/d3nexus:writing-plansfrom d3nexus
Use when you have a spec or requirements for a multi-step task, before touching code
Ships in d3nexus. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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. Crucially, plans must define bite-sized steps that not only cover unit TDD, but also Integration Test Planning & Boundary Edge Cases (empty states, errors, timeouts, race conditions). For any Web or UI deliverables, the plan MUST include a dedicated Browser Verification step using hermetic Playwright E2E assertions and screenshot capture as the primary automated gate (with optional interactive Chrome DevTools via browser_subagent pre-flight checked for DevToolsActivePort and falling back to Playwright in isolated multi-profile HOME environments).
Announce at start: "I'm using the writing-plans skill to create the implementation plan."
Context: If working in an isolated worktree, it should have been created via the d3nexus:using-git-worktrees skill at execution time.
Save plans as one English-only file:
docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md (a legacy .en.md plan is accepted, not produced)The plan MUST carry a linked table of contents covering every ## and ### Task section. Produce
a Vietnamese explanation only when Role 1.0 explicitly asks for it.
The plan MUST strictly satisfy Markdown & Diagram Lint Standards:
#, no trailing punctuation in headings, language tags on all fenced code blocks (no bare fences), and formatting hygiene (no trailing whitespace, no hard tabs).flowchart TD/LR (NEVER legacy graph TD/LR), double-quote node labels containing special characters/parentheses/brackets/colons (e.g. node["Text (Details)"]), use clean alphanumeric IDs, and avoid trailing semicolons.diamond for decisions ?, box for actions, plaintext for commands, ellipse for states, octagon for warnings, doublecircle for start/complete), semicolons on every statement, and quoted labels.Unit tests in isolation are necessary but insufficient to guarantee that a feature works end-to-end. When writing implementation plans:
Map Critical Use Cases to Integration Tests:
Exhaustive Edge Case Verification: For every feature, the plan MUST explicitly define test steps covering:
Live Web Browser Verification (For Web / UI Deliverables):
HOME) as the primary automated browser gate.browser_subagent) is an optional visual pass that MUST run a pre-flight check for DevToolsActivePort in the active Chrome user data directory and fall back cleanly to hermetic Playwright E2E + screenshots whenever DevToolsActivePort is absent (ENOENT) in isolated multi-profile HOME environments.npm run dev or npx --no-install astro preview --port 4324).npx --no-install playwright test) to exercise interactive flows, assert DOM text/states and CSS layout geometry, enforce zero unexpected console errors, and capture screenshot artifacts.DevToolsActivePort in the active Chrome user data directory; if present, dispatch browser_subagent to inspect visual hierarchy and record a WebP (.webp) interaction artifact; if absent, record the fallback to hermetic Playwright E2E + screenshots and proceed without stalling.100% BDD & Edge Case Traceability:
Quality-Manifest Verification Commands & No Bare npx:
d3nexus resolve-quality --files <planned_files> (when .agents/quality/*-quality.json exists) before locking task files and test steps to derive canonical/forbidden test roots, dual Web V8 LCOV unit + Playwright E2E rules, coverage_floors.json ratchets, referencing ?v= templates, and $D3NEXUS_KIT/skills-interpolated scoped type_check/lint commands (never emit unexpanded {skills_dir} or {base_ref} literals).npx <bin> in plan steps or verification commands (bare npx can hang on interactive install prompts in headless subagents) — always pass npx --no-install <bin> (or explicit npx --yes --package <pkg> <bin> when a non-interactive install is intentionally required).Before handing a plan to an executor, dispatch a reviewer subagent using
plan-document-reviewer-prompt.md. A plan that reads well to
its author and is missing a step reads exactly the same either way. Review the plan and apply every
content fix to it.
If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during dev-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.
A task is the smallest unit that carries its own test cycle and is worth a fresh reviewer's gate. When drawing task boundaries: fold setup, configuration, scaffolding, and documentation steps into the task whose deliverable needs them; split only where a reviewer could meaningfully reject one task while approving its neighbor. Each task ends with an independently testable deliverable.
Each step is one action (2-5 minutes):
Every plan MUST start with this header:
# [Feature Name] Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use d3nexus:subagent-driven-development (recommended) or d3nexus: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]
**Spec:** [path to the spec/design doc this plan implements — the plan
argues from the spec, so the spec travels with it; executors read both]
## Table of Contents
[A linked entry for every major section and every `### Task` heading]
## Global Constraints
[The spec's project-wide requirements — version floors, dependency limits,
naming and copy rules, platform requirements — one line each, with exact
values copied verbatim from the spec. Every task's requirements implicitly
include this section.]
---
### 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`
**Interfaces:**
- Consumes: [what this task uses from earlier tasks — exact signatures]
- Produces: [what later tasks rely on — exact function names, parameter
and return types. A task's implementer sees only their own task; this
block is how they learn the names and types neighboring tasks use.]
- [ ] **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: Integration, Edge Case & Static Quality Checks (if touching workflows/data/APIs)**
Write & run integration test exercising multi-component flow and boundary edge cases (empty payload, timeout, error fallback), plus the `$D3NEXUS_KIT/skills`-interpolated scoped `type_check`/`lint` commands and required unit/LCOV tests resolved via `d3nexus resolve-quality --files <planned_files>` (never bare `npx <bin>` — use `npx --no-install` or explicit `npx --yes --package <pkg>`):
Run: `npm test tests/integration/test_flow.test.ts` (or `pytest tests/integration/...`)
Expected: PASS with 100% boundary coverage
- [ ] **Step 6: Browser Verification (for Web / UI Tasks)**
Launch the preview/dev server and run the primary hermetic Playwright E2E gate:
1. Run `npx --no-install playwright test` against `http://localhost:<port>/<route>` (project-local bundled Chromium, independent of host `HOME`)
2. Assert interactive DOM states, layout geometry, and zero console exceptions
3. Capture and save screenshot artifacts for the verified views
4. Optional interactive supplement: pre-flight check `DevToolsActivePort` in the active Chrome user data directory; if present, dispatch `browser_subagent` for an interactive `.webp` visual pass; if absent (`ENOENT` in isolated `HOME`), record the fallback to hermetic Playwright E2E + screenshots and proceed without stalling
- [ ] **Step 7: Commit**
```bash
git add tests/path/test.py src/path/file.py
git commit -m "[SCOPE] Add specific feature" -m "- <what this step changed>"
```
Every step must contain the actual content an engineer needs. These are plan failures — never write them:
TBD, TODO, "implement later", "fill in details"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. Markdown & Diagram lint check: Does the plan strictly adhere to markdown lint standards (all code blocks tagged with language, no skipped headings, clean formatting)? Do any embedded Mermaid diagrams use modern flowchart instead of legacy graph, with quoted special-character labels? Do any DOT diagrams follow standard semantic shapes and statement semicolons?
5. Integration & Edge Case Verification Check: Does the plan specify tests for boundary edge cases (empty states, errors, race conditions)? If the plan touches Web/UI code, does it mandate a hermetic Playwright E2E + screenshot verification gate as primary and include a DevToolsActivePort pre-flight with Playwright fallback for any optional interactive browser_subagent steps?
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.
Verify the plan mechanically after all fixes:
python3 skills/doc_quality_check/resources/scripts/check_document.py \
--require-toc docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md
python3 "$D3NEXUS_KIT/skills/dev-implementation/resources/scripts/check_task_contract.py" \
--check-plan docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md
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:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub danhdue/ai-agent-tools --plugin d3nexus72 skills in this plugin
/android-api-integrationGenerates a standardized Network Module, API Interface, Remote Data Source, Repository, UseCase, Models, and ViewModel updates for Android using the Hybrid Network Architecture and MVI Pattern./android-quality-checkRead-only Android quality assurance provider implementing the common quality contract. Executes project-configured Gradle, Spotless, Detekt, and Konsist capabilities from .agents/quality/android-quality.json, enforces BCV and architecture policies, and outputs structured results bound to repository SHA./android-ui-auditAudits Jetpack Compose and Android UI code for recomposition stability, state hoisting, Material3 design system adherence, and modifier best practices.Other plugins' skills for the same job