一键导入
parallel-orchestration
Concurrent phase runner that dispatches independent pipeline phases in parallel, respecting dependency graphs and resource constraints
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Concurrent phase runner that dispatches independent pipeline phases in parallel, respecting dependency graphs and resource constraints
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Orchestrates end-to-end Figma-to-React conversion pipeline with enforced TDD, automated pixel-diff visual QA, E2E testing, and app-type awareness (web apps, Chrome extensions, PWAs). Keywords: Figma to React, design tokens, autonomous component generation, Figma conversion, Tailwind config, component library, TDD, E2E, pixel-perfect
Automated visual QA with pixel-level diff comparison, iterative fix loop, and cross-browser verification. Uses pixelmatch for programmatic screenshot comparison with region-based analysis. Covers responsive checks, Lighthouse audits, and accessibility validation. Keywords: verify app, visual QA, compare to Figma, check screenshots, responsive test, pixel-perfect check, cross-browser testing, visual diff, pixelmatch
Exports generated components + design-tokens.lock.json as a publishable pnpm workspace. Generates a framework-agnostic tokens package and a framework-specific component library (React/Vue/Svelte via Vite library mode, React Native via tsc). Includes Tailwind preset, ThemeProvider, Changesets versioning, and a properly configured exports map. Keywords: design system export, component library, npm package, vite lib mode, tailwind preset, changesets, monorepo, publishable
Use after React components are built (Phase 4.5 of the Figma/Canva/screenshot pipeline) or whenever a project needs Storybook coverage — auto-generates .stories.tsx and .mdx docs from components via ts-morph AST parsing, with prop controls, variant stories, action args, and default args. Keywords: Storybook, generate stories, .stories.tsx, MDX docs, argTypes, controls, autodocs, CSF3, variant stories, action args, component documentation, story generation, ts-morph
Convert an exported Adobe InDesign IDML package or PDF into typed React components, design tokens, and Storybook stories via the @aurelius/pipeline InDesign pipeline. Use when a designer hands you an .idml or .pdf and you need a starting React component set. Keywords: InDesign to React, IDML, PDF to React, indesign pipeline, design tokens from InDesign, brochure to React, print to web, aurelius pipeline indesign
Structured interview that turns a natural-language app description into a build-spec.json and a design-brief.json — no design file required. Auto-discovers local project context, asks at most 7 targeted questions, and dispatches the conversation-designer agent to make concrete design decisions. Entry point (Phase C0) for the /build-from-conversation pipeline. Keywords: conversation intake, describe an app, talk to build, design brief, build spec, no Figma file
| name | parallel-orchestration |
| description | Concurrent phase runner that dispatches independent pipeline phases in parallel, respecting dependency graphs and resource constraints |
| globs | [".claude/pipeline.config.json",".claude/commands/build-from-*.md"] |
A concurrent phase scheduler that dispatches independent pipeline phases in parallel using background agents. It reads the phase dependency graph and resource constraints from pipeline.config.json, determines which phases can safely run concurrently, and schedules them up to the configured maxConcurrent limit. Phases with unmet dependencies or conflicting exclusive resources are held until their prerequisites complete and resources free up.
The scheduler produces real-time streaming output as phases start and finish, and a final batch summary with wall-clock timing, estimated sequential time, and speedup factor.
/build-from-figma, /build-from-canva, and /build-from-screenshot after the sequential phases (0-3: token-sync, intake, token-lock, tdd-scaffold) complete. Phases 4+ are handed to this skill for parallel dispatch.["component-build", "storybook", "visual-diff", "dark-mode", "e2e-tests", "cross-browser", "quality-gate", "responsive", "report"]).build-spec.json (component list, appType, renderer, E2E flows)design-tokens.lock.json (locked token values).claude/pipeline.config.json, specifically the orchestration section.renderer, used to drop excluded phases and select the converter (see Step 0 and Step 5).Before scheduling, read renderer from build-spec.json and resolve its manifest:
node scripts/renderer-registry.js resolve <renderer> --json
Read manifest.phases.exclude (an array, absent/empty for most renderers) and drop every listed phase from the requested phase set before building the dependency graph. Excluded phases never enter the scheduler — they are not dispatched, not tracked, and not awaited.
Example: the expo renderer excludes visual-diff, cross-browser, responsive, and dark-mode (no browser rendering), so those phases are removed up front and only component-build, storybook, e2e-tests, quality-gate, and report schedule. When a dependent phase's dependency was excluded, treat that dependency as pre-satisfied (same as a phase completed externally).
This replaces any per-framework phase-skipping logic — the manifest is the single source of truth for which phases a renderer supports.
Read .claude/pipeline.config.json and extract the orchestration section:
maxConcurrent -- maximum number of phases running at once (default: 3)phases -- dependency graph, resource declarations, blocking flagsqualityGateSubtasks -- sub-tasks for the quality-gate phasereporting -- output preferences (streaming, summary, timeline)Validate that every requested phase ID exists in phases. Abort with an error if any phase is unknown.
Initialize a state tracker for all requested phases:
state = {
[phaseId]: {
status: "pending", // pending | running | completed | failed | skipped
startTime: null,
endTime: null,
duration: null,
result: null, // output or error message
agentId: null, // background agent identifier
blocking: <from config>,
depends: <from config>,
resources: <from config>
}
}
Mark any phase whose dependencies include a phase NOT in the requested set as having those dependencies pre-satisfied (assumed completed externally, e.g., phases 0-3).
WHILE any phase has status "pending" or "running":
ready = phases WHERE status == "pending"
AND all deps have status "completed"
AND no resource conflict with currently "running" phases
available_slots = maxConcurrent - count(status == "running")
to_dispatch = ready[0..available_slots]
FOR EACH phase IN to_dispatch:
dispatch phase as background agent (see Phase Dispatch Table)
set status = "running"
record startTime and agentId
REPORT "[START] {phase} dispatched"
Wait for next completion notification
On completion of phase P:
record endTime, compute duration
If success:
set status = "completed"
REPORT "[PASS] {phase} ({duration}s)"
If failed AND phase.blocking == true:
set status = "failed"
mark all transitive dependents as "skipped"
REPORT "[FAIL] {phase} -- blocking, skipping dependents: {list}"
If failed AND phase.blocking == false:
set status = "failed"
REPORT "[WARN] {phase} failed -- non-blocking, continuing"
Two phases conflict if they share any exclusive resource. The conflict rules:
"filesystem:src"): exclusive by default. Two running phases with the same string resource conflict."mode": "shared" (e.g., { "name": "port:dev-server", "mode": "shared" }): never conflicts with any other phase holding the same resource.[]: no conflicts with anything.Implementation:
function hasResourceConflict(candidatePhase, runningPhases):
candidateExclusive = candidatePhase.resources
.filter(r => typeof r === "string") // strings are exclusive
FOR EACH running IN runningPhases:
runningExclusive = running.resources
.filter(r => typeof r === "string")
IF intersection(candidateExclusive, runningExclusive) is non-empty:
RETURN true
RETURN false
| Phase | Dispatch Method |
|---|---|
component-build | Agent: dispatch the converter named by the resolved renderer manifest. For React renderers the calling command supplies the source-appropriate converter (figma/screenshot → figma-react-converter via the figma-to-react-workflow skill, canva → canva-react-converter); otherwise dispatch manifest.converter (e.g. react-native-converter for expo, future vue-converter / svelte-converter) |
storybook | Bash: ./scripts/generate-stories.sh |
visual-diff | Agent: invoke visual-qa-verification skill with pixel-diff loop (max iterations from iterationLoop.maxVisualIterations) |
dark-mode | Bash: ./scripts/check-dark-mode.sh http://localhost:3000 |
e2e-tests | Agent: invoke e2e-test-generator skill with flows from build-spec.json |
cross-browser | Bash: ./scripts/cross-browser-baseline.sh compare http://localhost:3000 --json (diffs firefox/webkit against committed baselines with provenance checks — RFC 0002; skips with a capture hint when no baselines exist) |
quality-gate | Parallel sub-dispatch: run all qualityGateSubtasks concurrently (see below) |
responsive | Bash: ./scripts/check-responsive.sh http://localhost:3000 |
report | Agent: generate build-report.md in .claude/visual-qa/ from all collected phase results, timings, and diff images |
When quality-gate is dispatched, it internally runs its subtasks using the same scheduling algorithm with independent concurrency tracking:
| Subtask | Command |
|---|---|
coverage | pnpm vitest run --coverage -- check 80% threshold |
typecheck | pnpm tsc --noEmit |
build | pnpm build |
token-verify | ./scripts/verify-tokens.sh |
lighthouse | Lighthouse audit via Chrome DevTools MCP or CLI, check thresholds from qualityGate.lighthouseThresholds |
All subtasks run in parallel (respecting their resource declarations). The quality-gate phase passes only if all subtasks pass. If any subtask fails, quality-gate fails.
Report each subtask result inline:
[QUALITY-GATE] coverage: PASS (87%)
[QUALITY-GATE] typecheck: PASS (0 errors)
[QUALITY-GATE] build: PASS (3.2s)
[QUALITY-GATE] token-verify: PASS (no drift)
[QUALITY-GATE] lighthouse: PASS (perf:92 a11y:98 bp:95 seo:100)
After all phases resolve, output a summary:
=== PARALLEL ORCHESTRATION SUMMARY ===
Phases: 9 total | 7 passed | 1 failed | 1 skipped
Wall time: 47s
Sequential est: 138s
Speedup: 2.9x
Timeline:
0s [################] component-build 32s PASS
32s [#####] storybook 8s PASS
32s [###########] visual-diff 22s PASS
32s [###] dark-mode 5s WARN (non-blocking)
32s [########] quality-gate 16s PASS
32s [######] cross-browser 12s PASS
32s [####] responsive 7s PASS
54s [#######] e2e-tests 14s FAIL
-- [-------] report -- SKIPPED (dep: e2e-tests)
Failures:
e2e-tests: 2/5 flows failed (popup-interact, content-script-inject)
Include:
The skill can be invoked directly for ad-hoc parallel work outside the pipeline context. Provide a list of independent tasks as phase descriptors:
Run these tasks in parallel using parallel-orchestration:
1. Run lint: pnpm eslint .
2. Run type check: pnpm tsc --noEmit
3. Run tests: pnpm vitest run
4. Check bundle size: ./scripts/check-bundle-size.sh
The scheduler treats each task as a phase with no dependencies and no resource conflicts, dispatching up to maxConcurrent at a time and producing the same batch summary on completion.
failed. If the phase is blocking, mark all transitive dependents as skipped and report the root cause. If non-blocking, log a warning and continue.pipeline.config.json is missing or the orchestration section is absent, abort with a clear error message listing what is expected.Pipeline commands (/build-from-figma, /build-from-canva, /build-from-screenshot) invoke this skill after completing the sequential phases 0-3. The handoff looks like:
# Phases 0-3 run sequentially (mandatory ordering)
Phase 0: token-sync -> completed
Phase 1: intake -> completed (build-spec.json written)
Phase 2: token-lock -> completed (design-tokens.lock.json written)
Phase 3: tdd-scaffold -> completed (failing tests written)
# Hand off to parallel-orchestration for phases 4+
Invoke parallel-orchestration with phases:
["component-build", "storybook", "visual-diff", "dark-mode",
"e2e-tests", "cross-browser", "quality-gate", "responsive", "report"]
Context provided:
- build-spec.json (appType, renderer, component list, E2E flows)
- design-tokens.lock.json
- Test files from phase 3
- Pipeline config
- Resolved renderer manifest (drives phase exclusion + converter selection)
Before scheduling, the scheduler resolves the renderer manifest and drops any phase in manifest.phases.exclude (Step 0). The parallel scheduler then respects the dependency graph within the remaining handed-off phases. For example, component-build has no unmet deps (its dep tdd-scaffold was completed in the sequential block), so it starts immediately. Phases like visual-diff, storybook, dark-mode, quality-gate, cross-browser, and responsive all depend on component-build, so they fan out once it completes. Finally, report waits for quality-gate and e2e-tests before running.