/unwind:uw-planfrom unwind
Interviews users about rebuild strategy after layer analysis, generating a data-grounded REBUILD-PLAN.md that records decisions on target stack, phasing, and risk.
Ships in unwind. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Transform layer analysis into a strategic rebuild plan that answers HOW to rebuild, not WHAT to rebuild. The plan is co-authored with the user, not guessed: the strategic decisions that shape a rebuild — target stack, what to keep vs rebuild, migration approach, phasing, risk tolerance — are ones only the user can make.
This skill grills the user the way the grilling skill does: walk the decision
tree one branch at a time, resolving dependencies in order, and for every question
provide a recommended answer derived from the deterministic data. If a question can
be answered from the scan/coverage data, answer it from the data — don't ask.
Key Principle: Layer docs are the source of truth for what exists. This plan records the strategic decisions about re-use, phasing, and approach — grounded in the deterministic brief — and references the layer docs for the detail.
Requires: docs/unwind/layers/*/index.md from layer specialists + verification reports
Produces:
docs/unwind/REBUILD-PLAN.md — strategic rebuild approach, target stack, and a decisions logdocs/unwind/.cache/rebuild-decisions.json — machine-readable record of the interview answersdocs/unwind/architecture.md if corrections needed after detailed analysisBefore using this skill:
.cache/coverage/)docs/unwind/layers/ with index.md + section filesBuild the rebuild brief: the verifiable facts that ground every interview question. Run the deterministic script:
# Locate the installed Unwind plugin, then load the core helper.
# $0/BASH_SOURCE are unreliable under `bash -c`, so glob the install cache.
UNWIND_PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-${UNWIND_PLUGIN_ROOT:-}}"
[ -f "$UNWIND_PLUGIN_ROOT/skills/scripts/_resolve-plugin-root.sh" ] || \
UNWIND_PLUGIN_ROOT="$(ls -dt "$HOME"/.claude/plugins/cache/*/unwind/*/ 2>/dev/null | head -1)"
source "${UNWIND_PLUGIN_ROOT%/}/skills/scripts/_resolve-plugin-root.sh"
ensure_unwind_core || echo "core unavailable — using legacy artifact reading"
node "$UNWIND_PLUGIN_ROOT/skills/scripts/plan-brief.mjs" "$(pwd)"
This writes docs/unwind/.cache/plan-brief.json. Read it. It contains:
project — name, languages, estimatedComplexity, file counts.detected — the current stack: languages, ormSources (data-access framework
in use, e.g. {drizzle: 39}), endpointMethods. Use this to recommend concrete
targets per element ("on Drizzle today → keep, or move to X?").perLayer[] — per layer: file/candidate/symbol counts, coverage %, and
[MUST]/[SHOULD]/[DON'T] tallies. Use these to weight effort and confidence.contracts — dataModels, sqlDdl, dataModelLinks (ORM↔SQL pairs to reconcile),
endpoints (+ by method). The API/data surface that must be preserved.importGraph — foundations (depended-upon leaves: build first) and hubs (most
depended-upon files). Seeds the phasing order.readiness — overall coverage % and provisionalLayers (< 100%). Where the plan
must flag itself provisional.Also:
docs/unwind/architecture.md for layer boundaries and cross-cutting concerns.package.json (+ pnpm-lock/bun),
requirements.txt/pyproject.toml, go.mod, Cargo.toml, pom.xml, *.csproj —
to learn the concrete current libraries (web framework, validation, auth, queue,
HTTP client, test runner). This is what lets you recommend specific target modules
in the stack interview rather than generic categories.Graceful fallback (per the repo's degrade-gracefully rule):
docs/unwind/.cache/scan-manifest.json, .cache/coverage/*.json, and
grep the [MUST]/[SHOULD]/[DON'T] tags across docs/unwind/layers/**. Say so.index.md
files for counts and readiness. Say that the brief is approximate.Then validate architecture.md against the detailed findings (layer boundaries
accurate? layers added/removed? cross-cutting concerns right?) and update it if needed.
Present a short factual summary of the brief to the user (a few lines: stack, complexity, contract surface, readiness, the largest layers) before the interview, so they answer with the facts in view.
Walk the decision tree in dependency order, asking one decision (or one
tightly-coupled cluster) per AskUserQuestion call. Asking everything at once is
bewildering and breaks the dependency chain. For each question:
(Recommended) in the label, derived
from the brief. Give the data behind it in the option description.[DON'T] tech-specific).uw-start run-to-dashboard mode) can one-shot the interview. The
decisions are still recorded with their recommended values.The tree has two parts: B1 — pin the exact target stack & architecture (drill deep,
relentlessly), then B2 — re-use, phasing & validation. B1 is the heart of the
interview — don't settle for a one-line "rebuild in TypeScript". Keep drilling each
element until the choice is concrete and named (a specific framework/library/version),
because every B1 answer changes what downstream code is [MUST] vs [DON'T]
tech-specific.
Ask these as separate questions, in order, each recommended-first from detected
detected.languages. The runtime constrains
everything below (Workers ⇒ no native Node APIs, etc.).contracts.endpoints > 0 (preserve the existing surface); flag if moving off REST
breaks the documented endpoint contract.detected.ormSources and dataModelLinks. (The keep-vs-migrate data decision is
B2 §1 — here we pick the access tech.)frontend layer exists) — React / Vue / Svelte /
Solid, and meta-framework if any (Next / Remix / Astro / SvelteKit), plus
styling (Tailwind / CSS modules) and state/data-fetching (TanStack Query, etc.).messaging layer exists — BullMQ / Cloudflare Queues /
SQS), caching, background jobs / cron, email/notifications, file
storage, observability/logging, testing framework (Vitest / Jest /
Playwright). Recommend the current library (from deps) as the default and offer 1–2
modern alternatives. Ask explicitly: "Any specific modules you want to use for any
part of the solution?" and capture free-form answers.[MUST] contracts and data model.Before leaving B1, play back the full assembled stack ("So: TS + Hono on Workers, REST, Drizzle + D1, React + Tailwind, Zod, Vitest, Cloudflare Queues — correct?") and get a single confirmation, so the stack is locked as one coherent set, not eight disconnected picks.
contracts.dataModels / dataModelLinks and table count
(more ORM↔SQL links ⇒ schema well-pinned ⇒ reuse safer).frontend layer exists and API-contract rigidity.tests layer coverage and coupling.importGraph.foundations (build leaves
first) and [MUST] weighting per layer. Confirm the order and the first slice.The user can wrap up at any point ("accept the rest as recommended", "stop here") — honor it and record the remaining decisions at their recommended values.
As decisions land, accumulate a list of records (one per question). After the
interview, write the machine-readable record to
docs/unwind/.cache/rebuild-decisions.json:
{
"version": "1.0.0",
"generatedAt": "<ISO timestamp>",
"decisions": [
{
"id": "RD-1",
"topic": "Target stack",
"question": "What stack should the rebuild target?",
"recommended": "<data-grounded default you proposed>",
"chosen": "<what the user picked>",
"rationale": "<the brief data that informed it + why the user chose>"
}
]
}
Write docs/unwind/REBUILD-PLAN.md, grounded in the brief and the confirmed
decisions. Each strategic section records the decision the user made, its rationale,
and the brief data that informed it — never an LLM guess.
CRITICAL: Never copy content from layer docs. Only reference them (anti-patterns below).
# [Project Name] - Rebuild Strategy
> Generated by Unwind on [timestamp]
## Target Stack
**From:** [detected source stack — language/framework/runtime/datastore/ORM]
**To (assembled in B1):**
| Element | Choice | From (current) |
|---------|--------|----------------|
| Language & runtime | [e.g. TypeScript / Cloudflare Workers] | [detected] |
| Backend framework | [e.g. Hono] | [detected] |
| API contract style | [REST / tRPC / GraphQL] | [detected] |
| Datastore | [e.g. D1 / Postgres] | [detected] |
| Data access / ORM | [e.g. Drizzle] | [detected ormSources] |
| Frontend | [framework + meta + styling, or "retained as-is"] | [detected] |
| Auth | [module] | [detected] |
| Validation | [module] | [detected] |
| Messaging / jobs | [module] | [detected] |
| Testing | [framework] | [detected] |
| Hosting / deploy | [target] | [detected] |
| Other requested modules | [free-form picks from B1 §6] | — |
**Changing:** [parts being re-platformed] **Staying:** [parts retained]
**Architecture:** [confirmed shape from B1 §8 — monolith/modular/services; layer→module map]
## Executive Summary
**Overall Readiness:** [overall coverage % from the brief] — provisional in: [layers < 100%]
**Recommended Approach:** [one line, e.g. "Rebuild backend on the target stack, retain frontend + live DB"]
---
## Strategic Decisions
> Each decision below was made during the rebuild interview and is recorded in
> `## Rebuild Decisions`. Assessments cite the deterministic brief.
### Database Strategy
**Decision:** [chosen] **Why:** [rationale + brief data — dataModels/links/table count]
**If live DB not feasible:** [ ] snapshot+restore [ ] sync mechanism [ ] dual-write
### Frontend Retention
**Decision:** [chosen] **Why:** [rationale + brief data]
**API contract:** preserve exactly [critical endpoints — count from brief]; can evolve [areas]
### Test Re-usability
**Decision:** [chosen] **Why:** [test-layer coverage + coupling]
**Adapters needed:** [ ] [list]
### Integration Preservation
| Integration | Contract Type | Must Preserve |
|-------------|---------------|---------------|
| [Name] | [webhook/API/job] | [Yes/No + reason] |
---
## Phasing Strategy
> Order seeded by the import graph (foundations first) and [MUST] weighting.
### Phase 1: Foundations
**Build first:** [foundations from the brief — depended-upon leaves]
**Retain / Adapt / Rebuild:** [...] **Reference:** [layers/xxx/index.md]
**Validation:** [ ] [check]
### Phase 2: Core Logic
[Same structure — highest-[MUST] layers]
### Phase 3: Interfaces (API)
[Same structure — preserve the [count] endpoints]
### Phase 4: Frontend (if rebuilding)
[Same structure]
### Phase 5: Integration & Cutover
**Parallel running:** [old vs new] · **Traffic split** · **Rollback triggers**
---
## Validation Strategy
**Equivalence testing:** [how to prove the rebuild matches — cite test-layer coverage]
**Test vectors:** [ ] existing integration tests pass [ ] calc outputs match [ ] API responses identical
**Go-live checklist:** [ ] phase validations [ ] parallel-run [duration] [ ] rollback tested [ ] monitoring
---
## Rebuild Decisions
> The interview answers (also in `.cache/rebuild-decisions.json`).
> One row per question — the B1 stack sub-tree (language, framework, API style,
> datastore, ORM, frontend, per-element modules, hosting, architecture) each get their
> own RD id, then the B2 re-use/phasing/validation decisions.
| ID | Topic | Recommended | Chosen | Rationale |
|----|-------|-------------|--------|-----------|
| RD-1 | Language & runtime | [rec] | [chosen] | [why] |
| RD-2 | Backend framework | [rec] | [chosen] | [why] |
| RD-3 | API contract style | [rec] | [chosen] | [why] |
| RD-4 | Datastore & ORM | [rec] | [chosen] | [why] |
| ... | (frontend, auth, validation, …, architecture) | | | |
| RD-n | Database re-use | [rec] | [chosen] | [why] |
| RD-n+1 | Phasing order | [rec] | [chosen] | [why] |
---
## Layer Documentation References
> These documents contain the detailed specifications. This plan records strategic decisions only.
| Layer | Reference | Coverage |
|-------|-----------|----------|
| Database | [layers/database/index.md](layers/database/index.md) | [%] |
| ... | | |
NEVER do these:
ALWAYS do these:
rebuild-decisions.jsonIf a rebuild plan exists:
rebuild-decisions.jsonplan-brief.mjs; compare to the recorded decisions## Changes Since Last Plan section; update rebuild-decisions.jsonAnnounce what was produced:
Rebuild strategy complete. See:
docs/unwind/REBUILD-PLAN.md— strategy, target stack, and decisions logdocs/unwind/.cache/rebuild-decisions.json— machine-readable decisionsdocs/unwind/architecture.md— validated architecture overviewThe layer documentation contains the detailed specifications. The rebuild plan records HOW to approach the rebuild, not WHAT to build.
Analysis is now complete. The natural next step is to visualize it — the
dashboard builds its data (rebuild-graph.json) on demand, so you go straight there.
Use AskUserQuestion to ask whether to continue:
unwind:uw-dashboard; it
(re)generates rebuild-graph.json from the current scan + docs and launches.unwind:uw-build to start building in the target
stack (it interviews you about scope/order and measures completeness as it goes).unwind:uw-graph to write
rebuild-graph.json without a server (for static deploy / CI / sharing).Act on the choice in the same turn; if they pause, tell them how to resume: "Run
unwind:uw-dashboard to explore the graph, or unwind:uw-build to start the rebuild."
Pipeline: scan → analyze → grill → plan ✓ → dashboard.
uw-graphis an optional artifact-export step, not a gate — the dashboard builds the graph itself.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub nearform/unwind --plugin unwind25 skills in this plugin
/uw-analyzeUse after unwind:uw-scan to orchestrate layer-by-layer analysis using specialist subagents/uw-analyze-apiUse when analyzing REST/GraphQL API endpoints, contracts, authentication, and client-facing interfaces/uw-analyze-databaseUse when analyzing the database layer including schema, migrations, ORM configuration, and data access patterns/uw-analyze-domainUse when analyzing domain entities, value objects, aggregates, and business rules encoded in the modelOther plugins' skills for the same job