# An architecture decision record

Generate an architecture decision record as Markdown in C# with context, alternatives, and consequences. Inspect the PDF and download the source.

Markdown · C# walkthrough

Create a decision record that works naturally in version control. The example preserves the context, chosen approach, alternatives, and consequences in portable Markdown.

[Build this report](#example-code)[Download MD](/downloads/showcase/workflows/markdown-decision-record/example.md) [Try this file in your browser](/browser/markdown-to-html/)

Opens the generated download in a local browser tool. The C# example below creates the document.

**Start with**

An architectural choice and the reasons behind it

**Generate**

MD + PDF

[!\[Generated Markdown example: An architecture decision record\](/downloads/showcase/workflows/markdown-decision-record/preview.webp)](/downloads/showcase/workflows/markdown-decision-record/preview.png)

Page 1 · Generated by the example below

## How it works

1. ### Record identity and status
  
  Give the decision an identifier, owner, date, and status before explaining the context.
2. ### Show the selected shape
  
  Use a fenced text block for the proposed report-bundle structure.
3. ### Preserve the reasoning
  
  Add an alternatives table, consequence list, and a condition for revisiting the decision.

## The C# source

The example below shows the document API and layout used for this report. Follow the Markdown guide for package setup in your own project.

```csharp
using OfficeIMO.Markdown;

namespace OfficeIMO.Examples.Showcase.Workflows;

/// <summary>Builds a repository-friendly architecture decision record with context and consequences.</summary>
internal static class MarkdownDecisionRecord {
    internal static void Create(string folder) {
        MarkdownDocument document = MarkdownDocument.Create()
            .H1("ADR-007: Keep report inputs with the output")
            .P("Status: Accepted | Owner: Reporting team | Date: 14 September 2026")
            .H2("Context")
            .P("A generated PDF is easy to share, but reviewers also need to understand which data and configuration produced it.")
            .H2("Decision")
            .P("Deliver the report, its structured input snapshot, and a small manifest as one versioned bundle.")
            .Code("text", "report-bundle/\n  report.pdf\n  input.json\n  manifest.json")
            .H2("Alternatives considered")
            .Table(table => table.Headers("Alternative", "Reason not selected")
                .Row("PDF only", "Insufficient context for reproducing the report")
                .Row("Live dashboard link only", "The underlying data can change after review")
                .Row("Full database export", "Unnecessary volume and unrelated information"))
            .H2("Consequences")
            .Ul(list => list.Item("The input snapshot must contain only the fields used by the report.")
                .Item("The manifest records the generator version and file hashes.")
                .Item("Retention rules apply to the whole bundle."))
            .H2("Revisit when")
            .P("The report contains data that cannot be retained, or the generation volume makes the bundle impractical.");
        File.WriteAllText(Path.Combine(folder, "example.md"), document.ToMarkdown());
    }
}
```

[Open the C# source file](/downloads/showcase/workflows/markdown-decision-record/MarkdownDecisionRecord.cs.txt)

## API used in this example

- [`MarkdownDocument`](/api/markdown/officeimo-markdown-markdowndocument/)

## Use this in your project

Generate the fixed sections from your decision-record template and supply the content from your review process. Keep the actual reasoning in the record rather than relying only on a status field.

The [Markdown guide](/docs/markdown/) explains package setup and related document APIs.

## Documents and scope

### What the preview shows

The linked C# example generates this file. The Markdown builder creates the source file. The runner exports a PDF, which is rendered for the preview.

### What to keep in mind

The report-bundle design is illustrative. This example writes the decision record; it does not create or hash a report bundle.

[Markdown API reference](/api/markdown/) · [Artifact hashes and provenance](/downloads/showcase/manifest.json)

## Continue with another example

- [Word**An editable decision record**](/showcase/word-decision-record/)
- [Markdown**A technical guide from Markdown**](/showcase/#markdown-technical-guide)
- [Markdown**An API handover guide**](/showcase/markdown-api-handover/)

<!-- PowerForge markdown artifact sha256:B306E81458A95ADAFF379EFCB2B2ABD800DB2AD5437AACA527A4C341363AFD04 -->
