Skip to main content
Beta

AI Foundry is in beta. We are actively shaping the product, so things may change as we iterate. Your feedback is welcome.

Spec Templates

A Spec Template is a catalog resource that stores a structured or free-form specification document.

The command-driven authoring mode supports Spec-Driven Development: a workflow in which AI agents move through structured phases — from requirement definition and clarification through planning, task breakdown, and implementation. A Spec Template bound to a command supplies the template content injected when that phase is invoked by an agent.

AI Foundry Spec Templates

When to use a Spec Template

Spec Templates are appropriate when you need an agent to have access to:

  • API contracts (OpenAPI / AsyncAPI documents, GraphQL schemas) so the agent can construct valid requests.
  • Domain glossaries that define the precise meaning of business terms the agent must reason about.
  • Policy documents that the agent must follow (acceptable-use policies, compliance rules, coding standards).
  • Data schemas that describe the structure of inputs or outputs the agent processes.
  • Architecture references used by agents that assist with software design or code generation.

Spec Template commands

Spec-Driven Development organises work into a sequence of structured phases, each invoked by a slash command. When a Spec is used as a template, its command field binds it to one of these phases so the template content is injected when that command is triggered.

The following commands are supported:

CommandPurpose
/spec.constitutionEstablish project principles and coding guidelines
/spec.specifyWrite a detailed feature specification
/spec.clarifyGenerate targeted clarifying questions before writing a spec
/spec.planProduce a technical architecture plan from a spec
/spec.tasksBreak a plan into an ordered, atomic task list
/spec.analyzeAnalyze existing code for patterns and anti-patterns
/spec.checklistRun a pre-build readiness check on a spec or plan
/spec.implementImplement a specific task from the task list
/spec.memoryUpdate the persistent project memory with finalized decisions

Spec Template reference

FieldRequiredDescription
TitleYesDisplay name shown in the UI.
NameYesUnique identifier. Referenced in Playbook.spec.specs and Playbook.spec.flow.nodes[].specs.
DescriptionYesShort description of what the document covers.
CommandYesThe command identifier that triggers this spec template.
TemplateYesMarkdown template produced or followed by the command.

Specs vs. Prompts

AspectSpecPrompt
Typical sizeMedium to large (full documents)Short to medium (focused instructions)
Content typeReference material, schemas, policiesInstructions, templates, few-shot examples
AuthorshipDomain experts, architects, legalPrompt engineers, product managers
RenderingMarkdown in the detail viewMarkdown with preview/source toggle

In practice the two complement each other: a playbook node might receive a Prompt that says "classify the request according to the taxonomy defined in spec X", with the Spec holding the full taxonomy document.

See also

  • Playbook: references specs at the playbook and node level.
  • Prompt: shorter, instruction-oriented text resources.