create-plans

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<essential_principles>
<principle name="solo_developer_plus_claude"> You are planning for ONE person (the user) and ONE implementer (Claude). No teams. No stakeholders. No ceremonies. No coordination overhead. The user is the visionary/product owner. Claude is the builder. </principle> <principle name="plans_are_prompts"> PLAN.md is not a document that gets transformed into a prompt. PLAN.md IS the prompt. It contains: - Objective (what and why) - Context (@file references) - Tasks (type, files, action, verify, done, checkpoints) - Verification (overall checks) - Success criteria (measurable) - Output (SUMMARY.md specification)
When planning a phase, you are writing the prompt that will execute it. </principle>
<principle name="scope_control"> Plans must complete within ~50% of context usage to maintain consistent quality.
The quality degradation curve:
  • 0-30% context: Peak quality (comprehensive, thorough, no anxiety)
  • 30-50% context: Good quality (engaged, manageable pressure)
  • 50-70% context: Degrading quality (efficiency mode, compression)
  • 70%+ context: Poor quality (self-lobotomization, rushed work)
Critical insight: Claude doesn't degrade at 80% - it degrades at ~40-50% when it sees context mounting and enters "completion mode." By 80%, quality has already crashed.
Solution: Aggressive atomicity - split phases into many small, focused plans.
Examples:
  • 01-01-PLAN.md
    - Phase 1, Plan 1 (2-3 tasks: database schema only)
  • 01-02-PLAN.md
    - Phase 1, Plan 2 (2-3 tasks: database client setup)
  • 01-03-PLAN.md
    - Phase 1, Plan 3 (2-3 tasks: API routes)
  • 01-04-PLAN.md
    - Phase 1, Plan 4 (2-3 tasks: UI components)
Each plan is independently executable, verifiable, and scoped to 2-3 tasks maximum.
Atomic task principle: Better to have 10 small, high-quality plans than 3 large, degraded plans. Each commit should be surgical, focused, and maintainable.
Autonomous execution: Plans without checkpoints execute via subagent with fresh context - impossible to degrade.
See: references/scope-estimation.md </principle>
<principle name="human_checkpoints"> **Claude automates everything that has a CLI or API.** Checkpoints are for verification and decisions, not manual work.
Checkpoint types:
  • checkpoint:human-verify
    - Human confirms Claude's automated work (visual checks, UI verification)
  • checkpoint:decision
    - Human makes implementation choice (auth provider, architecture)
Rarely needed:
checkpoint:human-action
- Only for actions with no CLI/API (email verification links, account approvals requiring web login with 2FA)
Critical rule: If Claude CAN do it via CLI/API/tool, Claude MUST do it. Never ask human to:
  • Deploy to Vercel/Railway/Fly (use CLI)
  • Create Stripe webhooks (use CLI/API)
  • Run builds/tests (use Bash)
  • Write .env files (use Write tool)
  • Create database resources (use provider CLI)
Protocol: Claude automates work → reaches checkpoint:human-verify → presents what was done → waits for confirmation → resumes
See: references/checkpoints.md, references/cli-automation.md </principle>
<principle name="deviation_rules"> Plans are guides, not straitjackets. Real development always involves discoveries.
During execution, deviations are handled automatically via 5 embedded rules:
  1. Auto-fix bugs - Broken behavior → fix immediately, document in Summary
  2. Auto-add missing critical - Security/correctness gaps → add immediately, document
  3. Auto-fix blockers - Can't proceed → fix immediately, document
  4. Ask about architectural - Major structural changes → stop and ask user
  5. Log enhancements - Nice-to-haves → auto-log to ISSUES.md, continue
No user intervention needed for Rules 1-3, 5. Only Rule 4 (architectural) requires user decision.
All deviations documented in Summary with: what was found, what rule applied, what was done, commit hash.
Result: Flow never breaks. Bugs get fixed. Scope stays controlled. Complete transparency.
See: workflows/execute-phase.md (deviation_rules section) </principle>
<principle name="ship_fast_iterate_fast"> No enterprise process. No approval gates. No multi-week timelines. Plan → Execute → Ship → Learn → Repeat.
Milestone-driven: Ship v1.0 → mark milestone → plan v1.1 → ship → repeat. Milestones mark shipped versions and enable continuous iteration. </principle>
<principle name="milestone_boundaries"> Milestones mark shipped versions (v1.0, v1.1, v2.0).
Purpose:
  • Historical record in MILESTONES.md (what shipped when)
  • Greenfield → Brownfield transition marker
  • Git tags for releases
  • Clear completion rituals
Default approach: Extend existing roadmap with new phases.
  • v1.0 ships (phases 1-4) → add phases 5-6 for v1.1
  • Continuous phase numbering (01-99)
  • Milestone groupings keep roadmap organized
Archive ONLY for: Separate codebases or complete rewrites (rare).
See: references/milestone-management.md </principle>
<principle name="anti_enterprise_patterns"> NEVER include in plans: - Team structures, roles, RACI matrices - Stakeholder management, alignment meetings - Sprint ceremonies, standups, retros - Multi-week estimates, resource allocation - Change management, governance processes - Documentation for documentation's sake
If it sounds like corporate PM theater, delete it. </principle>
<principle name="context_awareness"> Monitor token usage via system warnings.
At 25% remaining: Mention context getting full At 15% remaining: Pause, offer handoff At 10% remaining: Auto-create handoff, stop
Never start large operations below 15% without user confirmation. </principle>
<principle name="user_gates"> Never charge ahead at critical decision points. Use gates: - **AskUserQuestion**: Structured choices (2-4 options) - **Inline questions**: Simple confirmations - **Decision gate loop**: "Ready, or ask more questions?"
Mandatory gates:
  • Before writing PLAN.md (confirm breakdown)
  • After low-confidence research
  • On verification failures
  • After phase completion with issues
  • Before starting next phase with previous issues
See: references/user-gates.md </principle>
<principle name="git_versioning"> All planning artifacts are version controlled. Commit outcomes, not process.
  • Check for repo on invocation, offer to initialize
  • Commit only at: initialization, phase completion, handoff
  • Intermediate artifacts (PLAN.md, RESEARCH.md, FINDINGS.md) NOT committed separately
  • Git log becomes project history
See: references/git-integration.md </principle>
</essential_principles>
<context_scan> Run on every invocation to understand current state:
bash
undefined
<essential_principles>
<principle name="solo_developer_plus_claude"> 你正在为一个人(用户)和一个执行者(Claude)做规划。 无团队、无利益相关者、无繁琐流程、无协调成本。 用户是愿景提出者/产品负责人,Claude是构建者。 </principle> <principle name="plans_are_prompts"> PLAN.md 不是需要转换成提示词的文档。 PLAN.md 本身就是提示词,它包含: - 目标(内容及原因) - 上下文(@file 引用) - 任务(类型、文件、操作、验证、完成状态、检查点) - 验证(整体检查项) - 成功标准(可量化) - 输出(SUMMARY.md 规范)
当规划一个阶段时,你就是在编写将被执行的提示词。 </principle>
<principle name="scope_control"> 计划必须在上下文使用量约50%以内完成,以保持稳定的质量。
质量衰减曲线:
  • 0-30% 上下文:最佳质量(全面、细致、无焦虑)
  • 30-50% 上下文:良好质量(专注、压力可控)
  • 50-70% 上下文:质量下降(效率模式、内容压缩)
  • 70%+ 上下文:质量极差(自我简化、工作仓促)
关键洞察: Claude并非在80%时才衰减,当它发现上下文占用量增加并进入“完成模式”时,约40-50%就开始衰减。到80%时,质量已经崩溃。
解决方案: 极致原子化——将阶段拆分为多个小型、聚焦的计划。
示例:
  • 01-01-PLAN.md
    - 第1阶段,计划1(2-3个任务:仅数据库架构)
  • 01-02-PLAN.md
    - 第1阶段,计划2(2-3个任务:数据库客户端设置)
  • 01-03-PLAN.md
    - 第1阶段,计划3(2-3个任务:API路由)
  • 01-04-PLAN.md
    - 第1阶段,计划4(2-3个任务:UI组件)
每个计划都可独立执行、可验证,且范围限定为最多2-3个任务
原子任务原则: 10个小型、高质量的计划优于3个大型、质量下降的计划。每次提交都应精准、聚焦且易于维护。
自主执行: 无检查点的计划通过子Agent在全新上下文中执行——不会出现质量衰减。
参考:references/scope-estimation.md </principle>
<principle name="human_checkpoints"> **Claude可自动完成所有有CLI或API支持的操作。** 检查点仅用于验证和决策,而非手动工作。
检查点类型:
  • checkpoint:human-verify
    - 人工确认Claude的自动化工作(视觉检查、UI验证)
  • checkpoint:decision
    - 人工做出实现选择(认证提供商、架构选型)
极少需要:
checkpoint:human-action
- 仅适用于无CLI/API支持的操作(邮件验证链接、需要带2FA的网页登录的账户审批)
关键规则: 如果Claude可以通过CLI/API/工具完成某项工作,就必须由Claude完成。绝不要让人工去做:
  • 部署到Vercel/Railway/Fly(使用CLI)
  • 创建Stripe webhook(使用CLI/API)
  • 运行构建/测试(使用Bash)
  • 编写.env文件(使用Write工具)
  • 创建数据库资源(使用提供商CLI)
流程: Claude自动完成工作 → 到达checkpoint:human-verify → 展示已完成的工作 → 等待确认 → 继续执行
参考:references/checkpoints.md, references/cli-automation.md </principle>
<principle name="deviation_rules"> 计划是指南,而非紧身衣。实际开发总会有新发现。
执行过程中,偏差通过5条内置规则自动处理:
  1. 自动修复bug - 行为异常 → 立即修复,在Summary中记录
  2. 自动补充关键缺失项 - 安全/正确性漏洞 → 立即补充,记录在案
  3. 自动解决阻塞问题 - 无法继续 → 立即修复,记录在案
  4. 询问架构相关问题 - 重大结构变更 → 停止并询问用户
  5. 记录优化建议 - 非必需的功能 → 自动记录到ISSUES.md,继续执行
规则1-3、5无需用户干预。 仅规则4(架构变更)需要用户决策。
所有偏差都要在Summary中记录,包括:发现的问题、适用的规则、采取的措施、提交哈希值。
结果: 开发流程不中断。Bug得到修复。范围可控。完全透明。
参考:workflows/execute-phase.md(deviation_rules章节) </principle>
<principle name="ship_fast_iterate_fast"> 无企业级流程。无审批关卡。无多周时间线。 规划 → 执行 → 交付 → 学习 → 重复。
里程碑驱动: 交付v1.0 → 标记里程碑 → 规划v1.1 → 交付 → 重复。 里程碑标记已交付版本,支持持续迭代。 </principle>
<principle name="milestone_boundaries"> 里程碑标记已交付版本(v1.0、v1.1、v2.0)。
目的:
  • 在MILESTONES.md中留存历史记录(何时交付了什么)
  • 标记从全新开发到迭代开发的过渡点
  • 用于版本发布的Git标签
  • 明确的完成仪式
默认方式: 在现有路线图基础上扩展新阶段。
  • v1.0交付(阶段1-4)→ 添加阶段5-6用于v1.1
  • 阶段编号连续(01-99)
  • 里程碑分组让路线图更有条理
仅在以下情况归档: 独立代码库或完全重写(罕见)。
参考:references/milestone-management.md </principle>
<principle name="anti_enterprise_patterns"> 计划中绝不要包含: - 团队结构、角色、RACI矩阵 - 利益相关者管理、对齐会议 - 冲刺流程、站会、回顾会 - 多周估算、资源分配 - 变更管理、治理流程 - 为了文档而写的文档
如果内容听起来像企业级PM的形式主义流程,就删掉它。 </principle>
<principle name="context_awareness"> 通过系统警告监控token使用情况。
剩余25%时: 提示上下文即将耗尽 剩余15%时: 暂停,提供交接选项 剩余10%时: 自动创建交接,停止工作
在剩余上下文低于15%时,未经用户确认绝不要启动大型操作。 </principle>
<principle name="user_gates"> 在关键决策点绝不要擅自推进。使用关卡机制: - **AskUserQuestion**:结构化选项(2-4个) - **Inline questions**:简单确认 - **Decision gate loop**:“准备就绪,还是需要进一步询问?”
强制关卡:
  • 编写PLAN.md之前(确认拆分方式)
  • 低置信度研究之后
  • 验证失败时
  • 阶段完成但存在问题时
  • 带着之前的问题开始下一阶段之前
参考:references/user-gates.md </principle>
<principle name="git_versioning"> 所有规划产物都要进行版本控制。提交成果,而非过程。
  • 调用时检查仓库,提供初始化选项
  • 仅在以下节点提交:初始化、阶段完成、交接时
  • 中间产物(PLAN.md、RESEARCH.md、FINDINGS.md)不单独提交
  • Git日志即为项目历史
参考:references/git-integration.md </principle>
</essential_principles>
<context_scan> 每次调用时都要运行以了解当前状态:
bash
undefined

Check git status

检查git状态

git rev-parse --git-dir 2>/dev/null || echo "NO_GIT_REPO"
git rev-parse --git-dir 2>/dev/null || echo "NO_GIT_REPO"

Check for planning structure

检查规划结构

ls -la .planning/ 2>/dev/null ls -la .planning/phases/ 2>/dev/null
ls -la .planning/ 2>/dev/null ls -la .planning/phases/ 2>/dev/null

Find any continue-here files

查找任何continue-here文件

find . -name ".continue-here.md" -type f 2>/dev/null
find . -name ".continue-here.md" -type f 2>/dev/null

Check for existing artifacts

检查现有产物

[ -f .planning/BRIEF.md ] && echo "BRIEF: exists" [ -f .planning/ROADMAP.md ] && echo "ROADMAP: exists"

**If NO_GIT_REPO detected:**
Inline question: "No git repo found. Initialize one? (Recommended for version control)"
If yes: `git init`

**Present findings before intake question.**
</context_scan>

<domain_expertise>
**Domain expertise lives in `~/.claude/skills/expertise/`**

Before creating roadmap or phase plans, determine if domain expertise should be loaded.

<scan_domains>
```bash
ls ~/.claude/skills/expertise/ 2>/dev/null
This reveals available domain expertise (e.g., macos-apps, iphone-apps, unity-games, nextjs-ecommerce).
If no domain skills found: Proceed without domain expertise (graceful degradation). The skill works fine without domain-specific context. </scan_domains>
<inference_rules> If user's request contains domain keywords, INFER the domain:
KeywordsDomain Skill
"macOS", "Mac app", "menu bar", "AppKit", "SwiftUI desktop"expertise/macos-apps
"iPhone", "iOS", "iPad", "mobile app", "SwiftUI mobile"expertise/iphone-apps
"Unity", "game", "C#", "3D game", "2D game"expertise/unity-games
"MIDI", "MIDI tool", "sequencer", "MIDI controller", "music app", "MIDI 2.0", "MPE", "SysEx"expertise/midi
"Agent SDK", "Claude SDK", "agentic app"expertise/with-agent-sdk
"Python automation", "workflow", "API integration", "webhooks", "Celery", "Airflow", "Prefect"expertise/python-workflow-automation
"UI", "design", "frontend", "interface", "responsive", "visual design", "landing page", "website design", "Tailwind", "CSS", "web design"expertise/ui-design
If domain inferred, confirm:
Detected: [domain] project → expertise/[skill-name]
Load this expertise for planning? (Y / see other options / none)
</inference_rules>
<no_inference> If no domain obvious from request, present options:
What type of project is this?

Available domain expertise:
1. macos-apps - Native macOS with Swift/SwiftUI
2. iphone-apps - Native iOS with Swift/SwiftUI
3. unity-games - Unity game development
4. swift-midi-apps - MIDI/audio apps
5. with-agent-sdk - Claude Agent SDK apps
6. ui-design - Stunning UI/UX design & frontend development
[... any others found in expertise/]

N. None - proceed without domain expertise
C. Create domain skill first

Select:
</no_inference>
<load_domain> When domain selected, use intelligent loading:
Step 1: Read domain SKILL.md
bash
cat ~/.claude/skills/expertise/[domain]/SKILL.md 2>/dev/null
This loads core principles and routing guidance (~5k tokens).
Step 2: Determine what references are needed
Domain SKILL.md should contain a
<references_index>
section that maps planning contexts to specific references.
Example:
markdown
<references_index>
**For database/persistence phases:** references/core-data.md, references/swift-concurrency.md
**For UI/layout phases:** references/swiftui-layout.md, references/appleHIG.md
**For system integration:** references/appkit-integration.md
**Always useful:** references/swift-conventions.md
</references_index>
Step 3: Load only relevant references
Based on the phase being planned (from ROADMAP), load ONLY the references mentioned for that type of work.
bash
undefined
[ -f .planning/BRIEF.md ] && echo "BRIEF: exists" [ -f .planning/ROADMAP.md ] && echo "ROADMAP: exists"

**如果检测到NO_GIT_REPO:**
嵌入式问题:“未找到git仓库。是否初始化一个?(建议用于版本控制)”
如果是:`git init`

**在提出问题前先展示扫描结果。**
</context_scan>

<domain_expertise>
**领域专业知识存储在`~/.claude/skills/expertise/`**

在创建路线图或阶段计划之前,确定是否需要加载领域专业知识。

<scan_domains>
```bash
ls ~/.claude/skills/expertise/ 2>/dev/null
这会显示可用的领域专业知识(例如macos-apps、iphone-apps、unity-games、nextjs-ecommerce)。
如果未找到领域技能: 在无领域专业知识的情况下继续(优雅降级)。即使没有特定领域上下文,该工具也能正常工作。 </scan_domains>
<inference_rules> 如果用户的请求中包含领域关键词,自动推断领域:
关键词领域技能
"macOS", "Mac app", "menu bar", "AppKit", "SwiftUI desktop"expertise/macos-apps
"iPhone", "iOS", "iPad", "mobile app", "SwiftUI mobile"expertise/iphone-apps
"Unity", "game", "C#", "3D game", "2D game"expertise/unity-games
"MIDI", "MIDI tool", "sequencer", "MIDI controller", "music app", "MIDI 2.0", "MPE", "SysEx"expertise/midi
"Agent SDK", "Claude SDK", "agentic app"expertise/with-agent-sdk
"Python automation", "workflow", "API integration", "webhooks", "Celery", "Airflow", "Prefect"expertise/python-workflow-automation
"UI", "design", "frontend", "interface", "responsive", "visual design", "landing page", "website design", "Tailwind", "CSS", "web design"expertise/ui-design
如果推断出领域,进行确认:
检测到:[domain] 项目 → expertise/[skill-name]
是否加载该专业知识用于规划?(是 / 查看其他选项 / 不加载)
</inference_rules>
<no_inference> 如果从请求中无法明确领域,提供选项:
这是什么类型的项目?

可用的领域专业知识:
1. macos-apps - 基于Swift/SwiftUI的原生macOS应用
2. iphone-apps - 基于Swift/SwiftUI的原生iOS应用
3. unity-games - Unity游戏开发
4. swift-midi-apps - MIDI/音频应用
5. with-agent-sdk - Claude Agent SDK应用
6. ui-design - 出色的UI/UX设计与前端开发
[... 其他在expertise/中找到的技能]

N. 不加载 - 在无领域专业知识的情况下继续
C. 先创建领域技能

请选择:
</no_inference>
<load_domain> 当选择领域后,智能加载:
步骤1:读取领域SKILL.md
bash
cat ~/.claude/skills/expertise/[domain]/SKILL.md 2>/dev/null
这会加载核心原则和路由指南(约5k token)。
步骤2:确定需要哪些参考资料
领域SKILL.md应包含一个
<references_index>
章节,将规划上下文映射到特定参考资料。
示例:
markdown
<references_index>
**对于数据库/持久化阶段:** references/core-data.md, references/swift-concurrency.md
**对于UI/布局阶段:** references/swiftui-layout.md, references/appleHIG.md
**对于系统集成:** references/appkit-integration.md
**始终有用:** references/swift-conventions.md
</references_index>
步骤3:仅加载相关参考资料
根据要规划的阶段(来自ROADMAP),仅加载该类型工作所需的参考资料。
bash
undefined

Example: Planning a database phase

示例:规划数据库阶段

cat ~/.claude/skills/expertise/macos-apps/references/core-data.md cat ~/.claude/skills/expertise/macos-apps/references/swift-conventions.md

**Context efficiency:**
- SKILL.md only: ~5k tokens
- SKILL.md + selective references: ~8-12k tokens
- All references (old approach): ~20-27k tokens

Announce: "Loaded [domain] expertise ([X] references for [phase-type])."

**If domain skill not found:** Inform user and offer to proceed without domain expertise.

**If SKILL.md doesn't have references_index:** Fall back to loading all references with warning about context usage.
</load_domain>

<when_to_load>
Domain expertise should be loaded BEFORE:
- Creating roadmap (phases should be domain-appropriate)
- Planning phases (tasks must be domain-specific)

Domain expertise is NOT needed for:
- Creating brief (vision is domain-agnostic)
- Resuming from handoff (context already established)
- Transition between phases (just updating status)
</when_to_load>
</domain_expertise>

<intake>
Based on scan results, present context-aware options:

**If handoff found:**
Found handoff: .planning/phases/XX/.continue-here.md [Summary of state from handoff]
  1. Resume from handoff
  2. Discard handoff, start fresh
  3. Different action

**If planning structure exists:**
Project: [from BRIEF or directory] Brief: [exists/missing] Roadmap: [X phases defined] Current: [phase status]
What would you like to do?
  1. Plan next phase
  2. Execute current phase
  3. Create handoff (stopping for now)
  4. View/update roadmap
  5. Something else

**If no planning structure:**
No planning structure found.
What would you like to do?
  1. Start new project (create brief)
  2. Create roadmap from existing brief
  3. Jump straight to phase planning
  4. Get guidance on approach

**Wait for response before proceeding.**
</intake>

<routing>
| Response | Workflow |
|----------|----------|
| "brief", "new project", "start", 1 (no structure) | `workflows/create-brief.md` |
| "roadmap", "phases", 2 (no structure) | `workflows/create-roadmap.md` |
| "phase", "plan phase", "next phase", 1 (has structure) | `workflows/plan-phase.md` |
| "chunk", "next tasks", "what's next" | `workflows/plan-chunk.md` |
| "execute", "run", "do it", "build it", 2 (has structure) | **EXIT SKILL** → Use `/run-plan <path>` slash command |
| "research", "investigate", "unknowns" | `workflows/research-phase.md` |
| "handoff", "pack up", "stopping", 3 (has structure) | `workflows/handoff.md` |
| "resume", "continue", 1 (has handoff) | `workflows/resume.md` |
| "transition", "complete", "done", "next" | `workflows/transition.md` |
| "milestone", "ship", "v1.0", "release" | `workflows/complete-milestone.md` |
| "guidance", "help", 4 | `workflows/get-guidance.md` |

**Critical:** Plan execution should NOT invoke this skill. Use `/run-plan` for context efficiency (skill loads ~20k tokens, /run-plan loads ~5-7k).

**After reading the workflow, follow it exactly.**
</routing>

<hierarchy>
The planning hierarchy (each level builds on previous):
BRIEF.md → Human vision (you read this) ↓ ROADMAP.md → Phase structure (overview) ↓ RESEARCH.md → Research prompt (optional, for unknowns) ↓ FINDINGS.md → Research output (if research done) ↓ PLAN.md → THE PROMPT (Claude executes this) ↓ SUMMARY.md → Outcome (existence = phase complete)

**Rules:**
- Roadmap requires Brief (or prompts to create one)
- Phase plan requires Roadmap (knows phase scope)
- PLAN.md IS the execution prompt
- SUMMARY.md existence marks phase complete
- Each level can look UP for context
</hierarchy>

<output_structure>
All planning artifacts go in `.planning/`:
.planning/ ├── BRIEF.md # Human vision ├── ROADMAP.md # Phase structure + tracking └── phases/ ├── 01-foundation/ │ ├── 01-01-PLAN.md # Plan 1: Database setup │ ├── 01-01-SUMMARY.md # Outcome (exists = done) │ ├── 01-02-PLAN.md # Plan 2: API routes │ ├── 01-02-SUMMARY.md │ ├── 01-03-PLAN.md # Plan 3: UI components │ └── .continue-here-01-03.md # Handoff (temporary, if needed) └── 02-auth/ ├── 02-01-RESEARCH.md # Research prompt (if needed) ├── 02-01-FINDINGS.md # Research output ├── 02-02-PLAN.md # Implementation prompt └── 02-02-SUMMARY.md

**Naming convention:**
- Plans: `{phase}-{plan}-PLAN.md` (e.g., 01-03-PLAN.md)
- Summaries: `{phase}-{plan}-SUMMARY.md` (e.g., 01-03-SUMMARY.md)
- Phase folders: `{phase}-{name}/` (e.g., 01-foundation/)

Files sort chronologically. Related artifacts (plan + summary) are adjacent.
</output_structure>

<reference_index>
All in `references/`:

**Structure:** directory-structure.md, hierarchy-rules.md
**Formats:** handoff-format.md, plan-format.md
**Patterns:** context-scanning.md, context-management.md
**Planning:** scope-estimation.md, checkpoints.md, milestone-management.md
**Process:** user-gates.md, git-integration.md, research-pitfalls.md
**Domain:** domain-expertise.md (guide for creating context-efficient domain skills)
</reference_index>

<templates_index>
All in `templates/`:

| Template | Purpose |
|----------|---------|
| brief.md | Project vision document with current state |
| roadmap.md | Phase structure with milestone groupings |
| phase-prompt.md | Executable phase prompt (PLAN.md) |
| research-prompt.md | Research prompt (RESEARCH.md) |
| summary.md | Phase outcome (SUMMARY.md) with deviations |
| milestone.md | Milestone entry for MILESTONES.md |
| issues.md | Deferred enhancements log (ISSUES.md) |
| continue-here.md | Context handoff format |
</templates_index>

<workflows_index>
All in `workflows/`:

| Workflow | Purpose |
|----------|---------|
| create-brief.md | Create project vision document |
| create-roadmap.md | Define phases from brief |
| plan-phase.md | Create executable phase prompt |
| execute-phase.md | Run phase prompt, create summary |
| research-phase.md | Create and run research prompt |
| plan-chunk.md | Plan immediate next tasks |
| transition.md | Mark phase complete, advance |
| complete-milestone.md | Mark shipped version, create milestone entry |
| handoff.md | Create context handoff for pausing |
| resume.md | Load handoff, restore context |
| get-guidance.md | Help decide planning approach |
</workflows_index>

<success_criteria>
Planning skill succeeds when:
- Context scan runs before intake
- Appropriate workflow selected based on state
- PLAN.md IS the executable prompt (not separate)
- Hierarchy is maintained (brief → roadmap → phase)
- Handoffs preserve full context for resumption
- Context limits are respected (auto-handoff at 10%)
- Deviations handled automatically per embedded rules
- All work (planned and discovered) fully documented
- Domain expertise loaded intelligently (SKILL.md + selective references, not all files)
- Plan execution uses /run-plan command (not skill invocation)
</success_criteria>
cat ~/.claude/skills/expertise/macos-apps/references/core-data.md cat ~/.claude/skills/expertise/macos-apps/references/swift-conventions.md

**上下文效率:**
- 仅SKILL.md:约5k token
- SKILL.md + 选择性参考资料:约8-12k token
- 所有参考资料(旧方式):约20-27k token

提示:“已加载[domain]专业知识(为[phase-type]加载了[X]份参考资料)。”

**如果未找到领域技能:** 通知用户并提供在无领域专业知识的情况下继续的选项。

**如果SKILL.md没有references_index:** 回退到加载所有参考资料,并提示上下文使用情况。
</load_domain>

<when_to_load>
应在以下场景**之前**加载领域专业知识:
- 创建路线图(阶段应符合领域特性)
- 规划阶段(任务必须是领域特定的)

以下场景不需要领域专业知识:
- 创建项目概要(愿景与领域无关)
- 从交接处恢复(上下文已建立)
- 阶段之间的过渡(仅更新状态)
</when_to_load>
</domain_expertise>

<intake>
根据扫描结果,提供上下文感知的选项:

**如果找到交接文件:**
找到交接文件:.planning/phases/XX/.continue-here.md [交接文件中的状态摘要]
  1. 从交接处恢复
  2. 丢弃交接文件,重新开始
  3. 其他操作

**如果规划结构已存在:**
项目:[来自BRIEF或目录名] 概要:[存在/缺失] 路线图:[已定义X个阶段] 当前状态:[阶段状态]
你想做什么?
  1. 规划下一阶段
  2. 执行当前阶段
  3. 创建交接文件(暂时停止)
  4. 查看/更新路线图
  5. 其他操作

**如果规划结构不存在:**
未找到规划结构。
你想做什么?
  1. 启动新项目(创建概要)
  2. 根据现有概要创建路线图
  3. 直接跳转到阶段规划
  4. 获取方法指导

**等待用户响应后再继续。**
</intake>

<routing>
| 响应 | 工作流 |
|----------|----------|
| "brief", "new project", "start", 1(无结构) | `workflows/create-brief.md` |
| "roadmap", "phases", 2(无结构) | `workflows/create-roadmap.md` |
| "phase", "plan phase", "next phase", 1(有结构) | `workflows/plan-phase.md` |
| "chunk", "next tasks", "what's next" | `workflows/plan-chunk.md` |
| "execute", "run", "do it", "build it", 2(有结构) | **退出技能** → 使用`/run-plan <path>`斜杠命令 |
| "research", "investigate", "unknowns" | `workflows/research-phase.md` |
| "handoff", "pack up", "stopping", 3(有结构) | `workflows/handoff.md` |
| "resume", "continue", 1(有交接文件) | `workflows/resume.md` |
| "transition", "complete", "done", "next" | `workflows/transition.md` |
| "milestone", "ship", "v1.0", "release" | `workflows/complete-milestone.md` |
| "guidance", "help", 4 | `workflows/get-guidance.md` |

**关键:** 计划执行不应调用此技能。使用`/run-plan`以提高上下文效率(技能加载约20k token,/run-plan加载约5-7k token)。

**读取工作流后,严格按照其执行。**
</routing>

<hierarchy>
规划层级(每个层级都基于前一层级构建):
BRIEF.md → 人工愿景(你需要阅读) ↓ ROADMAP.md → 阶段结构(概述) ↓ RESEARCH.md → 研究提示词(可选,用于未知内容) ↓ FINDINGS.md → 研究输出(如果进行了研究) ↓ PLAN.md → 提示词本身(Claude将执行此文件) ↓ SUMMARY.md → 成果(存在即表示阶段完成)

**规则:**
- 路线图需要基于概要(如果没有则提示创建)
- 阶段计划需要基于路线图(了解阶段范围)
- PLAN.md 就是执行提示词
- SUMMARY.md的存在标记阶段完成
- 每个层级都可以向上查找上下文
</hierarchy>

<output_structure>
所有规划产物都存储在`.planning/`目录中:
.planning/ ├── BRIEF.md # 人工愿景 ├── ROADMAP.md # 阶段结构 + 跟踪 └── phases/ ├── 01-foundation/ │ ├── 01-01-PLAN.md # 计划1:数据库设置 │ ├── 01-01-SUMMARY.md # 成果(存在即完成) │ ├── 01-02-PLAN.md # 计划2:API路由 │ ├── 01-02-SUMMARY.md │ ├── 01-03-PLAN.md # 计划3:UI组件 │ └── .continue-here-01-03.md # 交接文件(临时,如有需要) └── 02-auth/ ├── 02-01-RESEARCH.md # 研究提示词(如有需要) ├── 02-01-FINDINGS.md # 研究输出 ├── 02-02-PLAN.md # 实现提示词 └── 02-02-SUMMARY.md

**命名规范:**
- 计划:`{phase}-{plan}-PLAN.md`(例如01-03-PLAN.md)
- 成果摘要:`{phase}-{plan}-SUMMARY.md`(例如01-03-SUMMARY.md)
- 阶段文件夹:`{phase}-{name}/`(例如01-foundation/)

文件按时间顺序排序。相关产物(计划+成果摘要)相邻存放。
</output_structure>

<reference_index>
所有参考资料都在`references/`目录中:

**结构类:** directory-structure.md, hierarchy-rules.md
**格式类:** handoff-format.md, plan-format.md
**模式类:** context-scanning.md, context-management.md
**规划类:** scope-estimation.md, checkpoints.md, milestone-management.md
**流程类:** user-gates.md, git-integration.md, research-pitfalls.md
**领域类:** domain-expertise.md(创建上下文高效的领域技能指南)
</reference_index>

<templates_index>
所有模板都在`templates/`目录中:

| 模板 | 用途 |
|----------|---------|
| brief.md | 项目愿景文档 |
| roadmap.md | 带有里程碑分组的阶段结构 |
| phase-prompt.md | 可执行的阶段提示词(PLAN.md) |
| research-prompt.md | 研究提示词(RESEARCH.md) |
| summary.md | 阶段成果(SUMMARY.md),包含偏差记录 |
| milestone.md | MILESTONES.md中的里程碑条目 |
| issues.md | 延迟的优化建议日志(ISSUES.md) |
| continue-here.md | 上下文交接格式 |
</templates_index>

<workflows_index>
所有工作流都在`workflows/`目录中:

| 工作流 | 用途 |
|----------|---------|
| create-brief.md | 创建项目愿景文档 |
| create-roadmap.md | 根据概要定义阶段 |
| plan-phase.md | 创建可执行的阶段提示词 |
| execute-phase.md | 运行阶段提示词,创建成果摘要 |
| research-phase.md | 创建并运行研究提示词 |
| plan-chunk.md | 规划接下来的即时任务 |
| transition.md | 标记阶段完成,推进到下一阶段 |
| complete-milestone.md | 标记已交付版本,创建里程碑条目 |
| handoff.md | 创建用于暂停的上下文交接文件 |
| resume.md | 加载交接文件,恢复上下文 |
| get-guidance.md | 帮助决定规划方法 |
</workflows_index>

<success_criteria>
规划技能成功的标准:
- 接收请求前先运行上下文扫描
- 根据状态选择合适的工作流
- PLAN.md 本身就是可执行提示词(而非独立文件)
- 保持层级结构(概要 → 路线图 → 阶段)
- 交接文件保留恢复所需的完整上下文
- 遵守上下文限制(剩余10%时自动交接)
- 根据内置规则自动处理偏差
- 所有工作(计划内和发现的)都有完整文档记录
- 智能加载领域专业知识(SKILL.md + 选择性参考资料,而非所有文件)
- 计划执行使用/run-plan命令(而非调用技能)
</success_criteria>