Canonical page: https://drawfather.com/docs/documentation-workflow/

# Maintain diagrams beside your documentation

Keep the `.drawfather` source and exported images in your repository. Link the image from Markdown. Use a project manifest when you need to declare source files, output paths and documentation links in one place.

## Use the hosted beta with your docs

Ask your agent to create or revise a diagram, then retrieve its `.drawfather` source and exported images through the authenticated MCP connection. Have the agent save those copies into your repository and update the Markdown link. Confirm that the files exist locally before committing them.

The hosted server cannot see your local checkout by itself. Dedicated remote Git input is still in development. The manifest and CLI workflows below run locally or on your own host; they are not a promise of complete hosted Git integration.

## Store the source and delivery paths

A minimal project manifest declares one drawing and one SVG output. Paths are relative to the manifest directory.

```json
{
  "type": "drawfather-project",
  "version": 1,
  "diagrams": [{
    "id": "system",
    "source": "docs/diagrams/system.drawfather",
    "outputs": [{
      "path": "docs/assets/system.svg",
      "format": "svg"
    }]
  }]
}
```

The source must already exist. Author it through the MCP tools with the server’s drawing directory configured to the source folder. Save this manifest as `drawfather.project.json` in the repository you want to manage.

## Render and check from the CLI

Use the absolute path to your built DrawFather CLI while working in the documentation repository:

```sh
node /absolute/path/DrawFather/dist/cli.js render --manifest drawfather.project.json
node /absolute/path/DrawFather/dist/cli.js check --manifest drawfather.project.json
```

Rendering writes the declared outputs and build receipt. Checking re-renders the expected bytes and compares the actual files. Commit the native drawing, manifest, generated assets and `drawfather.lock.json` together.

Stable filenames keep existing Markdown image URLs useful across revisions. Optional revisioned exports also identify the native source revision; Git retains earlier artifact versions.

## Connect the diagram to Markdown

Manifest documentation entries can declare an existing Markdown file, a managed output, alt text and a caption. The explicit `--write-docs` option inserts or updates the matching managed block while retaining unrelated prose. Existing image/source links can instead be checked with `managed: false`.

The [runnable repository example](https://github.com/its-imad/DrawFather/tree/main/examples/project) includes a README, architecture document, onboarding page and ADR, with a [CI recipe](https://github.com/its-imad/DrawFather/blob/main/examples/project/github-actions.yml). The [project contract](https://github.com/its-imad/DrawFather/blob/main/schema/PROJECT.md) defines the full manifest and command behavior.

## Review code changes honestly

Declared source references can flag diagrams affected by a code change. They are review hints, not an automatic reconstruction of your architecture. Rendering fresh image bytes does not acknowledge that a changed function is still described correctly.

Use the affected/diff workflow, inspect the relevant native drawing and code, and explicitly acknowledge a relationship only after review. Do not clear review status just to make a CI job green.

## Check appearance before committing

Ask the agent to run visual diagnostics and inspect the exported result. The checks cover supported overlaps, text and connector problems. Bounded repair previews a proposal before application and keeps unaffected geometry, pins and annotations where its contract requires.

The image can still contain an incorrect explanation even when its geometry passes. Human and agent review remain part of the workflow. See [native source and revisions](https://drawfather.com/docs/file-format/) and [supported diagram families](https://drawfather.com/docs/diagram-types/).
