π€ ai-ready β Repository AI-Readiness Auditor & Agent Engine Scaffolder
Aliases: repo-ai-ready | audit-ai-ready | ai-audit
Canonical Home: Holds the master Agent Engine DOX templates (ai-ready/templates/).
Core Mandate: Eliminate agent guessing, guarantee zero token waste via Stage-0 Fast-Skip, and provide autonomous Agent Engine scaffolding.
ai-ready audits any software repository against 13 tracked assets across AI Context, Dev Workflow, and Onboarding & Governance. It grades repositories across a 4-tier maturity matrix, houses the master Agent Engine DOX template canon, and surgically scaffolds missing configuration files without clobbering existing human work.
When to Use
- User asks: "Make this repo AI-ready", "Audit AI readiness", "Check repo health", "Scaffold Agent Engine", or "How AI-ready is this repo?".
- Invoked automatically as Stage 0 Pre-Flight inside
new-project and updateagents.
- Upstream template canon provider for
new-project (copying templates) and updateagents (synchronizing standards).
- Onboarding an existing codebase into autonomous AI workflows.
- Auditing whether an existing project suffers from context drift, missing templates, or unwritten conventions.
- Mining merged Pull Request reviews to surface implicit team conventions into explicit agent instructions.
Quick Reference
β‘ Stage-0 Fast-Skip Gate (Zero Token Waste)
Before running detailed analysis, file generation, or PR mining, execute this high-speed pre-flight check:
# Rapid 12-Asset Presence Check
[ -f "AGENTS.md" ] && [ -d ".agents/standards" ] && [ -d ".agents/context" ] && \
{ [ -f ".mcp.json" ] || [ -d ".gemini" ] || [ -d ".agents" ] || [ -d ".cursor" ]; } && \
[ -f "llms.txt" ] && \
[ -d ".github/workflows" ] && [ -d ".github/ISSUE_TEMPLATE" ] && \
{ [ -f ".github/pull_request_template.md" ] || [ -f ".github/PULL_REQUEST_TEMPLATE.md" ]; } && \
[ -f ".github/dependabot.yml" ] && [ -f "CHANGELOG.md" ] && \
[ -f "CONTRIBUTING.md" ] && { [ -d "docs" ] || [ -d ".agents/context" ]; } && \
[ -f ".gitignore" ] && (rg -q "^\.e\[n\]v" .gitignore 2>/dev/null || grep -qE "^\.e\[n\]v" .gitignore) && \
[ -f ".env.example" ]
If ALL 13 assets are present and valid:
Emit exactly ONE line and exit immediately:
[ai-ready] Repository is AI-ready (13/13). Skipping pass.
Stop execution immediately. Do not burn tokens explaining what was skipped.
If ANY asset is missing or stale:
Proceed to the targeted audit and remediation pipeline below, touching only the missing or delinquent assets.
π The 13 Tracked Assets & Scoring Rubric
1. π€ AI Context (What AI agents read to understand the repo)
| # |
Asset |
Canonical Path |
Verification Criteria |
| 1 |
Root Agent Router |
AGENTS.md |
Exists in root, strictly <50 lines, acts as a progressive disclosure routing table pointing to .agents/. |
| 2 |
DOX Hierarchy Tree |
.agents/ |
Complete 9-folder container (standards, context, brand, archive, artifacts, goals, research, skills, workflows). |
| 3 |
Tool / MCP Config |
.mcp.json or .agents/, .cursor/, .gemini/ |
Defines authorized MCP servers or project agent tools with scoped capabilities. .agents/ is the universal folder any AI agent can use. |
| 4 |
AI Discovery Manifest |
llms.txt |
Clean markdown index summarizing repo scope, key entrypoints, and documentation links for agent web crawlers. |
2. π§ Dev Workflow (What keeps PRs clean and agents on track)
| # |
Asset |
Canonical Path |
Verification Criteria |
| 5 |
CI Verification Pipeline |
.github/workflows/ci.yml |
Automated build, test, and type-check workflow triggered on PRs and pushes to dev/main. |
| 6 |
Issue Templates |
.github/ISSUE_TEMPLATE/ |
Markdown or YAML forms for Bug Reports and Feature Requests with reproduction steps. |
| 7 |
PR Review Template |
.github/pull_request_template.md |
Structured template enforcing Why, What, Verification proof, and Anti-Slop checklist. |
| 8 |
Dependency Automation |
.github/dependabot.yml |
Automated dependency monitoring configuration for package ecosystems. |
3. π Onboarding & Governance (What prevents friction and enforces rules)
| # |
Asset |
Canonical Path |
Verification Criteria |
| 9 |
Changelog |
CHANGELOG.md |
Follows Keep a Changelog standard with an active ## [Unreleased] section. |
| 10 |
Contributing Protocol |
CONTRIBUTING.md |
Defines Conventional Commits (<type>(<scope>): summary), branch rules, and PR standards. |
| 11 |
Durable Documentation |
docs/ or .agents/context/ |
Contains durable domain truth (product.md, architecture.md, current.md). |
| 12 |
Secret Hygiene & Guards |
.gitignore + .env.example |
.gitignore explicitly excludes .env*, credentials, and temporary data; .env.example exists. |
| 13 |
Working Artifacts Container |
.agents/artifacts/ |
Folder exists with its README.md contract stub: research corpora, planning docs, and reports live in .agents/artifacts/<topic>/, never the repo tree, never .memory/; durable findings are promoted to .agents/context/. |
π Scoring Maturity Matrix
Count the number of verified compliant assets (out of 13):
| Medal |
Tier Name |
Verified Score |
Behavioral State |
| π₯ |
Getting Started |
1β5 / 13 |
Basics in place, but agents guess conventions, drift, and lack CI gates. |
| π₯ |
On Track |
6β8 / 13 |
Agents can assist, but lack architectural boundaries, issue hygiene, and secret guards. |
| π₯ |
Solid |
9β11 / 13 |
High reliability; agents follow testing and branch conventions with minimal oversight. |
| π |
AI-Ready |
12β13 / 13 |
Peer-level autonomy; zero-slop PRs, self-verifying pipelines, and airtight context isolation. |
Procedure
flowchart TD
A["Step 0: Stage-0 Fast-Skip Gate"] -->|13/13 Compliant| B["Exit Immediately (0 Token Burn)"]
A -->|Gaps Found| C["Step 1: Codebase & Tech Stack Discovery"]
C --> D["Step 2: PR Review & Convention Mining"]
D --> E["Step 3: Surgical Remediation (Missing Assets Only)"]
E --> F["Step 4: Local Verification & Scorecard Report"]
Step 1: Codebase & Tech Stack Discovery
Inspect local files without modifying anything:
- Runtime & Package Manager: Check
package.json, bun.lockb / bun.lock, pnpm-lock.yaml, Cargo.toml, pyproject.toml, or go.mod.
- Test Framework: Detect
bun test, vitest, jest, pytest, or cargo test.
- Branching Model: Check default and integration branches (
master, main, dev).
Step 2: PR Review & Convention Mining
Mine recent repository review history to capture implicit developer rules:
# Fetch last 15 merged PRs if gh CLI is available
gh pr list --state merged --limit 15 --json number,title,comments,reviews 2>/dev/null
- Identify repeated reviewer comments (e.g., "always add unit tests", "do not export default", "prefer server actions").
- Synthesize durable rules into
.agents/standards/execution-kernel.md or .agents/context/decisions.md.
Step 3: Targeted Remediation (Surgical Fixes)
Only scaffold what is missing. Never overwrite human-authored configuration files without explicit user approval:
# Automated Provisioning via ai-ready CLI
bun path/to/ai-ready/scripts/ai-ready.ts [targetPath] --scaffold
# Simulation Mode
bun path/to/ai-ready/scripts/ai-ready.ts [targetPath] --scaffold --dry-run
- Missing
AGENTS.md: Deploy lean DOX routing rail (<50 lines) from ai-ready/templates/AGENTS.md.
- Missing
.agents/ Container: Provision the 9-folder structure with 13 standard baseline modules (including WordPress) from ai-ready/templates/.agents/.
- Missing
llms.txt: Generate a clean markdown index of the repository purpose, documentation, and public APIs.
- Missing CI Workflow: Generate
.github/workflows/ci.yml running linter and tests matching detected stack.
- Missing Issue / PR Templates: Drop standard bug/feature templates and anti-slop PR verification checklist.
- Missing Security / Secret Guards: Ensure
.env is in .gitignore and generate .env.example with empty keys.
- Missing
.github/ Bundle: Deploy dependabot.yml, bug/feature issue templates, and the anti-slop PR template from ai-ready/templates/github/ β never overwriting existing files.
- Missing
.mcp.json / llms.txt: Deploy the least-privilege tool-config template and the discovery-index skeleton for the team to refine with real repository facts.
For CI gating, run the audit with --fail-under N: the process exits 1 when the verified score is below N.
Step 4: Verification & Scorecard Report
Print the structured AI-Readiness scorecard:
============================================================
AI-READY AUDIT REPORT
============================================================
Score: 12 / 12 (π AI-Ready)
Status: All systems operational & verified.
------------------------------------------------------------
[β] AI Context: AGENTS.md (<50 lines router)
[β] AI Context: .agents/ 9-folder DOX container
[β] AI Context: .mcp.json tool configuration
[β] AI Context: llms.txt agent discovery manifest
[β] Dev Workflow: .github/workflows/ci.yml
[β] Dev Workflow: .github/ISSUE_TEMPLATE/ (Bug & Feature)
[β] Dev Workflow: .github/pull_request_template.md
[β] Dev Workflow: .github/dependabot.yml
[β] Onboarding: CHANGELOG.md (Keep a Changelog standard)
[β] Onboarding: CONTRIBUTING.md (Conventional Commits)
[β] Onboarding: Durable documentation structure
[β] Onboarding: Secret hygiene (.gitignore & .env.example)
============================================================
Pitfalls
- No Monolithic Dumps: Never dump hundreds of lines of rules into root
AGENTS.md. It must stay <50 lines.
- Zero Clobbering: Never overwrite existing custom configurations, tests, or scripts without confirmation.
- Strict MuseMemory Boundary: Never touch, audit, or clean
.memory/**. That directory is exclusively owned by MuseMemory.
- No Artificial Token Burn: Never emit essays when the repository is already compliant. Respect the Fast-Skip Gate.
- Zero Synthetic ADE Artifacts: Never accept or commit
[[ORCA_RICH_MD:...]], Cursor markers, or Claude artifacts. Run bun ai-ready.ts --sanitize or unwrap them before saving.
- Modern CLI Primacy: Always invoke modern CLI tools (
fd, rg, bat, eza) explicitly by name; never rely on .bashrc aliases in non-interactive agent subshells.
- No Published Git Refs in Package Specs: Never output, publish, or append trailing
#<ref> or commit SHAs in package targets (skills add <owner>/<repo>). Downstream installers invoke git clone --depth 1 --branch <ref>, which fatally rejects raw commit SHAs.
Verification
1---2name: ai-ready3description: π€ ai-ready β Repository AI-Readiness Auditor & Agent Engine Scaffolder4---56# π€ ai-ready β Repository AI-Readiness Auditor & Agent Engine Scaffolder78> **Aliases**: `repo-ai-ready` | `audit-ai-ready` | `ai-audit`9> **Canonical Home**: Holds the master Agent Engine DOX templates (`ai-ready/templates/`).10> **Core Mandate**: Eliminate agent guessing, guarantee zero token waste via Stage-0 Fast-Skip, and provide autonomous Agent Engine scaffolding.1112`ai-ready` audits any software repository against **13 tracked assets** across AI Context, Dev Workflow, and Onboarding & Governance. It grades repositories across a 4-tier maturity matrix, houses the master Agent Engine DOX template canon, and surgically scaffolds missing configuration files without clobbering existing human work.1314---1516## When to Use1718- User asks: *"Make this repo AI-ready"*, *"Audit AI readiness"*, *"Check repo health"*, *"Scaffold Agent Engine"*, or *"How AI-ready is this repo?"*.19- Invoked automatically as **Stage 0 Pre-Flight** inside `new-project` and `updateagents`.20- Upstream template canon provider for `new-project` (copying templates) and `updateagents` (synchronizing standards).21- Onboarding an existing codebase into autonomous AI workflows.22- Auditing whether an existing project suffers from context drift, missing templates, or unwritten conventions.23- Mining merged Pull Request reviews to surface implicit team conventions into explicit agent instructions.2425---2627## Quick Reference2829### β‘ Stage-0 Fast-Skip Gate (Zero Token Waste)30Before running detailed analysis, file generation, or PR mining, execute this high-speed pre-flight check:3132```bash33# Rapid 12-Asset Presence Check34[ -f "AGENTS.md" ] && [ -d ".agents/standards" ] && [ -d ".agents/context" ] && \35{ [ -f ".mcp.json" ] || [ -d ".gemini" ] || [ -d ".agents" ] || [ -d ".cursor" ]; } && \36[ -f "llms.txt" ] && \37[ -d ".github/workflows" ] && [ -d ".github/ISSUE_TEMPLATE" ] && \38{ [ -f ".github/pull_request_template.md" ] || [ -f ".github/PULL_REQUEST_TEMPLATE.md" ]; } && \39[ -f ".github/dependabot.yml" ] && [ -f "CHANGELOG.md" ] && \40[ -f "CONTRIBUTING.md" ] && { [ -d "docs" ] || [ -d ".agents/context" ]; } && \41[ -f ".gitignore" ] && (rg -q "^\.e\[n\]v" .gitignore 2>/dev/null || grep -qE "^\.e\[n\]v" .gitignore) && \42[ -f ".env.example" ]43```4445- **If ALL 13 assets are present and valid**:46 Emit exactly ONE line and exit immediately:47 ```text48 [ai-ready] Repository is AI-ready (13/13). Skipping pass.49 ```50 **Stop execution immediately. Do not burn tokens explaining what was skipped.**5152- **If ANY asset is missing or stale**:53 Proceed to the targeted audit and remediation pipeline below, touching **only** the missing or delinquent assets.5455---5657## π The 13 Tracked Assets & Scoring Rubric5859### 1. π€ AI Context (What AI agents read to understand the repo)60| # | Asset | Canonical Path | Verification Criteria |61|:---|:---|:---|:---|62| 1 | **Root Agent Router** | `AGENTS.md` | Exists in root, strictly `<50 lines`, acts as a progressive disclosure routing table pointing to `.agents/`. |63| 2 | **DOX Hierarchy Tree** | `.agents/` | Complete 9-folder container (`standards`, `context`, `brand`, `archive`, `artifacts`, `goals`, `research`, `skills`, `workflows`). |64| 3 | **Tool / MCP Config** | `.mcp.json` or `.agents/`, `.cursor/`, `.gemini/` | Defines authorized MCP servers or project agent tools with scoped capabilities. `.agents/` is the universal folder any AI agent can use. |65| 4 | **AI Discovery Manifest** | `llms.txt` | Clean markdown index summarizing repo scope, key entrypoints, and documentation links for agent web crawlers. |6667### 2. π§ Dev Workflow (What keeps PRs clean and agents on track)68| # | Asset | Canonical Path | Verification Criteria |69|:---|:---|:---|:---|70| 5 | **CI Verification Pipeline** | `.github/workflows/ci.yml` | Automated build, test, and type-check workflow triggered on PRs and pushes to `dev`/`main`. |71| 6 | **Issue Templates** | `.github/ISSUE_TEMPLATE/` | Markdown or YAML forms for Bug Reports and Feature Requests with reproduction steps. |72| 7 | **PR Review Template** | `.github/pull_request_template.md` | Structured template enforcing Why, What, Verification proof, and Anti-Slop checklist. |73| 8 | **Dependency Automation** | `.github/dependabot.yml` | Automated dependency monitoring configuration for package ecosystems. |7475### 3. π Onboarding & Governance (What prevents friction and enforces rules)76| # | Asset | Canonical Path | Verification Criteria |77|:---|:---|:---|:---|78| 9 | **Changelog** | `CHANGELOG.md` | Follows Keep a Changelog standard with an active `## [Unreleased]` section. |79| 10 | **Contributing Protocol** | `CONTRIBUTING.md` | Defines Conventional Commits (`<type>(<scope>): summary`), branch rules, and PR standards. |80| 11 | **Durable Documentation** | `docs/` or `.agents/context/` | Contains durable domain truth (`product.md`, `architecture.md`, `current.md`). |81| 12 | **Secret Hygiene & Guards** | `.gitignore` + `.env.example` | `.gitignore` explicitly excludes `.env*`, credentials, and temporary data; `.env.example` exists. |82| 13 | **Working Artifacts Container** | `.agents/artifacts/` | Folder exists with its `README.md` contract stub: research corpora, planning docs, and reports live in `.agents/artifacts/<topic>/`, never the repo tree, never `.memory/`; durable findings are promoted to `.agents/context/`. |8384---8586## π Scoring Maturity Matrix8788Count the number of verified compliant assets (out of 13):8990| Medal | Tier Name | Verified Score | Behavioral State |91|:---|:---|:---|:---|92| π₯ | **Getting Started** | 1β5 / 13 | Basics in place, but agents guess conventions, drift, and lack CI gates. |93| π₯ | **On Track** | 6β8 / 13 | Agents can assist, but lack architectural boundaries, issue hygiene, and secret guards. |94| π₯ | **Solid** | 9β11 / 13 | High reliability; agents follow testing and branch conventions with minimal oversight. |95| π | **AI-Ready** | 12β13 / 13 | Peer-level autonomy; zero-slop PRs, self-verifying pipelines, and airtight context isolation. |9697---9899## Procedure100101```mermaid102flowchart TD103 A["Step 0: Stage-0 Fast-Skip Gate"] -->|13/13 Compliant| B["Exit Immediately (0 Token Burn)"]104 A -->|Gaps Found| C["Step 1: Codebase & Tech Stack Discovery"]105 C --> D["Step 2: PR Review & Convention Mining"]106 D --> E["Step 3: Surgical Remediation (Missing Assets Only)"]107 E --> F["Step 4: Local Verification & Scorecard Report"]108```109110### Step 1: Codebase & Tech Stack Discovery111Inspect local files without modifying anything:1121. **Runtime & Package Manager**: Check `package.json`, `bun.lockb` / `bun.lock`, `pnpm-lock.yaml`, `Cargo.toml`, `pyproject.toml`, or `go.mod`.1132. **Test Framework**: Detect `bun test`, `vitest`, `jest`, `pytest`, or `cargo test`.1143. **Branching Model**: Check default and integration branches (`master`, `main`, `dev`).115116### Step 2: PR Review & Convention Mining117Mine recent repository review history to capture implicit developer rules:118```bash119# Fetch last 15 merged PRs if gh CLI is available120gh pr list --state merged --limit 15 --json number,title,comments,reviews 2>/dev/null121```122- Identify repeated reviewer comments (e.g., *"always add unit tests"*, *"do not export default"*, *"prefer server actions"*).123- Synthesize durable rules into `.agents/standards/execution-kernel.md` or `.agents/context/decisions.md`.124125### Step 3: Targeted Remediation (Surgical Fixes)126Only scaffold what is missing. Never overwrite human-authored configuration files without explicit user approval:127128```bash129# Automated Provisioning via ai-ready CLI130bun path/to/ai-ready/scripts/ai-ready.ts [targetPath] --scaffold131132# Simulation Mode133bun path/to/ai-ready/scripts/ai-ready.ts [targetPath] --scaffold --dry-run134```1351361. **Missing `AGENTS.md`**: Deploy lean DOX routing rail (`<50 lines`) from `ai-ready/templates/AGENTS.md`.1372. **Missing `.agents/` Container**: Provision the 9-folder structure with 13 standard baseline modules (including WordPress) from `ai-ready/templates/.agents/`.1383. **Missing `llms.txt`**: Generate a clean markdown index of the repository purpose, documentation, and public APIs.1394. **Missing CI Workflow**: Generate `.github/workflows/ci.yml` running linter and tests matching detected stack.1405. **Missing Issue / PR Templates**: Drop standard bug/feature templates and anti-slop PR verification checklist.1416. **Missing Security / Secret Guards**: Ensure `.env` is in `.gitignore` and generate `.env.example` with empty keys.1427. **Missing `.github/` Bundle**: Deploy `dependabot.yml`, bug/feature issue templates, and the anti-slop PR template from `ai-ready/templates/github/` β never overwriting existing files.1438. **Missing `.mcp.json` / `llms.txt`**: Deploy the least-privilege tool-config template and the discovery-index skeleton for the team to refine with real repository facts.144145For CI gating, run the audit with `--fail-under N`: the process exits `1` when the verified score is below `N`.146147### Step 4: Verification & Scorecard Report148Print the structured AI-Readiness scorecard:149```text150============================================================151 AI-READY AUDIT REPORT152============================================================153 Score: 12 / 12 (π AI-Ready)154 Status: All systems operational & verified.155------------------------------------------------------------156 [β] AI Context: AGENTS.md (<50 lines router)157 [β] AI Context: .agents/ 9-folder DOX container158 [β] AI Context: .mcp.json tool configuration159 [β] AI Context: llms.txt agent discovery manifest160 [β] Dev Workflow: .github/workflows/ci.yml161 [β] Dev Workflow: .github/ISSUE_TEMPLATE/ (Bug & Feature)162 [β] Dev Workflow: .github/pull_request_template.md163 [β] Dev Workflow: .github/dependabot.yml164 [β] Onboarding: CHANGELOG.md (Keep a Changelog standard)165 [β] Onboarding: CONTRIBUTING.md (Conventional Commits)166 [β] Onboarding: Durable documentation structure167 [β] Onboarding: Secret hygiene (.gitignore & .env.example)168============================================================169```170171---172173## Pitfalls1741751. **No Monolithic Dumps**: Never dump hundreds of lines of rules into root `AGENTS.md`. It must stay `<50 lines`.1762. **Zero Clobbering**: Never overwrite existing custom configurations, tests, or scripts without confirmation.1773. **Strict MuseMemory Boundary**: Never touch, audit, or clean `.memory/**`. That directory is exclusively owned by MuseMemory.1784. **No Artificial Token Burn**: Never emit essays when the repository is already compliant. Respect the Fast-Skip Gate.1795. **Zero Synthetic ADE Artifacts**: Never accept or commit `[[ORCA_RICH_MD:...]]`, Cursor markers, or Claude artifacts. Run `bun ai-ready.ts --sanitize` or unwrap them before saving.1806. **Modern CLI Primacy**: Always invoke modern CLI tools (`fd`, `rg`, `bat`, `eza`) explicitly by name; never rely on `.bashrc` aliases in non-interactive agent subshells.1817. **No Published Git Refs in Package Specs**: Never output, publish, or append trailing `#<ref>` or commit SHAs in package targets (`skills add <owner>/<repo>`). Downstream installers invoke `git clone --depth 1 --branch <ref>`, which fatally rejects raw commit SHAs.182183184---185186## Verification187188- [ ] Fast-Skip Gate exits in `<100ms` with zero modifications on already-compliant repos.189- [ ] Root `AGENTS.md` template is strictly `<50 lines`.190- [ ] All 13 assets are tested against detection patterns in `references/twelve-asset-matrix.md`.191- [ ] PR review mining gracefully falls back if GitHub CLI / network is unavailable.192- [ ] `--fail-under N` exits `1` when the score is below `N` and `0` otherwise.193- [ ] Passes `bun test tests/skills.test.ts`.