feat(workflows): add open-claude-design builtin workflow - #667
Conversation
Implements the open-claude-design workflow with a 5-stage pipeline (design-system-builder, design-generator, design-refiner, validation, design-exporter) that orchestrates Claude sub-agents to produce HTML/CSS/JS design artifacts from natural language prompts. Includes agent definitions, helper modules (prompts, design-system, validation, handoff, export, web-capture), tests, spec, and research.
There was a problem hiding this comment.
Pull request overview
Adds a new built-in workflow (open-claude-design) to the workflow SDK, implementing a multi-stage Claude-orchestrated design pipeline that generates and refines HTML/CSS/JS artifacts and exports a handoff bundle.
Changes:
- Introduces core workflow orchestration for
open-claude-design(Claude provider) including onboarding, import, generation, refinement loop, and export/handoff. - Adds helper modules for reference classification, validation parsing/formatting, design system persistence, export directory management, and deterministic handoff bundle packaging.
- Adds extensive Bun unit tests plus supporting spec + research documentation and new Claude agent definitions.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/sdk/workflows/builtin/open-claude-design/helpers/web-capture.ts | Reference classification helpers (URL/file/codebase) and standard viewports. |
| src/sdk/workflows/builtin/open-claude-design/helpers/web-capture.test.ts | Unit tests for reference classification + viewport sizes. |
| src/sdk/workflows/builtin/open-claude-design/helpers/validation.ts | Refinement decision parsing + critique/screenshot parsing + summary formatting. |
| src/sdk/workflows/builtin/open-claude-design/helpers/validation.test.ts | Unit tests for refinement decision parsing and validation merging/formatting. |
| src/sdk/workflows/builtin/open-claude-design/helpers/prompts.test.ts | Prompt-builder test coverage (strings contain expected sections/constraints). |
| src/sdk/workflows/builtin/open-claude-design/helpers/handoff.ts | Deterministic packaging of a Claude Code handoff bundle from design outputs. |
| src/sdk/workflows/builtin/open-claude-design/helpers/handoff.test.ts | Tests for handoff bundle structure, file writing, and sensitive file exclusion. |
| src/sdk/workflows/builtin/open-claude-design/helpers/export.ts | Timestamped output/export dir helpers + recursive copy with sensitive filtering. |
| src/sdk/workflows/builtin/open-claude-design/helpers/export.test.ts | Tests for timestamps, dir creation, filtering, and recursive copy behavior. |
| src/sdk/workflows/builtin/open-claude-design/helpers/design-system.ts | Design system type/validation + load/persist logic to JSON on disk. |
| src/sdk/workflows/builtin/open-claude-design/helpers/design-system.test.ts | Tests for default DS, validation guard, persistence, and loading behavior. |
| src/sdk/workflows/builtin/open-claude-design/claude/index.ts | Main workflow orchestration implementing the 5-stage pipeline + refinement loop. |
| src/sdk/workflows/builtin/open-claude-design/claude/index.test.ts | Lightweight definition-shape tests for the compiled workflow export. |
| specs/2026-04-17-open-claude-design.md | RFC/spec documenting architecture, phases, directory layout, and goals. |
| research/web/2026-04-17-claude-design-anthropic-labs.md | Source collection on Claude Design announcement/coverage. |
| research/docs/2026-04-17-open-claude-design.md | Research mapping Claude Design phases to Atomic SDK primitives. |
| research/docs/2026-04-17-claude-design-product-analysis.md | Product analysis of Claude Design phases/capabilities for reference. |
| .claude/agents/design-system-builder.md | New Claude agent definition for DS onboarding + user approval flow. |
| .claude/agents/design-refiner.md | New Claude agent definition for iterative refinement + AskUserQuestion enforcement. |
| .claude/agents/design-generator.md | New Claude agent definition for initial artifact generation (HTML/CSS/JS). |
| .claude/agents/design-exporter.md | New Claude agent definition for producing export/handoff documentation sections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { test, expect, describe, beforeEach, afterEach } from "bun:test"; | ||
| import { mkdtemp, rm, readdir, stat } from "node:fs/promises"; | ||
| import path from "node:path"; | ||
| import { tmpdir } from "node:os"; | ||
|
|
||
| import { | ||
| packageHandoffBundle, | ||
| generateHandoffPrompt, | ||
| extractSection, | ||
| isSensitiveFile, | ||
| HANDOFF_DIR_NAME, | ||
| HANDOFF_SUBDIRS, | ||
| HANDOFF_FILES, | ||
| type PackageHandoffOptions, | ||
| } from "./handoff"; |
There was a problem hiding this comment.
Unused imports in this test file (e.g., readdir, and PackageHandoffOptions) will trigger lint warnings. Remove unused imports or use them in assertions to keep the test suite clean.
| test("creates a new directory", async () => { | ||
| const newDir = path.join(TMP_DIR, "new-dir"); | ||
| await ensureDir(newDir); | ||
| const stat = await Bun.file(newDir).exists(); |
There was a problem hiding this comment.
This test creates const stat = await Bun.file(newDir).exists(); but never uses it. That unused variable will raise a lint warning; either assert on it (e.g., expect(stat).toBe(true)) or remove it.
| const stat = await Bun.file(newDir).exists(); |
| import type { | ||
| FindingSeverity, | ||
| ValidationFinding, | ||
| ValidationSummary, | ||
| SessionMessageLike, | ||
| } from "./validation.ts"; |
There was a problem hiding this comment.
FindingSeverity is imported but not used in this test file, which will cause a lint warning. Remove the unused type import (or add coverage that uses it).
| // If we reach here, the agent did NOT call AskUserQuestion. Log a warning | ||
| // so this failure mode is visible in workflow logs. | ||
| console.warn( | ||
| "[open-claude-design] WARNING: AskUserQuestion tool was not called during " + | ||
| "refinement. Falling back to JSON/regex extraction from agent text. " + | ||
| "The user was NOT prompted for input.", | ||
| ); |
There was a problem hiding this comment.
parseRefinementDecision logs via console.warn(...), but this module-level header and multiple docstrings claim all functions are pure (no side effects). Either remove the logging (or inject a logger callback) so the helpers remain pure, or update the docs to reflect the side effect (and consider gating it behind an explicit debug flag).
| // If we reach here, the agent did NOT call AskUserQuestion. Log a warning | |
| // so this failure mode is visible in workflow logs. | |
| console.warn( | |
| "[open-claude-design] WARNING: AskUserQuestion tool was not called during " + | |
| "refinement. Falling back to JSON/regex extraction from agent text. " + | |
| "The user was NOT prompted for input.", | |
| ); | |
| // If AskUserQuestion was not called, fall back to parsing the agent text. |
| typeof typography.scale !== "object" || | ||
| Array.isArray(typography.scale) | ||
| ) return false; | ||
|
|
There was a problem hiding this comment.
validateDesignSystem() checks that typography.fontFamily and typography.scale are objects, but it never validates required nested keys/types (e.g. fontFamily.heading/body and scale.h1/h2/body/small as strings). As a result, malformed design systems can pass validation and later produce undefined values in prompts/handoff output. Tighten the guard to verify the required nested fields are present and strings (matching the function docstring).
| const fontFamily = typography.fontFamily as Record<string, unknown>; | |
| if ( | |
| typeof fontFamily.heading !== "string" || | |
| typeof fontFamily.body !== "string" | |
| ) return false; | |
| const scale = typography.scale as Record<string, unknown>; | |
| if ( | |
| typeof scale.h1 !== "string" || | |
| typeof scale.h2 !== "string" || | |
| typeof scale.body !== "string" || | |
| typeof scale.small !== "string" | |
| ) return false; |
| if (refType === "url") { | ||
| const r = await ctx.stage( | ||
| { | ||
| name: "web-capture", | ||
| headless: true, | ||
| description: | ||
| "Capture website design context via playwright-cli (codebase-online-researcher)", | ||
| }, | ||
| {}, | ||
| {}, | ||
| async (s) => { | ||
| const result = await s.session.query( | ||
| buildWebCapturePrompt(reference), | ||
| { agent: "codebase-online-researcher", ...SUBAGENT_OPTS }, | ||
| ); | ||
| s.save(s.sessionId); | ||
| return extractAssistantText(result, 0); | ||
| }, |
There was a problem hiding this comment.
classifyReference() treats bare www. strings as a URL, but the workflow passes reference through to playwright-cli unchanged. Playwright navigation typically requires a scheme; www.example.com will fail in many cases. Consider normalizing URL references (e.g., prefix https:// when the ref starts with www.) before calling buildWebCapturePrompt() / launching capture.
Code Review —
|
Remove the open-claude-design workflow implementation, helper modules, tests, and associated agent definitions added in cbe81ff. Assistant-model: Claude Code
Review: PR #667 —
|
| File | +lines |
|---|---|
research/docs/2026-04-17-claude-design-product-analysis.md |
519 |
research/docs/2026-04-17-open-claude-design.md |
589 |
research/web/2026-04-17-claude-design-anthropic-labs.md |
269 |
specs/2026-04-17-open-claude-design.md |
875 |
No TypeScript, no agent definitions, no tests. The feat(workflow): Conventional Commits prefix is misleading for what is effectively a spec + research PR. Suggested actions:
- Retitle to
docs(spec): open-claude-design RFC and research(or similar), or - Push the implementation commits that the description refers to before merging.
A reviewer pulling this branch expecting to exercise the workflow will hit nothing. This also affects CI signal — none of the implementation claims (bun lint, bun typecheck, bun test coverage for the helpers) can actually be verified from this diff.
2. Quality of the docs themselves
Taking the PR as a docs/spec PR, content quality is high:
- Source attribution is solid — frontmatter in the research docs correctly separates
primary_source,raw_research,additional_sources. The raw web collection (research/web/...) is kept distinct from the synthesized analysis inresearch/docs/..., which matches the project'sresearch-codebaseskill convention. - Cross-references resolve — spec links to
../research/docs/...fromspecs/are correct relative paths. - SDK mapping is grounded — Part 2 and Part 3 of
research/docs/2026-04-17-open-claude-design.mdcite concrete files and line ranges (src/sdk/define-workflow.ts:186-195,ralph/claude/index.ts:54-248, etc.), which is the right level of specificity for a planning doc. - Non-goals are explicit (NG1–NG7 in the spec). That's the part of an RFC that's most often missing.
3. Internal inconsistencies in the spec
A few things a future implementer will stumble on:
design-exporteragent is referenced but not declared. Section 5.8 spawns a visible stage withchatFlags: [\"--agent\", \"design-exporter\", ...], but Section 5.11 ("Agent Definitions") lists only three new agents:design-system-builder,design-generator,design-refiner. Either adddesign-exporter.mdto 5.11, or rewrite 5.8 to use an existing agent (e.g.worker) with a skill-loaded prompt. The PR description lists four agents includingdesign-exporter.md, so 5.11 is likely the one that's wrong.- Refinement exit condition contradicts itself. Section 5.7 code snippet checks
if (isRefinementComplete(refine.result)) break;— i.e. parses the assistant's text for a completion signal. A few paragraphs later, the "Exit condition (viaAskUserQuestion)" subsection says the exit is an explicitAskUserQuestionwith three options (Approve / Continue / Start over). Section 9 (Q2 Resolved) confirms the intent is the latter — so the code snippet in 5.7 should be updated to show theaskUserQuestion(...)call instead of the text-parsing helper, otherwise an implementer will keep buildingisRefinementComplete()and drift away from the resolved decision. - Design system lifecycle is ambiguous. Section 5.1 shows a single
.open-claude-design/design-system.json(shared across runs) butoutput-<timestamp>/+export-<timestamp>/(per-run). Explicitly state: "design system JSON is a singleton that survives across runs; re-runs may update it via the onboarding stage" (or whatever the intent is). Also spell out whether the timestamped output dirs are ever garbage-collected — otherwise.open-claude-design/will grow unbounded. output-typeenum drift. The research doc lists[\"prototype\", \"wireframe\", \"deck\", \"collateral\", \"frontier\"]. The spec (5.2) lists[\"prototype\", \"wireframe\", \"mockup\", \"landing-page\"]. Pick one; the research doc's "deck / collateral / frontier" values are more faithful to Claude Design's product, but several are in NG (Non-Goals), so pruning makes sense — just make the two docs agree.- Reused agent
codebase-online-researchertool surface. 5.11 says it handles "Web capture via playwright; screenshot validation." Before implementation, confirm this agent actually has theplaywright-cliskill or Bash(playwright-cli:*) permission in its current definition — otherwise Phase 2 URL capture and Phase 4 screenshot validation will silently degrade to text-only.
4. Risks and open questions worth flagging before implementation
MAX_REFINEMENTS = 8with a visible HIL stage per iteration + parallel headless critique + screenshot per iteration. That's up to 8 × 3 = 24 stages and ~8 tmux windows in one run. Worth confirmingGraphFrontierTrackerhandles this and that the TUI graph panel stays readable. Ralph caps at 10 but isn't generally run to its limit.--allow-dangerously-skip-permissions+--dangerously-skip-permissionsboth appear inSKIP_PERMS. One is presumably a typo/alias — double-check againstdocs/claude-code/cli/permissions.mdbefore shipping.- CLAUDE.md rule: "Avoid ambiguous types like
anyandunknown." The snippets useDesignSystemContextandImportContextbut never define them in the spec. Section 5.4 hints at a JSON shape; please inline the full TS interface (or point to where it will live) so the type contract is reviewable before code lands. - Privacy claim vs. reality. 7.1 says "Source code is never uploaded to external servers." That's true for the headless in-process Agent SDK path, but visible stages invoke the Claude Code CLI which does send content to Anthropic. Consider rewording to "no data leaves the normal Claude provider path" to avoid an overclaim that Anthropic Trust & Safety would flag.
- Handoff bundle & sensitive files. 7.1 says the export helper "explicitly filters"
.env/credentials. Nail down the filter list (glob of denied patterns) in the spec — if this lives only in code it's easy to accidentally ship a permissive version.
5. Minor polish
- The
research_atdate, thegit_commitinresearch/docs/2026-04-17-open-claude-design.md, and thelast_updatedfield are all fine for a research artifact, but consider whethergit_commit: 200d34dc...(pre-branch) is worth keeping — it will be stale the moment this PR rebases. specs/2026-04-17-open-claude-design.mdSection 5.3 has a duplicate rendering of the "┌─→ web-capture..." ASCII diagram (same diagram appears in 4.1 as Mermaid and again in 5.3 as ASCII). Keep one canonical source.
Recommendation
- Blocking: Split or relabel this PR. As-is, the
feat(...)commit message will land onmainand futuregit log --grep=workflow/ release-note generation will claim a workflow was shipped when only the RFC was. Either push the implementation commits the description refers to, or re-title todocs(spec):and open the implementation as a follow-up PR that references this spec. - Non-blocking: Fix the internal inconsistencies in Section 3 above (design-exporter agent, refinement exit snippet, output-type enum, directory lifecycle). These will save the implementer a round-trip.
The research and spec work themselves are in good shape — just the packaging of this PR needs adjusting.
Removes the technical design document for the open-claude-design workflow, which was reverted in the previous commit (70b0232). Assistant-model: Claude Code
Code Review — PR #667Thanks for putting this up! Capturing the research and RFC as standalone artifacts before the implementation lands is the right call. Comments below, scoped to a docs-only PR (no code = no perf/security concerns; test coverage N/A). Blocking / should-fix1. PR description references a file that isn't in the diff.
This matters because the 2. RFC references skills that don't exist in
Anyone reading this as an implementation guide will hit the wall immediately. Please either correct these to skills that exist (e.g., Non-blocking suggestions3. Frontmatter inconsistency across the three files.
For 4. Cross-reference prior overlapping research. 5. Capture the why of the implementation revert. 6. 7. Minor accuracy nits in code references.
What's good
SummarySolid research + RFC content. Two things to fix before merge: (1) reconcile the missing |
Introduces the open-claude-design workflow — an open-source replica of Anthropic's Claude Design product — built on the Atomic workflow SDK. Orchestrates the existing design skill ecosystem (impeccable, critique, shape, polish, audit, etc.) into a deterministic 5-phase pipeline: Design System Onboarding → Import → Generation → Refinement Loop → Export/Handoff. Includes implementations for Claude, Copilot, and OpenCode agents, plus shared helpers for design system persistence, import/export, validation, and prompt templates. Also adds the companion RFC spec document. Assistant-model: Claude Code
Code Review — PR #667Thanks for the thorough research on Claude Design. I reviewed both the research docs and the workflow implementation. The research artifacts are high-quality and well-sourced. The implementation has some concrete issues worth addressing before this lands. PR Description vs. Diff MismatchThe PR body states "The implementation and spec were added in this branch and subsequently reverted. Only the research artifacts remain…", but the diff clearly includes:
Totals: 3,961 additions across 13 files, roughly 40% implementation/spec and 60% research. Please either update the description to reflect what's actually in the diff, or split off the implementation into a separate PR as the description suggests. Blockers (likely behavioral bugs)1. The completion signals include bare words like In practice the loop never iterates. Suggested fix: require a stricter sentinel (e.g., the agent writes a JSON marker like 2. Visible stages pass
3. Visible stages don't set 4. Reliability / Error Handling5. 6. Handoff bundle silently incomplete on exporter failure. 7. No existence check on Code Quality8. 9. 10. Regex-via-string-flag in 11. 12. Scratch directory inside 13. Dynamic import of 14. 15. Stub files duplicate the full inputs block. Security16. Web-capture + file-parser pipe untrusted content into downstream prompts. Expected for this use case, but worth a comment in 17. Testing18. Zero test coverage on pure helpers. SummaryThe research is solid work and worth landing. The implementation has a probable refinement-loop-never-runs bug (#1), several cases where config is declared but not wired (#2, #3, #4), and no tests. Suggested path forward:
Happy to dive deeper on any of these if useful. |
Code Review —
|
Reorder the refine feedback prompt so the iteration summary and preview reminder render as plaintext before any ToolSearch/AskUserQuestion invocation, ensuring the user sees progress before being asked to choose how to proceed. Assistant-model: Claude Code
Register a Stop hook that invokes `atomic _claude-stop-hook` so the harness can react when Claude Code finishes a turn. Expand the .mcp.json github headers block onto multiple lines for readability. Assistant-model: Claude Code
|
PR Review: feat(workflow): add open-claude-design builtin workflow Reviewed the full workflow (claude/index.ts, all helpers, stubs, constants, and prompts) against CLAUDE.md conventions and the existing deep-research-codebase pattern. Overall the topology and SDK-primitive usage are solid and consistent with existing builtins. A few items to address before merge. HIGH PRIORITY 1. isRefinementComplete completion detection is too permissive (helpers/validation.ts) The COMPLETION_SIGNALS list contains bare substrings like done, export, approved. These produce false positives on natural phrases the user is likely to say in the feedback stage: (not done yet), (do not export yet), (have not approved it) all match. Since the feedback stage is exactly where users will naturally mention these words, the refinement loop is likely to exit after iteration 1 in common cases. Consider either:
2. MAX_REFINEMENTS inconsistency
Pick one. If 5 is intentional, update the description and the topology comment. 3. npx in buildCritiquePrompt violates CLAUDE.md Bun-only rule The critique prompt emits: npx impeccable --json . CLAUDE.md has an EXTREMELY_IMPORTANT block forbidding npx — use bunx impeccable --json ... instead. Separately, there is no impeccable CLI binary in the repo (only .agents/skills/impeccable/ docs plus a cleanup script), so this command will always fall through to the scanner not available path. Either remove the scanner branch or wire up a real binary. 4. No tests in the final diff The first commit of this branch added ~2,000 lines of unit tests for the pure helpers (design-system.test.ts, export.test.ts, handoff.test.ts, prompts.test.ts, validation.test.ts, web-capture.test.ts, claude/index.test.ts). A later revert dropped them and they were not restored. CLAUDE.md explicitly instructs contributors to write tests with bun test. At minimum, the pure functions should have coverage — they all have deterministic inputs/outputs and are the easiest kind to test:
MEDIUM 5. isFilePath heuristic silently drops valid references (helpers/import.ts:28-34) The extension-detecting regex mis-classifies prompts like (notes about v1.2) as a file path. Conversely, codebase paths like src/components (no leading ./~ and no extension) return false for both isUrl and isFilePath, so the Import phase does nothing — despite the input description advertising URL, file path, or codebase path to import as design reference. Either narrow the input description or add a codebase-reference branch. 6. persistDesignSystem has no fallback when the builder agent does not write Design.md If HIL is cancelled, the tool budget is exhausted, or the agent drifts, readFile(designPath) throws ENOENT and aborts the whole workflow with an unhelpful error. Consider catching ENOENT and surfacing a workflow-specific message (design system builder did not produce Design.md — rerun with --design-system= or re-approve via HIL), and/or persisting the transcript as a fallback source so the error points at what the agent actually produced. 7. .claude/settings.json flips repo-wide permission posture skipDangerousModePermissionPrompt: true plus permissions.defaultMode: bypassPermissions means every Claude Code user opening this repo now inherits bypass-permissions by default. That may be intentional for a workflow-heavy repo, but it is a non-local security change bundled inside a feature PR. Worth calling out explicitly in the description and getting a second review from whoever owns the project security posture. 8. ensureScratchDir uses a dynamic import of an already-statically-imported module (helpers/design-system.ts:83-88) readFile from node:fs/promises is statically imported at the top of the file. Just add mkdir to the existing import line instead of await import(...). 9. Output-directory collisions finalDesignDir = isoDate-slug can collide across runs on the same day with similar prompts (the slug is capped at 6 words / 60 chars). deep-research-codebase disambiguates with startedAt.getTime(). Consider the same here so repeated runs do not silently overwrite. LOW / NITS 10. HEADLESS_OPTS sets both permissionMode: bypassPermissions and allowDangerouslySkipPermissions: true. deep-research-codebase SUBAGENT_OPTS sets the same pair — consistent, but worth hoisting to a single shared constant in the SDK rather than duplicating per-workflow. 11. DESIGNS_DIR is exported from constants.ts but ensureScratchDir hardcodes research/designs and .scratch rather than composing them from constants. 12. buildReadme in helpers/export.ts emits a claude CLI invocation as the suggested handoff command. claude is not guaranteed on PATH for bundle consumers; consider a tool-agnostic phrasing or at least a Prerequisites: Claude Code CLI installed note. 13. copilot/index.ts and opencode/index.ts are throwing stubs. If the workflow registry can expose not yet supported for agent X at listing time, this is a nicer UX than a runtime throw after the user has already supplied inputs. 14. The PR bundles ~2,200 lines of research/spec docs (research/docs/, specs/). These are genuinely useful but make the diff harder to review. Splitting them into a docs-only PR is a common pattern that would let reviewers focus on the workflow itself. WORKS WELL
Happy to look at a revision once the high-priority items are addressed — especially the isRefinementComplete tightening and restoring the pure-function tests. |
Code Review —
|
Export phase now emits output-type-specific assets: prototype ships a zero-dependency Bun static-file server with a start script, component ships an isolated copy-paste snippet, and page/wireframe stay as plain HTML. README and component-specs guidance adjust to match, and the AskUserQuestion export-mode prompt is removed since the type is already chosen at workflow invocation. Assistant-model: Claude Code
Code Review:
|
Review —
|
Code Review —
|
Replace the stub with a full 5-phase pipeline (design system onboarding, import, generation, refinement loop, export) mirroring the Claude reference implementation. Uses Copilot-native sub-agent dispatch via sessionOpts.agent and a getAssistantText() helper to handle empty trailing tool-call turns. Assistant-model: Claude Code
Review —
|
PR Review —
|
…e-design Inline the canonical impeccable absolute bans, reflex fonts, and DON'Ts directly into generation, refinement, and critique prompts so the rules are authoritative even if the /impeccable skill fails to load. Run the `impeccable detect --json` CLI after each refinement iteration to surface banned anti-patterns to apply-changes, and add a pre-export forced-fix stage that blocks handoff until every finding is removed. Assistant-model: Claude Code
Code Review —
|
Summary
Adds
open-claude-designas a built-in Atomic CLI workflow — an open-source replica of Anthropic's Claude Design product (launched April 17, 2026). Orchestrates the existing design skill ecosystem (impeccable,critique,shape,polish,audit, etc.) into a deterministic 5-phase pipeline via the Claude Agent SDK using a hybrid fan-out + bounded iterative loop topology.Key Changes
Workflow (
src/sdk/workflows/builtin/open-claude-design/)claude/index.ts— Full 5-phase workflow driven by the Claude Agent SDK:ds-locator,ds-analyzer,ds-patterns) + HIL approval viadesign-system-builder; persists tokens toDesign.mdweb-capture,file-parser)critique+screenshotsub-agents andapply-changes; exits early on completion signal phrases ("approved","ship it","done", etc.)handoff-prompt.md,README.md,design-intent.md,component-specs.md); export assets tailored tooutput-typecopilot/index.ts— Full Copilot provider implementation of the same 5-phase pipeline; handles Copilot-specific concerns: fresh session per stage (F5), empty assistant turn on tool-call exit (F1), andSessionEvent[]message retrieval (F9)opencode/index.ts— OpenCode adapter stub for future supporthelpers/constants.ts— Shared constants:MAX_REFINEMENTS=5,DESIGNS_DIR, headless (claude-sonnet) vs. visible (inherits Opus) agent options, impeccable design bans,IMPECCABLE_SCAN_CMDhelpers/design-system.ts— Design system persistence: load/saveDesign.md, token extraction, slugified scratch directorieshelpers/export.ts— Deterministic handoff bundle generation; LLM exporter stage handles design-content-aware files; adapts output tooutput-type(prototype/wireframe/page/component)helpers/import.ts— URL/file reference aggregation for the Import phasehelpers/prompts.ts— System prompts for all phase agents across all providershelpers/scan.ts— Deterministic impeccable scan gate: runsimpeccable detect --jsonagainst the design directory and returns structuredScanFinding[]; findings are surfaced to theapply-changesstage to fix banned anti-patterns alongside user feedback; gracefully degrades when CLI is unavailablehelpers/validation.ts— Refinement-complete detection via completion signal phrases (regex + substring matching)Research & Spec
specs/2026-04-17-open-claude-design.md— RFC: architecture decisions, goals, phase-by-phase specresearch/docs/2026-04-17-open-claude-design.md— SDK mapping: existing Atomic primitives cover ~70% of required capabilitiesresearch/docs/2026-04-17-claude-design-product-analysis.md— Product analysis of Anthropic's Claude Design (6-phase pipeline, capabilities, target users)research/web/2026-04-17-claude-design-anthropic-labs.md— Raw primary sources from the Anthropic Labs announcementArchitecture
ds-locator,ds-analyzer,ds-patterns,design-system-builderweb-capture,file-parsergeneratoruser-feedback,critique,apply-changesexporterHeadless stages use
claude-sonnetwithbypassPermissionsfor cost efficiency and unattended operation; visible/creative stages inherit the orchestrator model (Opus). The impeccable scan gate runs deterministically (no LLM call) each refinement iteration, grouping findings by anti-pattern and injecting them into theapply-changesprompt.Usage
Inputs
promptreferenceoutput-typeprototype(default),wireframe,page,componentdesign-systemDesign.md— skips onboarding if provided