prime-workflows

A code-reading command that gives an agent the background it needs to work on Archon's workflow engine, which runs sequential steps, loops, and dependency-based task graphs.

In plain words
What is it for?
Use it before editing workflow definitions, the executor, dependency-based node logic, variable substitution, or execution conditions.
Why use it?
It reduces the risk of changing workflow execution, YAML loading, routing, or monitoring code without understanding how the parts fit together.

Command for Claude Code

Install

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.

agentmods
npx agentmods add commands/coleam00/context-engineering-intro/prime-workflows
Clone the repo
git clone --depth 1 https://github.com/coleam00/context-engineering-intro

Made for: Claude Code.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 832 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What 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.

ModelPer sessionOnce 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

Measured 3d ago against content hash ad6d90d59857, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

Origin

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.

use-cases/ai-coding-wisc-framework/.claude/commands/prime-workflows.md · 97 lines

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.tsWorkflowEventEmitter, 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.tsWorkflowDeps type: IWorkflowPlatform, IWorkflowAssistantClient, IWorkflowStore injected at runtime. No direct DB or AI imports inside this package.

Read the full file on GitHub · 97 lines

Changes

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.

  1. 3d ago First seen · 97 lines · 8 tokens per session scan A ad6d90d59857

Subscribe to this mod's changes

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.