Skip to content
/

SpecPact

specpact · specpact/specpact · ★ 13 · last commit 2026-03-11

Provide permanent, tiered spec contracts with a Memory Bank so AI sessions always have project context and always implement against explicit contracts rather than inferred intent.

Best whenSpecs should never be deleted — deprecate them, keep the history; and the most important spec property is explicit scope boundary, not acceptance criteria.
Skip ifDeleting specs when a feature is complete, Implementing what the title implies rather than what the contracts specify
vs seeds
openspec(both use a CLI for spec lifecycle management, persistent spec files, and a Memory Bank / context injection pattern for …
Primitive shape
No installable primitives
00

Summary

SpecPact — Summary

SpecPact is a zero-dependency SDD toolkit distributed as a Node.js CLI (npm install -g specpact) that creates and maintains a .sdd/ directory at the project root. The framework's core insight is that specs should be permanent living contracts — deprecated when removed, never deleted — and that AI sessions need pre-loaded context (the "Memory Bank") to avoid repeating explanations. It implements three workflow tiers (nano / feature / system) with mode-specific numbered-priority rule files that govern exactly how the AI should behave when working on each change type. The CLI has 6 subcommands (init, new, update, list, verify, upgrade), and the mode files are plain markdown loaded into the AI's context at session start. SpecPact is explicitly multi-tool (targets Claude Code, GitHub Copilot, and any AI tool that can read a text file).

Compared to seeds, SpecPact is most similar to openspec (both implement a tiered spec workflow with Memory Bank / context files, persistent specs, and a CLI) but SpecPact adds: (1) three explicitly tiered workflows (nano/feature/system) with distinct priority-ordered rule files instead of a single spec format; (2) a permanent spec lifecycle ("deprecated, never deleted"); and (3) a verify command that generates a structured audit prompt for human-judged verification. Unlike openspec's delta-diff approach, SpecPact stores whole-file specs.

01

Overview

SpecPact — Overview

Origin

Created by the specpact organization (specpact/specpact). MIT license. 13 stars. Shell + JavaScript. Last push March 2026.

Philosophy

"Spec-Driven Development that fits how you actually work."

"AI coding assistants are powerful, but they forget everything between sessions. They implement what the prompt implies, not what the spec requires. They treat a bug fix and an architectural change with the same ceremony. SpecPact fixes this."

Core problems SpecPact names:

  1. AI forgets project context between sessions → Memory Bank (three files loaded every session)
  2. Specs die when the PR merges → Specs are permanent (deprecated when removed, never deleted)
  3. One verbose workflow for every change size → Three tiered modes (nano, feature, system)
  4. AI implements beyond the spec boundary → Mode rules (numbered, prioritized, enforced per session)
  5. Unclear whether implementation matches spec → specpact verify (structured audit prompt)
  6. No upgrade path for installed scripts → specpact upgrade (surgical update, never touches specs)

Key Manifesto Excerpts

From README:

"Every SpecPact project has a .sdd/ directory at the repo root."

"Specs are permanent — deprecated when removed, never deleted."

"Mode rules — numbered, prioritised, enforced per session."

From nano.md:

"A nano change is small, focused, and leaves the codebase structurally unchanged. If you find yourself wanting to improve architecture, refactor broadly, or add functionality beyond the scope boundary — stop. That is a different spec."

"Rule 5 — Stay small: A nano change should touch at most 3 files. If you find yourself needing to change more than 3 files, stop and tell the developer."

02

Architecture

SpecPact — Architecture

Distribution

  • Type: CLI tool (npm + shell installer)
  • Install: npx specpact init (no global install needed) or npm install -g specpact
  • License: MIT
  • Language: JavaScript (CLI), Shell (installer), Markdown (mode files)

Directory Structure (Generated in Project)

.sdd/
  memory/
    AGENTS.md         ← Stack, conventions, anti-patterns (Memory Bank)
    architecture.md   ← Service topology and boundaries (Memory Bank)
    decisions.md      ← Why key decisions were made (Memory Bank)
  specs/
    <spec-name>/
      spec.md         ← The contract (permanent, never deleted)
      notes.md        ← Implementation context (deleted when spec reaches stable)
  modes/
    nano.md           ← Bug fixes and small tweaks (priority-ordered rules)
    feature.md        ← New capabilities (priority-ordered rules)
    system.md         ← Architectural changes (priority-ordered rules)
  templates/          ← Spec templates for each mode type
  scripts/            ← CLI helper scripts

CLI Structure

cli/
  src/
    commands/
      init.js       ← Initialize .sdd/ in project
      new.js        ← Create new spec
      update.js     ← Update spec status (draft → stable → deprecated)
      list.js       ← List specs and their statuses
      verify.js     ← Generate audit prompt for spec verification
      upgrade.js    ← Surgical update of SpecPact scripts (never touches specs)
  bin/              ← Binary entry point

Required Runtime

  • Node.js 18+
  • No git required at install time
  • No external dependencies

Target AI Tools

Any AI tool that can read a text file: Claude Code, GitHub Copilot, and others. Mode files are loaded manually into the AI session context.

03

Components

SpecPact — Components

CLI Commands (6)

Command Purpose
specpact init Initialize .sdd/ directory; prompt for project name, type, stack, purpose; stamp Memory Bank
specpact new <mode> <name> Create new spec (mode: nano, feature, or system)
specpact update <name> <status> Update spec status: draft → stable → deprecated
specpact list List all specs with their statuses
specpact verify <name> Generate structured audit prompt for spec verification
specpact upgrade Update SpecPact scripts surgically (never touches .sdd/ specs)

Mode Files (3)

Mode files are priority-ordered rule documents loaded into the AI session to govern behavior for each change tier.

nano.md — Bug Fixes and Small Tweaks

Rules (priority order, lower wins on conflict):

  1. Load context before touching anything (.sdd/memory/AGENTS.md + spec.md)
  2. Restate change contract before acting (numbered list, wait for confirmation)
  3. Respect scope boundary absolutely (hard stops for out-of-scope areas)
  4. Follow existing patterns — do not introduce new ones
  5. Stay small (max 3 files changed; if more needed, stop and report)
  6. Do not touch tests unless the spec says so

feature.md — New Capabilities

Rules (priority order):

  1. Load full context (AGENTS.md + architecture.md + spec.md + notes.md)
  2. Restate intent and list contracts before acting
  3. Implement against contracts, not against the title
  4. ... (additional feature-scope rules)

system.md — Architectural Changes

Additional rules for system-scope changes (ADR format, migration planning, etc.)

Memory Bank (3 files)

File Purpose
.sdd/memory/AGENTS.md Stack, conventions, naming, what AI should never do
.sdd/memory/architecture.md Service topology, boundaries, component relationships
.sdd/memory/decisions.md Why key decisions were made (decision log)

Spec Files (per-feature)

Each spec lives at .sdd/specs/<name>/spec.md with:

  • Change contract (what must be true when done)
  • Scope boundary (what must NOT change)
  • Verification section
  • Status: draft → stable → deprecated (never deleted)

Claude Integration

.claude/ directory in the specpact repo includes SpecPact's own Claude Code commands for its development — not user-facing.

05

Prompts

SpecPact — Prompt Excerpts

Excerpt 1: nano.md — Priority-Ordered Rules System

Source: .sdd/modes/nano.md

# SpecPact: Nano Mode
# ─────────────────────────────────────────────────────────────────────────────
# This file defines how you operate when working on a nano-mode spec.
# Nano mode is for: bug fixes, small tweaks, targeted refactors.
# Rules are numbered by priority. When rules conflict, lower numbers win.
# ─────────────────────────────────────────────────────────────────────────────

## What nano mode means
A nano change is small, focused, and leaves the codebase structurally unchanged.
If you find yourself wanting to improve architecture, refactor broadly, or add
functionality beyond the scope boundary — stop. That is a different spec.

## Rules (in priority order)

### Rule 1 — Load context before touching anything
Before reading any code or writing any code, read these files in order:
1. `.sdd/memory/AGENTS.md`
2. The spec file for this task: `.sdd/specs/[spec-id]/spec.md`

### Rule 5 — Stay small
A nano change should touch at most 3 files. If you find yourself needing
to change more than 3 files, stop and tell the developer. The change may
have been misclassified as nano when it is actually a feature.

### Rule 6 — Do not touch tests unless the spec says so
Do not add, remove, or modify tests unless explicitly listed in the change
contract. If a test fails because of your change, report it — do not fix
it silently, as silent test fixes expand scope.

**Exception:** If the spec's verification section explicitly requires a test
to be written or updated, do so — that is within scope.

Prompting technique: Priority-ordered rules with explicit conflict resolution ("When rules conflict, lower numbers win"). Rule 5's "3 file limit" is a concrete, enforceable bound on scope creep — the most quantitative scope constraint in the corpus.


Excerpt 2: feature.md — Contract-Only Implementation Mandate

Source: .sdd/modes/feature.md

### Rule 3 — Implement against contracts, not against the title
The spec's "Contracts" section defines what must be true when you are done.
Implement to satisfy those specific, observable outcomes. If a contract is
ambiguous, ask one clarifying question — do not guess.

If you find yourself doing work that satisfies none of the contracts, stop.
You may be building something that was not requested.

Prompting technique: Title vs. contract distinction — the rule explicitly forbids implementing what the title implies and restricts work to only what the explicit contracts specify. This is a "negative scope" constraint: listing what the AI must NOT build.


Excerpt 3: From README — Memory Bank Pattern

Source: README.md

## Memory Bank — files that load into every AI session, every time.
.sdd/memory/AGENTS.md        ← your stack, conventions, anti-patterns
.sdd/memory/architecture.md  ← service topology and boundaries
.sdd/memory/decisions.md     ← why key decisions were made

Prompting technique: Context pre-loading as a structured pattern — the Memory Bank is a user-maintained set of files that serve as a "persistent context injection" mechanism for any AI tool that can read files, without relying on any specific hook or session management.

09

Uniqueness

SpecPact — Uniqueness

Differs From Seeds

SpecPact is most similar to openspec (both implement a spec format with a Memory Bank / context files, use a CLI for spec lifecycle management, and target multiple AI tools). The key delta: SpecPact adds three tiers (nano/feature/system) with distinct priority-ordered rule files per tier, while openspec has a single format. SpecPact's most distinctive design choice is the "permanent specs, never deleted" lifecycle — deprecated specs remain as historical record, which openspec does not guarantee. The verify command generates a human-judged audit prompt rather than running automated validation, making SpecPact explicitly human-in-the-loop at the verification stage.

Compared to spec-driver (delta-first lifecycle, Ralph loop), SpecPact is more conservative: whole-file specs with scope boundaries, no automated execution loop, manual context loading. SpecPact treats the human as the orchestrator; spec-driver automates the loop.

Positioning

  • "Fits how you actually work" — minimal disruption to existing workflow
  • Three-tier pragmatism: not every change deserves a design review
  • Tool-agnostic: the most portable spec framework in this batch
  • Small footprint: zero external dependencies

Notable Patterns

  1. 3-file limit (nano.md Rule 5): The most quantitative scope boundary in any framework in this batch — if a change touches more than 3 files it's not a nano change
  2. Title vs. contracts: Feature mode Rule 3 explicitly forbids implementing what the title implies, restricting work to only the explicit contract items
  3. Permanent specs: Specs are never deleted — only deprecated — creating an audit trail of all past specifications
  4. upgrade command: Surgically updates SpecPact scripts without touching user-owned specs — prevents the common "upgrade wipes my customizations" problem

Observable Failure Modes

  1. Manual context loading: No SessionStart hook — human must remember to load mode files into each session
  2. No automation: All advancement (draft → stable → deprecated) is manual; no verification script
  3. Low adoption: 13 stars — limited community validation
  4. Human-judged verify: specpact verify generates a prompt but does not run automated tests — leaves final verification entirely to human judgment
04

Workflow

SpecPact — Workflow

Core Loop

specpact new <mode> <name>
  ↓ Fill in spec.md (change contract, scope boundary)
  ↓ Load mode file into AI session
  ↓ AI reads AGENTS.md + spec.md, restates contract
  ↓ Human confirms restatement
  ↓ AI implements against contracts
  ↓ specpact verify <name> → audit prompt → human judges
  ↓ specpact update <name> stable

Workflow Phases

Step Command Artifact Gate
Create spec specpact new <mode> <name> .sdd/specs/<name>/spec.md None (auto-created)
Fill spec Manual editing spec.md with contract + scope Human writes the contract
Load context Paste mode file into AI session AI follows mode rules Human loads the file
Implement AI session Code changes AI must restate contract first
Verify specpact verify <name> Audit prompt Human judges the verdict
Finalize specpact update <name> stable Status change in spec.md Human decision

Mode-Specific Approval Gates

Nano Mode

  • Gate 1: AI must read .sdd/memory/AGENTS.md and spec.md before touching code
  • Gate 2: AI must restate the change contract as a numbered list and wait for human confirmation
  • Gate 3: Any scope expansion → stop and report (do not implement)
  • Gate 4: >3 files changed → stop and report

Feature Mode

  • Gate 1: AI must read AGENTS.md + architecture.md + spec.md + notes.md
  • Gate 2: AI must restate intent + list all contracts + flag open questions, wait for confirmation
  • Gate 3: Work not satisfying any contract → stop

Spec Lifecycle

draft → stable → deprecated

Specs are never deleted — only deprecated. The deprecated spec remains as historical record.

Memory Bank Workflow

On project init: fill in AGENTS.md (2 minutes), then create first spec. Memory Bank is loaded into every AI session — the AI never re-explains the stack.

06

Memory Context

SpecPact — Memory & Context

Memory Bank

Three persistent files loaded into every AI session:

File Purpose
.sdd/memory/AGENTS.md Stack, naming conventions, what AI must never do, backend/frontend config
.sdd/memory/architecture.md Service topology, boundaries, component relationships
.sdd/memory/decisions.md Why key architectural decisions were made (ADR-lite)

These files are maintained by the human. They are not auto-generated. The specpact init command creates them with stub content; the human fills in the remaining sections.

Spec Files

Each spec lives at .sdd/specs/<name>/spec.md. Permanent — never deleted, only deprecated. The notes.md companion is deleted when the spec reaches stable (implementation context no longer needed).

Persistence Mechanism

No hooks, no session injection scripts. The Memory Bank and mode files are loaded manually by the user into each AI session context. The framework relies on the human to include them.

Context Loading Pattern

For each new AI session:

  1. Paste or include .sdd/memory/AGENTS.md in the system/context
  2. Load the appropriate mode file (nano.md, feature.md, or system.md)
  3. Reference the specific spec: .sdd/specs/<name>/spec.md

The mode files' Rule 1 instructs the AI to read these files if the human hasn't already loaded them.

Spec Lifecycle State

Tracked in spec.md YAML frontmatter or plain text: draft | stable | deprecated. The specpact update <name> <status> command transitions this status.

No Automated Persistence

Unlike Smart Ralph's hooks or GSD's session state scripts, SpecPact has no automated context injection. All context loading is a human-manual step — which also makes it maximally portable across AI tools.

07

Orchestration

SpecPact — Orchestration

Multi-Agent

No. SpecPact is single-agent, single-session. No orchestration protocol.

Execution Mode

One-shot per spec. The user loads the mode file and spec into an AI session, the AI implements, the user runs specpact verify to get an audit prompt.

Multi-Model

No — framework-agnostic, but single model per session.

Isolation

None. Edits happen in-place. The framework relies on the AI following the scope boundary rule (Rule 3 in nano.md) rather than technical isolation.

Prompt Chaining

Minimal — the Memory Bank files provide context that feeds into the implementation session. There is no automated chaining; the human manages context loading.

Cross-Tool Portability

High — works with any AI tool that can read files. The mode files contain no tool-specific syntax.

08

Ui Cli Surface

SpecPact — UI / CLI Surface

CLI Binary

Yes — specpact binary (Node.js, cli/bin/):

Subcommand Description
init Initialize .sdd/ directory with prompts
new <mode> <name> Create new spec file
update <name> <status> Update spec status
list List all specs
verify <name> Generate audit prompt
upgrade Update CLI scripts without touching specs

Local UI

None. No web dashboard or TUI.

IDE Integration

Tool-agnostic. Works with any AI tool:

  • Claude Code: load mode file + spec into the session context
  • GitHub Copilot: same
  • Any AI reading files: same

Install Experience

Documented as "under 30 seconds":

npx specpact init

Answer four prompts (project name, type, language/stack, purpose). Done.

Observability

  • specpact list — shows all specs and their statuses
  • specpact verify <name> — generates a human-readable audit prompt for manual verification
  • No automated logging or monitoring

Related frameworks

same archetype · same primary tool · same memory type

MemPalace ★ 53k

Verbatim local-first AI memory with 96.6% R@5 retrieval on LongMemEval using zero API calls — structured into a palace hierarchy…

Beads (Yegge) ★ 24k

Dolt-powered distributed graph issue tracker where AI agents track tasks with hierarchical IDs and dependency edges, claim work…

deepagents (LangChain) ★ 23k

Opinionated Python agent harness on top of LangGraph with sub-agents, filesystem, memory, and context compaction bundled in

agentmemory ★ 18k

Persistent, searchable memory for AI coding agents that captures every tool interaction, compresses it via LLM, and injects…

Open Multi-Agent ★ 6.3k

Give a natural-language goal to a coordinator agent and get a dynamically decomposed, parallelized task DAG executed by…

Basic Memory ★ 3.1k

Gives AI agents a persistent, human-readable knowledge graph of project decisions, observations, and relations stored as plain…