[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EKJ5G6553VH8BES3V9CY5B":3,"skill-same:01M6EKJ5G6553VH8BES3V9CY5B":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":40,"install":41,"resources":54},"01M6EKJ5G6553VH8BES3V9CY5B","test",null,"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.","ThomasTartrau\u002Fironflow","ThomasTartrau","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F145434513?v=4","01M6EKHJ55CEQZVP23J48EMFQ1","Thomas Tartrau","01M6EKHJ9CJE78ZBQDPQ9M13C2",2,"MIT","https:\u002F\u002Fgithub.com\u002FThomasTartrau\u002Fironflow\u002Fblob\u002Fmain\u002Fplugins\u002Fironflow\u002Fskills\u002Ftest\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28],"workflow","status","run","engine","write","hub","fixtures","end","false","ironflow","2026-11-10 10:12:30",false,"---\nname: test\ndescription: 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.\nuser-invocable: false\n---\n\n# Ironflow workflow test\n\nBlack box: run the real handler against the in-memory store and assert on what was persisted. Two levels: `TestEngine` mocks the outside world (shell, HTTP, agent, approval) to exercise the handler's logic; the real `Engine` spawns real processes and replays recorded agent fixtures so the suite never spends tokens.\n\n## Unit test with TestEngine\n\nWhen every step of the handler is a shell, HTTP, agent or approval step, skip the engine boilerplate: `TestEngine` runs the real handler against an in-memory store with those steps mocked. No server, no worker, no Postgres, no process spawned.\n\n```rust,no_run\nuse ironflow_engine::config::ShellConfig;\nuse ironflow_engine::context::WorkflowContext;\nuse ironflow_engine::handler::{HandlerFuture, WorkflowHandler};\nuse ironflow_engine::testing::{MockShellOutput, TestEngine};\nuse ironflow_store::models::{RunStatus, StepStatus};\nuse serde_json::json;\n\n\u002F\u002F In a real project: `use workflows::handlers::Deploy;`\nstruct Deploy;\n\nimpl WorkflowHandler for Deploy {\n    fn name(&self) -> &str {\n        \"deploy\"\n    }\n    fn execute\u003C'a>(&'a self, ctx: &'a mut WorkflowContext) -> HandlerFuture\u003C'a> {\n        Box::pin(async move {\n            ctx.shell(\"build\", ShellConfig::new(\"cargo build\")).await?;\n            ctx.shell(\"ship\", ShellConfig::new(\".\u002Fship.sh\")).await?;\n            Ok(())\n        })\n    }\n}\n\n#[tokio::test]\nasync fn deploy_builds_then_ships() {\n    let result = TestEngine::new()\n        .with_handler(Deploy)\n        .with_mock_shell(|cfg| match cfg.command.as_str() {\n            \"cargo build\" => Ok(MockShellOutput::ok(\"compiled\")),\n            _ => Ok(MockShellOutput::ok(\"shipped\")),\n        })\n        .run(json!({\"environment\": \"staging\"}))\n        .await\n        .expect(\"the harness ran the handler\");\n\n    assert_eq!(result.status(), RunStatus::Completed);\n    assert_eq!(result.step_names(), vec![\"build\", \"ship\"]);\n    assert_eq!(result.step(\"build\").step_output().stdout(), \"compiled\");\n    assert_eq!(result.step(\"ship\").status(), StepStatus::Completed);\n}\n```\n\nBuilders: `with_handler`, `with_mock_shell`, `with_mock_http`, `with_mock_agent`, `with_recorded_agent(dir)`, `with_mock_approval`, `with_mock_human_input`, `with_mock_signal`, `with_agent_provider`, `with_decision_provider`, `with_secret(key, value)` (`secret-store` feature). Then `run(payload)`, `run_workflow(name, payload)` or `resume(run_id)`.\n\nA handler that fails is not an `Err`: `result.status()` is `RunStatus::Failed` and `result.error()` carries the message. A non-zero `MockShellOutput::failed(1, \"boom\")` fails the step like a real non-zero exit; a non-2xx `MockHttpResponse` is a normal output, like a real 500. Without `with_mock_approval`, a gate suspends the run (`RunStatus::AwaitingApproval`) and `resume(run_id)` continues it. `with_mock_human_input(|name, cfg| HumanInputOutcome::Provided(json!({..})))` answers every `ctx.human_input` step with a value that must deserialize into the handler's type; `HumanInputOutcome::reject(\"reason\")` makes the handler receive `EngineError::HumanInputRejected`. `with_mock_signal(|step, name, key| SignalOutcome::Received(json!({..})))` resolves every `ctx.wait_for_signal` step with that payload; `SignalOutcome::TimedOut` makes it return `None`.\n\nAn approval gate, two ways. `with_mock_approval` takes an `ApprovalOutcome` value, not a\nclosure: `ApprovalOutcome::Approved` or `ApprovalOutcome::reject(\"reason\")`. To assert the\nsuspension itself, leave the gate unmocked, then `resume` the same run:\n\n```rust,no_run\nuse ironflow_engine::config::{ApprovalConfig, ShellConfig};\nuse ironflow_engine::context::WorkflowContext;\nuse ironflow_engine::handler::{HandlerFuture, WorkflowHandler};\nuse ironflow_engine::testing::{ApprovalOutcome, MockShellOutput, TestEngine};\nuse ironflow_store::models::RunStatus;\nuse serde_json::json;\n\nstruct Release;\n\nimpl WorkflowHandler for Release {\n    fn name(&self) -> &str {\n        \"release\"\n    }\n    fn execute\u003C'a>(&'a self, ctx: &'a mut WorkflowContext) -> HandlerFuture\u003C'a> {\n        Box::pin(async move {\n            ctx.shell(\"build\", ShellConfig::new(\"cargo build\")).await?;\n            ctx.approval(\"ship\", ApprovalConfig::new(\"Publish?\")).await?;\n            ctx.shell(\"publish\", ShellConfig::new(\".\u002Fpublish.sh\")).await?;\n            Ok(())\n        })\n    }\n}\n\n#[tokio::test]\nasync fn release_waits_for_approval_then_publishes() {\n    let mut harness = TestEngine::new()\n        .with_handler(Release)\n        .with_mock_shell(|_cfg| Ok(MockShellOutput::ok(\"\")));\n\n    let suspended = harness.run(json!({})).await.expect(\"the harness ran the handler\");\n    assert_eq!(suspended.status(), RunStatus::AwaitingApproval);\n    assert_eq!(suspended.step_names(), vec![\"build\", \"ship\"]);\n\n    \u002F\u002F Records the approval vote on the open gate and replays the handler.\n    let resumed = harness.resume(suspended.run_id()).await.expect(\"the run resumed\");\n    assert_eq!(resumed.status(), RunStatus::Completed);\n    assert_eq!(resumed.step_names(), vec![\"build\", \"ship\", \"publish\"]);\n}\n\n#[tokio::test]\nasync fn release_publishes_when_approved_upfront() {\n    let result = TestEngine::new()\n        .with_handler(Release)\n        .with_mock_shell(|_cfg| Ok(MockShellOutput::ok(\"\")))\n        .with_mock_approval(ApprovalOutcome::Approved)\n        .run(json!({}))\n        .await\n        .expect(\"the harness ran the handler\");\n    assert_eq!(result.status(), RunStatus::Completed);\n}\n```\n\n`result.output()` is the run output the handler set with `ctx.set_output` (`Value::Null` when it set none), not the last step's output: that one is `result.steps().last()`. Read it back into the handler's type:\n\n```rust,no_run\nuse ironflow_engine::context::WorkflowContext;\nuse ironflow_engine::handler::{HandlerFuture, WorkflowHandler};\nuse ironflow_engine::testing::TestEngine;\nuse serde::{Deserialize, Serialize};\nuse serde_json::{from_value, json};\n\n#[derive(Debug, PartialEq, Serialize, Deserialize)]\nstruct Verdict {\n    approved: bool,\n}\n\nstruct Review;\n\nimpl WorkflowHandler for Review {\n    fn name(&self) -> &str {\n        \"review\"\n    }\n    fn execute\u003C'a>(&'a self, ctx: &'a mut WorkflowContext) -> HandlerFuture\u003C'a> {\n        Box::pin(async move {\n            ctx.set_output(&Verdict { approved: true })?;\n            Ok(())\n        })\n    }\n}\n\n#[tokio::test]\nasync fn review_approves() {\n    let result = TestEngine::new()\n        .with_handler(Review)\n        .run(json!({}))\n        .await\n        .expect(\"the harness ran the handler\");\n\n    let verdict: Verdict = from_value(result.output().clone()).expect(\"a verdict\");\n    assert_eq!(verdict, Verdict { approved: true });\n}\n```\n\nNot covered: `ctx.operation(...)` (pass a test-double `Operation` to the handler), `ctx.delay(...)` (still sleeps the run) and `ctx.decision(...)` (needs a real `DecisionProvider`).\n\n## 1. Locate\n\n```bash\ngrep -rn \"impl WorkflowHandler for\" --include=*.rs .      # the handler\ngrep -rl \"pub fn handlers\" --include=*.rs .              # the workflows crate\nls workflows\u002Ftests 2>\u002Fdev\u002Fnull                            # existing tests and fixtures\n```\n\nDev-dependencies the test needs, added once per crate (skip those already present):\n\n```bash\ncargo add -p workflows --dev ironflow-core ironflow-store serde_json\ncargo add -p workflows --dev tokio --features macros,rt-multi-thread\n```\n\n## 2. Write the test\n\nOne file per handler in `workflows\u002Ftests\u002F\u003Chandler>.rs`:\n\n```rust,no_run\nuse std::sync::Arc;\n\nuse ironflow_core::provider::AgentProvider;\nuse ironflow_core::providers::claude::ClaudeCodeProvider;\nuse ironflow_core::providers::record_replay::RecordReplayProvider;\nuse ironflow_engine::context::WorkflowContext;\nuse ironflow_engine::engine::Engine;\nuse ironflow_engine::handler::{HandlerFuture, WorkflowHandler};\nuse ironflow_store::memory::InMemoryStore;\nuse ironflow_store::models::{RunStatus, StepStatus, TriggerKind};\nuse ironflow_store::store::Store;\nuse serde_json::json;\n\n\u002F\u002F In a real project: `use workflows::handlers;`\nstruct Deploy;\n\nimpl WorkflowHandler for Deploy {\n    fn name(&self) -> &str {\n        \"deploy\"\n    }\n    fn execute\u003C'a>(&'a self, _ctx: &'a mut WorkflowContext) -> HandlerFuture\u003C'a> {\n        Box::pin(async move { Ok(()) })\n    }\n}\n\nfn handlers() -> Vec\u003CBox\u003Cdyn WorkflowHandler>> {\n    vec![Box::new(Deploy)]\n}\n\nfn engine() -> Engine {\n    let store: Arc\u003Cdyn Store> = Arc::new(InMemoryStore::new());\n    \u002F\u002F Replays `tests\u002Ffixtures\u002F\u003Chash>.json`; records with IRONFLOW_RECORD=1.\n    let provider: Arc\u003Cdyn AgentProvider> = Arc::new(RecordReplayProvider::new(\n        ClaudeCodeProvider::new(),\n        \"tests\u002Ffixtures\",\n    ));\n    let mut engine = Engine::new(store, provider);\n    for handler in handlers() {\n        engine.register(handler).expect(\"handler names are unique\");\n    }\n    engine\n}\n\n#[tokio::test]\nasync fn deploy_to_staging_completes() {\n    let result = engine()\n        .run_handler(\n            \"deploy\",\n            TriggerKind::Manual,\n            json!({\"git_ref\": \"main\", \"environment\": \"staging\"}),\n        )\n        .await\n        .expect(\"run completes\");\n\n    assert_eq!(result.run.status.state, RunStatus::Completed);\n    let names: Vec\u003C&str> = result.steps.iter().map(|s| s.name.as_str()).collect();\n    assert_eq!(names, vec![\"build\", \"test\", \"lint\", \"deploy\"]);\n    assert!(result.steps.iter().all(|s| s.status == StepStatus::Completed));\n}\n```\n\nAdapt: handler name, payload, expected step names in order. `result.steps` is in execution order; parallel steps appear in the order they were declared.\n\n## 3. Fixtures for agent steps\n\nFirst run records, later runs replay:\n\n```bash\nIRONFLOW_RECORD=1 cargo test -p workflows --test \u003Chandler>   # calls the provider, writes tests\u002Ffixtures\u002F\u003Chash>.json\ncargo test -p workflows --test \u003Chandler>                     # replays, no tokens spent\n```\n\nThe hash covers the prompt, system prompt and output schema, so a prompt change means re-recording. The nonce of a `Prompt` untrusted block is masked first: it changes on every run without changing the fixture, as long as it only appears in the block tags. Commit `tests\u002Ffixtures\u002F`. A missing fixture falls back to the real provider with a warning, which is how a stale suite silently starts costing money: check the test output for `fixture not found`.\n\n## 4. Verify\n\n```bash\ncargo test -p workflows --test \u003Chandler>\n```\n\nReport the assertion list and whether a fixture was recorded.\n\n## What the engine does with a failure\n\n`run_handler` returns `Err(EngineError)` when the handler fails: a payload that does not deserialize, a shell step with a non-zero exit code, an HTTP transport error. Assert on the error text with `err.to_string()`. A step configured with `allow_failure()` does not fail the run; the run ends with `RunStatus::Warning` instead.\n\n## Shell steps in tests\n\nThey spawn real processes. Keep commands portable (`echo`, `true`, `sh -c`) or gate the test on the tool with a runtime check, never by mocking the step.\n\nUse the real `Engine` when the test must exercise real commands; use `TestEngine` when it must exercise the handler's logic.\n","# Ironflow workflow test\n\nBlack box: run the real handler against the in-memory store and assert on what was persisted. Two levels: `TestEngine` mocks the outside world (shell, HTTP, agent, approval) to exercise the handler's logic; the real `Engine` spawns real processes and replays recorded agent fixtures so the suite never spends tokens.\n\n## Unit test with TestEngine\n\nWhen every step of the handler is a shell, HTTP, agent or approval step, skip the engine boilerplate: `TestEngine` runs the real handler against an in-memory store with those steps mocked. No server, no worker, no Postgres, no process spawned.\n\n```rust,no_run\nuse ironflow_engine::config::ShellConfig;\nuse ironflow_engine::context::WorkflowContext;\nuse ironflow_engine::handler::{HandlerFuture, WorkflowHandler};\nuse ironflow_engine::testing::{MockShellOutput, TestEngine};\nuse ironflow_store::models::{RunStatus, StepStatus};\nuse serde_json::json;\n\n\u002F\u002F In a real project: `use workflows::handlers::Deploy;`\nstruct Deploy;\n\nimpl WorkflowHandler for Deploy {\n    fn name(&self) -> &str {\n        \"deploy\"\n    }\n    fn execute\u003C'a>(&'a self, ctx: &'a mut WorkflowContext) -> HandlerFuture\u003C'a> {\n        Box::pin(async move {\n            ctx.shell(\"build\", ShellConfig::new(\"cargo build\")).await?;\n            ctx.shell(\"ship\", ShellConfig::new(\".\u002Fship.sh\")).await?;\n            Ok(())\n        })\n    }\n}\n\n#[tokio::test]\nasync fn deploy_builds_then_ships() {\n    let result = TestEngine::new()\n        .with_handler(Deploy)\n        .with_mock_shell(|cfg| match cfg.command.as_str() {\n            \"cargo build\" => Ok(MockShellOutput::ok(\"compiled\")),\n            _ => Ok(MockShellOutput::ok(\"shipped\")),\n        })\n        .run(json!({\"environment\": \"staging\"}))\n        .await\n        .expect(\"the harness ran the handler\");\n\n    assert_eq!(result.status(), RunStatus::Completed);\n    assert_eq!(result.step_names(), vec![\"build\", \"ship\"]);\n    assert_eq!(result.step(\"build\").step_output().stdout(), \"compiled\");\n    assert_eq!(result.step(\"ship\").status(), StepStatus::Completed);\n}\n```\n\nBuilders: `with_handler`, `with_mock_shell`, `with_mock_http`, `with_mock_agent`, `with_recorded_agent(dir)`, `with_mock_approval`, `with_mock_human_input`, `with_mock_signal`, `with_agent_provider`, `with_decision_provider`, `with_secret(key, value)` (`secret-store` feature). Then `run(payload)`, `run_workflow(name, payload)` or `resume(run_id)`.\n\nA handler that fails is not an `Err`: `result.status()` is `RunStatus::Failed` and `result.error()` carries the message. A non-zero `MockShellOutput::failed(1, \"boom\")` fails the step like a real non-zero exit; a non-2xx `MockHttpResponse` is a normal output, like a real 500. Without `with_mock_approval`, a gate suspends the run (`RunStatus::AwaitingApproval`) and `resume(run_id)` continues it. `with_mock_human_input(|name, cfg| HumanInputOutcome::Provided(json!({..})))` answers every `ctx.human_input` step with a value that must deserialize into the handler's type; `HumanInputOutcome::reject(\"reason\")` makes the handler receive `EngineError::HumanInputRejected`. `with_mock_signal(|step, name, key| SignalOutcome::Received(json!({..})))` resolves every `ctx.wait_for_signal` step with that payload; `SignalOutcome::TimedOut` makes it return `None`.\n\nAn approval gate, two ways. `with_mock_approval` takes an `ApprovalOutcome` value, not a\nclosure: `ApprovalOutcome::Approved` or `ApprovalOutcome::reject(\"reason\")`. To assert the\nsuspension itself, leave the gate unmocked, then `resume` the same run:\n\n```rust,no_run\nuse ironflow_engine::config::{ApprovalConfig, ShellConfig};\nuse ironflow_engine::context::WorkflowContext;\nuse ironflow_engine::handler::{HandlerFuture, WorkflowHandler};\nuse ironflow_engine::testing::{ApprovalOutcome, MockShellOutput, TestEngine};\nuse ironflow_store::models::RunStatus;\nuse serde_json::json;\n\nstruct Release;\n\nimpl WorkflowHandler for Release {\n    fn name(&self) -> &str {\n        \"release\"\n    }\n    fn execute\u003C'a>(&'a self, ctx: &'a mut WorkflowContext) -> HandlerFuture\u003C'a> {\n        Box::pin(async move {\n            ctx.shell(\"build\", ShellConfig::new(\"cargo build\")).await?;\n            ctx.approval(\"ship\", ApprovalConfig::new(\"Publish?\")).await?;\n            ctx.shell(\"publish\", ShellConfig::new(\".\u002Fpublish.sh\")).await?;\n            Ok(())\n        })\n    }\n}\n\n#[tokio::test]\nasync fn release_waits_for_approval_then_publishes() {\n    let mut harness = TestEngine::new()\n        .with_handler(Release)\n        .with_mock_shell(|_cfg| Ok(MockShellOutput::ok(\"\")));\n\n    let suspended = harness.run(json!({})).await.expect(\"the harness ran the handler\");\n    assert_eq!(suspended.status(), RunStatus::AwaitingApproval);\n    assert_eq!(suspended.step_names(), vec![\"build\", \"ship\"]);\n\n    \u002F\u002F Records the approval vote on the open gate and replays the handler.\n    let resumed = harness.resume(suspended.run_id()).await.expect(\"the run resumed\");\n    assert_eq!(resumed.status(), RunStatus::Completed);\n    assert_eq!(resumed.step_names(), vec![\"build\", \"ship\", \"publish\"]);\n}\n\n#[tokio::test]\nasync fn release_publishes_when_approved_upfront() {\n    let result = TestEngine::new()\n        .with_handler(Release)\n        .with_mock_shell(|_cfg| Ok(MockShellOutput::ok(\"\")))\n        .with_mock_approval(ApprovalOutcome::Approved)\n        .run(json!({}))\n        .await\n        .expect(\"the harness ran the handler\");\n    assert_eq!(result.status(), RunStatus::Completed);\n}\n```\n\n`result.output()` is the run output the handler set with `ctx.set_output` (`Value::Null` when it set none), not the last step's output: that one is `result.steps().last()`. Read it back into the handler's type:\n\n```rust,no_run\nuse ironflow_engine::context::WorkflowContext;\nuse ironflow_engine::handler::{HandlerFuture, WorkflowHandler};\nuse ironflow_engine::testing::TestEngine;\nuse serde::{Deserialize, Serialize};\nuse serde_json::{from_value, json};\n\n#[derive(Debug, PartialEq, Serialize, Deserialize)]\nstruct Verdict {\n    approved: bool,\n}\n\nstruct Review;\n\nimpl WorkflowHandler for Review {\n    fn name(&self) -> &str {\n        \"review\"\n    }\n    fn execute\u003C'a>(&'a self, ctx: &'a mut WorkflowContext) -> HandlerFuture\u003C'a> {\n        Box::pin(async move {\n            ctx.set_output(&Verdict { approved: true })?;\n            Ok(())\n        })\n    }\n}\n\n#[tokio::test]\nasync fn review_approves() {\n    let result = TestEngine::new()\n        .with_handler(Review)\n        .run(json!({}))\n        .await\n        .expect(\"the harness ran the handler\");\n\n    let verdict: Verdict = from_value(result.output().clone()).expect(\"a verdict\");\n    assert_eq!(verdict, Verdict { approved: true });\n}\n```\n\nNot covered: `ctx.operation(...)` (pass a test-double `Operation` to the handler), `ctx.delay(...)` (still sleeps the run) and `ctx.decision(...)` (needs a real `DecisionProvider`).\n\n## 1. Locate\n\n```bash\ngrep -rn \"impl WorkflowHandler for\" --include=*.rs .      # the handler\ngrep -rl \"pub fn handlers\" --include=*.rs .              # the workflows crate\nls workflows\u002Ftests 2>\u002Fdev\u002Fnull                            # existing tests and fixtures\n```\n\nDev-dependencies the test needs, added once per crate (skip those already present):\n\n```bash\ncargo add -p workflows --dev ironflow-core ironflow-store serde_json\ncargo add -p workflows --dev tokio --features macros,rt-multi-thread\n```\n\n## 2. Write the test\n\nOne file per handler in `workflows\u002Ftests\u002F\u003Chandler>.rs`:\n\n```rust,no_run\nuse std::sync::Arc;\n\nuse ironflow_core::provider::AgentProvider;\nuse ironflow_core::providers::claude::ClaudeCodeProvider;\nuse ironflow_core::providers::record_replay::RecordReplayProvider;\nuse ironflow_engine::context::WorkflowContext;\nuse ironflow_engine::engine::Engine;\nuse ironflow_engine::handler::{HandlerFuture, WorkflowHandler};\nuse ironflow_store::memory::InMemoryStore;\nuse ironflow_store::models::{RunStatus, StepStatus, TriggerKind};\nuse ironflow_store::store::Store;\nuse serde_json::json;\n\n\u002F\u002F In a real project: `use workflows::handlers;`\nstruct Deploy;\n\nimpl WorkflowHandler for Deploy {\n    fn name(&self) -> &str {\n        \"deploy\"\n    }\n    fn execute\u003C'a>(&'a self, _ctx: &'a mut WorkflowContext) -> HandlerFuture\u003C'a> {\n        Box::pin(async move { Ok(()) })\n    }\n}\n\nfn handlers() -> Vec\u003CBox\u003Cdyn WorkflowHandler>> {\n    vec![Box::new(Deploy)]\n}\n\nfn engine() -> Engine {\n    let store: Arc\u003Cdyn Store> = Arc::new(InMemoryStore::new());\n    \u002F\u002F Replays `tests\u002Ffixtures\u002F\u003Chash>.json`; records with IRONFLOW_RECORD=1.\n    let provider: Arc\u003Cdyn AgentProvider> = Arc::new(RecordReplayProvider::new(\n        ClaudeCodeProvider::new(),\n        \"tests\u002Ffixtures\",\n    ));\n    let mut engine = Engine::new(store, provider);\n    for handler in handlers() {\n        engine.register(handler).expect(\"handler names are unique\");\n    }\n    engine\n}\n\n#[tokio::test]\nasync fn deploy_to_staging_completes() {\n    let result = engine()\n        .run_handler(\n            \"deploy\",\n            TriggerKind::Manual,\n            json!({\"git_ref\": \"main\", \"environment\": \"staging\"}),\n        )\n        .await\n        .expect(\"run completes\");\n\n    assert_eq!(result.run.status.state, RunStatus::Completed);\n    let names: Vec\u003C&str> = result.steps.iter().map(|s| s.name.as_str()).collect();\n    assert_eq!(names, vec![\"build\", \"test\", \"lint\", \"deploy\"]);\n    assert!(result.steps.iter().all(|s| s.status == StepStatus::Completed));\n}\n```\n\nAdapt: handler name, payload, expected step names in order. `result.steps` is in execution order; parallel steps appear in the order they were declared.\n\n## 3. Fixtures for agent steps\n\nFirst run records, later runs replay:\n\n```bash\nIRONFLOW_RECORD=1 cargo test -p workflows --test \u003Chandler>   # calls the provider, writes tests\u002Ffixtures\u002F\u003Chash>.json\ncargo test -p workflows --test \u003Chandler>                     # replays, no tokens spent\n```\n\nThe hash covers the prompt, system prompt and output schema, so a prompt change means re-recording. The nonce of a `Prompt` untrusted block is masked first: it changes on every run without changing the fixture, as long as it only appears in the block tags. Commit `tests\u002Ffixtures\u002F`. A missing fixture falls back to the real provider with a warning, which is how a stale suite silently starts costing money: check the test output for `fixture not found`.\n\n## 4. Verify\n\n```bash\ncargo test -p workflows --test \u003Chandler>\n```\n\nReport the assertion list and whether a fixture was recorded.\n\n## What the engine does with a failure\n\n`run_handler` returns `Err(EngineError)` when the handler fails: a payload that does not deserialize, a shell step with a non-zero exit code, an HTTP transport error. Assert on the error text with `err.to_string()`. A step configured with `allow_failure()` does not fail the run; the run ends with `RunStatus::Warning` instead.\n\n## Shell steps in tests\n\nThey spawn real processes. Keep commands portable (`echo`, `true`, `sh -c`) or gate the test on the tool with a runtime check, never by mocking the step.\n\nUse the real `Engine` when the test must exercise real commands; use `TestEngine` when it must exercise the handler's logic.\n",{"name":5,"description":7,"user-invocable":30},"main","044fff6a01f24beff6afc538268aaf1ab0c95ba0","plugins\u002Fironflow\u002Fskills\u002Ftest",1,"https:\u002F\u002Fgithub.com\u002FThomasTartrau\u002Fironflow","https:\u002F\u002Fgithub.com\u002FThomasTartrau","2026-11-04 18:52:31",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add ThomasTartrau\u002Fironflow --skill test",{"tool":47,"command":48},"bunx","bunx skills add ThomasTartrau\u002Fironflow --skill test",{"tool":50,"command":51},"pnpm","pnpm dlx skills add ThomasTartrau\u002Fironflow --skill test","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FThomasTartrau\u002Fironflow\u002Fblob\u002Fmain\u002Fplugins\u002Fironflow\u002Fskills\u002Ftest\u002FSKILL.md",true,[],[56,72,95,111,124,139],{"skillNo":57,"name":19,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":29},"01M6EKJCDS84KZCE9F8G5D2ZW0","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.","https:\u002F\u002Fgithub.com\u002FThomasTartrau\u002Fironflow\u002Fblob\u002Fmain\u002Fplugins\u002Fironflow\u002Fskills\u002Fworkflow\u002FSKILL.md",[],[19,62,63,64,65,23,66,67,24,68,69,27,70,28,71],"http","shell","parallel","decision","approval","schema","registration","human","input","for",{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":29},"01M6EKJ8WSG7KC0M71GSN3N82K","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.","https:\u002F\u002Fgithub.com\u002FThomasTartrau\u002Fironflow\u002Fblob\u002Fmain\u002Fplugins\u002Fironflow\u002Fskills\u002Fupgrade\u002FSKILL.md",[],[74,79,80,81,82,83,84,85,86,24,87,88,89,90,91,92,93,27,94,28],"change","code","changelog","audit","Bash","migrate","diff","log","maps","migrations","show","scan","git log","project","cargo","scripts",{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":29},"01M6EKJ0NJYWEPJ9XX55GSYR44","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.","https:\u002F\u002Fgithub.com\u002FThomasTartrau\u002Fironflow\u002Fblob\u002Fmain\u002Fplugins\u002Fironflow\u002Fskills\u002Fsetup\u002FSKILL.md",[],[97,19,5,102,103,104,105,106,83,107,24,92,108,26,109,110,93,27,94,28],"workflows","hello","server","api","api server","workspace","worker","binary","lib",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":29},"01M6EKHWQRBXVMK7YXT3DV3XDH","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.","https:\u002F\u002Fgithub.com\u002FThomasTartrau\u002Fironflow\u002Fblob\u002Fmain\u002Fplugins\u002Fironflow\u002Fskills\u002Foperation\u002FSKILL.md",[],[113,118,62,119,120,105,23,24,121,27,28,122,71,123],"slack","gitlab","integration","as","http api","custom",{"skillNo":125,"name":28,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":29},"01M6EKHS2MNPSZ9A0B96HWGHZG","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\".","https:\u002F\u002Fgithub.com\u002FThomasTartrau\u002Fironflow\u002Fblob\u002Fmain\u002Fplugins\u002Fironflow\u002Fskills\u002Fironflow\u002FSKILL.md",[],[28,130,131,132,19,5,80,82,104,22,133,134,135,136,137,74,92,108,26,138],"testing","writing","review","use","version","up","en","bump","trigger",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":29},"01M6EKHNAEEZPNYY5ST70AXTHV","ops-crate","Generate a new ops\u002Fxxx 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\u002Fxxx\", \"nouveau crate ops\", \"ironflow ops\".","https:\u002F\u002Fgithub.com\u002FThomasTartrau\u002Fironflow\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fops-crate\u002FSKILL.md",[],[146,147,62,148,120,149,150,151,152,153,154,155,156,157,138,158,159,160],"ops","ops crate","generate","macro","direct","quality","Wrapper","checklist","structure","pattern","full","service","name","add","scaffolds"]