agentleFS
andrew-yangyandrew-yangy/gru-ai/.claude/skills/directive/SKILL.md

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.

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
  1. Very specific:

    Before executing, read .claude/agent-registry.json to map roles to agent names.

    line 12
  2. Very specific:

    Use each agent's id field as the subagent_type value when spawning.

    line 26
  3. Distinctive:

    DO NOT read source code. DO NOT edit files.

    line 34
  4. Distinctive:

    If you catch yourself wanting to "just fix it quickly" — STOP.

    line 38
  5. Very specific:

    Use the Write tool to overwrite the full directive.json

    line 55

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

  1. Set pipeline.{stepId}.status to "completed" with:
    • agent: who performed this step (e.g. "CEO", "COO", "CTO, full-stack engineer")
    • output: REQUIRED object with at least a summary string (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)
  2. Set current_step to the next step's ID
  3. Set updated_at to the current ISO timestamp
  4. 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:

  1. 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.
  2. approve — heavyweight/strategic: STOP and present plan for CEO approval. Lightweight/medium: auto-approve without stopping.
  3. 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 IDDocPurposeDepends On
1triage00-delegation-and-triage.mdTriage directive weight + select process—
2checkpoint01-checkpoint.mdCheck for existing checkpoint, resume if found—
3read02-read-directive.mdRead directive file + create directive.jsontriage
4context03-read-context.mdRead all context files before planningread
5audit06-technical-audit.mdTechnical codebase auditcontext
6brainstorm04-brainstorm.mdApproach brainstorm (includes challenge for heavyweight/strategic)audit
7clarification04b-clarification.mdSynthesize verified intent (auto-approve for lightweight/medium)audit
8plan05-planning.mdCOO strategic planningclarification
9approve07-plan-approval.mdPresent plan to CEO for approvalplan
10project-brainstorm07b-project-brainstorm.mdCTO + builder decompose projects into tasks with DODapprove
11setup08-worktree-and-state.mdWorktree isolation + directive state initproject-brainstorm
12execute09-execute-projects.mdExecute all tasks (phases, agents, UX)setup
13review-gate09-execute-projects.mdReview verification gate (end of doc)execute
14wrapup10-wrapup.mdOKRs, follow-ups, stale doc detection, digest, lessons, reportreview-gate
15completion11-completion-gate.mdCEO completion gate -- approve, amend, extend, or redirectwrapup

Reference Docs — Schemas

DocContent
plan-schema.mdCOO plan output JSON schema
audit-output.mdArchitect output JSON schema (design recommendations — second phase of two-agent audit)
investigation-output.mdQA Engineer's investigation output JSON schema (pure data — first phase of two-agent audit)
checkpoint.mdCheckpoint JSON schema (deprecated — merged into directive-json.md)
directive-json.mdDirective JSON schema (THE source of truth — includes pipeline progress for dashboard)
brainstorm-output.mdBrainstorm output JSON schema (proposals + rebuttals + challenge)

Reference Docs — Templates

DocContent
planner-prompt.mdFull COO planning prompt
investigator-prompt.mdInvestigation prompt template for the QA Engineer (pure data gathering — first phase of audit)
architect-prompt.mdArchitect prompt template (design recommendations — second phase of audit)
auditor-prompt.mdCombined audit prompt for the CTO (single-agent path for simple tasks)
brainstorm-prompt.mdBrainstorm agent prompt template (Phase 1 proposals + challenge + Phase 2 deliberation)
digest.mdDigest report template

Reference Docs — Rules

DocContent
casting-rules.mdAgent casting: delegation, auditing, reviewing, specialists
phase-definitions.mdPhase building blocks + common patterns
scope-and-dod.mdScope format + Definition of Done rules
failure-handling.mdFailure handling table

Validation Scripts

ScriptContent
validate-cast.shMechanical 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.shPre-execution gate — blocks execute step if project.json missing or incomplete (no tasks, no DOD, no scope)
detect-stale-docs.shPost-directive — scans docs for references to modified files, flags potentially stale docs
validate-gate.shPipeline step gate — validates prerequisites before advancing to next step
validate-reviews.shReview-gate hard gate — blocks completion if reviews missing, detects self-review and self-certification

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.