agentleFS
sebastientaggartsebastientaggart/CodeCannon/AGENTS.md

CodeCannon

AGENTS.md1 starsChanged 9 months agoMITView on GitHub

Instructions for AI coding agents working on the CodeCannon project itself. CodeCannon is a skill distribution system. It stores generic agent workflow skills in skills/, adapter configs in adapters/, and a sync.py script that generates agent-specific skill files for downstream projects. One source of truth, synced to every project and every AI agent. Use this section to orient yourself. Do not search for files when the answer is here. These are the single source of truth for all generated output.…

The file

Show its rules and text

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

23 rules. About 0 are common, 3 are distinctive, and 20 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.

  • 20

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this section to orient yourself.

    line 19
  2. Very specific:

    When asked to update documentation, check docs/ first — most detailed docs live there, not in README.md.

    line 73
  3. Distinctive:

    Every instruction in a skill must pass one test:

    line 96
  4. Very specific:

    Use {{UPPERCASE_NAME}} syntax.

    line 132
  5. Very specific:

    Add it to config.schema.yaml with description, default, and used_in list.

    line 135
  6. Very specific:

    Add it with its default value to templates/codecannon.yaml.

    line 136
  7. Very specific:

    Use {{PLACEHOLDER_NAME}} in the relevant skill files.

    line 137
  8. Very specific:

    If someone manually edits a generated file, the hash won't match and sync.py will refuse to overwrite it (unless run with --force).

    line 161
  9. Very specific:

    Run make check to validate placeholders.

    line 183
  10. Very specific:

    Run make dev to preview generated output.

    line 184
  11. Very specific:

    Run make sync to regenerate all adapter output.

    line 185
  12. Distinctive:

    Commit the skill source and the regenerated files together in the same PR.

    line 186
  13. Very specific:

    Create adapters/{name}/config.yaml — set agent, output_directory, and output_extension.

    line 190
  14. Very specific:

    Create adapters/{name}/header.md — invocation header template using {skill} and {description}.

    line 191
  15. Very specific:

    Document any adapter limitations in config.yaml under notes.

    line 193
  16. Very specific:

    Create skills/<group>/{name}.md with frontmatter (skill, type, description, args).

    line 198
  17. Very specific:

    Add any new placeholders to config.schema.yaml and templates/codecannon.yaml.

    line 199
  18. Very specific:

    Run make check and make dev to verify.

    line 200
  19. Very specific:

    Run make sync to generate output for all adapters.

    line 201
  20. Very specific:

    Create docs/skills/{name}.md with user-facing documentation.

    line 202
  21. Very specific:

    All adapter outputs are generated: after editing a skill, make sync regenerates .claude/commands/, .cursor/rules/, .agents/skills/, and …

    line 209
  22. Very specific:

    Add project-specific content to skills/<group>/ — skills must remain generic.

    line 216
  23. Very specific:

    Commit skill source changes without also committing the regenerated output (make sync).

    line 217

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

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md — CodeCannon

Instructions for AI coding agents working on the CodeCannon project itself.

CodeCannon is a skill distribution system. It stores generic agent workflow skills in skills/, adapter configs in adapters/, and a sync.py script that generates agent-specific skill files for downstream projects. One source of truth, synced to every project and every AI agent.

Branch strategy

feature/* → dev → main
  • main — published releases. Never push directly.
  • dev — integration branch. Never push directly.
  • feature/* — short-lived. Branch from dev, PR back to dev.

Where things live

Use this section to orient yourself. Do not search for files when the answer is here.

Source skills (edit here)

skills/<group>/*.md      Skill source files — YAML frontmatter + markdown body
                         Each <group> is a domain-specific bundle (e.g. github-agile)
                         A project enables exactly one group via skill_group: in .codecannon.yaml

These are the single source of truth for all generated output. Every edit to agent workflows starts here.

Generated output (never edit)

.claude/commands/*.md    Claude Code slash commands
.cursor/rules/*.mdc      Cursor agent rules
.agents/skills/          Codex / legacy agent skills
.gemini/skills/          Gemini agent skills

These are regenerated by ./sync.py. Each file contains a hash marker for change detection. If you need to change agent output, edit the source skill under skills/<group>/ and re-run sync.

Adapters

adapters/claude/         config.yaml + header.md — Claude Code adapter
adapters/cursor/         config.yaml + header.md — Cursor adapter
adapters/codex/          config.yaml + header.md — Codex adapter
adapters/gemini/         config.yaml + header.md — Gemini adapter

Each adapter has a config.yaml (output directory, file extension, agent name, notes) and a header.md (invocation header template using {skill} and {description} placeholders).

Configuration

.codecannon.yaml         This project's own config (adapters list + placeholder values)
config.schema.yaml       Canonical documentation for every placeholder
templates/codecannon.yaml  Template config for consumer projects to copy

Documentation

docs/index.md            Getting started and overview
docs/branching.md        Trunk, two-branch, and three-branch workflow docs
docs/customization.md    Tailoring skills to a project
docs/config-reference.md Every .codecannon.yaml setting explained
docs/adapters.md         Supported agents and how to add new ones
docs/skills/*.md         Per-skill documentation (start, deploy, qa, etc.)
README.md                User-facing overview and quick start

When asked to update documentation, check docs/ first — most detailed docs live there, not in README.md.

Build and workflow

Makefile                 CodeCannon-specific targets (sync, versioning, deployment)
Makefile.agents.mk       Generic git workflow targets (branch, pr, abandon, merge, promote)
sync.py                  The core sync engine (Python 3)
VERSION                  Current version number (plain text, e.g. 0.3.3)

Project meta

AGENTS.md                This file — instructions for agents working on CodeCannon
ROADMAP.md               Future ideas and planned work
.codecannon.yaml         Project config (also listed under Configuration)

Skill design philosophy

CodeCannon's skills were first written for a generation of models that needed to be told not just what outcome to produce but how to produce it — how to parse an argument string, what date format to use, which emoji maps to which CI state. Capable agents do all of that well unaided. Procedural over-specification no longer buys reliability; it burns context, crowds out the instructions that matter, and blocks a capable agent from doing something smarter than the author imagined.

Every instruction in a skill must pass one test:

Prune where model variance produces a different-but-fine result. Keep where model variance produces a wrong result.

  • Prune side — report formatting, argument tokenizing, investigation method, output templates, badge-to-emoji mappings. A differently-shaped-but-correct result is harmless, so hand the agent the intent and the inputs, not the procedure.
  • Keep side — ordering guarantees, human approval gates (and their exact wording), platform behaviour the model cannot derive, review policy, and the prompt-avoidance instructions (--body-file / no-heredoc / no-$(cat)). Variance in any of these is a defect, not a style difference.

Two categories look like removable noise when read quickly but are load-bearing — never weaken them:

  • Prompt-avoidance guidance. The --body-file and no-heredoc blocks exist because embedding markdown in a shell command triggers permission prompts that cannot be permanently allowed. State the rule once here and point at it; do not restate it per skill and do not soften it.
  • Platform-behaviour notes. Facts like "unqualified #N populates closingIssuesReferences", "Closes is inert on non-default-branch merges", and "gh issue develop --base reads from the API, not local working state" are knowledge a model has no way to derive. Keep them verbatim.

Calibrate the prune against the weakest supported harness and model size, not the strongest. Skills ship to several adapters and a range of model sizes; trusting the agent as far as the best available model would under-serve everyone else. The cost of variance decides where the line sits — not the capability of the strongest model.

story.md is the reference shape: overwhelmingly what rather than how, with business rules collected under a ## Hard rules section at the end and procedure written only where sequencing genuinely matters. Converge older skills toward it.

Skill anatomy

Each skill in skills/ follows this structure:

---
skill: start                    # Identifier (becomes the filename)
type: skill                     # "skill" (slash command) or "prompt" (non-invocable)
description: "Start a feature"  # Human-readable, used in adapter headers
args: "description text"        # What arguments the skill accepts
# Optional:
# output_path_override: path    # Override default output location
# no_invocation_header: true    # Skip the auto-generated header
---

Markdown body with instructions...

Placeholders

Use {{UPPERCASE_NAME}} syntax. All placeholders are documented in config.schema.yaml with descriptions, defaults, and which skills use them.

To add a new placeholder:

  1. Add it to config.schema.yaml with description, default, and used_in list.
  2. Add it with its default value to templates/codecannon.yaml.
  3. Use {{PLACEHOLDER_NAME}} in the relevant skill files.

Conditional blocks

Skills support conditional rendering:

{{#if BRANCH_TEST}}
  Content shown only when BRANCH_TEST has a value
{{/if}}

{{#if !BRANCH_TEST}}
  Content shown only when BRANCH_TEST is empty
{{/if}}

Change detection

sync.py embeds an MD5 hash in a marker comment at the end of each generated file:

<!-- generated by CodeCannon/sync.py | skill: start | adapter: claude | hash: a1b2c3d4 | DO NOT EDIT -->

If someone manually edits a generated file, the hash won't match and sync.py will refuse to overwrite it (unless run with --force).

Working on CodeCannon

Make targets

The primary commands for working on this project:

CommandWhat it does
make checkValidate that all skill placeholders resolve against config
make devPreview what sync would generate (dry run, no file writes)
make syncRegenerate all adapter output from skills/<group>/
make branch name=XCreate feature/X from dev
make prPush current branch and open PR to dev
make mergeMerge current PR into dev
make abandonDiscard changes and delete current feature branch
make bump-patchBump version patch segment, commit, and tag

Editing a skill

  1. Edit the source file under skills/<group>/ (this repo currently uses skills/github-agile/).
  2. Run make check to validate placeholders.
  3. Run make dev to preview generated output.
  4. Run make sync to regenerate all adapter output.
  5. Commit the skill source and the regenerated files together in the same PR.

Adding a new adapter

  1. Create adapters/{name}/config.yaml — set agent, output_directory, and output_extension.
  2. Create adapters/{name}/header.md — invocation header template using {skill} and {description}.
  3. Test with ./sync.py --skill start.
  4. Document any adapter limitations in config.yaml under notes.
  5. Update docs/adapters.md.

Adding a new skill

  1. Create skills/<group>/{name}.md with frontmatter (skill, type, description, args). Use the group that matches the skill's domain.
  2. Add any new placeholders to config.schema.yaml and templates/codecannon.yaml.
  3. Run make check and make dev to verify.
  4. Run make sync to generate output for all adapters.
  5. Create docs/skills/{name}.md with user-facing documentation.

Self-hosting: using CodeCannon to develop CodeCannon

This repo is the only project that runs sync as ./sync.py instead of CodeCannon/sync.py. Every consumer project uses the submodule path — this is the exception.

  • Edit-test loop: edit a skill under skills/<group>/ → make check → make dev → make sync → commit source + generated files together.
  • All adapter outputs are generated: after editing a skill, make sync regenerates .claude/commands/, .cursor/rules/, .agents/skills/, and .gemini/skills/. Commit all of them.
  • Never edit generated files directly — edit the source skill under skills/<group>/ and re-run make sync.

What agents must never do

  • Push directly to main or dev.
  • Edit generated files (.claude/commands/, .cursor/rules/, .agents/skills/, .gemini/skills/) — edit the source skill under skills/<group>/ instead.
  • Add project-specific content to skills/<group>/ — skills must remain generic. Use {{PLACEHOLDER}} tokens for anything project-specific.
  • Commit skill source changes without also committing the regenerated output (make sync).
  • Invent placeholder names — check config.schema.yaml for the canonical list.

Project layout

skills/                  source skill files (edit here)
adapters/                per-agent adapter configs and header templates
  claude/                  Claude Code (.claude/commands/*.md)
  cursor/                  Cursor (.cursor/rules/*.mdc)
  codex/                   Codex (.agents/skills/)
  gemini/                  Gemini (.gemini/skills/)
templates/               files for downstream projects to copy
  codecannon.yaml          template config
docs/                    user-facing documentation
  index.md                 getting started
  branching.md             branch workflow strategies
  customization.md         tailoring skills
  config-reference.md      config setting reference
  adapters.md              adapter documentation
  skills/                  per-skill documentation
config.schema.yaml       placeholder documentation (canonical)
.codecannon.yaml         this project's config
sync.py                  the sync engine
Makefile                 project-specific targets
Makefile.agents.mk       generic git workflow targets
VERSION                  current version
AGENTS.md                this file
README.md                user-facing overview
ROADMAP.md               future ideas

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.