一键导入
implement
Full TDD loop — plan, branch, write code + tests, fmt, clippy, test, review, commit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Full TDD loop — plan, branch, write code + tests, fmt, clippy, test, review, commit.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | implement |
| description | Full TDD loop — plan, branch, write code + tests, fmt, clippy, test, review, commit. |
The core SDLC loop. Use this whenever the user asks for a new feature, bug fix, or non-trivial change.
If invoked as /implement S-NNN, run these steps before Step 1:
Find stories/S-NNN-*.md and read it in full. The story's acceptance criteria become the spec for Step 1.
git rev-parse --abbrev-ref HEAD
The current branch must be feature/S-NNN-<slug>. If it is not:
Story S-NNN has not been started. Run: /story update S-NNN status=in-progress
Stop. Do not create a branch here — /story update owns that transition.
In Step 1 (Plan), use the story's acceptance criteria as the requirements. The plan must address each criterion. The branch already exists (from Step 0b), so skip the branch creation in Step 2 — just confirm you're on it.
After /pr opens, remind the user: /story update S-NNN status=review
Enter plan mode. Before touching any file:
AGENTS.md to confirm conventions and architecture.unsafe implications if relevant).Wait for explicit user approval before exiting plan mode. The plan also produces the work slug (used for the branch name).
If a story is active (you loaded one in Step 0a), append the approved plan to the story file. This captures the implementation approach for future reference.
story_file=$(ls stories/S-*.md 2>/dev/null | head -1)
if [[ -n "$story_file" ]]; then
cat >> "$story_file" << 'PLANEOF'
## Implementation plan
<the approved plan text — files, API surface, test strategy, risks>
PLANEOF
fi
Then git add the story file so the plan is version-controlled alongside the code.
git rev-parse --abbrev-ref HEAD
If on main:
git checkout -b feature/<slug> # or fix/<slug> for bug fixes
Slug rules: lowercase, kebab-case, derived from the plan title, max ~40 chars. Don't create the branch until step 1 is approved.
Follow AGENTS.md for where files go. For each unit of behaviour:
#[ignore] initially if needed).Don't batch a wall of production code and write tests at the end — interleave.
Rust-specific reminders:
? over .unwrap() in production paths.unsafe block needs a // SAFETY: comment.cargo add <crate> and commit Cargo.lock./fmtFormat inline. The PostToolUse hook will have surfaced violations during step 3 already; this is the belt-and-braces pass.
/testLoop control:
/test's output, re-run./reviewThe /review skill produces findings tagged Blocking / Should fix / Nits, with [needs-decision] on judgement calls.
[needs-decision] finding: surface to the user, get a call, then apply or dismiss./testConfirm review-driven changes didn't break anything. If they did, fix and re-run.
/commitHand off to the commit gate. Do not commit directly from this command — /commit enforces the pre-commit gate independently.
/implement run. Two features = two runs = two branches.#[allow(clippy::...)] to silence clippy — fix the underlying issue.Review a pull request or pending changes. Performs a focused code review against the current branch's diff (or staged diff if invoked pre-commit), surfacing correctness bugs, missing tests, style violations, and unclear naming. Use when the user asks to "review this", "review the PR", "code review", or before commits/PRs.
Complete a security review of pending changes on the current branch. Focuses on injection, authn/authz, secrets, SSRF, deserialisation, insecure defaults, and supply-chain risk. Use when the user asks to "security review", "security audit", "check for vulns", or before raising a PR.
Pre-commit gate (fmt + clippy + test) then create a conventional commit with explicit file staging.
Create or update ARCHITECTURE.md with system components, data flows, and ADRs
Format Rust code with rustfmt and report what changed.
View the story board grouped by status, with optional filters