Skip to content

ADR-265: Make dev_team.py and dev-team.md work as a Claude Code plugin - #1

Merged
jodavis merged 6 commits into
mainfrom
dev/jodavis/ADR-265-plugin-portability
Jun 2, 2026
Merged

ADR-265: Make dev_team.py and dev-team.md work as a Claude Code plugin#1
jodavis merged 6 commits into
mainfrom
dev/jodavis/ADR-265-plugin-portability

Conversation

@jodavis-claude

Copy link
Copy Markdown
Collaborator

Work item

ADR-265 — Make the minimal code changes to dev_team.py and dev-team.md that allow the pipeline to run as a Claude Code plugin, then install the plugin and cut AdaptiveRemote over to it by deleting its per-repo .claude/ directories.

Changes

  • scripts/dev_team.py — Added import os; _find_repo_root() now walks up from os.getcwd() (instead of __file__) and checks for .git; added PLUGIN_ROOT global defaulting to the parent of __file__; call_agent() resolves agent/command paths via PLUGIN_ROOT; added --plugin-root CLI argument that overrides PLUGIN_ROOT at startup
  • commands/dev-team.md — Step 3 command now invokes ${CLAUDE_PLUGIN_ROOT}/scripts/dev_team.py and passes --plugin-root ${CLAUDE_PLUGIN_ROOT} so the plugin system substitutes the absolute install path before Claude acts on the command
  • .claude-plugin/plugin.json — Removed "commands": "commands" and "agents": "agents" path fields; per the Claude Code plugins reference these must start with ./, and since they pointed to the same default auto-discovered directories, removal is equivalent and simpler

Design decisions

  • _find_repo_root() uses os.getcwd() not __file__: When installed as a plugin, __file__ points into the plugin installation directory (~/.claude/plugins/dev-team/), not the consuming project. os.getcwd() is reliable because Claude Code invokes commands from the project root.
  • --plugin-root as a CLI argument, not an env var: Environment variable injection into Python subprocesses is not guaranteed in the plugin system. Passing ${CLAUDE_PLUGIN_ROOT} as a CLI argument via the command file is the reliable path.
  • plugin.json path fields removed rather than corrected to ./commands/./agents: Auto-discovery handles both directories with no manifest entry needed; explicit entries that mirror the defaults add noise without benefit.
  • run_validate_script() continues to use REPO_ROOT: Validation scripts live in the consuming project's scripts/ dir, not the plugin — this function correctly uses the cwd-based root, not PLUGIN_ROOT.
  • Log path unchanged: The spec prescribes a final log path of REPO_ROOT/.claude/dev-team/logs but that change is deferred to Task 8 (ADR-237) and is out of scope here.

ElwoodMoves and others added 4 commits June 1, 2026 15:12
- _find_repo_root() now walks up from os.getcwd() so it works when the
  script is installed in a plugin directory separate from the consuming repo
- PLUGIN_ROOT global resolves agents/ and commands/ from the plugin install
  dir; --plugin-root argument overrides it at runtime
- dev-team.md step 3 uses ${CLAUDE_PLUGIN_ROOT} substitution and passes
  --plugin-root so the script knows where its agents and commands live
- plugin.json: removed commands/agents path fields that had invalid format
  (paths must start with ./); auto-discovery handles the defaults correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@jodavis-claude jodavis-claude left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Test review body - verifying API works.

@jodavis-claude jodavis-claude left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Test with line-based comments.

Comment thread .claude-plugin/plugin.json

@jodavis-claude jodavis-claude left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review: ADR-265 Plugin Portability

Exit criteria verified:

  • OK _find_repo_root() walks up from os.getcwd() (line 786)
  • OK --plugin-root accepted and applied; PLUGIN_ROOT used for agent/command resolution in call_agent() (lines 1021-1022, 1240-1246)
  • OK dev-team.md step 3 invokes dev_team.py with ${CLAUDE_PLUGIN_ROOT} substitution and passes --plugin-root ${CLAUDE_PLUGIN_ROOT} (line 61)
  • NEEDS VERIFICATION plugin.json present but missing commands and agents fields -- see inline comment

Deferred (acknowledged in task brief, not blocking this PR):

  • Log path REPO_ROOT/.claude/logs/dev-team (line 1059) differs from spec REPO_ROOT/.claude/dev-team/logs -- explicitly deferred to Task 8 (ADR-237)
  • Manual installation, AdaptiveRemote cleanup, and end-to-end validation -- out of scope for code review

One Priority 1 issue requiring resolution before exit criterion 1 can be confirmed; one style note.

Comment thread .claude-plugin/plugin.json
Comment thread .gitignore Outdated
The prior implementation removed these fields on the assumption that
Claude Code auto-discovers commands/ and agents/ directories. The
reviewer correctly identified this as unverified against the plugins
reference. Explicit declaration guarantees the plugin system registers
the slash command and agent definitions regardless of auto-discovery
behaviour.
Fixes missing newline at end of file on the /.claude/logs line.

@jodavis-claude jodavis-claude left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sign-off review: all prior review threads are resolved and no new issues were found in the modified files.

Threads resolved:

  • plugin.json test comment on closing brace — resolved (no action needed; JSON is syntactically valid).
  • plugin.json missing commands and agents fields — resolved; commit 7a8c69f restores "commands": "./commands" and "agents": "./agents". Both directories exist with the expected files.
  • .gitignore missing trailing newline — resolved; commit 450afbd adds the trailing newline.

Modified files scanned (7a8c69f, 450afbd): .claude-plugin/plugin.json, .gitignore. No new Priority 1–4 issues introduced.

Sign-off outcome: Approved. All review threads resolved, no new blocking issues.

@jodavis-claude
jodavis-claude marked this pull request as ready for review June 1, 2026 23:04
@jodavis-claude
jodavis-claude requested a review from jodavis June 1, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants