agentleFS
synaptiaisynaptiai/agent-capability-standard/CLAUDE.md

agent-capability-standard

CLAUDE.md6 starsChanged 13 days agoApache-2.0View on GitHub

The package is built with maturin: the validator and the executor live in the Rust crate under core/ and compiles into grounded_agency._core, so a Rust toolchain (rustc >= 1.86) is required. After changing Rust code, re-run the pip install -e line to rebuild the extension. CI pins the toolchain that runs these (RUST_TOOLCHAIN in .github/workflows/ci.yml), as constraints.txt pins ruff. Install the dev extra rather than individual packages, and pass -c constraints.txt — that file pins the exact tool versions CI…

  • Installs packages

The file

Show its rules and text

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

28 rules. About 0 are common, 17 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every agent action must be:

    line 127
  2. Distinctive:

    When adding a new atomic capability, you MUST complete ALL of these steps:

    line 206
  3. Very specific:

    Add capability node to schemas/capability_ontology.yaml with full input/output schemas

    line 209
  4. Very specific:

    Add edges connecting to related capabilities (requires, soft_requires, enables)

    line 210
  5. Very specific:

    Update the layer's capabilities array in the layers section

    line 211
  6. Very specific:

    Update the meta.description count (e.g., "36 atomic capabilities" → "37 atomic capabilities")

    line 212
  7. Very specific:

    Use templates/SKILL_TEMPLATE_ENHANCED.md as the starting template

    line 215
  8. Very specific:

    Place skill at skills/<name>/SKILL.md (kebab-case name)

    line 216
  9. Distinctive:

    Search and update capability counts in these files:

    line 219
  10. Very specific:

    Tip: Use grep -r "N atomic capabilit" .

    line 232
  11. Very specific:

    Add workflow to schemas/workflow_catalog.yaml

    line 242
  12. Very specific:

    Update workflow count in skills/README.md

    line 243
  13. Very specific:

    When creating a new release, update the version in .claude-plugin/plugin.json to match the new tag before committing.

    line 258
  14. Distinctive:

    If something goes sideways, STOP and re-plan immediately - don't keep pushing

    line 339
  15. Distinctive:

    Use plan mode for verification steps, not just building

    line 340
  16. Distinctive:

    Write detailed specs upfront to reduce ambiguity

    line 341
  17. Distinctive:

    Use subagents liberally to keep main context window clean

    line 345
  18. Distinctive:

    After ANY correction from the user: update 'tasks/lessons.md" with the pattern

    line 352
  19. Distinctive:

    Write rules for yourself that prevent the same mistake

    line 353
  20. Distinctive:

    Never mark a task complete without proving it works

    line 359
  21. Distinctive:

    Ask yourself: "Would a staff engineer approve this?"

    line 361
  22. Distinctive:

    Run tests, check logs, demonstrate correctness

    line 362
  23. Distinctive:

    If a fix feels hacky: "Knowing everything I know now, implement the elegant solution"

    line 367
  24. Distinctive:

    When given a bug report: just fix it.

    line 373
  25. Distinctive:

    PLan First: Write plan to 'tasks/todo.md" with checkable items

    line 380
  26. Distinctive:

    Verify Plan: Check in before starting implementation

    line 381
  27. Very specific:

    Document Results: Add review section to tasks/todo.md*

    line 384
  28. Distinctive:

    Capture Lessons: Update "tasks/lessons.md" after corrections

    line 385

≈ “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 (claude.ai/code) when working with code in this repository.

Commands

Validate workflows against the ontology (CI runs this in strict mode)

python tools/validate_workflows.py --strict

Validate the domain workflow catalogs and examples (CI runs these in strict mode)

for c in schemas/workflows/*.yaml examples/*.workflow_catalog.yaml; do python tools/validate_workflows.py --catalog "$c" --strict; done

Validate domain profiles against schema

python tools/validate_profiles.py

Validate skill file references (no phantom paths)

python tools/validate_skill_refs.py

Validate ontology graph (orphans, cycles, symmetry)

python tools/validate_ontology.py

Validate the five canonical schemas designated by spec §6.1

python tools/validate_canonical_schemas.py

Validate RFC structure against GOVERNANCE requirements

python tools/validate_rfcs.py

Validate constraints.txt agrees with pyproject.toml

python tools/validate_constraints.py

Validate documentation links (no dangling cross-references)

python tools/validate_doc_links.py

Validate YAML utility sync (safe_yaml.py ↔ yaml_util.py)

python tools/validate_yaml_util_sync.py

Validate transform mapping_ref paths (no broken refs)

python tools/validate_transform_refs.py

Validate benchmark deps against ontology

python tools/validate_benchmark_deps.py

Sync skill-local schemas and bundled catalogs from their sources

python tools/sync_skill_schemas.py          # write what changed
python tools/sync_skill_schemas.py --check  # CI: fail on drift

Regenerate the runtime conformance fixtures

python scripts/gen_runtime_fixtures.py          # after editing the fixtures there
python scripts/gen_runtime_fixtures.py --check  # CI: fail on drift

Run conformance tests (optional, local only)

python scripts/run_conformance.py

Setup Python environment (one-time)

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]" -c constraints.txt

The package is built with maturin: the validator and the executor live in the Rust crate under core/ and compiles into grounded_agency._core, so a Rust toolchain (rustc >= 1.86) is required. After changing Rust code, re-run the pip install -e line to rebuild the extension.

Rust core checks

cd core
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --features python -- -D warnings
cargo test

CI pins the toolchain that runs these (RUST_TOOLCHAIN in .github/workflows/ci.yml), as constraints.txt pins ruff.

Install the dev extra rather than individual packages, and pass -c constraints.txt — that file pins the exact tool versions CI runs, so the local formatter matches CI's exactly. Without it, ruff>=0.16,<0.17 resolves to whatever 0.16.x is newest and a reformat can appear in CI that never appeared locally.

The bounds in pyproject.toml are the supported range; constraints.txt is the one version CI runs. The range caps each dependency at the major this repo has been verified against, so a new major is a deliberate bump — run the suite on it, then raise the cap. Note the range still admits patch and minor drift: two installs a week apart are not identical unless both use the constraints file.

Architecture

This is a Claude Code plugin that defines a formal capability ontology for AI agents with 36 atomic capabilities across 9 cognitive layers, plus 12 composed workflow patterns.

Core Philosophy: Grounded Agency

Every agent action must be:

  1. Grounded — backed by evidence anchors, not hallucination
  2. Auditable — with provenance and lineage
  3. Safe — mutations require checkpoints
  4. Composable — typed contracts between capabilities

Key Files

FilePurpose
schemas/capability_ontology.yamlMaster ontology defining all 36 capabilities with I/O contracts, risk levels, and edges
schemas/workflow_catalog.yamlReference workflows that compose capabilities
schemas/profiles/*.yamlDomain-specific profiles (trust weights, risk thresholds, checkpoint/evidence policies)
schemas/profiles/profile_schema.yamlSchema defining structure for domain profiles
skills/<name>/SKILL.mdIndividual skill implementations (flat structure, no nesting)
hooks/hooks.jsonClaude Code hooks for safety enforcement
templates/SKILL_TEMPLATE_ENHANCED.mdTemplate for creating new skills
_archive/Archived files from v1 (99-capability model)
schemas/interop/oasf_mapping.yamlOASF skill-code-to-capability mapping
docs/guides/MODALITY_HANDLING.mdModality handling guide (vision, audio, multimodal)
docs/proposals/OASF_SAFETY_EXTENSIONS.mdOASF safety extension proposal

Layer Architecture

Capabilities are organized into 9 cognitive layers (defined in ontology):

LayerPurposeCountCapabilities
PERCEIVEInformation acquisition4retrieve, search, observe, receive
UNDERSTANDMaking sense of information6detect, classify, measure, predict, compare, discover
REASONPlanning and analysis4plan, decompose, critique, explain
MODELWorld representation5state, transition, attribute, ground, simulate
SYNTHESIZEContent creation3generate, transform, integrate
EXECUTEChanging the world3execute, mutate, send
VERIFYCorrectness assurance5verify, checkpoint, rollback, constrain, audit
REMEMBERState persistence2persist, recall
COORDINATEMulti-agent and user interaction4delegate, synchronize, invoke, inquire

Skill Structure

Skills are at skills/<skill-name>/SKILL.md (flat structure, not nested by category). Each skill has:

  • YAML frontmatter with name, description, allowed-tools, agent type, and layer
  • Intent and success criteria
  • Input/output contracts with domain parameter for specialization
  • Procedure steps with evidence grounding
  • Safety constraints from ontology

Domain Parameterization

The 36-capability model uses domain parameters instead of domain-specific variants:

Old (99 model)New (36 model)
detect-anomaly, detect-entitydetect with domain: anomaly, domain: entity
estimate-risk, estimate-impactmeasure with domain: risk, domain: impact
forecast-risk, forecast-timepredict with domain: risk, domain: time

Hooks

The plugin enforces safety through Claude Code hooks:

  • PreToolUse (Write|Edit|MultiEdit|NotebookEdit|Bash): Requires checkpoint marker before mutations
  • PostToolUse (Skill): Logs skill invocations to .claude/audit.log

Ontology Edge Types

Relationships between capabilities (in capability_ontology.yaml):

  • requires: Hard dependency — a from step must run before the target (e.g. checkpoint → mutate/send/rollback), else V102
  • soft_requires: Recommended — any one incoming source must run before the target, else warning W601
  • enables: Unlocks other capabilities
  • precedes: Ordering only — when both capabilities are present, the source must come first (V102)
  • conflicts_with: May not share a parallel_group (F504); running them in sequence is allowed
  • alternative_to: Substitutable capabilities
  • specializes: Parent-child inheritance

See spec/EDGE_TYPES.md for full edge type documentation.

Creating New Capabilities

When adding a new atomic capability, you MUST complete ALL of these steps:

1. Update the Ontology

  • Add capability node to schemas/capability_ontology.yaml with full input/output schemas
  • Add edges connecting to related capabilities (requires, soft_requires, enables)
  • Update the layer's capabilities array in the layers section
  • Update the meta.description count (e.g., "36 atomic capabilities" → "37 atomic capabilities")

2. Create the Skill

  • Use templates/SKILL_TEMPLATE_ENHANCED.md as the starting template
  • Place skill at skills/<name>/SKILL.md (kebab-case name)

3. Update ALL Capability Count References

Search and update capability counts in these files:

  • CLAUDE.md — Architecture section and layer table
  • README.md — Multiple references throughout
  • spec/WHITEPAPER.md — Summary and derivation sections
  • docs/GROUNDED_AGENCY.md — Capability ontology section
  • docs/FAQ.md — Capability count references
  • docs/GLOSSARY.md — Layer descriptions
  • docs/WORKFLOW_PATTERNS.md — Pattern references
  • docs/TUTORIAL.md — Tutorial references
  • docs/methodology/EXTENSION_GOVERNANCE.md — Governance references
  • skills/README.md — Layer counts and totals
  • .claude-plugin/plugin.json — Description field

Tip: Use grep -r "N atomic capabilit" . and grep -r "N capabilities" . to find all references (where N is the old count).

4. Validate

python tools/validate_workflows.py
python tools/validate_profiles.py
python -c "import yaml; yaml.safe_load(open('schemas/capability_ontology.yaml'))"

5. Update Workflow Catalog (if adding workflow patterns)

  • Add workflow to schemas/workflow_catalog.yaml
  • Update workflow count in skills/README.md

6. Generate Local Schema

python tools/sync_skill_schemas.py

This regenerates skills/<name>/schemas/output_schema.yaml from the ontology (removing orphaned generated ones), regenerates the skill-bundled skills/*/reference/workflow_catalog.yaml copies from schemas/workflow_catalog.yaml with their schema paths rewritten, and keeps the vendored schema copies in sync. --check fails on drift (CI); --dry-run lists what would change.

Releasing

When creating a new release, update the version in .claude-plugin/plugin.json to match the new tag before committing. This file does not auto-sync with git tags.

Give the release its ## [vX.Y.Z] — date section in CHANGELOG.md, then push an annotated tag vX.Y.Z on main. .github/workflows/release.yml publishes the GitHub Release with that section as its notes (a -suffix tag is a pre-release). Where the tag cannot be pushed, run the workflow by hand on main with the tag as its input: it creates the annotated tag on main's head, then publishes the Release. It refuses a tag that does not match plugin.json or has no section, or (run by hand) one that already exists; check first with:

python scripts/release_notes.py vX.Y.Z

Claude Agent SDK Integration

The grounded_agency/ Python package provides SDK integration:

Install

pip install -e ".[sdk]"  # From repo root

Run SDK integration tests

pytest tests/test_sdk_integration.py -v

Run examples

python examples/grounded_agent_demo.py
python examples/checkpoint_enforcement_demo.py
python examples/capability_skills_demo.py

Key Components

ComponentPurpose
GroundedAgentAdapterMain entry point - wraps SDK options with safety layer
CapabilityRegistryLoads and queries capability_ontology.yaml
ToolCapabilityMapperMaps SDK tools to capability metadata
CheckpointTrackerManages checkpoint lifecycle for mutation safety
EvidenceStoreCollects evidence anchors from tool executions
WorkflowRunnerRuns a workflow on the core's executor, dispatching actions to a Host (guide)

Example Usage

from grounded_agency import GroundedAgentAdapter, GroundedAgentConfig

adapter = GroundedAgentAdapter(GroundedAgentConfig(strict_mode=True))
adapter.create_checkpoint(["*.py"], "Before changes")
options = adapter.wrap_options(base_options)

See docs/integrations/claude_agent_sdk.md for full documentation.

Safety Model

High-risk capabilities (mutate, send) have:

  • mutation: true
  • requires_checkpoint: true
  • requires_approval: true
  • risk: "high"

Medium-risk capabilities (execute, rollback, delegate, synchronize, invoke) have:

  • risk: "medium"
  • execute also has requires_approval: true

Other mutation capabilities (checkpoint, audit, persist) have:

  • mutation: true, but need no checkpoint
  • Lower risk levels (low or medium)
  • audit also has mutation_overridable: true, so a step may declare mutation: false

A checkpoint must run before mutate, send and rollback (requires_checkpoint or a checkpoint requires edge). Safety flags on workflow steps are optional and inherit from the ontology; a step value weaker than the ontology's is ignored with warning W602, and a stricter one takes effect (a step that raises requires_checkpoint with no checkpoint before it is F501).

These are enforced structurally—not by convention.

Workflow Orchestration

1. Plan Mode Default

  • Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions)
  • If something goes sideways, STOP and re-plan immediately - don't keep pushing
  • Use plan mode for verification steps, not just building
  • Write detailed specs upfront to reduce ambiguity

2. Subagent Strategy

  • Use subagents liberally to keep main context window clean
  • Offload research, exploration, and parallel analysis to subagents
  • For complex problems, throw more compute at it via subagents
  • One task per subagent for focused execution

3. Self-Improvement Loop

  • After ANY correction from the user: update 'tasks/lessons.md" with the pattern
  • Write rules for yourself that prevent the same mistake
  • Ruthlessly iterate on these lessons until mistake rate drops
  • Review lessons at session start for relevant project

4. Verification Before Done

  • Never mark a task complete without proving it works
  • Diff behavior between main and your changes when relevant
  • Ask yourself: "Would a staff engineer approve this?"
  • Run tests, check logs, demonstrate correctness

5. Demand Elegance (Balanced)

  • For non-trivial changes: pause and ask "is there a more elegant way?"
  • If a fix feels hacky: "Knowing everything I know now, implement the elegant solution"
  • Skip this for simple, obvious fixes - don't over-engineer
  • Challenge your own work before presenting it

6. Autonomous Bug Fixing

  • When given a bug report: just fix it. Don't ask for hand-holding
  • Point at logs, errors, failing tests - then resolve them
  • Zero context switching required from the user
  • Go fix failing CI tests without being told how

Task Management

  1. PLan First: Write plan to 'tasks/todo.md" with checkable items
  2. Verify Plan: Check in before starting implementation
  3. Track Progress: Mark items complete as you go
  4. Explain Changes: High-level summary at each step
  5. Document Results: Add review section to tasks/todo.md*
  6. Capture Lessons: Update "tasks/lessons.md" after corrections

Core Principles

  • Simplicity First: Make every change as simple as possible. Impact minimal code.
  • No Laziness: Find root causes. No temporary fixes. Senior developer standards.
  • Minimal Impact: Changes should only touch what's necessary. Avoid introducing bugs.

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.