agentleFS
quruhao4800quruhao4800/agent-workflow/skills/workflow/writing-plans/SKILL.md

writing-plans

Skill1 starsChanged 6 months agoMITView on GitHub

Use when you have a spec or requirements for a multi-step task, before touching code

187 other projects use a version of this, 37 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-code-review, chinese-commit-conventions and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Leodorareluctant259Skill

    chinese-code-review

    中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈

    Also in 8 projects that use this

  • Leodorareluctant259Skill

    chinese-commit-conventions

    中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化

    Also in 8 projects that use this

  • ryanportfolioSkill

    addskill

    Create, import, update, or install repo or personal skills: runtime ownership, resources, discovery checks.

    Also in 6 projects that use this

  • ryanportfolioSkill

    apply-firmware

    Bring current folder (plain folder, existing repo, old or partial firmware copy) up to full Harness Firmware in place. Mirror external repo → adopt-repo.

    Also in 6 projects that use this

  • +2 more from Leodorareluctant259
  • +6 more from ryanportfolio

The file

Show its rules and text

We split this skill into the rules it gives an agent

33 rules. 0 are common, 16 are distinctive, and 17 are very specific to this project.

  • 0

    Common

    Most of the 169 edited versions we read keep these.

  • 16

    Distinctive

    This author's own choices. Worth a look.

  • 17

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write implementation plans that are executable, traceable, and safe for mid-flight requirement changes.

    line 17
  2. Distinctive:

    Use one of these modes explicitly:

    line 23
  3. Distinctive:

    Initial mode: - no existing plan artifacts for this feature

    line 25
  4. Very specific:

    Do NOT start Phase 1 until Design Charter is confirmed.

    line 32
  5. Very specific:

    Do NOT produce 03-implementation-plan.md until 02-design.md is approved.

    line 33
  6. Very specific:

    Read 01-requirements.md and load project rules (rules//*.md).

    line 38
  7. Distinctive:

    Stop when all decisions are answered.

    line 53
  8. Distinctive:

    Before proposing any design, think across ALL dimensions simultaneously.

    line 69
  9. Distinctive:

    When in doubt, add to Decisions Manifest and let the user confirm whether it needs explicit design.

    line 89
  10. Distinctive:

    After scanning per-REQ, do one cross-REQ pass for shared concerns:

    line 93
  11. Distinctive:

    Add any cross-REQ decisions to the Decisions Manifest.

    line 99
  12. Distinctive:

    Create or reuse one feature folder:

    line 111
  13. Very specific:

    After producing 02-design.md, run this gate before presenting to the user.

    line 225
  14. Distinctive:

    All decisions answered = design is complete.

    line 233
  15. Distinctive:

    When all items above are ✓, Agent MUST immediately output:

    line 243
  16. Very specific:

    When re-checking 02-design.md at any point, classify every finding before acting:

    line 255
  17. Distinctive:

    Before writing tasks, capture standards from:

    line 311
  18. Very specific:

    Every task in 03-implementation-plan.md must map to one or more REQ-###.

    line 330
  19. Very specific:

    Every implementation plan (03-implementation-plan.md) starts with:

    line 335
  20. Distinctive:

    Every task starts with the traceability + files header, then uses the steps template matching its type.

    line 374
  21. Very specific:

    Update 01-requirements.md effective requirement state.

    line 434
  22. Very specific:

    Update 03-implementation-plan.md tasks and statuses.

    line 435
  23. Very specific:

    Keep superseded tasks for audit (Status: superseded), do not silently delete history.

    line 436
  24. Very specific:

    Update 04-verification.md checklist for impacted REQ/CR.

    line 437
  25. Very specific:

    Update 02-design.md and set its Status back to Draft.

    line 441
  26. Very specific:

    Update affected tasks in 03-implementation-plan.md.

    line 446
  27. Very specific:

    Update 04-verification.md if verification steps are affected.

    line 447
  28. Distinctive:

    Stop current design work immediately.

    line 450
  29. Very specific:

    If confirmed in scope: update Design Charter in 02-design.md, answer the new decision, continue.

    line 455
  30. Distinctive:

    If confirmed out of scope: add to Explicitly Excluded in charter, record as CR candidate, continue without designing it.

    line 456
  31. Distinctive:

    After saving or revising the plan, offer:

    line 460
  32. Very specific:

    Subagent-Driven (this session): - use agent-workflow:subagent-driven-development

    line 462
  33. Very specific:

    Parallel Session (separate): - use agent-workflow:executing-plans

    line 463

“Common” is measured: kept by at least 6 in 10 of the 169 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Writing Plans

Prerequisites

From skillMust already existIf missing
brainstormingdocs/plans/YYYY-MM-DD-<feature>/01-requirements.md with Status: ApprovedReturn to brainstorming — do not start planning without approved requirements
brainstorming05-change-log.md if any CR was raised during brainstormingInitialize it here if absent

Overview

Write implementation plans that are executable, traceable, and safe for mid-flight requirement changes.

Announce at start: "I'm using the writing-plans skill to create the implementation plan."

Modes

Use one of these modes explicitly:

  1. Initial mode - no existing plan artifacts for this feature
  2. Revision mode - feature already has plan files and requirements or design changed

Three-Phase Flow (Initial Mode)

<HARD-GATE> Each phase requires explicit user approval before the next begins. Do NOT start Phase 1 until Design Charter is confirmed. Do NOT produce `03-implementation-plan.md` until `02-design.md` is approved. </HARD-GATE>

Phase 0 — Holistic Thinking & Design Charter

  1. Read 01-requirements.md and load project rules (rules/**/*.md).
  2. Apply the relevant language skill based on tech stack.
  3. Perform holistic thinking across all dimensions (see Holistic Thinking Framework section).
  4. Produce Design Charter draft with three lists:
    • Decisions Manifest: specific questions requiring explicit design — executing agent cannot correctly decide alone
    • Agent-Handled List: what executing agent handles independently per project conventions
    • Explicitly Excluded: items considered during holistic thinking but confirmed out of scope
  5. Present Charter to user and state:

    "Phase 0 complete. Here is the Design Charter. Please confirm the decisions boundary before I begin designing."

  6. Wait for explicit confirmation before continuing.
  7. Charter is now frozen. Any new decision point discovered in Phases 1–2 requires DR [charter-amendment] before it can be added.

Phase 1 — Technical Design (within charter)

  1. Answer each decision in the Design Charter's Decisions Manifest — in 02-design.md.
  2. Stop when all decisions are answered. Do NOT add content beyond the charter.
  3. Run Design Completeness Gate — verify every charter decision has a clear, unambiguous answer.
  4. Output proactive completion declaration (see Design Completeness Gate section).
  5. Present the design to the user and state:

    "Phase 1 complete. Please review 02-design.md. Confirm to proceed to implementation planning."

  6. Wait for explicit confirmation before continuing.

Phase 2 — Implementation Planning (after design approved)

  1. Produce 03-implementation-plan.md with tasks derived from approved design.
  2. Initialize 04-verification.md skeleton using the template below.
  3. Initialize 05-change-log.md and 99-mistake-log.md if not present.
  4. Offer execution handoff.

Holistic Thinking Framework (Phase 0)

Before proposing any design, think across ALL dimensions simultaneously. This is a single upfront scan — not incremental discovery. Every dimension must be considered before the charter is presented.

Dimensions to Scan

DimensionQuestions to answer
Functional pathWhat are the core responsibilities? What does success look like end-to-end?
Failure modesWhat can go wrong at each step? What is the recovery strategy?
Data concernsConsistency requirements? Idempotency? Data integrity constraints?
System interactionsWho calls this? What does it call? What are upstream/downstream SLAs?
Non-functional concernsConcurrency? Retry logic? Compensation? Performance targets?
Boundary conditionsEdge cases? Extreme inputs? Partial failures?

Decision Classification Rule

For each concern surfaced by the scan:

  • Needs explicit design → multiple valid approaches exist, executing agent cannot correctly choose alone → add to Decisions Manifest
  • Executing agent handles → single correct approach per project conventions, no architectural choice involved → add to Agent-Handled List

When in doubt, add to Decisions Manifest and let the user confirm whether it needs explicit design.

Cross-REQ Pass (MANDATORY)

After scanning per-REQ, do one cross-REQ pass for shared concerns:

  • Transaction boundaries spanning multiple REQs
  • Shared error handling strategy
  • Concurrency or idempotency across operations
  • Consistent state management across the feature

Add any cross-REQ decisions to the Decisions Manifest.

Red Flags — STOP if you are doing this

ThoughtReality
"I'll add this to the design if it comes up"Front-load all thinking now. Discovering decisions in Phase 1 means Phase 0 was incomplete.
"This is probably obvious"If multiple valid approaches exist, it is not obvious. Add it to the manifest.
"The user didn't mention compensation / retry / etc."User states WHAT. Holistic thinking surfaces HOW concerns. Surface them, let user decide scope.

Folder-First Rule (MANDATORY)

Create or reuse one feature folder:

docs/plans/YYYY-MM-DD-<feature-name>/

Required artifacts in that folder:

  • 01-requirements.md (produced by brainstorming — read, do not overwrite)
  • 02-design.md (produced here — technical design: HOW)
  • 03-implementation-plan.md (produced here — executable tasks)
  • 04-verification.md (produced here — checklist skeleton)
  • 05-change-log.md
  • 99-mistake-log.md

Conditional artifact:

  • 06-research-notes.md when external information affects decisions

02-design.md Template

# [Feature Name] — Technical Design

**Status:** Draft | Approved
**Requirements:** docs/plans/YYYY-MM-DD-<feature-name>/01-requirements.md

## Design Charter
**Chartered:** YYYY-MM-DD

### Decisions Manifest
_(Questions that required explicit design — executing agent cannot decide alone)_
1. [specific design question] (REQ-###)
2. [specific design question] (REQ-###)

### Agent-Handled
_(Executing agent handles per project conventions — no design decision needed)_
- [e.g., Spring Boot annotation syntax, method body implementation consistent with AC]

### Explicitly Excluded
_(Considered during holistic thinking, confirmed out of scope — CR required to add)_
- [e.g., retry mechanism, compensation logic, monitoring setup]

---

## Architecture Decision
[2-3 sentences: what is being built and how it fits into the existing system]

## Key Design Decisions
| Decision | Options Considered | Chosen | Reason |
|----------|--------------------|--------|--------|
| [topic]  | [A, B, C]          | [A]    | [why]  |

## Data Model
[DDL-level detail: table names, column names, types, constraints, indexes, FK relationships]

## Component Contracts

### [ClassName] (`com.example.package.ClassName`)
**Responsibility:** [one sentence]

| Method | Signature | Returns | Throws |
|--------|-----------|---------|--------|
| [methodName] | `(ParamType param)` | `ReturnType` | `ExceptionType` |

_(Repeat for each new or modified class)_

## API Contracts

### [HTTP Method] [/path]
**REQ:** REQ-###
**Auth:** [required role / none]

**Request:**
```json
{ "field": "type — required/optional, constraints" }

Response (success):

HTTP [status]
{ ... }

Response (errors):

ConditionHTTPBody
[condition][4xx]{"code":"X","message":"Y"}

Error Taxonomy

Exception ClassHTTP StatusError CodeTrigger Condition
[ExceptionName][4xx/5xx][ERROR_CODE][when this is thrown]

Business Rules & Constraints

[Explicit constraints the implementing agent must follow — uniqueness, state machine transitions, calculation rules. Agent must NOT override these.]

  • BR-001: [rule]

Tech Stack

[Key technologies and versions used]

Component Interaction

[Numbered sequence: which component calls which, in what order]

REQ Coverage Mapping

REQCovered by
REQ-001[ClassName.methodName() / /endpoint]
REQ-002[ClassName.methodName()]

Rollback Plan

[How to revert if deployment fails — required for DB changes and breaking API changes]


## Design Completeness Gate (MANDATORY — before Phase 1 user confirmation)

After producing `02-design.md`, run this gate before presenting to the user.

### Step 1 — Charter decisions check

For each item in the Design Charter's Decisions Manifest:
- [ ] Decision #N has a clear, unambiguous answer in the design document
- [ ] The answer is specific enough that the executing agent faces no further design choices

All decisions answered = design is complete. Do NOT check for things outside the charter.

### Step 2 — REQ coverage check

For each REQ-### in `01-requirements.md`:
- [ ] REQ-### appears in REQ Coverage Mapping
- [ ] REQ-### error path AC is addressed in Error Taxonomy or Component Contracts

### Step 3 — Proactive completion declaration (MANDATORY)

When all items above are ✓, Agent MUST immediately output:

> "设计章程中所有决策均已回答。
> **已回答的决策:** [list decisions from manifest]
> **Agent 自行处理:** [Agent-Handled list from charter]
> **本次明确不设计:** [Explicitly Excluded list from charter]
> **状态变更为 Draft(待审批)。** 请确认后进入 Phase 2。"

**Do NOT wait to be asked if anything is missing.** The charter defines completeness. If every charter decision is answered, the design is complete.

### Re-check Protocol (three-way branch)

When re-checking `02-design.md` at any point, classify every finding before acting:

发现问题 ├── 章程内,尚未回答 │ → 立即补充,无需用户确认 │ ├── 章程内,但当前答案不够清晰 │ → 澄清现有答案,不扩展范围 │ ├── 章程内,但需调整章程边界 │ → 提出 DR [charter-amendment],等待用户确认后再修改 │ └── 章程外 → 记录为 CR 候选,告知用户,不在当前设计中处理


**"章程外的发现"不是遗漏,是边界决策。** 不得直接加入设计。

## `04-verification.md` Template

```markdown
# [Feature Name] — Verification

**Status:** In Progress | Complete
**Implementation Plan:** docs/plans/YYYY-MM-DD-<feature-name>/03-implementation-plan.md

## Checklist

| REQ / CR / DR | Description | Acceptance Criteria | Evidence | Status |
|---------------|-------------|---------------------|----------|--------|
| REQ-001 | [short title] | [Given/When/Then summary] | [test name / command output] | pending |
| REQ-002 | [short title] | [Given/When/Then summary] | [test name / command output] | pending |
| CR-001 | [change description] | [updated criteria] | [evidence] | pending |
| DR-001 | [design change] | [verification approach] | [evidence] | pending |

> **Status values:** `pending` (not started) | `verified` (test passed, evidence recorded) | `failed` (check did not pass, needs fix)

## Coverage

| Layer | Target | Actual | Status |
|-------|--------|--------|--------|
| Service | 85% | — | pending |
| Controller | 80% | — | pending |
| Overall | 80% | — | pending |

## Closure Gate

- `unmapped_req`: 0
- `open_cr`: 0
- `open_dr`: 0
- `pending_recheck`: 0

Project Standards Baseline

Before writing tasks, capture standards from:

  1. rules/**/*.md
  2. Root instructions (AGENTS.md, CLAUDE.md, project docs)
  3. Nearby implementation patterns

Then identify the active tech stack from 01-requirements.md and 02-design.md, and apply the relevant language skill:

Tech StackApply Skill
Java / Spring Bootagent-workflow:springboot-patterns
Any backendagent-workflow:api-design (for API tasks)
DB migrationsagent-workflow:database-migrations

Traceability Rules (MANDATORY)

  • Requirements use REQ-### IDs (defined in 01-requirements.md).
  • Requirement changes use CR-### IDs in 05-change-log.md.
  • Design changes use DR-### IDs in 05-change-log.md.
  • Every task in 03-implementation-plan.md must map to one or more REQ-###.
  • 04-verification.md must verify each REQ-### and related CR-### / DR-### if changed.

Plan Header

Every implementation plan (03-implementation-plan.md) starts with:

# [Feature Name] — Implementation Plan

> **For Claude:** REQUIRED SUB-SKILL: Use agent-workflow:executing-plans to implement this plan task-by-task.

**Requirements:** docs/plans/YYYY-MM-DD-<feature-name>/01-requirements.md
**Design:** docs/plans/YYYY-MM-DD-<feature-name>/02-design.md
**Project Conventions:** [Concrete rule files in `rules/**/*.md`]
**Traceability:** [REQ/CR/DR strategy for this feature]
**Research Notes:** [Path to `06-research-notes.md` if used]

---

## Task Summary

| Task | Type | REQ | Depends on | Status |
|------|------|-----|------------|--------|
| Task 1: [name] | code-task | REQ-001 | — | pending |
| Task 2: [name] | migration-task | REQ-002 | Task 1 | pending |

## Definition of Done

Every task must satisfy all items before being marked `completed`:

- [ ] All tests pass; coverage meets targets (Service ≥ 85%, Controller ≥ 80%, Overall ≥ 80%)
- [ ] No TODO / debug / temporary code left
- [ ] Naming follows project rules (`rules/**/*.md`)
- [ ] Error handling complete (no silent failures)
- [ ] All callers listed in `Impact` have been handled
- [ ] `04-verification.md` evidence updated for related REQ / CR / DR
- [ ] Commit message format: `type(scope): one-line English summary`

> Override: project `rules/**/*.md` may extend or tighten this list.

Task Structure

Every task starts with the traceability + files header, then uses the steps template matching its type.

### Task N: [Component Name]

**Type:** `code-task` | `migration-task` | `config-task`

**Traceability:**
- REQ: `REQ-001`, `REQ-002`
- CR: `CR-003` (if applicable)
- Status: `pending` | `in_progress` | `completed` | `superseded` | `cancelled`

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

**Depends on:** Task N (optional — list task numbers that must be `completed` before this task starts)

**Impact:** [List existing modules/callers affected, or "none" if new code only]

**Test layer:** `unit` | `slice` | `integration` | `e2e` (choose all that apply)

code-task steps (default for feature/bugfix/refactor)

Step 1: Write the failing test (at the layer specified in Test layer)
Step 2: Run test — verify it fails for the expected reason
Step 3: Write minimal implementation following project language skill
Step 4: Run test — verify it passes; run full suite for regression
Step 5: Self-review: no debug code, naming follows rules, error handling complete
Step 6: Commit — format: type(scope): one-line English summary

migration-task steps (DB schema / data migration)

Step 1: Write migration script (forward)
Step 2: Write rollback script (backward)
Step 3: Test forward migration on dev data — verify schema/data correctness
Step 4: Test rollback — verify state restored
Step 5: Confirm zero-downtime compatibility if required
Step 6: Commit — format: type(scope): one-line English summary

config-task steps (config / env var / parameter change)

Step 1: Identify all affected environments
Step 2: Apply change with backward-compatible default if needed
Step 3: Verify affected behavior in dev environment
Step 4: Document change and affected services
Step 5: Commit — format: type(scope): one-line English summary

Revision Mode Rules

Requirement change (scope/behavior):

  1. Append CR-### to 05-change-log.md.
  2. Update 01-requirements.md effective requirement state.
  3. Update 03-implementation-plan.md tasks and statuses.
  4. Keep superseded tasks for audit (Status: superseded), do not silently delete history.
  5. Update 04-verification.md checklist for impacted REQ/CR.

Design change (technical approach, no scope change):

  1. Append DR-### to 05-change-log.md.
  2. Update 02-design.md and set its Status back to Draft.
  3. Present updated design to the user and state:

    "Design revised (DR-###). Please review 02-design.md. Confirm to resume implementation."

  4. Wait for explicit confirmation before continuing.
  5. Upon approval, set 02-design.md status to Approved (amended: DR-###).
  6. Update affected tasks in 03-implementation-plan.md.
  7. Update 04-verification.md if verification steps are affected.

Charter amendment (new decision point discovered after Phase 0):

  1. Stop current design work immediately.
  2. Append DR-### [charter-amendment] to 05-change-log.md with the new decision point and why it was not identified in Phase 0.
  3. Present to user:

    "发现章程外的设计决策点:[description]。建议将其加入 Decisions Manifest。请确认是否纳入本次设计范围,或记为 CR 候选。"

  4. Wait for explicit confirmation before continuing.
  5. If confirmed in scope: update Design Charter in 02-design.md, answer the new decision, continue.
  6. If confirmed out of scope: add to Explicitly Excluded in charter, record as CR candidate, continue without designing it.

Execution Handoff

After saving or revising the plan, offer:

  1. Subagent-Driven (this session) - use agent-workflow:subagent-driven-development
  2. Parallel Session (separate) - use agent-workflow:executing-plans

Ask: "Which approach?"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.