Project Info
Inspiration
Anyone who's maintained a shared agents, skills or AGENTS.md file knows the pain: it's one giant Markdown blob, and the moment two people touch it at the same time — one adding a testing rule, another adding a security rule — Git hands you a merge conflict in the middle of prose. Unlike code, agent instructions are semantic, not syntactic, so there's no clean three-way merge to fall back on. We also watched the multi-agent-platform problem compound this: teams now maintain near-duplicate instruction files for Codex, Cursor, Claude and Copilot by hand, each one drifting slightly from the others. We wanted structured source files to do for agent instructions what they already do for infrastructure and code: small, ordered, composable units that compile deterministically into whatever output each tool needs.
What it does
AgentQuilt turns agent instructions into small Markdown fragments — one concern per file (role, build commands, testing rules, security rules) — stored under .agentquilt/agents/<agent-id>/ and numbered with gaps (010, 020, 030) so new fragments can be inserted without renumbering. A deterministic compiler reads the fragments plus a minimal agent.yaml manifest and produces identical, hash-verified Markdown every time — the same fragments compile straight to .codex/agents/*.toml, AGENTS.md, .claude/agents/*.md files, with no hand-written Codex config at all. agentquilt check is a gate that detects drift between source and disk, and a build-time tamper guard refuses to silently overwrite a generated file that's been hand-edited since the last build. On top of the CLI, we built a VS Code extension: a sidebar tree of agents and fragments read straight from the lock file, a live preview webview with real HTML rendering (via marked) instead of a raw escaped-string dump, a drift status bar that flips the moment a fragment changes and clears after a rebuild, and a one-click "Enable Provider" command that edits .agentquilt/config.yaml through the yaml package's Document API so comments and formatting survive.
How we built it
The core is TypeScript with Zod schema validation and Commander for the CLI (agentquilt init, build, build --watch, check, agents add/list, skills add/list). The compiler normalizes fragments (LF line endings, trailing newlines) before hashing so the hash always matches the output, and orders fragments strictly by Unicode code point — never locale-aware sorting — to keep builds reproducible across machines. A Merkle-style target version binds fragment content, order, and format identity together, so any change to any of the three bumps the version. Adapters translate the same fragment set into platform-specific output: Claude, Codex (as standalone TOML, never touching .codex/config.toml), and the vendor-neutral Agent Skills format. For the demo, we scripted a live, unstaged comparison: a monolithic REVIEWER.md where two simultaneous branches collide in a merge conflict, versus the same two changes as separate fragment files, which merge cleanly and then compile into a combined Codex agent. The VS Code extension reads the same agentquilt.lock file the CLI writes, so the editor view and the CLI's idea of "current state" never disagree.
Challenges we ran into
Model-tier resolution across platforms turned into a real trap, not just a demo bug: enabling Codex on the repository's own 14-agent dev portfolio broke the build outright, because modelTiers only mapped tier names like balanced to Claude model IDs, and Codex has no default model identifiers scaffolded (a deliberate choice per ADR-0015, not an oversight) — so every agent using model: balanced threw Tier "balanced" has no mapping for platform "codex". The fix wasn't to add Codex entries to fill the gap; it was recognizing that this particular target shouldn't have Codex enabled at all, and using a separate fixture repo to exercise Codex-specific features instead. Getting the Codex preview to render readably in the extension was its own fight — Codex's TOML output escapes newlines as literal \n in strings, so a naive text dump was unreadable; we ended up parsing it with smol-toml (the same library the CLI itself uses) to decode it back into real prose before rendering. And more mundanely: running concurrent work in the same checkout kept yanking uncommitted extension work across branches, which pushed us to build the extension in an isolated git worktree instead of fighting branch switches.
Accomplishments we're proud of
Deterministic output is a genuinely hard guarantee to keep honest, and we kept it: the same fragments always hash to the same target version and always compile to byte-identical Markdown, verified in CI via agentquilt check. The tamper guard means the tool can refuse to overwrite a manually edited generated file instead of silently discarding someone's work — a small feature that prevents a real class of data loss. Getting a from-scratch VS Code extension to read live off the same lock file the CLI produces, with drift detection and auto-refreshing previews, gave the merge-conflict story a visual, editor-native payoff instead of just a terminal trick. And the "adopt an existing hand-written agent file with one command, then watch it start compiling to a second platform for free" flow is the kind of demo that makes the value concrete in under a minute.
What we learned
The deepest lesson was that "platform-agnostic" is a much stricter constraint than it sounds: it means every named provider is an example instance of a registry entry, never a special case baked into the compiler, and it surfaces in unglamorous places like model-tier mappings, not just in adapter code. We also learned to treat generated files as sacred — agentquilt.lock, .codex/agents/*, AGENTS.md, CLAUDE.md are never hand-edited, full stop — because the moment you let one exception in, drift detection loses its meaning. On the tooling side, building the VS Code extension against the same lock file the CLI already writes (rather than re-deriving state) kept the two surfaces honest with each other for free, which we think is the right pattern for any companion UI layered on top of a CLI-first tool.
What's next
Immediate: rehearsing and recording the VS Code extension demo, then committing the extension work out of its current worktree and getting it through review. Near-term, deferred items already on the roadmap: lint rules and semantic diffing for fragments, an eval runner for regression-testing agent behavior across compiled versions (not just prompt-presence checks), and release packaging/migration tooling. Longer-term, the "Enable Provider" and platform quick-pick UX in the extension point toward making platform onboarding a guided, zero-hand-editing flow rather than a config file edit — and there's an open question of whether AgentQuilt should ship a small library of common fragment patterns (security review blocks, testing conventions) that teams can pull in rather than write from scratch.
AgentQuilt
AgentQuilt is a Git-native framework for maintaining AI agent instructions as structured, composable, validated source files instead of manually edited Markdown prompts.
Problem
Large agent Markdown files are hard to maintain in distributed teams. Multiple developers editing the same .md file often create merge conflicts, and those conflicts are difficult to resolve because agent instructions are semantic, not purely syntactic.
Solution
AgentQuilt introduces a structured source model:
Agent = Manifest + Instruction Blocks + Generated Prompt
Developers edit small, ordered instruction blocks (fragments). AgentQuilt validates them and compiles them deterministically into platform-specific artifacts — the same sources can produce Claude Code agents, Codex custom agents, AgentSkills skills, Cursor rules, Copilot instructions, and more. Generated files are never hand-edited; a lock file records every fragment hash so CI can detect drift.
Supported Platforms
| Platform | Type | Output |
|---|---|---|
claude | adapter | .claude/agents/<name>.md (one file per agent) |
agentskills | adapter | .agents/skills/<name>/SKILL.md (one skill per agent) |
codex | adapter | .codex/agents/<name>.toml (one file per agent) |
cursor | preset | .cursor/rules/<agent>.mdc (combined) |
copilot | preset | .github/copilot-instructions.md (combined) |
gemini | preset | GEMINI.md (combined) |
Plain Markdown document targets (e.g. a repo-level AGENTS.md) are also supported.
Requirements
- Node.js >= 18
Installation
npm install -g agentquilt
Or from source:
git clone https://github.com/daxdue/agentquilt.git
cd agentquilt
npm install
npm run build
Get Started
# 1. Scaffold a project (in your repo root)
agentquilt init --platform claude
# Or emit standalone Codex custom-agent files
agentquilt init --platform codex
This creates .agentquilt/config.yaml, the .agentquilt/agents/ source tree (plus .agentquilt/skills/ when the agentskills platform is selected), and a .gitattributes. If you already have agents in .claude/agents/ or skills in .agents/skills/, init adopts them as sources automatically. It refuses to overwrite an existing config unless you pass --force, and never overwrites an existing .gitattributes.
Adoption is limited to the platforms selected for that init run; bare init
selects Claude, while skills require --platform agentskills.
# 2. Add an agent
agentquilt agents add reviewer
This scaffolds .agentquilt/agents/reviewer/ with a manifest and a first instruction block:
.agentquilt/agents/reviewer/
├── agent.yaml # description, model tier, permissions
└── 010-role.md # first instruction block
Edit 010-role.md, and add more blocks as separate files — 020-style.md, 030-testing.md, … Blocks compile in filename order; use gaps of 10 so you can insert later without renumbering. Fragments in .agentquilt/agents/_shared/ can be included across agents.
Codex targets inherit the model selected by Codex unless a model tier or override is configured. Existing Codex TOML files are not reverse-adopted; the first build preserves a differing file until --force explicitly lets AgentQuilt claim that output path.
Skills work the same way from their own source root: agentquilt skills add <name> scaffolds .agentquilt/skills/<name>/ with a manifest and a 010-instructions.md, compiled to .agents/skills/<name>/SKILL.md by an agentskills target.
# 3. Compile
agentquilt build
For a codex target, build writes standalone files under .codex/agents/; it never edits .codex/config.toml.
This writes the platform outputs (e.g. .claude/agents/reviewer.md) and agentquilt.lock. Commit sources and generated outputs together.
# 4. Guard it in CI
agentquilt check
check exits non-zero if any generated output or the lock is stale relative to the sources — so a PR that edits a generated file by hand, or edits sources without rebuilding, fails the gate.
Exit codes: 0 success · 1 drift detected by check or an output blocked by build ownership/tamper protection · 2 config or validation error · 3 I/O error.
Commands
agentquilt init [--platform <p>...] [--force] # Scaffold project; adopt existing agents
agentquilt build [--watch] # Compile all targets, write outputs and lock
agentquilt check # CI gate: detect drift between source and outputs
agentquilt agents add <name> # Scaffold a new agent directory
agentquilt agents list # List agents and resolved models per platform
agentquilt skills add <name> # Scaffold a new skill directory
agentquilt skills list # List skills and their descriptions
Repository Structure
repo/
├── .agentquilt/ # All AgentQuilt sources live here
│ ├── config.yaml # Project config (targets, model tiers, sourceDir)
│ └── agents/ # Flat source tree for project and lifecycle agents
│ ├── project/ # Fragments for the repository development guide
│ └── <development-agent>/
│ ├── agent.yaml # Agent manifest
│ └── NNN-block.md # Instruction blocks (ordered by prefix)
├── .claude/agents/ # Compiled Claude Code agent outputs (generated)
├── AGENTS.md # Compiled document target (generated)
├── agentquilt.lock # Fragment hashes and target versions (generated)
├── packages/
│ ├── agentquilt-cli/ # CLI source (TypeScript, Commander, Zod)
│ └── website/ # agentquilt.dev landing page (Astro)
├── schemas/ # JSON Schema definitions (language-neutral)
├── policies/ # SDLC gate policies and risk register
├── scripts/ # Utility scripts and spike tests
└── .docs/ # Architecture specs, ADRs, SDLC/STLC docs
The config is discovered at .agentquilt/config.yaml (or .agentquilt/config.json);
the legacy root locations agentquilt.config.yaml / agentquilt.config.json are
still honored as a fallback.
Project Status
Current development line — the core author → build → check workflow: deterministic compiler, Zod-validated schemas, Claude, Codex, and AgentSkills adapters, platform presets, lock file, and drift checking.
Planned next (see Roadmap): eval-based regression testing, lint rules and semantic diff, and additional platform adapters.
Goals
- Reduce merge conflicts in agent files
- Make agent changes reviewable
- Validate agent definitions before compilation
- Generate deterministic Markdown prompts
- Support CI gates
- Support eval-based regression testing (planned)
- Provide traceability for agent behavior changes
Non-Goals
- Replacing human review
- Fully automatic semantic conflict resolution
- Building a web platform in the MVP
- Requiring live LLM calls for core compilation
Documentation
- Architecture Overview
- v1 Specification
- v1.1 Addendum
- ADR-0015: Codex Provider Adapter
- Glossary
- Roadmap
- Contributing
Contributing
See CONTRIBUTING.md for branch naming, commit format, PR expectations, and ADR policy.
License
MIT
Analysis
View
Metric
- 42
- 31
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- Tailwind CSSIn code
- TypeScriptIn code
2 of 2 appear in the indexed code.
AI coding agents
- Claude CodeConfig · Commits
- CodexConfig
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
1.6 MB
Source files
300
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
daxdue/agentquilt
364 files · 3.4 MB · @ 57e6f5b
Structure
Interface
12 files · 3%Screens, components and styles rendered to the user.
Application logic
74 files · 20%Domain rules, services and shared utilities.
+5 moreData & schema
7 files · 2%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Markdown74%
- TypeScript21%
- YAML4%
- Shell1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
packages/agentquilt-cli/package.json
npm · 13- commander
- smol-toml
- yaml
- zod
- +9 more
packages/website/package.json
npm · 9- @astrojs/sitemap
- @fontsource-variable/geist
- @fontsource-variable/geist-mono
- @vercel/analytics
- astro
- +4 more
package.json
npm · 22 development-only dependencies.
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.