Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/coleam00/context-engineering-intro/prime-workflowsgit clone --depth 1 https://github.com/coleam00/context-engineering-introWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00008 | $0.00832 |
| Opus 5 | $0.00004 | $0.00416 |
| Sonnet 5 | $0.00002 | $0.00166 |
| Haiku 4.5 | $0.00001 | $0.00083 |
Grade A, and why
prime-workflows scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to prime-workflows — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Prime Workflows: Workflow Engine Orientation
Objective
Orient on the workflow engine (packages/workflows/) before working on workflow execution,
YAML parsing, DAG logic, routing, or observability.
Process
1. Understand the Workflow Package Structure
!ls packages/workflows/src/
2. Understand Workflow Type Definitions
Read packages/workflows/src/types.ts in full — the complete type system for workflow
definitions: WorkflowDefinition, WorkflowStep, WorkflowNode (DAG), LoopConfig,
NodeType (command / prompt / bash), TriggerRule, OutputFormat, tool restriction fields.
3. Understand the Executor
Read packages/workflows/src/executor.ts first 80 lines — executeWorkflow() entry point,
the three mutually exclusive execution modes (steps, loop, nodes/DAG), artifact directory setup,
variable substitution via $ARTIFACTS_DIR / $WORKFLOW_ID.
Read packages/workflows/src/dag-executor.ts first 80 lines — topological sort, concurrent
node dispatch for independent nodes in the same layer, when: condition evaluation,
trigger_rule join semantics, $nodeId.output substitution.
4. Understand the Loader
Read packages/workflows/src/loader.ts first 60 lines — discoverWorkflows() / discoverWorkflowsWithConfig(),
resilient loading (one bad YAML doesn't abort), model validation at load time,
bundled defaults merging with repo-specific workflows.
5. Understand the Router
Read packages/workflows/src/router.ts first 60 lines — how incoming messages are matched
to workflows, case-insensitive matching, archon-assist fallback, Codex tool bypass detection.
6. Understand Observability
Read packages/workflows/src/event-emitter.ts — WorkflowEventEmitter, emitted event types
(step_started, step_completed, node events, loop iterations, artifacts), how the server
bridges these to SSE via WorkflowEventBridge.
7. Understand Dependency Injection
Read packages/workflows/src/deps.ts — WorkflowDeps type: IWorkflowPlatform,
IWorkflowAssistantClient, IWorkflowStore injected at runtime. No direct DB or AI imports
inside this package.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 97 lines · 8 tokens per session scan A ad6d90d59857
prime-workflows is a command published in the GitHub repository coleam00/context-engineering-intro (13,819 stars, last pushed 5mo ago), licensed MIT. It adds 8 tokens to every session and 832 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to prime-workflows, differing in 2 lines, and is treated as a copy.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.