aigx 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
aigx-1.2.0/LICENSE ADDED
@@ -0,0 +1,36 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Grégory Parisotto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ------------------------------------------------------------------------------
24
+ SCOPE OF THIS LICENSE
25
+
26
+ This MIT License covers the AIGX reference TOOLS and source code: the `aigx`
27
+ CLI (packages/ and crates/), tools/aigx-lint, tools/aigx-sync, tools/aigx-mcp,
28
+ tools/aigx-export, bin/create-aigx, pyproject.toml, and all other code in this
29
+ repository.
30
+
31
+ The AIGX SPECIFICATION TEXT — the `standard/` directory and the informal
32
+ SPEC.md — is licensed separately under Creative Commons Attribution 4.0
33
+ International (CC-BY-4.0). See standard/LICENSE.
34
+
35
+ Open specification + permissive tools: anyone may reimplement AIGX in any
36
+ language without restriction.
aigx-1.2.0/PKG-INFO ADDED
@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: aigx
3
+ Version: 1.2.0
4
+ Summary: Reference validator + resolver for AIGX (AI Genome Exchange) — the open context format for AI coding agents. Zero dependencies.
5
+ Author-email: Grégory Parisotto <gregory@feex.it>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Lolner95/AIGX
8
+ Project-URL: Specification, https://github.com/Lolner95/AIGX/blob/main/standard/AIGX-1.1.md
9
+ Project-URL: Source, https://github.com/Lolner95/AIGX
10
+ Project-URL: Issues, https://github.com/Lolner95/AIGX/issues
11
+ Keywords: aigx,ai-genome-exchange,ai,agents,context,lint,validator,llm
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Software Development :: Quality Assurance
18
+ Classifier: Topic :: Software Development :: Build Tools
19
+ Requires-Python: >=3.8
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Dynamic: license-file
23
+
24
+ # aigx-lint
25
+
26
+ A tiny, **zero-dependency** (Python 3.8+ stdlib) validator and resolver for AIGX genomes. It exists to
27
+ kill the two most common objections to a centralized context format - *"it rots"* and *"it won't scale"* -
28
+ by making both mechanically false.
29
+
30
+ ## Why
31
+
32
+ - **It can't rot silently.** `aigx-lint` checks the genome against the **actual repository**: every
33
+ `<file path>` must still exist on disk, and every `<check>` id must resolve to a real `<rule>`. Run it in
34
+ CI or a pre-commit hook and a moved/renamed file **fails the build** until its entry is fixed - the same
35
+ discipline teams already use for `CODEOWNERS` and `tsconfig` path maps.
36
+ - **It scales by resolution, not ingestion.** `--resolve PATH` returns just one file's entry, so an agent's
37
+ context cost is **O(1) per edited file**, independent of index size. A 50,000-entry index is one lookup.
38
+ - **It understands hierarchical genomes.** Every `.aigx/` directory under the root is discovered; each
39
+ `files.aigx` indexes its own subtree (see [SPEC §8](../../SPEC.md#8-scaling-to-large-repositories--monorepos)).
40
+
41
+ ## Usage
42
+
43
+ ```bash
44
+ # Validate the genome(s) under the current repo. Exits non-zero on errors (CI-friendly).
45
+ python aigx_lint.py --root .
46
+
47
+ # Print just one file's boundary entry - constant-cost lookup an agent/MCP can call.
48
+ python aigx_lint.py --resolve src/features/meetings/bookMeeting.ts --root .
49
+
50
+ # Machine-readable output for MCP servers, editor extensions, and agent wrappers.
51
+ python aigx_lint.py --resolve src/features/meetings/bookMeeting.ts --root . --format json
52
+
53
+ # Summary: genomes, rules, entries, and the all-important forbid scarcity.
54
+ python aigx_lint.py --stats --root .
55
+ ```
56
+
57
+ `--resolve` returns exit code `0` when the target file exists even if the genome has no matching
58
+ `<file>` entry; that is an informational "no boundary indexed yet" result, not a tool failure. It returns
59
+ exit code `2` when the target path itself does not exist.
60
+
61
+ ## What validation catches
62
+
63
+ | Check | Why it matters |
64
+ |---|---|
65
+ | `<file path>` exists on disk | catches renamed/moved/deleted files → the genome can't go stale unnoticed |
66
+ | every `<check>` id resolves to a `<rule>` | catches dangling references when a rule is renamed/removed |
67
+ | duplicate `<file>` entries (warning) | catches copy-paste drift across shards |
68
+
69
+ ## JSON shape
70
+
71
+ JSON output is intentionally small and stable so MCP bridges can inject AIGX context without scraping XML:
72
+
73
+ ```json
74
+ {
75
+ "found": true,
76
+ "path": "src/features/meetings/bookMeeting.ts",
77
+ "domain": "meetings",
78
+ "role": "Book a meeting (validate slot + contact)",
79
+ "forbid": { "priority": "CRIT", "text": "NEVER import internal suppliers modules" },
80
+ "gotcha": { "priority": null, "text": "Use the public suppliers API for contact email" },
81
+ "checks": ["ARCH-no-deep-imports", "DATA-integer-cents"],
82
+ "block": "<file path=\"...\">...</file>"
83
+ }
84
+ ```
85
+
86
+ When there is no indexed boundary for an existing file, `found` is `false` and `exists` is `true`.
87
+
88
+ > Try it on [`examples/sourcing-app/`](../../examples/sourcing-app/): `--stats` and `--resolve` work
89
+ > directly; `--validate` will (correctly!) report the `src/**` paths as missing, because that example ships
90
+ > only the genome, not the application source - which is exactly the "moved/missing file" signal the linter
91
+ > is built to catch. Run it against a real checkout to see it pass clean.
92
+
93
+ ## CI examples
94
+
95
+ **GitHub Actions:**
96
+
97
+ ```yaml
98
+ name: aigx
99
+ on: [push, pull_request]
100
+ jobs:
101
+ lint-genome:
102
+ runs-on: ubuntu-latest
103
+ steps:
104
+ - uses: actions/checkout@v4
105
+ - uses: actions/setup-python@v5
106
+ with: { python-version: "3.x" }
107
+ - run: python tools/aigx-lint/aigx_lint.py --root .
108
+ ```
109
+
110
+ **GitLab CI:**
111
+
112
+ ```yaml
113
+ aigx-lint:
114
+ image: python:3.12-slim
115
+ script:
116
+ - python tools/aigx-lint/aigx_lint.py --root .
117
+ rules:
118
+ - if: '$CI_PIPELINE_SOURCE == "push"'
119
+ ```
120
+
121
+ **Bitbucket Pipelines:**
122
+
123
+ ```yaml
124
+ pipelines:
125
+ default:
126
+ - step:
127
+ name: Lint AIGX genome
128
+ image: python:3.12-slim
129
+ script:
130
+ - python tools/aigx-lint/aigx_lint.py --root .
131
+ ```
132
+
133
+ **Pre-commit hook** (catches issues before they reach CI):
134
+
135
+ ```bash
136
+ # Install once: copy to .git/hooks/pre-commit and make it executable
137
+ #!/usr/bin/env bash
138
+ set -e
139
+ python tools/aigx-lint/aigx_lint.py --root .
140
+ ```
141
+
142
+ ```bash
143
+ chmod +x .git/hooks/pre-commit
144
+ ```
145
+
146
+ Or use [`pre-commit`](https://pre-commit.com) framework with a local hook:
147
+
148
+ ```yaml
149
+ # .pre-commit-config.yaml
150
+ repos:
151
+ - repo: local
152
+ hooks:
153
+ - id: aigx-lint
154
+ name: Lint AIGX genome
155
+ entry: python tools/aigx-lint/aigx_lint.py --root .
156
+ language: python
157
+ pass_filenames: false
158
+ always_run: true
159
+ ```
160
+
161
+ That's the whole answer to "decoupled docs rot": don't decouple *and walk away* - decouple *and lint*.
aigx-1.2.0/README.md ADDED
@@ -0,0 +1,449 @@
1
+ <div align="center">
2
+
3
+ <img src="assets/logo.svg" alt="AIGX - AI Genome Exchange" width="640" />
4
+
5
+ # AIGX - AI Genome Exchange
6
+
7
+ **The open, benchmark-validated context format for AI coding agents.**
8
+
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-22c55e.svg)](LICENSE)
10
+ [![Spec](https://img.shields.io/badge/spec-v1.1-3b82f6.svg)](SPEC.md)
11
+ [![Benchmark](https://img.shields.io/badge/benchmark-controlled%20·%202%20models%20·%20n%3D60-f59e0b.svg)](BENCHMARK.md)
12
+ [![Status](https://img.shields.io/badge/status-stable-22c55e.svg)](#status--roadmap)
13
+ [![PRs welcome](https://img.shields.io/badge/PRs-welcome-8b5cf6.svg)](CONTRIBUTING.md)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ **AIGX (AI Genome Exchange) is an open context format that stores a codebase's AI-agent rules in a
20
+ centralized `.aigx/` directory with a per-file *boundary index*, while injecting nothing into your source
21
+ code.** To our knowledge it is **the only context format ever validated in a controlled benchmark** - and
22
+ in that benchmark it was the **only format that ranked first on *both* a weaker and a stronger model**
23
+ (Claude Haiku 4.5 *and* Sonnet 4.6, n=60), while surviving **~24 deliberate attempts to beat it.**
24
+
25
+ > **Straight about the statistics (up front, not in a footnote):** at n=60 the *top* formats are a
26
+ > **statistical tie** on the composite mean - AIGX is not a blowout over good alternatives. Its real,
27
+ > defensible edge is being the **most consistent across models, the most robust under challenge, the
28
+ > simplest to author, and the only option that was measured at all.** A reproducible tie-at-the-top you can
29
+ > write in an afternoon and that holds across model tiers beats a fragile, format-specific spike.
30
+ > [Full scope, limitations & responses to critique →](docs/limitations.md)
31
+
32
+ > **The one-liner:** A *genome* is the context that builds and operates an organism. **AIGX is the genome
33
+ > of your codebase** - a portable, standard description of your rules, boundaries, and conventions that
34
+ > *any* AI agent can read to inherit how your project works. Hand an agent your genome and it behaves
35
+ > like a senior engineer who already knows the code.
36
+
37
+ <sub>Spec v1.1 (CC-BY-4.0) · Tools MIT · Tool-agnostic · Last updated 2026-06-20</sub>
38
+
39
+ ---
40
+
41
+ ## Why AIGX exists
42
+
43
+ AI coding agents are only as good as the context you give them - and today that context is a mess:
44
+
45
+ - **It's a wall of prose.** `CLAUDE.md` / `AGENTS.md` files grow into thousand-line documents. Agents
46
+ read *selectively*, grepping at the edit site - so the one rule that mattered for *this* file is buried
47
+ three scrolls away and never read.
48
+ - **It's not targeted.** "Don't do deep imports" is a global rule. But *which* files have a forbidden
49
+ import, and *what* is the sanctioned path instead? Flat rule docs can't say.
50
+ - **It pollutes your code.** The other way to localize context - inline `// @ai: never import X` comments
51
+ - clutters every diff and, we measured, actually *hurts* a strong model by adding parse-noise.
52
+ - **Nobody knows if any of it works.** Every existing format is justified by assertion ("use X for Y"),
53
+ never by evidence that it changes what the model produces.
54
+
55
+ AIGX fixes all four - and we **measured** that it does.
56
+
57
+ ---
58
+
59
+ ## The proof (lead with it, because nobody else has it)
60
+
61
+ We built a controlled benchmark: one real TypeScript codebase with planted traps (deep-import
62
+ violations, dependency cycles, cross-tenant data leaks, cache-ordering bugs, AI hallucination, 10
63
+ hard-correctness pitfalls), held **constant**, with **only the context format varying** and **semantic
64
+ parity machine-enforced** (every format carries the identical rules). The subject is an autonomous agent
65
+ that greps, edits, and runs tests. Scoring is deterministic and tamper-proof.
66
+
67
+ **Result - authoritative, powered to n=60:**
68
+
69
+ | Format | Sonnet 4.6 mean | pass@1 | hidden | Haiku 4.5 mean | pass@1 | hidden |
70
+ |---|:---:|:---:|:---:|:---:|:---:|:---:|
71
+ | **🧬 AIGX** | **95.4** | **0.92** | **98.6%** | **93.5** | **0.78** | **96.0%** |
72
+ | Markdown | 95.1 | 0.80 | 96.4% | 92.2 | 0.70 | 93.6% |
73
+ | XML | 93.1 | 0.80 | 93.8% | 92.3 | 0.75 | 93.3% |
74
+ | In-source headers | 94.6 | 0.80 | 96.1% | 92.4 | 0.67 | 90.2% |
75
+
76
+ AIGX ranks nominally first on mean, pass@1, *and* hidden-test pass on both models - **but the honest
77
+ story is consistency, not margin.** Look down the columns: Markdown is excellent on Sonnet (95.1) yet
78
+ near-last on Haiku (92.2); XML is the rough reverse. **AIGX is the only format that is first on *both*
79
+ tiers** - the one you can trust not to fall over when you change models. And it survived a deliberate
80
+ campaign to dethrone it: **~24 challenger variants across 6 research rounds** (in-source guards, positional
81
+ tricks, salience tiers, prose re-renderings, and combinations) - **every one failed.**
82
+
83
+ 🔬 **Full method, models, sample sizes, raw data, and the challenger log:** **[BENCHMARK.md](BENCHMARK.md)**.
84
+
85
+ > **The statistics, stated plainly:** at n=60 the *top* formats are a **statistical tie** on the composite
86
+ > mean - this is *not* a blowout, and we don't pretend otherwise. AIGX's defensible wins are **cross-model
87
+ > consistency** (first on both tiers), **robustness** (beat every challenger), **simplicity**, and being
88
+ > **the only format measured at all**. n=30 rankings are noise; AIGX is the one that still holds at n=60.
89
+ > [Full honesty: scope, limitations & responses to every critique →](docs/limitations.md)
90
+
91
+ ---
92
+
93
+ ## How AIGX compares
94
+
95
+ | | **AIGX** | AGENTS.md / CLAUDE.md | Cursor `.mdc` rules | `llms.txt` |
96
+ |---|:---:|:---:|:---:|:---:|
97
+ | Scope | **codebase rules** | codebase rules | codebase rules | docs index |
98
+ | Per-file boundary targeting | ✅ **explicit index** | path globs (coarse) | glob-scoped | ❌ |
99
+ | Forbidden-import / gotcha per file | ✅ | ⚠️ prose only | ⚠️ | ❌ |
100
+ | Zero source-code injection | ✅ | ✅ | ✅ | ✅ |
101
+ | Tool-agnostic (not one vendor) | ✅ | ⚠️ varies | ❌ Cursor-only | ✅ |
102
+ | **Empirically benchmark-validated** | ✅ **yes** | ❌ | ❌ | ❌ |
103
+
104
+ AIGX isn't out to replace `AGENTS.md` - those are great and widely supported. AIGX is the **genome
105
+ layer**: a richer, *measured*, per-file-precise substrate you author once and can export down to a flat
106
+ `AGENTS.md`/`CLAUDE.md` when a tool needs it. Adopt the substrate, not the vendor.
107
+
108
+ ---
109
+
110
+ ## Quick start — one command
111
+
112
+ ```bash
113
+ npx create-aigx
114
+ ```
115
+
116
+ That's it. Run it in your project root and you get:
117
+
118
+ ```text
119
+ your-repo/
120
+ ├── .aigx/
121
+ │ ├── protocol.aigx ← the read protocol every agent loads first
122
+ │ ├── product.aigx ← product context + freshness clause
123
+ │ ├── architecture.aigx ← per-concern rules (ARCH-* ids)
124
+ │ ├── engineering.aigx ← hard-correctness invariants (ENG-* ids)
125
+ │ ├── files.aigx ← ★ the per-file boundary index — fill this in
126
+ │ └── agent.aigx ← self-maintenance rules for agents
127
+
128
+ ├── .cursor/rules/aigx.mdc ← Cursor picks this up automatically
129
+ ├── CLAUDE.md ← aigx section appended (or created)
130
+ ├── .github/
131
+ │ ├── copilot-instructions.md ← GitHub Copilot
132
+ │ └── workflows/aigx-validate.yml ← CI: validates genome on every push
133
+ └── .windsurfrules ← Windsurf
134
+ ```
135
+
136
+ Every agent integration is wired up. No configuration needed. Your source code is untouched.
137
+
138
+ **Then fill in three things:**
139
+
140
+ 1. **`.aigx/files.aigx`** — one `<file>` entry per source file your agent will touch:
141
+ ```xml
142
+ <file path="src/features/meetings/bookMeeting.ts" domain="meetings">
143
+ <role>Book a meeting (validate slot + contact)</role>
144
+ <forbid pri="CRIT">NEVER import @/features/suppliers/internal/*</forbid>
145
+ <gotcha>get contact_email from the suppliers PUBLIC api, never the internal mapper</gotcha>
146
+ <check>ARCH-no-deep-imports DATA-integer-cents TEST-failing-first</check>
147
+ </file>
148
+ ```
149
+
150
+ 2. **`.aigx/architecture.aigx`** — replace the TODO stubs with your real rules.
151
+
152
+ 3. **`.aigx/product.aigx`** — product name, quality standard, which old docs are stale.
153
+
154
+ **Then validate** — with the `aigx` CLI (zero-dependency). Install from whichever registry you live in —
155
+ `npm i -g @aigx/cli` (or `npx @aigx/cli`), `pip install aigx`, or `cargo install aigx`:
156
+
157
+ ```bash
158
+ aigx lint # required files, resolving checks, no stale paths
159
+ aigx resolve src/features/meetings/bookMeeting.ts # show one file's boundary
160
+ aigx check-conformance # report your genome's conformance level
161
+ ```
162
+
163
+ A complete real-world genome is in **[`examples/sourcing-app/`](examples/sourcing-app/)**, the one-screen
164
+ overview is **[`docs/aigx-in-60-seconds.md`](docs/aigx-in-60-seconds.md)**, and the authoring guide walks
165
+ you through it step by step: **[`docs/authoring-guide.md`](docs/authoring-guide.md)**.
166
+
167
+ ---
168
+
169
+ ## How it works
170
+
171
+ ```mermaid
172
+ flowchart TD
173
+ A["Agent gets a task<br/>e.g. 'add a field to bookMeeting'"] --> B["Reads .aigx/protocol.aigx<br/>(the read order)"]
174
+ B --> C["Reads the concern files<br/>the task touches<br/>(data.aigx, architecture.aigx…)"]
175
+ B --> D["For EACH file it will edit,<br/>looks up its entry in<br/>.aigx/files.aigx"]
176
+ D --> E["Gets the binding constraint<br/>at the edit site:<br/>forbid · gotcha · check-ids"]
177
+ C --> F["Implements the change"]
178
+ E --> F
179
+ F --> G["Verifies every &lt;check&gt; id<br/>before declaring done"]
180
+
181
+ style A fill:#1e293b,stroke:#475569,color:#e2e8f0
182
+ style D fill:#7c2d12,stroke:#ea580c,color:#fed7aa
183
+ style E fill:#7c2d12,stroke:#ea580c,color:#fed7aa
184
+ style G fill:#14532d,stroke:#22c55e,color:#bbf7d0
185
+ ```
186
+
187
+ The magic is **per-file addressability**. Agentic models read selectively - they grep, open the file
188
+ they're editing, and rarely re-scan the whole rule doc. AIGX makes the binding constraint for *that file*
189
+ retrievable in one lookup (in `files.aigx`), instead of buried in a wall of prose - *and* keeps it out of
190
+ your source code. We tested all three placements (global prose, inline-in-source, and the addressed
191
+ index); **the addressed index won, inlining lost.** It's not about document position or repetition - it's
192
+ about targeting the rule to the file. (See [the principles](docs/principles.md#l2--per-file-addressability-beats-both-global-prose-and-in-source-inlining).)
193
+
194
+ ---
195
+
196
+ ## The genome metaphor (and why it's more than a metaphor)
197
+
198
+ | Biology | AIGX |
199
+ |---|---|
200
+ | **Genome** - the code that builds & runs an organism | `.aigx/` - the context that runs an agent in your codebase |
201
+ | **Genes** with stable names | `<rule id="ARCH-2">` - rules with stable, citable ids |
202
+ | **Gene expression per tissue** - which genes are active where | `files.aigx` - which rules/forbids/gotchas are "expressed" at each file |
203
+ | **Regulatory context per cell type** | `<domain>.aigx` cards - per-feature context |
204
+ | **Exchange / sequencing** - a portable, readable record | a portable format any agent reads to inherit your conventions |
205
+
206
+ A genome doesn't live *inside* every cell's job description - it's a central library the cell consults.
207
+ AIGX is the same: the rules live in `.aigx/`, your code stays clean, and the per-file index is the
208
+ expression map that says *which rules apply right here.*
209
+
210
+ ---
211
+
212
+ ## Anatomy of a genome
213
+
214
+ A complete genome (see the [full worked example](examples/sourcing-app/)) has four parts:
215
+
216
+ **1. The read protocol** - `protocol.aigx`. One screen. Tells the agent: read the index entry for each
217
+ file you edit, obey its forbid, verify its checks, schema-first/test-first/minimal-blast.
218
+
219
+ **2. Per-concern rule files** - `architecture.aigx`, `data.aigx`, `auth.aigx`, … Each is the full rule
220
+ text as `<rule id="…">` tags. Ids are namespaced (`ARCH-*`, `DATA-*`, `ENG-*`) and are the cross-reference
221
+ backbone.
222
+
223
+ **3. The per-file boundary index** - `files.aigx`. **The keystone.** One entry per file an agent might
224
+ edit: its `role`, its `forbid` (only for real import boundaries - keep these *rare*), its single most
225
+ important `gotcha`, and the `check` rule-ids to verify. This is what no other format has.
226
+
227
+ **4. Per-domain cards** - `<domain>.aigx` colocated with each feature folder: purpose, public API, test
228
+ policy, blast radius, and rule-tagged facts.
229
+
230
+ 📖 The normative format definition is in **[SPEC.md](SPEC.md)**.
231
+
232
+ ---
233
+
234
+ ## Why it works - the design principles
235
+
236
+ Seven findings, each backed by the benchmark ([deep dive](docs/principles.md)):
237
+
238
+ 1. **Short, scarce, direct wins.** Lengthening, diluting, or re-framing a signal *reduces* compliance.
239
+ 2. **Locality beats position.** *Where in the codebase* a rule lives (at the edit site) matters; *where in
240
+ the document* it lives does not.
241
+ 3. **Simpler wins.** Every embellishment we added washed out or hurt. Complexity bears the burden of proof.
242
+ 4. **`n=30` rankings are noise.** Four times a "winner" with a perfect headline metric collapsed at n=60.
243
+ 5. **Winning levers don't stack.** Combining two good ideas produced *less* than either alone.
244
+ 6. **Format effects are model-dependent and don't shrink with capability.** A better model does *not* make
245
+ context format less important - the effect *grew* from Haiku to Sonnet.
246
+ 7. **The residual is model capability, not format.** Past a point, you can't fix hard tasks with better docs.
247
+
248
+ ---
249
+
250
+ ## Tool support
251
+
252
+ `npx create-aigx` wires up all integrations automatically. Or copy individual files from
253
+ [`integrations/`](integrations/) if you prefer to add just one tool:
254
+
255
+ | Agent / tool | What `create-aigx` creates | Manual path |
256
+ |---|---|---|
257
+ | **Cursor** | `.cursor/rules/aigx.mdc` (alwaysApply) | [integrations/cursor/](integrations/cursor/) |
258
+ | **Claude Code** | `CLAUDE.md` aigx section | [integrations/claude-code/](integrations/claude-code/) |
259
+ | **GitHub Copilot** | `.github/copilot-instructions.md` | [integrations/copilot/](integrations/copilot/) |
260
+ | **Windsurf** | `.windsurfrules` | [integrations/windsurf/](integrations/windsurf/) |
261
+ | **Aider** | — | [integrations/aider/](integrations/aider/) |
262
+ | **GitHub Actions CI** | `.github/workflows/aigx-validate.yml` | [integrations/github-actions/](integrations/github-actions/) |
263
+ | **Any LLM / custom agent** | — | Paste the addendum from [SPEC.md §4](SPEC.md#4-the-agent-addendum-agent-addendum) |
264
+
265
+ > **Also ships:** **[`aigx-lint`](tools/aigx-lint/)** — validates the genome in CI (can't silently rot)
266
+ > and resolves any file's boundary in O(1) (scales to monorepos).
267
+ > **[`aigx-sync`](tools/aigx-sync/)** — git pre-commit hook that auto-patches `files.aigx` when files
268
+ > are renamed, so drift is physically impossible at the commit boundary.
269
+
270
+ > For MCP clients and codebase-memory-style agents, use
271
+ > `python tools/aigx-lint/aigx_lint.py --resolve <path> --root . --format json` to inject the binding
272
+ > AIGX boundary before graph/search context. See [JIT Context Hydration](docs/jit-hydration.md).
273
+
274
+ ---
275
+
276
+ ## FAQ
277
+
278
+ **What is AIGX in one sentence?**
279
+ AIGX (AI Genome Exchange) is an open, MIT-licensed context format that stores a codebase's AI-agent rules
280
+ in a centralized `.aigx/` directory with a per-file boundary index, and is the only such format validated
281
+ to win a controlled benchmark.
282
+
283
+ **How is AIGX different from AGENTS.md or CLAUDE.md?**
284
+ Those are (usually) a single flat prose file. AIGX adds a **per-file boundary index** - for each source
285
+ file, the exact rules, forbidden imports, and gotchas that apply *there* - so an agent gets the binding
286
+ constraint at the edit site instead of scrolling a long doc. AIGX is also tool-agnostic and exports down
287
+ to those formats. Think of AIGX as the richer substrate; `AGENTS.md` as one possible output of it.
288
+
289
+ **Does it work with Cursor, Claude Code, Copilot, Aider?**
290
+ Yes. It's plain text; you point any agent at `.aigx/` with one instruction line. See [Tool support](#tool-support).
291
+
292
+ **Does AIGX put comments in my source code?**
293
+ No - and that's deliberate. We measured that in-source headers/comments *hurt* a strong model. The genome
294
+ lives entirely in `.aigx/`; your code and your diffs stay clean.
295
+
296
+ **What exactly does the benchmark prove?**
297
+ That with the rules held identical and only the *format* changing, AIGX produced the most correct and most
298
+ disciplined agent output - #1 on mean, pass@1, and hidden-test pass on both Claude Haiku 4.5 and Sonnet
299
+ 4.6 at n=60 - and that this held up when we tried hard to beat it. [Full methodology →](BENCHMARK.md)
300
+
301
+ **Is it really better, or are the top formats close?**
302
+ Honestly: at matched power the top formats are a tight cluster. AIGX's edge is **robustness, cross-model
303
+ generalization, and simplicity** - it wins on every metric on both models and is the design that survived
304
+ every challenger. That's a more useful result than a fragile blowout.
305
+
306
+ **Why "genome"?**
307
+ A genome is the context that builds and operates an organism - central, portable, and consulted rather
308
+ than copied into every cell. AIGX is that for your codebase: the central, portable description of how your
309
+ project works that any agent reads to inherit your conventions.
310
+
311
+ **Can I use it commercially / change it / build tools on it?**
312
+ Yes - it's MIT. Use it, fork it, build products on it, no permission needed.
313
+
314
+ ---
315
+
316
+ ## Repository layout
317
+
318
+ ```text
319
+ aigx/
320
+ ├── .aigx/ ← this repo's own genome (AIGX uses AIGX)
321
+ ├── README.md ← you are here
322
+ ├── SPEC.md ← informal, example-led specification (points to standard/)
323
+ ├── standard/ ← the NORMATIVE standard (cite this)
324
+ │ ├── AIGX-1.1.md ← normative spec, RFC 2119, 20 sections
325
+ │ ├── AIGX-1.1.abnf ← formal grammar (RFC 5234)
326
+ │ ├── AIGX-1.1.schema.json ← canonical JSON data model
327
+ │ ├── media-type-registration.md ← IANA application/aigx
328
+ │ └── security · conformance · interoperability · change-control
329
+ ├── BENCHMARK.md ← full method, results, raw data, challenger log
330
+ ├── CHANGELOG.md ← version history
331
+ ├── CONTRIBUTING.md ← how to contribute
332
+ ├── CITATION.cff ← citation metadata
333
+ ├── LICENSE ← MIT (tools) · standard/LICENSE ← CC-BY-4.0 (spec)
334
+ ├── llms.txt ← machine-readable index for AI answer engines
335
+ ├── pyproject.toml ← PyPI packaging: pip install aigx (Python reference validator)
336
+ ├── bin/
337
+ │ └── create-aigx.mjs ← npx create-aigx — scaffolds genome + all integrations
338
+ ├── packages/ ← npm workspace
339
+ │ ├── aigx/ ← the `aigx` CLI (init/lint/resolve/doctor/format/conformance)
340
+ │ ├── parser/ ← @aigx/parser — reference zero-dep parser
341
+ │ └── lint/ ← @aigx/lint — programmatic validator
342
+ ├── docs/
343
+ │ ├── concept.md ← the genome philosophy
344
+ │ ├── authoring-guide.md
345
+ │ ├── migration.md ← adopting AIGX alongside existing AGENTS.md / CLAUDE.md
346
+ │ ├── principles.md ← the 7 benchmark-backed design laws
347
+ │ ├── limitations.md ← scope, honest caveats, point-by-point critique responses
348
+ │ ├── jit-hydration.md ← JIT context hydration pattern (MCP, CI, editor)
349
+ │ ├── glossary.md
350
+ │ ├── roadmap.md
351
+ │ ├── aigx-in-60-seconds.md ← the one-screen overview
352
+ │ └── faq.md
353
+ ├── examples/
354
+ │ ├── sourcing-app/ ← complete real-world genome (conformance fixture, Level 2)
355
+ │ └── minimal/ ← smallest valid genome (3 files, 1 rule, 1 entry)
356
+ ├── integrations/ ← plug-and-play config for every AI coding agent
357
+ │ ├── cursor/ ← .cursor/rules/aigx.mdc
358
+ │ ├── claude-code/ ← CLAUDE.md aigx section
359
+ │ ├── copilot/ ← .github/copilot-instructions.md
360
+ │ ├── windsurf/ ← .windsurfrules
361
+ │ ├── aider/ ← .aider.conf.yml
362
+ │ ├── github-actions/ ← CI workflow
363
+ │ └── vscode/ ← extensions.json
364
+ ├── templates/
365
+ │ └── starter/.aigx/ ← copy-paste starter genome
366
+ ├── template/ ← npm package source (read by create-aigx)
367
+ │ ├── aigx/ ← .aigx/ files
368
+ │ └── integrations/ ← integration templates
369
+ ├── editors/ ← .aigx highlighting everywhere (one canonical grammar)
370
+ │ ├── vscode/ ← "AIGX Language Support" extension (full features)
371
+ │ ├── textmate/ ← canonical grammar + .tmbundle
372
+ │ ├── sublime/ ← native .sublime-syntax
373
+ │ ├── zed/ ← Zed extension (+ tree-sitter-aigx/ grammar)
374
+ │ └── linguist/ ← GitHub Linguist registration kit
375
+ ├── crates/
376
+ │ └── aigx/ ← Cargo: cargo install aigx — Rust reference validator (std-only)
377
+ ├── tests/
378
+ │ └── conformance/ ← cross-validator conformance suite (run.py + fixtures)
379
+ └── tools/
380
+ ├── aigx-lint/ ← zero-dep Python validator + per-file resolver (CI-ready)
381
+ ├── aigx-mcp/ ← stdio MCP bridge exposing aigx_resolve
382
+ ├── aigx-export/ ← safe .aigx / Markdown serializer (corruption guards)
383
+ └── aigx-sync/ ← git pre-commit hook: auto-patches files.aigx on renames
384
+ ```
385
+
386
+ ---
387
+
388
+ ## Editor support
389
+
390
+ Open any `.aigx` file in VS Code with **[AIGX Language Support](editors/vscode/)** for syntax highlighting,
391
+ file icons, snippets, autocomplete, **hover on rule ids**, **go-to-definition**, inline **diagnostics** (the
392
+ same checks as `aigx-lint`), formatting, and **AIGX: Resolve current file's boundary**.
393
+
394
+ Highlighting comes from one canonical [TextMate grammar](editors/textmate/) (`source.aigx`). And `.aigx`
395
+ **highlights on GitHub today** (via [`.gitattributes`](.gitattributes)) — with ready-made configs for
396
+ **Sublime Text**, **TextMate**, and **Zed**, plus a **GitHub Linguist** PR kit, all in
397
+ [`editors/`](editors/) (see the [ecosystem index](editors/README.md)).
398
+
399
+ ---
400
+
401
+ ## Status & roadmap
402
+
403
+ - ✅ **Spec v1.1** — stable; **normative standard** with ABNF, JSON schema & IANA media type ([standard/](standard/))
404
+ - ✅ **Benchmark** — n=60 on two models, reproducible, honest [scope & limitations](docs/limitations.md)
405
+ - ✅ **`aigx` CLI** — init / lint / resolve / doctor / format / check-conformance. Zero-dep. ([packages/aigx](packages/aigx/))
406
+ - ✅ **`@aigx/parser` + `@aigx/lint`** — programmatic parsing & validation ([packages/](packages/))
407
+ - ✅ **`pip install aigx` + `cargo install aigx`** — Python and Rust reference validators (three implementations, one spec)
408
+ - ✅ **Conformance suite** — Python · Node · Rust validators agree fixture-for-fixture ([tests/conformance/](tests/conformance/))
409
+ - ✅ **`npx create-aigx`** — interactive: pick your agent(s), then scaffold genome + integrations + CI
410
+ - ✅ **`aigx-lint`** — validate genome in CI + O(1) per-file resolve. Zero-dep. ([tools/aigx-lint](tools/aigx-lint/))
411
+ - ✅ **`aigx-sync`** — git hook auto-patches `files.aigx` on renames ([tools/aigx-sync](tools/aigx-sync/))
412
+ - ✅ **`aigx-mcp`** — stdio MCP bridge exposing `aigx_resolve` for JIT context hydration ([tools/aigx-mcp](tools/aigx-mcp/))
413
+ - ✅ **`aigx-export`** — safe `.aigx` / Markdown serializer with corruption guards, atomic write, and SHA-256 readback ([tools/aigx-export](tools/aigx-export/))
414
+ - ✅ **Integrations** — ready-to-use configs for 7 tools ([integrations/](integrations/))
415
+ - ✅ **Meta-genome** — this repo uses AIGX to describe itself (`.aigx/`)
416
+ - ✅ **VS Code extension** — highlighting · icons · snippets · diagnostics · hover · go-to-definition · format ([editors/vscode](editors/vscode/))
417
+ - ✅ **TextMate grammar** — one canonical grammar reused across editors + Linguist ([editors/textmate](editors/textmate/))
418
+ - ✅ **Highlights on GitHub** — `.aigx` rendered today via `.gitattributes`; Linguist PR kit ready ([editors/linguist](editors/linguist/))
419
+ - ✅ **Sublime · TextMate · Zed** — ready-made editor configs ([editors/](editors/))
420
+ - 🔜 Language Server (LSP) — the same intelligence in any LSP-capable editor
421
+ - 🔜 Monorepo-scale benchmark (5k+ files) and more worked examples (Python, Go)
422
+
423
+ Want to help? [CONTRIBUTING.md](CONTRIBUTING.md) · [open an issue](https://github.com/Lolner95/AIGX/issues) · star the repo to follow along.
424
+
425
+ ---
426
+
427
+ ## Citation
428
+
429
+ If AIGX or its benchmark informs your work, please cite it (a "Cite this repository" button is on the repo
430
+ sidebar; details in [CITATION.cff](CITATION.cff)).
431
+
432
+ ```bibtex
433
+ @software{aigx2026,
434
+ title = {AIGX: AI Genome Exchange - A Benchmark-Validated Context Format for AI Coding Agents},
435
+ author = {Parisotto, Grégory},
436
+ year = {2026},
437
+ url = {https://github.com/Lolner95/AIGX},
438
+ license = {MIT}
439
+ }
440
+ ```
441
+
442
+ ---
443
+
444
+ ## License
445
+
446
+ [MIT](LICENSE) - use it, fork it, build on it, no permission needed. AIGX is meant to be a shared
447
+ standard, so it's licensed to be freely adopted by anyone, for anything.
448
+
449
+ <div align="center"><sub>Built from a research-grade benchmark. The genome of your codebase, for the age of AI agents. 🧬</sub></div>