setup
Scaffold a new Ironflow project - a Cargo workspace with a workflows lib, an API server binary, a worker binary, a hello workflow and its end-to-end test. Loaded by the ironflow hub for the setup verb.
- License 许可
- MIT
- 最近更新
- 2026-11-04
- Stars
- ★ 2
- Forks
- 1
01 前言 Front Matter
- name
- setup
- description
- Scaffold a new Ironflow project - a Cargo workspace with a workflows lib, an API server binary, a worker binary, a hello workflow and its end-to-end test. Loaded by the ironflow hub for the setup verb.
- allowed-tools
- Bash(cargo:*), Bash(${CLAUDE_SKILL_DIR}/scripts/scaffold.sh:*)
- user-invocable
- false
02 资源文件 14
- 资产文件assets/.env.example3.1 KB
- 资产文件assets/.gitignore12 B
- 资产文件assets/Cargo.toml127 B
- 脚本assets/scripts/dev.sh475 B
- 资产文件assets/server/Cargo.toml394 B
- 脚本assets/server/src/main.rs8.3 KB
- 资产文件assets/worker/Cargo.toml308 B
- 脚本assets/worker/src/main.rs2.3 KB
- 资产文件assets/workflows/Cargo.toml264 B
- 脚本assets/workflows/src/hello.rs1.6 KB
- 脚本assets/workflows/src/lib.rs455 B
- 脚本assets/workflows/tests/hello.rs1.7 KB
- 参考文档references/options.md6.8 KB
- 脚本scripts/scaffold.sh2.7 KB
03 SKILL.md 正文
Ironflow setup
Creates a runnable Ironflow platform in an empty directory. Everything the script copies lives in ${CLAUDE_SKILL_DIR}/assets/ and is compiled in Ironflow's CI, so read the assets rather than re-deriving them.
1. Check the environment
rustc --version # 1.94 or newer
cargo --version
claude --version 2>/dev/null || echo "claude CLI not found"
psql --version 2>/dev/null || echo "psql not found"
Rust below 1.94: stop and say so, Ironflow does not compile on older toolchains.
2. Ask two questions, then stop asking
Ask both in one AskUserQuestion call:
- Store: in-memory (runs are lost on restart, no database needed) or Postgres (needs
DATABASE_URL, migrations run automatically at boot). - Agent provider for the worker: Claude Code CLI (
claudeon PATH), Anthropic API (ANTHROPIC_API_KEY), OpenAI (OPENAI_API_KEY), or "no agent steps for now" (keep the Claude Code provider, it is only exercised when a workflow runs an agent step).
Also confirm the target directory (default: current directory if empty, otherwise ask for a name).
3. Scaffold
"${CLAUDE_SKILL_DIR}/scripts/scaffold.sh" <target-dir>
The script refuses a non-empty directory. It copies the template and runs cargo add for every ironflow crate, so versions come from crates.io at scaffold time. Then apply the answers from step 2 by following ${CLAUDE_SKILL_DIR}/references/options.md (Postgres block, provider block). Skip it entirely for in-memory + Claude Code.
Workers that run on different hosts (a GPU box, another region) get tags with WorkerBuilder::tags([..]), and a workflow that needs one declares required_worker_tags: see "Workers with different capabilities" in the same file. Without tags every worker that registered a workflow may take its runs.
4. Verify
cd <target-dir>
cargo build --workspace
cargo test --workspace
Both must pass before you report anything. The test suite runs the hello workflow through a real engine.
5. Proof of life
Tell the user how to see a run complete, in this order:
scripts/dev.sh # starts the API server, then one worker
Then in the dashboard at http://localhost:3000: create the first account (it becomes admin), open API keys, create a key with the workflows_read, runs_read and runs_write scopes, and run:
cargo install ironflow-cli
export IRONFLOW_URL=http://localhost:3000 IRONFLOW_API_KEY=irfl_...
ironflow-cli workflow list
ironflow-cli run create hello --payload '{"name":"Ada"}'
ironflow-cli logs <run-id>
A completed run with one greet step is the proof of life.
6. Hand over
Report the generated layout in five lines, then point to the next verbs: /ironflow workflow <name> to add a handler, /ironflow operation <name> for an integration, /ironflow test <name> for a test.
Layout the script produces
<target>/
Cargo.toml workspace: workflows, server, worker
.env.example every variable, commented; copied to .env with fresh
WORKER_TOKEN and JWT_SECRET
scripts/dev.sh server then worker, Ctrl+C stops both
workflows/ lib: handlers() + hello.rs + tests/hello.rs
server/ API server, dashboard embedded, reaper, SSE
worker/ polls the server, executes handlers
Failure modes
cargo addfails with a network error: retry once, then tell the user the crate resolution failed and which command to rerun.cargo buildfails inside an ironflow crate: the template and the published crates drifted. Report the error verbatim with the crate version fromCargo.lock, do not patch the ironflow crate.- Port 3000 busy: set
PORTin.env;scripts/dev.shhonours it.
04 同仓库更多 Skills
workflow
Write an Ironflow WorkflowHandler - typed input schema, steps (shell, http, agent, approval, human input, signal, decision, sub-workflow, parallel), registration in handlers(). Loaded by the ironflow hub for the workflow verb.
upgrade
Upgrade the Ironflow crates of a project and migrate its code, or audit existing code against the current Ironflow idioms. Reads the changelog between the installed and the target release, maps every change to the project's code, then proposes or applies the migrations. Loaded by the ironflow hub for the upgrade and audit verbs.
test
Write an end-to-end test for an Ironflow workflow handler - real Engine, InMemoryStore, RecordReplayProvider fixtures, assertions on run status and step names. Loaded by the ironflow hub for the test verb.
operation
Write a custom Ironflow Operation - an integration (GitLab, Slack, any HTTP API) executed as a tracked step through ctx.operation(). Loaded by the ironflow hub for the operation verb.
ironflow
Entry point for building on the Ironflow workflow engine. Use for setting up an Ironflow project (server + worker), writing a WorkflowHandler, writing a custom Operation, testing a workflow end to end, reviewing a handler, upgrading the ironflow crates and migrating the code, or auditing existing code against the current Ironflow idioms. Trigger on "ironflow", "workflow handler", "ironflow setup", "ctx.shell", "ctx.agent", "approval gate", "upgrade ironflow", "bump ironflow", "créer un workflow ironflow", "mettre en place ironflow", "mettre à jour ironflow", "migrer ironflow".
ops-crate
Generate a new ops/xxx crate for an external service integration. Identifies the right pattern (A=wrapper, B=HTTP direct, C=macro), scaffolds the full structure, and runs the quality checklist. Trigger on "ops crate", "new ops", "creer un crate ops", "add ops/xxx", "nouveau crate ops", "ironflow ops".