Examples
These examples show current DiagramPilot Source File patterns for common software architecture diagrams. Use committed examples when you want a richer reference, and use Source Creation templates when you want a small maintained starting point.
Maintained Templates
Section titled “Maintained Templates”diagrampilot create docs/architecture.dp.yaml --template architecturediagrampilot create docs/login-flow.dp.yaml --template flowdiagrampilot create docs/packages.dp.yaml --template package-mapdiagrampilot create docs/system-context.dp.yaml --template system-contextdiagrampilot create docs/service-map.dp.yaml --template service-mapEach command writes a valid *.dp.yaml file, refuses to overwrite an existing
file, and prints the next validate and render commands.
Committed Example Sources
Section titled “Committed Example Sources”Codebase Architecture
Section titled “Codebase Architecture”Path: examples/codebase-architecture/codebase-architecture.dp.yaml
diagrampilot validate examples/codebase-architecture/codebase-architecture.dp.yamldiagrampilot render examples/codebase-architecture/codebase-architecture.dp.yaml --out examples/codebase-architecture/codebase-architecture.svgdiagrampilot export examples/codebase-architecture/codebase-architecture.dp.yaml --format mermaiddiagrampilot check examples/codebase-architectureUse this when a repository needs a compact architecture view with Stable IDs, Groups, local source metadata, and labeled request/write/event edges.
Dependency Map
Section titled “Dependency Map”Path: examples/dependency-map/dependency-map.dp.yaml
diagrampilot validate examples/dependency-map/dependency-map.dp.yamldiagrampilot render examples/dependency-map/dependency-map.dp.yaml --out examples/dependency-map/dependency-map.svgdiagrampilot export examples/dependency-map/dependency-map.dp.yaml --format mermaiddiagrampilot check examples/dependency-mapUse this for package dependency diagrams such as packages/cli,
packages/core, packages/render-svg, packages/export-mermaid,
packages/export-d2, packages/export-dot, and packages/icons.
Service Boundary Map
Section titled “Service Boundary Map”Path: examples/service-boundary-map/service-boundary-map.dp.yaml
diagrampilot validate examples/service-boundary-map/service-boundary-map.dp.yamldiagrampilot render examples/service-boundary-map/service-boundary-map.dp.yaml --out examples/service-boundary-map/service-boundary-map.svgdiagrampilot export examples/service-boundary-map/service-boundary-map.dp.yaml --format mermaiddiagrampilot check examples/service-boundary-mapUse this to review public, platform, and data boundaries without adding per-object styling fields to DiagramSpec.
Monorepo Overview
Section titled “Monorepo Overview”Path: examples/monorepo-overview/monorepo-overview.dp.yaml
diagrampilot validate examples/monorepo-overview/monorepo-overview.dp.yamldiagrampilot render examples/monorepo-overview/monorepo-overview.dp.yaml --out examples/monorepo-overview/monorepo-overview.svgdiagrampilot export examples/monorepo-overview/monorepo-overview.dp.yaml --format mermaiddiagrampilot export examples/monorepo-overview/monorepo-overview.dp.yaml --format d2 --out examples/monorepo-overview/monorepo-overview.d2diagrampilot export examples/monorepo-overview/monorepo-overview.dp.yaml --format dot --out examples/monorepo-overview/monorepo-overview.dotdiagrampilot check examples/monorepo-overviewThis is the medium-complexity example. It demonstrates Stable IDs, Groups,
edge labels and edge kinds, local source references, export workflow commands,
and SVG Artifact Freshness. Run render --out before check; generated SVG
artifacts include deterministic DiagramPilot provenance with source path,
source hash, DiagramPilot version, and renderer identity.
Pull Request Architecture Review
Section titled “Pull Request Architecture Review”Path: examples/pull-request-architecture-review/pull-request-architecture-review.dp.yaml
diagrampilot validate examples/pull-request-architecture-review/pull-request-architecture-review.dp.yamldiagrampilot render examples/pull-request-architecture-review/pull-request-architecture-review.dp.yaml --out examples/pull-request-architecture-review/pull-request-architecture-review.svgdiagrampilot export examples/pull-request-architecture-review/pull-request-architecture-review.dp.yaml --format mermaiddiagrampilot check examples/pull-request-architecture-reviewUse this to show how a pull request can review changed source files, DiagramPilot Source Files, Derived Artifacts, and repo workflow checks together.
System Context Diagram
Section titled “System Context Diagram”Path: examples/system-context/system-context.dp.yaml
diagrampilot validate examples/system-context/system-context.dp.yamldiagrampilot render examples/system-context/system-context.dp.yaml --out examples/system-context/system-context.svgdiagrampilot export examples/system-context/system-context.dp.yaml --format mermaiddiagrampilot check examples/system-contextUse this for a C4-style context view of an AI coding agent, local repository, DiagramPilot CLI, public docs, and pull request review.
Intentionally Broken Repair Example
Section titled “Intentionally Broken Repair Example”This broken source is for repair practice. Do not commit it as a passing
fixture. Save it temporarily as docs/broken-architecture.dp.yaml, then run:
diagrampilot validate docs/broken-architecture.dp.yamlversion: 1title: Broken Architecturenodes: - id: web_app label: Web App - id: api_gateway label: API Gatewayedges: - id: web_app_to_missing_service from: web_app to: missing_service label: HTTPSExpected diagnostic shape:
edges[0].to references unknown node "missing_service".Suggestion: Add a node with id "missing_service" or change edges[0].to to an existing node ID.Repair by changing edges[0].to from missing_service to api_gateway, then
rerun diagrampilot validate docs/broken-architecture.dp.yaml.
Small Inline Style Reference
Section titled “Small Inline Style Reference”version: 1title: Minimal Package Dependencydirection: rightnodes: - id: cli label: packages/cli kind: package icon: lucide:terminal - id: core label: packages/core kind: package icon: lucide:boxedges: - id: cli_to_core from: cli to: core label: validates source kind: imports