google/lightflow/create-lightflows
Claude Code and agent skill by google/lightflow
- vendor
Checking that the SKILL.md file is still in the repository.
Guides the design, authoring, compilation, and verification of new Python DAG workflows using Lightflow (YAML or JSON). Use when building a new multi-stage pipeline, authoring `actions.py` and `lightflow.yaml`, or scaffolding a workflow with the `create_lightflow` meta-workflow. For merely running or resuming an existing workflow, use `run_lightflows` instead.
Install
npx vskill@latest install google/lightflow/create-lightflowsSKILL.md
The same SKILL.md was published earlier as google/lightflow/create-lightflows.
Creating Lightflow Workflows (create_lightflows)
Lightflow coordinates multi-step operations between AI agents and human operators using an append-only state ledger (passport.json), safe AST-based CEL-like expressions, and selective subgraph re-arming.
Note: If you only need to execute, inspect, or resume an existingLightflow workflow, read therun_lightflowsskill instead.
1. Scaffolding a New Workflow via create_lightflow (3-Phase Meta-Workflow)
Instead of authoring a workflow from scratch in one shot, run the built-in 3-phase meta-workflow, which gates progress on deterministic AST signature checks, sample_payload return-contract smoke tests, unit test execution, and payload.outputs.<stage> DAG cross-checks. The meta-workflow ships in the Lightflow repository under examples/create_lightflow/: run it from a clone of github.com/google/lightflow, or pass the absolute path to examples/create_lightflow in your clone:
(python3 -m lightflow is equivalent to lightflow whenever the console script is not on PATH.)
- `align_on_design` (
operator_action): Align with the user on stage
boundaries (separate read/compute stages from external write/mutate stages), operator_action gates, and the output keys each stage produces under payload.outputs.<stage>.
- `implement_and_test_actions` $\rightarrow$ `verify_actions`: Write
actions.py + unit tests (or pass sample_payload); verify_actions parses the AST, smoke-tests that every action returns a JSON-serializable (dict, str) tuple, and runs unittest.
- `draft_and_explain_manifest` $\rightarrow$ `prove_manifest_dry_run`:
Write lightflow.yaml and explain the DAG to the user; prove_manifest_dry_run compiles the DAG, verifies that every payload.outputs.<stage> reference points to an upstream dependency in run_after, runs dry_run, and emits visualizer.html.
1b. Starting From an Existing SKILL.md
Most procedures worth moving into Lightflow already exist as a skill: a numbered list of steps an agent follows by hand. The translation is mechanical once each step is classified:
A step that… | becomes | because ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------- runs a command, calls an API, transforms data, writes a file | python_action | deterministic, testable, retryable; the agent never re-derives it needs judgment but no outside decision (triage findings, draft text, pick a remediation) | operator_action whose instructions tell the agent what to produce | the gate pauses the run, the agent does the work, then resumes with the result as payload needs a decision from a person (approve spend, confirm a destructive change) | operator_action whose instructions say who must decide | the resume stamp records who decided and from which session
Worked example. A skill that reads:
maps to:
Keep the skill: replace its step list with lightflow start --lightflow=<dir> and the gate-handling rules from skills/run_lightflows/SKILL.md. The judgment and the decision stay where they were; only the mechanical steps and the ordering move into code. Run the create_lightflow meta-workflow above to scaffold and prove the result.
2. Workflow Manifest Reference (lightflow.yaml)
Define actions and stages in lightflow.yaml (or .json). python_import resolves relative to the workflow's directory (e.g. actions.fetch_metrics for actions.py in the same folder) as well as package paths:
3. Rules for Crash-Free Python Actions
- One Side Effect per Stage: Separate read/compute stages from external
write/mutate stages. Lightflow's Passport never re-runs COMPLETED stages on resume; make write stages safe to retry if they fail mid-execution (overwrite files instead of appending, or attach a rollback_action).
- Consistent Output Keys (`payload.outputs.<stage_name>`): Every return
path of an action (including any offline test mode for external APIs) must return a JSON-serializable (dict, str) with the exact same dictionary keys so downstream run_if and instructions expressions never crash.
- Cross-Check `payload.outputs.<stage>` Against `run_after`: Any stage
whose run_if or instructions reads payload.outputs.<upstream>.<key> must list <upstream> (directly or transitively) in run_after.
- Timeouts, Polling & Resilience: Set stage-level
timeout_seconds
(0–86400; 0 disables the bound) on a stage to bound a python_action (or individual poll tick); for long-running external jobs, prefer polling_policy (condition, interval_seconds, timeout_seconds, max_attempts, optional poll_tick_action), which persists each tick's progress message to passport.json so lightflow status shows live progress. Use retry_policy for transient errors and rollback_action / trigger_rule: ALL_DONE for cleanup; keep cleanup stages idempotent, since an ALL_DONE stage that ran on a failure path runs again after resume.
A polling stage in YAML (the tick action goes under poll_tick_action; a stage may not also set python_action):
```yaml
- name: await_job
run_after: [submit_job] polling_policy: condition: "payload.outputs.await_job.status == 'READY'" interval_seconds: 5 timeout_seconds: 600 # or max_attempts: 120 poll_tick_action: action_id: check_job # (dict, message) per tick ```
Each tick's returned dict is merged into payload.outputs.await_job before condition is evaluated, so a tick can read its own previous output.
- Converging After a Conditional Branch: Two stages with complementary
run_if conditions leave one of them SKIPPED. A stage that run_afters both must set trigger_rule: NONE_FAILED to run (the default ALL_SUCCESS skips it because an upstream was skipped; ALL_DONE would also run it after an upstream failure, which is only right for cleanup stages). dry_run points this out when it sees it.
- Optional Keys with `has(...)`: Under
strict_expressions, read a key
that may be absent (e.g. an optional gate field) as !has(payload.outputs.gate.note) || payload.outputs.gate.note != 'skip'. has() never raises.
- Strict Expressions \& Explicit Namespaces: Set top-level
strict_expressions: true on new lightflows so a misspelled or not-yet-populated key in run_if / condition / instructions fails the stage instead of silently evaluating to null (guard optional keys with has(...)). Read upstream values as payload.outputs.<stage>.<key> rather than the top-level mirror, which is last-writer-wins across stages; the engine warns when a stage overwrites a top-level key that an expression reads. outputs is a reserved top-level key (--payload may not set it).
4. Validating Your New Workflow
Before handing off or running in production, always verify compilation, CEL-like expression evaluation, and gate schemas:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 29 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/create_lightflows/SKILL.md
Popularity
- Repository stars
- 14
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/google/lightflow/create-lightflows)