Loading...
Loading...
End-to-end Claude Design handoff to pull request: imports a handoff bundle from claude.ai/design, generates Storybook stories and Playwright tests, runs diff-aware browser verification, and opens a PR with the bundle URL, before/after screenshots, and coverage delta embedded in the body. The one-shot 'design URL in, reviewable PR out' workflow. Use when a designer or PM hands you a Claude Design URL and you want a PR back without intermediate steps.
npx skill4agent add yonatangross/orchestkit design-ship/ork:design-ship https://claude.ai/design/abc123 # From handoff URL
/ork:design-ship /tmp/handoff-bundle.json # From local file/ork:design-importHandoff bundle (URL or file)
│
▼
┌──────────────────────────────┐
│ 1. /ork:design-import │ Scaffold components, write provenance
│ (delegates to orchestrator │ Tokens reconciled
│ for parse + dedup) │ Components written or reused
└──────────┬───────────────────┘
│
▼
┌──────────────────────────────┐
│ 2. /ork:cover │ Storybook stories per new component
│ (Storybook + Playwright) │ Playwright E2E for new routes/views
└──────────┬───────────────────┘
│
▼
┌──────────────────────────────┐
│ 3. /ork:expect │ Diff-aware browser verification
│ (CDP + ARIA-tree-first) │ Screenshots saved for PR body
└──────────┬───────────────────┘
│
▼
┌──────────────────────────────┐
│ 4. /ork:create-pr │ PR opened with:
│ │ - Claude Design URL link
│ │ - Before/after screenshots
│ │ - Component scaffold list
│ │ - Coverage delta
│ │ - Label: claude-design
└──────────┬───────────────────┘
│
▼
┌──────────────────────────────┐
│ 5. UPDATE PROVENANCE │ Patch .claude/design-handoffs/<id>.json
│ │ with the opened PR number + URL
└──────────────────────────────┘status = Bash("git status --porcelain")
if status:
AskUserQuestion(questions=[{
"question": "Working tree has uncommitted changes. How to proceed?",
"header": "Pre-flight",
"options": [
{"label": "Commit them first", "description": "Run /ork:commit, then proceed with ship"},
{"label": "Stash and restore", "description": "Stash now, restore after PR opens"},
{"label": "Include in this PR", "description": "Risky — only if changes are related"},
{"label": "Cancel", "description": "Abort design-ship"}
],
"multiSelect": False
}])
current_branch = Bash("git branch --show-current")
if current_branch in ("main", "master", "dev"):
AskUserQuestion(questions=[{
"question": f"You're on {current_branch}. Create a feature branch?",
"header": "Branch",
"options": [
{"label": "Yes — feat/design-ship-<bundle-id>", "description": "Recommended"},
{"label": "Cancel", "description": "Switch branch yourself first"}
],
"multiSelect": False
}])/ork:design-import/ork:covercomponent_paths = [c["path"] for c in import_result["components"] if c["decision"] != "reuse"]
Agent(
subagent_type="test-generator",
description="Cover the freshly-imported components",
prompt=f"""Use the cover skill to generate tests for these components (scoped — do not regenerate suites for unrelated files):
{component_paths}
Tiers needed:
- Storybook stories per component (mandatory)
- Playwright E2E if any new route was registered (check src/app or src/pages)
- Unit tests if the components include non-trivial logic (skip for pure-presentation)
"""
)/ork:expectAgent(
subagent_type="expect-agent",
description="Diff-aware verification of imported components",
prompt=f"""Use the expect skill on the current diff.
Extra: capture before/after screenshots for each new component
and save them to .claude/design-handoffs/{bundle_id}/screenshots/.
These will be uploaded to the PR body.
If verification fails, do not block — report findings and continue.
Failures will surface in the PR review.
"""
)/ork:create-prpr_body = f"""## Summary
Generated from Claude Design handoff: {bundle_url}
Bundle ID: `{bundle_id}` · Provenance: `.claude/design-handoffs/{bundle_id}.json`
## Components
| Decision | Component | Path |
|---|---|---|
{table_from(import_result['components'])}
## Tokens
- Added: {len(token_diff['added'])}
- Modified: {len(token_diff['modified'])}
- Conflicts (resolved): {len(token_diff['conflicts'])}
## Verification (`/ork:expect`)
{expect_summary}
## Coverage delta (`/ork:cover`)
{coverage_delta}
## Screenshots
{screenshot_table}
---
🤖 Opened by `/ork:design-ship` · Closes: (none — link issues manually)
"""
Bash(f"gh pr create --title '{pr_title}' --body @- <<< '{pr_body}' --label claude-design")provenance = Read(f".claude/design-handoffs/{bundle_id}.json")
provenance["pr"] = {"number": pr_number, "url": pr_url, "opened_at": now()}
Write(f".claude/design-handoffs/{bundle_id}.json", provenance)| Phase | Failure | Behavior |
|---|---|---|
| Pre-flight | Dirty tree, on main | AskUserQuestion, do not proceed silently |
| 1. Import | Schema deviation, token conflict | |
| 2. Cover | Test generation fails | Continue to expect — tests are recoverable in PR review |
| 3. Expect | Browser verification fails | Continue to PR — failures noted in PR body |
| 4. Create PR | | Stop, surface auth error |
| 5. Provenance | File not writable | Warn but do not fail (PR is already open) |
| Skill | Role |
|---|---|
| Phase 1 — scaffold components |
| Phase 2 — Storybook + Playwright |
| Phase 3 — diff-aware browser verification |
| Phase 4 — open PR with templated body |
| Provenance updates |
| Concern | Owned by |
|---|---|
| Parsing bundles | |
| Component dedup | Orchestrator agent (called by |
| Test execution (CI) | GitHub Actions — this skill only generates tests |
| Merging the PR | Human reviewer — never auto-merge |
/ork:design-ship