v3.0

SurfContext Specification

Agent-Ready Documentation Standard (ARDS) v3.0

Overview

The Agent-Ready Documentation Standard (ARDS) defines a file structure and set of conventions that make software repositories fully navigable by AI coding agents across all major platforms. ARDS provides a canonical source of truth (.context/) from which platform-specific files (CLAUDE.md, AGENTS.md, .cursorrules) are generated, solving the fragmentation problem caused by incompatible AI tool formats.

Version 3.0 introduces nine new sections: living guides, session checkpoints, evidence epistemology, formalized discovery order, multi-agent coordination contracts, cross-repository references, IP safety protocols, MCP integration, and context budget management. All v3 additions are backward-compatible.

What ARDS Is

  • A file structure specification for AI-navigable repositories
  • A set of document type definitions (root context, agents, skills, docs, guides, plans, research)
  • A discovery protocol that agents follow to build context
  • A generation pipeline from canonical source to platform-specific output

What ARDS Is Not

  • Not a replacement for any single platform's format -- it generates them
  • Not a runtime protocol (that's MCP)
  • Not a build system or package manager
  • Not required to use any specific AI tool

Design Principles

1

Token budget awareness

Root context is loaded every agent turn. Everything else loads on demand. Structure files to minimize per-turn cost while maximizing agent effectiveness.

2

Tables over prose

AI agents parse structured data faster and more reliably than paragraphs. Use tables for any data with 2+ attributes.

3

Explicit paths over descriptions

Write src/lib/auth.ts, not "the auth file." Agents cannot infer locations from vague descriptions.

4

Single source of truth

Each fact lives in one file. Other files reference it, never duplicate it. This is the core principle that prevents context rot.

5

Temporal separation

Evergreen reference (.context/docs/) and time-stamped work (plans/) serve different purposes. Never mix them.

6

Self-containment per type

Each document should be useful when read in isolation.

7

Progressive disclosure

Summaries load first; details load on demand. Match depth to access pattern.

8

Canonical source, generated output

Edit .context/. Never edit .claude/ or .cursor/ directly. Generated files are disposable.

9

Backward compatibility

New spec versions must not break existing conforming projects. All additions are optional unless the version field is explicitly bumped.

File Hierarchy

A conforming SurfContext project MUST include a CONTEXT.md file at the project root. It SHOULD include a surfcontext.json manifest and a .context/ directory.

Required Structure

Minimum Structure
project-root/
  CONTEXT.md                          # Root context (required)
  surfcontext.json                    # Configuration (recommended)
  .context/
    agents/                           # Agent definitions (1 file per agent)
      agent-name.md
    docs/                             # Evergreen knowledge docs
      architecture.md
      conventions.md

Full Structure (All Optional Additions)

Full Structure
project-root/
  CONTEXT.md                          # Root context (canonical)
  surfcontext.json                    # ARDS configuration
  CLAUDE.md                           # Generated for Claude Code
  AGENTS.md                           # Generated for Codex CLI
  .context/
    agents/                           # Agent definitions
      agent-name.md
    skills/                           # Reusable expertise (directory per skill)
      skill-name/
        SKILL.md
    docs/                             # Evergreen knowledge docs
      architecture.md
    guides/                           # Living how-to documents
      deploying-to-aws.md
    queue.md                          # Multi-agent task queue
  plans/                              # Time-stamped deliverables
    [category]/
      YYYY-MM-DD-topic.md
    sessions/                         # Session checkpoints
      YYYY-MM-DD-checkpoint.md
  research/                           # Academic manuscripts
    [project-name]/
      manuscript/v[N]/

Naming Conventions

Element Convention Example
Agent files kebab-case.md devops-architect.md
Skill directories kebab-case/ patent-draft/
Knowledge docs kebab-case.md architecture.md
Guide files kebab-case.md deploying-to-aws.md
Plan docs YYYY-MM-DD-topic.md 2026-02-04-launch-plan.md
Checkpoint files YYYY-MM-DD-topic-checkpoint.md 2026-02-10-sprint-checkpoint.md
Research projects kebab-case/ remote-flow/

Root Context (CONTEXT.md)

CONTEXT.md is the single most important file in any ARDS-compliant repository. It is auto-loaded by Claude Code every turn (as CLAUDE.md), read first by Codex (as AGENTS.md), and serves as the primary orientation for any AI agent or human contributor.

Structure

CONTEXT.md
# Project Name

Brief description of what this project does.

## Key Files

| Path | Purpose |
|------|---------|
| `src/app/` | Next.js App Router pages |
| `.context/agents/` | Agent definitions |
| `.context/docs/` | Knowledge documents |
| `.context/guides/` | Living how-to guides |

## Architecture

Describe the high-level architecture: frameworks, data flow,
deployment targets, and key design decisions.

## Stack & Development

**Stack**: Next.js 15, React 19, AWS Amplify Gen 2, TypeScript
**Run locally**: `npm run dev`
**Run tests**: `npm test`

## Active Work

Current state: what's deployed, in progress, blocked, planned.

## Agents

| Agent | Scope |
|-------|-------|
| devops-architect | AWS architecture, deployment, CI/CD |
| code-reviewer | Code quality, security, best practices |

Requirements

  • MUST begin with an H1 heading containing the project name
  • MUST include a Key Files table mapping paths to purposes
  • SHOULD include an Architecture section with high-level system design
  • SHOULD include a Stack & Development section with build/run/test commands
  • SHOULD include an Active Work section with current state
  • SHOULD be under 200 lines (product repos) or 300 lines (command centers)
  • MAY include Agents, Commands, and Cross-Repo Dependencies sections
  • MUST NOT contain secrets, API keys, or credentials

Token budget

Repo Type Target Lines Tokens/Turn 30-Turn Cost
Product repo < 200 ~800 ~24,000
Command center < 300 ~1,200 ~36,000

surfcontext.json

The manifest file provides machine-readable configuration for SurfContext tooling. It declares which platforms to target, how to generate platform-specific files, and v3 features like discovery order, IP safety, and MCP integration.

Schema (v3.0)

surfcontext.json
{
  "version": "3.0",
  "platforms": ["claude", "codex", "cursor"],
  "canonical": {
    "rootContext": "CONTEXT.md",
    "docsDir": ".context/docs",
    "agentsDir": ".context/agents",
    "skillsDir": ".context/skills",
    "guidesDir": ".context/guides",
    "checkpointsDir": "plans/sessions",
    "plansDir": "plans"
  },
  "generation": {
    "claude": {
      "rootContext": "CLAUDE.md",
      "method": "sed-copy"
    },
    "codex": {
      "rootContext": "AGENTS.md",
      "method": "template-copy"
    }
  },
  "discoveryOrder": [
    "CONTEXT.md",
    "surfcontext.json",
    ".context/docs/",
    ".context/guides/",
    ".context/agents/",
    ".context/skills/",
    ".context/queue.md",
    "plans/"
  ],
  "ipSafety": {
    "enabled": true,
    "owner": "Example Corp",
    "noAiCoAuthor": true,
    "noSecrets": true
  },
  "mcp": {
    "serverName": "@surfcontext/mcp-server",
    "tools": [
      "surfcontext_read_context",
      "surfcontext_list_agents",
      "surfcontext_list_docs",
      "surfcontext_list_guides",
      "surfcontext_search"
    ]
  }
}

Field Reference

Field Required Description
version REQUIRED ARDS version: "3.0"
platforms REQUIRED Target platforms: "claude", "codex", "cursor", "copilot"
canonical.rootContext REQUIRED Path to canonical root context file
canonical.agentsDir REQUIRED Path to agent definitions directory
canonical.docsDir REQUIRED Path to knowledge docs directory
canonical.skillsDir OPTIONAL Path to skills directory
canonical.guidesDir OPTIONAL Path to guides directory (new in v3)
canonical.checkpointsDir OPTIONAL Path to session checkpoints (new in v3)
canonical.plansDir OPTIONAL Path to plans directory (new in v3)
generation OPTIONAL Platform-specific generation configuration
discoveryOrder OPTIONAL Ordered list of paths agents navigate (new in v3)
ipSafety OPTIONAL IP safety configuration (new in v3)
mcp OPTIONAL MCP server integration (new in v3)

Agent Configurations

Agent definition files live in .context/agents/. Each file defines a specialized agent with specific responsibilities, tool access, and output patterns.

File Format

.context/agents/devops-architect.md
---
name: devops-architect
description: AWS architecture, deployment, CI/CD, cost optimization
tools:
  - Read
  - Write
  - Bash
  - Grep
  - Glob
model: sonnet
---

# DevOps Architect

You are a DevOps specialist focused on AWS infrastructure.

## Scope

- Review and optimize AWS architecture decisions
- Diagnose deployment failures in Amplify Gen 2
- Manage CI/CD pipelines and build configurations

## Context Files

Read before starting work:
- `.context/docs/architecture.md` -- system structure
- `.context/guides/deploying-to-aws.md` -- deployment guide

## Cross-Agent Coordination

| Direction | Agent | What Flows | Format |
|-----------|-------|-----------|--------|
| Receives from | product-strategist | Feature specs | `plans/product/*.md` |
| Sends to | dev-workflow | Deploy status | `plans/dev/*.md` |

Frontmatter Fields

Field Required Description
name REQUIRED Kebab-case. Must match filename without .md.
description REQUIRED 80-150 chars. Action-oriented. Starts with verb.
tools REQUIRED Comma-separated. Only tools the agent needs.
model REQUIRED haiku, sonnet, opus, or inherit.

Scoping Rules

  • One job per agent -- don't combine frontend + deployment + testing
  • 3-5 per product repo -- enough coverage without overlap
  • Up to 25 for command centers -- strategy repos coordinate many domains
  • Stack-appropriate tools -- don't give every agent every tool

Skill Definitions

Skills define reusable expertise with progressive disclosure. Unlike agents, skills support slash-command invocation, supporting files, and cross-platform portability via the Agent Skills standard.

.context/skills/patent-draft/SKILL.md
---
name: patent-draft
description: Draft patent applications following USPTO conventions.
allowed-tools: Read, Write, Edit, Glob, Grep
model: opus
---

# Patent Drafting Skill

[Skill content -- expertise, procedures, templates]

Skills vs Agents

Property Agents Skills
Primary purpose Independent parallel workers Reusable expertise
Execution model Forked subagent (isolated context) Inline or forked
Best for Long analysis, strategy Code patterns, templates
Cross-platform Claude Code only Claude Code + Codex
Invocation Description match Description match or /command

Knowledge Documents

Knowledge documents live in .context/docs/ and store evergreen reference material too detailed for CONTEXT.md but essential for agent work. Read on demand, not every turn.

  • MUST include a > Last updated: YYYY-MM-DD date
  • SHOULD use descriptive kebab-case filenames
  • SHOULD begin with an H1 heading
  • MUST NOT contain secrets or credentials
  • SHOULD NOT exceed 400 lines

Standard docs

All repos: architecture.md, conventions.md

Strategy repos add: company-overview.md, product-portfolio.md, repo-registry.md

Guides v3

Guides are living how-to documents in .context/guides/ that accumulate battle-tested implementation knowledge over time. They are distinct from every other document type:

Type Purpose Mutability
Docs Describe what IS Updated when state changes
Agents Define WHO Stable
Skills Define COMMANDS Stable
Guides Describe HOW TO Living -- grows with each implementation
.context/guides/deploying-to-aws.md
# Guide: Deploying to AWS Amplify

> Platform: AWS Amplify Gen 2
> Last updated: 2026-02-10
> Confidence: high

## Table of Contents

- [Initial Setup](#initial-setup)
- [Common Issues](#common-issues)

## Initial Setup

Deploy using `npx ampx pipeline-deploy` with CI=1 flag.

> **Gotcha** (learned 2026-02-08): CDK tokens like
> `cdk.Stack.of().stackName` are unresolved at synth time.
> Use `process.env.AWS_BRANCH` for branch-specific naming.

## Common Issues

Check CloudWatch logs before assuming the issue is in your code.

> **Gotcha** (learned 2026-02-09): `force-dynamic` on root
> layout forces SSR on every request and crashes when client
> providers aren't available server-side.

Key Properties

  • Table of contents -- required; guides are long-form, agents need navigation
  • Last updated date -- required; signals freshness
  • Confidence level -- required; low / medium / high
  • Gotcha callouts -- blockquote with **Gotcha** prefix and date
  • Living by design -- agents SHOULD update the relevant guide after completing work

Plan Documents

Plan docs in plans/ capture point-in-time analysis, decisions, strategies, and deliverables. Named with YYYY-MM-DD-descriptive-slug.md format, organized by category subdirectory.

Category Contents
capital/ Funding, cap table, investor strategy
product/ Product strategy, design specs, roadmaps
strategy/ Business strategy, thesis evaluations
competitive/ Competitor landscape, market sizing
patents/ Patent families, prior art, filing strategy
sessions/ Session checkpoints
dev/ Workflow audits, CI/CD, testing
launches/ Launch checklists, beta programs
legal/ Corporate structure, compliance
research/ Study designs, venue analysis

Research Documents

Research docs in research/ are academic manuscripts with versioned drafts. Each project has its own directory with manuscript/v[N]/ and analysis/ subdirectories.

  • Never overwrite a previous version -- create a new directory
  • Analysis docs use YYYY-MM-DD naming
  • README.md at project root describes status and venue

Session Checkpoints v3

Session checkpoints are structured handoff documents that preserve work state across context boundaries -- when a conversation ends, an agent is swapped, or a developer switches machines.

plans/sessions/2026-02-10-sprint-review-checkpoint.md
# Session Checkpoint: Sprint Review

> Date: 2026-02-10 14:30
> Session: sprint-review
> Status: Checkpoint

## Accomplished

- Deployed billing integration
- Fixed production outage (FeedbackButton outside Providers)

## Remaining

- Wire Stripe webhook for subscription events
- Add usage tracking for metered billing

## Files Modified

| File | Change |
|------|--------|
| `src/app/billing/page.tsx` | Added tier subscription buttons |
| `amplify/backend.ts` | Fixed declaration ordering |

## Next Steps

1. Test subscription flow end-to-end
2. Deploy to production

When to Checkpoint

  • Context getting long -- better to checkpoint with margin than lose work
  • Switching agents -- when handing work between agent types
  • End of session -- before closing a conversation
  • Switching machines -- when continuing on a different computer
  • Before risky operations -- before large refactors or deployments

Discovery Order v3

Discovery order defines the sequence in which agents should navigate an ARDS-compliant repository. This was implicit in v2; v3 makes it explicit and configurable.

Step Path Loading Purpose
1 CONTEXT.md Always Project identity and map
2 surfcontext.json Always Configuration and platform targets
3 .context/docs/ On demand Evergreen knowledge
4 .context/guides/ On demand Living how-to documents
5 .context/agents/ On dispatch Agent definitions
6 .context/skills/ On invoke Skill definitions
7 .context/queue.md On request Multi-agent task queue
8 plans/ On demand Time-stamped work
9 research/ On demand Academic manuscripts
10 Source code On demand Follow architecture from CONTEXT.md

Custom order: Projects can override via discoveryOrder in surfcontext.json. Agents and tooling should respect this order when present.

Evidence Epistemology v3

Evidence epistemology defines how agents handle claims, sources, and uncertainty in documents they produce. This prevents strategy built on unverified claims from compounding errors.

Claim Tags

Tag When to Use
[verified] Claim backed by Tier 1-2 source
[unverified] From memory or secondary source
[assumption] Logical inference, not established fact
[internal estimate] Internal modeling or judgment

Evidence Hierarchy

Tier Source Type Trust Level
1 Peer-reviewed research, SEC filings, official docs Highest -- cite directly
2 Industry reports (Gartner, Forrester), reputable journalism High -- cite with date
3 Blog posts, conference talks, social media Medium -- cross-reference first
4 Internal estimates, founder intuition Use freely, always tag

Multi-Agent Coordination v3

Multi-agent coordination defines how multiple AI agents share work within and across repositories using the shared task queue at .context/queue.md.

.context/queue.md
# Agent Task Queue

## Pending

### TASK-001: Review PR for Security Issues

| Field | Value |
|-------|-------|
| Assigned to | **claude** |
| Priority | High |
| Status | **pending** |

**What to do:**
1. Review all changed files for OWASP top 10
2. Check for credential leaks

**Expected result:** Security assessment with pass/fail

---

## In Progress

## Done

Queue Protocol

  1. Agent creates task in Pending with clear steps
  2. Assigned agent starts -- moves to In Progress
  3. On completion -- fills Result, moves to Done
  4. Tasks older than 2 weeks -- move to Archive

Agent Contracts

When agents depend on each other's output, the dependency is documented in both agent configs with a Format column specifying the expected file pattern (new in v3).

Cross-Repository References v3

Cross-repo references define how projects link to and read from sibling repositories using a hub-and-spoke model.

Hub-and-spoke model

The strategy repo (hub) reads state from product repos (spokes). Product repos reference back for business context. Always use explicit relative paths.

  • Never duplicate company-wide context in product repos -- reference strategy
  • Product repos are self-contained for development; cross-refs are for business context
  • Strategy reads product state, not implementation code
  • Use the repo registry (.context/docs/repo-registry.md) as the master index

IP Safety v3

IP safety defines pre-write verification checks that protect intellectual property from misattribution, accidental disclosure, and brand contamination.

Check Rule
No misattribution IP is never attributed to another company
No AI co-author No Co-Authored-By: Claude or AI credits in commits
No leaked secrets No API keys, tokens, passwords, or credentials
No internal paths No absolute local filesystem paths in public content
No competitor branding Materials never carry competitor branding

Configure in surfcontext.json under the ipSafety block. Tools implementing ARDS should read this and enforce rules during file writes and pre-commit checks.

MCP Integration v3

The Model Context Protocol (MCP) provides a standard way for AI agents to access tools and data. ARDS defines how .context/ content can be exposed as MCP tools.

MCP and ARDS are complementary

MCP = what agents CAN DO (tools, actions, data access)

ARDS = what agents SHOULD KNOW (documentation, context, navigation)

Standard Tool Names

Tool Name Returns
surfcontext_read_context CONTEXT.md content
surfcontext_list_agents Agent names + descriptions
surfcontext_read_agent Full agent definition
surfcontext_list_docs Doc names + last-updated dates
surfcontext_read_doc Full doc content
surfcontext_list_guides Guide names + confidence levels
surfcontext_read_guide Full guide content
surfcontext_list_plans Plan titles + dates + status
surfcontext_read_plan Full plan content
surfcontext_search Matching excerpts with paths

Context Budget Management v3

Context budget management treats the AI agent's context window as a finite computational resource that must be allocated deliberately.

Content Class Budget Share Loading Strategy
System prompt + CONTEXT.md 5-10% Always loaded
Active working files 30-50% Loaded for current task
Reference docs + guides 10-20% On demand
Agent/skill definitions 5-10% On dispatch
Conversation history 20-30% Managed by platform

Progressive Disclosure Protocol

  1. Load CONTEXT.md -- provides the map
  2. Identify needed docs -- from key files table and task requirements
  3. Load only relevant docs/guides -- not the entire .context/ directory
  4. Checkpoint when long -- save state before context fills
  5. Prune completed context -- when a subtask finishes, its context can be released

Token Budget Guidance

Content Lines Tokens 30-Turn Cost
CONTEXT.md (200 lines) 200 ~800 ~24,000
CONTEXT.md (300 lines) 300 ~1,200 ~36,000
Agent config 100 ~400 ~400 (once)
Knowledge doc 150 ~600 ~600 (once)
Guide 200 ~800 ~800 (once)
Plan doc 200 ~800 ~800 (once)

Optimization Strategies

  • Move rarely-needed content to .context/docs/. If agents read it < 20% of sessions, extract from CONTEXT.md.
  • Use tables over prose. A 3-column table conveys the same info at ~1/3 the tokens.
  • Link, don't summarize. Path + one-line description, not a summary.
  • Prune Active Work. Remove completed items from CONTEXT.md.

Platform Compatibility

Claude Code (Anthropic)

Auto-loads CLAUDE.md every turn. Agents from .claude/agents/ dispatched by description match. Skills invoked by /command. ~200K token context.

Codex CLI (OpenAI)

Reads AGENTS.md as project context. Supports Agent Skills (SKILL.md). Reads PLANS.md for multi-hour problems. 32 KiB default limit. Sandboxed.

Cursor

.cursor/rules/*.mdc with YAML frontmatter and glob scoping. Rules scoped to file patterns. No agent dispatch.

GitHub Copilot

.github/copilot-instructions.md (workspace-wide). .github/instructions/*.instructions.md (path-specific with applyTo). No agent dispatch.

Windsurf

.windsurfrules at repo root. Single context file, no agent dispatch.

ARDS as Superset

ARDS is not competing with AGENTS.md, Agent Skills, or MCP. It is a superset that defines the full documentation architecture and generates files for every other format.

Standard Covers ARDS Relationship
AGENTS.md (AAIF) Single root context Maps to ARDS Root Context
Agent Skills Cross-platform skills Maps to ARDS Skill Configs
MCP Agent tool access Orthogonal: MCP = tools, ARDS = knowledge
PLANS.md (Codex) Problem-solving context Maps to ARDS Plan Docs
llms.txt LLM-readable site summary Orthogonal: site-level, not repo-level

Quality Scoring

Each dimension scores 0-3 (0 = missing, 1 = minimal, 2 = partial, 3 = fully compliant). Total: up to 99 points for a command center with all optional features.

CONTEXT.md max 27
  • Exists at repo root
  • Under line limit
  • Key Files table
  • Architecture section
  • Stack section
  • Development section
  • Active Work section
  • Cross-Repo section
  • Agents section
Agent Coverage max 21
  • Count appropriate
  • YAML frontmatter complete
  • Descriptions action-oriented
  • No overlapping scope
  • Tools appropriate
  • Output locations specified
  • Model selection justified
Knowledge Docs max 15
  • Directory exists
  • Standard docs present
  • All docs have dates
  • No doc exceeds 400 lines
  • Content is evergreen
Guides (v3) max 12
  • Directory exists
  • Guides have confidence levels
  • Guides have table of contents
  • Gotcha callouts use standard format
Plans max 12
  • YYYY-MM-DD naming
  • Header metadata
  • Category subdirectories
  • Active plans in CONTEXT.md
Range Rating
85-99 Excellent
65-84 Good
45-64 Fair
25-44 Poor
0-24 Non-compliant

Freshness Monitoring

Document Type Threshold Action
CONTEXT.md 7 days Review Active Work; prune completed items
Agent Config 30 days Verify scope, tools, model still match
Knowledge Doc 30 days Update or add [STALE] warning
Guide 30 days Review confidence; flag for re-validation
Plan Doc N/A Mark as Superseded when replaced
Checkpoint N/A Time-stamped by design
Research Doc 60 days Flag for author review

Migration Guide

All v3 additions are optional. A valid v2 project is already a valid v3 project.

v2.0 to v3.0

  1. Update surfcontext.json -- bump version to "3.0", add new fields (guidesDir, checkpointsDir, discoveryOrder, ipSafety, mcp)
  2. Create .context/guides/ -- move or create living how-to documents with confidence levels and gotcha callouts
  3. Create checkpoint directory -- start writing session checkpoints to plans/sessions/
  4. Add claim tags -- tag claims in strategic documents with [verified], [unverified], [assumption], [internal estimate]
  5. Add discovery order -- document your project's discovery order in surfcontext.json
  6. Configure IP safety -- add ipSafety block to surfcontext.json if relevant
  7. Add agent contracts -- include Format column in Cross-Agent Coordination tables

From platform-specific to ARDS

  1. Create .context/ with agents/ and docs/
  2. Write CONTEXT.md from existing root context
  3. Move agent/doc files to .context/
  4. Create surfcontext.json
  5. Set up generation (symlinks or sync script)
  6. Test platform-specific tool still works

Versioning

The SurfContext specification follows Semantic Versioning. The current version is 3.0.

  • v3.0 (2026-02-10) -- 9 new sections: guides, checkpoints, evidence, discovery order, multi-agent, cross-repo, IP safety, MCP, context budget
  • v2.0 (2026-01-31) -- Skills, research docs, expanded taxonomy, scoring rubric, freshness monitoring
  • v1.0 (2026-01-15) -- Initial specification: CONTEXT.md, agents, docs, plans