| name | reviewer:init |
| description | Inject reviewer-aligned rules into openspec/config.yaml so generated specs pass review on first attempt. Use to reduce review round-trips after /opsx:ff or spectra-propose. |
Init Reviewer Rules
Inject reviewer rules into your project's openspec/config.yaml so that specs generated by OpenSpec tooling satisfy the reviewer's criteria.
Usage
$init
$init --dry-run
$init --from-history
Process
- Determine the rules target:
openspec/config.yaml if present, else .claude/reviewer/rules.yaml.
If falling back to the portable target, confirmation of that target happens in the main
conversation (via AskUserQuestion) before dispatch — not inside the agent.
- Read the reviewer rules template
- Compare against existing rules (dedup by exact match)
- Append only new rules (or preview in dry-run mode)
- Report what was added
- With
--from-history: skip the static template — read the review findings history
(openspec/reviews/history.jsonl, else .claude/reviewer/history.jsonl), cluster
findings recurring across ≥2 changes into candidate rules, confirm each with the user
(AskUserQuestion, multiSelect), and pass only confirmed rules to the agent as the template.
Clustering and confirmation happen in the main conversation, NOT in the agent.
The same pass flags existing rules for retirement — candidates are rules whose finding
class never appears in history or that are superseded by a new candidate (never rules
that went quiet after injection: that silence means they work). Removals get a separate
AskUserQuestion and are applied with Edit in the main conversation; the injection agent
stays append-only.
Agent Dispatch
Use the companion init-reviewer.md in this directory as the agent prompt. The agent will cd to the git root automatically. Provide it with:
- Whether dry_run mode is enabled
- The full content of the reviewer rules template