with one click
enrich-and-review
Run enrichment pipeline on chunk directories
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Run enrichment pipeline on chunk directories
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Rotational arch audit — scores systems, audits top-priority, packages spinoff candidates. Never edits code; updates Last-targeted-audit clock.
Use for new feature requests, vague/ambiguous requirements, or multi-subsystem decomposition before plan mode.
Systematic codebase bug hunt — find and fix all AI-fixable bugs in-session, defer blocked ones to backlog
Night-shift code health review — queries completion entries for today's surfaces, dispatches reviewer, applies findings, updates health tracking.
Run a Codex code review as a second-opinion gate. Returns structured result with findings or graceful skip. Used by /bug-sweep --codex-verify and /workweek-complete Step 7.4.
Cleans up branch sprawl. Triggers: consolidate branches, clean up branches, stale branches, merge all branches.
| name | enrich-and-review |
| description | Run enrichment pipeline on chunk directories |
| allowed-tools | ["Read","Grep","Glob","Bash","Agent"] |
| argument-hint | [stub-ids|directory-path|'all'] |
Run the enrichment-review pipeline on a chunk directory, dispatching Sonnet enricher agents and Opus reviewers sequentially.
Project-rag is project-scoped. It indexes ONE specific codebase, configured at install time. Before reaching for mcp__*project-rag* tools, confirm they index the codebase you're investigating — not a different project on the same machine. If your target codebase doesn't have a project-rag index (no Saved/ProjectRag/ marker at its root, no --project-root argument pointing at it in the MCP config), skip this preamble entirely and use grep/Explore.
If MCP tools matching mcp__*project-rag* are available AND they index the codebase you're investigating, prefer them over grep/Explore for any code-shaped lookup. Symbol-shaped questions ("where is X defined", "find the function that does Y") → project_cpp_symbol / project_semantic_search. Subsystem-shaped questions ("how does X work") → project_subsystem_profile. Impact questions ("what breaks if I change X") → project_referencers with depth=2. Stale RAG still beats grep on structure. Fall through to grep/Explore only if RAG returns nothing AND staleness is plausible.
When invoked, run the full enrichment pipeline on a chunk directory containing plan stubs.
If $ARGUMENTS is provided, use it to scope the work:
--reviewers "name1,name2" → explicit reviewer override (e.g., --reviewers "sid,the Staff Engineer"). When provided, this replaces routing table auto-detection in Phase 5. Reviewers are dispatched in the order listed — first is domain pass, second is architectural/generalist pass. This is the mechanism for PM-directed dual-review setups.Before enriching anything, verify the source plan has been reviewed:
**Review:** line/staff-session --mode plan)/review first, or confirm PM override to skip."This prevents wasting enrichment cycles on a plan with structural problems.
Before parallel dispatch, check whether stubs share files:
Before dispatching any enrichers, mark every stub that is about to be enriched:
This ensures that if the session crashes mid-enrichment, the tracker shows "in progress" rather than misleading "pending." The enricher agents will also mark their individual stub documents (per the enricher's write-ahead protocol), creating two layers of breadcrumbs.
Optional: Task-scoped repo map. Before dispatching enrichers, consider whether the stub's file scope is clear enough to benefit from a focused map. If so, gate via check-rag-state.sh and generate via generate-repomap.sh. Full gating doctrine: docs/wiki/repomap-rag-gating.md.
RAG_STATE=$(bash "${CLAUDE_PLUGIN_ROOT}/bin/check-rag-state.sh" 2>/dev/null || echo "unknown")
if [ "$RAG_STATE" != "fresh" ]; then
bash "${CLAUDE_PLUGIN_ROOT}/bin/generate-repomap.sh" \
--project-root <project> --task "<stub summary>" --focus-files "<key files from stub>"
fi
Pass the task-scoped map path to the enricher in its dispatch prompt. This is awareness-based — use judgment, not every dispatch needs it.
Enricher pre-pass discovery. Scan all enabled plugins for root-level enricher-pre-pass.md files. These are instructions that run in the EM's context (with full tool access — MCP, Agent dispatch, etc.) to gather information the enricher cannot access with its own tools. For example, a UE plugin might inspect live Blueprint property surfaces via MCP, since the enricher can only read source files.
If pre-pass fragments are found:
If no pre-pass fragments are found, skip this step — it's an optional extension point.
Enricher-survey fragment discovery. Before dispatching, scan all enabled plugins for root-level enricher-survey.md files (analogous to routing fragment discovery in /review and /review-code). If a matching fragment exists for the project's project_type:
This is how domain-specific survey knowledge (e.g., UE project structure scanning) reaches the enricher without polluting the coordinator-core agent spec.
For independent stubs — dispatch Sonnet enricher agents in parallel:
Task tool with subagent_type: "enricher", model: "sonnet", and run_in_background: trueFor dependent stubs — dispatch sequentially, waiting for each to complete before starting the next.
For manual stubs — report them to the PM/Coordinator as requiring human action.
After all enrichers complete:
NEEDS_COORDINATOR: flagsBefore dispatching reviewers, update status to reflect the transition:
Determine which reviewers to summon and dispatch them sequentially.
Reviewer selection — two modes:
--reviewers provided): Use the specified reviewers in order. First name is Reviewer 1 (domain), second is Reviewer 2 (generalist/architectural). Look up each reviewer's agent type and model from the composite routing table.routing.md, scan all enabled plugins for root-level routing.md fragments, merge, and match.Persist reviewer findings — snippet-append, no EM pre-scaffold. Append the contents of snippets/findings-self-persist-sentinel.md verbatim to each reviewer's dispatch brief. The reviewer scaffolds its own sidecar in state/review-trail/findings/ and returns DONE: <sidecar-path> | verdict: <OK|WARN|BLOCKED> | findings: <N>. EM reads the returned path and passes it to the integrator. There is no EM pre-scaffold (coordinator-doc-new --type review is not called), no injected docs/plans/<stem>.review.md path, no cs_write_review_claim, and no EM-persists-inline fallback. Spec backlink: cross-repo/inbox/2026-07-01-reviewer-selfpersist-confinement-redirect.md.
Sequential dispatch with fix-application gate:
snippets/findings-self-persist-sentinel.md to the brief. The reviewer self-persists to state/review-trail/findings/ and returns DONE: <sidecar-path>.snippets/findings-self-persist-sentinel.md to the brief. Each reviewer self-persists to its own sidecar — no path injection from Reviewer 1 is needed. They should see fresh, clean work, not work with known bugs stapled on.Single-reviewer case: If only one reviewer is selected (by routing or by --reviewers "name"), skip steps 4-5. The fix-application rule (step 3) still applies — all feedback is incorporated before marking review complete.
Decision protocol for conflicting feedback:
Report the final state:
docs/wiki/delegate-execution.md)