directive
Skill155 starsChanged 9 months agoMITView on GitHub
Execute work through the directive pipeline — evaluate, plan, cast agents, build, review, and report. Takes a directive name (matching .context/directives/), a project path, or an ad-hoc CEO request.\n\nTRIGGER: Use this skill whenever the user requests non-trivial work that goes beyond a one-liner fix. This includes: building features, running projects with project.json, executing multiple tasks, multi-file changes, or any work with defined DOD/reviewers. Route through this pipeline so reviews and verification steps fire. Do NOT spawn builder agents directly.\n\nFor heavyweight/strategic work, create a directive file in .context/directives/ first. For medium work with an existing project.json, pass the project path. For quick multi-step tasks, pass an ad-hoc description — no directive file needed.
In this repository13 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- brainstormSkill
- code-review-excellenceSkill
- frontend-designSkill
- gruai-agentsSkill
- gruai-configSkill
- healthcheckSkill
- reportSkill
- scoutSkill
- seo-auditSkill
- smoke-testSkill
- walkthroughSkill
- webapp-testingSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Before executing, read .claude/agent-registry.json to map roles to agent names.
- Very specific: line 26
Use each agent's id field as the subagent_type value when spawning.
- Distinctive: line 34
DO NOT read source code. DO NOT edit files.
- Distinctive: line 38
If you catch yourself wanting to "just fix it quickly" — STOP.
- Very specific: line 55
Use the Write tool to overwrite the full directive.json
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Execute Directive
Execute the CEO directive: $ARGUMENTS
Role Resolution — Read First
Before executing, read .claude/agent-registry.json to map roles to agent names. The pipeline uses role-based language throughout. Resolve roles to concrete agent names using the registry:
- COO = the agent with
"title": "COO"(plans projects, orchestrates execution) - CTO = the agent with
"title": "CTO"(architecture, audits, reviews, technical decomposition) - CPO = the agent with
"title": "CPO"(product strategy, UX review, user perspective) - CMO = the agent with
"title": "CMO"(growth, SEO, content strategy) - Frontend Developer = the agent with
"title": "FE"(React, Tailwind, components) - Backend Developer = the agent with
"title": "BE"(server, API, infrastructure) - Full-Stack Engineer = the agent with
"title": "FS"(cross-domain work) - Data Engineer = the agent with
"title": "DE"(pipelines, parsers, indexing) - Content Builder = the agent with
"title": "CB"(MDX, documentation, copywriting) - QA Engineer = the agent with
"title": "QA"(testing, investigation, validation) - UI/UX Designer = the agent with
"title": "UX"(design review, wireframes, visual quality)
Use each agent's id field as the subagent_type value when spawning. Use the agentFile field to locate personality files. The registry is the single source of truth for who fills each role.
MANDATORY: Start with Triage — DO NOT SKIP
YOU MUST read and execute 00-delegation-and-triage.md BEFORE doing anything else.
DO NOT read source code. DO NOT edit files. DO NOT start solving the problem. The pipeline exists to ensure quality — every shortcut you take skips a review, a gate, or a verification step.
Your FIRST action must be: Read the triage doc, classify the directive weight, output the triage block, and create directive.json. Only then proceed to the next pipeline step.
If you catch yourself wanting to "just fix it quickly" — STOP. That impulse is exactly what the pipeline prevents. Even lightweight directives have a defined process (triage → context → audit → plan → build → review → digest → completion). The COO plans for ALL weights.
How to Use This Routing Map
This file is a routing table. Each row points to a modular doc containing full instructions for that step. Read only the docs you need for the current step — don't load everything at once.
Pipeline Progress Protocol
After completing each pipeline step, update .context/directives/{id}/directive.json:
- Set
pipeline.{stepId}.statusto"completed"with:agent: who performed this step (e.g. "CEO", "COO", "CTO, full-stack engineer")output: REQUIRED object with at least asummarystring (1-2 sentences of what happened/decided). Add other keys as relevant (e.g.decision,weight,projects).artifacts: array of file paths produced (if any)
- Set
current_stepto the next step's ID - Set
updated_atto the current ISO timestamp - Use the Write tool to overwrite the full directive.json
When starting a step, set pipeline.{stepId}.status to "active" and pipeline.{stepId}.agent to the array of participating agent first names (lowercase, e.g. ["sarah", "marcus", "morgan"]). This is critical for the dashboard game view — the game reads step agents to route characters to the meeting room during brainstorm/plan/clarification steps. Without this, characters won't move.
Why output is mandatory: The dashboard renders pipeline step details directly from directive.json. Without
output.summary, the UI shows empty steps — the CEO can't see what happened. Every step must leave a trace.
The server's directive-watcher reads directive.json directly (NOT current.json) and pushes pipeline state to the dashboard via WebSocket. Keeping pipeline updated is what makes the stepper UI show real-time progress.
Step Execution Loop
After completing a step and updating directive.json, immediately read the next step's doc from the routing table below and execute it. Do NOT stop, do NOT pause, do NOT ask for confirmation between steps. The pipeline is designed to run end-to-end in a single pass.
STOP gates — the only points where you must stop and wait for the CEO:
clarification— heavyweight/strategic: STOP and present synthesized intent for CEO verification. Lightweight/medium: still run the step (synthesize intent) but auto-approve without stopping. Do NOT skip this step — the verified_intent output feeds the COO planner.approve— heavyweight/strategic: STOP and present plan for CEO approval. Lightweight/medium: auto-approve without stopping.completion— all weights. The CEO must approve, amend, extend, or redirect the directive.
At every other step, transition directly to the next step without delay. If a step is skipped for the current weight class (brainstorm for lightweight/medium), set its status to "skipped" in directive.json and advance to the next step.
Pipeline Steps
| # | Step ID | Doc | Purpose | Depends On |
| 1 | triage | 00-delegation-and-triage.md | Triage directive weight + select process | — |
| 2 | checkpoint | 01-checkpoint.md | Check for existing checkpoint, resume if found | — |
| 3 | read | 02-read-directive.md | Read directive file + create directive.json | triage |
| 4 | context | 03-read-context.md | Read all context files before planning | read |
| 5 | audit | 06-technical-audit.md | Technical codebase audit | context |
| 6 | brainstorm | 04-brainstorm.md | Approach brainstorm (includes challenge for heavyweight/strategic) | audit |
| 7 | clarification | 04b-clarification.md | Synthesize verified intent (auto-approve for lightweight/medium) | audit |
| 8 | plan | 05-planning.md | COO strategic planning | clarification |
| 9 | approve | 07-plan-approval.md | Present plan to CEO for approval | plan |
| 10 | project-brainstorm | 07b-project-brainstorm.md | CTO + builder decompose projects into tasks with DOD | approve |
| 11 | setup | 08-worktree-and-state.md | Worktree isolation + directive state init | project-brainstorm |
| 12 | execute | 09-execute-projects.md | Execute all tasks (phases, agents, UX) | setup |
| 13 | review-gate | 09-execute-projects.md | Review verification gate (end of doc) | execute |
| 14 | wrapup | 10-wrapup.md | OKRs, follow-ups, stale doc detection, digest, lessons, report | review-gate |
| 15 | completion | 11-completion-gate.md | CEO completion gate -- approve, amend, extend, or redirect | wrapup |
Reference Docs — Schemas
| Doc | Content |
| plan-schema.md | COO plan output JSON schema |
| audit-output.md | Architect output JSON schema (design recommendations — second phase of two-agent audit) |
| investigation-output.md | QA Engineer's investigation output JSON schema (pure data — first phase of two-agent audit) |
| checkpoint.md | Checkpoint JSON schema (deprecated — merged into directive-json.md) |
| directive-json.md | Directive JSON schema (THE source of truth — includes pipeline progress for dashboard) |
| brainstorm-output.md | Brainstorm output JSON schema (proposals + rebuttals + challenge) |
Reference Docs — Templates
| Doc | Content |
| planner-prompt.md | Full COO planning prompt |
| investigator-prompt.md | Investigation prompt template for the QA Engineer (pure data gathering — first phase of audit) |
| architect-prompt.md | Architect prompt template (design recommendations — second phase of audit) |
| auditor-prompt.md | Combined audit prompt for the CTO (single-agent path for simple tasks) |
| brainstorm-prompt.md | Brainstorm agent prompt template (Phase 1 proposals + challenge + Phase 2 deliberation) |
| digest.md | Digest report template |
Reference Docs — Rules
| Doc | Content |
| casting-rules.md | Agent casting: delegation, auditing, reviewing, specialists |
| phase-definitions.md | Phase building blocks + common patterns |
| scope-and-dod.md | Scope format + Definition of Done rules |
| failure-handling.md | Failure handling table |
Validation Scripts
| Script | Content |
| validate-cast.sh | Mechanical casting validation — checks reviewer present, builder != reviewer, complex/moderate has C-suite reviewer, no self-review of own prompts, depends_on valid, no circular deps |
| validate-project-json.sh | Pre-execution gate — blocks execute step if project.json missing or incomplete (no tasks, no DOD, no scope) |
| detect-stale-docs.sh | Post-directive — scans docs for references to modified files, flags potentially stale docs |
| validate-gate.sh | Pipeline step gate — validates prerequisites before advancing to next step |
| validate-reviews.sh | Review-gate hard gate — blocks completion if reviews missing, detects self-review and self-certification |
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.

