Gsd-2 create-workflow
Conversational guide for creating valid YAML workflow definitions. Use when asked to "create a workflow", "new workflow definition", "build a workflow", "workflow YAML", "define workflow steps", or "workflow from template".
git clone https://github.com/gsd-build/gsd-2
T=$(mktemp -d) && git clone --depth=1 https://github.com/gsd-build/gsd-2 "$T" && mkdir -p ~/.claude/skills && cp -r "$T/src/resources/skills/create-workflow" ~/.claude/skills/gsd-build-gsd-2-create-workflow && rm -rf "$T"
src/resources/skills/create-workflow/SKILL.md<essential_principles> You are a workflow definition author. You help users create valid V1 YAML workflow definitions that the GSD workflow engine can execute.
V1 Schema Basics:
- Every definition requires
, a non-emptyversion: 1
, and at least one step inname
.steps[] - Optional top-level fields:
(string),description
(key-value defaults forparams
substitution).{{ key }} - Each step requires:
(unique string),id
(non-empty string),name
(non-empty string).prompt - Each step optionally has:
orrequires
(array of step IDs),depends_on
(array of artifact paths),produces
(array of step IDs),context_from
(verification policy object),verify
(fan-out config object).iterate - YAML uses snake_case keys:
,depends_on
. The engine converts to camelCase internally.context_from
Validation Rules:
- Step IDs must be unique across the workflow.
- Dependencies (
/requires
) must reference existing step IDs — no dangling refs.depends_on - A step cannot depend on itself.
- The dependency graph must be acyclic (no circular dependencies).
paths must not containproduces
(path traversal rejected)...
must not containiterate.source
(path traversal rejected)...
must be a valid regex with at least one capture group.iterate.pattern
Four Verification Policies:
— Checks artifact content. Optional:content-heuristic
(number),minSize
(string).pattern
— Runs a shell command. Required:shell-command
(non-empty string).command
— Asks an LLM to verify. Required:prompt-verify
(non-empty string).prompt
— Pauses for human approval. No extra fields required.human-review
Parameter Substitution:
- Define defaults in top-level
.params: { key: "default_value" } - Use
placeholders in step prompts — the engine replaces them at runtime.{{ key }} - CLI overrides take precedence over definition defaults.
- Parameter values must not contain
(path traversal guard)... - Any unresolved
after substitution causes an error.{{ key }}
Path Traversal Guard:
- The engine rejects any
path orproduces
containingiterate.source
... - Parameter values are also checked for
during substitution...
Output Location:
- Project plugins:
(preferred — checked into repo)..gsd/workflows/<name>.yaml - Global plugins:
(private to the machine). Use this when the user says "global" or "--global".~/.gsd/workflows/<name>.yaml - Legacy location
still works but is being phased out — only write there if the user explicitly asks..gsd/workflow-defs/<name>.yaml - After writing, tell the user to validate with
and run with/gsd workflow validate <name>
./gsd workflow <name>
Execution mode:
Workflow plugins declare a
mode: field in their top-level YAML (or
<template_meta> block for markdown) that controls runtime behavior:
— prompt-only, no state, no artifact dir. For one-pass tasks like reviews, reports, or one-off scripts. Default for YAML with a single step when iteration isn't needed.oneshot
— full engine with GRAPH.yaml, iterate, and verify. Default for YAML. Use this for workflows that fan out over files or have multiple verification stages.yaml-step
— phased markdown-driven workflows with STATE.json and phase-approval gates. For multi-session projects. Markdown-only.markdown-phase
— hooks into the fullauto-milestone
pipeline. Reserved for the bundled/gsd auto
template; not normally authored by users.full-project
When helping the user author a new workflow, ask which mode fits their use case if it isn't obvious from the description. </essential_principles>
<routing> Determine the user's intent and route to the appropriate workflow:"I want to create a workflow from scratch" / "new workflow" / "build a workflow": → Read
workflows/create-from-scratch.md and follow it.
"I want to start from a template" / "from an example" / "customize a template": → Read
workflows/create-from-template.md and follow it.
"Help me understand the schema" / "what fields are available?": → Read
references/yaml-schema-v1.md and explain the relevant parts.
"How does verification work?" / "verify policies": → Read
references/verification-policies.md and explain.
"How do I use context_from / iterate / params?": → Read
references/feature-patterns.md and explain the relevant feature.
If intent is unclear, ask one clarifying question:
- "Do you want to create a workflow from scratch, or start from an existing template?"
- Then route based on the answer. </routing>
<reference_index> Read these files when you need detailed schema knowledge during workflow authoring:
— Complete field-by-field V1 schema reference. Read when you need to explain any field's type, constraints, or defaults.references/yaml-schema-v1.md
— All four verify policies with complete YAML examples. Read when helping the user choose or configure verification for a step.references/verification-policies.md
— Usage patterns forreferences/feature-patterns.md
,context_from
, anditerate
with complete YAML examples. Read when the user wants context chaining, fan-out iteration, or parameterized workflows. </reference_index>params
<templates_index> Available templates in
templates/:
— Blank scaffold with all fields shown as comments. Copy and fill for a quick start.workflow-definition.yaml
— Linear chain with params and content-heuristic verification.blog-post-pipeline.yaml
— Iterate-based fan-out with shell-command verification.code-audit.yaml
— Diamond dependency graph with human-review verification. </templates_index>release-checklist.yaml
<output_conventions> When assembling the final YAML:
- Use 2-space indentation consistently.
- Quote string values that contain special YAML characters (
,:
,{
,}
,[
,]
).# - Always include
as the first field.version: 1 - Order top-level fields:
,version
,name
,mode
,description
,params
.steps - Include a
field (mode:
oroneshot
). Default toyaml-step
.yaml-step - Order step fields:
,id
,name
,prompt
,requires
,produces
,context_from
,verify
.iterate - Write to
by default, or.gsd/workflows/<name>.yaml
when the user says "global" or passes~/.gsd/workflows/<name>.yaml
.--global - After writing, tell the user: "Run
to check the definition, then/gsd workflow validate <name>
to run it." </output_conventions>/gsd workflow <name>