[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6J402341DKHG0AE48R28332":3,"skill-same:01M6J402341DKHG0AE48R28332":134},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":34,"publishedAt":56,"linkOnly":57,"markdownContent":58,"markdownBody":59,"frontMatter":60,"refName":63,"commitSha":64,"skillDirectory":65,"forksCount":14,"repositoryHtmlUrl":66,"repositoryHomepageUrl":6,"ownerHtmlUrl":67,"ownerBlogUrl":6,"ownerDescription":68,"updatedAt":69,"install":70,"resources":83},"01M6J402341DKHG0AE48R28332","plan",null,"Unified architecture + UX planner with engineering principles. Auto-detects\nwhether the work is backend-only, frontend-only, or full-stack and applies\nthe appropriate principle sets. Use when the user asks to plan, design, or\narchitect anything — features, refactors, API endpoints, services, UI\ncomponents, pages, layouts, user flows, modals, forms, visual changes,\ndatabase schemas. Also auto-invoke when detecting planning context like\n\"I want to add\", \"let's design\", \"plan the implementation\", \"how should we\nstructure this\", \"I need to refactor\", \"design the UI for\", \"build a\ncomponent\", \"improve the UX of\". Invoke on the request's shape; don't\nexplore the repo for stack context first and answer directly — the skill\ngathers that itself once invoked. Accepts a task description as argument;\nan explicit scope hint and diagram controls are available as flags.\nTriggers on: \"plan\", \"design this\", \"architect this\".\nFull command syntax: see the Usage section in this skill.","Lbstrydom\u002Fclaude-engineering-skills","Lbstrydom","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F77991486?v=4","01M6J3X4N2T0FTZT1RKFXDVS0K","Louis Strydom","01M6J3X4SXV0BXWDMXPW90D8BK",0,"MIT","https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002FSKILL.md",[18,23,26,29],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":30,"categoryName":31,"taxonomyType":32,"taxonomyTypeDesc":33},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[5,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],"command","invoke","auto-invoke","argument","detecting","as","full","structure","forms","auto","context","frontend","stack","improve","explore","how","ui","architecture","component","components","design","2026-11-10 10:12:30",false,"---\nname: plan\ndescription: |\n  Unified architecture + UX planner with engineering principles. Auto-detects\n  whether the work is backend-only, frontend-only, or full-stack and applies\n  the appropriate principle sets. Use when the user asks to plan, design, or\n  architect anything — features, refactors, API endpoints, services, UI\n  components, pages, layouts, user flows, modals, forms, visual changes,\n  database schemas. Also auto-invoke when detecting planning context like\n  \"I want to add\", \"let's design\", \"plan the implementation\", \"how should we\n  structure this\", \"I need to refactor\", \"design the UI for\", \"build a\n  component\", \"improve the UX of\". Invoke on the request's shape; don't\n  explore the repo for stack context first and answer directly — the skill\n  gathers that itself once invoked. Accepts a task description as argument;\n  an explicit scope hint and diagram controls are available as flags.\n  Triggers on: \"plan\", \"design this\", \"architect this\".\n  Full command syntax: see the Usage section in this skill.\nallowed-tools: Bash(node scripts\u002Fcross-skill.mjs detect-stack)\n---\n\n> **Worktree preflight** — in a linked git worktree the synced tooling tree\n> `scripts\u002F.claude-skills\u002F` is absent — it is gitignored, so `git worktree add`\n> does not populate it, and every command below that uses it dies on a bare\n> `MODULE_NOT_FOUND`. Run `npm run skills:hydrate` first. If this repo defines\n> no such script, `references\u002Fworktree-preflight.md` holds the entry to add — ask\n> the user first, since it edits their `package.json`.\n\n## Usage\n\n```\nExample: \u002Fplan add a wine recommendation engine\nUsage: \u002Fplan \u003Ctask description>                                  — auto-detected scope\nUsage: \u002Fplan \u003Ctask> --scope=backend|frontend|full-stack          — explicit scope hint\nUsage: \u002Fplan \u003Ctask> --no-diagram                                 — skip the architecture mermaid block\nUsage: \u002Fplan \u003Ctask> --diagram=sequence|graph|er|state            — force a specific mermaid diagram type\nUsage: \u002Fplan \u003Ctask> --campaign                                   — an evaluation\u002Ftest campaign: adds the C1-C12 contract\nTriggers on: \"plan\", \"design this\", \"architect this\", \"I want to add\",\n\"let's design\", \"plan the implementation\", \"how should we structure this\".\n```\n\n# Unified Architecture + UX Planner\n\n> **This skill's last line is an end marker naming the skill between em-dashes, after\n> the Reference files table.** If that last line is not in your context (context\n> compaction keeps only the start of a skill), re-read\n> `.claude\u002Fskills\u002Fplan\u002FSKILL.md` in full before continuing — the later steps still apply.\n\nSingle planning skill that produces ONE consolidated plan document, even\nfor cross-stack work. Principle tables load from `references\u002F*.md` by\ndetected scope (Phase 0).\n\n---\n\n## Phase 0 — Repo Stack Detection + Scope Detection\n\n### Repo Stack Detection\n\n```bash\nnode scripts\u002Fcross-skill.mjs detect-stack\n```\n\nReturns `{ stack, pythonFramework, detectedFrom }`.\n\n| `stack` | Profile to apply |\n|---|---|\n| `js-ts` | Universal principles |\n| `python` | Universal + Python profile (see references) |\n| `mixed` | File-based routing per the touched files; both profiles if both languages |\n| `unknown` | Universal principles only |\n\n### Scope (the new bit)\n\nChoose ONE of: `backend`, `frontend`, `full-stack`. Use this\ndecision tree:\n\n| Signal | Conclusion |\n|---|---|\n| User explicitly passed `--scope=X` | Use X |\n| Task touches only routes\u002Fservices\u002Fmodels\u002Fmigrations\u002FCLIs\u002Fscripts\u002Fserver | `backend` |\n| Task touches only components\u002Fpages\u002Flayouts\u002Fstyles\u002Fforms\u002FUI flows | `frontend` |\n| Task spans both, OR mentions API + UI together, OR is a feature with user-visible behavior backed by data | `full-stack` |\n| Genuinely uncertain | `full-stack` (safer — extra principles cost a few tokens vs missing real concerns) |\n\n**Cite the detected scope at the top of the plan** in a one-liner so\nthe auditor and reviewer know which principle sets apply.\n\nLazy reference loading by scope:\n\n| Scope | References to load in Phase 2\u002F3 |\n|---|---|\n| backend | `references\u002Fengineering-principles.md` (+ python-backend-profile if Python) |\n| frontend | `references\u002Fux-principles.md` + `references\u002Ftechnical-principles.md` (+ python-frontend-profile if Python+templates) |\n| full-stack | All of the above |\n\n---\n\n## Phase 0.5 — Architectural-memory Neighbourhood\n\nIf the architectural memory is populated for this repo (a prior\n`npm run arch:refresh` succeeded against a Supabase project), consult\nthe symbol-index for near-duplicates BEFORE proposing new code:\n\n```bash\nnode scripts\u002Fcross-skill.mjs get-neighbourhood --json '{\n  \"targetPaths\": [\"\u003Cpaths\u002Fbeing\u002Ftouched>\"],\n  \"intentDescription\": \"\u003Cone-line task summary>\",\n  \"kind\": [\"function\",\"class\",\"component\",\"hook\",\"route\",\"method\"]\n}'\n```\n\nInline the returned `markdown` field as **\"Neighbourhood considered\"**\nnear the top of the plan output. State-handling per the failure matrix:\n\n- `cloud:false` → emit literal `npm run arch:refresh` hint; proceed.\n- `cloud:true, records:[]` → \"No near-duplicates found — proceed.\"\n- `EMBEDDING_MISMATCH` \u002F `RPC_ERROR` → emit `_consultation failed: \u003Ccode>; plan proceeds without architectural context_`; continue.\n- `BAD_INPUT` → surface to user, abort plan generation.\n\nA `precedent` band means existing code occupies this space: open the named\nsymbols and decide on the code whether to reuse, extend, or write a sibling —\nthen record which and why under \"Proposed Architecture\". The band does not make\nthat choice; a distance score cannot see dependency direction, API shape or\nownership. `review` = nothing cleared the repo's noise floor (proceed\ngreenfield); `unscored` = no embedding, so nothing was compared.\n\nThe callout's **Domain** column flags domain-mismatch reuse candidates\n→ `references\u002Fcontext-callouts.md` §Phase 0.5 — read when a candidate sits in another domain.\n\n### Phase 0.5b — Compute target domain(s) and surface boundary work\n\nRun alongside the neighbourhood query:\n\n```bash\nnode scripts\u002Fcross-skill.mjs compute-target-domains --json '{\n  \"targetPaths\": [\"\u003Cpaths\u002Fbeing\u002Ftouched>\"]\n}'\n```\n\nReturns `{domains: [...], untaggedPaths: [...], crossDomain: bool, ruleCount}`.\n\nRender two header lines in the plan output (right after the metadata\nblock):\n\n- **Always** (when `domains.length > 0`):\n  `- **Target domain(s)**: \\`\u003Cd1>\\`, \\`\u003Cd2>\\``\n- **When `crossDomain === true`** (>1 distinct tagged domain):\n  `- ⚠ **Cross-domain work** — touches >1 domain; confirm boundary crossings are intentional.`\n- **When `untaggedPaths.length > 0`** (paths matched no rule):\n  `- ⚠ **Untagged paths**: \\`\u003Cp1>\\`, \\`\u003Cp2>\\` — these don't match any rule in \\`.audit-loop\u002Fdomain-map.json\\`. Consider adding a rule before designing.`\n\nBoth warnings are heads-ups, not blocks. They surface architectural\ndecisions the planner should make explicitly.\n\n### Phase 0.5c — Security incident neighbourhood (proactive memory)\n\nRun alongside the arch-memory + target-domains queries:\n\n```bash\nnode scripts\u002Fcross-skill.mjs get-incident-neighbourhood --json '{\n  \"targetPaths\": [\"\u003Cpaths\u002Fbeing\u002Ftouched>\"],\n  \"intentDescription\": \"\u003Cone-line task summary>\",\n  \"k\": 3\n}'\n```\n\nReturns `{records, totalCandidatesConsidered, freshnessWarning}`. Render\n**only when `records.length > 0`** (don't add a \"no incidents — proceed\"\nline on every plan; that creates noise). When `freshnessWarning` is non-null,\nadd a freshness warning ABOVE the table. When the security strategy document\ndoesn't exist (response carries a `hint`), add a soft bootstrap warning at the\ntop of the plan output. → `references\u002Fcontext-callouts.md` §Phase 0.5c — read\nwhen rendering any of these three.\n\nSoft warning only — never blocks plan generation.\n\nFor any plan that crosses a trust boundary surfaced in the incidents\ncallout, add a required **\"Security Considerations\"** section in the\nplan output addressing each relevant invariant.\n\n### Phase 0.6 — Read the rendered architecture map for the target domain(s)\n\nIf `docs\u002Farchitecture-map.md` exists AND target domains are non-empty:\n**Read** the file (or `Grep` for `## \u003Cdomain>`) and read the symbol\ntable beneath each target-domain section. This is the human-curated\nview — complements the embedding-based neighbourhood query with the\nfull inventory of the domain you're working in. Especially valuable\nwhen the domain has its own per-domain Haiku summary at the top\nexplaining the domain's purpose.\n\nNo tool invocation; pure file Read.\n\n---\n\n## Phase 1 — Understand Before You Design\n\n**Explore the codebase FIRST.** The biggest planning failure is\nproposing solutions without understanding what already exists.\n\n### Pre-step — Persona test history (frontend or full-stack scope only)\n\nIf scope ⊇ frontend, check whether persona testing has surfaced pain points in\nthe area being planned. The command resolves the repo itself (`--repo` ->\n`PERSONA_TEST_REPO_NAME` from `.env` -> ambient `git remote`) — do NOT\nshell-expand the env var into `--repo`, which yields an empty flag in any\nsession that did not export it. Read it only through `cross-skill.mjs`.\n\n```bash\nnode scripts\u002Fcross-skill.mjs get-persona-sessions-by-repo --limit 5 --select persona,focus,verdict,findings,p0_count,p1_count\n```\n\nOutput shape: `{ok: true, cloud: true|false, measured, scope:{mode,slug}, rows: [...]}`.\nWhen `cloud:false`, no persona-test database is configured — proceed without\nthis signal. When `measured:false`, no repo resolved and nothing was read —\nalso proceed, but never read the empty `rows` as \"no findings\".\n\nFilter `rows` whose `focus` overlaps with the feature. If matches found, include in the Context Summary as **Known user-visible issues**\n(→ `references\u002Fcontext-callouts.md` §Phase 1 — read when rendering that block). Treat P0\u002FP1 matches as HIGH priority in the design.\n\n### Exploration checklist (apply the rows that match scope)\n\n**Always**:\n1. **Map the landscape**: read the relevant existing files\n2. **Identify existing patterns**: how does the codebase already solve similar problems?\n3. **Find reusable components**: existing services, utilities, abstractions, components\n4. **Check for prior art**: something similar partially built?\n\n**If scope ⊇ backend**:\n5. **Trace the data flow**: request lifecycle from route → service → DB and back\n\n**If scope ⊇ frontend**:\n6. **Audit the current UI**: read relevant HTML\u002FCSS\u002FJS for the area being changed\n7. **Map component landscape**: existing modals, cards, grids, forms, toasts\n8. **Identify the design language**: colour palette, typography, spacing, button styles\n9. **Trace user flows**: how the user navigates to and through related features\n10. **Check responsive behaviour**: how the UI handles different screen sizes\n11. **Note pain points**: what feels clunky, inconsistent, or confusing\n\nDo NOT propose a plan until exploration is complete.\n\n---\n\n## Phase 1.5 — Execution Model (backend or full-stack scope only)\n\nForced question: **Are any planned operations dependent on others?**\nIf yes, identify chains, prerequisites, and per-chain atomicity (typical\ncases: batch ops, multi-step workflows, state transitions, cross-entity swaps\n→ `references\u002Fauthoring-rationale.md` §Phase 1.5 — read when unsure whether a dependency exists).\n\n### What to produce\n\n1. **Dependency graph**: which operations must complete before others can start?\n2. **Chain identification**: group dependent operations into atomic chains\n3. **Failure semantics**: for each chain — rollback, retry, skip?\n4. **Concurrency model**: can chains run in parallel, or must they be serial?\n\nIf all operations are independent — document that explicitly and move on.\nIf ANY dependency exists — define execution order, atomicity boundary,\nand partial-failure recovery before proceeding.\n\nFor frontend-only scope, this phase typically reduces to \"operations are\nindependent\" and you move on quickly.\n\n---\n\n## Phase 2 — Engineering Principles (backend or full-stack scope)\n\nIf scope ⊇ backend, every backend design decision is evaluated against\n20 principles across:\n- **Core Design** (1–10): DRY, SOLID, Modularity, No Hardcoding, Single Source of Truth\n- **Robustness** (11–16): Testability, Validation, Idempotency, Transaction Safety, Error Handling, Graceful Degradation\n- **Performance & Sustainability** (17–20): N+1 prevention, Backward Compat, Observability, Long-Term Flexibility\n\nCite principle numbers in the plan's \"Proposed Architecture\" section\n(e.g. `(#1, #11)` next to a decision).\n\nFull tables + anti-patterns: `references\u002Fengineering-principles.md`.\n\nIf frontend-only scope: skip this phase entirely.\n\n---\n\n## Phase 3 — UX & Design Principles (frontend or full-stack scope)\n\nIf scope ⊇ frontend, every UI\u002FUX decision is evaluated against 26\nprinciples across four groups: Gestalt, Interaction\u002FUsability,\nCognitive Load, Accessibility. Plus Nielsen's 10 heuristics as final\ncross-check.\n\nCite numbers in the plan's \"UX Design Decisions\" section.\n\nFull tables: `references\u002Fux-principles.md`.\n\nIf backend-only scope: skip this phase entirely.\n\n---\n\n## Phase 4 — Technical Implementation Principles (frontend or full-stack scope)\n\nIf scope ⊇ frontend, evaluate against 17 technical principles across\nComponent Architecture (#27–31), State Management (#32–35), Event\nHandling (#36–39), CSS & Styling (#40–43).\n\nCite numbers in the plan's \"Technical Architecture\" section.\n\nFull tables + anti-patterns: `references\u002Ftechnical-principles.md`.\n\nIf backend-only scope: skip this phase entirely.\n\n---\n\n## Phase 5 — Long-Term Sustainability\n\nResist the urge to solve only the immediate problem. Every plan answers:\n\n### Right-sizing gate (when the plan introduces new structure)\n\nThe flexibility checklist below biases toward abstraction; this is its\ncounterweight (**Design right-sizing**, AGENTS.md). **When the plan introduces a\nnew abstraction, dependency, persistent artifact, or config surface** (the §7b\nGate-1 trigger class — skip for trivial plans), write three lines so the chosen\ndesign is visibly in the middle, not on either cliff:\n\n- **Band-aid extreme** — the quickest patch that leaves the root cause to resurface.\n- **Over-engineered extreme** — the fully general\u002Fabstract\u002Fconfigurable version.\n- **Chosen** — and the **current** requirement it serves. *No current requirement\n  → drop the abstraction.* \"Might need it later\" \u002F \"cleaner\" \u002F \"extensible\" is not\n  a current requirement (YAGNI overrides the flexibility checklist).\n\n→ `references\u002Fauthoring-rationale.md` §Phase 5 — right-sizing gate — read when the three lines feel like ceremony.\n\n**Manual vs scripted**: state in the plan which path the work takes and why\n→ `references\u002Fauthoring-rationale.md` §Phase 5 — manual vs scripted — read when\na change repeats across many similar sites (≥~5 regular edits).\n\n### System-level thinking (always)\n\n- **What assumptions does this design encode?** Which might change?\n- **If requirements change in 6 months, what breaks?** Design seams now so changes are localised.\n- **Does this tighten or loosen coupling?** Prefer loose coupling — components communicate through well-defined interfaces.\n- **Patterns or exceptions?** If this is the first of its kind, design as a pattern others can follow. If it deviates, justify why.\n\n### Architecture flexibility checklist\n\n- [ ] **Data-driven over logic-driven**: behaviour by data\u002Fconfig, not rewriting code?\n- [ ] **Strategy pattern over switch**: would a new variant require a new file (good) or modifying existing function (bad)?\n- [ ] **Composable pipeline**: can processing steps be added, removed, reordered without rewriting?\n- [ ] **Abstraction boundaries**: if we swap DB, AI provider, or external API, how many files change? Target: 1–2 adapter files.\n- [ ] **Migration path**: if this outgrows its design, is there a clear upgrade path without rewrite?\n\n### UI-specific (frontend or full-stack scope)\n\n- **What if the design system changes?** CSS variables + reusable classes?\n- **What if we add more items\u002Fviews?** Does the layout scale from 5 to 500? From 3 tabs to 12?\n- **What if mobile support tightens?** Is the component architecture responsive-ready?\n- **What if accessibility requirements tighten?** ARIA attributes, keyboard flows, focus management already in place?\n- **Are we creating a reusable pattern?** First of its kind → design as template.\n\n---\n\n## Phase 6 — Present the Plan\n\nStructure ONE consolidated output document. Section presence depends on scope:\n\n### Always\n\n#### 1. Context Summary\n- Detected scope + stack + Python framework (one line)\n- What exists today (Phase 1)\n- **Code Trace** — the evidence that Phase 1 actually happened. Cite the\n  `file_path:line` refs you read and the call path you followed (e.g.\n  `route handler `api\u002Fwines.js:42` → `wineService.add()` `services\u002Fwine.js:88`\n  → `db.insert` `db\u002Fwines.js:15``). Required on any **non-trivial** plan (the\n  §7b Gate-1 trigger class: ≥6 files, ≥2 subsystems, a dependency chain, or\n  >1 sitting of work). Trivial single-file plans may write `Code Trace: \u003Cfile>`\n  and move on. An absent or hand-waved trace on a non-trivial plan means the\n  design is ungrounded — go back to Phase 1.\n  **Pin every `file:line` to the commit you read it at** — `src\u002Ffoo.js:42\n  (a4ec98da)`. Cite append-newest-first files by section header, never by\n  line. → `references\u002Fverification-discipline.md` §1; why: `references\u002Fauthoring-rationale.md` §1 — Code Trace.\n- Patterns reused vs new\n- Known user-visible issues (if persona data + frontend scope)\n- Neighbourhood considered (if Phase 0.5 fired with results)\n\n#### 2. Proposed Architecture\n- **Architecture diagram** — a fenced ` ```mermaid ` block (type from the\n  table below). Default-on; skip with `--no-diagram`, or force a type with\n  `--diagram=sequence|graph|er|state`.\n- Component diagram (which files\u002Fmodules, how they interact)\n- Data flow (request → response path) — backend\u002Ffull-stack\n- User flow + ASCII wireframe — frontend\u002Ffull-stack\n- Key design decisions and **which principles drove them** (cite #N)\n\nThe Mermaid diagram is the **proposed** view, not a maintained file (existing\nstructure: the generated architecture map, Phase 0.6; → `references\u002Fauthoring-rationale.md`\n§2 — read when asked to keep the diagram current). Pick the type from the Phase 0 scope:\n\n| Scope \u002F signal | Mermaid diagram |\n|---|---|\n| `backend` — request lifecycle | `sequenceDiagram` (route → service → DB → back) |\n| `backend` — module structure | `graph LR` component boxes |\n| `frontend` | `graph TD` component tree |\n| `full-stack` | `graph TD` with one `subgraph` per tier (Client \u002F API \u002F Data) |\n| DB schema work | `erDiagram` |\n\nMermaid renders natively in GitHub and VS Code preview — no tooling needed\nfor the reader. Copy the exact fence syntax from `examples\u002Fmermaid-blocks.md`.\n\n### If scope ⊇ frontend\n\n#### 3. UX Design Decisions\n- Key choices and **which UX principles drove them**\n- How Gestalt principles shaped the layout\n- How cognitive load was managed\n- Accessibility approach\n\n#### 4. Technical Architecture (frontend)\n- Component diagram (JS modules, how they interact)\n- State management approach\n- Event handling strategy\n- CSS architecture (new classes, variables, responsive approach)\n\n#### 5. State Map (frontend)\nFor every component, document: Empty \u002F Loading \u002F Error \u002F Success \u002F Edge cases.\nFor components with a non-trivial state machine, optionally render the\ntransitions as a `stateDiagram-v2` block — template in\n`examples\u002Fmermaid-blocks.md`.\n\n### Always\n\n#### 6. Sustainability Notes\n- Assumptions that could change\n- How the design accommodates future change\n- Extension points deliberately built in\n\n#### 7. File-Level Plan\nFor each file to be created or modified:\n- **File path** + purpose\n- **Key functions\u002Fexports** with brief descriptions\n- **Dependencies** (imports + what imports it)\n- **Why this file** (which principle justifies it)\n\n##### 7b. Implementation Phases (conditional — Gate 1)\nEmit an ordered phase list ONLY when the work is genuinely large —\n**Gate 1**: ≥6 files touched, OR ≥2 distinct subsystems\u002Fdomains, OR a\nsequential dependency chain (from Phase 1.5), OR clearly >1 sitting of\nwork. Otherwise the plan stays flat (§7 only) — **no phases, never a lone\n\"Phase 1\"** (anti-degenerate invariant: a plan with phases always has ≥2).\nKeeps ceremony proportional to the work.\n\nFormat each phase: `**Phase N — \u003Cname>**: \u003Cwhat it does>. Files: \u003Cpath>\n(create|modify|delete), …` — **every file intent-tagged** (the tag drives\n`\u002Fcycle`'s clustered-audit preflight; see §11). Mechanical close-out\n(regenerate \u002F build \u002F lint \u002F verify) is **NOT** a phase — list it\nseparately as `**Close-out (not a phase)**: \u003Ccommands>`, excluded from the\n§11 partition.\n\n> **Write every path REPO-RELATIVE — `scripts\u002Fsetup-postgres.mjs`, never\n> `setup-postgres.mjs`.** This is not style. `extractPlanPaths`\n> (the bundle's `lib\u002Fplan-paths.mjs`) matches only paths containing a `\u002F`; with\n> fewer than 5 resolvable paths the audit's fuzzy keyword discovery fills the\n> scope from plan *words* and reviews the wrong code. **Never invent file\n> references to clear the threshold** — qualify the paths you genuinely touch.\n> → `references\u002Fauthoring-rationale.md` §7b — read when the count is under 5.\n>\n> Self-check before persisting (report-only; read the `regex-resolvable` line,\n> not `found`\u002F`missing` — fuzzy results are folded into `found`):\n> ```bash\n> node scripts\u002Flib\u002Fplan-paths.mjs \"$PLAN\"   # $PLAN = the plan file you are about to persist\n> ```\n\n#### 8. Risk & Trade-off Register\n- Trade-offs made + why\n- What could go wrong\n- What was deliberately deferred (and why that is OK)\n\n#### 9. Testing Strategy\n- What gets unit tested\n- What gets integration tested\n- Key edge cases\n- **Proof plan** (every scope): per behaviour change, the oracle (red test, source check or repeatable calculation), pass condition, report evidence: `references\u002Fproof-oracle.md`\n- (Frontend) Visual\u002Fmanual checklist + a11y testing + responsive breakpoints\n\n### If scope ⊇ frontend\n\n#### 10. Acceptance Criteria (Playwright-verifiable)\n\nSame machine-parseable format the removed `\u002Fplan-frontend` skill used to call\nSection 9. Drives `\u002Fux-lock verify`. Format:\n\n```\n- [SEVERITY] [CATEGORY] \u003Cone-line description>\n  - Setup: \u003Chow to reach the state this asserts on>\n  - Assert: \u003Cwhat to check, as a semantic DOM contract>\n```\n\nSeverity: `P0`\u002F`P1`\u002F`P2`\u002F`P3`. Category (closed set): `visibility`,\n`interaction`, `a11y`, `state`, `responsive`, `text`, `navigation`, `other`.\n\nAssertion rules (critical — verify mode cannot work if you break these):\n- Assert on **semantic DOM contracts only**: `getByRole(...)`, `getByLabel(...)`, `getByTestId(...)`, `aria-*`, ARIA roles, axe-core\n- **Never** reference CSS class names, internal state, or implementation details\n- **Never** describe \"it should feel fast\" — that's `\u002Fpersona-test` territory\n- If a criterion can only be expressed via class selector, propose adding a `data-testid` during implementation\n\nCoverage guidance: ≥1 P0 per primary user flow; ≥1 a11y per new component;\n≥1 state criterion for components with loading\u002Ferror\u002Fempty states; ≥1\nresponsive if mobile is a target.\n\nIf you can't write ≥5 criteria for a non-trivial frontend plan, it may\nbe under-specified — revisit Phase 1 and §5 (State Map).\n\n### Always (conditional)\n\n#### 11. Execution Clustering (conditional — Gate 2)\n\nEmit ONLY when §7b fired AND the phases group into **≥2 clusters** (a real\nmerge\u002Fsplit decision exists). A large-but-cohesive plan keeps §7b with no\n§11; small plans have neither. `\u002Fcycle` reads this block to drive clustered\nimplementation + audit. **Cluster coupled phases** so `\u002Faudit-code`'s\ncross-cutting wiring pass can inspect the seam between them — clustering is\nquality-positive, not just a token saving.\n\n**Grammar** (the contract `\u002Fcycle` and `\u002Faudit-plan` consume):\n1. One bullet per cluster: `- **Cluster \u003CID>** — Phases \u003Ccontiguous range> — fix-gate: \u003Cyes|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.\n2. `Coupling:` sub-bullet (**required**) — WHY these phases group (the auditable claim; the shared seam).\n3. **Cluster audit scope is derived, not restated**: it is the union of the member phases' `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.\n4. `fix-gate: yes` → cluster must reach `\u002Faudit-code` convergence (`HIGH == 0 && MEDIUM \u003C= 2 && quickFix == 0`) before the next builds on it; `final` → last cluster, gated by the consolidated Gemini pass; `none` → no blocking gate.\n5. Trailing `- **Final gate**:` line (**required**) — declares the mandatory consolidated Gemini review over the union diff.\n6. **Partition invariant**: every §7b *implementation* phase appears in exactly one cluster (none omitted\u002Fduplicated); close-out work is outside the phase set and is not clustered.\n7. **Optional** `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). `\u002Fcycle` **records** it for actual-vs-suggested analysis but **does NOT change which model runs** — there is no router yet (see `docs\u002Fplans\u002Fmodel-tier-observation.md`). Omit it unless it adds signal; it never gates anything.\n\n**Authoring**: group coupled phases (cite the seam in `Coupling:`); keep\nindependent phases splittable; place `fix-gate: yes` before any cluster\nthat builds on a prior cluster's output; the last cluster is `fix-gate:\nfinal`. ≥2 clusters or omit the block entirely.\n\n---\n\n## Phase 6.5 — Validate diagrams (optional, graceful)\n\nIf the plan contains a ` ```mermaid ` block AND the Mermaid MCP is available\nthis session, validate each block before persisting — a syntax error otherwise\nrenders as a red error box in GitHub.\n\n**The tool is `mcp__mermaid__generate_mermaid_diagram`**, from the `mermaid`\nserver that `.mcp.json` and `.vscode\u002Fmcp.json` both register. Pass the block as\n`mermaid` and `outputType: \"mermaid\"` — that echoes the source back instead of\nrendering an image, so validation costs nothing. Invalid syntax comes back as an\nMCP error carrying the parser's line and column; that error IS the validation.\n(Tool-name history: `references\u002Fauthoring-rationale.md` §Phase 6.5 — read when the tool seems unavailable.)\n\n- **MCP available** → validate each block; fix any reported syntax error\n  in place before Phase 7.\n- **MCP not available** → **skip silently and proceed.** The Mermaid MCP\n  is an optional convenience, never an install dependency — Mermaid\n  renders natively in GitHub and VS Code preview, so an unvalidated block\n  still works for the reader. Do not warn the user about the missing MCP.\n\n**This does not replace `plans:lint`, and neither replaces the other** (two\nblind spots → `references\u002Fauthoring-rationale.md` §Phase 6.5 — read when one looks redundant).\n\n---\n\n## Phase 7 — Persist the Plan\n\nSave to `docs\u002Fplans\u002F\u003Cdescriptive-name>.md`. Create `docs\u002Fplans\u002F` if\nneeded. Metadata header:\n\n```markdown\n# Plan: \u003CFeature Name>\n- **Date**: \u003Ctoday's date>\n- **Status**: Draft | Approved | In Progress | Complete | Superseded\n- **Author**: Claude + \u003Cuser>\n- **Scope**: backend | frontend | full-stack   ← from Phase 0\n```\n\n**If this plan must not ship before another plan lands**, say so as a\nstructured line, not only in prose (→ `references\u002Fauthoring-rationale.md`\n§Phase 7 `Depends on:` — read when tempted to leave it as prose):\n\n```markdown\n- **Depends on**: docs\u002Fplans\u002F\u003Cother-plan>.md — \u003Cwhy, e.g. \"wait for Cluster F to land first\">\n```\n\nOne line per dependency; `\u002Fcycle` Step 0.5 reads it back with\n`node scripts\u002Fcheck-plan-status.mjs --check-deps \u003Cthis-plan>` — a nudge, never a gate.\n\nRegister in the cross-skill store so audit-plan\u002Faudit-code + ux-lock can link:\n\nInclude the user's ORIGINAL task description as `taskText` in the SAME payload\n— that is what arm-eval scores the arms on. **Write the\npayload to a file with the Write tool, then pipe it via `--stdin`** — never\ninline it into a shell single-quoted string (an apostrophe in the task text\ncorrupts the call; → `references\u002Fauthoring-rationale.md` §Phase 7 payload — read when asked why).\n\n1. Write `.claude\u002Ftmp\u002Fupsert-plan.json` with the Write tool:\n   ```json\n   {\n     \"path\": \"docs\u002Fplans\u002F*.md\",\n     \"skill\": \"plan\",\n     \"status\": \"draft\",\n     \"taskText\": \"the user's original task description, verbatim\"\n   }\n   ```\n2. Pipe it in:\n   ```bash\n   cat .claude\u002Ftmp\u002Fupsert-plan.json | node scripts\u002Fcross-skill.mjs upsert-plan --stdin\n   ```\n\nUpdate status as implementation progresses.\n\n### Phase 7.5 — Arm-eval capture (AUTOMATIC — no action)\n\n`upsert-plan` fires arm-eval capture itself — never run `arm-eval-maybe-capture`\ntoo (→ `references\u002Fauthoring-rationale.md` §Phase 7.5 — read when asked how capture works).\n\n---\n\n## Reminders\n\n- **Detect scope first** — Phase 0 is load-bearing; the rest of the flow keys off it\n- **Explore before proposing** — codebase is ground truth, not assumptions; §1's **Code Trace** is the artifact that proves you did (required on non-trivial plans)\n- **Name the principles** — every design choice cites which principle(s) it serves (#N)\n- **One document, one audit** — no merging child plans, no archive cruft\n- **Section 10 acceptance criteria are what `\u002Fux-lock verify` grades** for frontend\u002Ffull-stack — a **report, not a gate**: verify exits 0 even when criteria fail, and `\u002Fship` does not read `plan_satisfaction`. Write them to be gradeable, not because they block a ship (they don't)\n- **Phase the work only when it's large** — §7b\u002F§11 are conditional (Gate 1: ≥6 files \u002F ≥2 subsystems \u002F dep-chain; Gate 2: ≥2 clusters). Never emit a lone \"Phase 1\"; cluster coupled phases so the audit sees the seam\n- **A measurement is a campaign** — an eval, labelled test set or experiment takes `--campaign`: `- **Mode**: campaign`, the C1–C12 `## Campaign Contract`, a dress rehearsal before the real run (`references\u002Fcampaign.md`)\n- **Show every state** — Empty\u002FLoading\u002FError\u002FSuccess for any component you design\n- **Wireframe before code** — ASCII layouts prevent expensive rework\n- **Accessibility is not optional** — baseline, not nice-to-have\n\n---\n\n## Reference files\n\nThis skill's canonical flow is above. The files below cover specialised\nsituations — read them only when the trigger applies (scope detection\nin Phase 0 tells you which ones).\n\n| File | Summary | Read when |\n|---|---|---|\n| `references\u002Fengineering-principles.md` | 20 engineering principles — core design, robustness, performance, sustainability. | Phase 2 — scope ⊇ backend AND writing Proposed Architecture; need to cite principles. |\n| `references\u002Fux-principles.md` | 26 UX + design principles — Gestalt, interaction, cognitive load, accessibility, state\u002Fresilience. | Phase 3 — scope ⊇ frontend AND evaluating a design decision. |\n| `references\u002Ftechnical-principles.md` | 17 technical implementation principles — component architecture, state, events, CSS\u002Fstyling. | Phase 4 — scope ⊇ frontend AND writing Technical Architecture. |\n| `references\u002Fpython-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. |\n| `references\u002Fpython-frontend-profile.md` | Python frontend profile — Jinja\u002FDjango\u002FFlask template patterns + HTMX + anti-patterns. | Phase 0 detect-stack returned `python` (or mixed with Python frontend files) AND scope ⊇ frontend. |\n| `examples\u002Fmermaid-blocks.md` | Mermaid diagram templates — sequenceDiagram, graph, erDiagram, stateDiagram-v2 — one per scope. | Phase 6 §2\u002F§5 — emitting an architecture or state diagram; need the exact fence syntax. |\n| `references\u002Fproof-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. |\n| `references\u002Fverification-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. |\n| `references\u002Fcontext-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. |\n| `references\u002Fauthoring-rationale.md` | Why \u002Fplan'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. |\n| `references\u002Fcampaign.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). |\n| `references\u002Fworktree-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. |\n\n— end of \u002Fplan —\n","> **Worktree preflight** — in a linked git worktree the synced tooling tree\n> `scripts\u002F.claude-skills\u002F` is absent — it is gitignored, so `git worktree add`\n> does not populate it, and every command below that uses it dies on a bare\n> `MODULE_NOT_FOUND`. Run `npm run skills:hydrate` first. If this repo defines\n> no such script, `references\u002Fworktree-preflight.md` holds the entry to add — ask\n> the user first, since it edits their `package.json`.\n\n## Usage\n\n```\nExample: \u002Fplan add a wine recommendation engine\nUsage: \u002Fplan \u003Ctask description>                                  — auto-detected scope\nUsage: \u002Fplan \u003Ctask> --scope=backend|frontend|full-stack          — explicit scope hint\nUsage: \u002Fplan \u003Ctask> --no-diagram                                 — skip the architecture mermaid block\nUsage: \u002Fplan \u003Ctask> --diagram=sequence|graph|er|state            — force a specific mermaid diagram type\nUsage: \u002Fplan \u003Ctask> --campaign                                   — an evaluation\u002Ftest campaign: adds the C1-C12 contract\nTriggers on: \"plan\", \"design this\", \"architect this\", \"I want to add\",\n\"let's design\", \"plan the implementation\", \"how should we structure this\".\n```\n\n# Unified Architecture + UX Planner\n\n> **This skill's last line is an end marker naming the skill between em-dashes, after\n> the Reference files table.** If that last line is not in your context (context\n> compaction keeps only the start of a skill), re-read\n> `.claude\u002Fskills\u002Fplan\u002FSKILL.md` in full before continuing — the later steps still apply.\n\nSingle planning skill that produces ONE consolidated plan document, even\nfor cross-stack work. Principle tables load from `references\u002F*.md` by\ndetected scope (Phase 0).\n\n---\n\n## Phase 0 — Repo Stack Detection + Scope Detection\n\n### Repo Stack Detection\n\n```bash\nnode scripts\u002Fcross-skill.mjs detect-stack\n```\n\nReturns `{ stack, pythonFramework, detectedFrom }`.\n\n| `stack` | Profile to apply |\n|---|---|\n| `js-ts` | Universal principles |\n| `python` | Universal + Python profile (see references) |\n| `mixed` | File-based routing per the touched files; both profiles if both languages |\n| `unknown` | Universal principles only |\n\n### Scope (the new bit)\n\nChoose ONE of: `backend`, `frontend`, `full-stack`. Use this\ndecision tree:\n\n| Signal | Conclusion |\n|---|---|\n| User explicitly passed `--scope=X` | Use X |\n| Task touches only routes\u002Fservices\u002Fmodels\u002Fmigrations\u002FCLIs\u002Fscripts\u002Fserver | `backend` |\n| Task touches only components\u002Fpages\u002Flayouts\u002Fstyles\u002Fforms\u002FUI flows | `frontend` |\n| Task spans both, OR mentions API + UI together, OR is a feature with user-visible behavior backed by data | `full-stack` |\n| Genuinely uncertain | `full-stack` (safer — extra principles cost a few tokens vs missing real concerns) |\n\n**Cite the detected scope at the top of the plan** in a one-liner so\nthe auditor and reviewer know which principle sets apply.\n\nLazy reference loading by scope:\n\n| Scope | References to load in Phase 2\u002F3 |\n|---|---|\n| backend | `references\u002Fengineering-principles.md` (+ python-backend-profile if Python) |\n| frontend | `references\u002Fux-principles.md` + `references\u002Ftechnical-principles.md` (+ python-frontend-profile if Python+templates) |\n| full-stack | All of the above |\n\n---\n\n## Phase 0.5 — Architectural-memory Neighbourhood\n\nIf the architectural memory is populated for this repo (a prior\n`npm run arch:refresh` succeeded against a Supabase project), consult\nthe symbol-index for near-duplicates BEFORE proposing new code:\n\n```bash\nnode scripts\u002Fcross-skill.mjs get-neighbourhood --json '{\n  \"targetPaths\": [\"\u003Cpaths\u002Fbeing\u002Ftouched>\"],\n  \"intentDescription\": \"\u003Cone-line task summary>\",\n  \"kind\": [\"function\",\"class\",\"component\",\"hook\",\"route\",\"method\"]\n}'\n```\n\nInline the returned `markdown` field as **\"Neighbourhood considered\"**\nnear the top of the plan output. State-handling per the failure matrix:\n\n- `cloud:false` → emit literal `npm run arch:refresh` hint; proceed.\n- `cloud:true, records:[]` → \"No near-duplicates found — proceed.\"\n- `EMBEDDING_MISMATCH` \u002F `RPC_ERROR` → emit `_consultation failed: \u003Ccode>; plan proceeds without architectural context_`; continue.\n- `BAD_INPUT` → surface to user, abort plan generation.\n\nA `precedent` band means existing code occupies this space: open the named\nsymbols and decide on the code whether to reuse, extend, or write a sibling —\nthen record which and why under \"Proposed Architecture\". The band does not make\nthat choice; a distance score cannot see dependency direction, API shape or\nownership. `review` = nothing cleared the repo's noise floor (proceed\ngreenfield); `unscored` = no embedding, so nothing was compared.\n\nThe callout's **Domain** column flags domain-mismatch reuse candidates\n→ `references\u002Fcontext-callouts.md` §Phase 0.5 — read when a candidate sits in another domain.\n\n### Phase 0.5b — Compute target domain(s) and surface boundary work\n\nRun alongside the neighbourhood query:\n\n```bash\nnode scripts\u002Fcross-skill.mjs compute-target-domains --json '{\n  \"targetPaths\": [\"\u003Cpaths\u002Fbeing\u002Ftouched>\"]\n}'\n```\n\nReturns `{domains: [...], untaggedPaths: [...], crossDomain: bool, ruleCount}`.\n\nRender two header lines in the plan output (right after the metadata\nblock):\n\n- **Always** (when `domains.length > 0`):\n  `- **Target domain(s)**: \\`\u003Cd1>\\`, \\`\u003Cd2>\\``\n- **When `crossDomain === true`** (>1 distinct tagged domain):\n  `- ⚠ **Cross-domain work** — touches >1 domain; confirm boundary crossings are intentional.`\n- **When `untaggedPaths.length > 0`** (paths matched no rule):\n  `- ⚠ **Untagged paths**: \\`\u003Cp1>\\`, \\`\u003Cp2>\\` — these don't match any rule in \\`.audit-loop\u002Fdomain-map.json\\`. Consider adding a rule before designing.`\n\nBoth warnings are heads-ups, not blocks. They surface architectural\ndecisions the planner should make explicitly.\n\n### Phase 0.5c — Security incident neighbourhood (proactive memory)\n\nRun alongside the arch-memory + target-domains queries:\n\n```bash\nnode scripts\u002Fcross-skill.mjs get-incident-neighbourhood --json '{\n  \"targetPaths\": [\"\u003Cpaths\u002Fbeing\u002Ftouched>\"],\n  \"intentDescription\": \"\u003Cone-line task summary>\",\n  \"k\": 3\n}'\n```\n\nReturns `{records, totalCandidatesConsidered, freshnessWarning}`. Render\n**only when `records.length > 0`** (don't add a \"no incidents — proceed\"\nline on every plan; that creates noise). When `freshnessWarning` is non-null,\nadd a freshness warning ABOVE the table. When the security strategy document\ndoesn't exist (response carries a `hint`), add a soft bootstrap warning at the\ntop of the plan output. → `references\u002Fcontext-callouts.md` §Phase 0.5c — read\nwhen rendering any of these three.\n\nSoft warning only — never blocks plan generation.\n\nFor any plan that crosses a trust boundary surfaced in the incidents\ncallout, add a required **\"Security Considerations\"** section in the\nplan output addressing each relevant invariant.\n\n### Phase 0.6 — Read the rendered architecture map for the target domain(s)\n\nIf `docs\u002Farchitecture-map.md` exists AND target domains are non-empty:\n**Read** the file (or `Grep` for `## \u003Cdomain>`) and read the symbol\ntable beneath each target-domain section. This is the human-curated\nview — complements the embedding-based neighbourhood query with the\nfull inventory of the domain you're working in. Especially valuable\nwhen the domain has its own per-domain Haiku summary at the top\nexplaining the domain's purpose.\n\nNo tool invocation; pure file Read.\n\n---\n\n## Phase 1 — Understand Before You Design\n\n**Explore the codebase FIRST.** The biggest planning failure is\nproposing solutions without understanding what already exists.\n\n### Pre-step — Persona test history (frontend or full-stack scope only)\n\nIf scope ⊇ frontend, check whether persona testing has surfaced pain points in\nthe area being planned. The command resolves the repo itself (`--repo` ->\n`PERSONA_TEST_REPO_NAME` from `.env` -> ambient `git remote`) — do NOT\nshell-expand the env var into `--repo`, which yields an empty flag in any\nsession that did not export it. Read it only through `cross-skill.mjs`.\n\n```bash\nnode scripts\u002Fcross-skill.mjs get-persona-sessions-by-repo --limit 5 --select persona,focus,verdict,findings,p0_count,p1_count\n```\n\nOutput shape: `{ok: true, cloud: true|false, measured, scope:{mode,slug}, rows: [...]}`.\nWhen `cloud:false`, no persona-test database is configured — proceed without\nthis signal. When `measured:false`, no repo resolved and nothing was read —\nalso proceed, but never read the empty `rows` as \"no findings\".\n\nFilter `rows` whose `focus` overlaps with the feature. If matches found, include in the Context Summary as **Known user-visible issues**\n(→ `references\u002Fcontext-callouts.md` §Phase 1 — read when rendering that block). Treat P0\u002FP1 matches as HIGH priority in the design.\n\n### Exploration checklist (apply the rows that match scope)\n\n**Always**:\n1. **Map the landscape**: read the relevant existing files\n2. **Identify existing patterns**: how does the codebase already solve similar problems?\n3. **Find reusable components**: existing services, utilities, abstractions, components\n4. **Check for prior art**: something similar partially built?\n\n**If scope ⊇ backend**:\n5. **Trace the data flow**: request lifecycle from route → service → DB and back\n\n**If scope ⊇ frontend**:\n6. **Audit the current UI**: read relevant HTML\u002FCSS\u002FJS for the area being changed\n7. **Map component landscape**: existing modals, cards, grids, forms, toasts\n8. **Identify the design language**: colour palette, typography, spacing, button styles\n9. **Trace user flows**: how the user navigates to and through related features\n10. **Check responsive behaviour**: how the UI handles different screen sizes\n11. **Note pain points**: what feels clunky, inconsistent, or confusing\n\nDo NOT propose a plan until exploration is complete.\n\n---\n\n## Phase 1.5 — Execution Model (backend or full-stack scope only)\n\nForced question: **Are any planned operations dependent on others?**\nIf yes, identify chains, prerequisites, and per-chain atomicity (typical\ncases: batch ops, multi-step workflows, state transitions, cross-entity swaps\n→ `references\u002Fauthoring-rationale.md` §Phase 1.5 — read when unsure whether a dependency exists).\n\n### What to produce\n\n1. **Dependency graph**: which operations must complete before others can start?\n2. **Chain identification**: group dependent operations into atomic chains\n3. **Failure semantics**: for each chain — rollback, retry, skip?\n4. **Concurrency model**: can chains run in parallel, or must they be serial?\n\nIf all operations are independent — document that explicitly and move on.\nIf ANY dependency exists — define execution order, atomicity boundary,\nand partial-failure recovery before proceeding.\n\nFor frontend-only scope, this phase typically reduces to \"operations are\nindependent\" and you move on quickly.\n\n---\n\n## Phase 2 — Engineering Principles (backend or full-stack scope)\n\nIf scope ⊇ backend, every backend design decision is evaluated against\n20 principles across:\n- **Core Design** (1–10): DRY, SOLID, Modularity, No Hardcoding, Single Source of Truth\n- **Robustness** (11–16): Testability, Validation, Idempotency, Transaction Safety, Error Handling, Graceful Degradation\n- **Performance & Sustainability** (17–20): N+1 prevention, Backward Compat, Observability, Long-Term Flexibility\n\nCite principle numbers in the plan's \"Proposed Architecture\" section\n(e.g. `(#1, #11)` next to a decision).\n\nFull tables + anti-patterns: `references\u002Fengineering-principles.md`.\n\nIf frontend-only scope: skip this phase entirely.\n\n---\n\n## Phase 3 — UX & Design Principles (frontend or full-stack scope)\n\nIf scope ⊇ frontend, every UI\u002FUX decision is evaluated against 26\nprinciples across four groups: Gestalt, Interaction\u002FUsability,\nCognitive Load, Accessibility. Plus Nielsen's 10 heuristics as final\ncross-check.\n\nCite numbers in the plan's \"UX Design Decisions\" section.\n\nFull tables: `references\u002Fux-principles.md`.\n\nIf backend-only scope: skip this phase entirely.\n\n---\n\n## Phase 4 — Technical Implementation Principles (frontend or full-stack scope)\n\nIf scope ⊇ frontend, evaluate against 17 technical principles across\nComponent Architecture (#27–31), State Management (#32–35), Event\nHandling (#36–39), CSS & Styling (#40–43).\n\nCite numbers in the plan's \"Technical Architecture\" section.\n\nFull tables + anti-patterns: `references\u002Ftechnical-principles.md`.\n\nIf backend-only scope: skip this phase entirely.\n\n---\n\n## Phase 5 — Long-Term Sustainability\n\nResist the urge to solve only the immediate problem. Every plan answers:\n\n### Right-sizing gate (when the plan introduces new structure)\n\nThe flexibility checklist below biases toward abstraction; this is its\ncounterweight (**Design right-sizing**, AGENTS.md). **When the plan introduces a\nnew abstraction, dependency, persistent artifact, or config surface** (the §7b\nGate-1 trigger class — skip for trivial plans), write three lines so the chosen\ndesign is visibly in the middle, not on either cliff:\n\n- **Band-aid extreme** — the quickest patch that leaves the root cause to resurface.\n- **Over-engineered extreme** — the fully general\u002Fabstract\u002Fconfigurable version.\n- **Chosen** — and the **current** requirement it serves. *No current requirement\n  → drop the abstraction.* \"Might need it later\" \u002F \"cleaner\" \u002F \"extensible\" is not\n  a current requirement (YAGNI overrides the flexibility checklist).\n\n→ `references\u002Fauthoring-rationale.md` §Phase 5 — right-sizing gate — read when the three lines feel like ceremony.\n\n**Manual vs scripted**: state in the plan which path the work takes and why\n→ `references\u002Fauthoring-rationale.md` §Phase 5 — manual vs scripted — read when\na change repeats across many similar sites (≥~5 regular edits).\n\n### System-level thinking (always)\n\n- **What assumptions does this design encode?** Which might change?\n- **If requirements change in 6 months, what breaks?** Design seams now so changes are localised.\n- **Does this tighten or loosen coupling?** Prefer loose coupling — components communicate through well-defined interfaces.\n- **Patterns or exceptions?** If this is the first of its kind, design as a pattern others can follow. If it deviates, justify why.\n\n### Architecture flexibility checklist\n\n- [ ] **Data-driven over logic-driven**: behaviour by data\u002Fconfig, not rewriting code?\n- [ ] **Strategy pattern over switch**: would a new variant require a new file (good) or modifying existing function (bad)?\n- [ ] **Composable pipeline**: can processing steps be added, removed, reordered without rewriting?\n- [ ] **Abstraction boundaries**: if we swap DB, AI provider, or external API, how many files change? Target: 1–2 adapter files.\n- [ ] **Migration path**: if this outgrows its design, is there a clear upgrade path without rewrite?\n\n### UI-specific (frontend or full-stack scope)\n\n- **What if the design system changes?** CSS variables + reusable classes?\n- **What if we add more items\u002Fviews?** Does the layout scale from 5 to 500? From 3 tabs to 12?\n- **What if mobile support tightens?** Is the component architecture responsive-ready?\n- **What if accessibility requirements tighten?** ARIA attributes, keyboard flows, focus management already in place?\n- **Are we creating a reusable pattern?** First of its kind → design as template.\n\n---\n\n## Phase 6 — Present the Plan\n\nStructure ONE consolidated output document. Section presence depends on scope:\n\n### Always\n\n#### 1. Context Summary\n- Detected scope + stack + Python framework (one line)\n- What exists today (Phase 1)\n- **Code Trace** — the evidence that Phase 1 actually happened. Cite the\n  `file_path:line` refs you read and the call path you followed (e.g.\n  `route handler `api\u002Fwines.js:42` → `wineService.add()` `services\u002Fwine.js:88`\n  → `db.insert` `db\u002Fwines.js:15``). Required on any **non-trivial** plan (the\n  §7b Gate-1 trigger class: ≥6 files, ≥2 subsystems, a dependency chain, or\n  >1 sitting of work). Trivial single-file plans may write `Code Trace: \u003Cfile>`\n  and move on. An absent or hand-waved trace on a non-trivial plan means the\n  design is ungrounded — go back to Phase 1.\n  **Pin every `file:line` to the commit you read it at** — `src\u002Ffoo.js:42\n  (a4ec98da)`. Cite append-newest-first files by section header, never by\n  line. → `references\u002Fverification-discipline.md` §1; why: `references\u002Fauthoring-rationale.md` §1 — Code Trace.\n- Patterns reused vs new\n- Known user-visible issues (if persona data + frontend scope)\n- Neighbourhood considered (if Phase 0.5 fired with results)\n\n#### 2. Proposed Architecture\n- **Architecture diagram** — a fenced ` ```mermaid ` block (type from the\n  table below). Default-on; skip with `--no-diagram`, or force a type with\n  `--diagram=sequence|graph|er|state`.\n- Component diagram (which files\u002Fmodules, how they interact)\n- Data flow (request → response path) — backend\u002Ffull-stack\n- User flow + ASCII wireframe — frontend\u002Ffull-stack\n- Key design decisions and **which principles drove them** (cite #N)\n\nThe Mermaid diagram is the **proposed** view, not a maintained file (existing\nstructure: the generated architecture map, Phase 0.6; → `references\u002Fauthoring-rationale.md`\n§2 — read when asked to keep the diagram current). Pick the type from the Phase 0 scope:\n\n| Scope \u002F signal | Mermaid diagram |\n|---|---|\n| `backend` — request lifecycle | `sequenceDiagram` (route → service → DB → back) |\n| `backend` — module structure | `graph LR` component boxes |\n| `frontend` | `graph TD` component tree |\n| `full-stack` | `graph TD` with one `subgraph` per tier (Client \u002F API \u002F Data) |\n| DB schema work | `erDiagram` |\n\nMermaid renders natively in GitHub and VS Code preview — no tooling needed\nfor the reader. Copy the exact fence syntax from `examples\u002Fmermaid-blocks.md`.\n\n### If scope ⊇ frontend\n\n#### 3. UX Design Decisions\n- Key choices and **which UX principles drove them**\n- How Gestalt principles shaped the layout\n- How cognitive load was managed\n- Accessibility approach\n\n#### 4. Technical Architecture (frontend)\n- Component diagram (JS modules, how they interact)\n- State management approach\n- Event handling strategy\n- CSS architecture (new classes, variables, responsive approach)\n\n#### 5. State Map (frontend)\nFor every component, document: Empty \u002F Loading \u002F Error \u002F Success \u002F Edge cases.\nFor components with a non-trivial state machine, optionally render the\ntransitions as a `stateDiagram-v2` block — template in\n`examples\u002Fmermaid-blocks.md`.\n\n### Always\n\n#### 6. Sustainability Notes\n- Assumptions that could change\n- How the design accommodates future change\n- Extension points deliberately built in\n\n#### 7. File-Level Plan\nFor each file to be created or modified:\n- **File path** + purpose\n- **Key functions\u002Fexports** with brief descriptions\n- **Dependencies** (imports + what imports it)\n- **Why this file** (which principle justifies it)\n\n##### 7b. Implementation Phases (conditional — Gate 1)\nEmit an ordered phase list ONLY when the work is genuinely large —\n**Gate 1**: ≥6 files touched, OR ≥2 distinct subsystems\u002Fdomains, OR a\nsequential dependency chain (from Phase 1.5), OR clearly >1 sitting of\nwork. Otherwise the plan stays flat (§7 only) — **no phases, never a lone\n\"Phase 1\"** (anti-degenerate invariant: a plan with phases always has ≥2).\nKeeps ceremony proportional to the work.\n\nFormat each phase: `**Phase N — \u003Cname>**: \u003Cwhat it does>. Files: \u003Cpath>\n(create|modify|delete), …` — **every file intent-tagged** (the tag drives\n`\u002Fcycle`'s clustered-audit preflight; see §11). Mechanical close-out\n(regenerate \u002F build \u002F lint \u002F verify) is **NOT** a phase — list it\nseparately as `**Close-out (not a phase)**: \u003Ccommands>`, excluded from the\n§11 partition.\n\n> **Write every path REPO-RELATIVE — `scripts\u002Fsetup-postgres.mjs`, never\n> `setup-postgres.mjs`.** This is not style. `extractPlanPaths`\n> (the bundle's `lib\u002Fplan-paths.mjs`) matches only paths containing a `\u002F`; with\n> fewer than 5 resolvable paths the audit's fuzzy keyword discovery fills the\n> scope from plan *words* and reviews the wrong code. **Never invent file\n> references to clear the threshold** — qualify the paths you genuinely touch.\n> → `references\u002Fauthoring-rationale.md` §7b — read when the count is under 5.\n>\n> Self-check before persisting (report-only; read the `regex-resolvable` line,\n> not `found`\u002F`missing` — fuzzy results are folded into `found`):\n> ```bash\n> node scripts\u002Flib\u002Fplan-paths.mjs \"$PLAN\"   # $PLAN = the plan file you are about to persist\n> ```\n\n#### 8. Risk & Trade-off Register\n- Trade-offs made + why\n- What could go wrong\n- What was deliberately deferred (and why that is OK)\n\n#### 9. Testing Strategy\n- What gets unit tested\n- What gets integration tested\n- Key edge cases\n- **Proof plan** (every scope): per behaviour change, the oracle (red test, source check or repeatable calculation), pass condition, report evidence: `references\u002Fproof-oracle.md`\n- (Frontend) Visual\u002Fmanual checklist + a11y testing + responsive breakpoints\n\n### If scope ⊇ frontend\n\n#### 10. Acceptance Criteria (Playwright-verifiable)\n\nSame machine-parseable format the removed `\u002Fplan-frontend` skill used to call\nSection 9. Drives `\u002Fux-lock verify`. Format:\n\n```\n- [SEVERITY] [CATEGORY] \u003Cone-line description>\n  - Setup: \u003Chow to reach the state this asserts on>\n  - Assert: \u003Cwhat to check, as a semantic DOM contract>\n```\n\nSeverity: `P0`\u002F`P1`\u002F`P2`\u002F`P3`. Category (closed set): `visibility`,\n`interaction`, `a11y`, `state`, `responsive`, `text`, `navigation`, `other`.\n\nAssertion rules (critical — verify mode cannot work if you break these):\n- Assert on **semantic DOM contracts only**: `getByRole(...)`, `getByLabel(...)`, `getByTestId(...)`, `aria-*`, ARIA roles, axe-core\n- **Never** reference CSS class names, internal state, or implementation details\n- **Never** describe \"it should feel fast\" — that's `\u002Fpersona-test` territory\n- If a criterion can only be expressed via class selector, propose adding a `data-testid` during implementation\n\nCoverage guidance: ≥1 P0 per primary user flow; ≥1 a11y per new component;\n≥1 state criterion for components with loading\u002Ferror\u002Fempty states; ≥1\nresponsive if mobile is a target.\n\nIf you can't write ≥5 criteria for a non-trivial frontend plan, it may\nbe under-specified — revisit Phase 1 and §5 (State Map).\n\n### Always (conditional)\n\n#### 11. Execution Clustering (conditional — Gate 2)\n\nEmit ONLY when §7b fired AND the phases group into **≥2 clusters** (a real\nmerge\u002Fsplit decision exists). A large-but-cohesive plan keeps §7b with no\n§11; small plans have neither. `\u002Fcycle` reads this block to drive clustered\nimplementation + audit. **Cluster coupled phases** so `\u002Faudit-code`'s\ncross-cutting wiring pass can inspect the seam between them — clustering is\nquality-positive, not just a token saving.\n\n**Grammar** (the contract `\u002Fcycle` and `\u002Faudit-plan` consume):\n1. One bullet per cluster: `- **Cluster \u003CID>** — Phases \u003Ccontiguous range> — fix-gate: \u003Cyes|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.\n2. `Coupling:` sub-bullet (**required**) — WHY these phases group (the auditable claim; the shared seam).\n3. **Cluster audit scope is derived, not restated**: it is the union of the member phases' `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.\n4. `fix-gate: yes` → cluster must reach `\u002Faudit-code` convergence (`HIGH == 0 && MEDIUM \u003C= 2 && quickFix == 0`) before the next builds on it; `final` → last cluster, gated by the consolidated Gemini pass; `none` → no blocking gate.\n5. Trailing `- **Final gate**:` line (**required**) — declares the mandatory consolidated Gemini review over the union diff.\n6. **Partition invariant**: every §7b *implementation* phase appears in exactly one cluster (none omitted\u002Fduplicated); close-out work is outside the phase set and is not clustered.\n7. **Optional** `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). `\u002Fcycle` **records** it for actual-vs-suggested analysis but **does NOT change which model runs** — there is no router yet (see `docs\u002Fplans\u002Fmodel-tier-observation.md`). Omit it unless it adds signal; it never gates anything.\n\n**Authoring**: group coupled phases (cite the seam in `Coupling:`); keep\nindependent phases splittable; place `fix-gate: yes` before any cluster\nthat builds on a prior cluster's output; the last cluster is `fix-gate:\nfinal`. ≥2 clusters or omit the block entirely.\n\n---\n\n## Phase 6.5 — Validate diagrams (optional, graceful)\n\nIf the plan contains a ` ```mermaid ` block AND the Mermaid MCP is available\nthis session, validate each block before persisting — a syntax error otherwise\nrenders as a red error box in GitHub.\n\n**The tool is `mcp__mermaid__generate_mermaid_diagram`**, from the `mermaid`\nserver that `.mcp.json` and `.vscode\u002Fmcp.json` both register. Pass the block as\n`mermaid` and `outputType: \"mermaid\"` — that echoes the source back instead of\nrendering an image, so validation costs nothing. Invalid syntax comes back as an\nMCP error carrying the parser's line and column; that error IS the validation.\n(Tool-name history: `references\u002Fauthoring-rationale.md` §Phase 6.5 — read when the tool seems unavailable.)\n\n- **MCP available** → validate each block; fix any reported syntax error\n  in place before Phase 7.\n- **MCP not available** → **skip silently and proceed.** The Mermaid MCP\n  is an optional convenience, never an install dependency — Mermaid\n  renders natively in GitHub and VS Code preview, so an unvalidated block\n  still works for the reader. Do not warn the user about the missing MCP.\n\n**This does not replace `plans:lint`, and neither replaces the other** (two\nblind spots → `references\u002Fauthoring-rationale.md` §Phase 6.5 — read when one looks redundant).\n\n---\n\n## Phase 7 — Persist the Plan\n\nSave to `docs\u002Fplans\u002F\u003Cdescriptive-name>.md`. Create `docs\u002Fplans\u002F` if\nneeded. Metadata header:\n\n```markdown\n# Plan: \u003CFeature Name>\n- **Date**: \u003Ctoday's date>\n- **Status**: Draft | Approved | In Progress | Complete | Superseded\n- **Author**: Claude + \u003Cuser>\n- **Scope**: backend | frontend | full-stack   ← from Phase 0\n```\n\n**If this plan must not ship before another plan lands**, say so as a\nstructured line, not only in prose (→ `references\u002Fauthoring-rationale.md`\n§Phase 7 `Depends on:` — read when tempted to leave it as prose):\n\n```markdown\n- **Depends on**: docs\u002Fplans\u002F\u003Cother-plan>.md — \u003Cwhy, e.g. \"wait for Cluster F to land first\">\n```\n\nOne line per dependency; `\u002Fcycle` Step 0.5 reads it back with\n`node scripts\u002Fcheck-plan-status.mjs --check-deps \u003Cthis-plan>` — a nudge, never a gate.\n\nRegister in the cross-skill store so audit-plan\u002Faudit-code + ux-lock can link:\n\nInclude the user's ORIGINAL task description as `taskText` in the SAME payload\n— that is what arm-eval scores the arms on. **Write the\npayload to a file with the Write tool, then pipe it via `--stdin`** — never\ninline it into a shell single-quoted string (an apostrophe in the task text\ncorrupts the call; → `references\u002Fauthoring-rationale.md` §Phase 7 payload — read when asked why).\n\n1. Write `.claude\u002Ftmp\u002Fupsert-plan.json` with the Write tool:\n   ```json\n   {\n     \"path\": \"docs\u002Fplans\u002F*.md\",\n     \"skill\": \"plan\",\n     \"status\": \"draft\",\n     \"taskText\": \"the user's original task description, verbatim\"\n   }\n   ```\n2. Pipe it in:\n   ```bash\n   cat .claude\u002Ftmp\u002Fupsert-plan.json | node scripts\u002Fcross-skill.mjs upsert-plan --stdin\n   ```\n\nUpdate status as implementation progresses.\n\n### Phase 7.5 — Arm-eval capture (AUTOMATIC — no action)\n\n`upsert-plan` fires arm-eval capture itself — never run `arm-eval-maybe-capture`\ntoo (→ `references\u002Fauthoring-rationale.md` §Phase 7.5 — read when asked how capture works).\n\n---\n\n## Reminders\n\n- **Detect scope first** — Phase 0 is load-bearing; the rest of the flow keys off it\n- **Explore before proposing** — codebase is ground truth, not assumptions; §1's **Code Trace** is the artifact that proves you did (required on non-trivial plans)\n- **Name the principles** — every design choice cites which principle(s) it serves (#N)\n- **One document, one audit** — no merging child plans, no archive cruft\n- **Section 10 acceptance criteria are what `\u002Fux-lock verify` grades** for frontend\u002Ffull-stack — a **report, not a gate**: verify exits 0 even when criteria fail, and `\u002Fship` does not read `plan_satisfaction`. Write them to be gradeable, not because they block a ship (they don't)\n- **Phase the work only when it's large** — §7b\u002F§11 are conditional (Gate 1: ≥6 files \u002F ≥2 subsystems \u002F dep-chain; Gate 2: ≥2 clusters). Never emit a lone \"Phase 1\"; cluster coupled phases so the audit sees the seam\n- **A measurement is a campaign** — an eval, labelled test set or experiment takes `--campaign`: `- **Mode**: campaign`, the C1–C12 `## Campaign Contract`, a dress rehearsal before the real run (`references\u002Fcampaign.md`)\n- **Show every state** — Empty\u002FLoading\u002FError\u002FSuccess for any component you design\n- **Wireframe before code** — ASCII layouts prevent expensive rework\n- **Accessibility is not optional** — baseline, not nice-to-have\n\n---\n\n## Reference files\n\nThis skill's canonical flow is above. The files below cover specialised\nsituations — read them only when the trigger applies (scope detection\nin Phase 0 tells you which ones).\n\n| File | Summary | Read when |\n|---|---|---|\n| `references\u002Fengineering-principles.md` | 20 engineering principles — core design, robustness, performance, sustainability. | Phase 2 — scope ⊇ backend AND writing Proposed Architecture; need to cite principles. |\n| `references\u002Fux-principles.md` | 26 UX + design principles — Gestalt, interaction, cognitive load, accessibility, state\u002Fresilience. | Phase 3 — scope ⊇ frontend AND evaluating a design decision. |\n| `references\u002Ftechnical-principles.md` | 17 technical implementation principles — component architecture, state, events, CSS\u002Fstyling. | Phase 4 — scope ⊇ frontend AND writing Technical Architecture. |\n| `references\u002Fpython-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. |\n| `references\u002Fpython-frontend-profile.md` | Python frontend profile — Jinja\u002FDjango\u002FFlask template patterns + HTMX + anti-patterns. | Phase 0 detect-stack returned `python` (or mixed with Python frontend files) AND scope ⊇ frontend. |\n| `examples\u002Fmermaid-blocks.md` | Mermaid diagram templates — sequenceDiagram, graph, erDiagram, stateDiagram-v2 — one per scope. | Phase 6 §2\u002F§5 — emitting an architecture or state diagram; need the exact fence syntax. |\n| `references\u002Fproof-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. |\n| `references\u002Fverification-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. |\n| `references\u002Fcontext-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. |\n| `references\u002Fauthoring-rationale.md` | Why \u002Fplan'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. |\n| `references\u002Fcampaign.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). |\n| `references\u002Fworktree-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. |\n\n— end of \u002Fplan —\n",{"name":5,"description":61,"allowed-tools":62},"Unified architecture + UX planner with engineering principles. Auto-detects\nwhether the work is backend-only, frontend-only, or full-stack and applies\nthe appropriate principle sets. Use when the user asks to plan, design, or\narchitect anything — features, refactors, API endpoints, services, UI\ncomponents, pages, layouts, user flows, modals, forms, visual changes,\ndatabase schemas. Also auto-invoke when detecting planning context like\n\"I want to add\", \"let's design\", \"plan the implementation\", \"how should we\nstructure this\", \"I need to refactor\", \"design the UI for\", \"build a\ncomponent\", \"improve the UX of\". Invoke on the request's shape; don't\nexplore the repo for stack context first and answer directly — the skill\ngathers that itself once invoked. Accepts a task description as argument;\nan explicit scope hint and diagram controls are available as flags.\nTriggers on: \"plan\", \"design this\", \"architect this\".\nFull command syntax: see the Usage section in this skill.\n","Bash(node scripts\u002Fcross-skill.mjs detect-stack)","main","6598878d5de2e58ba007c801042092e04d733e99",".claude\u002Fskills\u002Fplan","https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills","https:\u002F\u002Fgithub.com\u002FLbstrydom","Studying M.Sc Computer Science at Heriot Watt","2026-11-14 22:15:30",{"source":8,"skillName":5,"commands":71,"prompt":81,"zipAvailable":82},[72,75,78],{"tool":73,"command":74},"npx","npx skills add Lbstrydom\u002Fclaude-engineering-skills --skill plan",{"tool":76,"command":77},"bunx","bunx skills add Lbstrydom\u002Fclaude-engineering-skills --skill plan",{"tool":79,"command":80},"pnpm","pnpm dlx skills add Lbstrydom\u002Fclaude-engineering-skills --skill plan","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002FSKILL.md",true,[84,90,94,98,102,106,110,114,118,122,126,130],{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"examples\u002Fmermaid-blocks.md","REFERENCE","参考文档",2937,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Fexamples\u002Fmermaid-blocks.md",{"path":91,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fauthoring-rationale.md",6934,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Fauthoring-rationale.md",{"path":95,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fcampaign.md",6738,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Fcampaign.md",{"path":99,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Fcontext-callouts.md",2383,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Fcontext-callouts.md",{"path":103,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Fengineering-principles.md",3180,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Fengineering-principles.md",{"path":107,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":108,"sourceHtmlUrl":109},"references\u002Fproof-oracle.md",1719,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Fproof-oracle.md",{"path":111,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":112,"sourceHtmlUrl":113},"references\u002Fpython-backend-profile.md",2159,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Fpython-backend-profile.md",{"path":115,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":116,"sourceHtmlUrl":117},"references\u002Fpython-frontend-profile.md",2196,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Fpython-frontend-profile.md",{"path":119,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":120,"sourceHtmlUrl":121},"references\u002Ftechnical-principles.md",3442,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Ftechnical-principles.md",{"path":123,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":124,"sourceHtmlUrl":125},"references\u002Fux-principles.md",4294,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Fux-principles.md",{"path":127,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":128,"sourceHtmlUrl":129},"references\u002Fverification-discipline.md",28340,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Fverification-discipline.md",{"path":131,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":132,"sourceHtmlUrl":133},"references\u002Fworktree-preflight.md",3413,"https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fplan\u002Freferences\u002Fworktree-preflight.md",[135,151,162,180,194,224],{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":144,"publishedAt":56},"01M6J45X4FDB2AD5BGS4R4QY8X","stated-absent","Negative fixture — the contract's stated string never appears in this file.","https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgate-honesty\u002Fnegative\u002Fstated-absent\u002Fskills\u002Fstated-absent\u002FSKILL.md",[141],{"categoryNo":142,"categoryName":143,"taxonomyType":32,"taxonomyTypeDesc":33},"01JBSEEDCAT000000000000037","律师与法务",[145,146,147,148,149,150],"stated absent","STRING","fixture","contract","never","file",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":158,"publishedAt":56},"01M6J45TAX2PPHETZ5TJZG20QQ","nonexistent-implementation","Negative fixture — contract references an implementation file that does not exist.","https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgate-honesty\u002Fnegative\u002Fnonexistent-implementation\u002Fskills\u002Fnonexistent-implementation\u002FSKILL.md",[157],{"categoryNo":142,"categoryName":143,"taxonomyType":32,"taxonomyTypeDesc":33},[159,160,147,161,148,150],"implementation","nonexistent implementation","references",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":171,"publishedAt":56},"01M6J45P5GN52YFMZ81T7NN1VF","document-only-with-params","Negative fixture — a document-only gate illegally carries params (schema must refuse this fake-check pattern).","https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgate-honesty\u002Fnegative\u002Fdocument-only-with-params\u002Fskills\u002Fdocument-only-with-params\u002FSKILL.md",[168],{"categoryNo":169,"categoryName":170,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理",[172,173,174,175,176,147,177,178,179],"only","document","document only with params","with","pattern","gate","schema","check",{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":189,"publishedAt":56},"01M6J45J1CCZ7AXDGQKBA9VC8M","lying-skill","Fixture skill for the gate-honesty self-check — every gate here is deliberately dishonest.","https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgate-honesty\u002Flying-skill\u002Fskills\u002Flying-skill\u002FSKILL.md",[186],{"categoryNo":187,"categoryName":188,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[190,147,191,177,192,193,179],"lying skill","self","for","fixture skill",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":198,"categories":199,"keywords":205,"publishedAt":56},"01M6J45CW0DNN7K2W39E3PQHEY","visual-audit","Math-first, deterministic visual\u002Fpaint inspection — the 4th UX lens, complementing\npersona-test (journey), click-test (page), and nav-audit (system). Drives Playwright +\ncomputed styles + bounding boxes + CDP forced-pseudo-state to audit declared-token\nconformance, light\u002Fdark theme parity, layout physics, and affordance signifiers. A VLM\nis advisory-only and never gates. CI gate is drift-only on the changed contracted surface.\nTriggers on: \"visual audit\", \"check styling consistency\", \"theme parity\", \"dark mode parity\",\n\"design token drift\", \"paint audit\", \"button\u002Fcard consistency\", \"focus ring audit\",\n\"\u002Fvisual-audit\".","https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvisual-audit\u002FSKILL.md",[200,201,204],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":202,"categoryName":203,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":30,"categoryName":31,"taxonomyType":32,"taxonomyTypeDesc":33},[206,207,208,209,210,211,212,213,214,215,216,149,217,218,219,220,55,221,172,222,223],"visual audit","visual","audit","inspection","layout","math","focus","design token","cdp","lens","click","physics","card","mode","ci","journey","persona","drift",{"skillNo":225,"name":226,"nameZh":6,"description":227,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":228,"categories":229,"keywords":234,"publishedAt":56},"01M6J4569S40ZASFWW698CHBKP","ux-lock","Generate Playwright e2e specs. Two modes:\n  1. LOCK mode — pin a fix's DOM contract so it doesn't regress (default).\n  2. VERIFY mode — check that a \u002Fplan plan was actually implemented\n     by parsing its Acceptance Criteria section and driving the live URL.\nVERIFY mode grades a plan against a RUNNING app. To judge the plan document\nitself, before anything is built, that is \u002Faudit-plan.\nTriggers on: \"ux lock\", \"lock ux\", \"lock in the fix\", \"write regression spec\",\n\"generate e2e test for\", \"regression test for commit\", \"lock this fix\",\n\"verify the plan\", \"verify plan implementation\", \"check the plan was built\",\n\"audit frontend implementation\", \"did we ship the plan\".\nFull command syntax: see the Usage section in this skill.","https:\u002F\u002Fgithub.com\u002FLbstrydom\u002Fclaude-engineering-skills\u002Fblob\u002Fmain\u002Fskills\u002Fux-lock\u002FSKILL.md",[230,231,232,233],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":30,"categoryName":31,"taxonomyType":32,"taxonomyTypeDesc":33},{"categoryNo":142,"categoryName":143,"taxonomyType":32,"taxonomyTypeDesc":33},[235,236,237,238,239,240,241,219,242,243,46,244,245,246,5,35,247,208,248,249,250],"ux","lock","ux lock","syntax","app","regression","e2e test","default","fix","acceptance","URL","commit","generate","write","judge","verify plan"]