plugins/writing-plans-enhanced/skills/writing-plans-enhanced/SKILL.md
Enhanced plan-authoring skill with Pre-Writing context gathering, task metadata, non-TDD templates, Red Flags, telemetry, and an automated plan linter. Use when you have a spec or requirements for a multi-step task, before touching code.
npx skillsauth add markus41/claude writing-plans-enhancedInstall 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.
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch, code to write, commands to run, and how to verify each step. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design well.
Announce at start: "I'm using the writing-plans skill to create the implementation plan."
Context: This should be run in a dedicated worktree (created by brainstorming skill).
Save plans to: docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md
digraph when_to_use {
"Have spec or requirements?" [shape=diamond];
"Single-step or exploratory?" [shape=diamond];
"Covers multiple subsystems?" [shape=diamond];
"writing-plans (this skill)" [shape=box];
"Just implement directly" [shape=box];
"Split into sub-plans first" [shape=box];
"Use brainstorming skill first" [shape=box];
"Have spec or requirements?" -> "Single-step or exploratory?" [label="yes"];
"Have spec or requirements?" -> "Use brainstorming skill first" [label="no"];
"Single-step or exploratory?" -> "Just implement directly" [label="yes"];
"Single-step or exploratory?" -> "Covers multiple subsystems?" [label="no, multi-step"];
"Covers multiple subsystems?" -> "Split into sub-plans first" [label="yes"];
"Covers multiple subsystems?" -> "writing-plans (this skill)" [label="no, single subsystem"];
}
Write plans in five phases. Each phase has outputs the next phase depends on.
Don't skip this. A plan written without context produces tasks that conflict with the codebase and force the implementer to guess.
Read the spec twice. The first read builds intuition. The second catches the details you glossed over. Note every explicit requirement and every implicit assumption.
Study the codebase before decomposing tasks:
Identify risks and unknowns:
Capture findings briefly at the top of the plan under Context (codebase conventions, reference patterns, known risks). The implementer reads this before touching code.
If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
Plan size guidance:
| Task count | Shape | Notes |
|------------|-------|-------|
| 3–10 | Single plan | Normal size — keep tasks in one file |
| 11–20 | Single plan with phases | Group tasks under ## Phase N: headings |
| 20+ | Split into multiple plans | One per phase or subsystem; link them |
If the plan keeps growing past 20 tasks, stop and ask: is this actually multiple features? Split before writing tasks you don't need yet (YAGNI).
Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
Each step is one action (2–5 minutes):
Every task should carry metadata that tells the implementer (or a subagent) how to execute it:
### Task N: [Component Name]
**Type:** TDD | Config | Refactor | Migration | Documentation | Infrastructure
**Depends on:** Task M (or: none)
**Parallel-safe:** yes | no
**Risk:** low | medium | high — [one-line reason if medium/high]
none liberally — tasks that don't depend on prior work can run in parallel.Not every task fits the red–green–commit loop. For non-code tasks, substitute a verification style that proves the task succeeded. See ./task-templates.md for full templates.
| Task type | Verification instead of test |
|-----------|------------------------------|
| Config change | Load config, print resolved value, assert expected |
| File move/rename | git status shows the rename; imports still resolve; tests still pass |
| Documentation | Cross-links resolve; code blocks parse; examples runnable |
| Infrastructure / IaC | terraform plan / kubectl diff shows expected delta; dry-run |
| Refactor (no behavior change) | All pre-existing tests still pass; no new tests needed |
| Migration (data/schema) | Dry-run succeeds; rollback plan present; applied on copy first |
For any non-TDD task, state the verification command and expected output explicitly.
Every plan MUST start with this header:
# [Feature Name] Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** [One sentence describing what this builds]
**Architecture:** [2-3 sentences about approach]
**Tech Stack:** [Key technologies/libraries]
**Context:**
- Codebase conventions: [one line]
- Reference pattern: [file path to similar feature]
- Known risks: [one line or "none"]
---
### Task N: [Component Name]
**Type:** TDD
**Depends on:** none
**Parallel-safe:** yes
**Risk:** low
**Files:**
- Create: `exact/path/to/file.py`
- Modify: `exact/path/to/existing.py:123-145`
- Test: `tests/exact/path/to/test.py`
- [ ] **Step 1: Write the failing test**
```python
def test_specific_behavior():
result = function(input)
assert result == expected
```
- [ ] **Step 2: Run test to verify it fails**
Run: `pytest tests/path/test.py::test_name -v`
Expected: FAIL with "function not defined"
- [ ] **Step 3: Write minimal implementation**
```python
def function(input):
return expected
```
- [ ] **Step 4: Run test to verify it passes**
Run: `pytest tests/path/test.py::test_name -v`
Expected: PASS
- [ ] **Step 5: Commit**
```bash
git add tests/path/test.py src/path/file.py
git commit -m "feat: add specific feature"
```
For non-TDD task templates (config, migration, refactor, documentation, infrastructure), see ./task-templates.md.
Every step must contain the actual content an engineer needs. These are plan failures — never write them:
After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
1. Spec coverage: Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
2. Placeholder scan: Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.
3. Type consistency: Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called clearLayers() in Task 3 but clearFullLayers() in Task 7 is a bug.
4. Dependency ordering: Does every Depends on: Task M refer to a task that comes before it? No forward references.
5. Verification completeness: Does every task have a verification step? TDD tasks need a "test passes" step. Non-TDD tasks need their specific verification (see Non-TDD Task Patterns).
6. Commit granularity: Does each task end with a commit? Are the commit messages specific ("feat: add foo") rather than vague ("wip", "update")?
7. Parallel-safe accuracy: For tasks marked Parallel-safe: yes, do they really not touch the same files or shared state as any other parallel-safe task?
If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
Optional: Dispatch the plan-document reviewer subagent (see ./plan-document-reviewer-prompt.md) for an independent read. Recommended for high-risk plans or when the implementer will be a fresh subagent with no spec exposure.
Plan is not ready to hand off when:
Parallel-safe: yes actually modify overlapping filesDepends on: forward-references (Task 3 depends on Task 7)Never:
Plans encounter reality. When execution reveals the plan is wrong:
Depends on: metadata and task order, then resume.Never let the plan drift from what's actually being built. A plan that doesn't match the code is worse than no plan.
Plans improve when you measure how they executed. For each task, capture at minimum:
| Metric | Why it matters | |--------|----------------| | Wall-clock duration | Compare to the 2–5 min step assumption; very long tasks were too big | | Pass on first attempt? | Low first-pass-pass rate = tasks are ambiguous | | Retry count before green | Each retry is a signal the plan missed something | | Test count added | Under-tested tasks are risk hotspots | | Commits per task | More than 1 = task was not atomic | | Blocker reason (if stuck) | Feeds future Pre-Writing context notes |
Persist these as a sibling execution-log.md next to the plan file. When writing the next plan, read the previous log to spot patterns (e.g., "tasks involving migrations always needed 2+ retries — budget more context there"). This closes the Plan → Execute → Learn → Plan loop.
Run the linter on every plan before handing it off:
bash ./scripts/plan-lint.sh docs/superpowers/plans/YYYY-MM-DD-feature.md
Exit codes: 0 = clean, 1 = issues found (prints file:line: issue), 2 = usage error. The linter catches: placeholders (TBD/TODO/"fill in"/"implement later"), missing **Context:** block, tasks missing metadata, forward dependencies (Task 3 depends on Task 7), and vague commit messages ("wip", "update", <10 chars).
Linter passing is necessary but not sufficient — it catches mechanical errors; it cannot validate spec coverage. Run Self-Review (Phase 5) regardless.
After saving the plan, offer execution choice:
"Plan complete and saved to docs/superpowers/plans/<filename>.md. Two execution options:
1. Subagent-Driven (recommended) — I dispatch a fresh subagent per task, review between tasks, fast iteration
2. Inline Execution — Execute tasks in this session using executing-plans, batch execution with checkpoints
Which approach?"
If Subagent-Driven chosen:
If Inline Execution chosen:
Before this skill:
During this skill:
./task-templates.md — Templates for TDD and non-TDD task types./plan-document-reviewer-prompt.md — Optional independent plan review./scripts/plan-lint.sh — Automated linter for placeholders, metadata, forward deps, vague commits./scripts/test-plan-lint.sh — Self-test for the linter (run before trusting linter output)After this skill:
tools
Documentation intelligence engine with graph-based API docs, algorithm library, and drift detection
tools
Ultraplan cloud planning — kick off a plan in the cloud from your terminal, review and revise in the browser, then execute remotely or send back to CLI
tools
--- name: mcp description: Configure MCP servers for Claude Code — stdio vs HTTP, authentication, Tools/Resources/Prompts distinction, channels (CI webhook, mobile relay, Discord bridge, fakechat), and cost of always-loaded tools. Use this skill whenever adding an MCP server, debugging connection issues, choosing between MCP Tools vs Prompts vs Resources, installing channel servers, or managing .mcp.json. Triggers on: "MCP server", "mcp config", "add Obsidian MCP", "install context7", "channels"
tools
Design, install, and debug Claude Code hooks across the full lifecycle (PreToolUse, PostToolUse, PostToolUseFailure, UserPromptSubmit, Notification, Stop, SessionStart, SessionEnd, PreCompact, SubagentStart, SubagentStop, TeammateIdle, PermissionRequest, Setup). Use this skill whenever a user asks to "install hooks", "add a pre-tool hook", "format on save", "block dangerous commands", "protect sensitive files", "restore context after compact", "enforce tests before stop", capture subagent telemetry, or runs /cc-hooks. Also triggers on "hooks not firing", "hook keeps blocking", or any configuration of .claude/settings.json hook sections.