agentleFS
BostonOrangeBostonOrange/claude-code-framework/AGENTS.md

claude-code-framework

AGENTS.md2 starsChanged 6 months agoMITView on GitHub

This file mirrors CLAUDE.md so that tools following the AGENTS.md convention (e.g. Codex) get the same framework instructions Claude Code does. Codex-format agent and hook configs live in .codex/; portable skills live in .agents/skills/. Keep this file and .codex/ in sync with CLAUDE.md and .claude/. This is the claude-code-framework — a reusable AI development workflow framework. It provides skills, agents, commands, rules, hooks, and templates that get installed into target projects via setup.sh or setup.ps1. This repo is the framework…

  • Reads credentials

The file

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

9 rules. About 0 are common, 1 is distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

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

    This repo is the framework itself, NOT a target project: Do not run setup.sh here.

    line 9
  2. Very specific:

    Create a .md file in templates/agents/ with YAML frontmatter: name, description, tools, model.

    line 110
  3. Very specific:

    Create a .md file in templates/commands/ with YAML frontmatter: name, description, allowed-tools.

    line 114
  4. Very specific:

    Create a .md file in templates/rules/ with YAML frontmatter: patterns array.

    line 118
  5. Very specific:

    Create a .sh file in templates/hooks/.

    line 122
  6. Very specific:

    When modifying setup.sh, always mirror changes to setup.ps1.

    line 135
  7. Very specific:

    When updating the framework's agents, hooks, or instructions, keep the .codex/ and AGENTS.md mirrors in sync with their .claude/ / …

    line 208
  8. Distinctive:

    After modifying the framework, test by running setup in a temp directory:

    line 212
  9. Very specific:

    Commit messages follow conventional format: Add, Fix, Update, Remove

    line 224

≈ “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 — Claude Code Framework

This file mirrors CLAUDE.md so that tools following the AGENTS.md convention (e.g. Codex) get the same framework instructions Claude Code does. Codex-format agent and hook configs live in .codex/; portable skills live in .agents/skills/. Keep this file and .codex/ in sync with CLAUDE.md and .claude/.

Project Overview

This is the claude-code-framework — a reusable AI development workflow framework. It provides skills, agents, commands, rules, hooks, and templates that get installed into target projects via setup.sh or setup.ps1.

This repo is the framework itself, NOT a target project. Do not run setup.sh here.

Tech Stack

LayerTechnology
SkillsMarkdown (YAML frontmatter + instructions)
AgentsMarkdown (YAML frontmatter + multi-step processes)
CommandsMarkdown (YAML frontmatter + steps)
RulesMarkdown (YAML frontmatter with patterns + guardrails)
HooksBash scripts
SetupBash (setup.sh) + PowerShell (setup.ps1)
CI/CD templatesGitHub Actions YAML
ConfigJSON (settings.json, settings.local.json)

System Structure

claude-code-framework/
├── CLAUDE.md                    # Claude Code instructions
├── AGENTS.md                    # This file (mirror of CLAUDE.md for AGENTS.md-convention tools)
├── README.md                    # User-facing documentation
├── setup.sh                     # Bash setup wizard
├── setup.ps1                    # PowerShell setup wizard
├── install-global-skill.sh      # Installs global skills into ~/.claude/skills/
├── install-global-skill.ps1     # PowerShell equivalent
├── global-skills/               # Account-level skills (→ ~/.claude/skills/), NOT per-repo
│   └── install-framework/       # /install-framework — bootstrap framework into any repo
├── .codex/                      # Codex-format configs for this repo (agents/*.toml, hooks/, hooks.json, config.toml)
├── .agents/skills/              # Portable skills for the AGENTS.md convention
├── templates/                   # Files copied to target projects
│   ├── CLAUDE.md.template       # Target project's CLAUDE.md
│   ├── settings.json            # User-level permissions (~/.claude/)
│   ├── settings.local.json      # Project-level permissions
│   ├── mcp.json                 # MCP server config (→ .mcp.json)
│   ├── agents/                  # 39 AI agent definitions
│   ├── commands/                # 11 quick command definitions
│   ├── internal-nextjs-business-app/ # Vendored app-creator template
│   ├── rules/                   # 23 file-pattern guardrails
│   ├── hooks/                   # 7 lifecycle scripts + 1 utility (codebase-index.sh)
│   └── statusline/              # Status bar config
├── skills/                      # 27 workflow skills + 1 template
├── workflows/                   # 4 GitHub Actions CI/CD templates
├── memory/                      # Memory system templates
└── docs/                        # Framework documentation

Key Conventions

Placeholder System

Templates use {{PLACEHOLDER}} syntax. setup.sh replaces these with project-specific values at install time.

Common placeholders:

  • {{BASE_BRANCH}} — primary integration branch (main/develop)
  • {{PROJECT_SHORT_NAME}} — short name for worktree directories
  • {{TEST_COMMAND}} — project test runner (npm test, pytest, etc.)
  • {{FORMAT_COMMAND}} — project formatter (prettier, black, etc.)
  • {{TRACKER_FETCH_TICKET}} — API call to fetch work items
  • {{API_ROUTE_PATTERNS}} — glob patterns for rule file scoping
  • {{SOURCE_PATTERNS}} — glob patterns for source files (used by auth-security, data-protection, error-handling rules)
  • {{COMPONENT_PATTERNS}} — glob patterns for UI components (used by components, design-system rules)
  • {{DATABASE_PATTERNS}} — glob patterns for DB files
  • {{DEFAULT_MODEL}} — default Claude model (sonnet)
  • {{DESIGN_COLOR_RULES}}, {{DESIGN_COMPONENT_IMPORTS}}, {{DESIGN_ICON_USAGE}}, {{DESIGN_CARD_PATTERNS}}, {{DESIGN_DARK_MODE}} — design system conventions

Non-Interactive Setup (CCF_* env vars)

setup.sh --non-interactive and setup.ps1 -NonInteractive read answers from CCF_* environment variables instead of prompting. This is what the global /install-framework skill drives. Interactive mode remains the default. Variables: CCF_PROJECT_TYPE (required), CCF_TRACKER, CCF_CICD, CCF_BASE_BRANCH, CCF_NOTIFICATION, CCF_PROJECT_SHORT_NAME, CCF_DESIGN_SYSTEM, plus CCF_HOSTING_TARGET / CCF_STORAGE_PROVIDER / CCF_POSTGRES_PROVIDER for internal-nextjs-app. Non-interactive mode never renames git branches. When adding a new prompt to the installers, also add its CCF_* variable to both the --non-interactive resolver in setup.sh and the resolver in setup.ps1.

Global Skills (global-skills/)

global-skills/ holds account-level skills installed into ~/.claude/skills/ (via install-global-skill.sh / .ps1), NOT copied into target repos by setup.sh. Currently: install-framework. Because these are not per-repo template skills, they do not count toward the "27 workflow skills" total.

Repo Knowledge Skills (.claude/skills/ccf-*)

The ccf-* skills under .claude/skills/ are a dogfood-only institutional-knowledge library for working ON this framework repo (architecture rationale, testing/QA, dogfood drift, setup parity, release/install, debugging, failure history, doc-sync, domain vocabulary). Consult them before re-deriving repo knowledge from scratch — start with ccf-onboarding-tour for a guided reading order; each skill's description says exactly when to load it. They are stability: experimental, scope: preset, NOT distributable (kept out of templates/ and skills/, allowlisted in config/dogfood-drift-allowlist.txt), and do NOT count toward the workflow-skills total above.

Adding New Skills

Copy skills/_template/ and edit SKILL.md. Use YAML frontmatter with name and description. See docs/skill-authoring.md.

Adding New Agents

Create a .md file in templates/agents/ with YAML frontmatter: name, description, tools, model. See docs/agents-commands-rules.md.

Adding New Commands

Create a .md file in templates/commands/ with YAML frontmatter: name, description, allowed-tools. Keep commands simple (single-purpose).

Adding New Rules

Create a .md file in templates/rules/ with YAML frontmatter: patterns array. Rules are guardrails, not suggestions.

Adding New Hooks

Create a .sh file in templates/hooks/. Wire it up in templates/settings.local.json under the hooks section.

Setup Script Architecture

Both setup.sh and setup.ps1 follow the same flow:

  1. Prompt — project type, internal app hosting/storage/Postgres choices when applicable, tracker, CI/CD, base branch, notification system, project short name, design system
  2. Build placeholders — map project type to commands (test, format, deploy, type-check, etc.)
  3. Copy files — skills, agents, commands, rules, hooks, settings
  4. Replace placeholders — sed (bash) or .Replace() (PowerShell) in all copied files
  5. Conditional logic — skip components.md and design-system.md rules for backend-only projects or when no design system is configured
  6. Generate extras — .env template, GitHub Actions workflows, CLAUDE.md, internal app .env.example and setup docs when selected

When modifying setup.sh, always mirror changes to setup.ps1.

Agent Teams

Spawn pre-configured teams for parallel analysis of the framework:

TeamCommandAgents
Review/team reviewcode-reviewer, security-auditor, ui-ux-reviewer
Architecture/team architecturearchitect, api-designer, database-architect
Release/team releasesecurity-auditor, devops-engineer, performance-optimizer
Quality/team qualitycode-reviewer, test-writer, performance-optimizer
Documentation/team documentationdocumentation-writer, api-designer
Design/team designui-ux-reviewer, performance-optimizer, frontend-architecture-reviewer
Full/team fullAll 12 agents (intentionally reduced dogfood roster; target projects get 15)
Custom/team custom a b cAny combination

Agents Available

AgentPurposeModel
architectSystem design, patterns, scalabilityopus
code-reviewerBugs, security, performance in diffs (broad sweep)opus
code-smell-reviewerCode smells: long methods, magic numbers, primitive obsession, dead code (cites code-smells rule)opus
dry-reviewerDuplication: 3+ repeated logic (cites dry rule)opus
purity-reviewerPure functions, side effects, query/command separation, SRP (cites purity rule)opus
complexity-reviewerFunction length, cyclomatic complexity, nesting, parameter count (cites complexity rule)opus
security-auditorOWASP audit, credentials, dependenciesopus
devops-engineerCI/CD, containers, infrastructureopus
ui-ux-reviewerAccessibility, design, responsivenessopus
performance-optimizerBundle, queries, caching, memoryopus
api-designerEndpoint design, schemas, versioningopus
database-architectSchema, indexes, migrationsopus
test-writerTest generation following conventionsopus
documentation-writerAPI docs, READMEs, guidesopus
frontend-architecture-reviewerFE structure: composition, state, hooks, data flow, render-perf (cites frontend-architecture rule)opus
architecture-reviewerLayering: dependency direction, cross-module reach, circular deps, god modules (cites architecture-layering rule)opus
api-layering-reviewerAPI structure: controller/service/repo separation, validation placement, error contract (cites api-layering rule)opus
crypto-reviewerOWASP A02: weak hashes, password storage, RNG, encryption modes/IV, JWT, TLS (cites crypto rule)opus
solid-reviewerOCP/LSP/ISP/DIP (cites solid rule); SRP is purity-reviewer's domainopus
concurrency-reviewerRace conditions, TOCTOU, async/lock discipline, mutable shared state, background workers (cites concurrency rule)opus
observability-reviewerOWASP A09: structured logging, log levels, metrics, tracing, audit logs, alerting (cites observability rule)opus
supply-chain-reviewerOWASP A06+A08: lockfiles, pinning, CVE reachability, signing, dev/prod separation, CI integrity (cites supply-chain rule)opus
requirements-clarifierPlanning specialist: ambiguity hunt, open questions, missing ACopus
scope-decomposerPlanning specialist: atomic steps, sequencing, parallelism groupsopus
risk-assessorPlanning specialist: rollback paths, blast radius, migration risk + mitigationsopus
test-strategy-plannerPlanning specialist: test levels per planned stepopus
scaffold-implementerBuild phase 1: skeleton (file structure, types, signatures, stubs)opus
happy-path-implementerBuild phase 2: core successful flow (defers errors and edges)opus
edge-case-implementerBuild phase 3: validation, errors, edge data (binds error-handling, auth-security, data-protection)opus
refactor-pass-implementerBuild phase 6 (final): actively applies code-smells/dry/purity/complexity rulesopus
framework-improver-detectorSelf-improvement read-only (invoked by /improve Phase 1); scans + builds /setup-aware skip-list + writes proposalopus
framework-improver-applierSelf-improvement write (invoked by /improve Phase 3); skip-list re-validation + apply + audit logopus
review-coordinatorSynthesizes parallel reviewer output (dedupe, filter, risk-tier classify, cross-iteration state)opus
planner-coordinatorOrchestrates planning specialists, classifies scope, synthesizes one planopus
build-coordinatorOrchestrates build phases sequentially (scaffold → happy-path → edge-case → tests → docs → refactor)opus
project-setup-detectorFirst-time onboarding read-only (invoked by /setup Phase 1); 17-layer detection + writes proposalopus
project-setup-applierFirst-time onboarding write (invoked by /setup Phase 4); allowlist + backup + substitutions + audit logopus
impact-analyzerOn-demand cascade analysis for a symbol/file (invoked by /impact); greps callers, classifies, scores confidenceopus
docs-staleness-reviewerReviews diffs for material changes without CLAUDE.md / AGENTS.md updates; cites docs-staleness ruleopus

framework-qa is available in this repo's own .claude/agents/ (and mirrored in .codex/agents/) but is not a distributable template agent.

Codex / AGENTS.md Support

This repo ships first-class support for the AGENTS.md convention and OpenAI Codex, mirroring the Claude Code setup:

  • AGENTS.md (this file) — mirrors CLAUDE.md so non-Claude tools get the same instructions.
  • .codex/agents/*.toml — 12 Codex-format agent definitions, the same set as the repo's own .claude/agents/: api-designer, architect, code-reviewer, database-architect, devops-engineer, documentation-writer, framework-improver, framework-qa, performance-optimizer, security-auditor, test-writer, ui-ux-reviewer. (The 39 agents in the table above are the distributable templates/agents/ set; these 12 are the repo's own working agents.)
  • .codex/hooks/ + .codex/hooks.json — Codex lifecycle hooks mirroring .claude/hooks: guardrails.sh on PreToolUse (Bash), post-edit-sync.sh on PostToolUse (Edit/Write), and session-stop.sh + post-coding-review.sh on SessionEnd. Hook commands use repo-relative paths so they work on any clone.
  • .codex/config.toml — Codex configuration.
  • .agents/skills/ — portable skills (improve, team).

When updating the framework's agents, hooks, or instructions, keep the .codex/ and AGENTS.md mirrors in sync with their .claude/ / CLAUDE.md counterparts.

Testing Changes

After modifying the framework, test by running setup in a temp directory:

mkdir /tmp/test-project && cd /tmp/test-project && git init
bash ~/Developer/claude-code-framework/setup.sh
# Verify: all files copied, placeholders replaced, no {{...}} remaining
grep -r "{{" .claude/ CLAUDE.md | grep -v ".git"

Version Control

  • Branch: main
  • Commit messages follow conventional format: Add, Fix, Update, Remove
  • Co-author attribution for AI-assisted commits

Self-Improvement

Before ending any session where framework files were modified, spawn /improve (which orchestrates framework-improver-detector → framework-improver-applier) in the background. This keeps CLAUDE.md, AGENTS.md, README.md, docs, and setup scripts in sync with the actual framework state.

Additionally, run the framework-qa agent to validate that all counts and tables are consistent across README, CLAUDE.md template, setup scripts, and docs.

These agents are not launched by a hidden mutating hook. They are an explicit contributor workflow enforced by this repo's instructions, with deterministic tests as the hard gate.

How the self-improvement system works

LayerMechanismWhenWhat
Hookguardrails.sh (PreToolUse)Before every Bash commandBlocks dangerous ops (deploys, migrations, force push)
Hookpost-edit-sync.sh (PostToolUse)After every Edit/WriteFlags which docs need updating based on what changed
Agentframework-improver-detector + framework-improver-applier (via /improve)End of every session with changesDetector scans + builds skip-list (read-only); applier validates skip-list + applies + audit log
Agentframework-qaEnd of every session with changesValidates all doc counts and tables match actual files
Teststests/run-all.shBefore PR / CIDeterministic hard gate for counts, placeholders, templates, guardrails, setup smoke, and dogfood drift
CLAUDE.md / AGENTS.mdThis instructionAlwaysEnforces the above as non-optional behavior

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.