AgentSkillsCN

create-plan

编码前务必制定实施计划,完成前需确保规划文件已按要求完备各关键章节。

SKILL.md
--- frontmatter
name: create-plan
description: Create implementation plan before coding. Plan file must exist with required sections before completion.

/create-plan

Create a detailed, actionable implementation plan. No vague language. No optional sections.

First: Activate Workflow

bash
mkdir -p .claude && echo '{"skill":"plan","started":"'$(date -Iseconds)'"}' > .claude/active-workflow.json

Craft Standards (MANDATORY)

Plan for code a master craftsperson would be proud of.

The plan should produce code that looks like it was written by a skilled human engineer, not generated by AI.

Plan AGAINST These AI Antipatterns

  • Over-abstraction (don't plan factories/builders unless truly needed)
  • Speculative features (plan only what's requested)
  • Enterprise patterns in simple code (no AbstractFactoryBeans)
  • Unnecessary layers (don't plan wrappers that add no value)
  • Config options nobody asked for

Plan FOR Human Craft

  • Minimal, focused interfaces
  • Single-responsibility functions
  • Names that reveal intent
  • Direct solutions to actual problems
  • Simplicity over "flexibility"

If your plan includes something a senior engineer would delete, remove it from the plan.


⚠️ STRICT REQUIREMENTS - NO JUDGMENT CALLS

You MUST produce a plan with ALL sections below. No "TBD". No "as needed". No "if applicable".

Every item must be SPECIFIC and ACTIONABLE.

Process

Step 0: Load Expert Guidance

Before starting, read these canon skills and apply their principles throughout:

Always load:

  1. .claude/skills/clarity/SKILL.md
  2. .claude/skills/simplicity/SKILL.md
  3. .claude/skills/data-first/SKILL.md
  4. .claude/skills/correctness/SKILL.md
  5. .claude/skills/abstraction/SKILL.md

Load if applicable to target code:

  • Auth, tokens, passwords, encryption → also read .claude/skills/security-mindset/SKILL.md and .claude/skills/owasp/SKILL.md

If a skill file doesn't exist (not installed in this project), skip it and continue. Reference loaded experts in your APPLIED output.

Step 0b: Learn From Past Mistakes

Read both lessons files if they exist:

  1. workflow-skills/phase-loop-lessons.md — universal patterns (ships with skills, applies to all projects)
  2. .claude/phase-loop-lessons.md — project-specific patterns (accumulated from this project's runs)

These contain patterns that later quality phases (gemini-fix, qodana-fix, adversarial-security) have repeatedly caught. Your plan should proactively address these known patterns so they don't recur:

  • LOGIC entries → plan to avoid these bug patterns (e.g., TOCTOU, path traversal, shell injection)
  • DESIGN entries → plan architecture that avoids these structural mistakes
  • CODE_QUALITY entries → plan naming/structure that won't trigger these findings
  • DUPLICATION entries → check for these duplicate patterns in your plan
  • AI_SMELL entries → plan at the right abstraction level: no single-use wrappers, no speculative config/types, no over-decomposition

If a file doesn't exist, skip it and continue.

Step 1: Explore

  1. Explore - Use Glob, Grep, Read to understand existing code
  2. Design - Create plan with ALL required sections
  3. Save - Write to .claude/create-plans/[slug].md
  4. Stop - Exit and wait for approval

⚠️ NO INTERVIEW QUESTIONS

  • Do NOT ask clarifying questions before planning
  • Make reasonable assumptions
  • State assumptions in the plan and proceed

MANDATORY Plan File Format

markdown
# Plan: [Feature/Task Name]

## FILES:
- path/to/file.ts: purpose of this file
- path/to/another.ts: purpose of this file

## FUNCTIONS:
- functionName(params): ReturnType (max N lines) - purpose
- anotherFunction(params): ReturnType (max N lines) - purpose

## TYPES:
- TypeName: { field: Type, field2: Type }
- AnotherType: { field: Type }

## INVARIANTS:
- Specific condition that must always be true
- Another specific invariant

## SECURITY:
- Specific security measure to implement
- Another specific security consideration

## TESTS:
- Specific test case: [what it verifies]
- Another test case: [what it verifies]

## APPLIED:
- [expert-name]: [specific planning decision based on their guidance]

PLAN_COMPLETE

DO NOT:

  • Be vague ("consider adding tests")
  • Leave sections empty
  • Say "as needed" or "if applicable"
  • Use "TBD" or "to be determined"
  • Make suggestions instead of decisions
  • Proceed without all sections complete

Validation (Phase will FAIL if violated)

  • Missing any of: FILES, FUNCTIONS, TYPES, INVARIANTS, SECURITY, TESTS
  • Contains "as needed", "if applicable", "TBD", "to be determined"
  • Contains "consider" without specific action

🛑 MANDATORY STOP

After outputting the plan:

  • DO NOT proceed to /structure-first
  • DO NOT start writing any code
  • DO NOT continue with "let me also..."

Your turn ends here. Output the plan and STOP.