workflow-decompose
Skill1 starsChanged 23 days agoMITView on GitHub
'Decompose any workflow into a DAG: trigger → conditions → actions →
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- .gemini/AGENTS.mdAGENTS.md
- .cursor/rules/agent-foundry-orchestrator.mdcCursor rule
- .cursor/rules/agent-foundry-skills.mdcCursor rule
- web/llms.txtllms.txt
- anti-slopSkill
- api-designSkill
- automation-pickSkill
- bottleneck-gatingSkill
- budget-guardSkill
- cache-identitySkill
- constraint-then-solveSkill
- context-optimizationSkill
- cron-troubleshootSkill
- e2e-test-strategySkill
- engram-routingSkill
- execution-observabilitySkill
- fallback-model-routingSkill
- feedback-loopSkill
- judge-integritySkill
- knowledge-extractSkill
- landscape-firstSkill
- measure-firstSkill
- plan-before-codeSkill
- plan-then-actSkill
- prompt-disciplineSkill
- pushback-when-wrongSkill
- quality-protocolSkill
- read-before-buildSkill
- re-verify-findingsSkill
- session-closeoutSkill
- session-distillSkill
- show-your-workSkill
- structured-output-contractSkill
- verify-firstSkill
- agent-memory-vaultSkill
- agent-team-standardsSkill
- autonomous-briefingSkill
- book-to-skillSkill
- chrome-devtools-mcp-bridgeSkill
- design-languageSkill
- funnel-pr-guardSkill
- persistent-memorySkill
- sql-migration-trioSkill
- token-compressionSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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 21
Every workflow is a directed acyclic graph with five node types:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Workflow Decompose
Decompose any workflow into a reusable DAG. Same model works for cron, n8n, GitHub Actions, or scripts.
Procedure
The DAG Model
Every workflow is a directed acyclic graph with five node types:
[trigger] → [condition] → [action] → [retry] → [observe]| Type | Purpose | Example |
| Trigger | Starts the workflow | Cron, webhook, event, manual |
| Condition | Gate; skip branch if false | "user has paid plan" |
| Action | Does the work | API call, DB write, email |
| Retry | Recovery on failure | Backoff, max attempts, DLQ |
| Observe | Logs, metrics, alerts | Log to DB, emit metric, page |
Worked Example: "Send weekly digest"
Trigger: cron(0 9 * * 1)
Condition: db.users.count(active_in_last_7d > 0)
Action: fetch eligible_users
Condition: eligible_users.length > 0
Action: render digest HTML
Action: send via email provider
Retry: exponential backoff, 3 attempts, fail → DLQ
Observe: log sent_count, failed_count, duration_ms
Observe: emit metric('digest.sent')
Observe: if failed_count > 0 → alertTrigger Design
| Trigger | Use when | Watch out for |
| Cron | Time-based, batch | Timezone drift, DST |
| Webhook | External event | Replay, ordering, idempotency |
| Event bus | Internal service event | Schema evolution, lost events |
| Manual | On-demand | No automation, easy to forget |
| File watch | File lands in S3 | Missed events, partial uploads |
Rule: one trigger per workflow. Multiple triggers = multiple workflows.
Conditions
Conditions save you from:
- Running on empty data ("send to 0 users")
- Running outside business hours
- Running during maintenance
- Re-running an already-completed step
if eligible_users.empty:
logger.info("no eligible users; skipping")
returnAnti-patterns
- A workflow with several triggers and no separation.
- Retry without a max attempt or dead-letter path.
- A condition with no observable skip reason.
- Success with no metric or alert.
References
- details
Verification Checklist
- Trigger, conditions, actions, retry, and observe are explicit.
- The workflow has one trigger.
- Every branch has a skip or failure outcome.
- Retry limits and dead-letter handling are defined.
- Success emits a metric or log that can alert.
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.

