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
In this repository42 other files it gives its agents.
- attributeSkill
- auditSkill
- gap-analysis-workflowSkill
- checkpointSkill
- classifySkill
- compareSkill
- constrainSkill
- critiqueSkill
- debug-workflowSkill
- decomposeSkill
- delegateSkill
- detectSkill
- digital-twin-bootstrapSkill
- digital-twin-sync-workflowSkill
- discover-capabilitiesSkill
- discoverSkill
- executeSkill
- explainSkill
- generateSkill
- groundSkill
- inquireSkill
- integrateSkill
- invokeSkill
- measureSkill
- mutateSkill
- observeSkill
- persistSkill
- perspective-validationSkill
- planSkill
- predictSkill
- recallSkill
- receiveSkill
- retrieveSkill
- rollbackSkill
- searchSkill
- sendSkill
- simulateSkill
- stateSkill
- synchronizeSkill
- transformSkill
- transitionSkill
- verifySkill
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
- Distinctive: line 127
Every agent action must be:
- Distinctive: line 206
When adding a new atomic capability, you MUST complete ALL of these steps:
- Very specific: line 209
Add capability node to schemas/capability_ontology.yaml with full input/output schemas
- Very specific: line 210
Add edges connecting to related capabilities (requires, soft_requires, enables)
- Very specific: line 211
Update the layer's capabilities array in the layers section
- Very specific: line 212
Update the meta.description count (e.g., "36 atomic capabilities" → "37 atomic capabilities")
- Very specific: line 215
Use templates/SKILL_TEMPLATE_ENHANCED.md as the starting template
- Very specific: line 216
Place skill at skills/<name>/SKILL.md (kebab-case name)
- Distinctive: line 219
Search and update capability counts in these files:
- Very specific: line 232
Tip: Use grep -r "N atomic capabilit" .
- Very specific: line 242
Add workflow to schemas/workflow_catalog.yaml
- Very specific: line 243
Update workflow count in skills/README.md
- Very specific: line 258
When creating a new release, update the version in .claude-plugin/plugin.json to match the new tag before committing.
- Distinctive: line 339
If something goes sideways, STOP and re-plan immediately - don't keep pushing
- Distinctive: line 340
Use plan mode for verification steps, not just building
- Distinctive: line 341
Write detailed specs upfront to reduce ambiguity
- Distinctive: line 345
Use subagents liberally to keep main context window clean
- Distinctive: line 352
After ANY correction from the user: update 'tasks/lessons.md" with the pattern
- Distinctive: line 353
Write rules for yourself that prevent the same mistake
- Distinctive: line 359
Never mark a task complete without proving it works
- Distinctive: line 361
Ask yourself: "Would a staff engineer approve this?"
- Distinctive: line 362
Run tests, check logs, demonstrate correctness
- Distinctive: line 367
If a fix feels hacky: "Knowing everything I know now, implement the elegant solution"
- Distinctive: line 373
When given a bug report: just fix it.
- Distinctive: line 380
PLan First: Write plan to 'tasks/todo.md" with checkable items
- Distinctive: line 381
Verify Plan: Check in before starting implementation
- Very specific: line 384
Document Results: Add review section to tasks/todo.md*
- Distinctive: line 385
Capture Lessons: Update "tasks/lessons.md" after corrections
≈ “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.
Files
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 --strictValidate 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; doneValidate domain profiles against schema
python tools/validate_profiles.pyValidate skill file references (no phantom paths)
python tools/validate_skill_refs.pyValidate ontology graph (orphans, cycles, symmetry)
python tools/validate_ontology.pyValidate the five canonical schemas designated by spec §6.1
python tools/validate_canonical_schemas.pyValidate RFC structure against GOVERNANCE requirements
python tools/validate_rfcs.pyValidate constraints.txt agrees with pyproject.toml
python tools/validate_constraints.pyValidate documentation links (no dangling cross-references)
python tools/validate_doc_links.pyValidate YAML utility sync (safe_yaml.py ↔ yaml_util.py)
python tools/validate_yaml_util_sync.pyValidate transform mapping_ref paths (no broken refs)
python tools/validate_transform_refs.pyValidate benchmark deps against ontology
python tools/validate_benchmark_deps.pySync 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 driftRegenerate 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 driftRun conformance tests (optional, local only)
python scripts/run_conformance.pySetup Python environment (one-time)
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]" -c constraints.txtThe 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 testCI 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:
- Grounded — backed by evidence anchors, not hallucination
- Auditable — with provenance and lineage
- Safe — mutations require checkpoints
- Composable — typed contracts between capabilities
Key Files
| File | Purpose |
schemas/capability_ontology.yaml | Master ontology defining all 36 capabilities with I/O contracts, risk levels, and edges |
schemas/workflow_catalog.yaml | Reference workflows that compose capabilities |
schemas/profiles/*.yaml | Domain-specific profiles (trust weights, risk thresholds, checkpoint/evidence policies) |
schemas/profiles/profile_schema.yaml | Schema defining structure for domain profiles |
skills/<name>/SKILL.md | Individual skill implementations (flat structure, no nesting) |
hooks/hooks.json | Claude Code hooks for safety enforcement |
templates/SKILL_TEMPLATE_ENHANCED.md | Template for creating new skills |
_archive/ | Archived files from v1 (99-capability model) |
schemas/interop/oasf_mapping.yaml | OASF skill-code-to-capability mapping |
docs/guides/MODALITY_HANDLING.md | Modality handling guide (vision, audio, multimodal) |
docs/proposals/OASF_SAFETY_EXTENSIONS.md | OASF safety extension proposal |
Layer Architecture
Capabilities are organized into 9 cognitive layers (defined in ontology):
| Layer | Purpose | Count | Capabilities |
| PERCEIVE | Information acquisition | 4 | retrieve, search, observe, receive |
| UNDERSTAND | Making sense of information | 6 | detect, classify, measure, predict, compare, discover |
| REASON | Planning and analysis | 4 | plan, decompose, critique, explain |
| MODEL | World representation | 5 | state, transition, attribute, ground, simulate |
| SYNTHESIZE | Content creation | 3 | generate, transform, integrate |
| EXECUTE | Changing the world | 3 | execute, mutate, send |
| VERIFY | Correctness assurance | 5 | verify, checkpoint, rollback, constrain, audit |
| REMEMBER | State persistence | 2 | persist, recall |
| COORDINATE | Multi-agent and user interaction | 4 | delegate, 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,agenttype, andlayer - Intent and success criteria
- Input/output contracts with
domainparameter 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-entity | detect with domain: anomaly, domain: entity |
estimate-risk, estimate-impact | measure with domain: risk, domain: impact |
forecast-risk, forecast-time | predict 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 — afromstep must run before the target (e.g.checkpoint→mutate/send/rollback), else V102soft_requires: Recommended — any one incoming source must run before the target, else warning W601enables: Unlocks other capabilitiesprecedes: Ordering only — when both capabilities are present, the source must come first (V102)conflicts_with: May not share aparallel_group(F504); running them in sequence is allowedalternative_to: Substitutable capabilitiesspecializes: 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.yamlwith full input/output schemas - Add edges connecting to related capabilities (
requires,soft_requires,enables) - Update the layer's
capabilitiesarray in thelayerssection - Update the
meta.descriptioncount (e.g., "36 atomic capabilities" → "37 atomic capabilities")
2. Create the Skill
- Use
templates/SKILL_TEMPLATE_ENHANCED.mdas 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 tableREADME.md— Multiple references throughoutspec/WHITEPAPER.md— Summary and derivation sectionsdocs/GROUNDED_AGENCY.md— Capability ontology sectiondocs/FAQ.md— Capability count referencesdocs/GLOSSARY.md— Layer descriptionsdocs/WORKFLOW_PATTERNS.md— Pattern referencesdocs/TUTORIAL.md— Tutorial referencesdocs/methodology/EXTENSION_GOVERNANCE.md— Governance referencesskills/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.pyThis 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.ZClaude Agent SDK Integration
The grounded_agency/ Python package provides SDK integration:
Install
pip install -e ".[sdk]" # From repo rootRun SDK integration tests
pytest tests/test_sdk_integration.py -vRun examples
python examples/grounded_agent_demo.py
python examples/checkpoint_enforcement_demo.py
python examples/capability_skills_demo.pyKey Components
| Component | Purpose |
GroundedAgentAdapter | Main entry point - wraps SDK options with safety layer |
CapabilityRegistry | Loads and queries capability_ontology.yaml |
ToolCapabilityMapper | Maps SDK tools to capability metadata |
CheckpointTracker | Manages checkpoint lifecycle for mutation safety |
EvidenceStore | Collects evidence anchors from tool executions |
WorkflowRunner | Runs 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: truerequires_checkpoint: truerequires_approval: truerisk: "high"
Medium-risk capabilities (execute, rollback, delegate, synchronize, invoke) have:
risk: "medium"executealso hasrequires_approval: true
Other mutation capabilities (checkpoint, audit, persist) have:
mutation: true, but need no checkpoint- Lower risk levels (low or medium)
auditalso hasmutation_overridable: true, so a step may declaremutation: 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
- PLan First: Write plan to 'tasks/todo.md" with checkable items
- Verify Plan: Check in before starting implementation
- Track Progress: Mark items complete as you go
- Explain Changes: High-level summary at each step
- Document Results: Add review section to tasks/todo.md*
- 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.
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.

