flows — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited flows (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Comprehensive skill for building CrewAI Flows with structured state management, event-driven control, and production-ready patterns.
python scripts/scaffold_flow.py my_flowUse structured state with Pydantic for type safety:
from pydantic import BaseModel
class MyState(BaseModel):
input_data: str = ""
processed: bool = False
results: list = []from crewai.flow.flow import Flow, listen, start
class MyFlow(Flow[MyState]):
@start()
def initialize(self):
self.state.input_data = "sample"
return "initialized"
@listen(initialize)
def process(self, _):
self.state.processed = True
return "completed"python scripts/validate_flow.py my_flow/main.py
python my_flow/main.pypython scripts/validate_flow.py ./my_flow/main.pyValidates:
flow = MyFlow()
result = flow.kickoff()from pydantic import BaseModel
class AppState(BaseModel):
user_input: str = ""
processing_result: str = ""
completed: bool = False
class MyFlow(Flow[AppState]):
@start()
def init(self):
self.state.user_input = "hello"
return "ok"Benefits:
class MyFlow(Flow):
@start()
def init(self):
self.state["key"] = "value" # Dictionary access
return "ok"Use for:
Entry point for flow execution.
Unconditional:
@start()
def init(self):
return "started"Conditional:
@start("previous_method")
def resume(self):
return "resumed"Listen to method completion or router labels.
Single source:
@listen(init)
def process(self, result):
return f"Got: {result}"Multiple sources (AND):
from crewai.flow.flow import and_
@listen(and_(step_a, step_b))
def merge(self, _):
return "both completed"Alternative sources (OR):
from crewai.flow.flow import or_
@listen(or_(option_a, option_b))
def handle_either(self, _):
return "one completed"Label-based:
@listen("approved")
def publish(self):
return "published"Conditional routing with labels.
@router(evaluate)
def quality_gate(self, _):
if self.state.score > 80:
return "approved"
elif self.state.score > 60:
return "revision"
else:
return "rejected"
@listen("approved")
def handle_approval(self): ...
@listen("revision")
def handle_revision(self): ...Automatic state persistence.
Class-level:
from crewai.flow.persistence import persist
@persist()
class MyFlow(Flow[MyState]): ...Method-level:
@persist()
@listen(process)
def critical_step(self, _): ...@start() → @listen → @listen → final@start() → @router → "revision" → @listen → back to @router
→ "approved" → @listen → complete ┌→ branch_a ─┐
@start() ─┤ ├→ @listen(and_(a, b)) → complete
└→ branch_b ─┘@start()
def collect_items(self):
self.state.items = []
return "start"
@listen(collect_items)
def add_item(self, _):
self.state.items.append(new_item)
if len(self.state.items) < 10:
return self.add_item("") # Loop
return "complete"Create new flow projects:
python scripts/scaffold_flow.py my_flow
python scripts/scaffold_flow.py my_flow --path ./projects --with-crewValidate flow structure:
python scripts/validate_flow.py ./my_flow/main.pyGenerate visualization:
python scripts/plot_flow.py ./my_flow/main.py --output flow.htmlInteractive state generator:
python scripts/generate_state.py --output state.pyassets/starter/main.py - Complete working flow with persistenceassets/starter/README.md - Project documentationassets/templates/flow-basic.py - Simple @start/@listenassets/templates/flow-advanced.py - Router, persistence, and_/or_assets/templates/state-structured.py - Pydantic state modelsassets/templates/state-unstructured.py - Dictionary statereferences/api/decorators.md - Complete decorator reference (@start, @listen, @router, @persist, and_, or_)references/api/state-management.md - State approaches, lifecycle, persistencereferences/api/flow-attributes.md - Flow class attributes and methodsreferences/guides/state-patterns.md - Accumulator, Pipeline, Branching, Retry, Progress, Error Recovery, Crew Integrationreferences/guides/control-primitives.md - Sequential, Conditional Routing, Parallel, Alternative Paths, Human-in-the-Loop, Multi-Startreferences/external.md - Official documentation links"No @start decorator found"
Error: Flow must have at least one @start methodSolution: Add @start() decorator to entry point method
"Router label has no listener"
Error: Router returns label 'approved' but no @listen('approved') foundSolution: Add matching listener for each router label
"Circular dependency detected"
Error: Circular dependency in decorator chainSolution: Remove circular @listen references
"State field not found"
Error: 'MyState' object has no attribute 'unknown_field'Solution: Add field to Pydantic model or check field name spelling
"Invalid state model"
Error: State model must inherit from pydantic.BaseModelSolution: Ensure state class inherits from BaseModel
import logging
logging.basicConfig(level=logging.INFO)@listen(step)
def next_step(self, _):
print(f"State: {self.state}")
...python scripts/plot_flow.py main.pyprint(f"Flow ID: {flow.state.id}")assets/templates/flow-basic.pyreferences/guides/state-patterns.mdreferences/guides/control-primitives.mdflows/
├── SKILL.md # This file
├── assets/
│ ├── starter/ # Complete working flow
│ │ ├── main.py # Production-ready example
│ │ └── README.md # Project documentation
│ └── templates/ # Progressive examples
│ ├── flow-basic.py # Simple decorators
│ ├── flow-advanced.py # Router, persistence
│ ├── state-structured.py # Pydantic models
│ └── state-unstructured.py # Dictionary state
├── references/
│ ├── api/ # API documentation
│ │ ├── decorators.md # @start, @listen, @router, @persist
│ │ ├── state-management.md # State approaches & lifecycle
│ │ └── flow-attributes.md # Flow class reference
│ ├── guides/ # How-to guides
│ │ ├── state-patterns.md # Common state patterns
│ │ └── control-primitives.md # Control flow patterns
│ └── external.md # Official docs links
└── scripts/ # Executable tools
├── scaffold_flow.py # Project scaffolding
├── validate_flow.py # Structure validation
├── plot_flow.py # Visualization
└── generate_state.py # State model generatorAlways start with Flow when building production AI applications:
@persist() class-level for full workflow checkpointing@persist() method-level for specific critical stepsassets/starter/ for a complete working examplereferences/guides/ for patterns and best practicesscripts/scaffold_flow.py to create your first flowscripts/validate_flow.pyscripts/plot_flow.py~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.