New plan
Create a new plan directory (P{NNN}-{slug}/) through an interactive, approval-gated document pipeline. Use when starting a new feature, bugfix effort, or architectural change — any work that needs structured tracking across multiple sessions.From its SKILL.md
npx -y skills add testfree2023/airein --skill new-planAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
30.9 KB, ~8.5k tokens by cl100k_base, as published. Nobody here has run it
Create New Plan
CRITICAL: This skill is the planning workflow. Do NOT call Claude Code EnterPlanMode or ExitPlanMode. Do NOT use built-in plan mode. Create files directly under docs/plans/P{NNN}-{slug}/ following this document pipeline.
Create a new plan directory and register it in the roadmap. The process is interactive: first complete a unified communication/brainstorming phase, then create each configured document one at a time with approval between documents.
Preflight: main worktree check
Planning belongs in the primary project checkout (Dashboard / roadmap / approval all assume that path). Linked worktrees are for coding isolation after tasks are approved — not for /new-plan.
Before Phase 0 / Phase 1 / creating any plan files, run:
node ~/.airein/scripts/lib/git-worktree-context.js
(Or from this repo: node scripts/lib/git-worktree-context.js.)
Inspect the JSON:
- If
isLinkedWorktreeistrue: stop writing plan files. Show the user thewarningstring (andmainWorktreepath). Ask them to switch to the main worktree and re-run/new-planthere. Only continue in the linked worktree if the user explicitly overrides after the reminder. - If
isLinkedWorktreeisfalse(orokisfalse/ non-git): proceed normally.
Do not implement Dashboard aggregation of plans across worktrees as a workaround.
Global template root (P004 — kernel only)
Airein global templates live in the install kernel, not under ~/.claude/:
| Asset | Path |
|---|---|
| Pipeline definitions | ~/.airein/templates/pipelines.json |
| Doc structure templates | ~/.airein/templates/docs/{doc-type}.md |
| Design tier templates | ~/.airein/templates/docs/design/{s|m|l}.md |
| Design sub-doc templates | ~/.airein/templates/docs/design-*/ |
| Language profiles | ~/.airein/templates/language-profiles/{lang}.json |
| Default quality.json | ~/.airein/templates/quality.json |
Do not read ~/.claude/templates/ — that path is legacy / absent after P004 unified install. Hooks and lib code resolve templates from the kernel (~/.airein/).
Project config: .airein/config/quality.json (legacy fallback: .claude/config/quality.json).
Phase 0: Context Gathering (l-feature / l-bugfix only)
For complex features, gather project intelligence before the communication phase:
- Read steering docs:
docs/steering/product.md,docs/steering/tech.md,docs/steering/structure.md - Read lessons learned:
docs/plans/*/progress.md(Blockers section),docs/roadmap.md(## Issues section) - Scan codebase: Identify reusable modules and existing patterns
→ Output: Context Brief (embedded into the first document that needs it, usually requirements.md)
Phase 1: Communication / Grilling / Brainstorming
Before creating any requirements/design/tasks document, align with the user through structured Q&A. This phase is the same role as /openspec-explore: clarify intent, challenge assumptions, and turn vague requests into concrete scope.
Rules:
- Ask one question at a time, wait for the user's answer before continuing
- If a question can be answered by exploring the codebase → explore instead of asking
- When a term conflicts with steering docs → call it out immediately
- When the user uses vague terms → propose a precise term
- When the user states how something works → check whether code agrees; surface contradictions
- Use concrete scenarios to stress-test: invent edge cases that force precise boundaries
- Only skip discussion if the user explicitly says to skip discussion / 跳过讨论
Questions to resolve:
- What is the desired outcome? (Goal)
- What triggers this? (Trigger — new feature, bug, requirement change?)
- Priority? (P1=critical, P2=high, P3=medium, P4=low)
- What tests will verify success? (Success Criteria)
- Any related plans or issues? (Related)
- What is the scope boundary? (What is NOT in scope)
Progress state:
- When creating
progress.md, setgrilling: in_progress - After discussion is complete, update
progress.mdtogrilling: completed - Continue to create the first pipeline document after grilling completes (no mandatory pause between grilling and document creation)
Complexity determination:
- Read
quality.json→planWorkflow.pipelineto get the pipeline name - Read
~/.airein/templates/pipelines.json→definitions.{pipeline}to get the doc list - If
pipelineis"auto"or missing, determine from project size and scenario - The
complexityfield inprogress.mdshould be the pipeline name (e.g.m-feature), notsimple/medium/complex - The
## Approval Statesection must have one entry per pipeline doc - Default pipelines (auto mode only, resolves to
m-feature):- s-feature:
requirements,tasks— 小型项目新功能 - s-bugfix:
tasks— 小型项目缺陷修复 - m-feature:
requirements,design,test-plan,tasks— 中型项目新功能(默认) - m-bugfix:
requirements,tasks— 中型项目缺陷修复 - m-urgent:
tasks— 中型项目紧急需求 - l-feature:
requirements,design,test-plan,deployment,tasks— 大型项目新功能 - l-bugfix:
requirements,design,test-plan,tasks— 大型项目缺陷修复 - hotfix:
tasks— 紧急修复(不限规模)
- s-feature:
⚠️ IMPORTANT: Before writing progress.md, you MUST read both quality.json and ~/.airein/templates/pipelines.json to determine the correct pipeline and approval keys. Never hardcode approval states.
Phase 2: Create Plan Directory + progress.md
- Determine the next plan ID from existing directories in
docs/plans/ - Create directory:
docs/plans/P{NNN}-{slug}/ - Create
progress.mdonly at first, withgrilling: in_progress - Append the plan entry to
docs/roadmap.mdactive section - Add an entry to
docs/roadmap.md## Recent Changes section - Complete Phase 1 communication; then set
grilling: completed
Phase 3: Configured Document Pipeline
Read quality.json → planWorkflow.pipelines.{complexity} and create documents in that exact order.
Mandatory document approval sequence (file-based, NOT Claude Code Plan Mode):
- Create only the next document in the pipeline
- Mark its approval state as
draftinprogress.md - Present it to the user for approval
- Wait for approval-guard / user approval
- After approval: first set the phase doc footer
## Status: approved(replacingdraft), then set that phase toapprovedinprogress.mdApproval State. Fortasks, the panel contract must parse (format gate runs at approval only — not on every tasks edit). HookprogressApprovalGate/ Dashboard Approve both require Status-first. - Only then create the next document
Examples:
medium: createrequirements.md→ approval → createtasks.mdcomplex: createrequirements.md→ approval → createdesign.md→ approval → createtasks.md- custom: if
planWorkflow.pipelines.complex = ["requirements", "tasks", "test-plan"], follow that order
Design Documents: Establishing vs Referencing
When the pipeline includes a design document, determine whether this plan
establishes or references the project's design docs. Run the resolver:
node ~/.airein/scripts/lib/design-doc-resolver.js
It checks two locations for existing project-level design docs and prints JSON:
- Archived (project-level, stable):
docs/conventions.md,docs/architecture.md - In-flight plans:
docs/plans/{plan}/design-conventions.md,design-architecture.md
Output: { establishing: bool, conventions: {exists, path, source}, architecture: {exists, path, source}, deployment: {exists, path, source} }.
establishing: true (no project-level design docs anywhere)
This is the first design-bearing plan for the project. Generate BOTH:
design-architecture.md— from~/.airein/templates/docs/design-architecture/{lang}.mddesign-conventions.md— from~/.airein/templates/docs/design-conventions/{lang}.mddesign.md— fromresolveDesignTemplatetier template; indexes them via a## Sub-documentssection
Regardless of complexity tier (s/m/l) and regardless of frontend-or-backend.
Even a pure-frontend project has architecture — use the nearest language template
(JS frontend → typescript.md fallback), or write free-form if no template matches.
Conventions lifecycle (P018):
design-conventions.mdlives in the plan directory during development. At archive time, thearchive-planskill migrates it todocs/conventions-{lang}.md(single source of truth) and generates the thin-shell.claude/rules/conventions-{lang}.md— a CC native conditional rule that auto-injects conventions when editing matching source files (replaces the deletedconventions-triggerhook).{lang}is thedesign-conventionstemplate's language token (javascript/typescript/python/go/rust/java/kotlin/bash).
establishing: false (project-level design docs already exist)
This is a subsequent plan. Generate a unified design.md ONLY (from the matching
tier template), with a section that LINKS to the existing conventions/architecture
(use the resolver's reported paths). Do NOT regenerate design-conventions.md / design-architecture.md.
Exception: architecture upgrade
If the user declares an architecture upgrade (e.g. "重构架构", "迁移到 X"), this
plan may UPDATE the existing design-architecture.md / design-conventions.md.
Prompt the user to confirm the overwrite before regenerating.
Module sub-documents (
design-domain-model.md,design-database.md,design-security.md,design-deployment.md) remain l-feature-driven — see Compound Documents below.
Deployment Step (l-feature only)
When the pipeline includes deployment (l-feature only), run the resolver to get
deployment.exists and follow one of three paths:
establishing: deployment.exists === false
This is the first deployment-bearing plan for the project. Generate deployment.md
from ~/.airein/templates/docs/deployment.md. At archive time, archive-plan migrates it to
docs/deployment.md (single source of truth).
referencing: deployment.exists === true (no deployment change signal)
A deployment doc already exists (archived docs/deployment.md or in-flight plan).
Do NOT regenerate deployment.md. Instead, LINK to the existing deployment doc in the
plan's design.md (use resolver's deployment.path for the link).
Exception: deployment upgrade
If the user declares a deployment change (e.g. "迁移到 k8s", "换 CI-CD", "新增环境",
"改部署目标", "改运行时"), this plan may UPDATE the existing docs/deployment.md.
Prompt the user to confirm the overwrite before regenerating. Zero silent false positives.
Tasks Step(全生命周期 · 可执行可验收)
tasks.md 不是「开发任务清单」,而是本计划在软件开发生命周期上的工作分解:Implement / Verify / Deploy / Accept 凡计划涉及的,都必须拆成可执行、可验收的任务(有命令或逐步操作 + 可观察断言)。
Every generated tasks.md follows ~/.airein/templates/docs/tasks.md.
Mandatory structures
- Global Constraints — version floors, dependency limits, naming, exact values. Bind ALL tasks.
- Traceability Index — UC / Critical / VS / INV → task IDs(上游规格总表;供 Coverage Gate).
- Entry Coverage — PRD Story→UC + 入口;每行 ≥1 Must Implement. 禁止入口降为 Should;禁止「前端收口」.
- Lifecycle Phases — Implement / Verify / Deploy / Accept; Kind:
implement|verify|deploy|accept(每条任务 Kind 必填;仅 implement 强制tests.md). - per-task Interfaces —
consume/produce. - Implement fields —
UC-id, Design refs(API / 表|模型 / INV- / DD), Persona, UI Entry, dual Acceptance. - Verify fields — Source(Critical- | VS-{UC}-{维} | Exit- | INV- | PRD-UC-)必填;禁止无源;
Ledger:可选指向 Implement 台账行(Verify 不强制tests.md行). - Coverage Gate — every UC + Critical(及关键 VS)mapped;自检清单保留在 tasks.md.
Slicing rules(vertical only for product capabilities)
- Prefer 角色能力垂直片(例:销售代报修 = 菜单权限 + FAB 入口 + 表单页 + API + 来源枚举),not 全后端做完再「前端收口」。
- Horizontal layering (DDL → 全 API → 最后 UI) is allowed only for pure infra with no persona UI; product 入口任务仍须 early Must.
- Each task Acceptance must be 可执行(命令或逐步操作)and 可验收(可观察结果). Role-entry tasks MUST assert「用该 Persona 登录后入口可见/可点」.
Test Plan = 测试策略(Critical + VS)
When the pipeline includes test-plan, resolve the tier template before writing test-plan.md:
const { resolveTestPlanTemplate } = require('…/scripts/lib/test-plan-template.js');
resolveTestPlanTemplate('m-feature');
// → { applicable: true, tier: 'm', relativePath: 'templates/docs/test-plan/m.md', fallback: false }
| Pipeline | Template |
|---|---|
m-feature(及含 test-plan 的 m-*) | templates/docs/test-plan/m.md — Critical + 关键 UC 轻量 VS |
l-feature / l-bugfix | templates/docs/test-plan/l.md — 全量 VS + Invariants + Data Strategy |
s-* / m-bugfix(pipeline 无 test-plan) | 不适用;Verify 从 PRD UC 生成 |
精炼 ≠ 稀疏:m 不必七维全表,但资金/一致性 UC 仍须可证伪断言。
Verify tasks(from test-plan or PRD AC)
When test-plan.md exists (m-feature / l-* pipelines), parse in this order (m: Critical + key-UC VS; l: full VS + invariants):
- Critical Acceptance Index(产品级门禁索引,一行一路径)— 一行一个 Persona;勿合并「销售/门店」。UI 行:步骤从入口起(打开页 → 见控件 → 动作)。每行 →
Kind: verify任务验收测试:{id} · {persona} · {behavior}。 - Verification Specs by UC(VS-{UC-id}) — test-plan 本体(场景穷举 + 不变量断言 + 数据矩阵)。资金/一致性 UC 的主成功/扩展/异常/边界/并发/幂等/降级各维,凡有可跑命令或夹具的,拆成或挂靠 Verify 任务;禁止只生成 Critical 主路径而丢掉 VS 穷举。
- Invariant Verification Specs + Exit Criteria →
Kind: verify/accept(覆盖率、不变量、缺陷门禁等)。Exit 须绑「可执行命令 + pass 输出」。
精炼 ≠ 稀疏:禁止把 TC 逐步操作抄进 Markdown(真相在测试代码);但场景维度/断言规格/数据矩阵必须穷尽——只填 Critical Index 不填 VS = 验收规格不完整。
If test-plan.md is absent or only has Critical Index without VS: still generate Verify tasks from PRD Use Case 主成功/扩展(及 Traceability 表)— do not ship Implement-only tasks.md. Cite UC-id in task titles/Acceptance.
Deploy tasks(from deployment.md / runbook)
When deployment.md exists (or design links a project docs/deployment.md), generate Kind: deploy Must tasks: migrations, rollouts, config flags, smoke after deploy, rollback path. Acceptance = executable runbook step + observable env result.
If the pipeline has no deployment doc and the change is docs/skill-only with nothing to ship, write Deploy: n/a — {reason} once under Lifecycle Phases — do not invent fake deploys.
Accept tasks
PRD §交付物(菜单角色初始化、培训要点、验收报告)→ Kind: accept tasks when they are product obligations, not optional notes.
Anti-patterns(P099-class failures)
| 反模式 | 正确做法 |
|---|---|
| 多角色入口合并成「E 前端收口」 | Entry Coverage 每角色一行 + 垂直片 |
| 销售/门店 UI 标 Should,仅 E.1 挡归档 | 入口行一律 Must |
| Critical Path「三角色发起」一行 | 客服 / 销售 / 门店 分三条 verify |
| 只有 API/UT,无 Persona 登录断言 | Acceptance 含入口可见 |
| tasks 只有实现、测试/部署写在别处口头说 | Verify / Deploy 必须落在 tasks.md |
| Verify 无 Source / 只拆 Critical 丢 VS | Source 必填;VS 可跑维须有 Verify |
| Implement 不回指 Design 契约 | 填写 Design refs(API / INV / DD) |
File Templates
Read structural templates from ~/.airein/templates/docs/{doc-type}.md for guidance on document structure. Fill each document with plan-specific content based on the communication phase output.
Requirements = 产品需求说明书(PRD)
When the pipeline includes requirements, the plan file is still named requirements.md, but content MUST be a 产品需求说明书(PRD), not a thin summary of Problem + WHEN/THEN.
Agent Teams v0: Check quality.json → pipelineRoles.enabled (default true).
true: Before writingrequirements.md, dispatchproduct-expert(agents/product-expert.md) to author the PRD + lightweight prototype per the requirements template. PM (agents/pm.md) only orchestrates and presents for approval — do not solo-author the full PRD unless the user explicitly exempts and Notes record it. Before writingdesign.md, prefer dispatchtech-leadwith mode: design (template-aligned).false(Solo PM): PM may authorrequirements.md/design.mddirectly (still template-aligned). No Notes exemption required for skipping specialists.
Before writing requirements.md, resolve the tier template via the kernel lib (after sync: ~/.airein/scripts/lib/requirements-template.js; in-repo: scripts/lib/requirements-template.js):
const { resolveRequirementsTemplate } = require('…/scripts/lib/requirements-template.js');
resolveRequirementsTemplate('m-feature');
// → { applicable: true, tier: 'm', relativePath: 'templates/docs/requirements/m.md', fallback: false }
Then read ~/.airein/{relativePath} (or the in-repo templates/docs/requirements/{s|m|l}.md) and fill the plan file.
| Pipeline prefix | Template |
|---|---|
s-* (and docs include requirements) | templates/docs/requirements/s.md |
m-* | templates/docs/requirements/m.md |
l-* | templates/docs/requirements/l.md |
| Custom name with requirements step | m.md (fallback: true) |
Docs omit requirements (e.g. s-bugfix, hotfix) | skip — do not create requirements |
PRD structure (all tiers that include requirements) — follow templates/docs/requirements/{s|m|l}.md:
- Business Process Overview(端到端业务流程总览,mermaid 活动图;l 可加时序图)— before User Stories.
- User Story = 价值源头(As a / I want / so that).
- Under each Story: one or more Use Cases(参与者、前置、主成功场景、扩展/异常)— UC is the落地 of the Story, not the reverse.
- Optional mermaid 活动图/时序图 under the specific Use Case.
- Traceability: Story → UC-id → tasks / test-plan / 验收.
Negative constraints: 禁止 only Problem + User Story + WHEN/THEN with no process overview and no Use Cases. 禁止 treating Use Case as the source that is later sliced into Stories. 禁止 Story-only PRD. For m/l also require roles + NFR as in the tier template; for l also Success Metrics and richer multi-UC coverage. Downstream tasks/verify/accept must cite UC-id (and 业务流程 where relevant).
Compat: ~/.airein/templates/docs/requirements.md is a stub only — not the authoritative structure.
Design = 工程设计说明书(概要 + 按规模详细)
When the pipeline includes design, the plan file is still named design.md, but content MUST follow the s/m/l design tier template, not the thin legacy Approach/Components checklist.
Before writing design.md, resolve the tier template:
const { resolveDesignTemplate } = require('…/scripts/lib/design-template.js');
resolveDesignTemplate('l-feature');
// → { applicable: true, tier: 'l', relativePath: 'templates/docs/design/l.md', fallback: false }
Then read ~/.airein/{relativePath} (or in-repo templates/docs/design/{s|m|l}.md) and fill the plan file.
| Pipeline prefix | Template |
|---|---|
s-* (and docs include design) | templates/docs/design/s.md |
m-* | templates/docs/design/m.md |
l-* | templates/docs/design/l.md |
| Custom name with design step | m.md (fallback: true) |
Docs omit design (e.g. s-feature default, hotfix) | skip — do not create design |
视角:Design = 架构师/技术专家文档(不是 PRD 摘要,也不是 class 索引)。须自洽可读,不强迫读者来回翻 Requirements。
框架吸收(精炼,禁止照搬企业长文):成熟概要设计常见两层骨架——平台级(约束 → 原则 → 架构多视图 → 决策对比 → 接口/数据/NFR 下沉)与 服务级(系统介绍 → 架构+用例/时序 → 按角色/视角模块设计(概述→场景→时序)→ 表职责与关系 → 接入指南)。airein 模板只吸收结构与门禁,不要求 RFQ 式百科篇幅。
Cross-tier Must(所有含 design 的档):
- Impact & Follow-up Checks — 一律必填(改动波及面 + 后续重点检查)。
- Permissions & AuthZ — 涉及菜单/页面/按钮/管理 API 则详写权限码与角色授权;否则显式
N/A(理由)。 - Cross-module Dependencies — 新引入其它模块依赖时须加厚:①依赖什么 ②契约 ③失败行为 ④归属 ⑤时序;无则
N/A。 - Traceability(自洽) — 绑定 UC-id,且每行含 名称 + 一句话意图(S/M/L 皆然;L 须覆盖每个 UC)。禁止只有无释义的
UC-S1-01。 - 架构图可读(M/L) — 须有起点/触发、关键外部边界(银行/支付/其它系统等若存在)、读图说明;禁止只有内部框、无说明、用自环糊弄第三方。
- 模型/服务在 UC 详设之前(M/L;S 用 Model & Service 节) — 禁止跳过抽象直接写 Class implement;表须点明职责与关系(字段级可下沉)。
- API 方法契约 — Interface/Service 须写清 method + 关键入参/返回/错误;禁止只有接口名、把签名整份甩到子文档导致主册空洞。
- 约束写死(M/L;S 写进 Intent) — Design Constraints:范围/不可动、NFR、技术栈等可验证边界。
- 未决显式(M/L;S 可选) — Open Issues:禁止假装已设计完。
按档要点:
- S:薄概要;强 Change Surface + Model/DDL + Service/API(方法级)+ by-UC 时序;禁止灌水式全系统架构。
- M:Constraints + Target Architecture(图+读图说明)+ Model/Services(含关系)+ 方法级 Interface + 自洽 Traceability + 关键 UC 时序 + Open Issues;对外接入时写 Integration Guide。
- L:Constraints + 命名 Design Principles + 子系统划分原则(可含配置态/运营态/运行时视角)+ 子系统设计(概述→场景→时序骨架)+ 架构图(含外部边界与读图说明)+ 按需多视图/组合场景 + Architecture Decisions(含备选对比)+ Logical Model & Services + 方法级 Interface + 按需 Integration Guide + 自洽全 UC Traceability + DD-by-UC + Consistency & Failure + Change Surface + Open Issues。正文偏目标态;代码行号证据放附录,证据不替代设计。禁止只有 Decisions 墙、无图无 UC 回应、无划分依据的「假子系统」、把主册写成平台百科。
Compat: ~/.airein/templates/docs/design.md is a stub only — not the authoritative structure.
Top-level templates (other docs): deployment.md, tasks.md, progress.md. Requirements use templates/docs/requirements/{s|m|l}.md via resolveRequirementsTemplate. Design uses templates/docs/design/{s|m|l}.md via resolveDesignTemplate. Test-plan uses templates/docs/test-plan/{m|l}.md via resolveTestPlanTemplate (m-feature → m; l-* → l; s-* / m-bugfix → null). Flat templates/docs/test-plan.md is a compat stub only.
Design sub-document templates (used when splitting design.md for l-feature / l-bugfix):
| Sub-document | Template path | Selection |
|---|---|---|
design-domain-model.md | ~/.airein/templates/docs/design-domain-model.md | language-independent (DDD) |
design-database.md | ~/.airein/templates/docs/design-database.md | language-independent |
design-security.md | ~/.airein/templates/docs/design-security.md | language-independent |
design-deployment.md | ~/.airein/templates/docs/design-deployment.md | language-independent |
design-architecture.md | ~/.airein/templates/docs/design-architecture/{lang}.md | per backend primary language |
design-conventions.md | ~/.airein/templates/docs/design-conventions/{lang}.md | per backend primary language |
Per-language template selection (architecture & conventions):
- Read
quality.json→language.primary(or detect from project files) - Read
~/.airein/templates/language-profiles/{primary}.json→ checkrolefield - If
roleisbackendorfullstack→ use~/.airein/templates/docs/design-architecture/{primary}.mdand~/.airein/templates/docs/design-conventions/{primary}.md - If
roleis frontend-only or no matching language template exists → fall back to nearest match (e.g. JS frontend project →typescript.md); if none exists, write free-form - Available languages:
javascript,typescript,python,java,go,rust,kotlin
Each template contains section headings with HTML comment guidance — replace the comments with actual content. For progress.md, use the template structure but fill with machine-readable values (plan ID, pipeline name, approval states).
Roadmap Entry Format
Append to the ### 活跃工作 (or ## 活跃工作) section of docs/roadmap.md.
Canonical template: templates/docs/roadmap.md. Prefer formatActiveEntry from scripts/lib/roadmap-contract.js.
- **[P{NNN}-{slug}](plans/P{NNN}-{slug}/)** — {≤80 字摘要}。状态:`{status}` | Priority: P{N} | {complexity}
Rules: one-line bullets only; no Markdown tables in the active section; summary ≤80 chars; status ∈ planning | in_progress | completed | archived | on_hold. Also add a short Recent Changes process note (not user-facing CHANGELOG).
Compound Documents
For l-feature and l-bugfix pipelines, the design step can be split into multiple sub-documents by module boundary. This is AI-guided, not user-managed.
Naming convention: {doc}-{subname}.md is a sub-document of {doc}.md.
Typical design sub-documents for large projects:
design.md→ 总册(按design/l.md:约束/原则、划分原则、架构图+读图说明、多视图按需、模型/服务、方法级 API、接入指南按需、自洽 Traceability、DD、一致性、变更面、Open Issues、子文档索引;主册不可变纯索引)design-architecture.md→ 架构设计(模块关系、数据流)design-domain-model.md→ DDD 领域模型(聚合根、实体、值对象、领域事件、核心业务规则、状态流转)design-conventions.md→ 工程规范与结构(目录规范、命名、代码风格、错误处理)design-database.md→ 数据库设计(表结构、索引、迁移策略)design-security.md→ 安全设计(认证、授权、加密、审计)design-deployment.md→ 部署方案(环境、CI/CD、回滚)
Rules:
- Generate parent
design.mdfromresolveDesignTemplate→templates/docs/design/{s|m|l}.md design.mdmust include a## Sub-documentssection linking to alldesign-*.mdfiles (when any exist; l template has the section)- Sub-documents share the same approval as the parent: one
design: approvedcovers alldesign-*.md design-architecture.md+design-conventions.mdgeneration is driven by establishing vs referencing (see section above) — NOT by complexity tier. An establishing plan generates both regardless of s/m/l.- Module sub-documents (
design-domain-model.md,design-database.md,design-security.md,design-deployment.md) are still l-feature / l-bugfix only — large-project module decomposition. - For s/m referencing plans: single unified
design.mdfrom the matching tier template, linking to existing conventions/architecture, no splitting unless needed - Same pattern applies to
requirementsif needed:requirements.md+requirements-{topic}.md - Templates:
- Parent:
templates/docs/design/{s|m|l}.mdviaresolveDesignTemplate design-domain-model.md— required template at~/.airein/templates/docs/design-domain-model.mddesign-database.md/design-security.md/design-deployment.md— required templates at~/.airein/templates/docs/{name}.md(language-independent)design-architecture.md/design-conventions.md— language-specific templates at~/.airein/templates/docs/design-architecture/{lang}.mdand~/.airein/templates/docs/design-conventions/{lang}.md. Select by primary backend language (see "Per-language template selection" above).- You MUST read the corresponding template before writing each sub-document and follow its structure.
- Parent:
Rules
- Never call
EnterPlanModeorExitPlanModeinside this skill. Approval means updatingprogress.mdapproval states and waiting for user confirmation, not Claude Code plan-mode approval. - Plan IDs are sequential: P001, P002, P003...
- Slug is lowercase-hyphenated from the title
- If the plan was triggered by a bug, add
Triggered-by: I{NNN}in Related - Each product capability task should be a thin vertical slice (tracer bullet) through entry → UI/API → data — not a late「前端收口」bucket
tasks.mdcovers the full SDLC for the plan (Implement / Verify / Deploy / Accept as applicable); every task is executable and acceptible- Entry Coverage rows and their verify/deploy counterparts are Must unless the user explicitly descope in grilling
progress.mdis machine-readable — hooks parse it, not the other filesapproval-sequence.jsenforces grilling completion and configured pipeline orderapproval-guard.jsenforces user approval; do not self-approve
终止状态
Pipeline 全部文档审批通过后,唯一允许的下一步:
- 直接进入
tddskill 开始规格绑定实现(Implement 任务维护计划tests.md台账;testsLedger.enabled开启时完成门禁强制) - 如果计划被否决 → 终止,不进入任何 skill
禁止:跳过计划阶段直接编码。禁止:创建计划后不做任何后续动作。
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.