plugins/superpowers/skills/writing-plans/SKILL.md
Use when you have a spec or requirements for a multi-step task, before touching code
npx skillsauth add primatrix/skills writing-plansInstall 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 for each task, code, testing, docs they might need to check, how to test it. 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 very 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: Append to the existing RFC file on primatrix/wiki (created by brainstorming skill).
The brainstorming skill creates an RFC PR with design spec content. This skill appends the implementation plan as a new ## Implementation Plan section to the same RFC file, pushing a new commit to the same branch/PR.
To append to the RFC:
set -e
# Fetch current RFC content
CURRENT=$(gh api repos/primatrix/wiki/contents/docs/rfc/NNNN-<topic>.md \
-f ref="rfc/NNNN-<topic>" --jq '.content' | base64 -d)
FILE_SHA=$(gh api repos/primatrix/wiki/contents/docs/rfc/NNNN-<topic>.md \
-f ref="rfc/NNNN-<topic>" --jq '.sha')
# Append implementation plan
UPDATED=$(printf '%s\n\n---\n\n## Implementation Plan\n\n%s' "$CURRENT" "$PLAN_CONTENT")
NEW_CONTENT=$(printf '%s' "$UPDATED" | base64 | tr -d '\n')
# Push update
gh api repos/primatrix/wiki/contents/docs/rfc/NNNN-<topic>.md \
-X PUT -f message="docs: add implementation plan to RFC NNNN" \
-f content="$NEW_CONTENT" -f sha="$FILE_SHA" -f branch="rfc/NNNN-<topic>"
RFC metadata (branch name, RFC number, file path, PR URL) is available in the session context from the brainstorming phase.
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.
Each step is one action (2-5 minutes):
Every plan MUST start with this header:
# [Feature Name] Implementation Plan
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** [One sentence describing what this builds]
**Architecture:** [2-3 sentences about approach]
**Tech Stack:** [Key technologies/libraries]
---
### 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`
- [ ] **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"
```
After completing each chunk of the plan:
Chunk boundaries: Use ## Chunk N: <name> headings to delimit chunks. Each chunk should be ≤1000 lines and logically self-contained.
Review loop guidance:
After saving the plan:
"Implementation plan appended to RFC: <PR_URL>. Ready to execute?"
Execution path depends on harness capabilities:
If harness has subagents (Claude Code, etc.):
If harness does NOT have subagents:
development
Use when analyzing TPU pretraining HBM occupancy from a profile directory — locates the static HBM peak (the same number TensorBoard's Memory Viewer shows), enumerates every buffer alive at the peak schedule moment with size / HLO instruction / opcode / op_name, and rolls the alive set up by opcode and op_name. Reads compile-time `*.hlo_proto.pb` (BufferAssignmentProto) as the primary source; runtime `*.xplane.pb` allocator events are a secondary, often-truncated signal.
testing
Use when analyzing TPU pretraining compute efficiency from xplane.pb — produces source-line-aggregated HLO duration tables, layer-scoped breakdowns, non-compute (padding/cast/copy) audits, and v7x roofline shortfall vs theoretical peak. Reads schema documented by profile-anatomy.
tools
--- name: comm-analysis description: Use when analyzing communication on a TPU pretraining profile — extracts every comm primitive (async + sync, TC + SparseCore), attributes axes via HLO replica_groups, computes per-row NCCL bus BW vs per-axis peak ICI BW (peak_link × k_torus_dims × directions_per_dim; TPUv7x: 200 GB/s bidir per link on a 3D torus; util% requires `--mesh-spec` with topology), and reports per-step compute/comm overlap. Builds on profile-anatomy. --- # Communication Analysis **
documentation
Use when reading TPU pretraining profiles (xplane.pb, trace.json.gz) — describes the on-disk layout, the XSpace/XPlane/XLine/XEvent/XStat hierarchy, and provides reference scripts that future tpu-perf skills can read as schema documentation.