Agents / claude-foundation
AGENTS.md1 starsChanged 58 days agoApache-2.0View on GitHub
A Claude Code plugin, not a package in the import graph. It also holds the repo's only CLAUDE.md. This directory packages the foundation plugin: reusable skills, least-privilege subagents and lifecycle hook guards, plus the foundation_tools validators that gate them. It is staged in-tree pending extraction, so it behaves like its own repository while living inside this one. - This directory holds the repo's only CLAUDE.md, and it decides what you can see. Under Claude Code's default project-instructions setting, a CLAUDE.md…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository39 other files it gives its agents.
- agent-core/AGENTS.mdAGENTS.md
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- behavioral-regression/AGENTS.mdAGENTS.md
- config/AGENTS.mdAGENTS.md
- corpora/AGENTS.mdAGENTS.md
- demo/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- examples/AGENTS.mdAGENTS.md
- experiments/AGENTS.mdAGENTS.md
- flow-corpus/AGENTS.mdAGENTS.md
- flow-protocol/AGENTS.mdAGENTS.md
- openspec/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
- claude-foundation/CLAUDE.mdCLAUDE.md
- merge-gate-auditorSkill
- update-executive-reportSkill
- update-executive-reportSkill
- architecture-drift-guardSkill
- commonSkill
- corpus-guardianSkill
- dataset-lintSkill
- deploySkill
- e2e-matrix-sentinelSkill
- eval-corpus-forgeSkill
- hierarchical-recursive-brainstormSkill
- model-benchSkill
- openai-judgeSkill
- openspec-implementation-reviewSkill
- openspec-peer-reviewSkill
- openspec-quality-planSkill
- pre-pr-gateSkill
- project-setupSkill
- quality-gateSkill
- refactoring-decomposerSkill
- repo-invariant-reviewSkill
- test-completeness-guardSkill
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 73
Staged in-tree, and still inside this repo's gates: Run its own commands from here as if this were the repository root, but tests/ is a …
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.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.
Files
AGENTS.md — claude-foundation
A Claude Code plugin, not a package in the import graph. It also holds the repo's only CLAUDE.md.
This directory packages the foundation plugin: reusable skills, least-privilege subagents and
lifecycle hook guards, plus the foundation_tools validators that gate them. It is staged
in-tree pending extraction, so it behaves like its own repository while living inside this one.
Map
| Path | Role |
.claude-plugin/plugin.json | The plugin manifest — name foundation, version 1.0.0 |
.claude-plugin/marketplace.json | Self-hosted marketplace entry consumers pin a ref against |
CLAUDE.md | Build commands and compatibility contract — and a context trap, see below |
hooks/hooks.json | Wires the three hooks to their events and matchers |
hooks/pre_tool_guard.py | The security guard. Fails closed, including on its own errors |
hooks/post_edit_verify.py, session_logger.py | Advisory. Always exit 0 |
agents/, skills/ | The four subagents and the four foundation:* skills, each with evals |
tools/foundation_tools/ | Validators: frontmatter, schemas, no-hardcode scan, compat diff |
tests/backwards_compat_baseline.json | The append-only component-name surface |
Diagram
flowchart TD
accTitle: claude-foundation plugin surface and hook fail modes
accDescr: The plugin manifest publishes skills, subagents and hooks; the pre-tool guard fails closed and denies on any error while the post-edit verifier and session logger always exit zero, and the foundation tools validators gate the whole surface against a committed baseline.
MAN[".claude-plugin/<br/>plugin + marketplace"]
SK["skills/<br/>foundation:* skills"]
AG["agents/<br/>4 subagents"]
HK["hooks/hooks.json"]
GUARD["pre_tool_guard.py<br/>FAILS CLOSED"]
ADV["post_edit_verify.py<br/>session_logger.py<br/>FAIL OPEN"]
ENV["CLAUDE_FOUNDATION_*<br/>env config only"]
TOOLS["foundation_tools/<br/>validate, scan, compat"]
BASE["tests/<br/>backwards_compat_baseline.json"]
MAN --> SK
MAN --> AG
MAN --> HK
HK --> GUARD
HK --> ADV
ENV --> GUARD
ENV --> ADV
SK --> TOOLS
AG --> TOOLS
HK --> TOOLS
TOOLS --> BASE
classDef here fill:#e8f0fe,stroke:#1a73e8,stroke-width:2px
class MAN hereRules that bite here
- This directory holds the repo's only
CLAUDE.md, and it decides what you can see. Under Claude Code's default project-instructions setting, aCLAUDE.mdin the working directory or above it makes Claude readCLAUDE.mdfiles only, so an agent working here would otherwise receive none of the repo-wide contract. The single line@AGENTS.mdat the top ofCLAUDE.mdis what pulls this file — and through it../AGENTS.md— back into context. Delete that line and every agent working here goes blind, silently. - The hook fail modes are asymmetric on purpose (ADR 0002).
pre_tool_guard.pyfails CLOSED — a matched deny rule and any internal error both deny, so a crash can never let a tool call through.post_edit_verify.pyandsession_logger.pyfail OPEN and always exit 0, so a broken config cannot paralyse every edit in a consumer repo. Never invert either one. - Component names are append-only within a major version. Removing or renaming a skill,
subagent or hook needs a major bump, then
python -m foundation_tools.backwards_compat --root . --updatein the same change — run after the bump, since it snapshots the current one. - No literals in hook behaviour. Everything configurable comes from a
CLAUDE_FOUNDATION_*environment variable, andfoundation_tools.scanenforces that against an allowlist policy. - Staged in-tree, and still inside this repo's gates. Run its own commands from here as if
this were the repository root, but
tests/**is a protected path and its 85 floor is declared in bothpyproject.tomlandscripts/quality-gate.sh.
Verify
make -C claude-foundation checkSubagents
| Task in this directory | Agent | Why |
| Locate where a component name is declared across manifest, skills and baseline | explorer | Read-only; the name appears in several files and all of them must agree |
| Run the gate and isolate a validator or compat-diff failure | test-runner | Has Bash; the compat gate reports a surface diff that needs reading back |
| Review a hook change before pushing | narrow-critic | A fail-mode inversion is a one-character diff and a security regression |
See also
| Doc | Read it when |
README.md | You need the component table, install flow and environment-variable contract |
CLAUDE.md | You need this component's own build commands and release gate |
../AGENTS.md | You need the repo-wide contract — reached only via the @AGENTS.md import |
docs/adr/0002-hook-fail-modes.md | You are changing a hook's exit path and need the exact blocking mechanics |
docs/adr/0004-backwards-compat-manifest-diff.md | You are removing or renaming a component and need the bump procedure |
../docs/decisions/0017-claude-foundation-reconciliation.md | The in-tree staging is in your way and you need the extraction plan |
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.

