AgentSkillsCN

planning

在规划多步骤任务、撰写实施方案,或在未接触代码之前启动新功能开发时,此功能可助您一臂之力。

SKILL.md
--- frontmatter
name: planning
description: Use when planning multi-step tasks, writing implementation plans, or starting new feature work before touching code

Planning

Announce at start: "Following the planning skill — mapping before editing."

The Core Rule

No edits before understanding. MAP first, then plan, then implement.

Process

1. MAP — Understand the Codebase

Before any change, build a mental model:

  • Read README, CONTRIBUTING, ARCHITECTURE.md
  • Identify build system and commands
  • Identify test strategy (unit/integration/e2e)
  • Locate CI workflows
  • Sketch package/module boundaries

Output a repo map:

markdown
## Repo Map: [project-name]

### Build & Test
- Build: `[command]` | Test: `[command]`
- CI: [platform] on [trigger]

### Structure
- `src/[dir]/` - [purpose]
- `tests/[dir]/` - [purpose]

### Invariants
- [architectural constraint]

2. PLAN — Design Small, Reversible Changes

Write a change plan before implementing:

  • Define objective (one sentence)
  • List files and functions to change
  • Define tests to add or update
  • Document rollback strategy
  • Identify risks and mitigations

3. Bite-Sized Task Granularity

Each step should be one action (2-5 minutes):

StepExample
Write the failing testOne step
Run it to verify it failsOne step
Implement minimal code to passOne step
Run tests to verify they passOne step
CommitOne step

Not: "Implement the feature and write tests" (too large, not reversible).

4. Plan Document Template

markdown
# [Feature Name] Implementation Plan

**Goal:** [One sentence]

**Architecture:** [2-3 sentences about approach]

---

### Task N: [Component Name]

**Files:**
- Create: `exact/path/to/file`
- Modify: `exact/path/to/existing`
- Test: `tests/exact/path/to/test`

**Step 1:** Write the failing test
**Step 2:** Run test to verify it fails
**Step 3:** Write minimal implementation
**Step 4:** Run test to verify it passes
**Step 5:** Commit

5. Execute with Checkpoints

  • Execute in batches of 3 tasks
  • Report results after each batch
  • Wait for feedback before continuing
  • Stop and ask when blocked — do not guess

Red Flags — STOP

SignalAction
Editing before understandingGo back to MAP
"This is too simple to need a plan"It's not — follow the process
Task is larger than 5 minutesBreak it down further
Blocked on unclear requirementsAsk before guessing

Related Skills

WhenInvoke
Ready to start implementationrefactoring (for restructuring) or begin coding
Need to write tests firsttesting
Plan involves security-sensitive changessecure-coding
Ready to submit changespr-writing

Deep Reference

For principles, rationale, anti-patterns, and examples:

  • guides/planning-documentation/planning-documentation.md
  • guides/agentic-workflow/agentic-workflow.md