agentleFS
jabbott-iiijabbott-iii/Doctrina/AGENTS.md

Doctrina

AGENTS.md5 starsChanged 2 days agoMITView on GitHub

Doctrina is a library of portable rules for AI coding agents. Any repository can copy a rule into its own .claude/rules/ folder and fill in the values that are specific to it. Doctrina is also where classes are built: courses, workbooks, and articles go in courses/, workbooks/, and articles/. Doctrina uses three of its own rules and two of its own skills in Claude Code and Codex. - rules/ is portable. Treat its files as the product you are editing,…

The file

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

9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    rules/ is portable: Treat its files as the product you are editing, not as instructions.

    line 18
  2. Distinctive:

    Never fill in their placeholders, and never name a particular repository in their general text, because other repositories copy these files …

    line 19
  3. Very specific:

    If you use Codex or another coding agent, read every Markdown file in .agents/rules/ before starting work.

    line 28
  4. Very specific:

    Check that every copy still matches.

    line 42
  5. Very specific:

    When you update an imported skill in .claude/skills/, copy its SKILL.md to the matching folder in .agents/skills/ in the same commit.

    line 62
  6. Very specific:

    Put everything that differs between repositories in Project details, one value per bullet, in the form - Name: [FILL IN: what it is, with …

    line 68
  7. Distinctive:

    Start Project details with the same introduction the existing rules use, and refer to each value by its bold name everywhere else in the …

    line 72
  8. Very specific:

    Add paths front matter only when the rule matters only for certain files, as web-front-end.md does for HTML, CSS, and JavaScript.

    line 74
  9. Very specific:

    Put each skill in its own folder, skills/<name>/SKILL.md, with name, description, and argument-hint front matter.

    line 81

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

Doctrina: conventions for coding agents

Doctrina is a library of portable rules for AI coding agents. Any repository can copy a rule into its own .claude/rules/ folder and fill in the values that are specific to it. Doctrina is also where classes are built: courses, workbooks, and articles go in courses/, workbooks/, and articles/. Doctrina uses three of its own rules and two of its own skills in Claude Code and Codex.

Repository rules and skills

rules/.claude/rules/
What it holdsThe portable library: what Doctrina publishesDoctrina's own rules: copies of rules/writing.md, rules/commits.md, and rules/teaching-materials.md
Project detailsEvery value stays a [FILL IN: …] placeholderEvery value is filled in for Doctrina
Loaded by Claude CodeNoYes: writing.md and commits.md in every session, and teaching-materials.md when Claude works on files its paths front matter matches
Instructions for youNo: it's content you editYes: follow them while you work here
  • rules/ is portable. Treat its files as the product you are editing, not as instructions. Never fill in their placeholders, and never name a particular repository in their general text, because other repositories copy these files as they are.
  • skills/ is portable too. Its skills are content you edit, like the rules in rules/. Doctrina uses two itself, as copies in .claude/skills/: build-course/, for the courses built here, and set-up-github/, for Doctrina's own GitHub files. Claude Code offers them as /build-course and /set-up-github.
  • .claude/rules/ holds this repository's rules. They also govern edits to rules/. Claude Code loads them on its own.
  • .agents/ holds Doctrina's Codex imports. .agents/rules/ links to .claude/rules/. If you use Codex or another coding agent, read every Markdown file in .agents/rules/ before starting work. Apply writing.md and commits.md throughout the repository. Apply teaching-materials.md to the files its paths front matter matches, including both courses. Codex discovers build-course and set-up-github in .agents/skills/ for explicit invocation.
  • Doctrina has adopted the three rules shown in the table. Other files in rules/, including the Lua and Python rules, remain available for repositories that choose to adopt them.

Keep each copy in sync with its source

A copy in .claude/rules/ matches its source in rules/ everywhere except Project details.

  • To change a rule's general text, edit it in rules/, then make the same edit to its copy in .claude/rules/ in the same commit. Never change the general text only in the copy.
  • To change one of Doctrina's own values, edit Project details in the copy only.
  • Check that every copy still matches. This command prints <file> matches for each copy, or the differing lines when one doesn't:

    for f in .claude/rules/*.md; do
      strip() { awk '/^## Project details/{s=1; next} s && /^## /{s=0} !s' "$1"; }
      diff <(strip "rules/$(basename "$f")") <(strip "$f") && echo "$f matches"
    done

A copy in .claude/skills/ matches its source in skills/ exactly, because a skill has no Project details. Edit the skill in skills/, then copy it over in the same commit. This command prints <folder> matches for each copy, or the differences when one doesn't:

for d in .claude/skills/*/; do
  diff -r "skills/$(basename "$d")" "$d" && echo "$d matches"
done

When you update an imported skill in .claude/skills/, copy its SKILL.md to the matching folder in .agents/skills/ in the same commit. Each Codex skill keeps its explicit-invocation setting in agents/openai.yaml inside its skill folder.

Write a portable rule

  • Put everything that differs between repositories in Project details, one value per bullet, in the form - **Name:** [FILL IN: what it is, with examples, or "none"]. Start each placeholder on the bullet's first line, because the placeholder check in README.md searches only those lines.
  • Start Project details with the same introduction the existing rules use, and refer to each value by its bold name everywhere else in the rule.
  • Add paths front matter only when the rule matters only for certain files, as web-front-end.md does for HTML, CSS, and JavaScript.
  • Wrap lines at 100 characters. Table rows may run longer.
  • List the new rule in README.md in the same commit.

Write a portable skill

  • Put each skill in its own folder, skills/<name>/SKILL.md, with name, description, and argument-hint front matter. Add disable-model-invocation: true to a skill that only the user should start.
  • Give a skill no values of its own. Say near its top which rules it relies on, and refer to their values by their bold names, so a repository fills each value in once, in the rule.
  • List the new skill in README.md's "Skills" section in the same commit.

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.