Runbook Generation Skill

SkillCloud & infra

Generate and update feature release runbooks from existing docs and codebase. Use when: creating operational runbook, release handbook, deployment checklist, pre-release preparation. Not for: incident response (v2), code review (use codex-code-review), architecture design (use architecture).

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Runbook Generation Skill skill

What this skill tells your AI

The instructions your AI receives, as published by sd0xdev/sd0x-harness in skills/runbook/SKILL.md and read by ahel’s review.

Trigger

  • Keywords: runbook, release runbook, deployment handbook, release handbook, operational guide, pre-release checklist, rollback plan

When NOT to Use

ScenarioAlternative
Incident response runbookv2 (not yet implemented)
Code review/codex-review-fast
Architecture design/architecture
Tech spec writing/tech-spec
Request tracking/create-request

Usage

/runbook                              # Auto-detect feature, create or update
/runbook <feature-keyword>            # Specify feature
/runbook --update                     # Force update mode
/runbook --check                      # Read-only staleness validation
/runbook --request <path|title>       # Specify target request (multi-request features)

Workflow

sequenceDiagram
    participant U as User
    participant S as /runbook
    participant FR as Feature Resolver
    participant CB as Codebase
    participant RB as runbook-release.md

    U->>S: /runbook [feature] [--update|--check] [--request path]
    S->>FR: node scripts/resolve-feature.js
    FR-->>S: {key, doc_inventory, source sets}
    S->>S: Mode dispatch + Request selection

    alt Create Mode
        S->>CB: Read current_authority + requests/*.md
        S->>CB: Scoped discovery (5-priority cascade)
        S->>RB: Write runbook-release.md from template
    else Update Mode
        S->>RB: Read existing runbook + provenance
        S->>CB: Compare current state vs provenance SHAs
        S->>RB: Edit changed sections only
    else Check Mode
        S->>RB: Read existing runbook + provenance
        S->>CB: Validate per-section SHAs
        S-->>U: Report: Fresh/Stale/Missing/Unknown
    end

Phase 0: Context Resolution

Resolve feature using the 5-level cascade:

The wrapper, not the CLI directly: resolve-feature.js owns the failure payload, so the full shape with scan_error: true arrives however the CLI fails — a nonzero exit, a signal, a partial write, a payload that is not the agreed shape. (It cannot survive node itself being unavailable: nothing running under node can. What it removes is the CLI's failure domain, not the interpreter's.) Calling the CLI with || echo '{}' produces a payload the gate below cannot recognise as a failure.

Decide the branch yourself, then run one command. This skill grants Bash(node:*), which matches a direct node … invocation and nothing else — a shell if/[ … ]/$(…) compound is not a node command and cannot run here. Parse $ARGUMENTS first (Step 1 below), then issue exactly one of:

node scripts/resolve-feature.js --feature <the feature key from $ARGUMENTS>
node scripts/resolve-feature.js

Use the first when $ARGUMENTS carried a positional feature key, the second otherwise. Pass the key as a separate argv token — never interpolate it into a larger shell expression.

SourceMapping
/runbook authPositional key auth--feature auth (two separate argv tokens)
/runbook (no arg)No --feature, resolver uses branch/diff/fallback
/runbook --checkNo --feature, parse flags only
StepAction
1Parse $ARGUMENTS for feature key or --check/--update/--request flags
2Run feature resolver, get key, doc_inventory, and the four source sets (current_authority, design_records, work_records, history_records)
2bIf scan_error !== false, stop — not === true: a payload missing the field is a failure too. See the gate below
3Check for runbook-release.md specifically in feature directory (not any runbook-*.md)
4Determine mode: create (runbook-release.md absent) / update (runbook-release.md exists) / check (--check flag)

scan_error gate. Gate on scan_error !== false, not on scan_error === true. When it is not exactly false the four source sets are unknown, not empty — the corpus could not be enumerated (unreadable directory, broken taxonomy, no repository), or the resolver never ran and a shell fallback supplied a payload with no such field at all. {} is the shape that made the stricter test useless: it has no scan_error, so === true is false and the gate passes a payload that contains nothing. Do not proceed as though the feature has no authority documents — report and take the ⚠️ Need Human exit. A key may still be present, so a non-null key is not evidence the sets are complete.

Note: Mode dispatch keys off the specific file runbook-release.md, not any runbook-typed doc in doc_inventory. A feature may have runbook-deploy.md (a different topic) without triggering update mode for the release runbook.

Request Selection

ConditionBehavior
--request specifiedUse specified request
Single active requestAuto-select
Multiple active requestsAskUserQuestion: list requests, let user choose
No active requestsUse most recent request (warn)

Phase 1: Content Discovery (Create/Update modes)

Use scoped discovery cascade — narrow to wide, with confidence degradation:

PriorityScopeConfidence
1Request Related Files pathsHigh
2current_authority — code, rules/, and the docs that claim to be currentHigh
3design_records (tech spec, architecture)Medium — intent only, mark steps unverified
4Feature-local paths (docs/features/{feature}/)Medium
5Repo-wide grepLow (tag results)

A P1 path is classified before it is used. Related Files is High confidence because the request author named those paths deliberately — not because a path in that table is exempt from the role split. Resolve each one first: a path landing in design_records (a tech spec, an architecture doc) is treated as P3 — Medium, marked unverified — even though it arrived via P1. Otherwise the row the split removed comes straight back through the front door, since a request's Related Files table routinely names 2-tech-spec.md.

Priorities 2 and 3 used to be one row reading "canonical docs (tech-spec, architecture) — High", which is the confusion this feature exists to remove: a tech spec is a design record, and a runbook built from one describes a procedure that may never have been built.

See references/discovery-heuristics.md for per-section mapping.

Security — Redaction Rules

When mining configs/workflows/logs into committed markdown:

ProhibitedReplacement
API keys, tokens, secrets${ENV_VAR_NAME} placeholder
Webhook URLs with credentials<webhook-url> symbolic reference
Internal-only endpoints<internal-endpoint> placeholder
Database connection strings${DATABASE_URL} placeholder

Phase 2: Generate / Update

Create Mode

  1. Read current_authority first — a runbook describes what operators will actually run, so the sources are code, rules/, and the docs that claim to be current. Fall back to design_records (tech spec, architecture) only for the intent behind a step, and mark any step sourced that way as unverified in the provenance manifest: a design record may describe a procedure that was never built
  2. Read active request(s) by enumerating docs/features/{feature}/requests/*.mdnot by filtering work_records. That set answers "is this document a work record", and a ticket that resolves to some other role — authority Yes, or a Doc role naming one of the other three — leaves it while staying an open ticket; selecting from the set would drop exactly that ticket's AC, scope and related files
  3. Run scoped discovery for each template section
  4. Fill template from references/template.md
  5. Embed <!-- runbook-provenance --> manifest with source SHAs
  6. Write to docs/features/{feature}/runbook-release.md

Update Mode

  1. Read existing runbook-release.md and parse <!-- runbook-provenance --> block
  2. Compare each sources[].sha against git hash-object <file>
  3. Identify stale sections (any source SHA mismatch)
  4. Re-run discovery for stale sections only
  5. Edit stale sections via Edit tool (preserve fresh sections)
  6. Update provenance manifest with new SHAs

Phase 3: Check Mode (--check)

Read-only validation — does not modify the runbook file.

  1. Read existing runbook-release.md and parse provenance manifest
  2. For each section, compare sources[].sha against current git hash-object
  3. Classify: Fresh / Stale / Missing / Unknown (see references/check-output.md)
  4. Output report with per-section status and SHA diffs
  5. Emit verdict: Ready / Stale / Incomplete

Output

ModeOutputLocation
CreateNew runbookdocs/features/{feature}/runbook-release.md
UpdateUpdated sectionsSame file, incremental edit
CheckConsole reportstdout only (no file modification)

Verification

  • Feature resolved via node scripts/resolve-feature.js, and scan_error was exactly false
  • Runbook detected in doc_inventory (ancillary/runbook type)
  • Template has all 9 sections (see references/template.md)
  • Provenance manifest embedded with multi-source SHA tracking
  • Discovery uses scoped cascade (not repo-wide grep as first option)
  • Redaction rules applied (no secrets in committed markdown)
  • --check mode is read-only (no file writes)

Auto-Loop Integration

This skill produces .md output. Per @rules/auto-loop.md:

EventAction
Create/Update writes .md/codex-review-doc auto-triggered
Check mode (no writes)No review needed

References

FilePurpose
references/template.md9-section runbook template with provenance block
references/discovery-heuristics.mdScoped discovery cascade and per-section mapping
references/check-output.md--check mode output template and verdict logic

Examples

Input: /runbook
Action: Auto-detect feature → create runbook-release.md → /codex-review-doc

Input: /runbook auth --check
Action: Read auth/runbook-release.md → validate provenance SHAs → output report

Input: /runbook --update --request docs/features/auth/requests/2026-04-01-login-fix.md
Action: Read existing runbook → diff stale sections → update → /codex-review-doc

Signals

GitHub stars
188
Forks
24
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
runbook-sd0xdev
Source
github.com/sd0xdev/sd0x-harness