/engineering-skills:detail-planningfrom engineering-skills
Expands one phase of plan.md into a deterministic, file-referenced implementation spec in executor.md, including failure-mode analysis, idempotency contracts, schema compatibility, isolation levels, observability, and rollback. Activates on phrases like 'detail planning' or 'expand phase'.
Ships in engineering-skills. 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.
None: SKILL.md is the whole skill.
ROLE: Staff engineer turning a planned phase into a specification precise enough that
implementation requires no further design decisions.
CORE FUNCTION: Expand exactly one phase of plan.md into executor.md, with every
file, signature, failure mode, and verification named.
Activates on: detail-planning, detail_planning, detail F<N>, expand phase F<N>,
breakdown F<N>, spec out F<N>.
plan.md does not exist, request planner first.executor.md is the single documentation artifact for detailed specs. Content that would
otherwise go into a separate design doc, schema doc, or notes file is appended into
executor.md under the correct section, annotated:
(Redirected from attempted
[filename])
Rationale: scattered planning documents drift out of sync and each one becomes a second
source of truth. plan.md is the roadmap authority; executor.md is the specification
authority.
Scope note: this policy governs documentation the agent generates. It does not forbid creating source files, migrations, tests, or config during the
implementphase, and it does not override a repository's existing documentation conventions (ADRs,docs/) when the user asks for them.
plan.md. Restate its goal.plan.md,
and the actual files the phase touches — read them, do not assume their contents.data-systems-design and carry its Design Record
decisions into this spec.security-engineering and
carry the plan's Security Record into this spec — each named mechanism becomes a step at a
named enforcement point, not a note. A mechanism with no step does not get built.executor.md under ## Phase F<N>: [Name].## Phase F<N>: [Title] — Specification
### Goal
[One sentence. What is true after this phase that was not true before.]
### Components
| Component | Path | Type | Action |
|---|---|---|---|
| [Name] | `src/services/billing.ts` | class | Modify |
| [Name] | `migrations/0143_add_idempotency_keys.sql` | migration | Create |
### Interfaces
[Exact signatures, types, schemas, API contracts, message payloads — declarations only]
### Steps (ordered)
#### Step 1 — [Title]
- **File:** `path/to/file.ext`
- **Action:** [Precise change]
- **Depends on:** [Prior step, or "none"]
- **Failure modes:** [Section 4 table row references]
- **Done when:** [Observable/executable criterion]
#### Step 2 — [Title]
…
### Failure Mode Analysis
[Section 4 — including the hazard scan, and the vulnerability scan if the security gate applies]
### Contracts
[Section 5 — including the security contract (5.5) if the security gate applies]
### Observability
[Section 6]
### Verification
[Section 6.2]
### Rollback
[Section 7]
### Risks
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
### Out of Scope
- [Explicitly deferred items → recorded under `## Future Enhancement Notes`]
For each step that performs I/O, mutates state, or crosses a process boundary:
| Step | What can fail | Detection | Behavior | Recovery |
|---|---|---|---|---|
| 3 | Payment provider times out (outcome unknown) | 5s deadline exceeded | Do NOT re-charge; mark `pending`, reconcile via provider lookup | Reconciliation job resolves within 15m |
| 4 | Outbox relay crashes mid-batch | Consumer lag alert | Rows stay unsent; at-least-once redelivery | Consumers are idempotent on `event_id` |
| 5 | Backfill interrupted | Checkpoint row stale > 10m | Resume from checkpoint | No manual intervention |
Then run the hazard scan for this phase against
data-systems-design/references/hazard-catalog.md, using its "Quick scan order":
### Hazard Scan (this phase)
| Hazard | Applies | Mitigation in this spec |
|---|---|---|
| H-14 Non-idempotent retry | Yes | Step 3 idempotency key; unique index in migration (Step 1) |
| H-32 Dual write | Yes | Step 4 uses the outbox; no direct index write |
| H-29 Hot partition key | No | Partitioned by `tenant_id`, evenly distributed |
Then, if the security gate applies to this phase, run the vulnerability scan against
security-engineering/references/vulnerability-catalog.md, using its "Quick scan order". The
mitigation column must name a step, so the spec is what gets built:
### Vulnerability Scan (this phase)
| Vulnerability | Applies | Mitigation in this spec |
|---|---|---|
| V-43/V-44 Missing or incomplete mediation | Yes | Step 2 adds the tenant predicate in the repository, not the handler; Step 6 negative test asserts cross-tenant 404 |
| V-25 No replay protection | Yes | Step 4 rejects timestamps older than 5m and caches seen `event_id` for the window |
| V-14 Secret in source | Yes | Step 1 reads the signing key from the secret store; no default value in config |
| V-09 Weak randomness | No | No tokens or identifiers generated in this phase |
SELECT … FOR UPDATE, CAS with retry, or serializable + retry loop| Change | Backward compatible? | Forward compatible? | Phase (expand/migrate/contract) |
|---|---|---|---|
| Add `idempotency_key` nullable | Yes | Yes | Expand |
| Backfill existing rows | N/A | N/A | Migrate |
| Add NOT NULL constraint | No — requires backfill complete | Yes | Contract (later deploy) |
Plus: migration lock strategy (CONCURRENTLY / online DDL / lock_timeout), batch size,
and resume mechanism for backfills.
security-engineering/references/10-intrusion-detection-and-audit.md)Mark N/A per line rather than deleting the lines; an N/A that someone had to write is a decision, and a missing line is an omission nobody noticed.
| Signal | Type | Name | Alert threshold |
|---|---|---|---|
| Charge attempts by outcome | counter | `billing.charge.total{outcome}` | error ratio > 1% for 5m |
| Outbox relay lag | gauge | `outbox.oldest_unsent_age_seconds` | > 60s |
| Duplicate key rejections | counter | `billing.idempotency.duplicate` | informational |
| Invariant: unsent outbox rows older than 1h | check | reconciliation job | any > 0 → page |
Include structured log fields (especially the end-to-end request ID) and trace spans.
| # | Check | Method | Passes when |
|---|---|---|---|
| 1 | Duplicate charge impossible | Integration test issuing the same key twice concurrently | Exactly one charge; second returns the first result |
| 2 | Migration is non-blocking | Run against a seeded copy with concurrent writes | No lock wait > 1s |
| 3 | Consumer is idempotent | Replay the last 1,000 events | No change in derived state |
| 4 | Rollback works | Deploy N+1 then revert to N | Application healthy, no data loss |
Include the concurrency test explicitly for any hazard in section A of the catalog — single-threaded tests cannot detect lost updates or write skew.
Every security mechanism needs a negative test. A test proving the authorized caller succeeds says nothing about the unauthorized one; the check may not exist. For each entry in the vulnerability scan, add a check that the wrong principal, the stale timestamp, the tampered payload, or the cross-tenant identifier is refused.
- **Revert method:** [flag flip / redeploy previous / down migration]
- **Data reversibility:** [fully reversible / reversible with loss of X / irreversible after step N]
- **Point of no return:** [the step after which rollback requires a restore]
- **Rollback verification:** [how you confirm the revert worked]
If a phase is irreversible past a point, that fact belongs in plan.md too, so nobody
discovers it during an incident.
path/to/service.executor.md.## Future Enhancement Notes — never into the current spec.implement F<N>.| Need | Skill |
|---|---|
| Create or update the roadmap | planner |
| Implement this spec | implement |
| Check the implementation against this spec | verify |
| Review the resulting diff | code-review |
| Data/distribution decisions and hazard catalog | data-systems-design |
| File, process, signal, and thread decisions and the failure catalog | systems-programming |
| Threat models, security decisions, and vulnerability catalog | security-engineering |
| Full pipeline | engineer-workflow |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
planning, specification, phase-expansion, implementation-spec
Other plugins' skills for the same job
npx claudepluginhub cool-coder174/engineering-skills --plugin engineering-skills18 skills in this plugin
/capacity-engineeringFinds the resource that reaches its limit first. Proves it with a load test that resembles real traffic. Plans for the load that was measured. Use this skill for capacity planning, a load test, a stress test, or a bottleneck hunt. Use it for a question about headroom, saturation, or throughput. Use it for utilization, queue depth, thread pool size, or connection pool contention. Use it for cache hit rate, precomputed content, garbage collector tuning, or session timeout. Use it for N+1 queries, table scans, or a launch traffic forecast. Use it for load balancing policy, subsetting, and server count. The content comes from Release It! (Nygard) and Site Reliability Engineering (Beyer and others)./code-reviewMulti-mode code review engine with six commands (/review-diff, /review-uncommitted, /review, /review-inscope, /review-data, /review-security) for branch diffs, uncommitted changes, full repository audits, scoped task reviews, data/distributed-systems hazard audits, and adversarial security review. Produces severity-ranked findings with concrete fixes, hazard and vulnerability scans, scope checks, and merge-readiness verdicts. Use when reviewing code, PRs, diffs, uncommitted changes, auditing a repo, or assessing security risk./data-systems-designDesign-decision engine for data-intensive and distributed systems, grounded in Designing Data-Intensive Applications (Kleppmann). Use when a task touches storage, schemas, migrations, replication, sharding, caching, transactions, queues, event streams, retries, background jobs, multi-service writes, or any non-functional requirement (latency, availability, throughput, durability, consistency). Provides decision tables, a named-hazard catalog, and deep-dive references per chapter./engineering-consultantRead-only engineering consultant with two duties. It compares frameworks, libraries, databases, platforms, and tools, and states a recommendation the reader can act on and can challenge. It explains a technical concept to a person new to it. Use it to choose a framework, compare two tools, evaluate a vendor, onboard a new engineer, read unfamiliar code, or ask for a recommendation. Use it for "should we use X or Y", "what is the difference between X and Y", "explain X", and "how does X work". It reads the repository, the documentation, and the web. It never writes a file. It routes build work to the specialist skills./engineer-workflowUnified engineering pipeline orchestrating Planning, Design, Security, Detail Planning, Implementation, Verification, and Review as one navigable workflow with persistent state in plan.md/executor.md and history tracking. Supports greenfield and brownfield projects. Use when the user wants an end-to-end workflow rather than a single phase./implementPhase-locked implementation engine that turns an executor.md specification into production code, enforcing non-negotiable robustness invariants — timeouts, jittered retries, idempotency keys, bounded queues and result sets, explicit isolation, monotonic clocks, fencing tokens, expand/migrate/contract migrations, and no dual writes. Use when the user says implement, execute, code this, or build.