ワンクリックで
design
Generate system architecture, machine-readable schemas, and UI mockups. Spawns planner + generator concurrently.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Generate system architecture, machine-readable schemas, and UI mockups. Spawns planner + generator concurrently.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Discover and map an existing codebase before planning or changing it.
Change the behavior of existing code — story-driven by default, or --issue N for a GitHub bug fix. Test-first, full verification, code review.
Use when a planned change touches persisted data shape — ORM models, migration files, schema definitions, serialized formats, or message contracts — in /change, /refactor, or /implement on an existing codebase. Routes schema changes through expand-contract and proves reversibility before any deploy.
Generate production code and tests for a story group using agent teams for parallel execution.
Refactor existing code for quality, performance, or maintainability. Enforces core quality principles with ratchet gate.
Generate test plan, test cases, test data fixtures, and Playwright E2E tests mapped to acceptance criteria.
| name | design |
| description | Generate system architecture, machine-readable schemas, and UI mockups. Spawns planner + generator concurrently. |
| context | fork |
Ultracode tip: This is the most reasoning-heavy, divergent phase in the pipeline — exploring a wide space of architecture and schema alternatives. Run
/effort ultracodebefore invoking it so the design space is explored as a judge-panel of approaches, then drop back to/effort highbefore the execution phases (/auto,/implement).
/design
No arguments. Reads from specs/stories/ and produces architecture documents, machine-readable schemas, and HTML mockups concurrently.
This is the third gate in the SDLC pipeline. Two agents run concurrently in a single message: a planner agent produces system architecture and machine-readable schemas, while the generator agent produces self-contained HTML mockups. After both complete, an evaluator agent (artifact mode) validates cross-phase traceability, schema correctness, and field-shape consistency between mockups and API contracts.
specs/stories/ must exist and contain story files. If it does not, halt and tell the human to run /spec first.
Every story consumed by /design must have Readiness: ready. If any story is marked needs_breakdown, halt and ask the human to approve a breakdown pass before generating architecture artifacts.
Before spawning agents, invoke superpowers:brainstorming to explore architectural trade-offs, technology choices, and design alternatives. This prevents the planner from committing to the first viable architecture without considering alternatives. Feed the brainstorming output into the planner agent's prompt.
Invoke .claude/skills/clarify/SKILL.md only for decisions that materially affect API contracts, data models, security/privacy, external integrations, deployment topology, or file ownership.
Use the clarification budget:
CONTEXT.md, ADRs, stories, and manifest data over asking.architecture.md or api-contracts.md when risk is low.In a single message, invoke both agents using the Agent tool. Do not wait for the planner to finish before starting the generator.
Prompt:
Read all ready story files in specs/stories/ plus specs/stories/epics.md and specs/stories/dependency-graph.md. Ignore any story listed in specs/stories/backlog-needs-breakdown.md. Design the full system architecture for this project.
Write the following files to specs/design/:
architecture.md — High-level architecture overview: components, data flows, infrastructure topology, key design decisions and rationale. For every major module, describe its public interface, invariants, error modes, and why it is deep enough to justify existing as a module. Avoid pass-through modules that only forward calls.
api-contracts.md — Every API endpoint in detail: method, path, request schema (headers, params, body), response schema (success and error shapes), authentication requirements, rate limits. Use a consistent format for each endpoint.
api-contracts.schema.json — OpenAPI 3.0 JSON Schema representing all endpoints defined in api-contracts.md. Must be valid and parseable.
data-models.md — Every data entity: field names, types, constraints, relationships, indexes, and example records.
data-models.schema.json — JSON Schema (draft-07 or later) for every entity in data-models.md. Must be valid and parseable.
folder-structure.md — Full proposed directory tree for the implementation, with a one-line annotation for each directory explaining its purpose.
component-map.md — A table mapping every ready story ID (from specs/stories/) to the specific files that will be created or modified to implement it. Include
Produces:andConsumes:notes for cross-story interfaces, and identify the owning story for every shared file.deployment.md — Deployment architecture: environments (dev/staging/prod), CI/CD pipeline steps, infrastructure-as-code approach, secrets management strategy, rollback procedure.
Spawn the generator agent for the mockup step, pointed at .claude/skills/design/references/ui-mockups.md for the full self-contained-HTML / CDN-React+Tailwind / aesthetic / data-fidelity guidance.
Prompt:
Read
.claude/skills/design/references/ui-mockups.md, then read all ready story files in specs/stories/ and specs/design/api-contracts.md (if it exists; wait or proceed with story context if not yet available).For every story with layer "UI", create a self-contained HTML mockup:
- The mockup must be a single .html file with all CSS and JavaScript inlined (no external dependencies).
- Use realistic mock data that matches the field names and types defined in api-contracts.md.
- Show the primary happy-path state. Include at least one empty/error state as a toggle or commented section.
- Label each interactive element with its API call (e.g., "POST /api/auth/register").
- The filename must match the story ID: E{n}-S{n}.html
Write all mockups to specs/design/mockups/.
specs/stories/story-traces.json exists]After both agents complete, write specs/design/design-traces.json — one entry per design component (module/service/endpoint group from component-map.md), each tracing to the story ids it realizes:
[
{ "id": "auth-service", "text": "Registration + login endpoints", "traces": ["E1-S1", "E1-S2"] },
{ "id": "user-repository", "text": "User persistence", "traces": ["E1-S1"] }
]
Every component must trace to at least one story. A component realizing no story is scope creep or dead design; a story with no component will never be built. Prove it deterministically (when the spec emitted a trace spine):
node .claude/scripts/trace-check.js \
--required specs/stories/story-traces.json \
--downstream specs/design/design-traces.json \
--layer design \
--out specs/reviews/design-grounding.json
specs/reviews/design-grounding.json is a hard gate independent of the rubric: any net_new (component tracing to no story) or dropped (story no component realizes) blocks. Resolve before Step 2. (Skip when story-traces.json does not exist.)
After both agents (planner + generator) complete, spawn the evaluator agent (artifact mode). This replaces and extends the previous field-shape validation.
Agent invocation:
Spawn Agent with subagent_type="evaluator" and prompt:
Ratchet loop (max 3 iterations):
| Artifact | Purpose |
|---|---|
api-contracts.schema.json | OpenAPI 3.0 schema — machine-readable by the evaluator for contract testing |
data-models.schema.json | JSON Schema — used by builder agents to generate type-safe code |
component-map.md | Maps stories to implementation files — used by builder agents for routing |
The .schema.json files enable automated validation in later pipeline stages (the evaluator validates contracts and shapes against them).
| File | Purpose |
|---|---|
specs/design/architecture.md | Architecture overview |
specs/design/api-contracts.md | Human-readable API contracts |
specs/design/api-contracts.schema.json | OpenAPI 3.0 machine-readable schema |
specs/design/data-models.md | Human-readable data model definitions |
specs/design/data-models.schema.json | JSON Schema for all data entities |
specs/design/folder-structure.md | Proposed directory tree with annotations |
specs/design/component-map.md | Story ID → implementation files mapping |
specs/design/design-traces.json | Trace spine: each component → story id(s) |
specs/reviews/design-grounding.json | (when story-traces exists) deterministic story-coverage verdict |
specs/design/deployment.md | Deployment architecture and CI/CD plan |
specs/design/mockups/E{n}-S{n}.html | One self-contained HTML mockup per UI story |
Phase evaluation gate runs before human approval. The evaluator agent (artifact mode) validates:
Human approval is required before proceeding to /auto.
After presenting all artifacts and validation results, ask: "Does this architecture and these mockups look correct? Approve to proceed to /auto, or provide corrections."
/autois the next step in the greenfield path (/brd→/spec→/design→/auto)./buildis the wrapper that runs the whole pipeline starting from a BRD path; it is not intended to be invoked mid-pipeline after/designhas already been approved.
user_name field but the API contract defines username, the downstream evaluator will flag a mismatch.folder-structure.md and component-map.md are the routing instructions for the build phase. Missing or vague entries cause agents to create files in wrong locations.needs_breakdown stories are product-planning backlog, not implementation input.component-map.md needs one owner. When multiple stories need a shared file, mark one story as owner and list the others under Consumes: or Declares additions:..schema.json files before presenting for human review.