skills/plan-driven-change/SKILL.md
Approval-gated, plan-first workflow for larger code changes. Use when the user asks to build a new capability or make a non-trivial change that touches multiple files, crosses module boundaries, or involves architectural decisions. Do NOT use for bug fixes, one-line tweaks, dependency bumps, or small config changes. The workflow is: clarify intent, get user approval, write a rich plan with interface stubs and checklist, get user approval again, implement with progress logging, run a gap audit, and record tweaks.
npx skillsauth add grepug/skills plan-driven-changeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Plan-first development cycle for larger changes. Combines brainstorming-style intent review with a tracked plan document and explicit implementation traceability.
If the change creates or reshapes module boundaries, introduces a new nested layer, changes public entrypoints, touches multiple layers where responsibilities may blur, or is happening in a repo with weak or duplicated boundary docs, load module-boundary-governance before finalizing the plan.
Skip for: bug fixes, one-liners, dependency bumps, config tweaks, and small maintenance edits. Act directly for those.
Before starting, quickly orient to the project:
scripts/discover_plan_conventions.py <repo-root> when available to inspect the repo before making assumptions about plan storage or archival.docs/, docs/plans/, docs/rfcs/, docs/decisions/, .github/, planning/, or similar. If none found, default to docs/plans/.docs/plans/ARCHIVED.md?package.json, Makefile, README, justfile, pyproject.toml, or CI config.Use these findings throughout the workflow — don't hardcode assumptions. The skill must follow repo-specific plan retention conventions instead of inventing its own.
Load module-boundary-governance when any of these are true:
Load the brainstorming skill. Then conduct a focused scoping conversation:
Ask one question at a time to clarify:
Challenge assumptions: if a simpler approach exists, surface it before planning the complex one.
Once aligned, produce the intent block in chat (not a file yet):
What: <one sentence>
Why: <one sentence>
Out of scope: <one sentence>
Key risk: <one sentence>
The approved intent block becomes the seed for the Context section of the Phase 2 plan document.
Create a plan file at the project's established location (discovered in Phase 0), using a consistent naming scheme. Default if no convention exists:
docs/plans/YYYY-MM-DD-NN-<kebab-topic>.md
NN is a zero-padded two-digit sequence number for that calendar day, starting at 01. List existing files for that date and increment from the highest NN found (or use 01 if none exist).
The plan is a design document first, checklist second. It should be rich enough that any engineer can implement without asking follow-up questions.
docs/plans/ARCHIVED.md metadata index with git-based recovery commands.Example archive-index convention:
docs/plans/ARCHIVED.mdassets/ARCHIVED.example.mdOriginal planArchived onSummaryRecoverygit log --follow -- docs/plans/<filename>.mdgit show <commit>:docs/plans/<filename>.md# <Topic>
**Date:** YYYY-MM-DD
**Status:** Draft | Ready for implementation
**Target path:** `path/to/affected/module/`
<!-- Optional: Supersedes: [prior-plan.md](link), Based on: [review.md](link) -->
---
## Context
<2–4 sentences: what problem this solves, why now, and — if this replaces a prior design —
what the old approach got wrong. Be specific. Name the actual file or abstraction being fixed.>
---
## Design
<!-- One ## sub-section per major component. Each section contains:
- the interface / signature stub (always — even a brief stub in the project's language)
- rationale: why this shape / approach
- key design decisions with > **Why X not Y:** callouts for non-obvious choices
- execution flow in numbered pseudocode if the component has a complex happy-path -->
### <Component Name> (`path/to/file`)
<interface or signature stub — use the project's language conventions, not full implementation>
<rationale paragraph>
> **Why X not Y:** <one-sentence justification for a non-obvious choice>
<!-- Execution flow — include only when the component orchestrates multiple steps -->
**Flow:**
method(input):
---
## Boundary <!-- required for boundary-sensitive changes -->
<!-- Include this section whenever module-boundary-governance applies.
State the owning manifest, affected layers, whether the manifest changes,
whether the public surface changes, and the main risk of boundary drift. -->
Owning manifest: `path/to/boundary.manifest.yml`
Affected layers:
- `<layer-id>`
Manifest changes:
- [ ] none
- [ ] add or update layer definitions
- [ ] public surface changed
Boundary risk:
- <main risk of responsibility or dependency drift>
---
## Folder Structure <!-- include only when new directories or files are being created -->
path/to/module/ ├── file-a — <one-line purpose> └── file-b — <one-line purpose>
<!-- Include a "Why This Layout" comparison table if the structure replaces an existing one -->
---
## Checklist
<!-- Each item names the file(s) it touches and references the design section above.
Steps are ordered by dependency. Verification steps are explicit, not assumed. -->
- [ ] <step> — `path/to/file` (see §<ComponentName>)
- [ ] <step> — `path/to/other`
- [ ] Verify: build + lint + tests pass
## Tweaks
<!-- appended after implementation -->
> **Why X not Y:** callouts for any decision another engineer might questionsee §ComponentName)## ChecklistDo a brainstorm-style review pass on the full document before showing it to the user:
## Boundary section with an owning manifest and affected layers?Wait for user approval of the plan. The user may reorder, add, or remove items. Do not begin implementation until they say "go" or equivalent.
Work through the checklist top-to-bottom:
## ChecklistWhile implementing, leave a compact trail that makes the work easy to review:
If the project already has a decision log, changelog, ADR folder, or implementation-notes convention, append to that instead of inventing a new logging location.
docs/plans/*.md, do not introduce tasks/todo.md.Write comments for future readers working without full context. That includes teammates, your later self, and AI assistants reading one file at a time. Favor rich local explanation when it helps a future editor understand why the code exists or why it works this way. Do not narrate obvious code.
New files and heavily reshaped files should open with a short header comment that explains:
If the file is part of a larger flow, call out the key related module, entrypoint, or owning abstraction so readers know where to look next.
Document the contract, not the implementation. Add function or method comments when a reader would otherwise miss:
Skip doc comments for trivial getters, obvious helpers, or code whose behavior is already clear from the signature and name.
Use inline comments to explain the why behind a choice:
Do not restate what the next line of code obviously does. Good inline comments usually sit next to subtle logic, protocol edges, migrations, compatibility shims, retry behavior, or ordering assumptions.
When code embodies an important design decision, add a local note that captures the trade-off. Keep broad system rationale in the plan document, but keep enough context in the code so a future editor can safely modify it without hunting through old chat or plan history.
Make temporary comments actionable and traceable:
After all checklist items are checked:
module-boundary-governance applied, run the boundary audit and record whether changed files still match the manifest.Post-implementation polish or orphan changes that emerge from conversation:
## Tweaks as one-liner checked items:
- [x] Fixed edge case in parser — added null guard
## Tweaks section.development
Measure and safely clean reclaimable macOS developer storage, including Xcode, simulator, CoreDevice, rebuildable project artifacts, Docker or OrbStack, VS Code, app cache, WeChat media, and Time Machine local snapshots.
development
Govern inline documentation coverage and comment quality in repo-owned source files. Use when Codex needs to audit or fix file headers, type docs, function or method contract docs, non-obvious inline comments, generated-file exclusions, or repo documentation rules for TypeScript, JavaScript, and Swift projects, including setting up a reusable docs/rules policy in a project-agnostic way.
tools
产品无关的 Linear 工作流,用于创建、更新、检查和讨论产品 issue、元数据、状态、范围、确认事项和长期产品文档同步。
data-ai
One-sentence summary of what this skill helps an agent do and when it should be used.