Generate operator runbooks from service repositories using AI.
# Install
npm install -g agent-runbook-generator
# Generate a runbook
agent-runbook-generator generate /path/to/service --output runbook.md
# Validate a runbook
agent-runbook-generator validate runbook.md --ci- Automated Analysis: Scans your repository to understand language, framework, and architecture
- AI-Powered Generation: Uses LLMs to generate comprehensive runbook content
- Multi-Format Export: Export to Markdown, HTML, PDF-style HTML, or JSON
- MCP Server: Expose tools via Model Context Protocol for AI agents
- CI/CD Integration: Validate runbooks in your pipeline
runbook.analyze.repository— Analyze repository structurerunbook.analyze.dependencies— Map service dependenciesrunbook.analyze.failure_modes— Identify failure modesrunbook.analyze.alerts— Extract alert definitionsrunbook.analyze.health_checks— Analyze health checks
runbook.generate.full— Generate complete runbookrunbook.generate.alerts— Generate alert definitionsrunbook.generate.dashboard— Generate dashboard configsrunbook.generate.rollback— Generate rollback proceduresrunbook.generate.incident_workflow— Generate incident responserunbook.generate.service_map— Generate dependency graphsrunbook.generate.health_checks— Generate health check definitions
runbook.validate.completeness— Check runbook completenessrunbook.validate.accuracy— Validate accuracy against codebaserunbook.validate.links— Verify cross-referencesrunbook.validate.ci— CI-style validation gate
# Analyze a repository
agent-runbook-generator analyze <path> [options]
# Generate a runbook
agent-runbook-generator generate <path> [options]
# Validate a runbook
agent-runbook-generator validate <path> [options]
# Export to different formats
agent-runbook-generator export <input> [options]
# Start MCP server
agent-runbook-generator serve [options]Create a runbook-config.yaml file:
service:
name: my-service
team: platform-engineering
repository: https://github.com/reaatech/my-service
generation:
provider: claude
sections:
- alerts
- dashboards
- failure-modes
- rollback
- incident-response
- health-checks| Variable | Description |
|---|---|
LLM_PROVIDER |
LLM provider (claude, openai, gemini, mock) |
LLM_API_KEY |
API key for LLM provider |
LLM_MODEL |
Specific model to use |
LOG_LEVEL |
Logging level (debug, info, warn, error) |
OTEL_EXPORTER_OTLP_ENDPOINT |
OpenTelemetry collector endpoint |
Start the MCP server:
agent-runbook-generator serveThe MCP server communicates via the Model Context Protocol over stdio.
--host and --port are accepted for forward compatibility, but this release
uses stdio transport only.
Note: All 16 MCP tools are available. Generation and validation tools perform real repository/runbook analysis, and the validation layer now checks completeness, accuracy against repository context, and broken links.
# .github/workflows/runbook.yml
name: Runbook Validation
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx agent-runbook-generator generate . --output runbook.md
- run: npx agent-runbook-generator validate runbook.md --ci| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error |
| 2 | Warning |
| 3 | Validation failed (CI gate) |
MIT