← Work with SpecDD skills guides

How to generate docs from specs (specdd-docs)

How-To Work with SpecDD skills Intermediate 1091006HOWTO-1091006

HOWTO-1091006Work with SpecDD skillsIntermediate

This guide shows you how to use specdd-docs to generate or update documentation from SpecDD specs in a spec-driven development workflow.

Docs explain the contract. They do not create new behavior, permissions, guarantees, or workflows that the specs and implementation do not support.

Short answer

Use specdd-docs when an agent should write or update user or developer documentation from active SpecDD contracts. The agent should identify the documentation authority, resolve the relevant spec chain, explain specified behavior without expanding it, preserve important Must not and operational constraints, and report any behavior that remains underspecified.

When to use this guide

Use this guide when:

Steps

1. Choose the documentation target

Use a focused prompt:

Document the Itinerary validation behavior.

or:

Update the Itinerary developer docs.

The target can be user documentation, developer documentation, a runbook, a README section, or another documentation file governed by the project.

2. Resolve the governing specs

The agent should identify:

Documentation claims should come from specs and implementation, not from a CLI summary alone.

3. Explain behavior without expanding it

If the spec says:

Must:
  Reject itinerary items without a place name.

The docs can say that a place name is required. They should not add unsupported claims such as “all itinerary fields are validated automatically” unless the active specs and implementation support that.

4. Preserve constraints that affect users

Some constraints belong in user-facing or developer-facing docs because they affect safe use.

Examples:

Must not:
  Change destination search behavior.

Forbids:
  Direct booking API access from itinerary behavior.

Developer docs may need to explain that itinerary validation does not own destination search or booking access. Do not soften those boundaries into vague wording.

5. Keep docs aligned with tasks and tests

If a task is still open, docs should not describe the behavior as complete unless the documentation is explicitly about planned work.

If Done when or scenarios exist, use them to check whether the docs match verified behavior:

Done when:
  Missing-place behavior is covered by a check.

Docs should not outrun implementation and verification.

6. Report underspecified behavior

If docs need to explain a behavior the specs do not define, the agent should report the gap instead of inventing a rule.

Use a follow-up prompt when a spec needs to change:

Revise the Itinerary validation spec.

Then update docs after the spec is reviewed.

Example

Spec:

Spec: Itinerary

Must:
  Reject itinerary items without a place name.

Must not:
  Change destination search behavior.

Developer doc:

Itinerary validation requires a place name before an item is stored. This validation is local to itinerary behavior;
destination search behavior is outside this module.

The doc explains the contract without adding new requirements.

Common mistakes

How to verify the result

The docs workflow worked when:

← Work with SpecDD skills guides