Skip to main content
Research Note8 min read

From Prompts to Project Memory: Spec-Driven Development for Coding Agents

A repository-grounded look at using version-controlled specs, decisions, and project rules as durable memory for coding agents across long-running software work.

  • #coding-agents
  • #context-engineering
  • #specifications
  • #software-architecture

Reading depth

Make the correction recoverable

A homepage once described my experience as including “design systems,” a broader claim than the evidence established. Correcting the sentence fixed the visible output. Recording that boundary in the repository gave later work somewhere durable to find it.

A correction needs an address—and a caretaker

Overview · unnumbered

Conversation

The correction is clear now

A claim is narrowed, a requirement changes, or a trade-off is settled.

The next session may not inherit the exchange.

Durable, scoped addresses

Record intent; inspect evidence

Memory: constitution · specification · plan · tasks · decision record

Evidence: implementation · tests

Each answers a different question. No universal precedence is implied.

Later task

Route, inspect, reconcile

Select relevant records, inspect implementation evidence, expose disagreement, and maintain each owner.

Selection is explicit today—not an automated relevance engine.

Addressable ≠ authoritative

Persistent ≠ current

Selected ≠ understood

Project memory improves recoverability; implementation and tests provide adjacent evidence of what exists and what was checked. None is automatically correct, current, universally authoritative, or read by every agent.

Store decisions at the scope they govern

Project memory preserves project-wide constraints, feature requirements, implementation plans, task state, and decision rationale. Code and tests are adjacent implementation and verification evidence: related, durable, and necessary to inspect, but not interchangeable with records of intent. A thin AGENTS.md can route a person or agent toward the relevant records and evidence instead of accumulating every rule in one prompt. When they disagree, the conflict is evidence to investigate—not a reason to silently pick a winner.

Persistence creates maintenance work

A durable record can still be wrong, stale, noisy, or misread. Requirements should change with their owning intent and rationale, then implementation still needs verification. The repository in this study even preserves an unresolved disagreement between earlier deployment rationale and current operating guidance: version control makes the drift visible; it does not reconcile it.

The next problem is relevance

Once decisions persist, later work still has to find the right subset without hiding conflicts or loading the whole archive. Selection here is explicit and human-authored. A Repository Context Engine is an unpublished direction for future research, not a capability this project has today.

Continue for the incident evidence, artifact authority, routing workflow, publication-gating example, requirement maintenance, and documented drift.

Here, spec-driven names a repository practice in which specifications own product requirements within a broader authority-by-concern system. It does not make a specification universally authoritative: constitutions preserve project-wide constraints, ADRs preserve rationale, plans and tasks preserve approach and execution state, code shows implementation, and tests show what was checked.

Version control gives consequential decisions an address a later agent can recover. It does not make those decisions correct or current. The agent still has to find the relevant records, interpret them against the task, inspect the implementation, and verify the resulting behavior.

The Claim Came Back

A sentence on my homepage once claimed:

“15+ years of experience designing scalable web architectures, design systems, and enterprise platforms.”

It sounded credible. It was also broader than the evidence I had established.

What I could support was substantial experience with reusable UI components, component architecture, frontend patterns and systems, UI architecture, and engineering standards. Formal design-system ownership was different, and the repository did not establish it.

I treat that mistake as a context-persistence failure. A distinction we had already made did not survive into a later piece of generated copy.

Correcting the sentence fixed the page. Recording the constraint in the repository gave the same mistake a durable address a later agent could recover before repeating it.

Figure 01

The claim and its two durable addresses

Observed account + repository evidence

01 · Author’s observed account

“15+ years of experience designing scalable web architectures, design systems, and enterprise platforms.”

The article reports that this unsupported wording appeared and was corrected.

02 · Reported corrective actionOutput corrected

03 · What the branch directly shows

The constraint was recorded at project and product scope.

.specify/memory/constitution.md

Do not describe the experience as “design systems” unless explicitly established.

specs/001-site-foundation/spec.md

Use grounded positioning; do not claim formal design-system ownership.

The branch corroborates the durable result—not necessarily every step or the complete chronology.

The correction now has two durable addresses at different scopes. That gives later work two places to catch a recurrence; it does not stop one from happening.

That second fix is the subject of this article.

Conversation Context Is Not Project Memory

Conversation remains useful for the work in front of us: goals, tradeoffs, corrections, and discoveries.

The problem is that a later session, agent, or tool cannot be assumed to inherit all of it. A new session may see the repository without the discussion that produced its current decisions.

In this repository, the durable substrate is version-controlled project memory: a small set of artifacts that record constraints, requirements, implementation intent, execution state, and decision rationale at different scopes.

Code and tests are adjacent implementation and verification evidence. They are durable and necessary to inspect, but they are not interchangeable with records of intent.

This does not make an agent correct. It gives the next agent something more stable than recollection to inspect, challenge, and follow.

A project should not depend on one conversation remaining available forever.

Figure 02

A session ends; the repository remains

Editorial model · repository pattern

Working context

Session 01 · decision made

Session 02 · prior chat unavailable

Session 03 · task continues

Goals, corrections, and trade-offs are useful while they are visible.

Durable project memory

An address for the next task

constitution · specplan · tasksdecision recordsmaintained guidance

These records preserve intent, requirements, rationale, constraints, and execution state.

Adjacent evidence · code shows implementation · tests show what was checked

This is a continuity model, not a claim that every agent reads these files or that a repository rule guarantees correct behavior. Persistence improves recoverability, not correctness.

What Became Durable

The wording incident eventually produced two durable guardrails at different scopes.

The project constitution now says not to describe my professional experience as design systems unless that experience is explicitly established. It gives grounded alternatives such as reusable UI components, component architecture, frontend patterns and systems, UI architecture, and engineering standards.

The site-foundation specification carries the same positioning constraint inside the requirements for the site itself.

That duplication is deliberate because the artifacts answer different questions.

The constitution establishes a project-wide invariant. The site specification narrows that invariant into the requirements of this product.

The important change is not that a correction exists somewhere in the repository. It is that the correction now has an address that later work can recover.

A Small Authority Model for Project Memory and Evidence

Project memory records and implementation evidence are related but not interchangeable. Each answers a different question.

Constitution — What must remain true across the project?

Feature specification — What behavior or outcome is required in this scope?

Plan — How does the repository intend to implement that requirement?

Tasks — What work remains or has been completed in the current execution sequence?

ADR / decision record — Why was a consequential product or architectural choice made?

Code and tests (adjacent evidence) — What has been implemented, and what behavior has been checked?

Figure 03

Authority depends on the question

Interpretive model grounded in repository roles

01ConstitutionWhat must remain true?Project-wideStated invariant
02Feature specificationWhat is required here?FeatureIntended behavior
03PlanHow is it intended to be built?Implementation approachStrategy
04TasksWhat remains or is complete?Current executionRecorded state
05ADRWhy was this choice made?DecisionRationale
06Code + testsWhat exists; what was checked?Behavior / checksImplementation / verification

No single artifact answers every concern.

When artifacts diverge, expose the conflict rather than flatten it.

This is an editorial interpretation of the repository’s artifact roles, not a claim that the repository contains an automatic precedence engine.

The first five preserve intent, requirements, rationale, constraints, or execution state. Code and tests provide adjacent implementation and verification evidence; selecting them does not turn them into records of intent.

That separation matters when sources disagree. Durability alone does not make an artifact authoritative for every concern.

A requirement can outlive a particular implementation strategy. Code can reveal that an old plan was never completed. A decision record can preserve useful reasoning while its operational details become stale. When artifacts diverge, the conflict has to be exposed rather than silently flattened into one story.

The Agent Entry Point: Route, Then Narrow

AGENTS.md stays deliberately thin. Its job is to route an agent into the repository’s existing memory:

AGENTS.mdSource excerpt
1. Read the constitution.
2. Consult the relevant feature specification.
3. Review the plan and tasks.
4. Consult ADRs before structural changes.
5. Never fabricate content.
6. Update durable specs when requirements change.

It is a routing layer, not a mega-prompt.

Routing can bring both project memory and adjacent implementation evidence into the task. Selecting code or tests does not turn them into records of intent; it makes comparison possible.

The point is not to load every artifact into every task. Start with the records and implementation surfaces the task makes relevant; follow their references and disagreements when that first selection is not enough. The aim is a bounded, inspectable selection—not a claim that the repository can identify a uniquely minimal context.

A positioning change begins with project-wide factual guardrails and the site-foundation specification. A publication change narrows into the publication-gating specification and its related decisions. Only then does the agent need the implementation surfaces that realize those requirements.

Today, that routing is mostly explicit and human-authored. The repository does not contain an automated relevance engine.

Figure 04

Route, then narrow

Current human-authored workflow

TaskChange publication behavior

The task supplies scope—not every document in the repository.

AGENTS.md

Read the constitution, relevant spec, plan/tasks, and ADRs; do not fabricate; update durable requirements when they change.

Explicit routing
Selected context
  1. 01Project-wide factual guardrails
  2. 02Publication-gating specification and decisions
  3. 03Relevant implementation surfaces

Selected by explicit task scope and maintained instructions—not an automated relevance system.

A human-authored entry point and task scope guide selection; the repository does not detect relevance automatically. Other project memory remains available for other work.

This is context selection rather than context accumulation.

Worked Example: Publication Gating

Publication gating makes the pattern more concrete because the same concern exists at several layers.

The feature specification says new Research and Project entries must fail closed until deliberately published. The content schema implements part of that rule directly:

published: z.boolean().default(false)

The specification then defines what unpublished state means across public listings, detail pages, indexing, RSS, and local preview behavior. The publication-gating decision record preserves why publication state is separate from lifecycle status.

Figure 05

One concern, four forms of evidence

Direct repository evidence

  1. Requirementspecs/003-content-publication-gating/spec.md

    New entries fail closed until deliberately published.

  2. Defaultsrc/content.config.ts

    published: z.boolean().default(false)

  3. Route behaviorsrc/pages/research/[...slug].astro

    Detail behavior distinguishes publication state; unpublished body preview requires DEV + content-preview mode.

  4. Feed behaviorsrc/pages/rss.xml.ts

    The collection query returns only data.published entries.

Adjacent rationalePublication-gating ADR

Preserves why publication state remains separate from lifecycle status.

Related decision evidence · not an interchangeable fifth implementation checkpoint
The spec defines intended behavior, while the schema, route, and feed show separate implementation surfaces. This is not an exhaustive proof that every gating requirement is met.

Those are different forms of evidence.

The specification establishes intended behavior. The schema establishes one implementation default. The route and feed implementations expose additional implementation surfaces. The figure samples that chain; it does not certify every publication-gating acceptance criterion.

That distinction prevents repository memory from becoming self-validating documentation. A requirement is not proof that the implementation satisfies it.

When the Requirement Changes

Durable memory only helps if the records that own a requirement change when the requirement changes.

The historical account for publication gating is that unpublished collection cards moved from non-clickable summaries to inline status interactions. The current branch records the resulting behavior across the feature specification, the publication-gating decision, the URL/SEO policy, and maintainer guidance in the README.

The current branch shows that these artifacts now describe the same interaction model. It does not, by itself, establish that every record changed in one atomic step.

The maintenance rule is a coordinated workflow across owning artifacts: update the durable records that own the changed requirement and rationale with the implementation, then verify what the implementation actually does. A specification is authoritative for the requirement within its concern, not a passing test; code shows what exists, but does not preserve every reason behind a choice.

Figure 06

A changed requirement has several homes

Repository history · publication gating

Behavior changed

Unpublished cards: from summaries to inline status interaction

The requirement is more than the card’s current appearance.

Owning intent and rationale

Requirement

specs/003-content-publication-gating/spec.md

Status-interactive unpublished cards

Decision

docs/decisions/004-content-publication-gating.md

Why the inline notice does not expose body content

Policy

docs/decisions/005-github-pages-seo-and-url-policy.md

Non-navigating status triggers and URL treatment

Guidance

README.md

Describes the resulting catalog behavior

Implementation

Code carries the resulting interaction and publication behavior.

Verification

Tests and review still compare behavior with the owning records.

Repository history supports the resulting records. It does not establish that every update happened atomically in one commit.

The branch history records updates to the spec, decision record, and SEO policy for the interactive-card change. This is a maintenance example, not a claim that documentation updates alone verify every behavior or always occur in one commit.

Durable Memory Can Drift Too

Version control preserves a record. It does not keep that record aligned with the system it describes.

The deployment documentation in this repository provides a useful example.

ADR 003 records an explicit manual publishing model centered on npm run live from main, and it says no repository-authored GitHub Actions workflow is required for that model.

Current AGENTS.md, however, documents three supported production paths: local npm run live, a GitHub Actions workflow, and a remote trigger branch. The repository now contains the workflow that the earlier ADR said was unnecessary.

Figure 07

Persistence without reconciliation

Observed repository inconsistency

Manual publishing model

Centers production publishing on npm run live from main and says a repository-authored Actions workflow is not required.

Divergence

Three supported paths

  1. 01Local npm run live
  2. 02GitHub Actions manual dispatch
  3. 03Remote trigger branch

Confirmed in AGENTS.md, README.md, and .github/workflows/deploy-production.yml

Preserved

Both accounts remain inspectable.

Not resolved

The repository does not automatically choose a winner.

Human action

Amend, supersede, or reconcile the record.

Version control makes drift visible; it does not perform maintenance. This figure does not assert that either artifact automatically outranks the other.

The important point is not which document should win automatically. The important point is that durable memory can preserve an earlier account after the operating model has changed.

That inconsistency is inspectable because both artifacts survive. It still requires someone to reconcile them.

Project memory therefore has a lifecycle: create it, scope it, consult it, update it, and retire or amend it when the system changes.

When a durable requirement changes, the artifact that owns that requirement should change with the implementation.

What This Does Not Solve

Version-controlled memory still has failure modes:

  • Wrong specs stay wrong. Durability does not make an assumption true.
  • Specs and ADRs can become stale. The deployment example above is evidence of that maintenance problem.
  • Agents can misread explicit context. Documentation reduces ambiguity; it does not eliminate interpretation errors.
  • Documentation can become noise. Overlapping or redundant artifacts make retrieval harder and can disagree.
  • Specifications do not replace tests. Requirements and passing behavior are different evidence.
  • Implementation evidence can be incomplete. Code shows what exists on inspected paths; tests show only what was checked.
  • Implementation does not explain every decision. Code can show what exists without preserving why a choice was made.
  • Human judgment remains necessary. Engineers still decide what becomes durable, which artifact owns a concern, and how conflicts are resolved.

The practical gain is narrower than determinism: consequential decisions have an address that later work can inspect. That creates an opportunity to catch a repeated mistake; it does not establish that the mistake will be caught or become less frequent.

The Next Problem Is Relevance

Once a project can remember, the next question is not how to accumulate more context.

It is how to select the context relevant to the task without hiding conflicts or overwhelming the agent.

An unpublished Repository Context Engine for Coding Agents concept explores that direction: task-aware selection of relevant specs, decisions, and repository patterns, plus explicit context delivery through MCP or another mechanism.

That is proposed work, not an implemented system.

For now, this repository supports a smaller conclusion: project memory becomes useful when it is scoped, inspectable, connected to implementation, and maintained as the system changes.

Research lineage

Where this argument came from and where it continues.

Led to
Context Engineering for Software DevelopmentUnpublished