agentleFS
avibebuilderavibebuilder/claude-prime/CLAUDE.md

claude-prime

CLAUDE.md119 starsChanged 6 months agoMITView on GitHub

This file provides guidance to Claude Code when working with this repository. A boilerplate toolkit that supercharges Claude Code with skills, commands, and workflows for agent-skill-driven development. Context engineering is about curating the optimal set of tokens to maximize desired model behavior. Unlike prompt engineering (crafting perfect prompts), context engineering considers the holistic state available to the LLM at any moment. Sources: Anthropic - Effective Context Engineering, Manus - Context Engineering Lessons Template skill kits shipped with the prime repo.…

The file

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

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Don't load everything upfront.

    line 36
  2. Distinctive:

    Use filesystem as extended memory.

    line 42
  3. Distinctive:

    Minimal overlap: If engineers can't definitively choose the right tool, agents won't either

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 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

CLAUDE.md

This file provides guidance to Claude Code when working with this repository.

Project overview

A boilerplate toolkit that supercharges Claude Code with skills, commands, and workflows for agent-skill-driven development.

Context engineering philosophy

Context engineering is about curating the optimal set of tokens to maximize desired model behavior. Unlike prompt engineering (crafting perfect prompts), context engineering considers the holistic state available to the LLM at any moment.

Core Principles

1. Context is a Finite Resource

Models have limited attention budgets that degrade as context grows (context rot). Goal: find the smallest high-signal set of tokens that maximizes desired outcomes. Every token competes for attention.

2. Right-Altitude Prompting

Concrete but not hardcoded. Find the Goldilocks zone.

Too Low (Brittle)Too VagueRight Altitude
"Use Tailwind's blue-500""Make it look good""Use project's existing color system"
"Set font-size to 16px""Use appropriate sizing""Match surrounding components"

3. Avoid Railroading Claude

Claude will generally try to stick to your instructions, and because Skills are so reusable you’ll want to be careful of being too specific in your instructions. Give Claude the information it needs, but give it the flexibility to adapt to the situation

4. Don’t State the Obvious

Claude Code knows a lot about your codebase, and Claude knows a lot about coding, including many default opinions. If you’re publishing a skill that is primarily about knowledge, try to focus on information that pushes Claude out of its normal way of thinking.

5. Anti-Convergence Patterns

LLMs default to high-probability outputs. Counter by listing what to avoid, suggesting uncommon alternatives, varying examples, and breaking monotony.

6. Just-in-Time Context Retrieval

Don't load everything upfront. Maintain lightweight identifiers (file paths, URLs) and retrieve dynamically at runtime.

7. Sub-Agent Architecture

Specialized sub-agents handle focused tasks with clean context windows, returning condensed summaries. Prevents context pollution, enables long-horizon tasks.

8. Structured External Memory

Use filesystem as extended memory. Write persistent notes/plans outside context window. Maintain todo lists in recent attention span.

9. Error Preservation

Keep failures visible in context. Failed attempts inform better strategies.

Tool Design Principles

  • Self-contained: Each tool independently understandable
  • Minimal overlap: If engineers can't definitively choose the right tool, agents won't either
  • Descriptive parameters: Unambiguous input names and descriptions
  • Token efficient: Minimize wasted exploration

Sources: Anthropic - Effective Context Engineering, Manus - Context Engineering Lessons

System architecture

Skills (.claude/skills/)

TypeWhen to createExamples
Workflow skillRepeatable process with clear actions and instructions/give-plan, /cook, /fix, /test,/discuss
Domain knowledge skillDomain has project-specific patterns the agent must followCreated per-project during priming or via /skill-creator

Starter Skills (.claude/starter-skills/)

Template skill kits shipped with the prime repo. During priming, optimus-prime copies relevant starters into the target project's .claude/skills/, adapts generic parts, and deletes the starter-skills/ folder.

Hub-and-spoke pattern: Complex skills use SKILL.md as the hub (always loaded, <500 lines) that dispatches to spoke files (references/, workflows/, templates/) loaded on demand. This keeps the main file focused while supporting deep reference content.

Knowledge system

LayerLocationLoadingContent
CLAUDE.mdCLAUDE.mdAlwaysEntry point — project identity, commands, stack, on-demand reference pointers
Skills.claude/skills/On-demand by agentFramework/library knowledge, workflows
Rules.claude/rules/Auto-attached by pathGuardrails — wrong code if missed
Agent memory.claude/agent-memory-local/Auto-injected per agentRuntime-discovered knowledge

Rule test: "With the relevant skill activated, will an agent still produce incorrect code without this?" Yes -> rule. No -> skill. Rules are optional.

Memory test: "Can this only be learned by working in the project, not authored upfront?" Yes -> agent memory. No -> skill or rule.

On-demand references can live anywhere — just point to them from CLAUDE.md. Use docs/ for human documentation. For complex projects where human docs are too verbose for agents, .claude/project/ can optionally hold agent-optimized references (dense, scannable format).

Configuration scope

Put hereWhen
CLAUDE.mdTeam-shared instructions checked into source control — architecture, coding standards, common workflows
CLAUDE.local.mdPersonal preferences for this project (gitignored) — your role, sandbox URLs, preferred test data, workflow quirks
.claude/rules/_apply-all.mdUniversal rules for all agents (main + subagents) — including interaction guardrails

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.