Do not read all protocol files in advance; only after determining the action, read references/<protocol>.md。
Startup steps
Before executing any protocol, run from the project root directoryonecommand:
node <SKILL_DIR>/scripts/get-context-info.js
<SKILL_DIR> is the directory where this SKILL.md is located (not a literal placeholder). The script output contains a JSON scope、currentPlanStatus、currentPlanNumber、currentPlanDir、currentPlanFile、nextPlanNumber、nextPatchNumber of JSON;built-in format validation, and when a problem is found it prints an error with a non-zero exit code—first fix it according to the error, then rerun until it passes. If not in the project root directory, append --cwd <project-root>。
Only when the script fails to launch (for example, a Node permission issue), fall back to node <SKILL_DIR>/scripts/validate-context.js for independent validation. Directly use the fields output by the script; do not scan directories yourself to infer status or numbering.Special case: if the script reports an error 未找到 .agent-context 目录 it means the project has not yet been initialized—directly read references/init.md to enter the initialization protocol, and do not execute any other routing.
Directory structure
The actual layout of the workspace, with naming strictly observed:
- Current plan:
.agent-context/{scope}/plan-{number}/, directory namecan onlybeplan-{nextPlanNumber}; appending a date or any suffix is prohibited. - Pending execution queue:
.agent-context/{scope}/preparing/plan-{number}/, naming rules same as above. - Archived:
.agent-context/{scope}/done/plan-{number}-YYYYMMDD/, automatically dated byagent-context done,manual creation in this form is prohibited。 - Metadata:
.agent-context/{scope}/index.md、.agent-context/.env。
Routing
After determining an action,read in fullthe corresponding protocol file and execute it in order. If the protocol references other protocols, continue reading the referenced files; do not execute from memory.
| Status | User intent | Action |
|---|---|---|
null |
Initialize context, complete project guidance files | Read references/init.md |
null |
Create plan, break down requirements | Read references/plan.md |
| Any | Userexplicitly names rush, or the task is single, the scope is clear, and it can be completed in one go | Read references/rush.md |
未执行 |
Start executing the current plan | Read references/implement.md |
未执行 |
Adjust, redo, or replace the current plan | Read references/replan.md |
未执行 |
Review the plan | Read references/review.md |
已执行 |
Patch, fill omissions, append related increments | Read references/patch.md |
已执行 |
Review the implementation | Read references/review.md |
已执行 |
Complete and archive | Run agent-context done --yes |
When the user explicitly names init/plan/replan/implement/patch/rush/review , likewise first complete the startup steps and then read the corresponding protocol. Whenever "「interactive questioning tool」" appears in a protocol, always execute it according to references/ask-user-question.md :Before the first question, first read that file, and follow its "tool identification" stepsby semantics(tool names or descriptions containing keywords such as ask / question / choice / select / prompt / input / followup / clarify, etc.) in this sessionself-callableLocate the host question-asking tool in the tool list; if any match → must call, and must not skip or switch to a plain text reply on the grounds of "priority" or "inconvenience"; only when there is truly no match at all, fall back to a short text question and pause,forging tool calls is prohibited. When it involves writing business code or producing a plan, first read references/_principles.md as the shared professional baseline.
Hard constraints
- The plan status may only be
未执行or已执行。 - At most one current plan at any time, and the directory name must be strictly
plan-{nextPlanNumber}(without date/suffix);done/plan-{number}-YYYYMMDDis generated only byagent-context done. - Use
nextPlanNumberto create a plan; usenextPatchNumber。 - Do not modify business code before creating a plan in
planorrush; code changes occur only inimplementorpatch。 ## 影响范围Do not record files within.agent-context/.