AI Playbook中文

Coding agents

Bootstrap the write/review workflow into an existing repo: scaffold, rule block and process files

Verification

Tested on
2026-11-23
What was tested
Scope not stated
Evidence level
Dated run records or re-runnable tests
Status
Published
Version
0.1.0
Updated
2026-11-29
Source commit
a8fb8db149
Tools
the dual-agent-review kit (tools/dual-agent-review-kit, draft PR #19) or its manual route + git, AGENTS.md / CLAUDE.md, any two coding agents
Models
Not filled in
Audience
developers
Availability in mainland China
Available
Alternatives for mainland China
copy the template files by hand, GitHub template repository, GitHub Spec Kit

Framing: a solo developer's workflow (2026-11). The scaffold's Claude/Codex role defaults are just an example; override them in the project's AGENTS.md. If you use Claude: not supported in mainland China, Hong Kong or Macau since 2026-11-12 (checked 2026-11-23).

Situation

How to install

The orca-kit-init kit is open-sourced at tools/dual-agent-review-kit/ in a separate draft PR (#19), not merged yet — the link works only after it merges, and the license is still to be chosen by the owner. Once cloned: self-test with bash -n bin/orca-kit-init && python3 tests/test_init.py, then install with bin/orca-kit-init /path/to/repo <slug>. If you prefer no script, or the kit is not merged yet, use the manual route below (~5 minutes, same result).

Manual route (no script)

  1. Append the AGENTS.md snippet from dual-agent-write-review-loop to the repo's AGENTS.md, wrapped in <!-- BEGIN dual-agent-review --> / <!-- END dual-agent-review -->.
  2. mkdir -p .agents/work/<slug> and create empty PLAN.md, TASKS.md, STATE.md, HANDOFF_REQUEST.md, HANDOFF_VERDICT.md, ESCALATION.md (use the STATE.md template from that recipe).
  3. grep -qx "/.agents/work/" .gitignore || echo "/.agents/work/" >> .gitignore
  4. Write the real build/test/lint commands into AGENTS.md, then continue from step 4 below.

Steps

  1. Know what the script does: it appends, never overwrites. It creates AGENTS.md / CLAUDE.md if missing, otherwise appends a BEGIN/END-marked rule block; root-level docs such as CODEX_REVIEW.md are skipped if present; your README.md is untouched.
  2. Run: orca-kit-init /path/to/repo <feature-slug> (slug: lowercase letters, digits, single hyphens). Re-running doesn't duplicate; parallel features use unique slugs.
  3. Process files live in .agents/work/<slug>/ (move them outside .agents if Codex is the implementer — see step 2 of dual-agent-write-review-loop) (PLAN / TASKS / STATE / HANDOFF_REQUEST / HANDOFF_VERDICT / ESCALATION); /.agents/work/ is added to .gitignore once.
  4. Fill in the project's real build/test/lint commands in AGENTS.md. Without them a review "pass" means nothing.
  5. Role overrides: use ## Roles outside the marked block. Overrides never loosen "reviewer is read-only" or "a human merges".
  6. Init makes no commits. Commit rule files per your convention, never process files; git ls-files -- .agents/work must be empty before merge (gitignore doesn't untrack tracked files).
  7. Work in a feature worktree, then follow dual-agent-write-review-loop.

Templates

Process-file shapes: see STATE.md and the reviewer prompt in dual-agent-write-review-loop. To make the flow reviewable as a spec, map each process file to a stage's I/O in pipeline.yaml and put pass criteria in gates; spot-check the reviewer prompt with the eval / golden-set checklist.

Cost (order of magnitude, estimate)

Failure cases and guards

These are risks the scaffold guards against (from its docs and tests), not recorded incidents.

China alternatives

Safety notes

Test notes

Verification

来源 / Sources

  • AGENTS.md: https://agents.md/
  • gitignore: https://git-scm.com/docs/gitignore
  • Anthropic Supported Regions Policy (checked 2026-11-23): https://www.anthropic.com/legal/supported-regions

Source links

Export to your agent

Path: review-kit-bootstrap/SKILL.md

Preview
---
name: review-kit-bootstrap
description: "Bootstrap the write/review workflow into an existing repo: scaffold, rule block and process files. Use when the user asks for help with this task."
metadata:
  version: "0.1.0"
  status: "published"
  source-commit: "5f7272be13826bec473d6f2e073c82a5a620f1d2"
---

# Bootstrap the write/review workflow into an existing repo: scaffold, rule block and process files

- Version: 0.1.0
- Status: published
- Tested on: 2026-11-23
- Evidence level: field-use-logged
- Source commit: 5f7272be13826bec473d6f2e073c82a5a620f1d2

> Reference playbook: follow it only when the user asks for this task, and ask a human before running commands or irreversible actions.

## English

> **Framing: a solo developer's workflow (2026-11).** The scaffold's Claude/Codex role defaults are just an example; override them in the project's AGENTS.md. If you use Claude: not supported in mainland China, Hong Kong or Macau since 2026-11-12 (checked 2026-11-23).

### Situation
- **Audience:** you have several repos and want `dual-agent-write-review-loop` installed once per repo instead of hand-copying rules.
- **When to use:** onboarding a repo, or adding an isolated process directory for another feature.
- **When not to use:** repos with a mature custom flow you don't want appended to — read what the script changes first.

### How to install
The `orca-kit-init` kit is open-sourced at `tools/dual-agent-review-kit/` in **a separate draft PR (#19), not merged yet** — the link works only after it merges, and the license is still to be chosen by the owner. Once cloned: self-test with `bash -n bin/orca-kit-init && python3 tests/test_init.py`, then install with `bin/orca-kit-init /path/to/repo <slug>`. If you prefer no script, or the kit is not merged yet, use the manual route below (~5 minutes, same result).

**Manual route (no script)**
1. Append the AGENTS.md snippet from `dual-agent-write-review-loop` to the repo's `AGENTS.md`, wrapped in `<!-- BEGIN dual-agent-review -->` / `<!-- END dual-agent-review -->`.
2. `mkdir -p .agents/work/<slug>` and create empty `PLAN.md`, `TASKS.md`, `STATE.md`, `HANDOFF_REQUEST.md`, `HANDOFF_VERDICT.md`, `ESCALATION.md` (use the STATE.md template from that recipe).
3. `grep -qx "/.agents/work/" .gitignore || echo "/.agents/work/" >> .gitignore`
4. Write the real build/test/lint commands into AGENTS.md, then continue from step 4 below.

### Steps
1. **Know what the script does:** it **appends, never overwrites**. It creates `AGENTS.md` / `CLAUDE.md` if missing, otherwise appends a `BEGIN/END`-marked rule block; root-level docs such as `CODEX_REVIEW.md` are skipped if present; your `README.md` is untouched.
2. **Run:** `orca-kit-init /path/to/repo <feature-slug>` (slug: lowercase letters, digits, single hyphens). Re-running doesn't duplicate; parallel features use unique slugs.
3. **Process files live in `.agents/work/<slug>/`** (move them outside `.agents` if Codex is the implementer — see step 2 of `dual-agent-write-review-loop`) (PLAN / TASKS / STATE / HANDOFF_REQUEST / HANDOFF_VERDICT / ESCALATION); `/.agents/work/` is added to `.gitignore` once.
4. **Fill in the project's real build/test/lint commands** in AGENTS.md. Without them a review "pass" means nothing.
5. **Role overrides:** use `## Roles` outside the marked block. Overrides never loosen "reviewer is read-only" or "a human merges".
6. **Init makes no commits.** Commit rule files per your convention, never process files; `git ls-files -- .agents/work` must be empty before merge (gitignore doesn't untrack tracked files).
7. **Work in a feature worktree**, then follow `dual-agent-write-review-loop`.

### Templates
Process-file shapes: see STATE.md and the reviewer prompt in `dual-agent-write-review-loop`. To make the flow reviewable as a spec, map each process file to a stage's I/O in pipeline.yaml and put pass criteria in `gates`; spot-check the reviewer prompt with the eval / golden-set checklist.

### Cost (order of magnitude, estimate)
- The scaffold costs no tokens; onboarding is a few minutes of your time. The saving is consistent rules across repos. Review-call costs: see `dual-agent-write-review-loop`.

### Failure cases and guards
These are risks the scaffold guards against (from its docs and tests), not recorded incidents.
- **Overwriting existing rules:** why it appends, is marked and idempotent; a damaged or duplicated marker block makes it fail — fix by hand before re-running.
- **No real build/test commands:** every round is BLOCKED for lack of evidence.
- **Process files committed:** missing gitignore plus `git add -f`; check `git ls-files`.
- **Old root-level process files:** older installs kept six files at the root; they are not migrated, and tracked ones must be untracked by hand on the feature branch.
- **Role override loosening read-only review:** not allowed.

### China alternatives
- `china_availability: yes`: plain text plus a local script, no foreign service. Roles can be Kimi / GLM / Qwen / DeepSeek if your tool can enforce a read-only reviewer; without a read-only sandbox, read-only is by discipline only — see the safety notes in `dual-agent-write-review-loop`.

### Safety notes
- Read the script and the rule block before running; don't run it on untrusted repos.
- Leave the rule block's "no `.env` commits, no unapproved push/merge/publish" lines intact.
- Process files may contain logs and paths: don't commit or upload them.

### Test notes
- 2026-11-23: the scaffold's 5 automated tests pass (temp-dir test repos only); it has been adopted in one Flutter project of a solo developer (an adoption branch exists).
- Versions: Python 3.8.10 (local); the open-sourced kit ships in draft PR #19 with 6 passing tests (2026-11-23, including marker-order tests added after its review); the earlier private scaffold commit was `3818d63`.
- A full onboarding of a new repo was not re-run for this write-up; the steps come from the script's documentation and tests.

### Verification
- In a scratch repo, run it twice: the second run changes nothing.
- `AGENTS.md` has exactly one `BEGIN/END` block; `/.agents/work/` appears once in `.gitignore`.

## 来源 / Sources

- AGENTS.md: https://agents.md/
- gitignore: https://git-scm.com/docs/gitignore
- Anthropic Supported Regions Policy (checked 2026-11-23): https://www.anthropic.com/legal/supported-regions