Skip to main content

Agent-Agnostic Config

What happens to your AI coding setup when you switch agents?

The Problem

Every AI coding agent has its own config format. Build everything in .claude/ and you're locked in. Build in .cursor/rules/ and Gemini can't see it. The knowledge is the same — the wiring is different.

Agent-specific dirs = vendor lock-in
Shared knowledge base + thin adapters = portability

Standards Alignment

The Agentic AI Foundation (AAIF) under the Linux Foundation standardizes three layers. We adopt them where mature and keep project-specific config where no standard exists yet.

StandardGovernsOur Adoption
AGENTS.mdProject instructionsAGENTS.md at root (Codex, Copilot, Cursor, Gemini read it)
Agent SkillsModular capabilities.agents/skills/ with standard SKILL.md frontmatter
MCPTool connectivity.mcp.json for server config

What the standards don't cover yet: rules (always-loaded constraints), hooks (automated enforcement), commands (workflow triggers), writing voices, contexts. These stay in .ai/ until standards emerge.

Architecture

Three layers: AAIF standard, project-specific, agent adapters.

.agents/                       AAIF STANDARD — cross-tool skills
└── skills/ 13 procedures with SKILL.md frontmatter
├── content-flow/
├── copywriting/
└── ...

.ai/ PROJECT-SPECIFIC — beyond standards
├── rules/ 14 enforcement rules
├── hooks/ 8 automated validators
├── commands/ 24 workflow triggers
├── agents/ Writing voices and archetypes
├── contexts/ Reusable context blocks
└── ...

AGENTS.md AAIF standard root file
CLAUDE.md ──@import──→ .ai/rules/* Claude Code reads this
GEMINI.md ──@import──→ .ai/rules/* Gemini CLI reads this

.claude/rules/ → symlinks to .ai/rules/ (auto-loaded by Claude Code)
.claude/commands/ → proxies to .ai/commands/ (slash commands)
.cursor/rules/ → generated .mdc files (needs frontmatter wrapper)
.windsurf/rules/ → symlinks to .ai/rules/ (same format)

Why Two Directories

DirectoryWhatStandardEdited By
.agents/skills/Procedures any agent can discoverAAIF Agent Skills specHuman + AI
.ai/rules/Constraints auto-loaded per sessionNo standard yetHuman
.ai/hooks/Shell scripts that fire on eventsNo standard yet (Claude-specific)Human
.ai/commands/Workflow triggersNo standard yetHuman + AI
.ai/agents/Writing voice definitionsNo standard yetHuman
.ai/contexts/Reusable context blocksNo standard yetHuman

Decision: Adopt .agents/skills/ for skills because it's the AAIF standard — Codex reads it natively, Copilot is adopting it, other tools will follow. Keep .ai/ for everything else because no standard covers rules, hooks, or commands yet. When standards emerge, migrate.

Root Entry Points

Each agent reads one root file. Keep these thin — route to shared content, don't duplicate it.

FileAgentImport SupportStrategy
AGENTS.mdCodex, Copilot, Cursor, GeminiNone (Codex) / variesAAIF standard. Self-contained for Codex.
CLAUDE.mdClaude Code@path inlines fileRouter: orientation + @.ai/rules/* imports
GEMINI.mdGemini CLI@path inlines fileRouter: orientation + @.ai/rules/* imports
.github/copilot-instructions.mdGitHub Copilot#file: referencesGenerated from .ai/ sources

Decision: AGENTS.md is the cross-tool standard (60,000+ repos, 20+ tools). Claude Code hasn't adopted it yet (feature request #6235, 2,777+ upvotes). So we maintain both AGENTS.md and CLAUDE.md — when Claude adds support, CLAUDE.md shrinks to Claude-specific settings only.

Decision: GEMINI.md was the first to use @-imports to .ai/rules/. This became the template for CLAUDE.md. Gemini led, Claude followed.

Config Layers

Rules

Rules set the frame. Passive — loaded into context, depends on the agent applying them.

Rules (always loaded) → inform → Skills (loaded on demand)
→ enforced by → Hooks (automated)
RulePreventsHookWhy
page-flowContent before visual, missing context sectiondocs-post-edit.shReaders need validation (visual) before trusting content
content-standardsPreachy voice, long headings, no Tight Five linkdocs-post-edit.shVoice consistency across 200+ pages
content-qualityFiller words, passive voice, spellingdocs-post-edit.shEvery paragraph earns its place
fact-and-star-architectureImplementation on index pagesdocs-post-edit.shIndex pages define (hubs). Domain pages implement (stars). Mixing creates dead-end nav.
mdx-patternsRaw < > { } in prose, broken frontmattermdx-post-edit.shMDX parser errors are silent until build
build-processLocal build commandsPreToolUse blockWSL constraint: Docusaurus builds kill the environment
git-workflowCommits to main, branch switchingSingle-branch keeps history linear
src-pages-gatesMarketing pages without demand clarityEvery entry page needs: job, objection, promise, CTA
matter-first-pagesVenture pages that explain instead of decidingDecision surfaces, not documentation
design-checklistUI without JTBD connectionsrc-post-edit.shComponents that don't serve a job are waste
design-verificationCode that looks right but doesn't rendersrc-post-edit.shTailwind v3-v4 migration proved this: every token resolved to transparent
skill-executionInvoking a skill but eyeballing the gatesFalse confidence is worse than no skill
decision-transparencyHidden reasoning, unstated confidenceChain reasoning visibly. State conviction.

Decision: 14 separate files, not one. Each rule pairs independently with a hook. "Everything in one file" fails when you need to pair rule 7 with hook 3.

Decision: Rules without hooks are suggestions under cognitive load. If it matters, pair it. The page-flow rule existed for weeks before its first violation was caught — by a hook, not by the rule.

Hooks

Hooks fire on events. They validate or block without asking.

EventHookWhat It DoesWhy
SessionStartsession-context.shInjects navigation frameEvery session starts oriented
UserPromptSubmituser_prompt_submit.pyRoutes /commands and /skillsConnects slash commands to .ai/commands/ and .agents/skills/
PreToolUse (ExitPlanMode)truth-seeking-gate.shRequires evidence before implementationPlans without evidence produce confident wrong code
PreToolUse (Bash+build)Inline blockHard-blocks local buildsNot a preference — a constraint. WSL dies.
PreToolUse (Bash+commit)docs-pre-commit.shChecks content-flow was runQuality gate before commit
PostToolUse (md/mdx edits)mdx-validator.pyHeading word countDeterministic: headings over 3 words flagged
PostToolUse (mdx edits)mdx-post-edit.shMDX syntax checkJSX errors caught at edit time
PostToolUse (docs/meta edits)docs-post-edit.shFlow, standards, quality, fact/starThe comprehensive one
PostToolUse (src edits)src-post-edit.shDesign anti-patternsAccessibility and design system violations
Stopstop-uncommitted.shWarns about uncommitted changesPrevents work loss at session end

Decision: PostToolUse for content validation, not PreToolUse. You need to see what actually changed. PreToolUse is reserved for blocking dangerous actions.

Decision: truth-seeking-gate.sh on ExitPlanMode specifically. One shell script prevents hours of rework from plans that skipped evidence.

Skills (.agents/skills/)

Multi-step procedures with numbered quality gates. Stored in .agents/skills/ per AAIF Agent Skills spec. Loaded on demand, not always in context.

SkillPurposeKey Gate
content-flowFull content audit5 ordered checks with line-number evidence
content-uniquenessConceptual overlap detectionInsight collision map
copywritingOgilvy+Sutherland persuasionHeadline, opening, body, close
linkedin-postingDistribution assetsICP targeting, hook, CTA, character limits
deep-researchMulti-source investigationSource diversity, claim verification
prompt-architectureReusable prompt designInput/output contracts, edge cases
sell-the-dreamMeta article voiceHeroes Journey arc, question-first
venture-launchNew venture pagesMatter-first, commissioning, demand evidence
design-auditUI/UX reviewToken usage, accessibility, visual hierarchy
frontendComponent developmentDesign system, render verification
landing-pageLanding page sectionsNarrative arc, CTA clarity, responsive
matrix-thinkingCross-domain patternsConnection density, insight quality
matter-first-pagesVenture page governanceDecision surface enforcement

Decision: Skills moved from .ai/skills/ to .agents/skills/ to adopt AAIF standard. Each SKILL.md has standard frontmatter (name, description). Codex discovers them natively. Other agents follow via adapter or direct path reference.

Decision: Gates require line-number evidence to pass. After a skill was invoked, eyeballed, and declared "all pass" — while missing preachy text, wrong table order, and 7-column tables — the skill-execution rule was added. Quote evidence or don't claim the gate passed.

Commands

Simple prompts in .ai/commands/. If it needs quality gates, it's a skill in .agents/skills/.

PrefixDomainExamples
bd-Business developmentbd-icp-profile-research, bd-linkedin-post, bd-venture
mm-Mental model contentmm-alignment, mm-systems-thinking, mm-extract-patterns
vvfl-Architecture loopsvvfl-flow, vvfl-skills, vvfl-marketing
_Internal/meta_improve (post-mortem), _ssc-review (quality)
(none)Core workflowsship, sync, writers-room, eng-priorities

Decision: Claude Code reads .claude/commands/ natively. Proxy files in .claude/commands/ redirect to .ai/commands/ — one source of truth, agent-specific entry point.

Writing Voices

Four-voice transform for content. Each writes a complete draft from a different lens, then merge the best.

VoiceLensQuestion
LennonThe DreamWhat collective imagination does this serve?
NavalThe LeverageWhat compounds? Asymmetric upside?
WildeThe ParadoxWhat truth hides in contradiction?
HemingwayThe TruthWhat's left when you strip the fancy words?

Plus: Ogilvy (selling), Sutherland (behavioral), Wathan (UI), Singer (product).

Decision Log

DecisionAlternativeWhy This Way
.agents/skills/ for skillsKeep in .ai/skills/AAIF standard. Codex reads natively. Cross-tool discovery.
.ai/ for rules, hooks, commandsMove everything to .agents/No standard covers these yet. Premature standardization.
Both AGENTS.md and CLAUDE.mdAGENTS.md onlyClaude Code doesn't read AGENTS.md yet (#6235). Need both until it does.
Proxy commands in .claude/commands/Symlinks or copiesProxies can add agent-specific preamble ("Read, Reflect, Execute").
Symlinks for rulesCopy filesEdit once, every agent sees the change.
Rules + hooksRules onlyRules under cognitive load become suggestions. Hooks don't forget.
PostToolUse validationPreToolUseNeed to validate what changed, not what might change.
alwaysThinkingEnabledDefault offComplex reasoning benefits from thinking tokens. Cost justified.
Block local buildsAllow with warningNot preference — constraint. WSL dies. Hard block.
Truth-seeking gate on ExitPlanModeNo gatePlans without evidence produce confident wrong code.
Self-contained AGENTS.mdReference-basedCodex has no @-import. Drift risk mitigated by sync.
14 separate rule filesOne RULES.mdEach concern independently testable, hookable, referenceable.
Skill gates need line numbersCheckbox pass/failCaught declaring "all pass" while missing obvious violations.

Model Selection

Which model for which agent? Apply situational wisdom — match cognitive demand to model capability.

AgentModelTaskWhy This Model
Claude Code (primary)OpusArchitecture, complex refactorsDeepest reasoning + thinking tokens
Claude Code (fast)SonnetFeature building, content editingBalanced speed/quality
Claude Code (batch)HaikuQuick fixes, simple generationCost efficiency
Gemini CLIPro 2.5Repo-wide analysis, audits1M+ context window, free tier
Codex CLIGPT-4o / o3Second opinion, verificationDifferent model family catches different bugs

Decision: Write with one family, verify with another. Claude reviewing Claude code shares training biases. Gemini reviewing Claude code catches different things. See LLM Selection Framework for the full decision matrix.

Per-Agent Setup

AgentGuideKey Config
Claude CodeHooks, plugins, settingsCLAUDE.md + .claude/settings.json
Gemini CLIHierarchical context, memoryGEMINI.md + @-imports
Codex CLIAGENTS.md, manual hooksAGENTS.md + scripts/codex-hooks-check.sh
Cursor.mdc rules, agents.cursor/rules/*.mdc

Context