ワンクリックで
uw-analyze
Use after unwind:uw-scan to orchestrate layer-by-layer analysis using specialist subagents
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use after unwind:uw-scan to orchestrate layer-by-layer analysis using specialist subagents
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use after unwind:uw-plan to EXECUTE the rebuild — interview the user about scope/order/target, dispatch technology-agnostic per-layer builder agents that reproduce the [MUST] contracts in the target stack, hold rebuild state in a local file, and maintain a source→target verification graph that measures completeness. Supports a loop-until-verified mode.
Use to visually explore the rebuild knowledge graph. Builds and launches the Unwind dashboard (React + React Flow + ELK) pointed at docs/unwind/rebuild-graph.json with coverage, priority, and contract views.
Optional. Publish the Unwind dashboard to the scanned project's GitHub Pages gh-pages branch so it's viewable at https://<owner>.github.io/<repo>/unwind/. Builds the dashboard at the correct sub-path and commits it into an `unwind/` subdir — never blatting an existing gh-pages branch. Confirms the target, then pushes.
Use when dispatched by unwind:uw-build to rebuild ONE layer/slice of a codebase in the target stack. Technology-agnostic builder that reproduces the layer's [MUST] contracts (API surface, data model, business rules) as idiomatic target-stack code and records the source→target mapping for verification.
Use when starting any reverse engineering task - establishes how to find and use Unwind skills for codebase analysis, service mapping, and documentation
Use after layer analysis is complete to interview the user about the rebuild strategy (target stack, what to keep vs rebuild, phasing, risk) and generate a data-grounded REBUILD-PLAN.md that records those decisions.
| name | uw-analyze |
| description | Use after unwind:uw-scan to orchestrate layer-by-layer analysis using specialist subagents |
| uses-skills | ["unwind:uw-analyze-database","unwind:uw-analyze-domain","unwind:uw-analyze-service","unwind:uw-analyze-api","unwind:uw-analyze-messaging","unwind:uw-analyze-frontend","unwind:uw-analyze-unit-tests","unwind:uw-analyze-integration-tests","unwind:uw-analyze-e2e-tests","unwind:uw-analyze-infrastructure","unwind:uw-verify","unwind:uw-complete"] |
| allowed-tools | ["Read","Grep","Glob","Bash(git:*, mkdir:*, ls:*)","Bash(node:*)","Bash(pnpm:*)","Bash(source:*)","Read(docs/unwind/.cache/**)","Write(docs/unwind/**)","Edit(docs/unwind/**)","Task"] |
Requires: docs/unwind/architecture.md + docs/unwind/.cache/scan-manifest.json (from uw-scan)
Produces: docs/unwind/layers/*/ folders via subagents (each with index.md + section files)
Principles: See analysis-principles.md - completeness, machine-readable, link to source, no commentary, incremental writes, anchor-id headings, manifest seeding.
Hybrid flow: layer specialists are seeded with the deterministic candidate list the scanner found (so completeness is a checklist, not a guess), and verification is a deterministic
manifest − docsdiff (not a subjective LLM comparison). If@unwind/core/the manifest is unavailable, fall back to the legacy unseeded dispatch + LLM gap detection — the flow still works.
Before doing anything, check whether a prior analysis exists:
ls docs/unwind/layers/*/ 2>/dev/null | head -1 # any layer docs already written?
If docs/unwind/layers/ already has content, do NOT silently re-run. Use
AskUserQuestion to let the user choose:
## Changes Since Last Review
and reconcile against the current scan. Non-destructive.Restarting is destructive and hard to reverse, so require a clear second confirmation before deleting. Only after the user explicitly confirms (e.g. answers "yes, delete"), remove the prior analysis docs — and nothing else:
# DESTRUCTIVE — run ONLY after explicit user confirmation to restart from scratch.
rm -rf docs/unwind/layers
rm -rf docs/unwind/.cache/coverage docs/unwind/.cache/seeds
rm -f docs/unwind/REBUILD-PLAN.md
# Keep architecture.md and .cache/scan-manifest.json (ground truth from uw-scan).
Then proceed in fresh mode. If the user chose Update, skip the deletion and run
every step below in Refresh Mode. If there is no existing docs/unwind/layers/,
this is a first run — proceed normally.
If docs/unwind/.cache/scan-manifest.json exists, emit per-layer candidate lists:
# 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 — legacy unseeded dispatch"
node "$UNWIND_PLUGIN_ROOT/skills/scripts/seed-layers.mjs" "$(pwd)"
This writes one seed file per specialist — {layer, docDir, count, items:[{id, kind, name, file, startLine, endLine, link}]}. The filename is the doc folder
(docDir). Most layers map to one seed (database.json, domain.json →
docDir: domain-model, …); the tests layer is fanned out into up to three
seeds named by folder — unit-tests.json, integration-tests.json,
e2e-tests.json — so each test specialist gets only its own checklist (empty
groups are omitted). The items are what each specialist must document. If
the manifest is missing, skip this step and dispatch specialists the legacy way
(no seed paste).
docs/unwind/architecture.mdrepository.link_format for source linkinglayers blockstatus: not_detectedPhase 1: database (no dependencies)
Phase 2: domain_model (needs database)
Phase 3: service_layer (needs domain_model)
Phase 4: api, messaging (parallel - need service_layer)
Phase 5: frontend (optional - needs api)
Phase 6: unit_tests, integration_tests, e2e_tests (parallel - no layer dependencies)
Phase 7: infrastructure (parallel - no layer dependencies)
For each layer, dispatch the specialist with its seed file pasted in
(read docs/unwind/.cache/seeds/{layer}.json first). The seed's docDir field
is the canonical output folder — use it verbatim for [docDir] below. Do
not derive the folder from the layer/seed-key name: they differ (domain →
domain-model, service → service-layer), and a mismatch makes
verify-coverage read an empty folder and report a false 0%.
Task(subagent_type="general-purpose")
description: "Analyze [layer] layer"
prompt: |
Use unwind:uw-analyze-[layer] to analyze this codebase layer.
Entry points from architecture.md:
[entry_points]
## Candidate items (deterministic scan) — your completeness checklist
[paste the contents of docs/unwind/.cache/seeds/[layer].json]
These [count] items were found deterministically by the scanner. You MUST
document EVERY one. Use the anchor-id heading format so coverage can be
verified mechanically:
### <name> [MUST|SHOULD|DON'T] <!-- id: <id> -->
(the `id` is the item's `id` from the seed). To omit an item, document it
under an `## Excluded` section with a one-line reason — NEVER silently drop
it. You MAY ADD items the scanner missed (e.g. dynamically-registered routes).
SOURCE LINKING - Use this format for all source references:
[link_format from architecture.md]
Replace {path}, {start}, {end} with actual values.
Example: [UserService.ts]([link_format with path=src/services/UserService.ts, start=45, end=67])
(the seed items already include a ready-made `link` field.)
IMPORTANT: Write incrementally to folder structure.
1. Create docs/unwind/layers/[docDir]/ directory first
([docDir] = the seed file's `docDir` field, NOT the layer name)
2. Write initial index.md with skeleton sections
3. Analyze each section and write its .md file IMMEDIATELY after analyzing
4. Update index.md after each section file is written
5. Do NOT buffer all content for a single write at the end
Output folder: docs/unwind/layers/[docDir]/
- index.md (overview + links to sections)
- section files per the skill spec
Follow analysis-principles.md: completeness, machine-readable, link to
source, no commentary, anchor-id headings.
Legacy (no manifest): if seeds are unavailable, omit the "Candidate items" block and the anchor-id requirement; dispatch as an unseeded discovery task.
Parallel rules:
After application layers complete, dispatch testing specialists in parallel —
one per test seed file that exists (the scanner's single tests layer was
fanned out into per-folder seeds in Step 0; a project with only unit tests gets
only unit-tests.json). Each specialist reads its own seed and writes to the
matching folder:
- seeds/unit-tests.json → uw-analyze-unit-tests → unit-tests/
- seeds/integration-tests.json → uw-analyze-integration-tests → integration-tests/
- seeds/e2e-tests.json → uw-analyze-e2e-tests → e2e-tests/
Dispatch each using the Step 3 template, pasting that test specialist's seed (its
items are the checklist; docDir is the output folder). Skip a specialist whose
seed file is absent. Testing analysis can reference application layer docs for
coverage mapping.
Also dispatch uw-analyze-infrastructure (→ infrastructure/ folder) in this
phase — it has no layer dependencies. It documents build/dependency config,
runtime configuration, program entrypoints/bootstrap, and deploy/ops assets
(the files the scanner classifies as infrastructure). Without it the seeded
infrastructure layer is a permanent, uncloseable 0% gap.
After all layer analysis completes, run the coverage verifier. This is a
deterministic manifest − docs diff — not an LLM comparison:
node "$UNWIND_PLUGIN_ROOT/skills/scripts/verify-coverage.mjs" "$(pwd)"
It writes docs/unwind/.cache/coverage/{layer}.json (covered/total/pct, matched
by id vs fuzzy) and, for any layer with missing items, a
docs/unwind/layers/{layer}/gaps.md work list — already in the format
uw-complete consumes (name, type, location, id). The stderr
table shows per-layer coverage at a glance.
Legacy (no manifest): dispatch
unwind:uw-verifysubagents to compare docs against source and emit gaps.md the old way.
For each layer with a gaps.md, dispatch completion agents IN PARALLEL:
For each layer with gaps.md:
Task(subagent_type="general-purpose")
description: "Complete [layer] documentation gaps"
prompt: |
Use unwind:uw-complete to fix gaps in [layer].
Read docs/unwind/layers/[layer]/gaps.md for the work list.
For each missing item:
1. Read source at specified location (the gap lists file:start-end)
2. Add documentation to the correct section file using the anchor-id
heading format: ### <name> [MUST|SHOULD|DON'T] <!-- id: <id> -->
(use the gap's Id verbatim so re-verification matches)
3. If the item should NOT be in the rebuild, move it to an ## Excluded
section with a one-line reason instead of documenting it.
Delete gaps.md when complete.
Completion runs in parallel - no dependencies between layers.
Re-run verify-coverage.mjs. Repeat Steps 5-6 until every layer reports 100%
coverage (or the only remaining "missing" items are justified entries under an
## Excluded section). Because the diff is deterministic, this loop converges
and is reproducible.
When all layers reach full coverage, the analyze phase is done: layer docs are written and deterministically verified.
Use AskUserQuestion to ask whether to move on:
REBUILD-PLAN.md.Act on the choice in the same turn:
unwind:uw-plan.unwind:uw-plan (type /uw-plan) when ready."Pipeline: scan → analyze ✓ → plan → dashboard. Each phase is a separate skill; the dashboard builds its graph on demand (
uw-graphis an optional export).
layers:
database: { status: detected, dependencies: [] }
domain_model: { status: detected, dependencies: [database] }
service_layer: { status: detected, dependencies: [domain_model] }
api: { status: detected, dependencies: [service_layer] }
messaging: { status: not_detected }
frontend: { status: detected, dependencies: [api] }
Execution:
0. Seeds: seed-layers.mjs → .cache/seeds/{layer}.json (candidate checklists)
uw-analyze-database (seeded)uw-analyze-domain (seeded)uw-analyze-service (seeded)uw-analyze-api (messaging skipped) (seeded)uw-analyze-frontend (seeded)uw-analyze-unit-tests, uw-analyze-integration-tests, uw-analyze-e2e-tests (parallel, seeded)uw-analyze-infrastructure (parallel, seeded)verify-coverage.mjs → coverage + gaps.md per layeruw-complete for layers with gaps.md (parallel)This is the Update path from Step 0 (pre) — used when layer docs already exist and the user chose to update rather than restart from scratch. It is non-destructive: existing docs are kept and reconciled against the current scan.
## Changes Since Last Review to index.md## Changes Since Last Review entries)