Skip to content

feat: unified Reviewer architecture with self-review framework#29

Merged
dean0x merged 3 commits intomainfrom
feat/unified-reviewer-architecture
Jan 11, 2026
Merged

feat: unified Reviewer architecture with self-review framework#29
dean0x merged 3 commits intomainfrom
feat/unified-reviewer-architecture

Conversation

@dean0x
Copy link
Copy Markdown
Owner

@dean0x dean0x commented Jan 11, 2026

Summary

This PR implements Architecture v3 from Issue #28, fundamentally restructuring how code reviews work in DevFlow:

  • 11 → 1: Consolidate 11 individual review agents into a single parameterized Reviewer agent
  • Self-review: Add 9-pillar self-review framework to Coder agent via Stop hook
  • Pattern skills: Create 10 new pattern skills as shared knowledge libraries
  • DRY orchestration: /implement now calls /review instead of duplicating logic

Changes

New Pattern Skills (10 files)

Skill Focus Area Iron Law
devflow-architecture-patterns SOLID, coupling, layering VIOLATIONS IN YOUR CHANGES ARE BLOCKING
devflow-performance-patterns N+1, algorithms, memory, I/O MEASURE BEFORE OPTIMIZING
devflow-complexity-patterns Cyclomatic complexity, readability COMPLEXITY IS THE ENEMY OF RELIABILITY
devflow-consistency-patterns Pattern violations, simplification FOLLOW EXISTING PATTERNS
devflow-tests-patterns Coverage, quality, brittleness TESTS MUST VALIDATE BEHAVIOR NOT IMPLEMENTATION
devflow-database-patterns Schema, queries, migrations MIGRATIONS MUST BE REVERSIBLE
devflow-documentation-patterns Docs quality, alignment DOCS MUST MATCH CODE
devflow-dependencies-patterns CVEs, versions, licenses NO VULNERABLE DEPENDENCIES IN PRODUCTION
devflow-regression-patterns Lost functionality, broken behavior PRESERVE EXISTING FUNCTIONALITY
devflow-self-review 9-pillar framework FIX BEFORE RETURNING

Unified Reviewer Agent

Single agents/reviewer.md with all pattern skills loaded. Focus specified via prompt injection:

Task(subagent_type="Reviewer"):
"Review this code focusing exclusively on SECURITY.
Apply patterns from devflow-security-patterns skill.
Follow the 6-step process from devflow-review-methodology."

Coder Self-Review (Stop Hook)

hooks:
  Stop:
    - hooks:
        - type: prompt
          prompt: |
            Before completing, run self-review using devflow-self-review skill.
            Evaluate each of the 9 pillars in priority order (P0 -> P1 -> P2).
            FIX any P0 or P1 issues found - do not just report them.
            Only return when all P0 and P1 pillars PASS.

9 Pillars:

  • P0 (MUST pass): Design, Functionality, Security
  • P1 (SHOULD pass): Complexity, Error Handling, Tests
  • P2 (Fix if time): Naming, Consistency, Documentation

Removed

11 individual review agent files:

  • review-architecture.md, review-complexity.md, review-consistency.md
  • review-database.md, review-dependencies.md, review-documentation.md
  • review-performance.md, review-regression.md, review-security.md
  • review-tests.md, review-typescript.md

Architecture

/review (orchestrator)
├─ Spawns 7-11 Reviewer agents in parallel (different focus areas)
├─ Spawns Comment agent (PR inline comments)
├─ Spawns TechDebt agent (backlog tracking)
└─ Spawns Summary agent (merge recommendation)

/implement (orchestrator)
├─ Phase 1-5: Explore + Plan
├─ Phase 6: Coder agent (with self-review via Stop hook)
├─ Phase 7-8: Commit + PR
└─ Phase 9: Calls /review command (DRY)

Test Plan

  • Run /review on a branch with mixed file types
  • Verify Reviewer agents spawn with correct focus areas
  • Verify self-review triggers in Coder before completion
  • Verify pattern skills provide correct detection patterns
  • Verify /implement calls /review instead of duplicating

Closes #28

🤖 Generated with Claude Code

@dean0x dean0x force-pushed the feat/unified-reviewer-architecture branch from 7df1be4 to cbc383e Compare January 11, 2026 21:29
Comment thread agents/coder.md Outdated
Only return when all P0 and P1 pillars PASS.
If a P0 issue is unfixable (requires architectural change), STOP and report blocker.
Output: Summary of fixes made + final pillar status.
timeout: 120
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Is this enough? I think this should be much higher

Comment thread commands/review.md Outdated
**Always run**: SecurityReview, PerformanceReview, ArchitectureReview, ComplexityReview, ConsistencyReview, RegressionReview, TestsReview (7 agents)

**Conditionally run**: DependenciesReview, DocumentationReview, TypescriptReview, DatabaseReview
**Always run (7 focus areas):**
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

isn't the next few lines duplicate what we have in the table above?


---

## Integration
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This section seems irrelevant once the skill already loaded what am I missing?


---

## Integration
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This section seems irrelevant once the skill already loaded what am I missing?


---

## Integration
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This section seems irrelevant once the skill already loaded what am I missing?


---

## Integration
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This section seems irrelevant once the skill already loaded what am I missing?


---

## Integration
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This section seems irrelevant once the skill already loaded what am I missing?


---

## Integration
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This section seems irrelevant once the skill already loaded what am I missing?


---

## Integration
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This section seems irrelevant once the skill already loaded what am I missing?

@@ -370,7 +370,7 @@ Map findings to OWASP Top 10 2021:
## Integration
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This section seems irrelevant once the skill already loaded what am I missing?

Comment thread skills/devflow-tests-patterns/SKILL.md Outdated

---

## Integration
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This section seems irrelevant once the skill already loaded what am I missing?


---

## Integration
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This section seems irrelevant once the skill already loaded what am I missing?

@dean0x dean0x force-pushed the feat/unified-reviewer-architecture branch from cbc383e to 26c28ae Compare January 11, 2026 21:43
Replace 11 individual review agents with a single parameterized Reviewer agent
that receives focus area via prompt injection. Add 9-pillar self-review
framework to Coder agent via Stop hook.

## Changes

### New Pattern Skills (10 files)
- devflow-architecture-patterns: SOLID, coupling, layering
- devflow-performance-patterns: N+1, algorithms, memory, I/O
- devflow-complexity-patterns: Cyclomatic complexity, readability
- devflow-consistency-patterns: Pattern violations, simplification
- devflow-tests-patterns: Coverage, quality, brittleness
- devflow-database-patterns: Schema, queries, migrations
- devflow-documentation-patterns: Docs quality, alignment
- devflow-dependencies-patterns: CVEs, versions, licenses
- devflow-regression-patterns: Lost functionality, broken behavior
- devflow-self-review: 9-pillar framework (P0/P1/P2)

### Unified Reviewer Agent
- Single agent with all pattern skills loaded
- Focus specified via prompt injection
- Follows devflow-review-methodology 6-step process

### Coder Self-Review
- Stop hook triggers self-review before returning
- Must fix all P0 (Design, Functionality, Security) issues
- Must fix all P1 (Complexity, Error Handling, Tests) issues
- Only returns when all P0/P1 pillars PASS

### Command Updates
- /review: Spawns Reviewer with different focus areas
- /implement: Calls /review command (DRY)

### Removed
- 11 individual review-*.md agent files

Closes #28

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

Co-Authored-By: Claude <noreply@anthropic.com>
@dean0x dean0x force-pushed the feat/unified-reviewer-architecture branch from 26c28ae to 113fa9d Compare January 11, 2026 21:44
Dean Sharon and others added 2 commits January 11, 2026 21:46
Updates DEVFLOW_SKILLS in init.ts to include all 25 skills:
- Added devflow-self-review
- Added 10 review pattern skills (architecture, complexity, consistency,
  database, dependencies, documentation, performance, regression,
  security, tests)

This is cosmetic only - installation already works correctly since
it copies entire directories.

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

Co-Authored-By: Claude <noreply@anthropic.com>
The uninstall command's skill cleanup list was missing 10 pattern
skills added in Architecture v3. This would leave orphaned skills
after uninstalling DevFlow:

- devflow-self-review
- devflow-architecture-patterns
- devflow-complexity-patterns
- devflow-consistency-patterns
- devflow-database-patterns
- devflow-dependencies-patterns
- devflow-documentation-patterns
- devflow-performance-patterns
- devflow-regression-patterns
- devflow-security-patterns
- devflow-tests-patterns

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

Co-Authored-By: Claude <noreply@anthropic.com>
@dean0x dean0x merged commit e058809 into main Jan 11, 2026
@dean0x dean0x deleted the feat/unified-reviewer-architecture branch January 11, 2026 21:55
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.

feat: Architecture v3 - Unified Reviewer, Self-Review Framework, Agent Hooks

1 participant