rr-spec
Turn a rough idea into one file, docs/sdlc/specs/<slug>.md — an `## Intent` section (problem, outcome, affected users and systems, constraints, decisions taken) from a short one-question-at-a-time brainstorm recorded through state.py, then requirements and design from the architect agent on the STRONG tier, checked against the project's constitution, instruction files, skills and ADRs, ending with explicitly flagged concerns (especially contradicting policies). Accepts an existing docs/sdlc/intent/<slug>.md instead of the brainstorm. Use when starting a feature, "write the spec", "let's define what we want", "design this", before any plan or code.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- rr-spec
- description
- Turn a rough idea into one file, docs/sdlc/specs/<slug>.md — an `## Intent` section (problem, outcome, affected users and systems, constraints, decisions taken) from a short one-question-at-a-time brainstorm recorded through state.py, then requirements and design from the architect agent on the STRONG tier, checked against the project's constitution, instruction files, skills and ADRs, ending with explicitly flagged concerns (especially contradicting policies). Accepts an existing docs/sdlc/intent/<slug>.md instead of the brainstorm. Use when starting a feature, "write the spec", "let's define what we want", "design this", before any plan or code.
- argument-hint
- <topic or one-line idea> | <path to docs/sdlc/intent/<slug>.md>
03 SKILL.md 正文
/rr-spec $ARGUMENTS
Output: docs/sdlc/specs/<slug>.md, one file that says what and why
(## Intent) and then how (requirements, design, interfaces, concerns).
Nothing here edits code. Resolve the install root once:
for AI_HOME in "${CLAUDE_CONFIG_DIR:-$HOME/.claude}" "${CODEX_HOME:-$HOME/.codex}"; do
[ -d "$AI_HOME/skills/rr-spec" ] && break
done
STATE="python3 $AI_HOME/skills/ai-task/state.py"
1. Prerequisites
docs/sdlc/constitution.md exists, else run /rr-setup first. The template is
docs/sdlc/specs/TEMPLATE.md when the project overrides it, else
$AI_HOME/skills/project-init/templates/spec.md. Derive
<slug> from the topic (kebab-case, at most five words). If
docs/sdlc/specs/<slug>.md exists, offer to refine it instead of starting over.
When $ARGUMENTS is a path to an intent file, read it fully — it is small by
design — and skip to step 3 with it as the intent.
2. Brainstorm, on the record
Every question to the human goes through state.py, so the brainstorm survives
a compaction, a /clear and a change of runtime. Topic questions live in
docs/sdlc/intent/<slug>.questions.md — with or without .ai/ — and block
nothing:
$STATE ask --topic <slug> "<one line>" --option "A: <text>" --option "B: <text>" --recommend A
$STATE answer --topic <slug> Q1=B # or --prose "1B", or Q1=X:"free text"
If superpowers:brainstorming is available, let it drive the conversation; the
questions and answers still go through ask and answer. Otherwise:
- one question per turn, multiple choice where possible (two to six options,
A first; never write "(recommended)" into an option — that is
--recommend); - in order: the problem and its evidence → the observable outcome → who and what is affected → constraints and non-goals → what is still unknown;
- look at the code (
grep -n, bounded reads) before asking what it answers; - stop when each part of the intent can be filled with something concrete — five to eight questions is typical.
Never hand-edit the questions file; a human may fill an [Answer]: line
themselves, and the file is the record.
3. Policies the spec must honour
docs/sdlc/constitution.md, this project's principlesC1…C<n>: cite the ones a decision rests on. If it is absent, say so in one line and go on.- The repo-root instruction files (
CLAUDE.md,AGENTS.md— when both exist, note any disagreement as a concern) and the global one of this runtime. - Project skills and agents: only their
description:lines (grep -n '^description:'), opening one only when it applies. docs/sdlc/adr/*.md: accepted decisions are binding; note their numbers.- Plugin skills whose description matches the stack.
4. Design
Delegate to architect on the STRONG tier
(model: $($STATE profile --tier STRONG) under Claude Code; under Codex the
agent file's model is the tier). Give it the intent, the policy list, and ask for
Requirements (numbered, testable, each naming the outcome it satisfies), Design
(components, data flow, at least two alternatives rejected), Interfaces (exact
shapes) and Risks. It writes no code. Only an EXPERT trigger from
<home>/riskrails/routing.md — an irreversible data-model or API
decision — moves this to the top tier.
5. Write
Copy the template (§1) to docs/sdlc/specs/<slug>.md, creating the folder, replace
{{TITLE}} and {{SLUG}}. Replace the template's Intent: line with:
## Intent
Problem · Outcome (testable: "a user can …", "p95 < …") · Affected users and
systems · Constraints and non-goals · Open questions ((blocking) where they block
the plan)
### Decisions taken
— or, when an intent file was given, keep the line pointing at it. Fill
### Decisions taken from docs/sdlc/intent/<slug>.questions.md: each answered
question with the option chosen, in the order asked. It stops the plan from
reopening a settled question. Then fill every template section from the
architect's output and your policy pass, listing each policy in Policy
conformance with one line on how the design honours it.
Flagged concerns is mandatory and last: policy against policy, policy
against intent, requirements that cannot be met, assumptions the intent left
open, security and data-protection questions. Write none only when the list is
genuinely empty, and say why. Contradictions are never resolved silently.
6. Confirm and hand off
Show Flagged concerns first, then the rest; take one round of corrections.
Suggest git add docs/sdlc/specs/<slug>.md docs/sdlc/intent/<slug>.questions.md
and a commit spec: <title> — the questions file is the evidence behind the
decisions. Next: /rr-plan docs/sdlc/specs/<slug>.md.
04 同仓库更多 Skills
sylius-fixtures
Load the Sylius fixture suite into the local database
deploy-staging
Deploy the current branch to staging and smoke-test the checkout. Use on "deploy to staging".
rr-status
暂无简介
rr-ship
Close the task — state.py close measures the two facts (a green whole-suite verify on the tree as it is now; every changed file inside the task's files), applies the mode table and either archives the task or, in full mode, requests the human's approval and prints the exact approve command for their own terminal. Writes the commit message body and suggests the commit; never merges or deploys, and commits, pushes or approves only as the command the human picked in the dialog, verbatim, once. Use on "/rr-ship", "close the task", "ship it", "ready for approval", after /rr-build or /rr-review.
rr-setup
暂无简介
rr-review
One adversarial review of the task's change, at the tier its mode sets — BALANCED in guarded, STRONG in full, security-focused when the domain axis is 2, and in light only when close reports a red fact. A fresh ai-reviewer reads the diff with bounded inputs, returns FINDINGS and a VERDICT, and state.py records them; in-scope BLOCKER and HIGH findings are fixed as one batch, closed by a green verify or one scoped re-review. The pass past the budget is the human's. Use on "/rr-review", "review this", after /rr-build in guarded or full mode, or when close says a review is required.