MCP HubMCP Hub
SKILL·A4C277

create-workflow

pjt222
업데이트됨 29 days ago
26
3
26
GitHub에서 보기
메타aiautomationdesign

정보

`create-workflow` 스킬은 개발자가 Claude Code의 Workflow 도구를 위한 재사용 가능하고 독립적인 `.mjs` 오케스트레이션 스크립트를 작성하는 데 도움을 줍니다. 이 스킬은 고정된 제어 흐름, 감사 가능성, 검증 안전 장치를 갖춘 다중 에이전트를 조정하는 매개변수화된 워크플로우를 생성하는 과정을 안내합니다. 팀을 사용하는 대신 반복 가능한 절차를 재사용 가능한 아티팩트로 포착해야 할 때 이 스킬을 사용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/create-workflow

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Create a New Workflow

Author a workflow — the fifth content type — as a self-contained workflows/<name>.mjs script run by Claude Code's Workflow tool. A workflow fixes its phases, fan-out, and verification structure in JavaScript: its control flow is deterministic and rereadable, while the outputs of its agent() calls are LLM subagents and remain nondeterministic. This skill is the procedure for authoring one; guides/creating-workflows.md is the API reference it draws on.

Vendor-API caveat. The Workflow run model is generally available on paid Claude Code plans (~v2.1.154+), but the script-authoring surface (the injected agent() / parallel() / pipeline() / phase() / log() / workflow() primitives and the args / budget globals) is an evolving vendor API — accurate as observed in Claude Code v2.1.x, subject to change, never CI-enforced.

When to Use

  • You have a repeatable, parameterized procedure that coordinates several agents and want it captured as a reusable artifact whose shape you already know.
  • You need a review, research, or migration procedure to run the same way every time, with the fan-out and verification logic auditable in code rather than re-decided by a lead each run.
  • You are adding a reviewed seed to the workflows/ library, or authoring a personal workflow for .claude/workflows/.
  • You are deciding between writing a team and a workflow — read Step 1 first.

Inputs

  • Required: Workflow name (lowercase kebab-case, e.g., review-changes). This becomes the filename stem, the sidecar name:, and meta.name — all three must be identical.
  • Required: Purpose (one paragraph: what repeatable procedure this codifies and why its control flow should be fixed in code).
  • Required: Phase plan (the named stages, e.g., Classify → Verify → Synthesize) and the fan-out shape (per-item pipeline() vs barrier parallel()).
  • Optional: Parameters the workflow accepts via args (default them so it runs with no input).
  • Optional: Source material (an existing ad-hoc multi-agent procedure to formalize).

Procedure

Step 1: Confirm a Workflow Is the Right Tool

A workflow is one of five content types. Choose deliberately:

  • A skill is how one agent performs a procedure. A team is a declarative roster the lead coordinates at runtime (model-driven, adaptive). A workflow is a script whose phases and fan-out are fixed in code (deterministic control flow, auditable, parameterized).
  • Pick a workflow only when the coordination shape is known in advance and you want it repeatable and rereadable. If the right next step depends on what the last step found, pick a team instead.

Expected: A one-line justification for why this is a workflow and not a team or a single skill.

On failure: If the coordination must adapt turn-by-turn, stop and use create-team. If only one agent acts, use create-skill.

Step 2: Copy the Template

Start from the canonical scaffold — never a blank file:

cp workflows/_template.mjs workflows/<name>.mjs

For a personal (non-library) workflow, copy into .claude/workflows/<name>.mjs instead. The template carries the sidecar block, a pure-literal meta, a phase(), a pipeline() fan-out, an agent({ schema }) call, and the hard constraints inline.

Expected: A new .mjs file that is a verbatim copy of the template.

On failure: If workflows/_template.mjs is missing, you are on a pre-Phase-1 checkout — fetch main.

Step 3: Satisfy the Triple-Name Discovery Contract

Rename in the three places that must stay identical — the filename stem, the sidecar // name:, and the meta.name literal:

grep -n "name:" workflows/<name>.mjs   # sidecar + meta.name must equal the filename stem

That triple equality (filename ↔ sidecar name ↔ meta.name) is the Workflow({ name }) and /<name> discovery contract.

Expected: All three read the same kebab-case name.

On failure: A Workflow not found by name error at runtime means the triple is out of sync — re-check all three.

Step 4: Write the Pure-Literal meta and Sidecar

export const meta must be a pure literal — no variables, function calls, spreads, or template interpolation. Required fields: name and description. phases (one entry per phase the workflow uses, whether opened by a global phase() call or a stage's per-call phase: option) is optional but recommended. Mirror name, description, and the phases titles in the top-of-file sidecar comment block — the sidecar is the catalog source of truth (the analogue of YAML frontmatter on the other content types), readable by grep without a JS parser.

Expected: meta is a literal object; the sidecar agrees with it; phases ⊇ every title passed to phase() or a stage phase:.

On failure: A meta must be a pure literal error means a value references a variable or call — inline it.

Step 5: Build the Body

The body runs inside an async wrapper — use top-level await and a top-level return directly. Compose with the injected globals (no imports):

  • pipeline(items, ...stages) — the default: each item flows through every stage with no barrier between stages (wall-clock = slowest single chain).
  • parallel(thunks) — a barrier: use only when a stage needs every prior result at once (dedup, an early-exit count, a synthesis step).
  • agent(prompt, { schema, label, phase, agentType }) — spawn one subagent; with { schema } it returns a validated object.
  • phase(title), log(message), and the args / budget globals. Default args so the workflow runs with no input.

Pass a JSON Schema as { schema } to force structured output (no free-text parsing). See guides/creating-workflows.md for the full primitive reference.

Expected: A body that defaults its inputs, fans out with the right primitive, and returns a value.

On failure: If you reach for parallel() only to flatten or map between stages, that barrier is not justified — do the transform inside a pipeline() stage.

Step 6: Honor the Capability Contract (#285)

agent({ agentType }) names the spawn type per call — the workflow's native expression of the persona-vs-spawn decoupling. The intent rule applies:

  • A stage that mutates artifacts (uses Write/Edit/Bash to change files, or runs under isolation: 'worktree') must target an implementing agent type.
  • A read-only analysis stage targets an advisory type (e.g., Explore).

Set agentType explicitly on every stage so the contract is visible, not implied.

Expected: Every agent() call names an agentType whose capability matches what the stage does.

On failure: A mutating stage targeting an advisory type cannot write — switch it to an implementing type such as general-purpose.

Step 7: Apply the Adversarial-Verification Fail-Safes

If your workflow verifies candidate findings (the classify → refute → synthesize spine), bake in the three lessons the review-changes seed encodes:

  1. Gate on affirmative confirmations, not refutations. agent() returns null when a subagent is skipped or dies, so filter(Boolean) before counting and require a majority of confirmations to survive (confirmedVotes >= Math.floor(n / 2) + 1). Surviving when "few enough refuted" inverts the fail-safe — a dead refuter would let an unverified finding through.
  2. Give verifiers the evidence the proposer had. If the classifier read a diff, tell the refuters to read it too — otherwise change-specific findings get default-refuted and unfairly killed.
  3. Default to refuted/unconfirmed unless a verifier can independently reproduce the finding.

Expected: Survival gates on a confirmation quorum, verifiers share the proposer's evidence, and null results are filtered.

On failure: If real findings vanish, check that verifiers aren't starved of context (lesson 2); if junk survives, check the gate counts confirmations, not refutations (lesson 1).

Step 8: Validate the Script

Workflow scripts use a top-level return, which the runtime accepts (it wraps the body in an async function) but raw ESM rejects — so plain node --check reports Illegal return statement on a valid workflow. Use the wrap-then-check recipe:

{ echo '(async()=>{'; \
  sed 's/^[[:space:]]*export const meta/const meta/' workflows/<name>.mjs; \
  echo '})()'; } | node --check -

The authoritative check is running it: Workflow({ name: '<name>' }).

Expected: The wrap-check passes with no syntax error.

On failure: Do not "fix" a top-level return to pass raw node --check — that would cripple the script. Use the wrap-check; debug any other syntax error normally.

Step 9: Install and Run

The Workflow tool resolves Workflow({ name }) from .claude/workflows/<name>.mjs. In Phase 1, install by hand:

cp workflows/<name>.mjs .claude/workflows/<name>.mjs   # curated installs prefix: almanac-<name>.mjs

Then invoke Workflow({ name: '<name>' }) or the /<name> slash command. .claude/workflows/ is user-writable and the save-flow writes there, so a curated install must namespace (almanac-<name>.mjs) to avoid shadowing a user's own workflow.

Expected: The workflow runs end-to-end and returns its value.

On failure: If /<name> is not found, confirm the file is in .claude/workflows/ and the triple-name contract holds (Step 3).

Step 10: Register (Library Contributions)

Phase-2-pending. A workflows/_registry.yml, CI validation of the sidecar, and a CLI install adapter are deferred behind the #288 promotion gate (~8–10 workflows + a real install request). Until they land, a library workflow needs no registry entry — the sidecar frontmatter is its catalog metadata and discovery is by filename. When the registry exists, this step becomes "add an entry derived from the sidecar."

Workflows are excluded from i18n. Unlike skills/agents/teams/guides, a workflow is executable code, not prose — do not scaffold translations for it.

If contributing a reviewed seed to agent-almanac, place it in workflows/, cross-reference it from guides/creating-workflows.md, and carry the vendor-API caveat in any prose you add.

Expected: A library workflow lives in workflows/ with an accurate sidecar; no registry or translation steps are attempted in Phase 1.

On failure: If a tool expects workflows/_registry.yml, you are ahead of the promotion gate — stop and confirm Phase 2 has shipped.

Validation

  • File exists at workflows/<name>.mjs (or .claude/workflows/<name>.mjs for personal use).
  • Filename stem, sidecar name:, and meta.name are identical (triple-name contract).
  • export const meta is a pure literal; sidecar mirrors name/description/phases.
  • Sidecar phases: ⊇ every title passed to phase() or a stage phase: option.
  • Body defaults its args, uses an appropriate fan-out primitive, and returns a value.
  • Every agent() call sets an agentType whose capability matches the stage (advisory vs implementing).
  • Verification stages gate on a confirmation quorum and filter(Boolean) null results.
  • No forbidden calls: Date.now(), Math.random(), argless new Date(); no TypeScript syntax; no filesystem/Node APIs.
  • The wrap-then-node --check recipe passes.
  • No workflows/_registry.yml entry or translation scaffold was created (both are Phase 2 / i18n-excluded).

Common Pitfalls

  • Writing a workflow when a team fits. If the next step depends on what the last step found, the coordination is adaptive — use a team. Workflows are for procedures whose shape is fixed in advance.
  • Counting refutations instead of confirmations. Gating survival on "few enough refuted" lets a null/dead refuter pass an unverified finding through. Gate on a majority of affirmative confirmations.
  • Starving verifiers of context. Refuters that see less than the proposer (e.g., the file but not the diff) default-refute legitimate change-specific findings and kill them.
  • Computing meta. export const meta must be a literal — no spreads, calls, or interpolation. A computed meta fails at load.
  • "Fixing" the top-level return. It is valid Workflow dialect; rewriting it to satisfy raw node --check breaks the script. Use the wrap-check.
  • Forbidden non-determinism. Date.now() / Math.random() / argless new Date() break workflow resume. Pass timestamps via args; vary randomness by agent index or label.
  • Building Phase-2 machinery early. Do not add a workflows/_registry.yml or scaffold translations for a workflow — registries/CLI/validation are gated, and workflows are i18n-excluded.

Related Skills

  • create-skill — author a SKILL.md (the how for one agent); the meta-pattern sibling.
  • create-agent — define an agent persona; workflows spawn agents by agentType.
  • create-team — compose a declarative, model-driven roster (the adaptive counterpart to a workflow).
  • commit-changes — commit the new workflow file.
  • review-codebase / review-pull-request — the single-reviewer skills the review-changes workflow coordinates many of.

GitHub 저장소

pjt222/agent-almanac
경로: i18n/ja/skills/create-workflow
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams
FAQ

Frequently asked questions

What is the create-workflow skill?

create-workflow is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform create-workflow-related tasks without extra prompting.

How do I install create-workflow?

Use the install commands on this page: add create-workflow to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.

What category does create-workflow belong to?

create-workflow is in the Meta category, tagged ai, automation and design.

Is create-workflow free to use?

Yes. create-workflow is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.

연관 스킬

content-collections
메타

이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.

스킬 보기
polymarket
메타

이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.

스킬 보기
creating-opencode-plugins
메타

이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.

스킬 보기
sglang
메타

SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.

스킬 보기