data-driven-workflows
Skill13 starsChanged 36 days agoMITView on GitHub
Grammar for for_each over an upstream runtime array and per-item when. Irrelevant to fixed task lists, parallel branches, waits, or ordinary DAGs.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-featureSkill
- update-schema-docsSkill
- azure-resourcesSkill
- actionable-pr-reportSkill
- pr-status-analysisSkill
- glossarySkill
- style-guideSkill
- api-guideSkill
- guide-childSkill
- guide-parentSkill
- excludedSkill
- too-deepSkill
- groupedSkill
- childSkill
- parentSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when a workflow plan must decide at runtime whether work should run or must apply the same tool or Sub Agent task to a …
- Distinctive: line 77
Use collections that are already bounded.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data-driven workflows
Use this skill when a workflow plan must decide at runtime whether work should run or must apply the same tool or Sub Agent task to a collection discovered by an earlier task.
Collection fan-out
for_each is allowed on a tool or sub_agent task only, never wait. Its
value must be one full reference to an upstream JSON array:
{
"id": "inspect",
"type": "tool",
"tool": "inspect_incident",
"depends_on": ["discover"],
"for_each": "${discover.result.items}",
"args": {
"incident": "${item}",
"source_index": "${index}"
}
}Inside that task's value fields (args, a Sub Agent's task, and when.ref),
use these iteration locals:
${item}for the whole element${item.path.to.field}for a field within the element${index}for its zero-based source position
The locals are valid only inside a for_each task. item and index are reserved task ids
and must never be authored as task id values. Keep the target tool/agent name static; only
value fields vary per item.
Runtime conditions
when is a constrained predicate:
{
"ref": "${item.requires_action}",
"operator": "equals",
"value": true
}The exact shape is:
{"ref": "${...}", "operator": "equals" | "not_equals", "value": <scalar>}ref must be one full upstream reference or, during iteration, one full
iteration-local reference. value must be a JSON scalar: null, boolean, number,
or string. Comparison uses exact typed equality only. There is no coercion,
truthiness, ordering, regex, boolean composition, or function call.
The condition is evaluated before executable args or task templates are
resolved. A false condition schedules no Activity or timer and produces a null
result. A skip does not propagate: each downstream task that belongs to the
conditional branch must declare its own when.
Fan-in and limits
The logical for_each task exposes one array of {index, status, result}
envelopes in source order. Skipped positions remain in the array with a null
result. Depend on the logical task id and consume the full aggregate with
${node_id.result}; individual runtime instances cannot be referenced.
Use collections that are already bounded. Filter or cap the array upstream so materialized items stay within workflow node limits and runnable instances stay within workflow parallelism limits.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

