jig
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseJig
Jig
A jig holds the work and guides the tool so every cut comes out true. This skill
holds a task and guides the agent through a repeatable, gated software development
lifecycle for the current repository, so every task runs the same accurate path.
Deterministic mechanics are Node scripts bundled in this skill under ;
you run them and interpret the output. below is this skill's base
directory — use its absolute path when running commands. Node.js ≥ 18 is required.
scripts/<SKILL_DIR>夹具(Jig)用于固定工件并引导工具,确保每一次加工都精准无误。本技能用于管理任务,并引导Agent完成当前代码仓库中可重复、受控的软件开发生命周期,确保每一项任务都遵循统一的精准流程。确定性机制由本技能下目录中的Node脚本实现;你可以运行这些脚本并解析输出。下文的指本技能的基础目录——运行命令时请使用其绝对路径。要求Node.js版本≥18。
scripts/<SKILL_DIR>Dispatch
调度
Parse the sub-command from the user's invocation (the word after , or infer
from the request) and follow the matching section. If none matches, run status
and show the available sub-commands.
/jig从用户的调用中解析子命令(后的单词,或从请求中推断),然后遵循对应章节的流程。如果没有匹配项,运行status命令并显示可用的子命令。
/jiginit
init
Scaffold , then run Phase 0 to build Project Memory.
.jig/- Run: and report created vs. skipped.
node "<SKILL_DIR>/scripts/scaffold.mjs" "$(pwd)" - Run Phase 0 — understand the codebase: follow to fan out explorer subagents, merge their findings, and populate
<SKILL_DIR>/phases/understand.md..jig/memory/ - Decide whether is tracked in git (git repo only) — ask the developer:
.jig/- Track it (recommended) — Jig state (spec, plan, progress, review, memory,
backlog) is git-versioned and shared, committed alongside the code it describes. Set
in
git.track_state: true, then commit the scaffold:.jig/config.yml. If the base is protected and rejects a direct commit, tell the developer to commitgit add .jig && git commit -m "chore: initialize jig"(or open a PR)..jig/ - Don't track it — stays local-only (never dirties the tree, not shared). Set
.jig/, addgit.track_state: falseto.jig/, and commit that:.gitignore.git add .gitignore && git commit -m "chore: ignore .jig state"
- Track it (recommended) — Jig state (spec, plan, progress, review, memory,
backlog) is git-versioned and shared, committed alongside the code it describes. Set
- Report which memory files were populated and suggest the user skim
.
.jig/memory/index.md - Do not overwrite an existing config unless the user explicitly asks ().
--force
搭建目录,然后运行第0阶段以构建项目记忆。
.jig/- 运行:,并报告已创建和已跳过的内容。
node "<SKILL_DIR>/scripts/scaffold.mjs" "$(pwd)" - 运行第0阶段——理解代码库:遵循的指引,调用探索子Agent,合并它们的发现,并填充
<SKILL_DIR>/phases/understand.md目录。.jig/memory/ - 决定是否在git中跟踪目录(仅针对git仓库)——询问开发者:
.jig/- 跟踪(推荐)——Jig的状态(需求定义、计划、进度、评审、记忆、待办事项)将通过git进行版本控制并共享,与它所描述的代码一起提交。在中设置
.jig/config.yml,然后提交搭建内容:git.track_state: true。如果主分支受保护且拒绝直接提交,请告知开发者提交git add .jig && git commit -m "chore: initialize jig"目录(或打开PR)。.jig/ - 不跟踪——目录仅保存在本地(永远不会污染代码树,不共享)。设置
.jig/,将git.track_state: false添加到.jig/中,并提交该更改:.gitignore。git add .gitignore && git commit -m "chore: ignore .jig state"
- 跟踪(推荐)——Jig的状态(需求定义、计划、进度、评审、记忆、待办事项)将通过git进行版本控制并共享,与它所描述的代码一起提交。在
- 报告已填充的记忆文件,并建议用户浏览。
.jig/memory/index.md - 除非用户明确要求(使用参数),否则不要覆盖现有配置。
--force
task
task
Create a new task folder for an issue/bug/feature.
- Determine a short from the user's request and a
title(type|feature|bug|chore; defaultrefactor).feature - Propose a (process weight): defaults by type are feature/refactor →
track, bug/chore →full; suggestfastwhen the user signals urgency. Confirm title, type, and track in one line before creating, and let the user override the track.hotfix - Run: (omit
node "<SKILL_DIR>/scripts/new-task.mjs" "<title>" <type> <track>to accept the type default).<track> - Report the created , its
taskId, and path (track)..jig/tasks/<YYYYMMDD>/<slug>/ - The created task folder is (
<taskDir>), at phase.jig/tasks/<YYYYMMDD>/<slug>/.intake - Run Phase 1 — Intake & Clarify: follow (pass
<SKILL_DIR>/phases/intake.md). This is an interactive dialogue with the developer.<taskDir> - Run Phase 2 — Spec & Plan: follow (pass
<SKILL_DIR>/phases/spec-plan.md), ending at the spec gate.<taskDir> - After the gate is approved (phase ), run Phase 3 — Implement (
implement; creates a<SKILL_DIR>/phases/implement.mdfeature branch per<type>/<slug>), Phase 4 — Test (git.branch), Phase 5 — Review (<SKILL_DIR>/phases/test.md, review gate), then Phase 6 — Ship (<SKILL_DIR>/phases/review.md). Ship pushes the branch and opens a PR or leaves commits (<SKILL_DIR>/phases/ship.md), refreshes Project Memory, and moves the task toship.mode(a branch awaiting merge) orshipped. When adonetask's PR is merged, runshippedto verify the merge, delete the branch, return to base, and close the task./jig cleanup
为议题/缺陷/功能创建新的任务文件夹。
- 从用户的请求中确定简短的和
title(type|feature|bug|chore;默认值为refactor)。feature - 建议一个(流程权重):根据类型的默认值为feature/refactor→
track,bug/chore→full;当用户表示紧急时建议使用fast。在创建前确认标题、类型和track,允许用户覆盖track。hotfix - 运行:(省略
node "<SKILL_DIR>/scripts/new-task.mjs" "<title>" <type> <track>以接受类型的默认值)。<track> - 报告创建的、其
taskId和路径(track)。.jig/tasks/<YYYYMMDD>/<slug>/ - 创建的任务文件夹为(
<taskDir>),处于.jig/tasks/<YYYYMMDD>/<slug>/阶段。intake - 运行第1阶段——需求收集与澄清:遵循(传入
<SKILL_DIR>/phases/intake.md)。这是与开发者的交互式对话。<taskDir> - 运行第2阶段——需求定义与计划:遵循(传入
<SKILL_DIR>/phases/spec-plan.md),直至需求定义关卡。<taskDir> - 关卡通过后(进入阶段),运行第3阶段——实现(
implement;根据<SKILL_DIR>/phases/implement.md创建git.branch功能分支)、第4阶段——测试(<type>/<slug>)、第5阶段——评审(<SKILL_DIR>/phases/test.md,评审关卡),然后是第6阶段——发布(<SKILL_DIR>/phases/review.md)。发布阶段会推送分支并打开PR或保留提交(取决于<SKILL_DIR>/phases/ship.md),刷新项目记忆,并将任务状态改为ship.mode(分支等待合并)或shipped。当done状态的任务PR合并后,运行**shipped**以验证合并、删除分支、回到主分支,并关闭任务。/jig cleanup
status
status
Show all tasks and their current phase/gate state.
- Run: from the repo root (
node "<SKILL_DIR>/scripts/status.mjs").$(pwd) - Print the output verbatim.
显示所有任务及其当前阶段/关卡状态。
- 从仓库根目录()运行:
$(pwd)。node "<SKILL_DIR>/scripts/status.mjs" - 按原样打印输出内容。
config
config
View, edit, and validate . Backed by ; run it from the
repo root () and relay the output. Keys are dotted paths (e.g. ).
.jig/config.ymlscripts/config.mjs$(pwd)gates.review- show (default): — print settings grouped by section with allowed values.
node "<SKILL_DIR>/scripts/config.mjs" show - get: — print one value.
node "<SKILL_DIR>/scripts/config.mjs" get <key> - set: — validate and write one key, preserving comments. On an invalid value it exits non-zero and prints the allowed set; relay that and do not retry blindly.
node "<SKILL_DIR>/scripts/config.mjs" set <key> <value> - check: — static validation (
node "<SKILL_DIR>/scripts/config.mjs" check/OK/WARN+ summary); exits non-zero if anyERR.ERR
When , commit the changed after a .
git.track_state: true.jig/config.ymlset查看、编辑和验证。由提供支持;从仓库根目录()运行该脚本并传递输出。键为点分隔的路径(例如)。
.jig/config.ymlscripts/config.mjs$(pwd)gates.review- show(默认):——按分组打印设置及允许的值。
node "<SKILL_DIR>/scripts/config.mjs" show - get:——打印单个值。
node "<SKILL_DIR>/scripts/config.mjs" get <key> - set:——验证并写入单个键,保留注释。如果值无效,脚本将以非零状态退出并打印允许的取值范围;传递该信息,不要盲目重试。
node "<SKILL_DIR>/scripts/config.mjs" set <key> <value> - check:——静态验证(
node "<SKILL_DIR>/scripts/config.mjs" check/OK/WARN+ 摘要);如果存在任何ERR,则以非零状态退出。ERR
当时,在执行后提交修改后的。
git.track_state: trueset.jig/config.ymlmemory-refresh
memory-refresh
Re-run Phase 0 to refresh Project Memory (e.g., after significant changes).
Follow ; it overwrites the memory files.
<SKILL_DIR>/phases/understand.md重新运行第0阶段以刷新项目记忆(例如在代码发生重大变更后)。遵循;该操作将覆盖记忆文件。
<SKILL_DIR>/phases/understand.mdcleanup
cleanup
Finish a task after its PR was merged out-of-band.
shipped- Determine the task: if the user gave , use it; else run
<YYYYMMDD>/<slug>and pick a task whose phase isnode "<SKILL_DIR>/scripts/resume.mjs" "$(pwd)"(ask the user if there are several).shipped - Read its state: ; confirm the phase is
node "<SKILL_DIR>/scripts/resume.mjs" "$(pwd)" "<taskId>". If it is alreadyshipped, tell the user the task is already cleaned up.done - Follow Phase 7 — Cleanup (), passing the task folder.
<SKILL_DIR>/phases/cleanup.md
当状态的任务其PR已通过外部方式合并后,完成该任务的收尾工作。
shipped- 确定任务:如果用户提供了,则使用该值;否则运行
<YYYYMMDD>/<slug>并选择一个状态为node "<SKILL_DIR>/scripts/resume.mjs" "$(pwd)"的任务(如果有多个,询问用户)。shipped - 读取任务状态:;确认状态为
node "<SKILL_DIR>/scripts/resume.mjs" "$(pwd)" "<taskId>"。如果任务已处于shipped状态,告知用户任务已完成收尾。done - 遵循第7阶段——收尾(),传入任务文件夹。
<SKILL_DIR>/phases/cleanup.md
resume
resume
Resume a paused task from its saved state.
- Determine the task: if the user gave , use it; otherwise run
<YYYYMMDD>/<slug>to list resumable tasks (phase ≠ done) and pick one (ask the user if there are several).node "<SKILL_DIR>/scripts/resume.mjs" "$(pwd)" - Read its state: (prints
node "<SKILL_DIR>/scripts/resume.mjs" "$(pwd)" "<taskId>"); note the currentstate.json.phase - Recover context: read the task's (and
progress.md) underspec.md..jig/tasks/<taskId>/ - Re-enter that phase by following its guide (passing the task folder):
→
intake,phases/intake.md→spec_plan,phases/spec-plan.md→implement,phases/implement.md→test,phases/test.md→review,phases/review.md→ship,phases/ship.md→shipped. Ifphases/cleanup.mdisphase, tell the user the task is already complete.done - Continue the lifecycle from there.
从保存的状态恢复暂停的任务。
- 确定任务:如果用户提供了,则使用该值;否则运行
<YYYYMMDD>/<slug>列出可恢复的任务(状态≠done)并选择一个(如果有多个,询问用户)。node "<SKILL_DIR>/scripts/resume.mjs" "$(pwd)" - 读取任务状态:(打印
node "<SKILL_DIR>/scripts/resume.mjs" "$(pwd)" "<taskId>");记录当前的state.json。phase - 恢复上下文:读取任务文件夹下的
.jig/tasks/<taskId>/(和progress.md)。spec.md - 通过遵循对应阶段的指引(传入任务文件夹)重新进入该阶段:→
intake,phases/intake.md→spec_plan,phases/spec-plan.md→implement,phases/implement.md→test,phases/test.md→review,phases/review.md→ship,phases/ship.md→shipped。如果phases/cleanup.md为phase,告知用户任务已完成。done - 从该阶段继续生命周期流程。
backlog
backlog
Groom deferred work in — e.g. when there's free time to burn it down.
This is a maintenance flow, not a lifecycle phase; it reads and prunes the file and promotes
items into normal tasks. No dedicated script.
.jig/backlog.md- List the open items () from
- [ ]. If there are none, say the backlog is empty and stop..jig/backlog.md - Context-check each item (or the ones the user cares about) — index-first via
, plus the code: is it still relevant, already solved incidentally, a duplicate, or stale? Give your read per item.
.jig/memory/ - Prune (with the developer's OK): check off () or delete items that are already done, obsolete, or no longer wanted. Commit the pruned
- [x]when.jig/backlog.md.git.track_state - Promote an item the developer picks up now: start it as a normal task — run the
task flow (see ) with the item text as the request. When that task reaches
### task/shipped, check its source item off indone..jig/backlog.md - Report: items pruned, item(s) promoted to tasks, and how many remain open.
梳理中的延期工作——例如当有空闲时间时处理这些任务。这是一个维护流程,不属于生命周期阶段;它会读取并精简文件,并将项目转化为常规任务。没有专用脚本。
.jig/backlog.md- 列出中的未完成项(
.jig/backlog.md)。如果没有未完成项,告知用户待办事项为空并停止操作。- [ ] - 检查每个项(或用户关心的项)的上下文——首先通过索引,再结合代码:该项是否仍然相关、是否已被意外解决、是否重复或已过时?给出每个项的判断。
.jig/memory/ - 精简(需获得开发者许可):勾选()或删除已完成、过时或不再需要的项。当
- [x]为true时,提交精简后的git.track_state。.jig/backlog.md - 升级开发者现在要处理的项:将其作为常规任务启动——运行task流程(见),将项的文本作为请求。当该任务进入
### task/shipped状态时,在done中勾选对应的源项。.jig/backlog.md - 报告:已精简的项数、已升级为任务的项数,以及剩余的未完成项数。
Committing .jig/
state
.jig/提交.jig/
状态
.jig/When is tracked (, chosen at init), its files — a task's
///, refreshed , — are
committed alongside the code they describe, never left as a trailing pile of dirt:
.jig/git.track_state: truespec.mdprogress.mdreview.mdstate.jsonmemory/*.mdbacklog.md- Intake & Spec-Plan run on the base before the feature branch exists — they write but do not commit. Creating the branch at Implement carries those changes onto it, where they fold into the first code commit.
.jig/ - Implement / Test / Review stage in the same commit as the code/tests/fixes. When a phase has no code to ride with (a clean Review pass, Ship's memory refresh), commit the
.jig/changes on their own — on a feature branch these still merge via the PR..jig/ - Cleanup runs on the base after the merge — commit and push () the small final state there directly; if the base is protected and rejects it, report and leave it.
git.push
When is not tracked (, gitignored) or the repo is non-git,
skip all of this — lives on disk and is still resumable.
.jig/git.track_state: false.jig/当被跟踪时(,在init阶段选择),其文件——任务的///、刷新后的、——会与它们所描述的代码一起提交,永远不会留下未提交的变更:
.jig/git.track_state: truespec.mdprogress.mdreview.mdstate.jsonmemory/*.mdbacklog.md- 需求收集与需求定义-计划在功能分支创建前的主分支上运行——它们会写入但不提交。在实现阶段创建分支时,这些变更会被带到分支上,并融入第一次代码提交。
.jig/ - 实现/测试/评审阶段将的变更与代码/测试/修复一同提交到同一commit中。如果某个阶段没有对应的代码变更(例如评审通过、发布阶段的记忆刷新),则单独提交
.jig/的变更——在功能分支上,这些变更仍会通过PR合并。.jig/ - 收尾在合并后的主分支上运行——直接提交并推送()最后的小变更;如果主分支受保护且拒绝提交,告知用户并停止操作。
git.push
当不被跟踪时(,已添加到git忽略)或仓库非git仓库,跳过所有上述操作——仅存储在磁盘上,仍可恢复。
.jig/git.track_state: false.jig/Notes
注意事项
- All commands operate on the current working directory as the project root.
- If does not exist when running
.jig//task, tell the user to runstatusfirst./jig init
- 所有命令都以当前工作目录作为项目根目录。
- 如果运行/
task时status目录不存在,告知用户先运行.jig/。/jig init