Skip to content

Add implementation polish agent#80

Merged
leeovery merged 10 commits intomainfrom
feature/implementation-polish-agent
Feb 5, 2026
Merged

Add implementation polish agent#80
leeovery merged 10 commits intomainfrom
feature/implementation-polish-agent

Conversation

@leeovery
Copy link
Copy Markdown
Owner

@leeovery leeovery commented Feb 4, 2026

Summary

  • Adds a new implementation polish agent (agents/implementation-polish.md) that performs holistic quality analysis after all tasks complete — catching cross-task issues like DRY violations, naming drift, integration gaps, and missing integration tests
  • The polish agent orchestrates fixes through the existing executor and reviewer agents (no direct code changes), enforcing a minimum of 2 discovery-fix cycles with hybrid fixed + dynamic analysis passes
  • Inserts a new Step 6 (Polish) into the implementation skill with git checkpoint, user approval gate (y/skip/comment), and safe discard via working tree reset
  • Adds invoke-polish.md invocation contract following the same pattern as invoke-executor and invoke-reviewer

Test plan

  • Verify agents/implementation-polish.md follows existing agent conventions (frontmatter, tools, model, hard rules, structured output)
  • Verify invoke-polish.md follows the same pattern as invoke-executor.md and invoke-reviewer.md
  • Verify SKILL.md Step 6 flow: early exit skips polish, git checkpoint before invocation, report presentation, y/skip/comment routing
  • Verify old Step 6 correctly renumbered to Step 7
  • Verify task-loop.md "Return to skill for Step 6" references now correctly point to the polish step
  • Verify the skip path safely discards only polish changes via checkpoint reset
  • Verify the comment re-invocation path does not re-checkpoint

🤖 Generated with Claude Code

leeovery and others added 10 commits February 4, 2026 21:19
Introduces a polish step (Step 6) that runs after all tasks complete,
performing multi-pass analysis to catch cross-task issues (DRY violations,
naming drift, integration gaps) and orchestrating fixes via the existing
executor and reviewer agents.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace brittle git diff command with natural language intent for
  identifying implementation scope
- Flesh out fixed analysis passes — each sub-agent now receives file
  list and detailed analysis criteria, with structured findings expected
- Move test rules into fix cycle as pass-through to executor/reviewer
  rather than standalone section (polish agent doesn't write code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… subagent_type

The claude-technical-workflows: prefix is a marketplace namespace only available
when the package is installed. Match existing convention from invoke-executor.md
and invoke-reviewer.md: reference agents by name and .claude/agents/ path.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The polish agent needs to know HOW to read tasks from the plan — plans
may be stored in external tools (e.g. Linear) where simply reading the
file is insufficient. Pass the format's reading.md adapter so the agent
can retrieve the full task landscape regardless of storage format.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace numbered list with lettered stages (A-D) matching task-loop
conventions. Add STOP gates after executor and reviewer invocations,
explicit routing on STATUS/VERDICT, and clear sequential flow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace explanatory prose + separate sections with sequential Steps
(1-4) and lettered stages (A-F) within the discovery-fix loop. STOP
gates after every agent dispatch, explicit routing on STATUS/VERDICT,
inline analysis criteria at point of use. Matches task-loop and
SKILL.md conventions — deterministic orchestration with creativity
scoped to analysis sub-agents only.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Plans implement specific features within a larger system. Polish must
stay within the plan's boundary — don't flag missing features that
belong to other plans (e.g., "lacks authentication" when auth is a
separate plan). Look inward at what this plan built, not outward at
what the broader system might be missing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add stage A (Cycle Gate) as the loop entry point with inline cycle
  count logic — increment, check exit conditions, route to B or Step 4
- Fix stage C (Dynamic Analysis) — check if needed BEFORE dispatching,
  not after the STOP gate
- Renumber stages A-G with G always returning to A (proper loop)
- All routing now flows correctly: gate → dispatch → synthesize → fix → complete → gate

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Syncs flowchart data with recent changes:

- Add implementation-polish agent (flowchart, sidebar, desc, source map)
- Update skill-implementation:
  - Add fix_gate_mode routing in Review Changes
  - Add Step 6 Polish (checkpoint → polish agent → approval gate)
  - Task loop now exits to polish, not directly to completion
- Update implementation-task-reviewer:
  - 6 dimensions (added codebase cohesion)
  - Fix recommendations (FIX/ALTERNATIVE/CONFIDENCE)
  - Add read-context step in flowchart
- Update descriptions for skill-implementation and reviewer

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@leeovery leeovery merged commit 732e8a9 into main Feb 5, 2026
@leeovery leeovery deleted the feature/implementation-polish-agent branch February 5, 2026 12:56
leeovery added a commit that referenced this pull request Feb 6, 2026
…itions)

V3's integration context created a "convention gravity well" where early
design choices got documented as established patterns and later tasks
faithfully propagated them. V2 without this mechanism won 21/23 tasks.

Removes: integration context file accumulation, plan file access for
executor, expanded exploration instructions, codebase cohesion review
dimension, Convention Consistency quality section.

Keeps: fix recommendations (PR #78), fix_gate_mode (PR #78), full
re-attempt context (PR #77), polish agent (PR #80).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant