Skip to content

refactor: rename agents to PascalCase + add swarm orchestration system#25

Closed
dean0x wants to merge 11 commits intomainfrom
refactor/rename-agents
Closed

refactor: rename agents to PascalCase + add swarm orchestration system#25
dean0x wants to merge 11 commits intomainfrom
refactor/rename-agents

Conversation

@dean0x
Copy link
Copy Markdown
Owner

@dean0x dean0x commented Dec 18, 2025

Summary

This PR includes two major changes:

1. Agent Naming Refactor

  • Renamed all 21 agent name: properties from kebab-case to PascalCase
  • Audit agents renamed from audit-X to XReview pattern (e.g., audit-securitySecurityReview)
  • Updated all command files and documentation to reference new names
  • Removed explicit tools: field from all agents (inherit all tools including MCP)

2. Swarm Orchestration System (NEW)

Introduces parallel task execution using git worktrees:

Components:

  • /swarm command - Entry point for parallel task execution
  • SwarmOrchestrator agent - Coordinates explore/plan/implement/review phases
  • Coder agent - Autonomous implementation in isolated worktrees
  • worktree skill - Git worktree management patterns

Workflow:

SETUP → EXPLORE → PLAN → ANALYZE → IMPLEMENT → REVIEW → MERGE → RELEASE
        (parallel) (parallel)        (parallel)  (parallel) (sequential)

Features:

  • True parallelism via git worktrees (no file conflicts)
  • Smart dependency detection from plans
  • Per-task PRs with correct merge ordering
  • Automatic cleanup of worktrees and branches

Changes

Agent Renames

Old Name New Name
audit-architecture ArchitectureReview
audit-security SecurityReview
audit-* *Review
catch-up CatchUp
code-review CodeReview
(all others) PascalCase

New Files

  • src/claude/agents/devflow/coder.md
  • src/claude/agents/devflow/swarm-orchestrator.md
  • src/claude/commands/devflow/swarm.md
  • src/claude/skills/devflow/worktree/SKILL.md

Modified Files

  • All 21 agent files (name + tools removal)
  • 9 command files (agent references)
  • CLAUDE.md, README.md (documentation)

Testing

  • Swarm workflow needs end-to-end testing
  • Agent renames verified in command files
  • Tools inheritance verified (no explicit tools field)

Notes

The swarm system is implemented as prompt templates (markdown) but not yet tested in a real workflow. This PR establishes the architecture; testing and refinement will follow.


🤖 Generated with Claude Code

Dean Sharon and others added 11 commits December 18, 2025 00:41
Update all 21 agent definition `name:` properties from kebab-case
to PascalCase for consistency with standard naming conventions.

Simple agents: commit -> Commit, debug -> Debug, etc.
Audit agents: audit-security -> SecurityReview, etc.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Update all 9 command files to reference agents using their new
PascalCase names (Commit, Debug, Brainstorm, etc.).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Update documentation to reflect new PascalCase agent names:
- CLAUDE.md: Agent persistence rules section
- README.md: Sub-agent table and examples
- src/claude/CLAUDE.md: Agent reference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Enable all 21 sub-agents to invoke skills during their execution.
This allows agents to leverage quality enforcement skills like
pattern-check, test-design, and code-smell during their work.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove tools: field from all 21 sub-agents to inherit all tools
from the main thread, including MCP tools.

Benefits:
- Agents automatically get MCP tools (Context7, Tavily, etc.)
- Zero maintenance when tools are added/removed
- Agent prompts already define correct behavior
- Future-proof as Claude Code evolves

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduces a complete swarm workflow for executing multiple tasks
in parallel using git worktrees:

Components:
- /swarm command: Entry point for parallel task execution
- SwarmOrchestrator agent: Coordinates explore/plan/implement/review phases
- Coder agent: Autonomous implementation in isolated worktrees
- worktree skill: Git worktree management patterns

Workflow:
1. SETUP: Create release branch, worktrees for each task
2. EXPLORE: Parallel codebase exploration (Explore agents)
3. PLAN: Parallel planning with dependency detection (Plan agents)
4. ANALYZE: Build conflict matrix, determine merge order
5. IMPLEMENT: Parallel coding in worktrees (Coder agents)
6. REVIEW: Parallel code review per PR
7. MERGE: Sequential merge in dependency order
8. RELEASE: Final PR to main

Features:
- True parallelism via git worktrees (no file conflicts)
- Smart dependency detection from plans
- Per-task PRs with correct merge ordering
- Automatic cleanup of worktrees and branches
- Failure handling with partial completion support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Major improvements to the code review workflow:

1. /code-review now ensures PR exists before reviewing:
   - Checks for uncommitted changes → spawns Commit agent
   - Checks if branch is pushed → pushes if needed
   - Checks for PR → spawns PullRequest agent if missing

2. All 9 review agents now create PR line comments directly:
   - SecurityReview, PerformanceReview, ArchitectureReview
   - TestsReview, ComplexityReview, DependenciesReview
   - DocumentationReview, TypescriptReview, DatabaseReview
   - Uses gh api to create line-specific comments
   - Tracks comments created vs skipped (lines not in diff)

3. PrComments agent simplified:
   - Now only handles skipped issues (lines not in diff)
   - Creates single summary comment for issues that couldn't
     get line comments

Benefits:
- Comments can be resolved/replied to in GitHub
- Direct feedback on specific lines of code
- Automated PR creation when missing
- Cleaner workflow: commit → push → PR → review

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move all orchestration logic from /code-review command to CodeReview agent:

- Command reduced from 422 lines (~2,700 tokens) to 33 lines (~150 tokens)
- Agent now handles full workflow: pre-flight, analysis, parallel audits,
  PR comments, summary generation, and tech debt tracking
- Smart audit selection: only runs relevant audits based on changed file types
- Pre-flight checks: ensures changes are committed, pushed, and PR exists

This significantly reduces token cost when invoking /code-review since the
command prompt is loaded into context, while agent prompts are isolated.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

Remove brainstorm command and agent - functionality merged into /design.

Redesign /design command to orchestrate Claude Code's built-in agents:
- Phase 1: 3 parallel Explore agents (architecture, integration, reuse)
- Phase 2: Synthesize findings, clarify with user via AskUserQuestion
- Phase 3: 2 Plan agents (generate plan, then review/refine)
- Phase 4: Merge plans, persist to .docs/design/

Benefits:
- Leverages optimized built-in agents instead of custom 770-line prompts
- Multi-agent exploration provides more thorough codebase analysis
- Dual planning with self-review catches issues before implementation
- User clarification ensures alignment on design decisions

Removed:
- src/claude/agents/devflow/brainstorm.md (279 lines)
- src/claude/agents/devflow/design.md (491 lines)
- src/claude/commands/devflow/brainstorm.md (69 lines)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Restore critical quality controls that were in the deleted agents:

Philosophy section:
- Never create generic plans
- Ground everything in actual code with file:line references
- Detailed enough for someone unfamiliar to execute
- Honest about trade-offs and risks

Evaluation priority:
1. Pattern alignment
2. Project philosophy (Result types, DI, immutability)
3. Minimal disruption
4. Testability
5. Maintainability
6. Performance

Enhanced agent prompts:
- Explorers must provide file:line proof for every claim
- Planner 1 must reference specific files, follow patterns exactly
- Planner 2 acts as skeptical reviewer, checks for common failures

Quality gates checklist:
- No generic steps, patterns verified, all integration points found
- Edge cases explicit, code reuse maximized, testing concrete
- Scope boundaries clear, risks surfaced

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reduce command from 326 to 87 lines while preserving quality controls.

Guardrails now embedded directly in agent prompts:
- Explorers: "Every claim needs file:line reference"
- Planner 1: "Every step references specific files"
- Planner 2: "Be harsh. Generic steps without file:line (REJECT)"

Removed verbose prose, kept essential structure:
- Phase 1: 3 parallel Explore agents
- Phase 2: User clarification via AskUserQuestion
- Phase 3: 2 sequential Plan agents (create + review)
- Phase 4: Persist to .docs/design/
- Quality gates checklist

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dean0x dean0x closed this Dec 18, 2025
@dean0x dean0x deleted the refactor/rename-agents branch December 18, 2025 22:09
dean0x pushed a commit that referenced this pull request Apr 16, 2026
Review walkthrough across 4 sessions resolved all 31 issues from the
2026-04-15_1022 code review (19 fixed, 5 rejected, 1 deferred, 6
pre-resolved).

Blocking fixes (sessions 1-2):
- CHANGELOG contradiction rewritten (#1)
- Worktree placeholder unified on "{worktree}" across 11 sites (#3)
- /debug migrated to index pattern (#4)
- KNOWLEDGE_CONTEXT quoting standardized, no inline fallback (#6)
- apply-knowledge skill defers to footer for paths (#7)
- Simplifier dropped from knowledge consumers; 4 agents canonicalized (#8)
- lstat+isFile guard on legacy-knowledge-purge unlink (#9)

Architecture + consistency fixes (session 2):
- Bare-form CLI removed, dispatch simplified to index-only (#10)
- code-review-teams template+table extraction (#12)
- Designer Apply Knowledge H2 added (#13)
- Teams phase numbering aligned (#14)
- loadKnowledgeContext + full subcommand removed entirely (#16)

Complexity + performance + testing + docs fixes (sessions 3-4):
- D-A filter extracted to isDeprecatedOrSuperseded predicate (#18)
- formatAdrLine/formatPfLine merged into formatEntryLine (#19)
- Shared test fixtures extracted to tests/knowledge/fixtures.ts (#21)
- Token claim "~250 tokens" dropped from 12 sites (#22)
- tmpdir cleanup added to test fixtures (#25)
- self-learning.md example and footer paths corrected (#28, #29)

28 files changed, 333 insertions, 524 deletions. 1021/1021 tests passing.
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