Operations & Deployment Guide Generator
Produce a single .docx document covering how a system gets deployed and how
its infrastructure stays resilient — environments, CI/CD, deployment and
rollback steps, configuration, secrets, backups, and DR. Day-to-day
monitoring, logging, and incident troubleshooting belong in the companion
support-runbook skill — don't duplicate that content here, cross-reference
it instead.
Sections (in this order)
Cover page, Version History, Document Approval, Revision Log, and TOC are
automatic — your sections array starts at "1. Environment Overview".
| # |
Section |
Content |
Diagram? |
| 1 |
Environment Overview |
Table: Environment (Dev/Staging/Prod/...), Purpose, URL, Access Method |
|
| 2 |
Infrastructure Overview |
Cloud provider(s), regions, compute/networking model |
Infrastructure Diagram, Network Diagram |
| 3 |
Deployment Architecture |
How services map onto infrastructure — containers, orchestration, load balancers, CDN |
Deployment Diagram |
| 4 |
CI/CD Pipeline |
Tool, stages (build/test/scan/deploy), triggers, approval gates |
CI/CD Pipeline Diagram |
| 5 |
Deployment Procedure |
Numbered, literal steps to deploy a release to each environment |
|
| 6 |
Rollback Procedure |
Numbered, literal steps to revert a bad deployment, including data/migration rollback |
|
| 7 |
Configuration Management |
Table of environment variables (name, description, example/default, secret?) and feature flags |
|
| 8 |
Secrets Management |
Where secrets live (vault/secrets manager), rotation policy, who can access them — never actual values |
|
| 9 |
Backup Strategy |
Table: Data store, frequency, retention, storage location |
|
| 10 |
Disaster Recovery |
RTO/RPO targets, failover process, who declares a disaster, communication plan |
|
| 11 |
Appendix |
Related runbook links, escalation contacts |
|
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 infrastructure details, deployment steps, or DR targets you have
no basis for — a wrong-but-plausible deployment step is dangerous, not just
inaccurate, since someone may follow it during an actual release. 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:
# Operations & Deployment Guide
*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 Operations_and_Deployment_Guide.md instead of Operations_and_Deployment_Guide.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 — CI/CD config files, infra-as-code, or ask
directly about environments, deployment tooling, and DR targets.
- Draft each section as data using the builder functions below. Write
Deployment/Rollback Procedure as numbered steps, not prose — someone may
need to follow them under pressure.
- 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/Operations_and_Deployment_Guide.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. Environment Overview"),
B.table(["Environment", "Purpose", "URL", "Access Method"],
[["Production", "Live traffic", "https://app.acme.com", "VPN + SSO"]],
[2000, 2600, 2600, 2200]),
B.h1("5. Deployment Procedure"),
B.para("1. Merge the release branch into main after CI passes."),
B.para("2. Trigger the \"Deploy to Production\" workflow and approve the gate."),
B.para("3. Watch the rollout dashboard until all pods report healthy."),
B.h1("9. Backup Strategy"),
B.toBeCompleted("Backup schedule and retention weren't provided — check the database provider's backup configuration or ask the infra owner."),
B.h1("10. Disaster Recovery"),
B.table(["Metric", "Target"], [["RTO", "4 hours"], ["RPO", "1 hour"]], [4600, 4600]),
];
await B.buildDocument("/mnt/user-data/outputs/Operations_and_Deployment_Guide.docx", {
docLabel: "Operations & Deployment Guide",
title: "Operations & Deployment Guide",
subtitle: "Acme Order Platform",
versionHistory: [["0.1", "2026-07-19", "Jane Doe", "Initial draft"]],
approvers: [["Jane Doe", "DevOps 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 DevOps or infrastructure engineer should be able to deploy a release, roll
one back, and understand the system's resilience posture using only this
document — without needing to ask the original team.
1---2name: operations-deployment-guide3description: Generate a professional Operations & Deployment Guide as a formatted Word (.docx) file — environments, infrastructure, deployment architecture, CI/CD pipeline, deployment/rollback procedures, configuration and secrets management, backups, and disaster recovery. Use this whenever someone asks for a "deployment guide," "infra runbook," "release process document," or wants to document how a system is deployed and kept resilient (as distinct from day-to-day incident troubleshooting, which lives in the companion support-runbook skill). Part of an enterprise handover documentation suite (see also: project-overview-doc, architecture-document, high-level-design, support-runbook, api-documentation, database-design, release-maintenance-guide) but fully usable standalone.4---56# Operations & Deployment Guide Generator78Produce a single `.docx` document covering how a system gets deployed and how9its infrastructure stays resilient — environments, CI/CD, deployment and10rollback steps, configuration, secrets, backups, and DR. Day-to-day11monitoring, logging, and incident troubleshooting belong in the companion12`support-runbook` skill — don't duplicate that content here, cross-reference13it instead.1415## Sections (in this order)1617Cover page, Version History, Document Approval, Revision Log, and TOC are18automatic — your `sections` array starts at "1. Environment Overview".1920| # | Section | Content | Diagram? |21|---|---|---|---|22| 1 | Environment Overview | Table: Environment (Dev/Staging/Prod/...), Purpose, URL, Access Method | |23| 2 | Infrastructure Overview | Cloud provider(s), regions, compute/networking model | **Infrastructure Diagram**, **Network Diagram** |24| 3 | Deployment Architecture | How services map onto infrastructure — containers, orchestration, load balancers, CDN | **Deployment Diagram** |25| 4 | CI/CD Pipeline | Tool, stages (build/test/scan/deploy), triggers, approval gates | **CI/CD Pipeline Diagram** |26| 5 | Deployment Procedure | Numbered, literal steps to deploy a release to each environment | |27| 6 | Rollback Procedure | Numbered, literal steps to revert a bad deployment, including data/migration rollback | |28| 7 | Configuration Management | Table of environment variables (name, description, example/default, secret?) and feature flags | |29| 8 | Secrets Management | Where secrets live (vault/secrets manager), rotation policy, who can access them — never actual values | |30| 9 | Backup Strategy | Table: Data store, frequency, retention, storage location | |31| 10 | Disaster Recovery | RTO/RPO targets, failover process, who declares a disaster, communication plan | |32| 11 | Appendix | Related runbook links, escalation contacts | |3334## Diagram Policy3536**Applies to the `.docx` path only** — Markdown embeds Mermaid source37directly instead of rendering anything (see "Output Format" below).3839Prefer a real Mermaid diagram — rendered via `mmdc` and embedded with40`B.diagramImage()` — over `diagramPlaceholder()`, but only once you have41concrete structure to draw (real names, not "TBD"). Read42`references/diagram-generation.md` when you're actually about to render one43— it has the full build order, the bundled config44(`assets/mermaid-config.json`), the exact `mmdc` flags, and token-saving45tips. Skip it entirely if this document ends up needing no diagrams.4647## Missing Information Policy4849Never invent infrastructure details, deployment steps, or DR targets you have50no basis for — a wrong-but-plausible deployment step is dangerous, not just51inaccurate, since someone may follow it during an actual release. Use52`toBeCompleted("...")` for sections you lack real input for, explaining what's53needed, and still generate everything else.5455## Output Format5657Ask the user which output format they want, unless they've already said so in58this request (e.g., "as a docx", "in markdown," "just give me an .md file") —59a quick single-choice question is enough, don't block on it otherwise:6061- **Word document (.docx)** — the default assumption if the person hasn't62 specified and their context suggests a formal deliverable. Follow "Using63 the builder" below.64- **Markdown (.md)** — no script needed, write the file directly. Use these65 conventions so it stays structurally equivalent to the docx version:6667 - Front matter: instead of a cover page, open with the title as an `#`68 heading, the project name as an italic subtitle line, then a metadata69 table instead of separate Version History / Approval / Revision Log70 tables:7172 ```markdown73 # Operations & Deployment Guide74 *Acme Order Platform*7576 | Field | Value |77 |---|---|78 | Version | 0.1 |79 | Author | Jane Doe |80 | Date | 2026-07-19 |81 | Status | Draft |82 | Approved By | Jane Doe (Tech Lead) |83 ```84 - Headings: `#`/`##`/`###`/`####` matching the same section levels used in85 the table above — don't flatten everything to one level, that's what86 keeps the document skimmable and consistent with the docx version.87 - Tables: standard Markdown tables.88 - Diagrams — unlike the `.docx` path, don't render or embed an image here.89 Write the actual Mermaid source directly in a fenced code block; GitHub,90 GitLab, Obsidian, and most modern Markdown viewers render `mermaid` code91 blocks natively, so this is a real diagram, not a placeholder:9293 ````markdown94 ```mermaid95 flowchart TD96 A[Client] --> B[API Gateway]97 B --> C[Order Service]98 C --> D[(Database)]99 ```100 ````101 Only fall back to a text placeholder if you don't yet have concrete102 enough detail to draw something real (mirrors `toBeCompleted` above):103 ```markdown104 > 📊 **DIAGRAM PLACEHOLDER — TO BE COMPLETED**105 > Not enough detail yet to draw the System Architecture Diagram — need106 > the actual component names and how they connect.107 ```108 - "To be completed" callout — same blockquote treatment:109110 ```markdown111 > ⚠️ **TO BE COMPLETED**112 > Explanation of what input is needed to fill this in.113 ```114 - Save as `Operations_and_Deployment_Guide.md` instead of `Operations_and_Deployment_Guide.docx`.115116## Workflow117118Ask 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.1191201. Gather what's available — CI/CD config files, infra-as-code, or ask121 directly about environments, deployment tooling, and DR targets.1222. Draft each section as data using the builder functions below. Write123 Deployment/Rollback Procedure as numbered steps, not prose — someone may124 need to follow them under pressure.1253. Build with `scripts/docx_builder.js`.1264. Skip PDF conversion by default — `docx_builder.js` is already tested and127 hardened (table widths and text alignment are enforced at the library128 level), so routine generations don't need a re-render just to confirm it129 worked. Only convert to PDF and view it if the user explicitly asks for130 visual verification, or if something about this generation is unusual131 (e.g., a new kind of content the library hasn't handled before, or a132 reported rendering problem). When you do need it: `soffice --headless133 --convert-to pdf <file>.docx` (or `libreoffice --headless ...`), then134 `pdftoppm -jpeg -r 100 <file>.pdf page` and view the images.1355. Save to `/mnt/user-data/outputs/Operations_and_Deployment_Guide.docx` (or `.md` if that's the chosen format) and present it.136137## Using the builder (for the .docx path)138139This library requires the `docx` npm package. Before running any script,140check it's available with `node -e "require('docx')"`; if that fails, install141it with `npm install docx` in the working directory first — don't assume it's142pre-installed, since that varies by environment.143144```javascript145const B = require("./scripts/docx_builder.js");146147const sections = [148 B.h1("1. Environment Overview"),149 B.table(["Environment", "Purpose", "URL", "Access Method"],150 [["Production", "Live traffic", "https://app.acme.com", "VPN + SSO"]],151 [2000, 2600, 2600, 2200]),152153 B.h1("5. Deployment Procedure"),154 B.para("1. Merge the release branch into main after CI passes."),155 B.para("2. Trigger the \"Deploy to Production\" workflow and approve the gate."),156 B.para("3. Watch the rollout dashboard until all pods report healthy."),157158 B.h1("9. Backup Strategy"),159 B.toBeCompleted("Backup schedule and retention weren't provided — check the database provider's backup configuration or ask the infra owner."),160161 B.h1("10. Disaster Recovery"),162 B.table(["Metric", "Target"], [["RTO", "4 hours"], ["RPO", "1 hour"]], [4600, 4600]),163];164165await B.buildDocument("/mnt/user-data/outputs/Operations_and_Deployment_Guide.docx", {166 docLabel: "Operations & Deployment Guide",167 title: "Operations & Deployment Guide",168 subtitle: "Acme Order Platform",169 versionHistory: [["0.1", "2026-07-19", "Jane Doe", "Initial draft"]],170 approvers: [["Jane Doe", "DevOps Lead", "", ""]],171 revisionLog: [],172 sections,173});174```175176Available functions: `h1`/`h2`/`h3`/`h4`, `para`, `bullets`, `table(headers,177rows, widths)`, `pageBreak`, `toBeCompleted(explanation)`,178`diagramPlaceholder({name, purpose, recommendedContent, notes})`, and179`buildDocument(path, options)`. Always use heading functions for titles so180Word's Table of Contents and Navigation Pane work correctly.181182## Success Criteria183184A DevOps or infrastructure engineer should be able to deploy a release, roll185one back, and understand the system's resilience posture using only this186document — without needing to ask the original team.