Skip to content

Improve AI development guidance - #21388

Merged
wborn merged 3 commits into
openhab:mainfrom
wborn:agent/improve-agents-development-guidance
Aug 14, 2026
Merged

Improve AI development guidance#21388
wborn merged 3 commits into
openhab:mainfrom
wborn:agent/improve-agents-development-guidance

Conversation

@wborn

@wborn wborn commented Aug 14, 2026

Copy link
Copy Markdown
Member

Description

This PR improves and expands the repository guidance for AI coding agents.

The existing AGENTS.md has been reworked to provide clearer, more actionable instructions while avoiding duplication of information that is already maintained in the repository documentation. It now focuses more strongly on openHAB-specific development practices and on preventing issues that are commonly caught during code review.

The guidance is based on:

  • existing openHAB contribution, development, coding, and review documentation;
  • established patterns and conventions in the openHAB codebase;
  • recurring issues identified while reviewing openHAB pull requests, particularly around lifecycle handling, concurrency, external APIs and protocols, compatibility, configuration, testing, comments, and unnecessary abstractions;
  • lessons from well-maintained AGENTS.md files in other projects, while keeping the instructions specific to openHAB.

Notable improvements include guidance for:

  • determining the intended behavior before implementing a change and keeping changes narrowly scoped;
  • reusing existing openHAB APIs and avoiding unnecessary abstractions or dependencies;
  • verifying assumptions about external APIs, protocols, libraries, and file formats against authoritative sources;
  • lifecycle, concurrency, asynchronous work, reconnection, cleanup, and runtime configuration changes;
  • OSGi Declarative Services and HTTP Whiteboard usage;
  • external data validation, protocol compatibility, caching, and error handling;
  • security and handling of sensitive data;
  • useful source-code comments and accurate documentation;
  • Maven dependency changes, including features.xml and *.bndrun implications;
  • generated files, formatting, Markdown linting, and commit conventions;
  • deterministic tests, integration tests, static analysis, and appropriate build validation;
  • Thing, Channel, and configuration metadata;
  • creating new bindings and preparing pull requests.

The document also points agents to the relevant README.md, CONTRIBUTING.md, openHAB developer documentation, coding guidelines, and review checklist instead of duplicating those sources.

Small CLAUDE.md and GEMINI.md compatibility files are added so Claude Code and Gemini Code Assist follow the same AGENTS.md guidance rather than maintaining separate copies of the instructions.

There are no runtime or add-on behavior changes in this PR.

@wborn
wborn force-pushed the agent/improve-agents-development-guidance branch 2 times, most recently from 1137839 to b467235 Compare August 14, 2026 13:02
@wborn wborn changed the title Improve AGENTS.md development guidance Improve AI development guidance Aug 14, 2026
Expand AGENTS.md with repository-specific guidance for design, lifecycle, OSGi, external data, security, testing, dependencies, formatting, and pull requests.
Add lightweight Claude and Gemini shims that delegate to AGENTS.md so the same instructions are reused across coding agents.

Signed-off-by: Wouter Born <github@maindrain.net>
@wborn
wborn force-pushed the agent/improve-agents-development-guidance branch from b467235 to a543111 Compare August 14, 2026 13:13
@wborn
wborn marked this pull request as ready for review August 14, 2026 13:35
@wborn
wborn requested a review from a team as a code owner August 14, 2026 13:35
@wborn
wborn requested a balanced review from Copilot August 14, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands repository-wide guidance for AI coding agents without changing runtime behavior.

Changes:

  • Reworks AGENTS.md with detailed development and review practices.
  • Adds Claude Code and Gemini Code Assist compatibility files.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
AGENTS.md Defines comprehensive repository guidance.
CLAUDE.md Imports the shared agent guidance.
GEMINI.md Directs Gemini to shared and scoped guidance.
Suppressed comments (3)

AGENTS.md:209

  • This bare URL violates the enabled MD034 Markdown lint rule. Use an autolink so this changed file passes the configuration referenced at line 182.
- Reference documentation: https://bnd.bndtools.org/chapters/825-instructions-ref.html

AGENTS.md:227

  • This bare URL violates the enabled MD034 Markdown lint rule. Use an autolink so this changed file passes the configuration referenced at line 182.
- Reference documentation: https://www.openhab.org/docs/developer/utils/i18n.html#managing-translations

AGENTS.md:296

  • This bare URL violates the enabled MD034 Markdown lint rule. Use an autolink so this changed file passes the configuration referenced at line 182.
- Read the binding development guide before creating a new binding: https://www.openhab.org/docs/developer/#develop-a-new-binding

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Signed-off-by: Wouter Born <github@maindrain.net>
@wborn
wborn requested a balanced review from Copilot August 14, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

AGENTS.md:299

  • The skeleton scripts resolve archetype-settings.xml and ../src/etc/NOTICE relative to the current working directory, so invoking them from the repository root fails. Specify that they must be run from bundles/ to make this instruction reliably actionable.
- Use the provided `create_openhab_binding_skeleton` script rather than creating the binding structure manually.

@lsiepel lsiepel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to adjust this.
Let's see how this improves the reviews and contributions. A first test seemed to improve the results. 👍

@wborn
wborn requested a balanced review from Copilot August 14, 2026 14:10
Signed-off-by: Wouter Born <github@maindrain.net>
@wborn
wborn force-pushed the agent/improve-agents-development-guidance branch from cf59fb7 to 4e005dd Compare August 14, 2026 14:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@wborn

wborn commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

Yes it would be nice to see how quickly the AIs pick up on this!
Retriggering Copilot on a few PRs might already show if it has learned some new tricks. 😉

@wborn
wborn merged commit 604f479 into openhab:main Aug 14, 2026
1 of 2 checks passed
@wborn
wborn deleted the agent/improve-agents-development-guidance branch August 14, 2026 14:34
@wborn

wborn commented Aug 15, 2026

Copy link
Copy Markdown
Member Author

These improvements helped with guiding my AI:
#21357 (review)

cipianpascu pushed a commit to cipianpascu/openhab-addons that referenced this pull request Aug 16, 2026
Expand AGENTS.md with repository-specific guidance for design, lifecycle, OSGi, external data, security, testing, dependencies, formatting, and pull requests.
Add lightweight Claude and Gemini shims that delegate to AGENTS.md so the same instructions are reused across coding agents.

Signed-off-by: Wouter Born <github@maindrain.net>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants