Skip to content

[unic-pr-review] Remaining five aspect agents + conditional spawning #146

@orioltf

Description

@orioltf

Parent

docs/issues/unic-pr-review/PRD.md

What to build

Add the other five review aspect sub-agents (silent-failure-hunter, type-design-analyzer, pr-test-analyzer, comment-analyzer, code-simplifier) and grow changed-file-analyser.mjs into the full spawn-decision table so each agent only runs when the diff actually touches its concern.

Per ADR-0008: code-reviewer always runs; the others are conditional. Each agent has its own distinctive name + colour, embeds the same Confidence-Score rubric, and emits Findings with the same structured schema as #145.

Clean-slate doctrine. No prompt copying from pr-review-toolkit or apps/claude-code/pr-review/. Each agent's prompt is written fresh against the PRD's "review aspects" guidance.

Acceptance criteria

  • agents/silent-failure-hunter.md exists with distinct name + colour, looks for swallowed errors / inappropriate fallback / try-catch antipatterns; spawned when error-handling code changed.
  • agents/type-design-analyzer.md exists with distinct name + colour, looks for weakly-encapsulated types and missing invariants; spawned when type definitions changed.
  • agents/pr-test-analyzer.md exists with distinct name + colour, looks for test-coverage gaps and missing edge cases; spawned when test files changed.
  • agents/comment-analyzer.md exists with distinct name + colour, looks for comment rot / inaccurate docs / over-documentation; spawned when comments or docs changed.
  • agents/code-simplifier.md exists with distinct name + colour, looks for opportunities to reduce complexity; spawned when a complexity heuristic fires on any changed file.
  • scripts/lib/changed-file-analyser.mjs exports a pure function decideSpawnSet(changedFiles) → Set<string> returning agent names. Table-driven, classifies files by path/extension/diff content.
  • tests/changed-file-analyser.test.mjs covers each spawn predicate with at least one positive and one negative fixture.
  • A Pre-PR run on a mixed-content diff (code + tests + docs + types) spawns the expected subset of agents (verifiable by orchestrator log).
  • All six aspect agents are visually distinguishable in Claude Code's UI (US 44).
  • Cross-platform CI green.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew capabilityfeature/unic-pr-reviewIssues from the unic-pr-review featureready-for-agentFully specified, ready for an AFK agent

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions