# Delta Spec
<!--
ref: @protocol/delta-spec
tags: [spec, change-management, versioning, delta, requirements]
triggers: [update the spec, propose a change, modify a published protocol, what changed, change proposal]
trigger_prompt: Use when proposing or applying a change to any document that is a source of truth for agreed behavior — specs, protocols, contracts — especially when another agent will implement against the text.
complements: [@protocol/spec, @protocol/harvest-index]
version: 3
updated_at: 2026-07-14T23:23:54.931Z
-->

Change a living spec with ADDED/MODIFIED/REMOVED sections whose requirements are restated in full (never as inline diffs), proposed beside the canonical doc, then folded in and date-prefix archived on completion.

## When this applies

Any time a document is the source of truth for agreed behavior and you're proposing a change to it: evolving a spec in a brownfield system, revising a published protocol, changing a contract other agents build against. If the reader of your change would otherwise have to hold old-version and new-version in their head simultaneously, write a delta spec.

## The delta format

A change document has up to three sections. Under each, affected requirements appear **complete** — the full requirement as it will read (or read), never a fragment or an inline edit:

```markdown
## ADDED Requirements
### <requirement name>
<the full new requirement text>

## MODIFIED Requirements
### <requirement name>
<the full requirement text as it will now read — not the edit, the result>

## REMOVED Requirements
### <requirement name>
<the full requirement being removed, so the removal is auditable>
```

Restating in full is the point. Inline diffs optimize for the writer; restated deltas optimize for the reader — and the reader is usually an agent that will implement against the text verbatim.

## Requirement language

- **RFC-2119 keywords** (MUST / SHALL / SHOULD / MAY) make obligation levels machine-checkable.
- **Given / When / Then scenarios** under a requirement make it testable: `Given <state>, When <action>, Then <observable outcome>`.

## Lifecycle: propose → apply → archive

1. **Propose** — the delta lives beside (not inside) the canonical doc: a change folder or entry holding the delta plus, for larger changes, the why (proposal), the how (design), and the steps (tasks). Each artifact is context for the next; investigate once, pass forward.
2. **Apply** — implementation happens against the delta. The canonical doc is untouched while the change is in flight, so readers always see agreed behavior, not aspiration.
3. **Archive** — on completion, fold the deltas into the canonical doc and move the change to an archive, **date-prefixed** (`archive/2026-07-05-<change-name>`). The canonical doc grows continuously and always reflects reality; the archive is the audit trail of how it got there.

## Small changes: the changelog line

Full propose/apply/archive ceremony is heavy for a one-line fix. The lightweight form: apply the change directly and append a dated changelog line to the canonical doc using the same verbs —

```markdown
- **2026-07-05** — MODIFIED: threat checklist gains prompt-injection scan. ADDED: harvest logging step. Source: <event/plan ref>.
```

Rule of thumb: if the change touches one requirement and needs no design discussion, changelog line. If it touches several, or another agent will implement it, full delta.

## Anti-patterns

- **Editing the canonical doc while the change is still being debated** — readers can no longer tell agreed from proposed.
- **Delta fragments** ("change 'weekly' to 'daily' in §3") — pushes the diff work onto every future reader.
- **Undated archives** — the audit trail loses its timeline.

---

*Related: `@content/youtube/lennys-podcast/2026-09-27-molly-graham-the-grief-burnout-and-opportunity-hiding-inside` · `@protocol/spec-audit` · `@agentsite/spec-audit` · `@protocol/append` · `@protocol/agent-shipping`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*