autospec-review
Use when the user wants to audit design specs against open + closed issues to find gaps, file high-priority regression issues, and feed them back through autospec. Runs as `/autospec-review` (manual) or auto-fires after each autospec-run batch unless `~/.autospec/no-review.flag` exists.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- autospec-review
- description
- Use when the user wants to audit design specs against open + closed issues to find gaps, file high-priority regression issues, and feed them back through autospec. Runs as `/autospec-review` (manual) or auto-fires after each autospec-run batch unless `~/.autospec/no-review.flag` exists.
02 资源文件 12
- 参考文档codex/prompt.md16.1 KB
- 脚本install.sh11.1 KB
- 参考文档opencode/agent.md16.4 KB
- 参考文档README.md1.0 KB
- 参考文档references/.keep—
- 参考文档references/csv-schema.md2.7 KB
- 参考文档references/gap-taxonomy.md3.3 KB
- 参考文档references/reviewer-prompt.md2.7 KB
- 参考文档references/subagent-contract.md2.4 KB
- 其他templates/.keep—
- 其他templates/regression-spec.md.tmpl949 B
- 脚本uninstall.sh3.8 KB
03 SKILL.md 正文
<!-- BODY START -->
Self-update mode
Decide this purely from the request text the harness handed you. Do NOT
shell out to test the user's free-form request. Read the request, normalize
it in your reasoning (collapse whitespace, trim, lowercase), and if the result is
exactly update, this skill enters self-update mode and does NOT run the
normal pipeline.
- Detect harness by checking which install path exists for this skill:
- Claude Code:
~/.claude/skills/autospec-review/SKILL.md - OpenCode:
~/.config/opencode/agent/autospec-review.md - Codex CLI:
~/.codex/prompts/autospec-review.md
- Claude Code:
- Re-install from
mainby piping the canonical installer:
Run this one-liner once; it refreshes all autospec skills across all harnesses.curl -fsSL https://raw.githubusercontent.com/berlinguyinca/autospec/main/bootstrap.sh | bash -s -- --skill all --harness all --update - Show the diff between the prior installed file(s) and the freshly fetched copy.
Required capabilities & harness adapter
| Capability | Claude Code | OpenCode | Codex CLI | Fallback if missing |
|---|---|---|---|---|
| Subagent model tier | Tier A: opus + ultrathink |
Tier A: top-tier task + max reasoning |
Tier A: runtime/repository frontier model + reasoning_effort=high |
Fall back UP on unavailability |
| <!-- autospec-block:harness-adapter-core --> |
Model tier: TIER_B (implementation work) — cheaper model with medium thinking; resolved at startup. Silently fall back to TIER_A if unavailable.
Harness detection (run once at skill start, before Phase 0)
Detect your harness by checking available tools before any phase:
-
Claude Code — the
Agenttool with asubagent_typeparameter is available.TIER_A=opus+ultrathink(the alias, which resolves to the current Claude Opus generation)TIER_B=sonnet(the alias, which resolves to the current Claude Sonnet generation)
-
OpenCode — a
tasktool with model/tier configuration is available (nosubagent_type).TIER_A= top-tier task model + high reasoningTIER_B= smaller-tier task model + medium reasoning
-
Codex CLI — neither
Agentnor a configurabletasktool is available;apply_patchis the primary edit tool.TIER_A= current top GPT model +reasoning_effort=highTIER_B= the spark / cost-optimized variant of the configured model when one exists, else the configured model +reasoning_effort=medium
Fallback rule: If TIER_B is not available in your harness (model unknown, quota/capacity failure, authorization failure, or tool call returns an error for that model), silently retry the same subagent dispatch with TIER_A. Preserve the needed context with a bounded handoff; for Codex native subagents, use a fresh configurable independent agent and the runtime/repository frontier model instead of moving the work into the main/authoring session. When a role-specialized reviewer has a fixed unavailable model binding, the configurable fallback must receive the identical prompt, evidence, validation steps, and output schema. Record requested_model, actual_model, fallback_reason, and reviewed head SHA in an orchestrator-owned sidecar artifact so the reviewer verdict remains byte-exact. Never use a weaker model or self-review. If no equal-or-stronger independent reviewer can run, fail closed for merge/release decisions. Never ask the user.
Hold TIER_A and TIER_B for the entire skill run. Every "Tier A" and "Tier B" reference below resolves to these harness-specific values.
Relevant memory injection (run-start, once)
Before executing the main pipeline phases, call the injector to surface relevant saved lessons:
bash "${AUTOSPEC_SCRIPTS_DIR:-$HOME/.autospec/scripts}/inject-relevant-memory.sh" \
--context "<skill-relevant keywords from request/issue/spec>" \
--top-k 5
Prepend the output block (if non-empty) to your working context. This surfaces lessons like
feedback_bash_return_trap_leak.md that prevent re-occurrence of known pitfalls.
autospec-review
Audit design specs against open + closed issues, write gap rows to a
CSV ledger, and route regressions back through /autospec-split with
priority:high + regression labels.
When to invoke
- Manually as
/autospec-review [...flags]. - Automatically by
autospec-runafter the last issue in a batch closes — gated by~/.autospec/no-review.flagand the--no-postreviewflag.
CLI flags
| Flag | Effect |
|---|---|
--spec PATH |
Audit one spec only |
--profile NAME |
Model profile from ~/.autospec/model-profiles.yml |
--dry-run |
CSV + regression specs only; skip /autospec-split |
--no-autoreview |
Skip the §7a Tier-A reviewer pass |
--since DATE |
Only audit specs whose date prefix ≥ DATE |
--spec-glob PATTERN |
Override default spec discovery globs |
--remediation |
Broad-dimension review (spec-coverage + correctness + test-quality + integration-wiring + docs) with false-positive filter, for the end-of-run gap-remediation loop |
--emit-gaps PATH |
Write the machine-readable gap JSON to PATH (implies --remediation) |
--reasoning-trial |
In remediation mode, run candidate findings through the deterministic conjecture/falsifier trial before emitting gaps |
Remediation mode (--remediation / --emit-gaps)
The Phase 5.5 typed dispatcher passes this complete slash command as one
harness argument, so --remediation, --since, and --emit-gaps are not
mistaken for native harness options.
When --remediation (or --emit-gaps PATH) is passed, run a broad-dimension review instead of the spec-coverage-only audit, and emit a machine-readable gap list for the /autospec-run end-of-run gap-remediation loop.
Model tier: Tier A (spec work) — broad review is inline analysis and needs opus turn-stamina (per feedback_monitor_silent_exit.md).
Dimensions reviewed (all five, not just spec-coverage):
- spec-coverage — acceptance criteria with no shipping issue/PR (the existing audit).
- correctness — logic bugs, cross-platform shell portability (e.g. GNU-vs-BSD
grep/sed), off-by-one, error-path gaps. - test-quality — assertions that never fail, missing negative-path coverage, untested branches.
- integration-wiring — emitted-but-unconsumed artifacts, dangling references, lock-step drift.
- docs — stale or contradictory documentation versus shipped behavior.
Pipeline:
-
Dispatch the broad review subagent(s) at Tier A. Collect candidate findings, each tagged with
dimension,severity,file,line,title,body, and a stablededupe_key. -
False-positive filter (required before emit): pipe candidate findings through an evaluate-findings/critic pass. Mark each finding
verdict: keeporverdict: false_positive. When uncertain, drop it (false_positive) — never ship a false positive into the auto-implement queue. -
Reasoning trial (optional, high-uncertainty gate): when
--reasoning-trialis passed, or when the review is autonomous and the finding isreasoning:deep/priority:high, require each kept finding to carry a falsifier:{"falsifier":{"kind":"absent","needle":"expected-token","haystack":"repo-relative/path"}}Run the deterministic trial before emitting gaps:
python3 scripts/autospec_review_audit.py reasoning-trial \ --repo-root . \ --candidates /tmp/autospec-review/remediation-findings.json \ --out /tmp/autospec-review/remediation-findings-survived.json \ --report ".autospec/reasoning-trials/${RUN_ID}/summary.json" \ --events ".autospec/reasoning-trials/${RUN_ID}/events.jsonl"Use only the
--outsurvivors as the findings input foremit-gaps.sh. Treatrefutedfindings as false positives. Treatneeds_evidenceas not fileable yet; record them in the review report so the next audit can gather better proof. This gives the Phase 5.5 loop a replayable conjecture/falsifier trail without adding another LLM call. -
Write the surviving findings to a temp findings file, then shape them into the gap contract:
bash "${AUTOSPEC_SCRIPTS_DIR:-$HOME/.autospec/scripts}/emit-gaps.sh" \ --findings /tmp/autospec-review/remediation-findings.json \ --out "${EMIT_GAPS_PATH:-$HOME/.autospec/gaps-${RUN_ID}.json}"The emitted gap JSON is an array of objects matching the contract:
[{"gap_id":"G1","dimension":"correctness","severity":"medium", "file":"skills/autospec-shared/scripts/cross-repo-search.sh","line":77, "title":"trailing pipe matches every line on BSD grep", "body":"<remediation issue body>", "dedupe_key":"cross-repo-search-trailing-pipe"}] -
When
--emit-gaps PATHis given, write to PATH; otherwise default to~/.autospec/gaps-<run_id>.json. The driver (gap-remediation-loop.sh) reads this file. On review-subagent failure, write an empty array ([]) so the driver converges cleanly, and log a warning — never block run completion. -
Run the shared read-only repo quality audit and link its artifacts from the review report:
bash "${AUTOSPEC_SCRIPTS_DIR:-$HOME/.autospec/scripts}/repo-quality-audit.sh" \ --repo . \ --json ".autospec/repo-quality-audit.json" \ --markdown ".autospec/repo-quality-audit.md" \ ${AUTOSPEC_QUALITY_AUDIT_FILE_ISSUES:+--file-issues}Treat audit findings as a separate repo-wide quality signal, not as spec-coverage rows. Findings are already classified as
app-follow-up,autospec-process-gap,inherited-accepted-debt, orcurrent-branch-regression; preserve those classifications when filing or reporting follow-ups.
Phase 0 — Preflight
- Read repo state. Resolve
repofromgh repo view --json nameWithOwnerandshort_shafromgit rev-parse --short HEAD. - Compute
run_id = <UTC compact>-<short_sha>(delegate toscripts/autospec_review_audit.py). - Acquire
~/.autospec/review.lock(PID + start time). If lock exists and PID is alive AND start_time < 1h ago → exit with error "another autospec-review run in progress (PID X)". If stale → reclaim. - Ensure
reports/autospec-review/exists in target repo. - Compute
audit_date = today (yyyy-mm-dd).
Phase 1 — Spec discovery + linkage matrix (deterministic)
Invoke the helper script directly (no LLM):
python3 scripts/autospec_review_audit.py discover \
--repo-root . \
--since "${SINCE:-1900-01-01}" \
${SPEC_GLOB:+--glob "$SPEC_GLOB"} \
--out /tmp/autospec-review/specs.json
Then for each spec, build the linkage:
python3 scripts/autospec_review_audit.py link \
--repo "$REPO" \
--specs /tmp/autospec-review/specs.json \
--out /tmp/autospec-review/linkage.json
Output linkage.json is a list of:
{
"spec_path": "...", "spec_topic": "...", "spec_text": "...",
"linked_issues": [ ...gh issue records... ]
}
Phase 2 — Audit subagent fan-out (Tier A)
For each entry in linkage.json, dispatch one Tier-A subagent in
batches of ${AUTOSPEC_REVIEW_BATCH_SIZE:-5} (parallel within a batch,
serial across batches).
Model tier: Tier A (spec work) — top model + ultrathink.
Subagent prompt skeleton (verbatim, with input substitutions):
You are an autospec audit subagent. Read references/gap-taxonomy.md
and references/subagent-contract.md (loaded inline below). Apply the
taxonomy to the supplied spec + linked issues. Output JSON matching
the contract. Do not ship false positives — when uncertain, omit.
== gap-taxonomy.md ==
<verbatim contents>
== subagent-contract.md ==
<verbatim contents>
== input ==
<yaml block from §4 of the design spec>
For each subagent's JSON return:
python3 scripts/autospec_review_audit.py validate-subagent --input /tmp/.../subagent-NN.json --spec-path "..." --linked-numbers "1 2 3" --spec-text-file ...- On schema failure, retry the subagent ONCE with the validation error
prepended to the prompt. On second failure, write a fallback row
{gap_type: ac_no_issue, severity: blocker, title: "subagent schema failure", notes: <error>, ...}.
Phase 3 — CSV merge + per-run snapshot
Aggregate all subagent outputs into one rows list. For each gap:
- compute
gap_id = sha1(spec_path + spec_anchor + gap_type)[:10] - set
status = open,remediation_issue = "",remediation_pr = "" - copy
run_id,audit_date,repofrom preflight
Then:
python3 scripts/autospec_review_audit.py write-csv \
--rows /tmp/autospec-review/rows.json \
--snapshot reports/autospec-review/${AUDIT_DATE}-${RUN_ID}.csv \
--ledger reports/autospec-review/gaps.csv
The script writes the per-run snapshot (overwrite-on-same-run_id) and
merges into the ledger preserving manual wontfix / false_positive
edits.
Phase 4 — Render regression specs
Group rows by spec_path. For each group with ≥1 status=open row:
- Render
templates/regression-spec.md.tmplwith substitutions (audit_date,spec_path,run_id,spec_topic,parent_spec_summary(2-3 line auto-generated summary from spec_text headings), and the iteratedgaps). - Write to
docs/specs/${AUDIT_DATE}-${SPEC_TOPIC}-regressions.mdin the TARGET repo (NOT the autospec repo). - Do NOT commit yet — Phase 5 reviews and may modify.
Phase 5 — Reviewer subagent (§7a Tier A)
Skip if --no-autoreview was passed.
For each rendered regression spec, dispatch one Tier-A reviewer subagent.
Model tier: Tier A (spec work).
If the configured reviewer cannot run for a qualifying model-availability reason, apply the run-start fallback rule: use a fresh configurable Tier-A reviewer with the same prompt and JSON contract. This is an availability retry only; never replace or erase substantive reviewer findings.
Prompt: load references/reviewer-prompt.md verbatim and append
the input yaml block.
For each reviewer JSON return:
- For each
gap_idinfalse_positive_gap_ids:- Update CSV row:
status=false_positive, prependReviewer flagged: <reason>tonotes. - Strip the corresponding
### Gap <id>section from the regression spec.
- Update CSV row:
- For each
gap_idinscope_concern_gap_ids:- Prepend
Reviewer scope-concern: <reason>tonotes. Keepstatus=open.
- Prepend
- For each
ac_tighteningentry: replace the AC bullet in the regression spec body. - Append
reviewer_notes_mdunder a new heading### Reviewer notes (autospec-review §7a, Tier A, <run_id>).
After all reviewers finish:
git checkout -b "autospec-review/${RUN_ID}"
git add docs/specs/${AUDIT_DATE}-*-regressions.md
git commit -m "docs(autospec-review): regression specs from run ${RUN_ID}"
Phase 6 — /autospec-split handoff + post-process
Skip if --dry-run was passed.
For each regression spec file:
- Invoke
/autospec-split docs/specs/<file>and capture the issue numbers it returns (parse from gh output). - For each new issue number:
gh issue edit <num> --add-label priority:high --add-label regression --add-label <topic-label>gh issue edit <num> --title "[REGRESSION] $(gh issue view <num> --json title -q .title)"(idempotent — strip duplicate prefix first via shell prefix-test)gh issue comment <num> --body "Generated by autospec-review run ${RUN_ID}. See gap_id <id> in reports/autospec-review/gaps.csv."
- Update CSV rows: write
remediation_issue=#<num>, flipstatus=filed. Usepython3 scripts/autospec_review_audit.py update-status --gap-id <id> --status filed --issue <num>.
Finalization
- Append run summary to
reports/autospec-review/runs.md(newest first). - Print to console:
run_id, gaps by type, gaps by severity, regression issues filed, paths to per-run CSV + ledger. - If env
AUTOSPEC_REVIEW_NOTIFYset, POST the same summary as JSON to that webhook. - Release
~/.autospec/review.lock. <!-- BODY END -->
04 同仓库更多 Skills
trio-pass-skill
暂无简介
duo-pass-skill
暂无简介
duo-divergence-skill
暂无简介
autospec
Use when the user wants to ship a feature end-to-end across multiple commits — bootstraps repo if missing, brainstorms a design spec, decomposes into linked GitHub issues, or splits an existing spec into issues, then runs an autonomous implementation loop with auto-merge.
autospec-upgrade
Use when the user wants to upgrade an Angular, Next.js, or React project to the latest official versions safely — by locking observable behavior before touching versions, upgrading one major at a time with official codemods, and gating completion on mutation score rather than coverage theater.
autospec-ui-audit
Use when a React Router application needs a deterministic whole-site route inventory before UI, UX, navigation, or evidence auditing begins.