liveBook · Manning

Context

As explained in Spec-Driven Development

Information supplied to an AI coding agent to guide its understanding and work.

Context is the information an AI coding agent needs to make a particular change in line with its purpose. Intent—what outcome is wanted and why—starts the selection process, but is not the whole context. Relevant domain rules, technical constraints, decisions, and verification criteria complete it. More information is not automatically better: an entire codebase or policy collection can consume the agent’s limited context window while obscuring the decisions that matter. section 1.1.2 section 1.3

Put guidance where its scope belongs:

  • Keep the user need, feature-specific rule, boundary, and demonstration of success in the feature specification. section 3.3
  • Keep recurring stack choices, conventions, business rules, and architectural constraints in standing context, so they need not be restated for every feature. section 3.3.1 section 4.2.1
  • Move practices shared across projects into reusable skills rather than copying them into every project’s guidance. Add new standing rules as repeated experience justifies them. section 4.2.5 section 4.3.4
Listing 2.6 Example openspec config.yaml for URL Shortener
schema: spec-driven
context: |
  Tech stack: Node.js
  Domain: URL shortener
  Conventions: Simple, dependency-free, and use built-in modules.

A small project configuration shows context made persistent: the URL shortener’s domain, Node.js stack, and dependency-free convention are supplied at the start of each agent session. section 2.4.3

A missing rule in an expiring-link change

Suppose issued shortcodes must never be reassigned. While links remain permanently stored, the database design may enforce that rule without explicit code. If an agent is asked directly to add link expiration using only the implementation as context, it may miss the reassignment ban. Revise the specification before regenerating the change; a direct fix would leave the decision in code or conversation history instead of durable context. section 3.1 section 3.1.2

Treat context as a maintained engineering artifact, not a large prompt assembled once. Extract important decisions before conversation compaction can lose them, make them available when needed, and use implementation gaps to find what the specification or workflow failed to carry. This lets later sessions work from recorded intent rather than reconstructing it from old exchanges. section 1.3 section 3.4

How Spec-Driven Development covers it

How deep it goes
Explains selection, placement, persistence, and revision of context, including context-window limits; does not prescribe a universal context template.
Examples
Uses URL-shortener project configuration, recurring business rules, and an expiration change that risks losing a shortcode reassignment ban.
What it assumes
Assumes familiarity with coding agents and software changes while defining context engineering and allowing standing guidance to grow from initial feature work.
What you can do after
Operate/configure it through OpenSpec config.yaml or SpecKit constitution.md to supply recurring guidance to future agent sessions.
How it connects
Connects intent articulation, feature specifications, standing context, reusable skills, context windows, and specification governance.

Also explained in

Compare how 30 books explain context →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spec-Driven Development. The section links point to the parts of the book it draws on.