Skip to content

fix(agents): delegate code-reviewer persona to code-review-and-quality skill - #427

Open
BryanDhaniel wants to merge 3 commits into
addyosmani:mainfrom
BryanDhaniel:fix/code-reviewer-delegate-to-skill
Open

BryanDhaniel wants to merge 3 commits into
addyosmani:mainfrom
BryanDhaniel:fix/code-reviewer-delegate-to-skill

Conversation

@BryanDhaniel

Copy link
Copy Markdown

Fixes #172

agents/code-reviewer.md inlined the full five-axis review framework
instead of referencing skills/code-review-and-quality/SKILL.md, which
already documents the same framework in more detail. This duplicated
content that would drift out of sync as the skill evolves — something
CONTRIBUTING.md explicitly warns against.

The persona now loads the skill for the review framework and keeps
only what's specific to the persona: role, output format, and
composition rules.

No eval changes needed — this is a persona edit, not a new/modified skill.

@addyosmani addyosmani left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I like the instinct here. We do say "don't duplicate content between skills, reference and link instead," and the persona was carrying a near-verbatim copy of the five axes that live in code-review-and-quality. I checked and the skill genuinely is the fuller source (the five axes plus the approval standard), so pointing at it isn't losing anything for someone reading this inside the repo.

The problem is where these persona files actually get used. docs/copilot-setup.md tells people to cp agents/code-reviewer.md .github/agents/code-reviewer.agent.md, and docs/gemini-cli-setup.md says to copy this file's content into other tools. In every one of those flows the persona travels alone, and ../skills/code-review-and-quality/SKILL.md resolves to nothing on the other side. So this trades duplication for a broken link in the persona's main distribution mode. That is the same portability tradeoff we're already tracking in #361, and for a file whose job is to be copied out, self-containment wins over DRY.

So I don't want to take this as-is. If you want to kill the duplication, the persona needs to stay usable standalone, which probably means inlining a compact version of the axes here with a "canonical source: code-review-and-quality" pointer for in-repo readers, rather than replacing the content with a link. Happy to look again if you reshape it that way. Thanks for spotting the duplication, the underlying observation is correct.

…-out

Pure link-delegation broke when this persona is copied out standalone
(docs/copilot-setup.md, docs/gemini-cli-setup.md both distribute this
file alone into other tools' directories), where the relative link to
skills/code-review-and-quality/SKILL.md resolves to nothing.

Inline a compact version of the five axes instead, with a canonical-source
pointer for in-repo readers. Still nearly halves the original duplication
(97 -> 74 lines) while keeping the persona usable on its own.
@BryanDhaniel

Copy link
Copy Markdown
Author

I hadn't considered that this persona file gets copied out standalone into other tools (per docs/copilot-setup.md / docs/gemini-cli-setup.md), so a pure link would break outside this repo. Updated to inline a compact version of the five axes, with a canonical-source pointer back to code-review-and-quality for anyone reading this in-repo.

Worth flagging honestly: this cuts the duplication but doesn't fully eliminate it, the axis descriptions are still hand-maintained in two places, just more concisely now. A complete fix would probably mean generating this section from the skill rather than hand-syncing it, but that felt like a bigger change than this issue called for. Let me know if this looks right.

@federicobartoli federicobartoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @BryanDhaniel ! The compact-summary direction is right and the approval standard matches the skill's wording. One required change: the canonical-source pointer must survive standalone copies (GitHub URL instead of the relative link, and drop the "if you have access to this repo" conditional , see line comment), otherwise this reintroduces the exact portability problem the second commit set out to fix. Plus three small wording nits inline. Request changes and thanks again ! Happy to approve right after.

Comment thread agents/code-reviewer.md Resolved
Comment thread agents/code-reviewer.md Resolved
Comment thread agents/code-reviewer.md Resolved
Comment thread agents/code-reviewer.md Resolved
… dropped criteria

- Relative link broke for standalone copies, same problem the previous
  commit tried to fix. Use an absolute GitHub URL instead.
- Restore 'no circular dependencies' (Architecture) and 'no known
  vulnerabilities' (Security) that got dropped when compressing.
- Match 'dimensions' wording used by this file's own frontmatter and
  by SKILL.md, instead of 'axes'.

@federicobartoli federicobartoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

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.

Persona/skill duplication: code-reviewer.md inlines the 5-axis framework instead of delegating to code-review-and-quality skill

3 participants