Skip to content
/

spec-ops-agents-file

spec-ops-agents-file · spec-ops-method/spec-ops-agents-file · ★ 0 · last commit 2026-04-10

Embed spec-first discipline into any AI agent via AGENTS.md instructions: always read the spec first, never implement undocumented behavior, stop and request clarification when specs are ambiguous.

Best whenAgents must stop rather than interpret ambiguous requirements; specifications are a communication medium between humans, not just agent instructions.
Skip ifImplementing behavior not covered by a specification, Interpreting ambiguous or contradictory requirements instead of flagging them
vs seeds
spec-kitships 9 commands, 9 skills, and 18 hooks — SpecOps's 'in…
Primitive shape
No installable primitives
00

Summary

SpecOps Agents File — Summary

SpecOps Agents File (0 stars) is a minimalist methodology distribution: two AGENTS.md instruction files (full and slim versions) that embed the SpecOps methodology into any AI agent's operating instructions. The core principle is "specification is the source of truth" — agents must read and defer to specs in specifications/ before making code changes, propose spec updates before implementing undocumented behavior, and stop when requirements are ambiguous rather than making assumptions. The full AGENTS.md covers workflow, review protocol, spec format (with Gherkin-style acceptance criteria), legacy code extraction, and CI/CD integration. The slim version removes ~65% of the text while preserving behavioral instructions. A complementary GitHub Action (spec-ops-method/spec-ops-action) creates issues when spec files change, enforcing traceability. This is a Tier-A Archetype 4 framework (Markdown scaffold, zero agent primitives) — it works by modifying what the AI agent reads, not by providing commands, skills, or hooks. Closest seed is agent-os (both are markdown instruction files with zero primitives) but SpecOps is specifically focused on spec-first development for legacy system modernization while agent-os is a general standards system.

01

Overview

SpecOps Agents File — Overview

Origin

Published by spec-ops-method organization (GitHub). Related to the SpecOps methodology site (spec-ops.ai) and Mark Headd's original SpecOps repo. Part of an ecosystem including a GitHub Action for CI/CD enforcement. MIT license.

Philosophy

"The specification is the source of truth. All code implements behavior defined in specifications."

"Specification First: Agents read and defer to specs in specifications/ before making or reviewing code changes." "No Undocumented Behavior: If behavior isn't covered by a spec, draft a spec update and request human verification." "Human Verification: Domain experts review specs (plain language), not implementation details." "Flag Ambiguity: Agents stop and request clarification when requirements are unclear, contradictory, or incomplete." "Preserve Knowledge: Extract implicit business rules found in legacy code into specs for human review."

Target Use Case

Legacy system modernization — teams using AI agents to understand and refactor existing codebases need to ensure that implicit business rules are captured in specifications before being lost or misinterpreted during AI-assisted changes.

Two Versions

File Use case
AGENTS.md Comprehensive guidance for all SpecOps aspects
AGENTS-slim.md ~65% shorter; only behavioral instructions (faster context load)

The slim version's design rationale: "concentrates only on instructions that change agent behavior."

02

Architecture

SpecOps Agents File — Architecture

Distribution

  • Type: Standalone repo (methodology documentation)
  • Core deliverable: Two markdown files (AGENTS.md, AGENTS-slim.md)
  • License: MIT

Installation

# Option A: Copy AGENTS.md or AGENTS-slim.md to your project root
cp AGENTS.md /path/to/your/project/AGENTS.md

# Option B: Add CI/CD GitHub Action
# .github/workflows/spec-changes.yml

Directory Tree

spec-ops-method/spec-ops-agents-file/
├── AGENTS.md           # Full SpecOps instructions for AI agents
├── AGENTS-slim.md      # Condensed version (~65% shorter)
├── CONTRIBUTING.md
├── LICENSE
├── README.md
└── specifications/
    └── sample-feature.md  # Example specification in SpecOps format

Required Runtime

  • Any AI coding agent that reads AGENTS.md/AGENTS.md-equivalent instruction files
  • Works with Claude Code, Codex (AGENTS.md), any agent that reads instruction files

Config Files

None — the framework value is entirely in AGENTS.md/AGENTS-slim.md content.

Ecosystem

  • SpecOps GitHub Action (spec-ops-method/spec-ops-action) — creates GitHub issues when specification files change
  • SpecOps methodology site — spec-ops.ai
  • LLMs.txthttps://spec-ops.ai/llms.txt (agent-readable version)
  • GitHub spec-kit — related GitHub-developed framework (listed in references)
03

Components

SpecOps Agents File — Components

Core Files (2)

File Content
AGENTS.md Full SpecOps workflow, review protocol, spec format, legacy extraction guide, CI/CD integration
AGENTS-slim.md Core principle + workflow requirements + spec format + CI/CD integration only

Specification Format (defined in AGENTS.md)

# [Feature/Component Name] Specification

## Purpose
Brief description of what this component does and why it exists.

## Requirements

### Requirement: [Requirement Name]
The system SHALL [behavior description].

#### Acceptance Criteria
- GIVEN [precondition]
- WHEN [action]
- THEN [expected outcome]

#### Edge Cases
- [Edge case description and expected handling]

## References
- [Link to governing statute, regulation, or policy]

Example Spec

specifications/sample-feature.md — demonstrates the format with a real example.

CI/CD Integration Component

The GitHub Action spec-ops-method/spec-ops-action@v1:

- uses: spec-ops-method/spec-ops-action@v1
  with:
    file-pattern: 'specifications/**/*.md'
    labels: 'spec-change'

Creates issues when specification files are modified, making spec changes trackable as work items.

What the Framework Does NOT Ship

  • No slash commands
  • No skills
  • No hooks
  • No agents (the AGENTS.md is for agents, not about agents the framework provides)
  • No CLI binary
  • No MCP server
05

Prompts

SpecOps Agents File — Prompts

Verbatim Excerpt 1: Core Principle Statement

## Core Principle

**The specification is the source of truth.** All code implements behavior defined in specifications.
When in doubt, defer to the spec. If the spec is unclear or incomplete, flag it for human review
rather than making assumptions.

Prompting technique: Three-sentence iron law with a decision procedure for ambiguity: don't interpret, don't assume, flag and stop. The "when in doubt" clause prevents the agent from filling gaps with reasonable-seeming defaults.


Verbatim Excerpt 2: Spec-Before-Code Enforcement

## The SpecOps Workflow

### Specification First

1. **Read specifications before code.** Before implementing, modifying, or analyzing any feature,
   locate and read the relevant specification in the `specifications/` directory.
2. **Propose spec changes before code changes.** If implementation requires behavior not covered
   by a specification, draft a specification update for human review before writing code.
3. **Never implement undocumented behavior.** All system behavior must trace back to a
   verified specification.

### Human Verification

4. **Domain experts verify specifications, not code.** Specifications are written in plain
   language so non-technical stakeholders can review them. Code is an implementation detail.
5. **Flag ambiguity for human review.** When specifications contain ambiguous requirements,
   edge cases without clear guidance, or apparent contradictions, stop and request clarification
   rather than interpreting.
6. **Preserve institutional knowledge.** When you encounter implicit business rules, policy
   interpretations, or undocumented edge cases in existing code, extract them into specification
   language for human verification.

Prompting technique: Numbered workflow with explicit role separation between specifications (human-readable, human-verified) and code (implementation detail). Rules 4-6 encode the "specification as communication medium between humans and agents" pattern — specs are not for the agent, they are for domain experts to verify.


Verbatim Excerpt 3: Legacy Code Extraction Instructions

### Analysis Approach

1. **Identify business logic.** Distinguish business rules from infrastructure, error handling,
   and technical implementation details.
2. **Trace to authoritative sources.** Look for references to statutes, regulations, form
   numbers, or policy documents in comments or naming.
3. **Document edge cases.** Pay special attention to conditional logic, boundary conditions,
   and error handling — these often encode important business rules.
4. **Preserve original intent.** Capture what the code *does*, not what you think it *should* do.
   Specification review will determine correctness.

Prompting technique: "Preserve original intent" instruction prevents the agent from "improving" during analysis — a common failure mode where AI agents subtly change behavior while extracting it into specs. The instruction to distinguish business logic from infrastructure creates a classification task that surfaces the actual spec-worthy content.

09

Uniqueness

SpecOps Agents File — Uniqueness

Differs from Seeds

Closest seed: agent-os — both are markdown instruction files with zero agent primitives (Archetype 4: "Markdown scaffold, zero primitives"). Key differences: (1) SpecOps is specifically designed for spec-first development with legacy system modernization — agent-os is a general-purpose standards system; (2) SpecOps includes a legacy code extraction protocol (extract implicit business rules from existing code into specs for human verification) — no seed has this; (3) SpecOps's "stop when ambiguous" rule is more aggressive than agent-os's guidance — the agent must halt rather than interpret unclear requirements; (4) SpecOps has a complementary CI/CD GitHub Action for spec change tracking — agent-os is purely instruction-file-based.

Compared to spec-kit (a seed): both are spec-driven, but spec-kit is a full framework (9 commands, 9 skills, 18 hooks) while SpecOps is a pure instruction methodology — no primitives, no automation.

Positioning

SpecOps occupies the "maximum human control, minimum agent autonomy" niche. It is designed for contexts where business requirements must be human-verified — regulated industries, legacy system modernization, compliance-heavy environments — where an agent making reasonable assumptions about undocumented behavior is unacceptable.

Observable Failure Modes

  1. Spec discovery — Agents must "locate the governing spec" for any change. If the spec naming convention or directory structure is unclear, agents may proceed without finding the relevant spec.
  2. Ambiguity threshold — "Stop when ambiguous" could cause excessive interruptions in codebases with many edge cases. The slim version reduces this by being more direct.
  3. Spec currency — If specs are not updated when code changes, the agent defers to stale specs. SpecOps has no automatic spec freshness detection.
  4. Zero automation — The GitHub Action is the only automation. Teams expecting automated test running, commit creation, or PR generation will need to add other tools.
04

Workflow

SpecOps Agents File — Workflow

Encoded Workflow (from AGENTS.md)

The SpecOps Workflow

Before any change:
1. Locate the governing spec for the feature in specifications/
2. Validate the spec covers the required behavior + acceptance criteria
3. If missing: draft spec update for human review BEFORE writing code
4. If ambiguous: STOP and request clarification

During implementation:
5. Reference specification requirements in code comments
6. Align naming with specification terminology
7. Implement exactly what the spec requires — no more, no less

After implementation:
8. Verify all acceptance criteria are met
9. Document implementation decisions not obvious from spec
10. Note any spec gaps discovered for future spec updates

Legacy Extraction Workflow

For existing code without specs:
1. Identify business logic (separate from infrastructure + error handling)
2. Trace to authoritative sources (statutes, regulations, policies in comments)
3. Document edge cases (boundary conditions encode business rules)
4. Generate specs in plain language for domain expert verification
5. Flag contradictory logic, magic numbers, dead code for human review

Approval Gates (human-in-the-loop)

Condition Gate
Spec ambiguous Agent stops, requests clarification
Behavior not covered by spec Agent drafts spec update, requests human approval before implementing
Contradictory spec Agent flags, does not interpret

Phase / Artifact Map

Phase Artifact
Pre-implementation Spec in specifications/<name>.md
Implementation Code changes + comments referencing spec
Post-implementation Verification confirmation
CI/CD GitHub issue per spec change (via GitHub Action)
06

Memory Context

SpecOps Agents File — Memory & Context

State Storage

Type: File-based (markdown specifications)
Persistence: Project-scoped (specifications/ directory)

State Files

Path Content
specifications/<feature>.md Specification with requirements, acceptance criteria, edge cases
specifications/drafts/*.md In-progress spec updates awaiting human review

Memory Model

SpecOps has the simplest possible memory model: the specifications/ directory IS the memory. Everything the agent needs to know about system behavior is in spec files. The agent's job is to:

  1. Read the relevant spec before any work
  2. Write new spec drafts when behavior is undocumented
  3. Never rely on memory of past sessions for behavior — always re-read the spec

Cross-Session State

Specs are committed files. Every new session reads the same specs. No session state, no database. This is the entire point: specs as persistent, human-readable, human-verifiable memory.

Spec Update Tracking

The GitHub Action creates issues when spec files change, providing a change-tracking layer on top of git. Spec modifications become actionable work items in the project's issue tracker.

What SpecOps Does NOT Track

  • Implementation progress (no task tracking)
  • Code review state
  • Test results
  • Agent session history
07

Orchestration

SpecOps Agents File — Orchestration

Multi-Agent

No. SpecOps Agents File defines instructions for a single AI agent. There is no multi-agent orchestration.

Execution Mode

Interactive-loop — the agent follows SpecOps instructions within normal coding sessions. No dedicated execution mode.

Isolation

None — in-place edits.

Multi-Model

N/A — model-agnostic instruction file.

Autonomy Level

Deliberately constrained:

  • Agent stops when specs are ambiguous (never interprets)
  • Agent stops when behavior is undocumented (drafts spec, waits for human)
  • Human verification is required before implementing any undocumented behavior

What "Orchestration" Means in SpecOps

The only coordination in SpecOps is between the AI agent and human domain experts:

  1. Agent reads specs (AI-authored content and human-authored content, same format)
  2. Agent flags gaps/ambiguities → humans clarify
  3. Humans verify spec drafts → agent implements
  4. GitHub Action creates issues for spec changes → humans review

This is a human-AI collaboration protocol, not an AI orchestration system.

08

Ui Cli Surface

SpecOps Agents File — UI, CLI & Surface

No Dedicated CLI

SpecOps Agents File ships no CLI binary, no TUI, no web dashboard. The "interface" is:

  1. Copy AGENTS.md (or AGENTS-slim.md) to your project
  2. Configure your AI coding tool to read AGENTS.md
  3. Place specifications in specifications/

CI/CD Surface (optional)

The complementary GitHub Action (spec-ops-method/spec-ops-action) is the framework's only automation surface:

  • Triggers on push/PR to branches with spec file changes
  • Creates GitHub issues per modified spec file
  • Labels with spec-change

Cross-Tool Portability

MaximumAGENTS.md is read by:

  • Claude Code (via AGENTS.md convention)
  • OpenAI Codex (via AGENTS.md convention)
  • Any AI coding tool that reads instruction files

AGENTS-slim.md is the optimized version for tools where context window size matters.

LLMs.txt

https://spec-ops.ai/llms.txt provides a machine-readable version of the methodology for AI agents to fetch directly.

Related frameworks

same archetype · same primary tool · same memory type

Context-Engineering Handbook ★ 9.0k

Provides a first-principles, research-grounded vocabulary and learning path for context engineering — the discipline of designing…

walkinglabs/learn-harness-engineering ★ 6.6k

Teach harness engineering from first principles (12 lectures + 6 projects) and provide a scaffolding skill (harness-creator) that…

Awesome Harness Engineering (walkinglabs) ★ 2.7k

Curate the authoritative reference list of articles, benchmarks, and tools for harness engineering — the practice of shaping the…

cline-memory-bank (nickbaumann98) ★ 581

Custom instructions + 6-file hierarchical Markdown memory bank so Cline maintains full project context across sessions, with a…

FPF (First Principles Framework) ★ 372

Provides a formal pattern language for making reasoning explicit, traceable, and publishable in mixed human/AI engineering work —…

nexu-io/harness-engineering-guide ★ 134

Provide a practical, code-first reference guide to harness engineering — from first principles to production patterns —…