> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SkillsFlow

> Deterministic, multi-step workflows that chain skills, agents, and tools via YAML in the workflows/ directory.

SkillsFlow lets you define deterministic, multi-step pipelines in `workflows/` as YAML. Chain `skill:`, `agent:`, and `tool:` steps with dependency ordering, template data flow, and per-step context via inputs.

## SkillsFlow Example

```yaml theme={null}
name: code-review-flow
description: Full code review pipeline

steps:
  - id: lint
    action: "Run static analysis on changed files"
    skill: static-analysis
    inputs:
      path: ${{ trigger.changed_files }}

  - id: review
    action: "Review code for security and performance issues"
    agent: code-reviewer
    depends_on: [lint]
    inputs:
      findings: ${{ steps.lint.outputs.issues }}
      focus: "Focus on security and performance. Flag any use of eval() or raw SQL."

  - id: test
    action: "Run the test suite with coverage"
    tool: bash
    depends_on: [lint]
    inputs:
      command: "npm test -- --coverage"

  - id: report
    action: "Summarise review findings and test coverage"
    skill: review-summary
    depends_on: [review, test]
    conditions:
      - ${{ steps.review.outputs.severity != 'none' }}
    inputs:
      review: ${{ steps.review.outputs.comments }}
      coverage: ${{ steps.test.outputs.report }}

error_handling:
  on_step_failure: escalate
  escalation_target: "eng-reviews"
```

## Key Concepts

| Concept                         | Description                                                                                              |
| ------------------------------- | -------------------------------------------------------------------------------------------------------- |
| **Deterministic Execution**     | Skills run in declared order, not LLM discretion. Every run follows the same path.                       |
| **Data Flow via Templates**     | Chain outputs to inputs with `${{ steps.X.outputs.Y }}` template syntax.                                 |
| **Per-Step Context via inputs** | Pass extra guidance to a step through `inputs:`: the receiving skill or agent reads it as a named input. |
| **Mixed Step Types**            | Combine `skill:`, `agent:`, and `tool:` steps in a single flow for maximum flexibility.                  |

## Execution Pipeline

```
1. lint   (skill)    — runs immediately (no depends_on)
2. review (agent)    — runs after lint completes
3. test   (tool)     — runs after lint completes (parallel with review)
4. report (skill)    — runs after both review and test complete
```

Steps with `depends_on` block until their dependencies finish. Steps without `depends_on` run immediately.

## Step Types

| Type  | Key             | Description                                             |
| ----- | --------------- | ------------------------------------------------------- |
| Skill | `skill: <name>` | Runs a SKILL.md module                                  |
| Agent | `agent: <name>` | Delegates to a sub-agent defined in agent.yaml          |
| Tool  | `tool: <name>`  | Executes a tool directly (e.g. `bash`, `read`, `write`) |

<Note>
  SkillsFlow workflows live in the `workflows/` directory of your agent repo: version-controlled alongside everything else.
</Note>

<CardGroup cols={2}>
  <Card title="Skills Overview" icon="sparkles" href="/open-source/opengap/skills/overview">
    SKILL.md format and the skill discovery system
  </Card>

  <Card title="Agent Structure" icon="folder-tree" href="/open-source/opengap/agent-structure/overview">
    workflows/ directory in the full repo layout
  </Card>

  <Card title="Design Patterns" icon="lightbulb" href="/open-source/opengap/design-patterns">
    SkillsFlow and other git-native patterns
  </Card>

  <Card title="CLI" icon="terminal" href="/open-source/opengap/cli">
    Run and trigger workflows via CLI
  </Card>
</CardGroup>
