Twelve Pages Cross-IDE Portability: AGENTS.md, SKILL.md & Shared MCP

Cross-IDE Portability: AGENTS.md, SKILL.md & Shared MCP

Write repo instructions, portable SKILL.md playbooks, and MCP server configs once so every developer on your team gets identical agent behavior across Cursor, Claude Code, Codex, Copilot, Windsurf, OpenCode, and Antigravity.

Updated 2026-11 v1.0 12 min read 12-Page Illustrated Edition How it’s made
Glowing central blueprint prism radiating emerald and sapphire pathways into seven synchronized modular developer workstations

Core Takeaways

One Canonical Repo Truth

Maintain a single root AGENTS.md and nested package overrides, backed by thin shims so zero rules are ever duplicated.

On-Demand SKILL.md Packs

Package repeatable workflows into AAIF-governed .agents/skills/ folders with YAML triggers, scripts, and references.

Secret-Free Shared MCP

Unify local stdio and remote Streamable HTTP MCP servers via env-var expansion, OAuth 2.1, and automated client sync.

1. Write Once, Run Identically Across Every AI Coding Harness

Modern engineering teams rarely standardize on a single AI IDE: backend engineers run Claude Code or Codex CLI in the terminal, frontend teams use Cursor or Windsurf/Devin, enterprise squads run GitHub Copilot, and open-source or Gemini-native builders use OpenCode and Antigravity. Under the Linux Foundation’s Agentic AI Foundation (AAIF), three open standards—AGENTS.md, SKILL.md, and MCP—now eliminate vendor lock-in.

Architecture: Single Repo Truth Fanning Out to 7 IDEs & Harnesses

SINGLE REPO TRUTH (GIT) 1. AGENTS.md Ambient rules, build cmds, invariants 2. .agents/skills/*/SKILL.md On-demand playbooks + scripts/refs 3. .mcp.json (Secret-Free) Live tools: stdio + Streamable HTTP PORTABILITY LAYER Symlinks & Shims CLAUDE.md → AGENTS.md .cursor/rules/*.mdc CI Schema & Drift Gate Zero Duplicated Prose Cursor AGENTS.md + .agents/skills + .cursor/mcp.json Claude Code CLAUDE.md shim + .agents/skills + .mcp.json GitHub Copilot AGENTS.md + .agents/skills + .mcp.json Codex CLI / Cloud AGENTS.md + .agents/skills + config.toml Windsurf / Devin AGENTS.md + .agents/skills + mcp_config.json OpenCode AGENTS.md + .agents/skills + opencode.json Antigravity AGENTS.md + .agents/skills + .mcp.json
1 Ambient Context

AGENTS.md is always loaded into session context. Keep it lean (500–2,000 tokens): repo map, build/test commands, non-negotiable invariants.

2 On-Demand Playbooks

SKILL.md (donated to AAIF Oct 2026) loads only YAML metadata at boot. Multi-step procedures, scripts, and references load only when matched.

3 Live Tool Connectivity

MCP connects agents to live databases, issue trackers, and docs. Commit a secret-free .mcp.json and inject tokens via env vars or OAuth 2.1.

Why the 3-Layer Split Matters in Late 2026
By late 2026, all three standards live under the Linux Foundation’s Agentic AI Foundation (AAIF), backed by OpenAI, Anthropic, Google, Microsoft, Block, and Cloudflare. Separating always-on rules (AGENTS.md) from lazy-loaded procedures (SKILL.md) and live APIs (MCP) cuts baseline prompt bloat by 60–80% while guaranteeing uniform behavior across every developer’s chosen IDE.

2. Exact File Paths, Precedence & Quirks Across 7 AI Harnesses

Every major coding agent now supports AGENTS.md and the open SKILL.md format, but each harness still has distinct precedence rules, scoped-rule syntax, and MCP config keys. Use this verified late-2026 reference matrix before designing your repo’s portability layer.

Tool / Harness Instructions & Precedence SKILL.md Discovery Paths MCP Config Path & Key Quirks
Claude Code
Thin Shim
1. CLAUDE.md (highest)
2. AGENTS.md (native in v2.1.277+ if no CLAUDE.md)
3. .claude/rules/*.md (paths:)
.claude/skills/
.agents/skills/
~/.claude/skills/ (global)
Root .mcp.json (key: mcpServers, supports ${VAR} & ${VAR:-default}). Also reads user ~/.claude.json.
Cursor
Native
1. .cursor/rules/*.mdc (glob/always)
2. AGENTS.md (root & nested)
Legacy .cursorrules deprecated
.agents/skills/
.cursor/skills/
.claude/skills/ (compat)
.cursor/mcp.json (key: mcpServers, url for remote HTTP). Symlink or sync directly from root .mcp.json.
GitHub Copilot
Native
1. .github/copilot-instructions.md
2. AGENTS.md (root & nested)
3. .github/instructions/*.instructions.md (applyTo:)
.agents/skills/
.github/skills/
.claude/skills/ (compat)
Root .mcp.json (mcpServers, Nov 2026 Copilot/VS Code) or .vscode/mcp.json (key: servers + ${input:...}).
Codex CLI & Cloud
Native
1. AGENTS.override.md (local)
2. AGENTS.md (root → nested dir chain, deepest wins)
.agents/skills/
.codex/skills/
~/.agents/skills/
.codex/config.toml (TOML [mcp_servers.<name>] tables). Generate from canonical .mcp.json via sync script.
Windsurf / Devin
Native
1. AGENTS.md (Devin Local & Windsurf)
2. .windsurf/rules/*.md
Legacy .windsurfrules deprecated
.agents/skills/
.windsurf/skills/
Devin CLI skill loader
~/.codeium/windsurf/mcp_config.json (mcpServers, uses serverUrl instead of url for remote HTTP).
OpenCode
Native
1. AGENTS.md (primary)
2. CLAUDE.md (automatic fallback if AGENTS.md absent)
.agents/skills/
.opencode/skills/
~/.config/opencode/skills/
Root opencode.json (key: mcp, uses type: "local" | "remote" and command: [...] array). Sync from .mcp.json.
Antigravity
Native
1. AGENTS.md (workspace)
2. .agents/rules/ (glob/always)
3. ~/.gemini/GEMINI.md (global)
.agents/skills/ (workspace)
~/.agent/skills/ (global)
Root .mcp.json / Antigravity MCP config (key: mcpServers, native stdio & Streamable HTTP + OAuth).
! The Universal Convergence Path

Notice the clear convergence across all seven harnesses in late 2026:

  • Instructions: AGENTS.md at root + nested package dirs.
  • Skills: .agents/skills/<skill-name>/SKILL.md is now read natively by all 7 tools (zero symlink needed for skills!).
  • MCP: Root .mcp.json with mcpServers is the de facto canonical source, with thin generated targets only for TOML/schema outliers (Codex, OpenCode, Windsurf).
? Precedence Gotchas to Watch
  • Claude Code shadow: If a stale CLAUDE.md exists alongside AGENTS.md, Claude Code prioritizes CLAUDE.md. Fix: replace CLAUDE.md with a 1-line @AGENTS.md import or symlink.
  • Copilot double-loading: If both .github/copilot-instructions.md and AGENTS.md contain full rules, Copilot injects both and wastes context.
  • Windsurf serverUrl: Copying a remote MCP block with "url" into Windsurf silently fails unless mapped to "serverUrl".
Rule of Thumb: Canonical Standards First, Adapter Shims Second
Never author business logic or coding standards inside tool-specific directories (.cursor/rules/, .windsurf/rules/, .github/copilot-instructions.md). Keep 100% of team knowledge in AGENTS.md, .agents/skills/, and .mcp.json, and treat tool-specific files strictly as thin pointers or CI-generated projections.

3. Inside a Multi-Agent-Ready Monorepo (7-Control HUD)

A portable repository looks boring on purpose. Every harness finds its expected entry point immediately, while human maintainers only ever edit three canonical locations. Explore the 7-pin layout below to see how symlinks and thin wrappers bridge all seven IDEs.

Swipe horizontally to view the full interactive workspace mockup

acme-platform/ — Multi-Agent Monorepo Layout
AAIF Compliant 7 IDEs Synced Zero Secrets
acme-platform/
├── AGENTS.md 1 # Root source (<1.5k tok)
├── CLAUDE.md 2 # 1-line @AGENTS.md shim
├── .mcp.json 3 # Canonical MCP (env vars)
├── .agents/
│ └── skills/ 4
│ ├── db-migration/
│ │ ├── SKILL.md
│ │ ├── scripts/verify_sql.py
│ │ └── references/schema.md
│ └── release-notes/SKILL.md
├── .cursor/ 5
│ ├── mcp.json → ../.mcp.json
│ └── rules/ui-tokens.mdc # Glob only
├── .github/
│ ├── CODEOWNERS 6
│ └── workflows/agent-lint.yml
├── packages/
│ ├── api/AGENTS.md 7 # Go/SQL delta
│ └── web/AGENTS.md # React/a11y delta
└── scripts/sync-mcp-clients.mjs
SYMLINK VS. THIN-SHIM MATRIX
• Windows-safe? Use 1-line text shims (@AGENTS.md) instead of OS symlinks if any contributor develops on Windows without Developer Mode.
• macOS / Linux? Git symlinks (ln -s AGENTS.md CLAUDE.md) work cleanly across CI and containers.
GENERATED CLIENT PROJECTIONS (.gitignore or CI)
.mcp.json → .cursor/mcp.json (symlink)
.mcp.json → .codex/config.toml (script)
.mcp.json → opencode.json (script)
.mcp.json → mcp_config.json (url→serverUrl)
NEVER COMMIT THESE FILES
• AGENTS.override.md & CLAUDE.local.md
• .env, .mcp.local.json, OAuth token caches
• Unpinned third-party skill binaries

Control-by-Control Breakdown (Pins 1–7)

1 Root AGENTS.md: Canonical architecture map, exact test/lint commands, branch naming, and repo-wide invariants. Read natively by all 7 harnesses.

2 Thin CLAUDE.md Shim: Contains only @AGENTS.md (Claude Code native file import). Guarantees older/enterprise Claude Code builds never miss root rules.

3 Canonical .mcp.json: Declares shared team MCP servers with ${ENV_VAR} placeholders and remote Streamable HTTP URLs. Zero plaintext API keys.

4 .agents/skills/ Vault: AAIF-standard directory auto-discovered by Claude Code, Cursor, Copilot, Codex, Windsurf/Devin, OpenCode, and Antigravity.

5 Glob-Only IDE Extensions: Keep .cursor/rules/*.mdc or .claude/rules/*.md strictly for file-pattern-triggered micro-rules that cannot be expressed by directory nesting.

6 CODEOWNERS & CI Gate: Route edits to AGENTS.md, .agents/skills/, and .mcp.json through Staff/Security review and run automated token + schema linters.

7 Nested Package AGENTS.md: Sub-directory deltas (e.g., packages/api/AGENTS.md) load only when an agent edits files inside that package, keeping root context small.

4. Hierarchical AGENTS.md & Thin-Shim Patterns

Think of README.md as onboarding for humans and AGENTS.md as an executable contract for machines. In a monorepo, stuffing every framework quirk into the root file degrades agent accuracy. Instead, pair a lean root contract with directory-scoped child AGENTS.md files.

Isometric hierarchical architecture showing a glowing slate-blue root foundation branching via emerald and sapphire conduits into modular glass package nodes
Hierarchical Inheritance: Root AGENTS.md defines universal invariants; child files in packages/api/ or apps/web/ add local commands and overrides only when the agent enters that subtree.
A The 6 Mandatory Root Sections
  1. Repo Map (5–8 lines): Top-level directories and what owns what.
  2. Exact Commands: Copy-pasteable install, typecheck, test, and lint commands (prefer single-file test flags).
  3. Architecture Invariants: Hard boundaries (e.g., “Never import db/ from ui/”).
  4. Code & Style Rules: Only rules your linter cannot enforce automatically.
  5. PR & Verification Gate: Exact checks the agent must pass before finishing.
  6. Pointer Index: Links to .agents/skills/ and deep docs (never inline them).
B Nested Monorepo Overrides

When an agent opens packages/payments/ledger.ts, harnesses walk upward from the file to the repo root, merging context with nearest-file precedence:

Prompt / Snippet
# packages/payments/AGENTS.md (Delta Only)
## Local Commands
- Test single file: `pnpm --filter payments test <file>`
## Non-Negotiable Rules
- Use integer cents (`bigint`); NEVER use JS `number` floats.
- All ledger mutations require an idempotency key header.

Result: Frontend engineers editing apps/web/ never pay the token cost of payments rules.

Thin-Shim Blueprint (Zero Duplication Across Legacy & Enterprise Clients)

Claude Code (CLAUDE.md)
Prompt / Snippet
@AGENTS.md
# Claude-specific hooks only:
# Run `/compact` after 40 turns.
Copilot (.github/copilot-instructions.md)
Prompt / Snippet
Read and strictly follow the root
`AGENTS.md` and nearest nested
`AGENTS.md` for all repo rules.
Cursor (.cursor/rules/sql.mdc)
Prompt / Snippet
---
globs: ["**/*.sql"]
---
Follow `packages/db/AGENTS.md`.
Executable Specs Beat Wishlists
Replace vague prose (“Write clean, well-tested TypeScript”) with deterministic commands (“Run pnpm vitest run path/to/test.ts and pnpm tsc --noEmit; zero warnings allowed”). Agents verify concrete commands 3–4× more reliably than stylistic adjectives.

5. The SKILL.md Progressive-Disclosure Formula

Donated to the Linux Foundation’s AAIF in October 2026 and supported by 70+ platforms (Claude Code, Codex, Cursor, Copilot, Windsurf/Devin, OpenCode, Antigravity), Agent Skills solve context bloat via 3-tier progressive disclosure: agents see only a 2-line YAML summary at boot, loading full instructions and helper scripts only when a task matches.

Color-Coded 5-Part SKILL.md Anatomy

---
name: safe-db-migration
description: Generate and verify zero-downtime Postgres migrations. Use whenever creating, altering, or rolling back SQL schema files in packages/db/migrations/.
---
# Workflow: Zero-Downtime Migration
1. Inspect `packages/db/schema.sql` and draft an expand-and-contract migration file.
2. Generate both `up.sql` and reversible `down.sql` with timestamp prefix.
3. Execute `python3 scripts/check_locks.py <migration.sql>` to verify zero table-locking DDL.
4. Consult `references/postgres-lock-matrix.md` before adding NOT NULL or concurrent indexes.
## Guardrails: NEVER run `DROP COLUMN` in the same PR as app code removal. Stop and ask for human approval if estimated lock time > 200ms.
1. YAML Trigger

Only name (lowercase kebab-case) and description are universally portable. Write trigger-rich descriptions naming exact file paths and intents.

2. Workflow Steps

Numbered, imperative steps (<300 lines). Each step produces a verifiable artifact or state transition before moving to the next.

3. scripts/

Deterministic Python/Bash/Node validators bundled inside the skill folder. Offload brittle regex/schema checks from the LLM to code.

4. references/

Deep domain docs, API schemas, or checklists kept in sibling markdown files. Loaded only when the agent reaches that step—never bloating the core prompt.

5. Guardrails & Stop Conditions

Explicit “NEVER” rules and human-in-the-loop escalation triggers. Prevents autonomous agents from executing destructive commands.

3-Tier Progressive Disclosure & Portability Rules

Loading Tier What Loads Into Context Token Cost Cross-IDE Portability Note
Tier 1: Boot YAML name + description ~30–60 tok / skill Always visible in system prompt. Keep description under 250 chars for clean matching.
Tier 2: Trigger Full SKILL.md body ~400–1,800 tok Triggered by intent match or explicit /skill-name. Avoid tool-only frontmatter like context: fork unless optional.
Tier 3: Execution scripts/, references/, assets/ 0 tok until read/run Use relative paths from the skill folder. Scripts must use standard runtimes (python3, node, bash).
Portability Trap: Tool-Specific Frontmatter Extensions
Claude Code supports optional fields like allowed-tools, model, and context: fork, while Codex CLI ignores unknown keys and does not load legacy plugin commands. Stick to name and description for core behavior, and treat vendor extensions strictly as progressive enhancements.

6. Shared MCP Configs, Streamable HTTP & Secret Hygiene

The Model Context Protocol (MCP) gives every IDE identical live access to GitHub, Postgres, Linear, Sentry, and internal docs. The #1 cross-IDE friction point in 2026 is not MCP itself—it is divergent client config schemas and hardcoded API tokens accidentally pushed to git.

Canonical Secret-Free .mcp.json

Prompt / Snippet
{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${GITHUB_MCP_TOKEN}"
      }
    },
    "postgres-ro": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres@0.6.2"],
      "env": {
        "POSTGRES_URL": "${DEV_PG_READONLY_URL}"
      }
    },
    "context-docs": {
      "type": "http",
      "url": "https://mcp.internal.acme.dev/v1"
    }
  }
}

Local stdio vs. Remote Streamable HTTP

Dimension Local stdio Streamable HTTP
Auth Model Local env vars / CLI creds OAuth 2.1 / SSO + Bearer
Onboarding Needs Node/Python/Docker Zero local install (URL only)
Audit & RBAC Per-laptop; hard to revoke Central gateway & logs
Best For Local DBs, filesystem, git Jira, GitHub, Sentry, prod docs
2026 Shift: Remote Streamable HTTP + OAuth 2.1
Prefer hosted Streamable HTTP MCP servers over local stdio wrappers for SaaS tools. Developers authenticate via browser OAuth 2.1—meaning zero static API tokens ever touch laptops or config files.

Bridging Client Schema Differences Without Manual Duplication

Client Config File Root Key Schema Delta & Sync Strategy
Claude Code / Antigravity .mcp.json mcpServers Canonical source! Native ${VAR} and ${VAR:-fallback} expansion.
Cursor .cursor/mcp.json mcpServers Symlink directly to ../.mcp.json (identical JSON schema).
VS Code / Copilot .mcp.json or .vscode/mcp.json mcpServers / servers Late-2026 Copilot reads root .mcp.json; use .vscode/mcp.json only if you need interactive ${input:token} prompts.
Codex CLI .codex/config.toml [mcp_servers.*] Run pnpm mcp:sync to emit TOML from .mcp.json (auto-checked in CI).
Windsurf / OpenCode mcp_config.json / opencode.json mcpServers / mcp Sync script maps url → serverUrl (Windsurf) and type: "remote" (OpenCode).
! 4 Rules of MCP Secret Hygiene
  • Zero hardcoded keys: Commit .env.example with blank vars; load real values via direnv, 1Password CLI, or OAuth 2.1.
  • Pin versions: Always pin npx -y pkg@x.y.z or Docker digests to block supply-chain hijacks.
  • Read-only by default: Bind dev MCP DB credentials to a read-only Postgres role.
  • Pre-commit secret scan: Run gitleaks on .mcp.json and all generated client configs.
i Watch the Tool-Count Ceiling

Connecting 10+ MCP servers can inject 150–300 tool schemas into every turn, degrading tool selection accuracy and hitting client caps (e.g., VS Code’s 128-tool limit).

Fix: Cap workspace .mcp.json at 3–5 high-signal servers (or use an MCP gateway/router that filters toolsets per role).

7. Stopping Instruction Drift & Context Bloat With CI Linters

Instruction files decay faster than code. Every time an engineer patches a bug by appending “NEVER do X” to CLAUDE.md without updating AGENTS.md, or dumps a 4,000-token style guide into the root prompt, agent compliance drops sharply. Treat agent instructions like production code: budget them, lint them, and prune them in CI.

Precision optical calibration prism and metallic architectural gate refining tangled ribbons into three parallel glowing emerald, sapphire, and coral streams
Continuous Calibration: Automated CI gates filter ad-hoc developer notes into lean AGENTS.md contracts, modular SKILL.md playbooks, and schema-verified MCP configs.

Context Token Budgets (Empirical Sweet Spots)

Artifact Target Budget CI Hard Cap Overflow Action (When Cap Is Hit)
Root AGENTS.md 500–1,500 tok 2,000 tok (~150 lines) Move step-by-step workflows to .agents/skills/; move pkg rules to nested AGENTS.md.
Nested AGENTS.md 150–500 tok 800 tok (~60 lines) Delete rules already enforced by ESLint/Ruff/Go vet; link to docs/.
SKILL.md Frontmatter 25–50 tok 75 tok (≤250 chars) Tighten description to crisp trigger verbs + exact target paths.
SKILL.md Body 400–1,200 tok 2,500 tok (~300 lines) Extract reference tables into references/ and validators into scripts/.
× Top 4 Drift Anti-Patterns
  • Copy-Paste Syncing: Duplicating prose across AGENTS.md, CLAUDE.md, and .cursor/rules/ guarantees divergence within 2 weeks.
  • Linter Duplication: Listing Prettier/ESLint formatting rules in Markdown wastes tokens and triggers contradictions.
  • Stale Commands: Leaving old npm run test:old commands causes every agent to burn 3+ turns failing before guessing.
  • Tombstone Accumulation: Never deleting rules for deprecated frameworks creates contradictory instructions.
✓ 5 Automated CI Lint Checks
  1. Token Cap Check: Fail PR if root AGENTS.md exceeds 2,000 tokens or 150 lines.
  2. Shim Integrity: Assert CLAUDE.md is either a symlink or ≤5 lines containing @AGENTS.md.
  3. SKILL.md Schema: Validate YAML frontmatter (name matches folder, description present, no unreferenced scripts).
  4. Dead Path Check: Verify every backticked path/script mentioned in AGENTS.md exists in git.
  5. MCP Sync & Secret Check: Assert generated configs match .mcp.json and contain zero raw tokens.

8. 5 Copy-Paste Portability Recipes Ready for Production

Drop these five battle-tested templates directly into any repository to achieve immediate cross-IDE parity across Cursor, Claude Code, Codex, Copilot, Windsurf/Devin, OpenCode, and Antigravity.

# Recipe File Path Problem Solved
1Lean Root ContractAGENTS.mdGives all 7 harnesses identical build, test, and boundary rules.
2Zero-Drift Claude ShimCLAUDE.mdPrevents Claude Code from shadowing or missing AGENTS.md.
3Portable PR Review Skill.agents/skills/pr-review/SKILL.mdOn-demand security & diff review playbook with deterministic script.
4Client MCP Sync Scriptscripts/sync-mcp.mjsGenerates Codex TOML & Windsurf serverUrl from .mcp.json.
5GitHub Actions Lint Gate.github/workflows/agent-lint.ymlBlocks bloated rules, broken YAML, or unpinned MCP servers in PRs.
Recipe 1: Lean Root AGENTS.md
Prompt / Snippet
# AGENTS.md — Acme Platform
## Repo Map
- `apps/web/`: Next.js 16 frontend (pnpm)
- `packages/api/`: Go 1.24 REST/gRPC services
- `packages/db/`: SQL migrations (see local AGENTS.md)

## Verification Commands (Run Before Finishing)
- Typecheck: `pnpm -r typecheck`
- Fast unit test: `pnpm --filter <pkg> test <file>`
- Go check: `cd packages/api && go test ./...`

## Hard Invariants
- Never commit secrets or edit `.env*` files.
- Never bypass ESLint/golangci-lint with ignore comments.
- Use `.agents/skills/` for migrations & release notes.
Recipe 2: Thin CLAUDE.md Shim
Prompt / Snippet
@AGENTS.md

<!-- Keep all shared rules in AGENTS.md.
     Only Claude-specific local hooks belong below. -->
Recipe 3: Portable SKILL.md
Prompt / Snippet
---
name: pr-readiness-check
description: Audit staged diffs for security leaks, missing tests, and breaking API changes before opening a PR.
---
# PR Readiness Check
1. Run `git diff --staged --stat` to list touched packages.
2. Execute `python3 scripts/scan_diff.py` for secret/TODO checks.
3. Verify each modified module has a passing targeted test.
4. Summarize risks in 3 bullets; NEVER auto-push to `main`.
Recipe 4: scripts/sync-mcp.mjs (Excerpt)
Prompt / Snippet
import fs from "node:fs";
const cfg = JSON.parse(fs.readFileSync(".mcp.json", "utf8"));
// 1. Emit Codex .codex/config.toml
const toml = Object.entries(cfg.mcpServers).map(([k, v]) => {
  const lines = [`[mcp_servers.${k}]`];
  if (v.url) lines.push(`url = "${v.url}"`);
  if (v.command) lines.push(`command = "${v.command}"`);
  if (v.args) lines.push(`args = ${JSON.stringify(v.args)}`);
  return lines.join("\n");
}).join("\n\n");
fs.mkdirSync(".codex", { recursive: true });
fs.writeFileSync(".codex/config.toml", toml + "\n");
Recipe 5: .github/workflows/agent-lint.yml
Prompt / Snippet
name: Agent Portability Lint
on: [pull_request]
jobs:
  lint-agent-config:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Enforce AGENTS.md line cap (<=150)
        run: test "$(wc -l < AGENTS.md)" -le 150
      - name: Verify CLAUDE.md thin shim
        run: grep -q "@AGENTS.md" CLAUDE.md && test "$(wc -l < CLAUDE.md)" -le 8
      - name: Validate SKILL.md YAML frontmatter
        run: |
          python3 -c '
          import glob, yaml
          for f in glob.glob(".agents/skills/*/SKILL.md"):
            fm = yaml.safe_load(open(f).read().split("---")[1])
            assert fm.get("name") and len(fm.get("description","")) <= 250, f
          '
      - name: Check MCP sync & no raw secrets
        run: |
          node scripts/sync-mcp.mjs && git diff --exit-code .codex/config.toml
          ! grep -E "(sk-|ghp_|xoxb-)" .mcp.json

9. Securing AGENTS.md, Third-Party Skills & MCP Tools

Because every AI coding agent treats AGENTS.md and SKILL.md as trusted system instructions—and executes bundled scripts/ with developer privileges—agent configs are now a Tier-1 supply-chain attack surface. A single poisoned community skill can exfiltrate ~/.ssh or .env secrets across all seven IDEs simultaneously.

1 Indirect Prompt Injection

Hidden Unicode (zero-width chars), HTML comments, or obfuscated base64 strings inside third-party SKILL.md or references/ files can instruct agents to curl secrets to attacker domains.

2 Rug-Pull Skill Scripts

Installing unpinned skills via git pull or floating npx -y pkg@latest lets a compromised upstream maintainer inject malicious shell payloads overnight.

3 Over-Privileged MCP

Granting write/admin tokens to MCP servers (or combining untrusted web-fetch MCP with local shell execution) creates a lethal “confused deputy” exfiltration path.

Mandatory Team Governance Controls

Control Layer Implementation Standard Verification Mechanism
CODEOWNERS Review Require Staff Engineer + AppSec approval on AGENTS.md, .agents/skills/**, and .mcp.json. GitHub Branch Protection “Require review from Code Owners” enforced on main.
Vendor & Pin Skills Copy audited third-party skills into your repo’s .agents/skills/ (or internal private registry) pinned to a commit SHA. CI rejects dynamic runtime skill fetchers and logs SHA provenance in SKILL_LOCK.json.
Static Injection Scan Reject invisible Unicode (U+200B..U+200F, bidi overrides), base64 blobs, and unapproved egress domains in Markdown/scripts. Pre-commit & CI regex/AST scanner across all *.md and .agents/skills/*/scripts/*.
Least-Privilege Tools Scope MCP credentials to read-only or staging; restrict destructive shell commands via harness allowlists/sandboxes. Quarterly token audit + OAuth 2.1 short-lived tokens via central MCP gateway.
.github/CODEOWNERS Rule Block
Prompt / Snippet
# Agent instructions & executable skills require dual review
/AGENTS.md                  @org/platform-eng @org/appsec
/**/AGENTS.md               @org/platform-eng
/CLAUDE.md                  @org/platform-eng
/.mcp.json                  @org/platform-eng @org/appsec
/.agents/skills/            @org/platform-eng @org/appsec
/.cursor/rules/             @org/platform-eng
✓ 5-Minute Third-Party Skill Audit
  1. Read every line of SKILL.md and references/ in raw text (inspect for HTML comments or hidden Unicode).
  2. Inspect all files in scripts/ for network calls (curl, fetch, requests) and env access (os.environ).
  3. Check whether the skill requests disabling safety hooks or auto-approving shell commands.
  4. Test the skill inside a disposable sandbox container with dummy credentials before merging.
Security Golden Rule: Treat SKILL.md as Executable Code
Never merge a community skill PR the way you merge documentation. A malicious instruction in Markdown can hijack an autonomous agent just as effectively as a malicious line of Python.

10. One Git Commit → CI Gate → Identical Behavior in 7 IDEs

When AGENTS.md, .agents/skills/, and .mcp.json flow through a single Git + CI pipeline, onboarding a new engineer or rolling out a new architectural rule takes one pull request—and instantly upgrades every local IDE and cloud coding agent simultaneously.

1. AUTHOR ONCE Single Git PR Edit Canonical Files AGENTS.md / SKILL.md CODEOWNERS Gate Platform + AppSec review 2. CI VALIDATION Automated Lint Budget & Schema ≤2k tok, valid YAML, paths Security & Sync Zero secrets, TOML parity 3. GIT PULL / CLONE Zero-Touch Sync Local Dev IDEs Auto-loads on next session Cloud Agents Copilot, Codex, Devin, Jules 4. IDENTICAL OUTPUT 7-IDE Parity • Cursor & Windsurf • Claude Code • GitHub Copilot • Codex CLI / Cloud • OpenCode & Antigravity Same tests, style & tools

4-Week Team Migration Playbook (From Fragmented Rules to AAIF Parity)

W1 Audit & Consolidate

Inventory every .cursorrules, CLAUDE.md, .windsurfrules, and wiki doc. Distill only verified commands and invariants into a root AGENTS.md under 1,500 tokens. Replace old files with thin shims.

W2 Extract Top 3 Workflows to Skills

Move verbose procedures (DB migrations, PR review, service scaffolding) out of AGENTS.md into .agents/skills/*/SKILL.md with deterministic Python/Node validation scripts.

W3 Unify MCP & Kill Plaintext Keys

Create canonical .mcp.json with Streamable HTTP + OAuth 2.1 for SaaS tools and ${VAR} for local stdio servers. Wire up scripts/sync-mcp.mjs and symlink .cursor/mcp.json.

W4 Enforce CI Gates & Run Parity Eval

Enable agent-lint.yml and CODEOWNERS. Run one identical benchmark ticket across two different team IDEs (e.g., Cursor + Claude Code) and verify both run the exact same test command and pass CI.

Bonus Win: Cloud Coding Agents Get Upgraded for Free
Autonomous background agents—GitHub Copilot Coding Agent, OpenAI Codex Cloud, Devin, and Google Jules—all clone your repository and read root/nested AGENTS.md plus .agents/skills/ automatically. Local portability directly doubles your cloud-agent PR acceptance rate.

11. Troubleshooting Clinic (Top 7 Fixes) & Pre-Flight Check

When an agent ignores a rule, misses a skill, or fails to boot an MCP server, the cause is almost always one of these seven deterministic configuration bugs.

# Symptom Root Cause Exact Fix
1 Claude Code ignores AGENTS.md Older build (<v2.1.277), disabled plugin, or stale CLAUDE.md shadowing it. Keep a 1-line CLAUDE.md containing @AGENTS.md and verify Project instructions in /config.
2 SKILL.md never auto-triggers Vague description in YAML frontmatter or folder name mismatch. Match folder name to YAML name; add explicit trigger verbs & target paths in description.
3 Windows dev sees broken symlink Git symlinks checked out as plain text files without Windows Developer Mode. Replace symlinks with 1-line text shims (@AGENTS.md) or run scripts/sync-mcp.mjs via postinstall.
4 Windsurf remote MCP silently fails Config uses "url" instead of Windsurf’s "serverUrl" key. Map url → serverUrl in your MCP sync script when emitting Windsurf’s mcp_config.json.
5 Agent hallucinates old commands Root AGENTS.md exceeds 2,500 tokens or retains outdated scripts. Prune root AGENTS.md under 1,500 tokens and add a CI dead-command check.
6 MCP tool calls degrade or hit cap 10+ servers enabled globally, injecting 150+ schemas (hits VS Code 128 cap). Trim workspace .mcp.json to 3–5 core servers or route through a scoped MCP gateway.
7 Agent violates nested package rule Rule lives only in root .cursor/rules/ instead of package AGENTS.md. Move package-specific invariants to packages/<pkg>/AGENTS.md so all 7 harnesses inherit them.

6-Point Cross-IDE Pre-Flight Checklist

✓
1. Lean Canonical AGENTS.md: Under 1,500 tokens at repo root, with exact single-file test/lint commands and nested package deltas.
✓
2. Zero-Duplication Shims: CLAUDE.md imports @AGENTS.md; legacy .cursorrules and .windsurfrules deleted.
✓
3. AAIF .agents/skills/ Layout: Repeatable workflows packaged with crisp YAML triggers, scripts/, and references/.
✓
4. Secret-Free .mcp.json: Pinned package versions, Streamable HTTP + OAuth 2.1 where available, ${ENV_VAR} placeholders only.
✓
5. CI Lint & CODEOWNERS Active: Token caps, YAML validation, MCP client sync, and secret scanning block broken PRs automatically.
✓
6. Two-IDE Smoke Test Passed: Same feature prompt verified in at least two distinct harnesses (e.g., Cursor + Claude Code or Codex).
Final Takeaway: Invest in Portable Repo Architecture, Not IDE Lock-In
Models and editors will keep leapfrogging every quarter. Teams that encode their engineering judgment in AAIF open standards—AGENTS.md, SKILL.md, and secret-free MCP—can adopt tomorrow’s best coding harness in five minutes without rewriting a single rule.

Save the 12-Page Magazine PDF

Keep a print-ready copy of Cross-IDE Portability: AGENTS.md, SKILL.md & Shared MCP for offline reading, desk reference, or sharing with teammates (981 KB).