Skip to content
reaatechREAATECH

@reaatech/agent-runbook-runbook

npm v0.1.0

Assembles and formats infrastructure runbooks from analysis data using a collection of pipeline functions, template utilities, and multi-format exporters. It provides tools to validate runbook completeness and accuracy, typically consuming output from repository analysis packages.

@reaatech/agent-runbook-runbook

npm version License: MIT CI

Runbook assembly, formatting, and orchestration pipeline for the Agent Runbook Generator. Combines all analysis results into a complete operator runbook with table of contents, cross-references, and multiple output formats.

Installation

terminal
npm install @reaatech/agent-runbook-runbook
# or
pnpm add @reaatech/agent-runbook-runbook

Feature Overview

  • Runbook assembly — combines alerts, dashboards, failure modes, rollback procedures, incident workflows, health checks, and service maps into a single structured runbook
  • Pipeline orchestration — end-to-end generation pipeline from repository scan through LLM analysis to formatted output
  • Table of contents — auto-generated TOC with anchor links for all sections and subsections
  • Templating — pre-built runbook section templates with configurable content and ordering
  • Multi-format export — Markdown, HTML, and PDF output with consistent formatting
  • Validation — completeness, accuracy, and cross-reference validation with CI-grade scoring

Quick Start

typescript
import {
  buildRunbook,
  generateRunbookArtifacts,
  exportRunbook,
  validateCompleteness,
} from "@reaatech/agent-runbook-runbook";
 
const { runbook, sections } = await generateRunbookArtifacts({
  path: "/path/to/repo",
  sections: ["alerts", "dashboards", "failure-modes", "rollback", "incident-response", "health-checks", "service-map"],
});
 
const markdown = exportRunbook(runbook, "markdown");
 
const result = validateCompleteness(runbook);
// { score: 0.92, missingSections: [], suggestions: [...] }

API Reference

Runbook Builder

FunctionSignature
buildRunbook(analysisContext: AnalysisContext) => Runbook
generateTOC(sections: RunbookSection[]) => TocEntry[]
validateCompleteness(runbook: Runbook) => CompletenessResult

Formatter

FunctionSignature
exportRunbook(runbook: Runbook, format: ExportFormat) => string
formatAsMarkdown(runbook: Runbook) => string
formatAsHTML(runbook: Runbook) => string
formatAsPDF(runbook: Runbook) => string

Templates

FunctionSignature
getTemplateById(id: string) => RunbookSectionTemplate | undefined
getAllTemplates() => RunbookSectionTemplate[]
applyTemplate(template: RunbookSectionTemplate, context: AnalysisContext) => RunbookSection

Pipeline

FunctionSignature
generateRunbookArtifacts(options: PipelineOptions) => Promise<{ runbook: Runbook; sections: string[] }>
parseRunbookDocument(content: string, format: ExportFormat) => Runbook
parseMarkdownRunbook(content: string) => Runbook
validateRunbookAccuracy(runbook: Runbook, context: AnalysisContext) => AccuracyResult
validateRunbookLinks(runbook: Runbook) => LinkValidationResult
createCiValidationResult(runbook: Runbook, thresholds: ValidationThresholds) => ValidationResult

License

MIT