plot-idea

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Plot: Create Idea

Plot:创建Idea计划

Create a plan for review: idea branch, plan file, and draft PR.
Input:
$ARGUMENTS
in the format
<slug>: <title description>
Example:
/plot-idea sse-backpressure: Handle SSE client disconnects gracefully
<!-- keep in sync with plot/SKILL.md Setup -->
创建用于评审的计划:包括idea分支、计划文件和草稿PR。
输入: 格式为
<slug>: <title description>
$ARGUMENTS
示例:
/plot-idea sse-backpressure: Handle SSE client disconnects gracefully
<!-- 与plot/SKILL.md中的设置保持同步 -->

Setup

设置

Add a
## Plot Config
section to the adopting project's
CLAUDE.md
:
## Plot Config
- **Project board:** <your-project-name> (#<number>)  <!-- optional, for `gh pr edit --add-project` -->
- **Branch prefixes:** idea/, feature/, bug/, docs/, infra/
- **Plan directory:** docs/plans/
- **Active index:** docs/plans/active/
- **Delivered index:** docs/plans/delivered/
在待接入项目的
CLAUDE.md
中添加
## Plot Config
章节:
## Plot Config
- **项目看板:** <your-project-name> (#<number>)  <!-- 可选,用于`gh pr edit --add-project`命令 -->
- **分支前缀:** idea/, feature/, bug/, docs/, infra/
- **计划目录:** docs/plans/
- **活跃索引:** docs/plans/active/
- **已交付索引:** docs/plans/delivered/

Model Guidance

模型指导

StepsMin. TierNotes
1. Parse InputSmallString parsing
2. Pre-flight ChecksSmall (hard gate), Mid (soft warning)Slug collision is mechanical; title similarity needs mid-tier
3-8. Create Branch through SummarySmallGit/gh commands, templates, file ops
The entire skill is small-model capable except the soft duplicate warning (title similarity in step 2).
步骤最低模型层级说明
1. 解析输入Small字符串解析
2. 前置检查Small(硬性限制)、Mid(软性警告)Slug冲突为机械检查;标题相似度检查需要Mid层级模型
3-8. 创建分支至总结SmallGit/gh命令、模板、文件操作
除了标题相似度检查(步骤2中的软性警告)外,整个技能可由小型模型完成。

1. Parse Input

1. 解析输入

If
$ARGUMENTS
is empty or missing:
  • Look at the conversation context for clues about what the user wants to plan
  • If obvious, propose: "It looks like you want to plan
    <slug>: <title>
    . Shall I proceed?"
  • Otherwise ask: "What's the idea? Usage:
    /plot-idea <slug>: <title>
    "
Extract
slug
and
title
from
$ARGUMENTS
:
  • Everything before the first
    :
    is the slug (trimmed)
  • Everything after is the title (trimmed)
  • If no
    :
    found, treat the entire input as the slug and ask for a title
  • Slug must match
    [a-z0-9-]+
    (lowercase letters, digits, hyphens only). If it doesn't, ask the user to fix it rather than silently normalizing
如果
$ARGUMENTS
为空或缺失:
  • 查看对话上下文以获取用户想要创建的计划相关线索
  • 如果线索明确,提议:“看起来你想要创建计划
    <slug>: <title>
    。是否继续?”
  • 否则询问:“请提供你的创意?使用方式:
    /plot-idea <slug>: <title>
$ARGUMENTS
中提取
slug
title
  • 第一个
    :
    之前的所有内容为slug(去除首尾空格)
  • 第一个
    :
    之后的所有内容为title(去除首尾空格)
  • 如果未找到
    :
    ,将整个输入视为slug并询问用户提供title
  • Slug必须符合
    [a-z0-9-]+
    格式(仅包含小写字母、数字和连字符)。如果不符合,要求用户修正,而非自动标准化。

2. Pre-flight Checks

2. 前置检查

  • Warn if working tree has uncommitted changes (offer to stash)
  • Verify
    gh auth status
    has project scope
  • Check that branch
    idea/<slug>
    does not already exist (if it does, ask whether to check it out or pick a new name)
  • Duplicate detection:
    • ls docs/plans/active/ 2>/dev/null
      +
      gh pr list --json headRefName --jq '.[].headRefName' | grep '^idea/'
      to find existing plans and idea branches
    • Hard gate: if a plan with the identical slug already exists (file or branch), stop and ask the user to pick a different name
    • Soft warning: if any existing plan title shares 3+ significant words with the proposed title, warn the user and ask to confirm this is intentionally separate work (only check Draft/Approved plans, not Delivered ones)
Smaller models: Skip the title similarity check. Enforce the hard gate (identical slug) only. Ask the user: "Could not check for similar plan titles. Please verify manually that this doesn't overlap with existing plans."
  • 如果工作区存在未提交的更改,发出警告(提供暂存选项)
  • 验证
    gh auth status
    是否具有项目权限范围
  • 检查
    idea/<slug>
    分支是否已存在(如果存在,询问用户是要检出该分支还是选择新名称)
  • 重复检测:
    • 通过
      ls docs/plans/active/ 2>/dev/null
      +
      gh pr list --json headRefName --jq '.[].headRefName' | grep '^idea/'
      查找现有计划和idea分支
    • 硬性限制: 如果存在完全相同slug的计划(文件或分支),停止操作并要求用户选择不同名称
    • 软性警告: 如果任何现有计划的标题与提议标题有3个以上重要词汇重合,向用户发出警告并确认这是否为独立的工作(仅检查草稿/已批准的计划,不包括已交付的计划)
小型模型说明: 跳过标题相似度检查,仅执行硬性限制(相同slug)。询问用户:“无法检查相似计划标题,请手动确认该计划与现有计划无重叠。”

3. Create Branch

3. 创建分支

bash
git fetch origin main
git checkout -b idea/<slug> origin/main
bash
git fetch origin main
git checkout -b idea/<slug> origin/main

4. Create Plan File

4. 创建计划文件

bash
CREATE_DATE=$(date -u +%Y-%m-%d)
Write
docs/plans/${CREATE_DATE}-<slug>.md
with this template:
markdown
undefined
bash
CREATE_DATE=$(date -u +%Y-%m-%d)
使用以下模板创建
docs/plans/${CREATE_DATE}-<slug>.md
文件:
markdown
undefined

<title>

<title>

<title as one-line summary>
<title的单行摘要>

Status

状态

  • Phase: Draft
  • Type: feature | bug | docs | infra
  • Sprint: <!-- optional, filled when plan is added to a sprint -->
  • 阶段: 草稿
  • 类型: feature | bug | docs | infra
  • 迭代周期: <!-- 可选,当计划加入迭代时填写 -->

Changelog

变更日志

<!-- Release note entry. Written during planning, refined during implementation. -->
  • <user-facing change description>
<!-- 发布说明条目。在规划阶段编写,在实现阶段完善。 -->
  • <面向用户的变更描述>

Motivation

动机

<!-- Why does this matter? What problem does it solve? -->
<!-- 该计划的重要性是什么?解决了什么问题? -->

Design

设计

Approach

实现方案

<!-- How will this be implemented? Key architectural decisions. -->
<!-- 如何实现?关键架构决策是什么? -->

Open Questions

待解决问题

  • ...
  • ...

Branches

分支规划

<!-- Branches to create when approved: --> <!-- - `type/name` — description -->
  • feature/<slug>
    <description>
<!-- 计划批准后要创建的分支: --> <!-- - `type/name` — 描述 -->
  • feature/<slug>
    — <描述>

Notes

备注

<!-- Session log, decisions, links -->

Ask the user what **Type** to use, presenting this reference:

| Type | Use when | Examples |
|------|----------|----------|
| `feature` | New user-facing functionality | API endpoint, UI component, CLI command |
| `bug` | Fixing a defect | Crash fix, data corruption, incorrect output |
| `docs` | Documentation-only | README updates, API docs, guides |
| `infra` | CI, build, tooling, release automation | GitHub Actions, Dockerfile, linter config, deps |

Always ask — don't infer from the title.
<!-- 会话日志、决策记录、相关链接 -->

询问用户要使用的**类型**,并提供以下参考:

| 类型 | 使用场景 | 示例 |
|------|----------|----------|
| `feature` | 新增面向用户的功能 | API端点、UI组件、CLI命令 |
| `bug` | 修复缺陷 | 崩溃修复、数据损坏修复、输出错误修复 |
| `docs` | 仅更新文档 | README更新、API文档、使用指南 |
| `infra` | CI、构建、工具链、发布自动化 | GitHub Actions、Dockerfile、代码检查器配置、依赖管理 |

必须询问用户,不要从标题推断类型。

5. Create Active Symlink and Commit

5. 创建活跃索引软链接并提交

bash
mkdir -p docs/plans/active docs/plans/delivered
ln -s ../${CREATE_DATE}-<slug>.md docs/plans/active/<slug>.md
git add docs/plans/${CREATE_DATE}-<slug>.md docs/plans/active/<slug>.md
git commit -m "plot: <title>"
git push -u origin idea/<slug>
bash
mkdir -p docs/plans/active docs/plans/delivered
ln -s ../${CREATE_DATE}-<slug>.md docs/plans/active/<slug>.md
git add docs/plans/${CREATE_DATE}-<slug>.md docs/plans/active/<slug>.md
git commit -m "plot: <title>"
git push -u origin idea/<slug>

6. Create PR

6. 创建PR

Create a draft PR (plan is still being written/refined):
bash
gh pr create \
  --draft \
  --title "Plan: <title>" \
  --body "$(cat <<'EOF'
创建草稿PR(计划仍在编写/完善中):
bash
gh pr create \
  --draft \
  --title "Plan: <title>" \
  --body "$(cat <<'EOF'

Plan

计划详情

See
docs/plans/${CREATE_DATE}-<slug>.md
on this branch.
Refine the plan, then mark ready for review with
gh pr ready
. Once reviewed, run
/plot-approve <slug>
to merge and start implementation.

Created with
/plot-idea
EOF )"
undefined
查看本分支上的
docs/plans/${CREATE_DATE}-<slug>.md
文件。
完善计划后,使用
gh pr ready
命令标记为可评审状态。评审通过后,运行
/plot-approve <slug>
命令合并并开始实现。

通过
/plot-idea
命令创建
EOF )"
undefined

7. Add to Project Board

7. 添加至项目看板

Read the
## Plot Config
section from
CLAUDE.md
for the project board name. If configured:
bash
gh pr edit <number> --add-project "<project board name>"
If no project board is configured, skip this step.
CLAUDE.md
## Plot Config
章节中读取项目看板名称。如果已配置:
bash
gh pr edit <number> --add-project "<project board name>"
如果未配置项目看板,则跳过此步骤。

8. Summary

8. 总结

Print:
  • Branch:
    idea/<slug>
  • Plan file:
    docs/plans/<CREATE_DATE>-<slug>.md
  • Active index:
    docs/plans/active/<slug>.md
    (symlink)
  • PR URL (draft)
  • Next steps:
    1. Refine the plan (especially the Branches section)
    2. When ready for review:
      gh pr ready <number>
    3. After review:
      /plot-approve <slug>
输出以下内容:
  • 分支:
    idea/<slug>
  • 计划文件:
    docs/plans/<CREATE_DATE>-<slug>.md
  • 活跃索引:
    docs/plans/active/<slug>.md
    (软链接)
  • PR链接(草稿状态)
  • 后续步骤:
    1. 完善计划(尤其是分支规划章节)
    2. 准备好评审时:
      gh pr ready <number>
    3. 评审通过后:
      /plot-approve <slug>