DocumentationPublishingAutomation

Auto-Generate Product Documentation from Your Specs

How Intent turns your product specs into published documentation — API references, data models, and architecture guides — without extra work.

Intent Team8 min read

Every engineering team has a documentation problem. It is not that nobody wants to write docs. It is that by the time someone does, the code has already moved on. The API endpoint changed. A field was renamed. A new parameter was added. The docs say one thing and the code does another.

This is the documentation drift problem, and it has been around for as long as software teams have existed. The typical response is to add "update docs" to every pull request checklist, hire a technical writer, or adopt a docs-as-code workflow. These help, but they all share the same flaw: documentation is treated as a separate artifact that needs its own maintenance cycle.

What if documentation was not a separate thing you maintained, but a byproduct of the design work you are already doing?

The Real Cost of Stale Documentation

Before getting into the solution, it is worth understanding what stale docs actually cost a team.

When a new engineer joins and follows the API docs to integrate a service, only to discover the response format changed three months ago, that is lost time. When a partner team builds against your documented data model and their integration breaks because a field was renamed, that is lost trust. When a product manager shares architecture docs with a stakeholder and the information is outdated, that is lost credibility.

The cost compounds. Teams stop trusting the docs. They go straight to the code. They ping engineers on Slack. Knowledge becomes tribal again, trapped in the heads of the people who wrote the code most recently. Documentation becomes a formality that nobody reads because nobody trusts it.

Docs as a Byproduct of Design

Intent takes a different approach. Instead of treating documentation as something you write after building, it generates documentation directly from your product specs.

The logic is straightforward. When you design a product in Intent, you are already defining the things that documentation needs to describe: API endpoints, data models, logic flows, architecture decisions. These are not vague notes. They are structured, typed, and connected to each other. That is exactly the kind of information that makes good documentation.

So instead of asking you to write the same information twice, once in a spec and once in a doc, Intent uses the spec as the single source of truth and renders documentation from it.

What You Can Auto-Generate

Intent can produce several types of documentation directly from your specs.

API Reference Documentation

If your spec defines API endpoints, Intent generates a complete API reference. Each endpoint gets its own entry with the HTTP method, path, description, request parameters, request body schema, response schema, and status codes.

Here is what a spec definition for an endpoint might look like:

endpoints:
  - method: POST
    path: /api/v1/projects/{project_id}/specs
    description: Create a new specification within a project
    parameters:
      - name: project_id
        in: path
        type: string
        required: true
    request_body:
      content_type: application/json
      schema:
        title: string (required)
        description: string (optional)
        type: enum[feature, api, data_model]
    responses:
      201:
        description: Specification created successfully
        schema: Specification
      400:
        description: Validation error
      404:
        description: Project not found

From this, Intent generates a fully rendered API reference page with a clean layout, type annotations, and example request/response bodies. No Swagger annotations. No JSDoc comments. No separate OpenAPI file to maintain.

Data Model Documentation

Data models defined in your spec become documented entities with field names, types, constraints, descriptions, and relationships to other models.

data_models:
  - name: Specification
    description: A product specification within a project
    fields:
      - name: id
        type: uuid
        description: Unique identifier
      - name: title
        type: string
        max_length: 255
        description: Human-readable title
      - name: status
        type: enum[draft, review, approved, archived]
        default: draft
        description: Current lifecycle status
      - name: project_id
        type: uuid
        foreign_key: Project.id
        description: Parent project reference
      - name: created_at
        type: datetime
        description: Creation timestamp

The generated docs show each model as a table with types and constraints, plus a visual or textual representation of how models relate to each other. If Specification references Project, that relationship is documented automatically.

Architecture Overview

When your spec includes system architecture information, like service boundaries, data flow descriptions, or integration points, Intent generates an architecture overview page. This gives stakeholders a high-level view of how the system is structured without requiring them to read code or chase down engineers.

How Published Docs Work

The publishing pipeline in Intent follows a clear path: specs to structured data to rendered documentation.

Step 1: Spec as Structured Data

When you build a spec in Intent, you are not writing freeform text. You are filling in structured fields: endpoints with typed parameters, data models with defined relationships, logic flows with conditions and outcomes. This structure is what makes generation possible.

Step 2: Extraction and Organization

When you publish, Intent extracts the relevant sections from your spec and organizes them into documentation categories. API endpoints go into the API reference. Data models go into the data model reference. Architecture notes go into the architecture overview.

Step 3: Rendering

The extracted data is rendered into clean, readable documentation pages. Each page follows consistent formatting with navigation, type annotations, and cross-references between related items.

In your project, the publishing flow looks like this:

// Publishing is triggered from the spec workspace
// The spec data is already structured — no conversion needed

const publishConfig = {
  sections: ["api-reference", "data-models", "architecture"],
  visibility: "public",  // or "team" for internal docs
  customDomain: "docs.yourapp.com",  // optional
};

The result is a hosted documentation site with a URL you can share. No static site generator to configure. No CI pipeline to maintain. No deploy step to remember.

Keeping Docs and Specs in Sync

The key advantage of this approach is that sync is automatic. When you update a spec, the published docs reflect the change. There is no separate update step because the docs are derived from the spec, not maintained alongside it.

This eliminates an entire category of bugs:

  • API docs showing old response format: Cannot happen. The response format in the docs comes directly from the spec definition.
  • Data model docs missing a new field: Cannot happen. The field list comes directly from the model definition in your spec.
  • Architecture docs describing a removed service: Cannot happen. If you remove it from the spec, it disappears from the docs.

The mental model shift is important. You are not maintaining documentation. You are maintaining your spec, and documentation is a view of that spec.

Sharing Docs with Stakeholders

Published docs in Intent are shareable via URL. This matters because different audiences need documentation for different reasons.

Frontend engineers need the API reference to know what endpoints are available, what parameters they accept, and what responses they return.

Partner teams need data model documentation to understand your domain and how their systems should integrate with yours.

Product stakeholders need architecture overviews to understand the system they are funding and the technical decisions behind it.

New team members need all of the above to get up to speed without scheduling a dozen knowledge transfer meetings.

Each of these audiences can get a link to the relevant section. The docs are always current because they come from the spec that the team is actively working with.

Practical Walkthrough

Here is a realistic walkthrough of how this works in practice.

1. Define Your Spec

You create a spec for a new feature, say a notification system. In the spec, you define the endpoints, data models, and logic flows:

# Notification system spec (simplified)
endpoints:
  - method: GET
    path: /api/v1/notifications
    description: List notifications for the current user
    parameters:
      - name: unread_only
        in: query
        type: boolean
        default: false
    responses:
      200:
        schema: NotificationList

  - method: PATCH
    path: /api/v1/notifications/{id}/read
    description: Mark a notification as read
    responses:
      200:
        schema: Notification

data_models:
  - name: Notification
    fields:
      - name: id
        type: uuid
      - name: user_id
        type: uuid
        foreign_key: User.id
      - name: type
        type: enum[mention, assignment, update, comment]
      - name: message
        type: string
      - name: read
        type: boolean
        default: false
      - name: created_at
        type: datetime

2. Publish

From the spec workspace, you open the publishing panel and select which sections to include. You click publish.

3. Share

You now have a URL like docs.yourapp.com/notifications with a fully rendered API reference showing the GET /notifications and PATCH /notifications/{id}/read endpoints, plus a data model reference showing the Notification schema with all its fields and types.

4. Update

Two weeks later, you add a priority field to the notification model and a new DELETE /notifications/{id} endpoint. You update the spec. The published docs update automatically. Nobody had to remember to update a separate docs file.

What This Does Not Replace

To be clear about scope: auto-generated docs from specs cover the structural, reference-style documentation that describes what your system is and how it works. They do not replace:

  • Tutorials and guides: Step-by-step walkthroughs that teach someone how to accomplish a task still need to be written by a human who understands the user's journey.
  • Conceptual explanations: "Why we chose this architecture" or "How our auth model works" require narrative writing that goes beyond what a spec contains.
  • Runbooks and operational docs: Deployment procedures, incident response guides, and monitoring setup are operational concerns outside the spec.

The goal is not to automate all documentation. It is to automate the documentation that goes stale fastest, which is the reference documentation tied directly to your system's structure. That frees up your team's writing time for the docs that actually need a human touch.

The Bigger Picture

Documentation is often framed as a discipline problem: teams just need to be more disciplined about keeping docs updated. But that framing ignores the structural issue. When documentation is a separate artifact from the source of truth, keeping it in sync requires ongoing effort that competes with every other priority.

The better approach is to eliminate the gap between the source of truth and the documentation. When your spec is your source of truth and your docs are a rendered view of that spec, the sync problem goes away.

This is what Intent's published docs feature does. Not by adding another tool to your workflow, but by making documentation a natural output of the design work you are already doing.

Related articles

Ready to write specs that actually work?

Intent helps you structure product ideas, generate visual previews, and export specs your dev team and AI tools can use immediately.

Start free trial

7-day trial · Full access · Cancel anytime