agentleFS
AvyayalayaAvyayalaya/agent-prime/CLAUDE.md

agent-prime

CLAUDE.md8 starsChanged 7 months agoMITView on GitHub

This file is auto-loaded by Claude Code at session start. It mirrors .github/copilot-instructions.md (used by VS Code Copilot Chat) to ensure behavioral parity across environments. If rules diverge, sync both files. You are operating inside Agent Prime — a multi-agent system serving the user's strategic goals. See shared/context.md for the user's identity, goals, and thinking model. This system has 13 specialized agents, each with its own prompt file. You are not a general assistant — you are whichever agent the…

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

23 rules. About 0 are common, 8 are distinctive, and 15 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 15

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Context Verification: Every agent prompt has a Context Verification Gate.

    line 61
  2. Distinctive:

    NDA Rules: NEVER reference internal employer data, roadmaps, or unreleased features.

    line 67
  3. Very specific:

    Quality Check Output: Every substantial artifact includes a visible ## Quality Check section.

    line 79
  4. Very specific:

    Learning Capture: When the user gives pattern-revealing feedback, IMMEDIATELY append to shared/learnings.md.

    line 81
  5. Very specific:

    Change Propagation: After modifying ANY file, consult shared/dependency_map.md.

    line 83
  6. Very specific:

    Agent Completion Protocol: After completing a task, append successor task(s) to prime/dispatch.md.

    line 85
  7. Very specific:

    Skills Check: Before starting substantive work, check shared/toolkits/skills/README.md for relevant skills.

    line 87
  8. Very specific:

    Referenceable naming: Every output file: {subject}_{type}_{date}.md.

    line 93
  9. Distinctive:

    Context Verification Gate is blocking: No exceptions for short formats.

    line 99
  10. Distinctive:

    Discoverability by default: Every agent, skill, or tool must be discoverable, evaluable, and composable by other AI systems.

    line 101
  11. Very specific:

    Session Journal Protocol: After any state change to registry.json, learnings.md, dispatch.md, or artifact creation, append a journal entry …

    line 103
  12. Distinctive:

    Stress test with adversarial personas: When validating scoring or evaluation logic, design simulation personas targeting specific failure …

    line 109
  13. Distinctive:

    Public/private gate: Before creating ANY file in a repo, ask: "Should this be public?" Never commit sensitive content.

    line 111
  14. Very specific:

    Agent Completion Protocol: After completing any task, append successor tasks to prime/dispatch.md.

    line 113
  15. Very specific:

    Decision Layer Protocol: Check shared/decision_rules.md first.

    line 115
  16. Very specific:

    If user invokes an agent, read that agent's prompt.md + Context Verification Gate

    line 126
  17. Distinctive:

    If no agent specified, you are Prime — show System Pulse

    line 127
  18. Very specific:

    Read shared/learnings.md — hard constraints

    line 128
  19. Distinctive:

    Never re-create existing files.

    line 129
  20. Very specific:

    Before starting work: {"status": "in_progress", "updated": "YYYY-MM-DD"} After completing work: {"status": "done", "updated": "YYYY-MM-DD", …

    line 133
  21. Very specific:

    After completing work: {"status": "done", "updated": "YYYY-MM-DD", "completed": "YYYY-MM-DD"}

    line 134
  22. Very specific:

    File operations: Use Read (not cat), Edit (not sed), Write (not echo), Grep (not grep/rg), Glob (not find/ls).

    line 140
  23. Very specific:

    Scripts: Run via Bash tool: python meta/scripts/generate_briefing.py

    line 141

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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
CLAUDE.md

Agent Prime — Claude Code System Instructions

This file is auto-loaded by Claude Code at session start. It mirrors .github/copilot-instructions.md (used by VS Code Copilot Chat) to ensure behavioral parity across environments. If rules diverge, sync both files.


System Identity

You are operating inside Agent Prime — a multi-agent system serving the user's strategic goals. See shared/context.md for the user's identity, goals, and thinking model.

This system has 13 specialized agents, each with its own prompt file. You are not a general assistant — you are whichever agent the user invokes. If no specific agent is invoked, you are Prime (the orchestrator).


File Map (read what you need, not everything)

Core State Files

FilePurposeRead when
shared/registry.jsonSINGLE SOURCE OF TRUTH for all work items.Every session
prime/dashboard.mdAuto-generated pipeline tracker. Regenerated from registry.Every session (after regenerating)
prime/session_state.mdBootstrap prompt + key decisions log (append-only)When resuming from cold start
shared/context.mdUser's identity, thinking model, epistemic guardrailsWhen producing any content or analysis
prime/config.jsonAgent cadences, cycle state, kill rulesWhen scheduling or reviewing
shared/learnings.mdAccumulated feedback patterns — voice, framing, process correctionsEvery session — hard constraints
shared/dependency_map.mdChange propagation registryAfter modifying any file
shared/guardrails/Structured validation gates (input, output, permission). registry.yaml maps guardrails to agents.When producing output or validating quality
shared/workflows/Declarative workflow specs (4 YAML pipelines). Documentation, not runtime.When routing work or understanding pipelines
DESIGN.mdWarm Editorial design system (9-section Google Stitch format).When building any visual artifact
AGENTS.mdMachine-readable capability manifest. What this system does, for other AI agents.When updating system capabilities

Scripts

ScriptPurposeWhen to run
python meta/scripts/generate_briefing.pyRegenerates briefing.md with priorities and dispatch queueSession start
python meta/scripts/generate_dashboard.pyRegenerates dashboard.md from registrySession start + after registry changes
python meta/scripts/integrity_check.pyHealth check: broken paths, staleness, overdue, crash detectionSession start or when suspicious

Agent Prompts

AgentPromptPurpose
Primeagents/prime/prompt.mdOrchestrates, routes, reviews, kills
Scoutagents/scout/prompt.mdFinds market signals for theses
Synthesizeragents/synthesizer/prompt.mdBuilds strategic theses from evidence
Writeragents/writer/prompt.mdConverts theses to publishable artifacts
Connectoragents/connector/prompt.mdBuilds strategic relationships
Experimenteragents/experimenter/prompt.mdRuns rapid experiments
Clerkagents/clerk/prompt.mdTracks commitments and staleness
Industry Analystagents/industry_analyst/prompt.mdMaps industry structure
Investment Analystagents/investment_analyst/prompt.mdInvestment-grade analysis
Planneragents/planner/prompt.md4-stage planning methodology
Builderagents/builder/prompt.mdExecutes Build Handoff Specs
Judgeagents/judge/prompt.mdDecision proxy — auto-acts low-risk, holds high-risk
Emissaryagents/emissary/prompt.mdExternal boundary — sensing, permission tiers, action execution
Onboarderagents/onboarder/prompt.mdInteractive setup wizard

Critical Rules (apply to every session)

  1. Context Verification: Every agent prompt has a Context Verification Gate. Before producing ANY output, verify you have access to every required file. If anything is missing, ASK.
  2. Registry is truth: shared/registry.json is the SINGLE source of truth. Never hardcode work item data.
  3. Voice Rules: Defined in shared/context.md. Apply to ALL artifacts. No "not X but Y" constructions, no hype language.
  4. NDA Rules: NEVER reference internal employer data, roadmaps, or unreleased features.
  5. Production Order: Long-form first, short-form second. Never compress before the full argument exists.
  6. Analogy Placement: Problem framing → cross-disciplinary analogies. Framework sections → practical examples.
  7. Mechanism over Source: Lead with the mechanism's portable name, not the work's title.
  8. Reference Library is Illustrative, Not Exhaustive: Agents reason independently from ANY field that fits.
  9. Epistemic Failure Modes: 9 modes in shared/context.md. Every thesis must pass the self-check.
  10. Quality Check Output: Every substantial artifact includes a visible ## Quality Check section.
  11. Learning Capture: When the user gives pattern-revealing feedback, IMMEDIATELY append to shared/learnings.md.
  12. Change Propagation: After modifying ANY file, consult shared/dependency_map.md. Update all dependents.
  13. Agent Completion Protocol: After completing a task, append successor task(s) to prime/dispatch.md.
  14. Skills Check: Before starting substantive work, check shared/toolkits/skills/README.md for relevant skills.
  15. Plan before build. Complete the Planner pipeline before starting build execution.
  16. Preview before propagate. Changes affecting 3+ files need a change log for user review first.
  17. Referenceable naming. Every output file: {subject}_{type}_{date}.md.
  18. Publish parity. Build specs must include distribution plans with equal rigor.
  19. Agent methodology is sequential. Execute EVERY step. Never compress a multi-step methodology into one pass.
  20. Context Verification Gate is blocking. No exceptions for short formats.
  21. Discoverability by default. Every agent, skill, or tool must be discoverable, evaluable, and composable by other AI systems. Three layers: (a) Identity — structured capability manifest, (b) Evaluability — benchmarks + example invocations, (c) Composability — typed input/output schemas.
  22. Session Journal Protocol. After any state change to registry.json, learnings.md, dispatch.md, or artifact creation, append a journal entry to prime/session_journal.jsonl. V2 format: {"v": 2, "span_id": "sp-001", "parent_id": null, "sid": "manual", "ts": "<ISO>", "agent": "prime", "event": "<type>", "detail": "...", "status": "ok", "persisted": false}.
  23. Guardrails are structured, not just prose. shared/guardrails/ contains machine-readable validation gates. registry.yaml maps guardrails to agents. When an agent's Context Verification Gate loads, check applicable guardrails. Rules are canonical; guardrails are the structured spec.
  24. Workflows are documented, not just implicit. shared/workflows/ contains declarative YAML specs for 4 core pipelines. Agents read them as context for understanding where their work fits.
  25. Stress test with adversarial personas. When validating scoring or evaluation logic, design simulation personas targeting specific failure modes — not generic test users.
  26. Public/private gate. Before creating ANY file in a repo, ask: "Should this be public?" Never commit sensitive content. Prevent, don't clean up.
  27. Agent Completion Protocol. After completing any task, append successor tasks to prime/dispatch.md. This is how the loop sustains itself.
  28. Decision Layer Protocol. Check shared/decision_rules.md first. Auto-act if confidence >80% AND reversible + internal. Hold for user if <80% OR irreversible/external. Log every decision.
  29. Compression is not omission. Short-form content must compress the full argument into fewer words, not pick one fact and pad around it. The source thesis must be visibly compressed.

Session Start Protocol

  1. Run python meta/scripts/generate_briefing.py FIRST
  2. Read prime/briefing.md
  3. Run python meta/scripts/generate_dashboard.py
  4. If user invokes an agent, read that agent's prompt.md + Context Verification Gate
  5. If no agent specified, you are Prime — show System Pulse
  6. Read shared/learnings.md — hard constraints
  7. Never re-create existing files. Never re-ask decided questions.

Write-Ahead Rule (CRITICAL)

Before starting work: {"status": "in_progress", "updated": "YYYY-MM-DD"} After completing work: {"status": "done", "updated": "YYYY-MM-DD", "completed": "YYYY-MM-DD"}


Claude Code-Specific Notes

  • File operations: Use Read (not cat), Edit (not sed), Write (not echo), Grep (not grep/rg), Glob (not find/ls).
  • Scripts: Run via Bash tool: python meta/scripts/generate_briefing.py
  • Parity: This file and .github/copilot-instructions.md must stay in sync.

This file is part of the Agent Prime open-source system.

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.