/claude-engineering-skills:planfrom Claude Engineering Skills
Unified architecture + UX planner with engineering principles. Auto-detects whether the work is backend-only, frontend-only, or full-stack and applies the appropriate principle sets. Use when the user asks to plan, design, or architect anything — features, refactors, API endpoints, services, UI components, pages, layouts, user flows, modals, forms, visual changes, database schemas. Also auto-invoke when detecting planning context like "I want to add", "let's design", "plan the implementation", "how should we structure this", "I need to refactor", "design the UI for", "build a component", "improve the UX of". Invoke on the request's shape; don't explore the repo for stack context first and answer directly — the skill gathers that itself once invoked. Accepts a task description as argument; an explicit scope hint and diagram controls are available as flags. Triggers on: "plan", "design this", "architect this". Full command syntax: see the Usage section in this skill.
Ships in Claude 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.
Read when SKILL.md points to them.
Worktree preflight — in a linked git worktree the gitignored tooling tree
scripts/.claude-skills/is absent (git worktree adddoes not populate it), so every command below that uses it dies onMODULE_NOT_FOUND. Runnpm run skills:hydratefirst; if no such script exists,references/worktree-preflight.mdholds the entry to add (ask the user first: it editspackage.json). Keys are not copied: put them in~/.audit-loop.env, which every worktree reads.
Example: /plan add a wine recommendation engine
Usage: /plan <task description> — auto-detected scope
Usage: /plan <task> --scope=backend|frontend|full-stack — explicit scope hint
Usage: /plan <task> --no-diagram — skip the architecture mermaid block
Usage: /plan <task> --diagram=sequence|graph|er|state — force a specific mermaid diagram type
Usage: /plan <task> --campaign — an evaluation/test campaign: adds the C1-C12 contract
Triggers on: "plan", "design this", "architect this", "I want to add",
"let's design", "plan the implementation", "how should we structure this".
This skill's last line is an end marker naming the skill between em-dashes, after the Reference files table. If that last line is not in your context (context compaction keeps only the start of a skill), re-read
.claude/skills/plan/SKILL.mdin full before continuing — the later steps still apply.
Single planning skill that produces ONE consolidated plan document, even
for cross-stack work. Principle tables load from references/*.md by
detected scope (Phase 0).
node scripts/cross-skill.mjs detect-stack
Returns { stack, pythonFramework, detectedFrom }.
stack | Profile to apply |
|---|---|
js-ts | Universal principles |
python | Universal + Python profile (see references) |
mixed | File-based routing per the touched files; both profiles if both languages |
unknown | Universal principles only |
Choose ONE of: backend, frontend, full-stack. Use this
decision tree:
| Signal | Conclusion |
|---|---|
User explicitly passed --scope=X | Use X |
| Task touches only routes/services/models/migrations/CLIs/scripts/server | backend |
| Task touches only components/pages/layouts/styles/forms/UI flows | frontend |
| Task spans both, OR mentions API + UI together, OR is a feature with user-visible behavior backed by data | full-stack |
| Genuinely uncertain | full-stack (safer — extra principles cost a few tokens vs missing real concerns) |
Cite the detected scope at the top of the plan in a one-liner so the auditor and reviewer know which principle sets apply.
Lazy reference loading by scope:
| Scope | References to load in Phase 2/3 |
|---|---|
| backend | references/engineering-principles.md (+ python-backend-profile if Python) |
| frontend | references/ux-principles.md + references/technical-principles.md (+ python-frontend-profile if Python+templates) |
| full-stack | All of the above |
If the architectural memory is populated for this repo (a prior
npm run arch:refresh succeeded), consult the symbol-index for near-duplicates BEFORE proposing new code:
node scripts/cross-skill.mjs get-neighbourhood --json '{
"targetPaths": ["<paths/being/touched>"],
"intentDescription": "<one-line task summary>",
"kind": ["function","class","component","hook","route","method"]
}'
Inline the returned markdown field as "Neighbourhood considered"
near the top of the plan output. Handle by state:
cloud:false or repoRegistered:false → emit literal npm run arch:refresh hint; proceed (nothing compared).cloud:true, records:[] → "No near-duplicates found — proceed" only if coverage.status:"verified", else absence of evidence: search by hand.EMBEDDING_MISMATCH / RPC_ERROR → emit _consultation failed: <code>; plan proceeds without architectural context_; continue.BAD_INPUT → surface to user, abort plan generation.A precedent band means existing code occupies this space: open the named
symbols and decide on the code whether to reuse, extend, or write a sibling —
then record which and why under "Proposed Architecture" (a distance score cannot see dependency direction, API shape or
ownership). review = below the repo's noise floor (proceed); unscored = no embedding, nothing compared.
The Domain column flags domain-mismatch reuse candidates
→ references/context-callouts.md §Phase 0.5 — read when a candidate sits in another domain.
Run alongside the neighbourhood query:
node scripts/cross-skill.mjs compute-target-domains --json '{
"targetPaths": ["<paths/being/touched>"]
}'
Returns {domains: [...], untaggedPaths: [...], crossDomain: bool, ruleCount}.
Render two header lines in the plan output (right after the metadata block):
domains.length > 0):
- **Target domain(s)**: \`, ```crossDomain === true (>1 distinct tagged domain):
- ⚠ **Cross-domain work** — touches >1 domain; confirm boundary crossings are intentional.untaggedPaths.length > 0 (paths matched no rule):
- ⚠ **Untagged paths**: \`, `` — these don't match any rule in `.audit-loop/domain-map.json`. Consider adding a rule before designing.`Both warnings are heads-ups, not blocks. They surface architectural decisions the planner should make explicitly.
Run alongside the arch-memory + target-domains queries:
node scripts/cross-skill.mjs get-incident-neighbourhood --json '{
"targetPaths": ["<paths/being/touched>"],
"intentDescription": "<one-line task summary>",
"k": 3
}'
Returns {records, totalCandidatesConsidered, freshnessWarning}. Render
only when records.length > 0 (don't add a "no incidents — proceed"
line on every plan; that creates noise). When freshnessWarning is non-null,
add a freshness warning ABOVE the table. When the security strategy document
doesn't exist (response carries a hint), add a soft bootstrap warning at the
top of the plan output. → references/context-callouts.md §Phase 0.5c — read
when rendering any of these three.
Soft warning only — never blocks plan generation.
For any plan that crosses a trust boundary surfaced in the incidents callout, add a required "Security Considerations" section in the plan output addressing each relevant invariant.
If docs/architecture-map.md exists AND target domains are non-empty:
Read the file (or Grep for ## <domain>) and read the symbol
table beneath each target-domain section — the domain's full inventory
(and its summary, if any), complementing the embedding query.
Explore the codebase FIRST. The biggest planning failure is proposing solutions without understanding what already exists.
If scope ⊇ frontend, check whether persona testing has surfaced pain points in
the area being planned. The command resolves the repo itself (--repo ->
PERSONA_TEST_REPO_NAME from .env -> ambient git remote) — do NOT
shell-expand the env var into --repo, which yields an empty flag in any
session that did not export it. Read it only through cross-skill.mjs.
node scripts/cross-skill.mjs get-persona-sessions-by-repo --limit 5 --select persona,focus,verdict,findings,p0_count,p1_count
Output shape: {ok: true, cloud: true|false, measured, scope:{mode,slug}, rows: [...]}.
When cloud:false, no persona-test database is configured — proceed without
this signal. When measured:false, no repo resolved and nothing was read —
also proceed, but never read the empty rows as "no findings".
Filter rows whose focus overlaps with the feature. If matches found, include in the Context Summary as Known user-visible issues
(→ references/context-callouts.md §Phase 1 — read when rendering that block). Treat P0/P1 matches as HIGH priority in the design.
Always:
If scope ⊇ backend: 5. Trace the data flow: request lifecycle from route → service → DB and back
If scope ⊇ frontend: 6. Audit the current UI: read relevant HTML/CSS/JS for the area being changed 7. Map component landscape: existing modals, cards, grids, forms, toasts 8. Identify the design language: colour palette, typography, spacing, button styles 9. Trace user flows: how the user navigates to and through related features 10. Check responsive behaviour: how the UI handles different screen sizes 11. Note pain points: what feels clunky, inconsistent, or confusing
Do NOT propose a plan until exploration is complete.
Forced question: Are any planned operations dependent on others?
If yes, identify chains, prerequisites, and per-chain atomicity (typical
cases: batch ops, multi-step workflows, state transitions, cross-entity swaps
→ references/authoring-rationale.md §Phase 1.5 — read when unsure whether a dependency exists).
If all operations are independent — document that explicitly and move on. If ANY dependency exists — define execution order, atomicity boundary, and partial-failure recovery before proceeding.
For frontend-only scope, this phase typically reduces to "operations are independent" and you move on quickly.
If scope ⊇ backend, every backend design decision is evaluated against 20 principles across:
Cite principle numbers in the plan's "Proposed Architecture" section
(e.g. (#1, #11) next to a decision).
Full tables + anti-patterns: references/engineering-principles.md.
If frontend-only scope: skip this phase entirely.
If scope ⊇ frontend, every UI/UX decision is evaluated against 26 principles across four groups: Gestalt, Interaction/Usability, Cognitive Load, Accessibility. Plus Nielsen's 10 heuristics as final cross-check.
Cite numbers in the plan's "UX Design Decisions" section.
Full tables: references/ux-principles.md.
If backend-only scope: skip this phase entirely.
If scope ⊇ frontend, evaluate against 17 technical principles across Component Architecture (#27–31), State Management (#32–35), Event Handling (#36–39), CSS & Styling (#40–43).
Cite numbers in the plan's "Technical Architecture" section.
Full tables + anti-patterns: references/technical-principles.md.
If backend-only scope: skip this phase entirely.
Resist the urge to solve only the immediate problem. Every plan answers:
The flexibility checklist below biases toward abstraction; this is its counterweight (Design right-sizing, AGENTS.md). When the plan introduces a new abstraction, dependency, persistent artifact, or config surface (the §7b Gate-1 trigger class — skip for trivial plans), write three lines so the chosen design is visibly in the middle, not on either cliff:
→ references/authoring-rationale.md §Phase 5 — right-sizing gate — read when the three lines feel like ceremony.
Manual vs scripted: state in the plan which path the work takes and why
→ references/authoring-rationale.md §Phase 5 — manual vs scripted — read when
a change repeats across many similar sites (≥~5 regular edits).
Structure ONE consolidated output document. Section presence depends on scope:
file_path:line refs you read and the call path you followed (e.g.
route handler api/wines.js:42→wineService.add() services/wine.js:88→db.insert db/wines.js:15``). Required on any non-trivial plan (the
§7b Gate-1 trigger class: ≥6 files, ≥2 subsystems, a dependency chain, or
1 sitting of work). Trivial single-file plans may write
Code Trace: <file>and move on. An absent or hand-waved trace on a non-trivial plan means the design is ungrounded — go back to Phase 1. Pin everyfile:lineto the commit you read it at —src/foo.js:42 (a4ec98da). Cite append-newest-first files by section header, never by line. →references/verification-discipline.md§1; why:references/authoring-rationale.md§1 — Code Trace.
```mermaid block (type from the
table below). Default-on; skip with --no-diagram, or force a type with
--diagram=sequence|graph|er|state.The Mermaid diagram is the proposed view, not a maintained file (existing
structure: the generated architecture map, Phase 0.6; → references/authoring-rationale.md
§2 — read when asked to keep the diagram current). Pick the type from the Phase 0 scope:
| Scope / signal | Mermaid diagram |
|---|---|
backend — request lifecycle | sequenceDiagram (route → service → DB → back) |
backend — module structure | graph LR component boxes |
frontend | graph TD component tree |
full-stack | graph TD with one subgraph per tier (Client / API / Data) |
| DB schema work | erDiagram |
Mermaid renders natively in GitHub and VS Code preview — no tooling needed
for the reader. Copy the exact fence syntax from examples/mermaid-blocks.md.
For every component, document: Empty / Loading / Error / Success / Edge cases.
For components with a non-trivial state machine, optionally render the
transitions as a stateDiagram-v2 block — template in
examples/mermaid-blocks.md.
For each file to be created or modified:
Emit an ordered phase list ONLY when the work is genuinely large — Gate 1: ≥6 files touched, OR ≥2 distinct subsystems/domains, OR a sequential dependency chain (from Phase 1.5), OR clearly >1 sitting of work. Otherwise the plan stays flat (§7 only) — no phases, never a lone "Phase 1" (anti-degenerate invariant: a plan with phases always has ≥2). Keeps ceremony proportional to the work.
Format each phase: **Phase N — <name>**: <what it does>. Files: <path> (create|modify|delete), … — every file intent-tagged (the tag drives
/cycle's clustered-audit preflight; see §11). Mechanical close-out
(regenerate / build / lint / verify) is NOT a phase — list it
separately as **Close-out (not a phase)**: <commands>, excluded from the
§11 partition.
Write every path REPO-RELATIVE —
scripts/setup-postgres.mjs, neversetup-postgres.mjs. This is not style.extractPlanPaths(the bundle'slib/plan-paths.mjs) matches only paths containing a/; with fewer than 5 resolvable paths the audit's fuzzy keyword discovery fills the scope from plan words and reviews the wrong code. Never invent file references to clear the threshold — qualify the paths you genuinely touch. →references/authoring-rationale.md§7b — read when the count is under 5.Self-check before persisting (report-only; read the
regex-resolvableline, notfound/missing— fuzzy results are folded intofound):node scripts/lib/plan-paths.mjs "$PLAN" # $PLAN = the plan file you are about to persist
references/proof-oracle.mdSame machine-parseable format the removed /plan-frontend skill used to call
Section 9. Drives /ux-lock verify. Format:
- [SEVERITY] [CATEGORY] <one-line description>
- Setup: <how to reach the state this asserts on>
- Assert: <what to check, as a semantic DOM contract>
Severity: P0/P1/P2/P3. Category (closed set): visibility,
interaction, a11y, state, responsive, text, navigation, other.
Assertion rules (critical — verify mode cannot work if you break these):
getByRole(...), getByLabel(...), getByTestId(...), aria-*, ARIA roles, axe-core/persona-test territorydata-testid during implementationCoverage guidance: ≥1 P0 per primary user flow; ≥1 a11y per new component; ≥1 state criterion for components with loading/error/empty states; ≥1 responsive if mobile is a target.
If you can't write ≥5 criteria for a non-trivial frontend plan, it may be under-specified — revisit Phase 1 and §5 (State Map).
Emit ONLY when §7b fired AND the phases group into ≥2 clusters (a real
merge/split decision exists). A large-but-cohesive plan keeps §7b with no
§11; small plans have neither. /cycle reads this block to drive clustered
implementation + audit. Cluster coupled phases so /audit-code's
cross-cutting wiring pass can inspect the seam between them — clustering is
quality-positive, not just a token saving.
Grammar (the contract /cycle and /audit-plan consume):
- **Cluster <ID>** — Phases <contiguous range> — fix-gate: <yes|final|none>. Clusters are contiguous ascending ranges of §7b, listed in order — this makes cluster order a valid topological order without a separate dependency graph.Coupling: sub-bullet (required) — WHY these phases group (the auditable claim; the shared seam).Files: (plus an optional Additional files: sub-bullet, each entry intent-tagged per §7b). Never add a free-standing per-cluster Files: line — that is a second source of truth that drifts.fix-gate: yes → cluster must reach /audit-code convergence (HIGH == 0 && MEDIUM <= 2 && quickFix == 0) before the next builds on it; final → last cluster, gated by the consolidated Gemini pass; none → no blocking gate.- **Final gate**: line (required) — declares the mandatory consolidated Gemini review over the union diff.author-tier: economy|standard|frontier sub-bullet — an advisory, observation-only hint of the model tier this cluster's work likely warrants (you MAY derive it from the same scope signals the model-tier observer uses: floor paths → frontier, mechanical-only → economy). /cycle records it for actual-vs-suggested analysis but does NOT change which model runs — there is no router yet (see docs/plans/model-tier-observation.md). Omit it unless it adds signal; it never gates anything.Authoring: group coupled phases (cite the seam in Coupling:); keep
independent phases splittable; place fix-gate: yes before any cluster
that builds on a prior cluster's output; the last cluster is fix-gate: final. ≥2 clusters or omit the block entirely.
If the plan contains a ```mermaid block AND the Mermaid MCP is available
this session, validate each block before persisting — a syntax error otherwise
renders as a red error box in GitHub.
The tool is mcp__mermaid__generate_mermaid_diagram, from the mermaid
server, where the repo registers it. Pass the block as
mermaid and outputType: "mermaid" — that echoes the source back instead of
rendering an image, so validation costs nothing. Invalid syntax comes back as an
MCP error carrying the parser's line and column; that error IS the validation.
(Tool-name history: references/authoring-rationale.md §Phase 6.5 — read when the tool seems unavailable.)
This does not replace plans:lint, and neither replaces the other (two
blind spots → references/authoring-rationale.md §Phase 6.5 — read when one looks redundant).
Save to docs/plans/<descriptive-name>.md. Create docs/plans/ if
needed. Metadata header:
# Plan: <Feature Name>
- **Date**: <today's date>
- **Status**: Draft | Approved | In Progress | Complete | Superseded
- **Author**: Claude + <user>
- **Scope**: backend | frontend | full-stack ← from Phase 0
If this plan must not ship before another plan lands, say so as a
structured line, not only in prose (→ references/authoring-rationale.md
§Phase 7 Depends on: — read when tempted to leave it as prose):
- **Depends on**: docs/plans/<other-plan>.md — <why, e.g. "wait for Cluster F to land first">
One line per dependency; /cycle Step 0.5 reads it back with
node scripts/check-plan-status.mjs --check-deps <this-plan> — a nudge, never a gate.
Register in the cross-skill store so audit-plan/audit-code + ux-lock can link:
Include the user's ORIGINAL task description as taskText in the SAME payload
— that is what arm-eval scores the arms on. Write the
payload to a file with the Write tool, then pipe it via --stdin — never
inline it into a shell single-quoted string (an apostrophe in the task text
corrupts the call; → references/authoring-rationale.md §Phase 7 payload — read when asked why).
.claude/tmp/upsert-plan.json with the Write tool:
{
"path": "docs/plans/*.md",
"skill": "plan",
"status": "draft",
"taskText": "the user's original task description, verbatim"
}
cat .claude/tmp/upsert-plan.json | node scripts/cross-skill.mjs upsert-plan --stdin
Update status as implementation progresses.
upsert-plan fires arm-eval capture itself — never run arm-eval-maybe-capture
too (→ references/authoring-rationale.md §Phase 7.5 — read when asked how capture works).
/ux-lock verify grades for frontend/full-stack — a report, not a gate: verify exits 0 even when criteria fail, and /ship-checked does not read plan_satisfaction. Write them to be gradeable, not because they block a ship (they don't)--campaign: - **Mode**: campaign, the C1–C12 ## Campaign Contract, a dress rehearsal before the real run (references/campaign.md)This skill's canonical flow is above. The files below cover specialised situations — read them only when the trigger applies (scope detection in Phase 0 tells you which ones).
| File | Summary | Read when |
|---|---|---|
references/engineering-principles.md | 20 engineering principles — core design, robustness, performance, sustainability. | Phase 2 — scope ⊇ backend AND writing Proposed Architecture; need to cite principles. |
references/ux-principles.md | 26 UX + design principles — Gestalt, interaction, cognitive load, accessibility, state/resilience. | Phase 3 — scope ⊇ frontend AND evaluating a design decision. |
references/technical-principles.md | 17 technical implementation principles — component architecture, state, events, CSS/styling. | Phase 4 — scope ⊇ frontend AND writing Technical Architecture. |
references/python-backend-profile.md | Python backend profile — framework-tagged principle checks + stack commands + anti-patterns. | Phase 0 detect-stack returned python (or mixed with Python backend files) AND scope ⊇ backend. |
references/python-frontend-profile.md | Python frontend profile — Jinja/Django/Flask template patterns + HTMX + anti-patterns. | Phase 0 detect-stack returned python (or mixed with Python frontend files) AND scope ⊇ frontend. |
examples/mermaid-blocks.md | Mermaid diagram templates — sequenceDiagram, graph, erDiagram, stateDiagram-v2 — one per scope. | Phase 6 §2/§5 — emitting an architecture or state diagram; need the exact fence syntax. |
references/proof-oracle.md | Proof oracle for any plan - what proves the change right, its pass condition, and the evidence the report shows. | Phase 6 §9 Proof plan. |
references/verification-discipline.md | Verification discipline — pinned citations, figure provenance, two-direction proof, attribution, consumer-side checks. | Phase 6 §1 — writing the Code Trace, or any file:line citation, into the plan document. |
references/performance-measurement.md | Budgets as percentile × factor, CPU-time guards, browser step timings, a load-harness recipe. | A plan names concurrent users, a pilot, load testing or a latency target. |
references/context-callouts.md | Render templates for the plan's context callouts — incident table, freshness and bootstrap warnings, persona issues. | Phase 0.5c returned records, a freshnessWarning or a hint, OR Phase 1 persona rows matched the feature. |
references/authoring-rationale.md | Why /plan's authoring rules exist — Code Trace, repo-relative paths, Mermaid checks, payload file, Depends on. | A rule is questioned, fewer than 5 plan paths resolve, OR a change repeats across ≥~5 similar sites. |
references/campaign.md | Campaign mode — the C1-C12 contract an evaluation or test campaign plan must carry, and the dress-rehearsal gate. | --campaign was passed, OR the plan's output is a measurement (eval, test set, experiment). |
references/worktree-preflight.md | Worktree preflight remedy — the skills:hydrate npm script to add when a linked worktree lacks the tooling tree. | A command dies with MODULE_NOT_FOUND in a linked worktree AND this repo has no skills:hydrate script. |
— end of /plan —
examples/mermaid-blocks.md (opens in a new tab)gate-contract.json (opens in a new tab)references/authoring-rationale.md (opens in a new tab)references/campaign.md (opens in a new tab)references/context-callouts.md (opens in a new tab)references/engineering-principles.md (opens in a new tab)references/performance-measurement.md (opens in a new tab)references/proof-oracle.md (opens in a new tab)references/python-backend-profile.md (opens in a new tab)references/python-frontend-profile.md (opens in a new tab)references/technical-principles.md (opens in a new tab)references/ux-principles.md (opens in a new tab)references/verification-discipline.md (opens in a new tab)references/worktree-preflight.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (lbstrydom/claude-engineering-skills) — no native marketplace selected
npx claudepluginhub p/lbstrydom-claude-engineering-skills18 skills in this plugin
/ai-context-managementManage AGENTS.md and CLAUDE.md alignment across a repo so Claude, Copilot,
Cursor, Windsurf, and other AI agents share the same project context.
Detects drift, reconciles manually-introduced divergence, and migrates legacy
CLAUDE.md-canonical repos to AGENTS.md-canonical.
Triggers on: "audit AGENTS.md", "check context drift", "AGENTS.md vs CLAUDE.md",
"fix context drift", "migrate to AGENTS.md",
"context sync", "what tools read which file", "ai-context-management".
Usage: /ai-context-management audit — Score drift + report findings
Usage: /ai-context-management reconcile — Apply patches to fix drift
Usage: /ai-context-management migrate — Flip legacy repo to AGENTS.md canonical
/audit-codeIteratively audit code against a plan with GPT + an independent final gate (Gemini, else Claude).
5-pass parallel static analysis (structure, wiring, backend, frontend,
sustainability), R2+ ledger-driven suppression, debt capture for
out-of-scope findings, max 6 rounds with 2-stable-rounds convergence.
Invoke this for ANY code-correctness review, even a small pasted snippet
or diff — don't just review it yourself directly; a single read-through
is not a substitute for the multi-pass GPT + final-gate adjudication this skill
performs, and skipping it means the review didn't actually happen.
Triggers on: "audit my code", "audit my changes", "audit my PR",
"check the implementation", "review my code", "audit code", "/audit-code",
"audit this", "verify the implementation".
Usage: /audit-code <plan-file> — Audit code against plan (--scope diff default)
Usage: /audit-code <plan-file> --scope plan — Audit only files mentioned in the plan
Usage: /audit-code <plan-file> --scope full — Full repo audit
Other plugins' skills for the same job