From solid-coder
Analyze existing code and produce a rewrite spec with subtasks — extracts functionalities as user stories, builds integration map, interviews about target state.
How this skill is triggered — by the user, by Claude, or both
Slash command
/solid-coder:build-spec-from-code <file-or-directory-path><file-or-directory-path>This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyzes existing code and produces a rewrite spec. Extracts functionalities as user stories with edge cases and acceptance criteria. For UI code: requests screenshots/designs, extracts colors, fonts, spacing. For non-UI code: captures API contracts, performance constraints, threading model. Builds an integration map of consumers, dependencies, and connection points.
Analyzes existing code and produces a rewrite spec. Extracts functionalities as user stories with edge cases and acceptance criteria. For UI code: requests screenshots/designs, extracts colors, fonts, spacing. For non-UI code: captures API contracts, performance constraints, threading model. Builds an integration map of consumers, dependencies, and connection points.
AskUserQuestion steps — all other steps run to completion without stopping.[default].other: <describe>).$ARGUMENTS — extract file paths or directory path. If no argument provided, fail with: "Usage: /build-spec-from-code <file-or-directory-path>"code_context.1.1 Extract functionalities as user stories — read the code and identify what it does (not how it's structured):
As a [user], I want [goal] so that [reason]As the system, when [trigger], [outcome]1.2 Build integration map — extract how the code connects to the rest of the codebase:
1.3 Generate diagrams — treat the current component as a black box. The component is a single opaque node. Diagrams show ONLY what crosses the boundary.
1.4 Detect mixed concerns — if the code has multiple unrelated responsibilities, note them. These may become separate rewrite specs.
2.1 Present extracted user stories to the user. Ask using AskUserQuestion: "Here's what the code does. Confirm, adjust, or add stories?"
2.2 Present generated diagrams. Ask using AskUserQuestion: "Here's how the code works. Keep, revise, or describe what to change?"
2.3 Present integration map summary: "Found N consumers, M dependencies, K integration points." If mixed concerns detected, ask: "This code has multiple unrelated responsibilities. Should we create one rewrite spec or split into multiple?"
3.1 UI requirements — if code includes UI elements, request design or screenshots for every UI element you need using AskUserQuestion.
3.2 What to keep vs change — ask using AskUserQuestion: "What should stay the same and what needs to change? Think about: behaviors to preserve, pain points to fix, patterns to adopt or drop." Free-text.
3.3 Subtask decision — if consumers were found in Phase 1.2, present them and ask using AskUserQuestion:
Found N consumers of this code's public APIs:
<list top consumers>
Which subtasks do you need?
1. Rebuild only (consumers handle their own migration)
2. Rebuild + bridge (adapter between old and new interface)
3. Rebuild + bridge + migrate consumers
If no consumers found, default to rebuild only.
4.1 Where does it belong? — use skill solid-coder:find-spec with --status draft,ready --action Select as parent. Returns selected spec. Store as parent_spec (or none if root).
4.2 "Give it a short title." — ask using AskUserQuestion free-text only. This becomes the epic slug.
4.3 Get next spec number — use skill solid-coder:find-spec with next-number. Store as parent_number.
${CLAUDE_PLUGIN_ROOT}/spec-driven-development/specs/:
README.md — common frontmatter fields, section rulesepic/rule.md — used for the parent rewrite specfeature/rule.md — used for the rebuild/bridge/migrate scaffoldsFollow epic/rule.md. Frontmatter requires mode: rewrite. Populate sections:
## Description — what this rewrite achieves## User Stories — confirmed/adjusted stories from Phase 2.1 describing the TARGET behavior (carried forward from existing code's functionalities)## Current State — summary from Phase 1 (types, responsibilities, integration map). Snapshot for reference, not a target.## Technical Requirements — boundary/external constraints only. UI code: colors, fonts, spacing, padding, design file/screenshot links. Non-UI: API contracts, performance constraints, threading model, platform requirements. Do NOT carry forward internal implementation details — capture the underlying need, not the concrete type that currently provides it.## Diagrams — current state diagrams from Phase 1.3 + target state diagrams generated from interview answers## Connects To — from integration map## Definition of Done — verifiable checklistFollow feature/rule.md frontmatter. Scaffold-only — full body deferred to /build-spec later.
number (next from find-spec), feature, type: feature, status: draft, mode: rewrite, parent: <parent_number>, blocked-by: [], blocking: []Follow feature/rule.md frontmatter. No mode: rewrite — runs normal /implement (validator finds both old and new types).
number (next from find-spec), feature, type: feature, status: draft, parent: <parent_number>, blocked-by: [<rebuild_number>], blocking: []Follow feature/rule.md frontmatter. No mode: rewrite. User stories describe updating consumers to use the new interface directly (removing the bridge).
number (next from find-spec), feature, type: feature, status: draft, parent: <parent_number>, blocked-by: [<bridge_number>], blocking: []Use skill solid-coder:validate-spec with --interactive on each generated spec.
1. Yes, write all specs
2. Needs changes
python3 ${CLAUDE_PLUGIN_ROOT}/skills/build-spec/scripts/build-spec-query.py resolve-path feature <SPEC-NNN> <slug> [--parent <parent-SPEC-NNN>]
If non-zero exit: stop and report error.Spec.md + empty resources/ directory at the resolved path. The parent folder must exist before subtask paths can be resolved.python3 ${CLAUDE_PLUGIN_ROOT}/skills/build-spec/scripts/build-spec-query.py resolve-path subtask <SPEC-NNN> <slug> --parent <parent-SPEC-NNN>
resources/ directory alongside each.build-spec-query.py for path resolution — do NOT inline path logic.status: ready.blocked-by entries are permanent — never remove them.build-spec-query.py call exits non-zero, report and stop.npx claudepluginhub swift-gurus/solid-coderGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.