- Inspect
.agents/state/INDEX.mdplus unfinished task summaries first; do not bind, select, or create any task state file yet. - Resolve workflow context before calling
$ac-memory:
- identify task type (
feat/fix/refactor/chore/docs) - determine whether this is a new task or
continue - check whether the request is a pure copy-edit exempted by AGENTS; if yes, do not enter workflow state handling
- treat
active/blockedas resumable only when the user explicitly indicatescontinue - if unfinished task-state files exist but the user intent is a new task, create a new task instead of auto-resuming
- if the user says
continue, first try explicittask-idor exactTASK_TITLE - if exact resolution fails, build a small candidate set from stable substring / keyword matches against unfinished
TASK_TITLE - if the candidate set has one clear match, surface it and let the user confirm before binding
- if the candidate set has multiple matches, list the candidates and require user confirmation before binding
- Call
$ac-memoryonly after the target task is resolved, so.agents/state/INDEX.mdand the selected or newly created task state file are valid and ready for routing. - Determine route using the AGENTS risk score:
singlefor low-risk work: run minimalac-planthenac-executeresponsibilities in the same thread, do not edit files before the Contract is written andPLAN_FROZEN=true, and after execution perform summary closeout by writingCURRENT_ROLE: singleandWORKFLOW_STATUS: completedsingle + reviewerwhen review must be forced: complete the same collapsed planning/execution path, hand off to$ac-review, then reclaim control after a pass for final summary closeoutplanner -> executor -> reviewerfor multi-file, high-risk, or workflow-rule changes; reclaim control after$ac-reviewpasses for final summary closeout- for low-risk work that is not AGENTS copy-edit exempt, prefer
singleunless workflow routing semantics, AGENTS core rules, review conclusions, or shared terminology across multiple workflow assets also change
- Echo a concise state line such as
[STATE] <task-id> | <role> | <status> | 已检查/已更新when helpful, then emit the standard workflow progress display and keep it aligned with the real phase in the active task state file. 5.5. When running a low-risk non-copy-edit task, the caller may echo a concise line such as当前按轻量 workflow 执行(简版 Contract、聚合验证、按需 review); the workflow progress display may be shortened as long as the active task state remains accurate. 5.6. AGENTS lightweight workflow eligibility is decided by task shape and exclusions first; use the risk score to decide whether the route stayssingle, upgrades tosingle + reviewer, or exits lightweight handling for a fuller route. - For docs / skills / templates tasks, ensure the Contract uses consistency checks instead of default
gradlewcommands unless code or build files are touched. - On phase or status change, update the active task state file and
.agents/state/INDEX.mdbefore handoff. - On
continue, long-running tasks, or context risk, trigger the forced wrap-up pattern:
- pause work
- set
WORKFLOW_STATUS: blocked - refresh the active task state file and
.agents/state/INDEX.md - echo the updated
[STATE]line when helpful - output completed work, remaining work, and the next resume hint with both
TASK_TITLEandtask-id
- Summary closeout ownership:
$ac-workflowis the only owner of final📝 总结- after
$ac-reviewpasses, echo the final[STATE]line when helpful and output the summary in the same thread - for reviewed routes, keep
CURRENT_ROLE: reviewerandWORKFLOW_STATUS: completed; do not rewrite reviewed tasks tosingle
Outputs:
- valid
.agents/state/INDEX.md - valid selected or newly created active task state file
- active route (
single,single + reviewer, orplanner -> executor -> reviewer) - current phase and
WORKFLOW_STATUSaligned across user-facing output and state file
Hard rules:
- Always resolve
new taskversuscontinue, plus the targetTASK_TITLE/task-id, before calling$ac-memoryin a way that binds or creates a task state file. - Candidate matching may narrow
continuechoices, but it never replaces explicit user confirmation when exactTASK_TITLE/task-idresolution failed. - Do not replace planner / executor / reviewer responsibilities; orchestrate them, and collapse them only when
singleis explicitly selected. - Do not create workflow state for AGENTS copy-edit-exempt requests.
- Do not let
$ac-memoryauto-create or auto-select a task while continue intent is unresolved or ambiguous. - Do not leave a finished
singletask inCURRENT_ROLE: executororWORKFLOW_STATUS: active. - Do not treat docs-only file changes as general chat once workflow assets are being edited.
- Do not auto-resume from
.agents/state/INDEX.mdor.agents/state/tasks/*.mdwithout explicit user intent to continue. - Do not auto-resume a
WORKFLOW_STATUS: completedtask ascontinue. - Do not leave passed reviewed routes without returning to
$ac-workflowfor final summary closeout. - Keep user-facing workflow progress and
[STATE]echo aligned with actual state in the active task state file.