← Agent workflows guides

How to use specs as agent memory

How-To Agent workflows Beginner 1041005HOWTO-1041005

HOWTO-1041005Agent workflowsBeginner

This guide shows you how to use SpecDD specs as durable project memory for agents and humans in a spec-driven development workflow.

SpecDD memory is not a hidden profile, private conversation, or hosted tool state. It is local, reviewable context in Git: .sdd specs, bootstrap files, tasks, scenarios, and completion criteria.

Short answer

Put durable decisions in specs, not prompts. Use local .sdd files for ownership, required behavior, boundaries, allowed files, references, tasks, and done criteria. Use prompts only to request the current action.

When to use this guide

Use this guide when:

What belongs in spec memory

Good SpecDD memory includes:

Avoid storing:

Steps

1. Identify repeated context

Look for instructions you keep giving agents:

If the instruction should remain true after the current chat ends, it probably belongs in a spec or bootstrap file.

2. Put local behavior beside the work

For a local feature:

src/trips/itinerary.js
src/trips/itinerary.sdd

Write the durable contract:

Spec: Itinerary

Purpose:
  Keep a trip itinerary organized by day.

Owns:
  ./itinerary.js
  ./itinerary.test.js

Must:
  Itinerary items remain grouped by trip day.
  Missing place names are rejected before an itinerary item is stored.

Must not:
  Change destination search behavior.

Now the next agent session can find the same rule without inheriting your previous chat.

3. Separate project conventions from local specs

Put shared conventions in:

.specdd/bootstrap.project.md

Examples:

Keep local .sdd specs focused on behavior, ownership, boundaries, local tasks, and local completion.

4. Use References for external context

If one area needs another area’s contract, reference it:

References:
  ../storage/trip-storage.sdd

The reference gives the agent memory of the related contract. It does not grant permission to edit the referenced area.

5. Capture active work with Tasks

Use tasks for local work packets:

Tasks:
  [ ] Add missing-place validation.
  [?] Decide whether duplicate places are allowed on the same day.

Task states preserve work status across sessions. Mark [x] only after implementation and checks are complete. Use [?] when a decision is needed before implementation can continue.

6. Update memory when new context is approved

When an agent discovers missing context, do not leave it in the final chat report. Add the approved rule to the relevant spec.

Use:

Propose an Itinerary spec update for duplicate-place behavior.

After review:

Update the Itinerary spec with the approved duplicate-place rule.

Then implementation can proceed from the updated contract.

SpecDD pattern

This pattern uses:

Common mistakes

How to verify the result

Specs are working as agent memory when:

← Agent workflows guides