Skills
A skill is the procedure for one role, from start to finish, in at most 120 lines. There are four, and Claude Code and Codex read the same files.
Sources: .agents/skills/.
Common shape
Section titled “Common shape”| Item | Value |
|---|---|
| Location | .agents/skills/<name>/SKILL.md; .claude/skills is a symlink to ../.agents/skills |
| Frontmatter | name (the directory name) and description (when to use it) |
| Length | at most 120 lines, checked by tests/skills/test_skills.py |
| Commands | <run> and <results> stand for the Run and results commands on the Run line of AGENTS.md Project, the part before --issue N |
| Reports | plan, implement and run end every stop with the three lines of AGENTS.md Report; review ends with its Verdict comment and reports the link and verdict to the session that asked |
| Language | as shipped, the skills name Chinese for the discussion, drafts, PR bodies, reports and comment templates; a project whose Language line names another language changes them |
| Skill | Takes | From | To | Writes |
|---|---|---|---|---|
plan |
a discussion | new work | published parent and sub-issues (gate 1) | issues, one Decision |
implement |
one code issue |
ready | merge-ready, or merged under Merge: agent |
files in Scope, the PR, blocker comments |
review |
one PR number | fresh session | one Verdict comment | one PR comment |
run |
one run issue |
ready | closed with a results comment | run records, the results comment |
Use when the human wants to discuss new work and turn it into a published study (research) or plan (development) parent issue with its code and run sub-issues.
- Read state and context. Open
study,planandneeds-decisionissues; open PRs; earlier studies or tasks with their comments;<results> --issue <N>for earlier run records; the code the work will touch and the papers and records the human points to. Nothing is written while discussing. - Discuss with the human until the draft is complete: the question or goal, the result that answers it, the budget and, for a study, the spec. For Controlled, walk the usual confounders (data and split; preprocessing and augmentation; model and init; optimizer and schedule; effective batch and training length; precision; tuning budget; evaluation protocol and checkpoint selection; seeds), each with a value and a sourced reason. Seeds and tuning grids are
inlines. Keys come from the code; a setting the code can’t take through config needs acodesub-issue. - Draft the issues with the forms’ exact
###sections. Aplanparent has### Goaland### Context. Scope globs never start with a wildcard; Acceptance lines all exit 0 if and only if the task is done; Merge isagentonly for a low-risk task whose Scope matches no protected path. - Order sub-issues into waves. Issues in one wave have disjoint Scopes; overlapping ones are chained with blocked-by. Show the whole draft and the graph to the human and revise until they approve.
- Publish (gate 1) only on explicit instruction: the parent first, then sub-issues wave by wave with
gh issue create --label ... --parent P --blocked-by ..., bodies through a quoted heredoc. Check the parent lists every sub-issue. - Record and stop:
Decision: 发布 ...on the parent, report, stop. Editing a published task’s Goal, Scope, Acceptance or Merge, or a study’s spec, is gate 1 too.
implement
Section titled “implement”Use when doing a code issue, from claiming it through fresh reviews to a merge-ready PR, or to merged when its Merge field is agent.
- Claim and set up.
gh issue develop N --name t/N-<slug> --base main, thengh issue develop --list N; if another branch is linked, delete yours and pick other work. Work only in../worktrees/N-<slug>. - Read the issue and its Decisions, the parent and its Decisions (and a study’s spec),
AGENTS.md, the code in Scope and its interfaces. - Implement. TDD where it fits. Change only paths in Scope (
git diff --name-only origin/main...). Under a study, set every spec key through config, write the resolved config to$RUN_DIR/config.jsonfrom one process, and never alter a Controlled setting or make arms differ beyond Arms. Bugs outside Scope become newcodeissues. Commit as<type>(#N): <summary>and push often. - Inner loop before the PR. Run every Acceptance line and the
Testcommand; get a fresh pre-PR review of the diff against the issue; fix; repeat with a new reviewer until nothing blocking remains. - Open the PR from the template: English title, Chinese body. Watch
gh pr checks <PR> --watchand fix guard or test failures without asking. - Outer loop. Start a fresh PR review and check the newest
Verdict:names the PR head.changes: fix, rerun Acceptance, push, review again (three in a row is a blocker).passwith minors: fix those inside Scope, get one more fresh review if you pushed, then post one comment proposing an action for each remaining minor. Its first line must not start withVerdict:. - Merge-ready. Under
Merge: agent, runpython .github/scripts/merge.py <PR>. Otherwise, or if it exits 2, stop: the merge-ready PR is the request. Exit 1 (couldn’t read the PR, or the merge failed): fix the cause and retry; the same failure 3 times is a blocker. On the human’s merge instruction, runmerge.py <PR> --humanand recordDecision: 合并 PR #<PR> — .... After either merge, carry out the minor proposals and remove the worktree and branches.
review
Section titled “review”Use in a fresh session whose only input is a PR number, to review that PR against its issue and post one comment whose first line is the Verdict.
-
Read the PR and its diff, the issue it closes with its comments, the parent’s
Decision:comments and, for a study, its spec;AGENTS.md, the design doc indocs/if there is one, and the code around the diff. Never the implementer’s session or summaries. To run Acceptance, check out the head SHA in a scratch worktree../worktrees/review-<PR>(notFETCH_HEAD). -
Checklist:
- Contract: meets Goal and Acceptance, stays in Scope, follows the Decisions; under a study, every spec key is set through config and written to
config.json, and nothing alters a Controlled setting or makes arms differ beyond Arms. - Correctness on realistic inputs and error paths, assuming capable, cooperative agents and users.
- Consistency with
AGENTS.md, the design doc and existing code. - Tests that pin the contract.
- Simplicity: nothing the contract doesn’t need.
Items 1 to 4 are blocking; everything else is minor. No requests for defenses against malformed formats, forgery, outsiders or adversarial input unless the issue requires them. The verdict is
changesonly with at least one blocking finding. - Contract: meets Goal and Acceptance, stays in Scope, follows the Decisions; under a study, every spec key is set through config and written to
-
Post one comment. Re-read the full head SHA right before posting; if it moved, review the new head first. First line exactly
Verdict: pass @ <full head SHA>orVerdict: changes @ <full head SHA>; below it, the findings in the tool’s own format and language, unedited, each pointed at a file and line. Don’t approve, label, push or edit anything. Remove the scratch worktree. -
Starting a review (for the implementer): a fresh Claude Code subagent,
codex exec -s danger-full-access, or the built-incodex exec review, whose[P0]or[P1]findings meanchanges. A pre-PR review gets only the issue number and the diff and posts nothing. See Claude Code and Codex.
Use when doing a run issue, from claiming it and launching its Runs within Budget to the results comment and closing the issue.
- Claim and set up as in
implement. Launch every run from the clean worktree, so each record names merged code. Commit nothing; a run issue has no PR. - Read the issue (Runs, Budget, Report) and its Decisions, the study and its spec and Decisions, and
<results> --issue Nfor runs already recorded. Recorded lines aren’t launched again, unless an earlier attempt ended in an infra failure. - Launch within Budget. Check that each Runs line runs exactly one arm and that each arm this issue runs gets every
invalue; otherwise it’s a blocker. Launch<run> --issue N [options] -- <cmd>. Right after launch, rungh issue view P --json body -q .body | <results> --issue N --spec -and stop every running run that规格核对lists as breaking a Controlledkey=valueline, not recording one, or matching no arm or several. A key under未声明的差异is a blocker. Adaptable changes stay within their rule and are noted. GPU hours = wall time times GPUs, summed over all runs including failed ones; before exceeding Budget, stop at gate 3. - Failures. Failed runs stay and count. Rerun only after an infra failure, never because a result looks wrong. A code failure is a result: open a
codeissue and continue. Same failure 3 times is a blocker. - Results comment and close. When every line has a finished or failed record, post a note plus
<results> --issue N --metric <Report> --spec -output, unedited and unfiltered; close the issue. If all run issues of the study are closed, post the study-level table over all of them on the study. Clean up the worktree and branches. - Report with links to the results comment and the study. Concluding the study is gate 4.