AGENT SKILL

rr-build

暂无简介

License 许可
MIT
最近更新
2026-11-14
Stars
★ 3
Forks
0

03 SKILL.md 正文

/rr-build $ARGUMENTS

You implement, in this session, and keep your own context small. The same under Claude Code and Codex; resolve the install root once:

for AI_HOME in "${CLAUDE_CONFIG_DIR:-$HOME/.claude}" "${CODEX_HOME:-$HOME/.codex}"; do
  [ -d "$AI_HOME/skills/rr-build" ] && break
done
STATE="python3 $AI_HOME/skills/ai-task/state.py"

Shared policies resolve through "$AI_HOME/riskrails/ai-path" <path>: a project file at the same path under .ai/ wins. Read policies/safety.md and using-riskrails.md once per session.

1. Resume or start

$STATE handoff --print
  • No task in flight: run /rr-plan $ARGUMENTS — it weighs the task, picks the mode, shapes the plan and calls start. Come back here after it. (The message may point at the old init command: it starts an old-surface task.)
  • $STATE status prints old surface: the task was started before this plugin; the new commands refuse it and this skill cannot finish it. Say so and let the human decide whether to finish it with the version that started it, or to drop it.
  • A task in flight: the handoff is the cheapest way back in — mode, step, files, decisions, pending questions, the resume point, in at most thirty lines. Trust it over a compaction summary; it is rendered from the state. If $ARGUMENTS asks for something else, say what is in flight and ask whether to finish it, or drop it with $STATE close --abandon. Never discard it silently. A handoff line Batch: on means the task runs the loop of /rr-build-all — parallel implementers and fixers, its own budgets — continue there.
  • Handed to <the other runtime>: every state change exits 7 until that runtime resumes it. Say where to resume; take it back with $STATE handoff --to <this runtime> only when asked. Handed to <this runtime>: resume at its resume point.

$STATE status prints the same in twenty lines whenever you need it.

2. Edit, inside the task

Before the first edit, recall what the record already holds about the task's files — open risks, residual findings, decisions and why, within a token budget, read-only: $STATE recall --files "<the task's files>" (memory show <id> for one task in full).

Implement it yourself. The scope guard refuses an edit to a file the task does not name. That refusal is the plan being enforced, not an obstacle:

SCOPE_CHANGE_REQUIRED — say which file and why, then widen the task in place:
$STATE start --amend --files "+<path>" --why "<why the task needs it>"

The amendment is journaled; the task is not re-planned. A file that belongs to a different change is not amended in — it is recorded with $STATE memory risk add --title … --where "file:line" --label RISK --what … (in files mode that writes .ai/project/known-risks.md) and left for its own task.

Production behaviour is the source of truth: code that looks wrong may be load-bearing. Change only what the task asked for; a refactoring never rides along with a feature (workflows.md#refactoring).

3. Each step's own tests

After each piece of work run only its own tests, to the end, and fix their failures there:

$STATE verify --scope step --files "<its tests>"

Never the full suite mid-edit, never e2e. A bugfix shows its test failing before the fix (C2):

$STATE verify --scope step --files "<the new test>" --expect fail   # must bite

expected fail: … it bites is the proof; "does not bite yet" means the test does not reproduce the bug — fix the test, not the code.

A task with steps (guarded or full, from the plan) closes each one:

$STATE step-done <step-id>

It measures what the step changed. Exit 6 SCOPE_CHANGE_REQUIRED names the files outside the task and the start --amend that widens it. A step still open at close is finished by close.

4. Verify once, to the end

After the last edit (after the last step: $STATE step-done <id> && $STATE verify --scope all):

$STATE verify --scope all
$STATE verify --scope all --e2e not-applicable "<why the change reaches no e2e flow>"

It runs verify_command from .ai/policies/testing.md with no fail-fast, then — when the suite is green and the mode runs e2e — e2e_command, each to the end, with the log under .ai/state/logs/<task>/. Exit 0 is green and needs no agent to interpret. If the Verification block is empty, take the command from the project instruction file or CI, say so, and ask the human to write it into testing.md — it is theirs.

Red: fix as one batch. Read the log by path — grep -n for the failures, tail, or log-reader (FAST) for a long one; never the log into this session. Classify every failure first: new regression, existing failure, environment. Fix all new regressions together, then run once more, naming what the batch fixed:

$STATE verify --scope all --after-fix "<n> regressions: <one line each>"
  • An existing failure is recorded with $STATE memory risk add, not fixed.
  • An environment failure gets one more run, not a code change.
  • Never edit a test to make it pass.
  • Two whole-suite runs are the budget (tests.max_suite_runs; in a batch task batch.max_suite_runs). The third exits 6 SUITE_BUDGET: running it again is the human's decision, from their own terminal, with the command it prints — or the pick: with the dialog on it also prints DIALOG_PENDING, and you run the command the human picks, verbatim, once.

verify re-scores reversibility and domain from the diff. A re-score: line can raise the mode; the next: it prints is the path from here. A mode never drops during a task.

5. Questions — only real blockers

The plan collected the questions. During the build only these stop you: a guard refusal you cannot answer with --amend, a re-score to reversibility or domain 2, or a plan assumption the code proves false. Then:

$STATE ask "<one line>" --option "A: <text>" --option "B: <text>" \
  --recommend A --context "<file:line>"
$STATE ask --batch /path/questions.json   # a subagent's QUESTIONS_NEEDED, as a JSON list

The batch is [{"question": "…", "options": [{"key": "A", "text": "…"}, …], "recommend": "A", "context": "file:line"}] — a QUESTIONS_NEEDED option "A: text" becomes {"key": "A", "text": "text"}.

Option keys are single letters, A first, at least two; --recommend marks the one you would pick. Then stop and show the questions: while one is pending, step-done and close exit 4. The human answers in the conversation — record it with $STATE answer Q1=B Q2=X:"free text" or --prose "1B 2A" — or fills the [Answer]: line in .ai/reports/<task-id>/task.md §Questions, which is then the record. Never edit that file, and never answer on the human's behalf.

6. Hand over by mode

Mode Next
light /rr-ship — close decides from the two facts whether a review is owed
guarded /rr-review (one pass, BALANCED), then /rr-ship
full /rr-review (one pass, STRONG), then /rr-ship, which asks the human

Keeping context small

  • grep -n, then read the ranges that matched. A large file or a log goes to a FAST reader — Explore for code, log-reader for output — which returns file:line excerpts, never the file. A reader that must judge (where a behaviour really lives, whether two paths are coupled) is ai-discovery on BALANCED.
  • Do not rediscover what .ai/project/ records; if it is wrong, fix that file in this task.
  • Between steps your context holds the goal, the mode, the current step and the last verdict. Everything else is on disk: task.md, the handoff, the logs.
  • Tools and MCP servers the task does not need stay off.

Rules

  • No commit, push, merge or deploy. The task ends at /rr-ship, and approval is the human's.
  • A refusal from a guard or from state.py names the way out; follow it, never reword the command to get past it.
  • Failures are fixed in batches; one red test never restarts the task.
  • Problems found outside the task are written down, not fixed.

04 同仓库更多 Skills

vanssata
vanssata/claude-agentic-sdlc-module

sylius-fixtures

Load the Sylius fixture suite into the local database

★ 3
vanssata
vanssata/claude-agentic-sdlc-module

deploy-staging

Deploy the current branch to staging and smoke-test the checkout. Use on "deploy to staging".

★ 3
vanssata
vanssata/claude-agentic-sdlc-module

rr-status

暂无简介

★ 3
vanssata
vanssata/claude-agentic-sdlc-module

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.

★ 3
vanssata
vanssata/claude-agentic-sdlc-module

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.

★ 3
vanssata
vanssata/claude-agentic-sdlc-module

rr-setup

暂无简介

★ 3