write-plan

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Write Plan Skill

Write Plan Skill

Automatically capture every agent-produced plan as a discoverable file in
.agentic/plans/
— so plans are preserved locally but never pollute the git tree.
When a plan is tied to a GitHub issue and issue persistence is desired, prefer
github-issue-planning
for issue-backed plan persistence on GitHub (prefer MCP, fallback to
gh
CLI). Keep this skill as the local-file persistence path.
This skill is agent-invoked, not user-invoked. Do not prompt the user for metadata. Derive everything from context and write silently.

自动将Agent生成的所有计划捕获为.agentic/plans/目录下可检索的文件——这样计划会在本地保存,但不会污染Git提交历史。
如果计划关联到GitHub Issue,且需要将计划与Issue绑定存储,优先使用
github-issue-planning
在GitHub上实现基于Issue的计划存储(优先使用MCP,备选方案为
gh
CLI)。本技能仅作为本地文件存储方案。
本技能由Agent触发,而非用户触发。 请勿向用户请求元数据。所有信息均从上下文提取,静默执行写入操作。

Step 1 — Derive Metadata from Context

步骤1 — 从上下文提取元数据

Extract automatically — no prompts:
  • Title: from the plan's main heading or the task description.
  • Type: infer from the nature of the work:
    • feature
      — new capability being added
    • architecture
      — structural or design decision
    • decision
      — a choice between alternatives
    • refactor
      — improving existing code without behaviour change
    • investigation
      — exploring a problem or unknown
  • Status: always
    draft
    on auto-save.
  • Affected: list of modules, files, or systems touched by the plan.
  • Author: the agent name or model identifier.

自动提取——无需提示:
  • 标题:来自计划的主标题或任务描述。
  • 类型:根据工作性质推断:
    • feature
      — 新增功能
    • architecture
      — 架构或设计决策
    • decision
      — 多方案选择决策
    • refactor
      — 在不改变功能的前提下优化现有代码
    • investigation
      — 问题探索或未知领域调研
  • 状态:自动保存时始终为
    draft
    (草稿)。
  • 影响范围:计划涉及的模块、文件或系统列表。
  • 作者:Agent名称或模型标识符。

Step 2 — Build the Filename

步骤2 — 生成文件名

YYYY-MM-DD-{kebab-case-title}.md
Rules:
  • Use today's date in
    YYYY-MM-DD
    format.
  • Slugify the title: lowercase, replace spaces and special characters with
    -
    , strip leading/trailing hyphens.
  • If a file with the same slug already exists for today, append
    -2
    ,
    -3
    , etc.
Examples:
2026-04-04-add-golang-manual-di-skill.md
2026-04-04-refactor-auth-module.md

YYYY-MM-DD-{kebab-case-title}.md
规则:
  • 使用当日日期,格式为
    YYYY-MM-DD
  • 将标题转换为别名格式:小写,空格和特殊字符替换为
    -
    ,移除首尾的
    -
  • 如果当日已存在相同别名的文件,则追加
    -2
    -3
    等后缀。
示例:
2026-04-04-add-golang-manual-di-skill.md
2026-04-04-refactor-auth-module.md

Step 3 — Write the Plan File

步骤3 — 写入计划文件

Save to
.agentic/plans/{filename}
using
plan-template.md
as the structure.
Mandatory sections (never omit):
  • Context — what situation or problem prompted this plan?
  • Goals — verifiable bullet points (done / not done).
  • Approach — key decisions, alternatives considered, rationale.
  • Steps — ordered list of concrete tasks.
  • Risks & Open Questions — unknowns and blockers.
  • Outcome — leave blank; filled in when status moves to
    completed
    .

plan-template.md
为模板,将内容保存到
.agentic/plans/{filename}
必填章节(不可省略):
  • 背景:触发本计划的场景或问题是什么?
  • 目标:可验证的要点(完成/未完成)。
  • 方案:关键决策、备选方案及理由。
  • 步骤:具体任务的有序列表。
  • 风险与待解决问题:未知事项与阻碍因素。
  • 结果:留空;当状态变为
    completed
    (已完成)时填写。

Step 4 — Ensure
.agentic/plans/
is Gitignored

步骤4 — 确保
.agentic/plans/
已加入Git忽略列表

Check the project's
.gitignore
. If
.agentic/plans/
is not present, add it:
undefined
检查项目的
.gitignore
文件。如果
.agentic/plans/
未在其中,则添加:
undefined

Agentic — local plan files (managed by write-plan skill)

Agentic — local plan files (managed by write-plan skill)

.agentic/plans/

This ensures plan files are never accidentally committed.

---
.agentic/plans/

这可确保计划文件不会被意外提交。

---

Step 5 — Upsert the Plans Index

步骤5 — 更新计划索引

Append one row to
.agentic/plans/INDEX.md
. Create the file with this header if it does not exist:
markdown
undefined
.agentic/plans/INDEX.md
追加一行内容。如果该文件不存在,则创建并添加以下表头:
markdown
undefined

Plans Index

Plans Index

DateTitleTypeStatusFile

Append:
```markdown
| YYYY-MM-DD | {Title} | {Type} | {Status} | [{filename}]({filename}) |

DateTitleTypeStatusFile

追加内容:
```markdown
| YYYY-MM-DD | {Title} | {Type} | {Status} | [{filename}]({filename}) |

Step 6 — Clean Up Any PLAN.md

步骤6 — 清理所有PLAN.md文件

If a
PLAN.md
exists in the working directory or repo root, delete it after saving to
.agentic/plans/
. This is the primary reason this skill exists —
PLAN.md
at the repo root is a commit accident waiting to happen.

如果工作目录或代码仓库根目录中存在
PLAN.md
文件,在将计划保存到
.agentic/plans/
删除该文件。这正是本技能存在的主要原因——仓库根目录下的
PLAN.md
很容易被意外提交。

Step 7 — Report

步骤7 — 生成报告

Emit exactly one line:
Plan saved: .agentic/plans/{filename}
Do not emit anything else unless there was an error.
输出以下内容,且仅输出一行:
Plan saved: .agentic/plans/{filename}
除非发生错误,否则不得输出其他内容。