بنقرة واحدة
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when you have a spec or requirements for a multi-step task, before touching code
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when auditing a Rust codebase, module, or workspace and wanting cross-model consensus on findings, a false-positive-filtered consolidated report, and a reproducible audit trail in git
Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
Use after writing or modifying code to simplify and refine it for clarity, consistency, and maintainability without changing functionality. Triggers after any implementation work in the current session.
Dynamic performance measurement for Rust projects — profiling, load testing, benchmarking, and analysis of existing observability data (traces, metrics, logs). Use when you need measured impact, not inference. Requires either a runnable binary + load generator, or existing production telemetry. For static code-level analysis without measurement, use rust-perf.
Static performance audit for Rust projects — analyzes code for allocation, async, database, data-structure, and compile-time anti-patterns without requiring a running system. Use when reviewing code for performance issues before or instead of load testing. For runtime profiling and load-test analysis, use rust-perf-measure.
Use when adding, reviewing, or improving doc-comments on Rust functions, methods, structs, enums, or modules. Covers idiomatic `///` and `//!` style, required sections, and automation via cargo doc.
| name | writing-plans |
| description | Use when you have a spec or requirements for a multi-step task, before touching code |
Write implementation plans as a TODO list of well-defined tasks, not as pre-written code. Document what each task must achieve, the contracts/interfaces it touches, the behavior to verify, and the references the engineer should consult. The engineer writes the actual code following TDD — you define the targets, not the keystrokes.
Document for each task: which files to touch, the interfaces/contracts involved, the behavior and acceptance criteria, docs they might need to check, and how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
Assume they are a competent developer who will write the implementation themselves. They know almost nothing about our toolset, problem domain, or where things live — so be explicit about paths, contracts, and expected behavior. But do not spell out function bodies or full test files for them: define the contract and the behavior, and let them implement it test-first.
The default is to describe, not to pre-write code. Write literal code only when that code is the definition (see "When to Show Code" below).
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
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.
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.
The plan describes behavior and defines contracts. It does not contain the implementation. Use this rule to decide whether a code block belongs in the plan:
Show literal code only when the code IS the definition — i.e. it's a contract the engineer must match exactly:
Describe instead of showing code for everything the engineer implements:
The litmus test: "Is this code something the engineer must reproduce verbatim, or something they should write themselves?" Only the former goes in the plan.
Each step is one action (2-5 minutes), phrased as an instruction — not as pre-written code:
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]
---
Each task defines a target: the files, the contract, the behavior to verify, and acceptance criteria. The engineer fills in the code test-first.
### Task N: [Component Name]
**Files:**
- Create: `exact/path/to/file.py`
- Modify: `exact/path/to/existing.py:123-145`
- Test: `tests/exact/path/to/test.py`
**Contract** (the signature/types the engineer must match — this IS the definition):
```python
def compute_discount(cart: Cart, coupon: Coupon | None) -> Money: ...
```
**References:** [existing patterns to follow, e.g. `src/pricing/tax.py` for the Money usage; relevant docs]
- [ ] **Step 1: Write the failing test**
Test `compute_discount` covers:
- No coupon → returns zero discount
- Percentage coupon → applies percent to cart subtotal
- Coupon above cart total → discount capped at subtotal (never negative)
- Expired coupon → raises `CouponExpired`
- [ ] **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: Implement `compute_discount` to satisfy the test**
Apply the coupon to the cart subtotal per the cases above. Cap the result at the subtotal; raise `CouponExpired` for expired coupons. Reuse `Money` arithmetic from `src/pricing/tax.py`.
- [ ] **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 discount computation"
```
Note how only the signature and the commands are literal code. The test cases and the implementation are described, because the engineer writes those test-first.
Never write the entire plan in a single response. Long responses cause connection timeouts and lose all work.
Required approach:
# WIP marker at the top# WIP marker, run self-review, save final versionBetween each task, write the task directly to the file using a tool call (write/edit) — do not buffer tasks in memory. If the connection drops mid-plan, the file will have whatever was written so far and work can resume.
Describing behavior is good. Being vague is the failure. The difference: a good description names the concrete cases and outcomes; a placeholder gestures at work without specifying it.
These are plan failures — never write them:
CouponExpired for expired coupons; reject negative quantities with ValueError")Allowed (and encouraged): describing what a function does and what its tests assert, in prose, instead of writing the code. That is not a placeholder — it's the point.
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 Vague Placeholders" section above. Also check the reverse: are you pre-writing implementation code or full test files that the engineer should write themselves? If so, replace it with a contract + behavior description (see "When to Show Code"). Fix both directions.
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.
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.
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: