SuperAPI AI Directory

ac-workflow

Office & productivity

View repository

Updated 10-15 17:30

About this skill

Agent Context Workflow (ac-workflow)

Strictly based onreferencesthe files in as the development workflow protocol:

  • init: Initialize project context; there are different processing flows depending on whether it is a new project or an old project.
  • plan: Produce a plan for the requirements, split tasks.
  • replan: Redo the plan, adjust the approach.
  • implement: Start working according to the plan, implement the current plan.
  • rush: Quickly produce a plan and implement it, equivalent to the consecutive execution of plan + implement .
  • patch: After implementation, if dissatisfied, add requirements, or fix problems.
  • review: Review the implementation results.
  • done: The task is completely finished, archive the current plan.

Supreme Rules

Step 1: Obtain Context (Mandatory, Cannot Be Skipped)

Before executing any protocol or decision, you must first run the following script in the shell to obtain a context snapshot:

node <SKILL_DIR>/scripts/get-context-info.js

Where <SKILL_DIR> is the directory path where this SKILL.md file is located.

The script outputs JSON, containing the following key fields (subsequent protocol steps directly reference these values; it is forbidden to explore the file system yourself to obtain them):

Field Meaning
scope Current scope name
currentPlanStatus Current plan status:"未执行" / "已执行" / null(no plan)
currentPlanNumber Current plan number (when there is no plan, it is null)
currentPlanDir Current plan directory path (when there is no plan, it is null)
currentPlanFile Current plan file path (when there is no plan, it is null)
nextPlanNumber Next available plan number
nextPatchNumber Next available patch number (when there is no plan, it is null)

This step is the prerequisite for all operations. If the script is not executed → do not enter any protocol. If the script reports an error → correct it according to the error message and rerun until successful.

Step 2: Global Validation

Run in the shell agent-context validate. If it does not pass, correct the corresponding content according to the error message (such as fixing the status line format, completing missing files, etc.), then rerun the validation after correction, repeating until it passes.

Mandatory Rules

  • Protocol First: After selecting a protocol,completelyread references/<protocol>.md and then execute it step by step; it is forbidden to skip protocol steps based on memory, summaries, or guesses
  • No Direct Changes: In plan / rush before a plan is created, business code must not be modified; code changes are only made in the implement or patch protocol
  • Sequential Execution: Steps within a protocol are executed in numerical order, without skipping steps, merging, or parallelizing
  • Questioning and Guidance Standards: When using AskUserQuestion, you must comply with references/ask-user-question.md

Protocol Selection Decision

If the user explicitly specifies a protocol to execute, exit the protocol selection decision and directly execute that protocol.

The current state must be determined based on the script output currentPlanStatus , and then the protocol must be selected according to the table below. It is forbidden to skip state judgment and directly match actions.

State A:currentPlanStatus is null(no current plan)

User intent Action Protocol File
Initialize project context, complete AGENTS.md init references/init.md
Create a plan for the requirement, break down tasks plan references/plan.md
Quickly produce a plan and implement it rush references/rush.md

State B:currentPlanStatus is "未执行"

User Intent Action Protocol File
Start working according to the plan, implement the current plan implement references/implement.md
Redo the plan, adjust the approach replan references/replan.md
Review the current plan review references/review.md
The user raises a new requirement and it is with the current planrelated replan references/replan.md
The user raises a new requirement and it is with the current planunrelated → AskUserQuestion Options: 1) Archive the current plan and then create a new plan (recommended) 2) Terminate the operation

State C:currentPlanStatus is "已执行"

User Intent Action Protocol File
Dissatisfied after implementation, additional requirements, fix issues patch references/patch.md
Review the implementation result review references/review.md
The task is completely finished, archive the current plan done Run agent-context done
The user raises a new requirement and it is with the current planrelated patch references/patch.md
The user raises a new requirement and it is with the current planunrelated → AskUserQuestion Options: 1) Archive and then create a new plan (recommended) 2) Terminate the operation

Relevance determination: When the user raises a change requirement, compare it against the current plan.md of the ## 目标 to determine relevance. If it cannot be determined → have the user confirm via AskUserQuestion.

Global Constraints

  • Plan has two states:未执行、已执行。
  • At most one current plan at any time:.agent-context/{scope}/plan-{number}。
  • Plan numbers start from 1 and increase globally, and are not reused. Patch numbers start from 1 and increase within a single plan directory, and are not reused.
  • Impact scope (## 影响范围) must not include files under the .agent-context/ directory.
  • The nextPlanNumber and nextPatchNumber in the script output are precomputed values; when the protocol requires numbering,use them directly, and do not scan the directory to calculate them yourself.

Context Directory Structure

.agent-context/
├── .env               # SCOPE 配置(SCOPE=<name>)
├── .gitignore
└── {scope}/           # 作用域目录(按协作者隔离)
    ├── plan-{N}/      # 当前计划(最多一个)
    │   ├── plan.md
    │   └── patch-{N}.md
    ├── preparing/     # 待执行计划队列
    │   └── plan-{N}/
    └── done/          # 已归档计划
        └── plan-{N}-{YYYYMMDD}/