agentleFS
imMamdouhaboammarimMamdouhaboammar/repo-to-skill/skills/codebase-constitution/adapters/claude.md

repo-to-skill / adapters

CLAUDE.md0 starsChanged 51 days agoMITView on GitHub

Portability status: SUPPORTED_STRUCTURAL_ONLY Adapter for loading the Codebase Constitution into Claude Code via CLAUDE.md. Append to or create CLAUDE.md at the repository root: Claude Code reads CLAUDE.md at session start from: 1. Repository root (./CLAUDE.md) — recommended for project constitution 2. Home directory (~/.claude/CLAUDE.md) — global fallback

The file

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

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    No automatic validation that Claude followed the rules

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 27,641 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 Code Host Adapter

Portability status: SUPPORTED_STRUCTURAL_ONLY

Adapter for loading the Codebase Constitution into Claude Code via CLAUDE.md.


Installation Layout

{repo-root}/
  CLAUDE.md                  ← Claude's project memory (inject rules here)
  docs/
    CONSTITUTION.md
    agent-rules.yaml
    adr/
      ADR-*.md

Injection Format

Append to or create CLAUDE.md at the repository root:

# Engineering Constitution — {Project Name}

> Source: docs/CONSTITUTION.md | Generated: {date}

## Rules Claude Must Follow

### Architecture
{for each CONST-ARCH-* rule: paste agent_instruction field}

### Security
{for each CONST-SEC-* rule: paste agent_instruction field}

### Conventions
{for each CONST-CONV-* + CONST-NAME-* rule: paste agent_instruction field}

### Testing
{for each CONST-TEST-* rule: paste agent_instruction field}

### API Design
{for each CONST-API-* rule: paste agent_instruction field}

### Data
{for each CONST-DATA-* rule: paste agent_instruction field}

## Full Reference
See [docs/CONSTITUTION.md](./docs/CONSTITUTION.md) for the complete engineering constitution.
See [docs/agent-rules.yaml](./docs/agent-rules.yaml) for machine-readable rules.

Loading Mechanism

Claude Code reads CLAUDE.md at session start from:

  1. Repository root (./CLAUDE.md) — recommended for project constitution
  2. Home directory (~/.claude/CLAUDE.md) — global fallback

Capability Contract

CapabilityStatusNotes
File read✅ AvailableRead, Glob, Grep tools
File write✅ AvailableWrite, Edit tools
Shell exec✅ AvailableBash tool
Subagents✅ AvailableTask tool
Web search❌ Not availableUnless MCP configured
Python✅ Availablevia Bash
CLAUDE.md loading✅ AvailableAuto-loaded at session start

Gaps

  • CLAUDE.md has no schema enforcement — rules are prose-only
  • No automatic validation that Claude followed the rules
  • CLAUDE.md contents count against context window
  • Long constitutions should be summarized, with reference to full docs/

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.