Support Runbook Generator
Produce a single .docx document a support or on-call engineer reaches for
during their shift — how to check system health, where the logs are, what to
do when something breaks, and who to escalate to. Deployment and rollback
procedures belong in the companion operations-deployment-guide skill —
cross-reference it rather than duplicating.
Sections (in this order)
Cover page, Version History, Document Approval, Revision Log, and TOC are
automatic — your sections array starts at "1. Monitoring".
| # |
Section |
Content |
Diagram? |
| 1 |
Monitoring |
Dashboards (tool, link, what they show), alert thresholds and severities, on-call rotation tool and escalation policy |
Monitoring Architecture diagram |
| 2 |
Logging |
Log sources, storage/retention, how to query, access control |
|
| 3 |
Health Checks |
Endpoints/mechanisms used, what "healthy" means, how failures are detected |
|
| 4 |
Scheduled Jobs |
Table: Job name, schedule/cron, purpose, owner, what happens on failure |
|
| 5 |
Troubleshooting Guide |
Table: Symptom, Likely Cause, Resolution — prefer real past incidents over hypotheticals if known |
|
| 6 |
Operational Checklist |
Routine tasks (dependency updates, access reviews, cert renewals) with owner and cadence |
|
| 7 |
Support Process & SLAs |
Support tiers, ticketing system, response-time SLAs |
Support Escalation Flow diagram |
| 8 |
Escalation Contacts |
Table: Role, Name/Rotation, Contact, When to Escalate |
|
| 9 |
Appendix |
Related runbook/deployment guide links |
|
Diagram Policy
Applies to the .docx path only — Markdown embeds Mermaid source
directly instead of rendering anything (see "Output Format" below).
Prefer a real Mermaid diagram — rendered via mmdc and embedded with
B.diagramImage() — over diagramPlaceholder(), but only once you have
concrete structure to draw (real names, not "TBD"). Read
references/diagram-generation.md when you're actually about to render one
— it has the full build order, the bundled config
(assets/mermaid-config.json), the exact mmdc flags, and token-saving
tips. Skip it entirely if this document ends up needing no diagrams.
Missing Information Policy
Never invent alert thresholds, troubleshooting steps, or escalation paths you
have no basis for — a fabricated "resolution" in a runbook could make an
actual incident worse. Use toBeCompleted("...") for sections you lack real
input for, explaining what's needed, and still generate everything else.
Output Format
Ask the user which output format they want, unless they've already said so in
this request (e.g., "as a docx", "in markdown," "just give me an .md file") —
a quick single-choice question is enough, don't block on it otherwise:
Word document (.docx) — the default assumption if the person hasn't
specified and their context suggests a formal deliverable. Follow "Using
the builder" below.
Markdown (.md) — no script needed, write the file directly. Use these
conventions so it stays structurally equivalent to the docx version:
Front matter: instead of a cover page, open with the title as an #
heading, the project name as an italic subtitle line, then a metadata
table instead of separate Version History / Approval / Revision Log
tables:
# Support Runbook
*Acme Order Platform*
| Field | Value |
|---|---|
| Version | 0.1 |
| Author | Jane Doe |
| Date | 2026-07-19 |
| Status | Draft |
| Approved By | Jane Doe (Tech Lead) |
Headings: #/##/###/#### matching the same section levels used in
the table above — don't flatten everything to one level, that's what
keeps the document skimmable and consistent with the docx version.
Tables: standard Markdown tables.
Diagrams — unlike the .docx path, don't render or embed an image here.
Write the actual Mermaid source directly in a fenced code block; GitHub,
GitLab, Obsidian, and most modern Markdown viewers render mermaid code
blocks natively, so this is a real diagram, not a placeholder:
```mermaid
flowchart TD
A[Client] --> B[API Gateway]
B --> C[Order Service]
C --> D[(Database)]
```
Only fall back to a text placeholder if you don't yet have concrete
enough detail to draw something real (mirrors toBeCompleted above):
> 📊 **DIAGRAM PLACEHOLDER — TO BE COMPLETED**
> Not enough detail yet to draw the System Architecture Diagram — need
> the actual component names and how they connect.
"To be completed" callout — same blockquote treatment:
> ⚠️ **TO BE COMPLETED**
> Explanation of what input is needed to fill this in.
Save as Support_Runbook.md instead of Support_Runbook.docx.
Workflow
Ask the output format first (see "Output Format" above). For Markdown, skip straight to writing the file using those conventions — the numbered steps below describe the .docx path.
- Gather what's available — monitoring/alerting config, past incident
history, on-call tooling — or ask directly.
- Draft each section as data using the builder functions below. Prefer real
past incidents for the Troubleshooting Guide over generic examples.
- Build with
scripts/docx_builder.js.
- Skip PDF conversion by default —
docx_builder.js is already tested and
hardened (table widths and text alignment are enforced at the library
level), so routine generations don't need a re-render just to confirm it
worked. Only convert to PDF and view it if the user explicitly asks for
visual verification, or if something about this generation is unusual
(e.g., a new kind of content the library hasn't handled before, or a
reported rendering problem). When you do need it: soffice --headless --convert-to pdf <file>.docx (or libreoffice --headless ...), then
pdftoppm -jpeg -r 100 <file>.pdf page and view the images.
- Save to
/mnt/user-data/outputs/Support_Runbook.docx (or .md if that's the chosen format) and present it.
Using the builder (for the .docx path)
This library requires the docx npm package. Before running any script,
check it's available with node -e "require('docx')"; if that fails, install
it with npm install docx in the working directory first — don't assume it's
pre-installed, since that varies by environment.
const B = require("./scripts/docx_builder.js");
const sections = [
B.h1("1. Monitoring"),
B.para("Dashboards are hosted in Grafana; PagerDuty manages on-call rotation and escalation."),
// Prefer B.diagramImage(path, {caption}) with a real mmdc render when
// possible (see "Diagram Policy" above) — diagramPlaceholder() is the fallback:
B.diagramPlaceholder({
name: "Monitoring Architecture",
purpose: "Show how metrics flow from services to dashboards and alerts.",
recommendedContent: ["Services", "Prometheus", "Grafana", "PagerDuty", "Slack"],
}),
B.h1("5. Troubleshooting Guide"),
B.table(["Symptom", "Likely Cause", "Resolution"],
[["Service returns 503", "Downstream dependency down", "Check dependency health dashboard; if down, page the owning team"]],
[3000, 3000, 3200]),
B.h1("8. Escalation Contacts"),
B.toBeCompleted("On-call rotation and escalation contacts weren't provided — ask for the PagerDuty schedule link or current on-call roster."),
];
await B.buildDocument("/mnt/user-data/outputs/Support_Runbook.docx", {
docLabel: "Support Runbook",
title: "Support Runbook",
subtitle: "Acme Order Platform",
versionHistory: [["0.1", "2026-07-19", "Jane Doe", "Initial draft"]],
approvers: [["Jane Doe", "Support Lead", "", ""]],
revisionLog: [],
sections,
});
Available functions: h1/h2/h3/h4, para, bullets, table(headers, rows, widths), pageBreak, toBeCompleted(explanation),
diagramPlaceholder({name, purpose, recommendedContent, notes}), and
buildDocument(path, options). Always use heading functions for titles so
Word's Table of Contents and Navigation Pane work correctly.
Success Criteria
A support or on-call engineer who has never seen this system before should be
able to triage a real incident using only this document — check health,
find the right logs, recognize a known symptom, and know who to escalate to.
1---2name: support-runbook3description: Generate a professional Support Runbook as a formatted Word (.docx) file — monitoring, logging, health checks, scheduled jobs, troubleshooting guide, routine operational checklist, and support process/escalation. Use this whenever someone asks for a "runbook," "support handbook," "on-call guide," "incident response doc," or wants day-to-day operational reference material for a support or on-call team (as distinct from how a system gets deployed, which lives in the companion operations-deployment-guide skill). Part of an enterprise handover documentation suite (see also: project-overview-doc, architecture-document, high-level-design, operations-deployment-guide, api-documentation, database-design, release-maintenance-guide) but fully usable standalone.4---56# Support Runbook Generator78Produce a single `.docx` document a support or on-call engineer reaches for9during their shift — how to check system health, where the logs are, what to10do when something breaks, and who to escalate to. Deployment and rollback11procedures belong in the companion `operations-deployment-guide` skill —12cross-reference it rather than duplicating.1314## Sections (in this order)1516Cover page, Version History, Document Approval, Revision Log, and TOC are17automatic — your `sections` array starts at "1. Monitoring".1819| # | Section | Content | Diagram? |20|---|---|---|---|21| 1 | Monitoring | Dashboards (tool, link, what they show), alert thresholds and severities, on-call rotation tool and escalation policy | **Monitoring Architecture** diagram |22| 2 | Logging | Log sources, storage/retention, how to query, access control | |23| 3 | Health Checks | Endpoints/mechanisms used, what "healthy" means, how failures are detected | |24| 4 | Scheduled Jobs | Table: Job name, schedule/cron, purpose, owner, what happens on failure | |25| 5 | Troubleshooting Guide | Table: Symptom, Likely Cause, Resolution — prefer real past incidents over hypotheticals if known | |26| 6 | Operational Checklist | Routine tasks (dependency updates, access reviews, cert renewals) with owner and cadence | |27| 7 | Support Process & SLAs | Support tiers, ticketing system, response-time SLAs | **Support Escalation Flow** diagram |28| 8 | Escalation Contacts | Table: Role, Name/Rotation, Contact, When to Escalate | |29| 9 | Appendix | Related runbook/deployment guide links | |3031## Diagram Policy3233**Applies to the `.docx` path only** — Markdown embeds Mermaid source34directly instead of rendering anything (see "Output Format" below).3536Prefer a real Mermaid diagram — rendered via `mmdc` and embedded with37`B.diagramImage()` — over `diagramPlaceholder()`, but only once you have38concrete structure to draw (real names, not "TBD"). Read39`references/diagram-generation.md` when you're actually about to render one40— it has the full build order, the bundled config41(`assets/mermaid-config.json`), the exact `mmdc` flags, and token-saving42tips. Skip it entirely if this document ends up needing no diagrams.4344## Missing Information Policy4546Never invent alert thresholds, troubleshooting steps, or escalation paths you47have no basis for — a fabricated "resolution" in a runbook could make an48actual incident worse. Use `toBeCompleted("...")` for sections you lack real49input for, explaining what's needed, and still generate everything else.5051## Output Format5253Ask the user which output format they want, unless they've already said so in54this request (e.g., "as a docx", "in markdown," "just give me an .md file") —55a quick single-choice question is enough, don't block on it otherwise:5657- **Word document (.docx)** — the default assumption if the person hasn't58 specified and their context suggests a formal deliverable. Follow "Using59 the builder" below.60- **Markdown (.md)** — no script needed, write the file directly. Use these61 conventions so it stays structurally equivalent to the docx version:6263 - Front matter: instead of a cover page, open with the title as an `#`64 heading, the project name as an italic subtitle line, then a metadata65 table instead of separate Version History / Approval / Revision Log66 tables:6768 ```markdown69 # Support Runbook70 *Acme Order Platform*7172 | Field | Value |73 |---|---|74 | Version | 0.1 |75 | Author | Jane Doe |76 | Date | 2026-07-19 |77 | Status | Draft |78 | Approved By | Jane Doe (Tech Lead) |79 ```80 - Headings: `#`/`##`/`###`/`####` matching the same section levels used in81 the table above — don't flatten everything to one level, that's what82 keeps the document skimmable and consistent with the docx version.83 - Tables: standard Markdown tables.84 - Diagrams — unlike the `.docx` path, don't render or embed an image here.85 Write the actual Mermaid source directly in a fenced code block; GitHub,86 GitLab, Obsidian, and most modern Markdown viewers render `mermaid` code87 blocks natively, so this is a real diagram, not a placeholder:8889 ````markdown90 ```mermaid91 flowchart TD92 A[Client] --> B[API Gateway]93 B --> C[Order Service]94 C --> D[(Database)]95 ```96 ````97 Only fall back to a text placeholder if you don't yet have concrete98 enough detail to draw something real (mirrors `toBeCompleted` above):99 ```markdown100 > 📊 **DIAGRAM PLACEHOLDER — TO BE COMPLETED**101 > Not enough detail yet to draw the System Architecture Diagram — need102 > the actual component names and how they connect.103 ```104 - "To be completed" callout — same blockquote treatment:105106 ```markdown107 > ⚠️ **TO BE COMPLETED**108 > Explanation of what input is needed to fill this in.109 ```110 - Save as `Support_Runbook.md` instead of `Support_Runbook.docx`.111112## Workflow113114Ask the output format first (see "Output Format" above). For Markdown, skip straight to writing the file using those conventions — the numbered steps below describe the `.docx` path.1151161. Gather what's available — monitoring/alerting config, past incident117 history, on-call tooling — or ask directly.1182. Draft each section as data using the builder functions below. Prefer real119 past incidents for the Troubleshooting Guide over generic examples.1203. Build with `scripts/docx_builder.js`.1214. Skip PDF conversion by default — `docx_builder.js` is already tested and122 hardened (table widths and text alignment are enforced at the library123 level), so routine generations don't need a re-render just to confirm it124 worked. Only convert to PDF and view it if the user explicitly asks for125 visual verification, or if something about this generation is unusual126 (e.g., a new kind of content the library hasn't handled before, or a127 reported rendering problem). When you do need it: `soffice --headless128 --convert-to pdf <file>.docx` (or `libreoffice --headless ...`), then129 `pdftoppm -jpeg -r 100 <file>.pdf page` and view the images.1305. Save to `/mnt/user-data/outputs/Support_Runbook.docx` (or `.md` if that's the chosen format) and present it.131132## Using the builder (for the .docx path)133134This library requires the `docx` npm package. Before running any script,135check it's available with `node -e "require('docx')"`; if that fails, install136it with `npm install docx` in the working directory first — don't assume it's137pre-installed, since that varies by environment.138139```javascript140const B = require("./scripts/docx_builder.js");141142const sections = [143 B.h1("1. Monitoring"),144 B.para("Dashboards are hosted in Grafana; PagerDuty manages on-call rotation and escalation."),145146 // Prefer B.diagramImage(path, {caption}) with a real mmdc render when147 // possible (see "Diagram Policy" above) — diagramPlaceholder() is the fallback:148 B.diagramPlaceholder({149 name: "Monitoring Architecture",150 purpose: "Show how metrics flow from services to dashboards and alerts.",151 recommendedContent: ["Services", "Prometheus", "Grafana", "PagerDuty", "Slack"],152 }),153154 B.h1("5. Troubleshooting Guide"),155 B.table(["Symptom", "Likely Cause", "Resolution"],156 [["Service returns 503", "Downstream dependency down", "Check dependency health dashboard; if down, page the owning team"]],157 [3000, 3000, 3200]),158159 B.h1("8. Escalation Contacts"),160 B.toBeCompleted("On-call rotation and escalation contacts weren't provided — ask for the PagerDuty schedule link or current on-call roster."),161];162163await B.buildDocument("/mnt/user-data/outputs/Support_Runbook.docx", {164 docLabel: "Support Runbook",165 title: "Support Runbook",166 subtitle: "Acme Order Platform",167 versionHistory: [["0.1", "2026-07-19", "Jane Doe", "Initial draft"]],168 approvers: [["Jane Doe", "Support Lead", "", ""]],169 revisionLog: [],170 sections,171});172```173174Available functions: `h1`/`h2`/`h3`/`h4`, `para`, `bullets`, `table(headers,175rows, widths)`, `pageBreak`, `toBeCompleted(explanation)`,176`diagramPlaceholder({name, purpose, recommendedContent, notes})`, and177`buildDocument(path, options)`. Always use heading functions for titles so178Word's Table of Contents and Navigation Pane work correctly.179180## Success Criteria181182A support or on-call engineer who has never seen this system before should be183able to triage a real incident using only this document — check health,184find the right logs, recognize a known symptom, and know who to escalate to.