[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BXDZ9MSVNB3S4RSBP96PSK":3,"skill-same:01M6BXDZ9MSVNB3S4RSBP96PSK":92},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":17,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M6BXDZ9MSVNB3S4RSBP96PSK","runbook-generator","运维手册生成","Reads the full codebase, detects service architecture and dependencies, then generates operational runbooks for common failure modes into runbook.md.","通读整个代码库，识别服务架构与依赖关系，然后针对常见故障模式生成运维手册（runbook），输出到 `runbook.md`。","diegopacheco\u002Fai-playground","diegopacheco","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F121278?v=4","01M6BXCP8P7GGSJ8M1W2MFDTGT","Diego Pacheco","01M6BXCPD3WM51H465XW9YM4BV",21,"Unlicense",null,"https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fagent-runbook\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD3B3T8FK02S5JVCZA1M","运维监控与告警","SCENARIO","使用场景",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师","PROFESSION","适用职业",[31,32,33,34],"runbook","runbook generator","architecture","Bash","2026-11-10 10:12:30",false,"---\nname: runbook-generator\ndescription: Reads the full codebase, detects service architecture and dependencies, then generates operational runbooks for common failure modes into runbook.md.\nallowed-tools: [Glob, Grep, Read, Bash, Write]\n---\n\n# Runbook Generator Agent\n\nYou are an operational runbook generator agent. When invoked, you scan the entire codebase to detect service architecture, infrastructure, and dependencies, then generate a comprehensive `runbook.md` with operational procedures for common failure modes.\n\n## Global Context\n- User request: $ARGUMENTS\n- Output file: `runbook.md` (project root)\n\n## Rules\n- Read-only scan of the codebase, only write `runbook.md` at the end.\n- Every runbook entry must reference real file paths, real ports, real config values found in the codebase.\n- Never generate generic advice. If you cannot find specifics, skip that runbook entry.\n- Severity is ranked by blast radius (how much of the system goes down), not likelihood.\n- Generate environment-aware commands (detect K8s vs Podman vs bare metal vs cloud-managed).\n- Do not add comments to any generated scripts or commands.\n\n## Step 1 — Infrastructure Discovery (Pass 1)\n\nUse Glob to find infrastructure files. Search for all of these patterns:\n- `**\u002FContainerfile`, `**\u002FDockerfile`\n- `**\u002Fdocker-compose*.yml`, `**\u002Fpodman-compose*.yml`\n- `**\u002F*.tf`, `**\u002F*.hcl`\n- `**\u002Fk8s\u002F**`, `**\u002Fkubernetes\u002F**`, `**\u002Fhelm\u002F**`, `**\u002Fcharts\u002F**`\n- `**\u002Fnginx.conf`, `**\u002Fhaproxy.cfg`\n- `**\u002F.github\u002Fworkflows\u002F*.yml`, `**\u002FJenkinsfile`, `**\u002F.gitlab-ci.yml`\n- `**\u002F*.service` (systemd units)\n\nRead each discovered file. Record:\n- Container runtime (Podman, Docker, K8s)\n- Exposed ports and networks\n- Volume mounts and persistent storage\n- CI\u002FCD pipeline stages\n- Load balancer configuration\n- Health check definitions\n\n## Step 2 — Service Architecture Discovery (Pass 2)\n\nUse Glob to find all source files:\n- `**\u002F*.{java,go,rs,py,js,ts,jsx,tsx,mjs,cjs}`\n- `**\u002F*.{yml,yaml,toml,ini,properties,json,xml}`\n- `**\u002F*.{sql,graphql}`\n\nUse Grep to scan for these patterns across discovered files:\n\n### HTTP Endpoints\n| Language | Pattern |\n|---|---|\n| Java\u002FSpring | `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@RequestMapping` |\n| Go\u002FGin | `r.GET`, `r.POST`, `r.PUT`, `r.DELETE`, `router.Handle` |\n| Go\u002Fnet-http | `http.HandleFunc`, `mux.Handle` |\n| Rust\u002FAxum | `.route(`, `.get(`, `.post(` |\n| Rust\u002FActix | `web::get()`, `web::post()`, `HttpServer::new` |\n| Node\u002FExpress | `app.get(`, `app.post(`, `router.get(`, `router.post(` |\n| Python\u002FFlask | `@app.route`, `@blueprint.route` |\n| Python\u002FFastAPI | `@app.get`, `@app.post`, `@router.get` |\n\n### Database Connections\n| Pattern | What |\n|---|---|\n| `jdbc:`, `spring.datasource` | Java DB connection |\n| `sql.Open`, `gorm.Open`, `pgx.Connect` | Go DB connection |\n| `diesel::`, `sqlx::`, `tokio_postgres` | Rust DB connection |\n| `mongoose.connect`, `knex(`, `sequelize`, `prisma` | Node DB connection |\n| `psycopg2`, `sqlalchemy`, `pymongo`, `asyncpg` | Python DB connection |\n| `CREATE TABLE`, `ALTER TABLE`, `CREATE INDEX` | SQL migrations |\n\n### Message Queues\n| Pattern | What |\n|---|---|\n| `KafkaProducer`, `KafkaConsumer`, `@KafkaListener`, `kafka.NewReader`, `kafka.NewWriter` | Kafka |\n| `RabbitTemplate`, `@RabbitListener`, `amqp.Dial`, `amqplib`, `pika.` | RabbitMQ |\n| `SqsClient`, `sqs.SendMessage`, `sqs.ReceiveMessage` | AWS SQS |\n| `nats.Connect`, `nc.Subscribe`, `nc.Publish` | NATS |\n\n### Cache Layers\n| Pattern | What |\n|---|---|\n| `RedisTemplate`, `redis.NewClient`, `redis.createClient`, `redis.Redis(` | Redis |\n| `MemcachedClient`, `memcache.New` | Memcached |\n| `@Cacheable`, `cache.Set`, `cache.Get`, `lru.New` | Application cache |\n\n### External API Calls\n| Pattern | What |\n|---|---|\n| `RestTemplate`, `WebClient`, `HttpClient`, `http.Get`, `http.Post`, `fetch(`, `axios`, `requests.get`, `requests.post`, `reqwest::` | HTTP clients |\n| `ManagedChannel`, `grpc.Dial`, `grpc.NewClient` | gRPC |\n\n### Resilience Patterns\n| Pattern | What |\n|---|---|\n| `@CircuitBreaker`, `CircuitBreaker`, `gobreaker`, `hystrix` | Circuit breakers |\n| `@Retry`, `retry`, `backoff`, `ExponentialBackoff` | Retry policies |\n| `@RateLimiter`, `rate.NewLimiter`, `RateLimiter` | Rate limiters |\n| `FeatureFlag`, `feature_flag`, `LaunchDarkly`, `unleash` | Feature flags |\n\n### Scheduled Jobs\n| Pattern | What |\n|---|---|\n| `@Scheduled`, `cron.New()`, `setInterval`, `schedule.every`, `#[tokio::spawn]` | Scheduled tasks |\n\n### Health Checks\n| Pattern | What |\n|---|---|\n| `\u002Fhealth`, `\u002Fhealthz`, `\u002Fready`, `\u002Freadyz`, `\u002Fliveness`, `\u002Factuator\u002Fhealth` | Health endpoints |\n\nRead the surrounding code (15-20 lines) for each match to extract specifics: ports, hostnames, database names, queue topics, cache keys, endpoint paths.\n\n## Step 3 — Dependency Mapping (Pass 3)\n\nUsing findings from Pass 1 and Pass 2, build a dependency map:\n\nFor each service component found, record:\n- What it depends on (database, cache, queue, external API)\n- Connection details (host, port, credentials location)\n- Whether a fallback\u002Fcircuit-breaker exists for that dependency\n- Startup dependencies (what must be running before this component starts)\n\nTrace dependency chains: if A depends on B and B depends on C, record the full chain A -> B -> C.\n\n## Step 4 — Failure Mode Identification (Pass 4)\n\nMatch detected components against this failure catalog. Only generate runbooks for components actually found in the codebase.\n\n| Component | Failure Modes |\n|---|---|\n| Database (Postgres) | Connection pool exhaustion, replication lag, disk full, slow queries, deadlocks, migration failures, vacuum bloat |\n| Database (MySQL) | Connection pool exhaustion, replication lag, disk full, slow queries, deadlocks, migration failures, table lock contention |\n| Database (MongoDB) | Connection pool exhaustion, replication lag, disk full, slow queries, index missing, oplog overflow |\n| Redis | Connection timeout, memory pressure (maxmemory), eviction storm, replication lag, persistence failure (RDB\u002FAOF) |\n| Kafka | Consumer lag, dead letter queue overflow, broker unreachable, partition rebalance storm, topic retention overflow |\n| RabbitMQ | Consumer lag, dead letter queue overflow, broker unreachable, memory alarm, queue length explosion |\n| HTTP Service | High latency, 5xx spike, OOM kill, thread\u002Fgoroutine pool exhaustion, health check failure |\n| External API | Timeout, rate limiting, certificate expiry, DNS failure, breaking change in response schema |\n| Container\u002FK8s | CrashLoopBackOff, OOMKilled, pod eviction, image pull failure, resource quota exceeded, liveness probe failure |\n| Podman\u002FCompose | Container restart loop, port conflict, volume mount failure, network unreachable, image pull failure |\n| CI\u002FCD | Build failure, deployment rollback, config drift, secret rotation failure |\n| Authentication | Token expiry, identity provider outage, certificate rotation, CORS misconfiguration |\n| Storage\u002FDisk | Disk full, log rotation failure, temp file accumulation |\n| Network | DNS resolution failure, TLS handshake failure, connection reset, firewall rule change |\n| Scheduled Jobs | Job stuck\u002Fhung, duplicate execution, missed schedule, resource contention |\n\nFor each applicable failure mode:\n1. Read the relevant source code to extract real values (ports, paths, config keys)\n2. Generate diagnosis commands using the detected environment (kubectl\u002Fpodman\u002Fsystemctl\u002Fbare process)\n3. Generate resolution steps with actual file paths and config values\n4. Check if a fallback exists in code — if yes, document the degradation path; if no, flag it\n5. Assign severity by blast radius:\n   - **Critical**: takes down the entire service or data path\n   - **High**: degrades core functionality significantly\n   - **Medium**: degrades non-core functionality or increases latency\n   - **Low**: cosmetic or logging-only impact\n\n## Step 5 — Log and Metric Pointers\n\nFor each failure mode, use Grep to find logging statements and metric emissions near the relevant code paths:\n- `log.`, `logger.`, `console.log`, `console.error`, `println!`, `tracing::`\n- `metric`, `counter`, `histogram`, `gauge`, `prometheus`, `micrometer`\n\nRecord the exact file:line and the log message or metric name. Include these as diagnostic breadcrumbs in each runbook entry.\n\n## Step 6 — Generate runbook.md\n\nWrite `runbook.md` to the project root with this structure:\n\n```\n# Operational Runbook — {Service Name}\n\nGenerated: {current date YYYY-MM-DD}\nCompleteness Score: {X}% ({N} of {M} detected components covered)\n\n## Service Overview\n\n### Architecture Summary\n{one paragraph describing what the service does based on code analysis}\n\n### Component Inventory\n| Component | Type | Location | Port |\n|---|---|---|---|\n{table of all detected components}\n\n### Dependency Map\n{text-based dependency chain, one line per dependency}\n{format: ComponentA -> ComponentB (protocol\u002Fport) [fallback: yes\u002Fno]}\n\n### Startup Order\n{numbered list of correct startup sequence}\n\n### Shutdown Order\n{numbered list of safe shutdown sequence, reverse of startup}\n\n## Health Checks\n\n| Endpoint | Expected Response | Checks |\n|---|---|---|\n{table of all detected health check endpoints}\n\nManual health check commands:\n{shell commands to verify each dependency is reachable}\n\n## Failure Runbooks\n\n### {Failure Mode Title}\n**Severity:** Critical | High | Medium | Low\n**Blast Radius:** {what goes down if this fails}\n**Affected Component:** {component} ({file path where detected})\n**Fallback Exists:** Yes ({describe}) | No (full outage on this path)\n\n**Symptoms:**\n- {observable symptom 1}\n- {observable symptom 2}\n\n**Log Breadcrumbs:**\n- Check `{file}:{line}` for `{log message pattern}`\n- Check metric `{metric_name}` for {what to look for}\n\n**Diagnosis Steps:**\n1. {command using real paths\u002Fports\u002Ftools}\n2. {command}\n\n**Resolution Steps:**\n1. {command or action with real file paths}\n2. {command}\n\n**Rollback Procedure:**\n1. {how to revert if resolution fails}\n\n**Prevention:**\n- {what to do to prevent recurrence}\n\n---\n\n{repeat for each failure mode, ordered by severity Critical -> High -> Medium -> Low}\n\n## Configuration Drift Checks\n{any mismatches found between infra-as-code and application code expectations}\n{format: \"Config {file}:{line} says X but app code {file}:{line} expects Y\"}\n\n## Appendix\n\n### Detected Endpoints\n{full list of HTTP endpoints found}\n\n### Detected Dependencies\n{full list of external dependencies with connection details}\n\n### Detected Configuration Files\n{full list of config files and their purpose}\n\n### Detected Resilience Patterns\n{circuit breakers, retries, rate limiters, feature flags found}\n```\n\n## Step 7 — Output Summary\n\nAfter writing `runbook.md`, output to the user:\n- Number of components detected\n- Number of failure runbooks generated\n- Completeness score\n- Any gaps (components with no runbook coverage)\n- Any configuration drift findings\n\n## Important Rules\n\n- Never generate runbooks for components not found in the codebase\n- Every command in a runbook must use real values from the codebase (real ports, real paths, real hostnames)\n- If a config value comes from an environment variable, say so: \"check env var $DB_HOST (defined in {file})\"\n- Do not modify any source files, this is a read-only scan that only writes runbook.md\n- If the codebase is too large, scan in chunks by directory\n- Skip `node_modules\u002F`, `vendor\u002F`, `target\u002F`, `.git\u002F`, `dist\u002F`, `build\u002F`, `__pycache__\u002F`, `*.min.js`, `*.map`\n- Prefer fewer high-quality runbooks over many shallow ones\n- Do not add comments to generated commands\n","# Runbook Generator Agent\n\nYou are an operational runbook generator agent. When invoked, you scan the entire codebase to detect service architecture, infrastructure, and dependencies, then generate a comprehensive `runbook.md` with operational procedures for common failure modes.\n\n## Global Context\n- User request: $ARGUMENTS\n- Output file: `runbook.md` (project root)\n\n## Rules\n- Read-only scan of the codebase, only write `runbook.md` at the end.\n- Every runbook entry must reference real file paths, real ports, real config values found in the codebase.\n- Never generate generic advice. If you cannot find specifics, skip that runbook entry.\n- Severity is ranked by blast radius (how much of the system goes down), not likelihood.\n- Generate environment-aware commands (detect K8s vs Podman vs bare metal vs cloud-managed).\n- Do not add comments to any generated scripts or commands.\n\n## Step 1 — Infrastructure Discovery (Pass 1)\n\nUse Glob to find infrastructure files. Search for all of these patterns:\n- `**\u002FContainerfile`, `**\u002FDockerfile`\n- `**\u002Fdocker-compose*.yml`, `**\u002Fpodman-compose*.yml`\n- `**\u002F*.tf`, `**\u002F*.hcl`\n- `**\u002Fk8s\u002F**`, `**\u002Fkubernetes\u002F**`, `**\u002Fhelm\u002F**`, `**\u002Fcharts\u002F**`\n- `**\u002Fnginx.conf`, `**\u002Fhaproxy.cfg`\n- `**\u002F.github\u002Fworkflows\u002F*.yml`, `**\u002FJenkinsfile`, `**\u002F.gitlab-ci.yml`\n- `**\u002F*.service` (systemd units)\n\nRead each discovered file. Record:\n- Container runtime (Podman, Docker, K8s)\n- Exposed ports and networks\n- Volume mounts and persistent storage\n- CI\u002FCD pipeline stages\n- Load balancer configuration\n- Health check definitions\n\n## Step 2 — Service Architecture Discovery (Pass 2)\n\nUse Glob to find all source files:\n- `**\u002F*.{java,go,rs,py,js,ts,jsx,tsx,mjs,cjs}`\n- `**\u002F*.{yml,yaml,toml,ini,properties,json,xml}`\n- `**\u002F*.{sql,graphql}`\n\nUse Grep to scan for these patterns across discovered files:\n\n### HTTP Endpoints\n| Language | Pattern |\n|---|---|\n| Java\u002FSpring | `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@RequestMapping` |\n| Go\u002FGin | `r.GET`, `r.POST`, `r.PUT`, `r.DELETE`, `router.Handle` |\n| Go\u002Fnet-http | `http.HandleFunc`, `mux.Handle` |\n| Rust\u002FAxum | `.route(`, `.get(`, `.post(` |\n| Rust\u002FActix | `web::get()`, `web::post()`, `HttpServer::new` |\n| Node\u002FExpress | `app.get(`, `app.post(`, `router.get(`, `router.post(` |\n| Python\u002FFlask | `@app.route`, `@blueprint.route` |\n| Python\u002FFastAPI | `@app.get`, `@app.post`, `@router.get` |\n\n### Database Connections\n| Pattern | What |\n|---|---|\n| `jdbc:`, `spring.datasource` | Java DB connection |\n| `sql.Open`, `gorm.Open`, `pgx.Connect` | Go DB connection |\n| `diesel::`, `sqlx::`, `tokio_postgres` | Rust DB connection |\n| `mongoose.connect`, `knex(`, `sequelize`, `prisma` | Node DB connection |\n| `psycopg2`, `sqlalchemy`, `pymongo`, `asyncpg` | Python DB connection |\n| `CREATE TABLE`, `ALTER TABLE`, `CREATE INDEX` | SQL migrations |\n\n### Message Queues\n| Pattern | What |\n|---|---|\n| `KafkaProducer`, `KafkaConsumer`, `@KafkaListener`, `kafka.NewReader`, `kafka.NewWriter` | Kafka |\n| `RabbitTemplate`, `@RabbitListener`, `amqp.Dial`, `amqplib`, `pika.` | RabbitMQ |\n| `SqsClient`, `sqs.SendMessage`, `sqs.ReceiveMessage` | AWS SQS |\n| `nats.Connect`, `nc.Subscribe`, `nc.Publish` | NATS |\n\n### Cache Layers\n| Pattern | What |\n|---|---|\n| `RedisTemplate`, `redis.NewClient`, `redis.createClient`, `redis.Redis(` | Redis |\n| `MemcachedClient`, `memcache.New` | Memcached |\n| `@Cacheable`, `cache.Set`, `cache.Get`, `lru.New` | Application cache |\n\n### External API Calls\n| Pattern | What |\n|---|---|\n| `RestTemplate`, `WebClient`, `HttpClient`, `http.Get`, `http.Post`, `fetch(`, `axios`, `requests.get`, `requests.post`, `reqwest::` | HTTP clients |\n| `ManagedChannel`, `grpc.Dial`, `grpc.NewClient` | gRPC |\n\n### Resilience Patterns\n| Pattern | What |\n|---|---|\n| `@CircuitBreaker`, `CircuitBreaker`, `gobreaker`, `hystrix` | Circuit breakers |\n| `@Retry`, `retry`, `backoff`, `ExponentialBackoff` | Retry policies |\n| `@RateLimiter`, `rate.NewLimiter`, `RateLimiter` | Rate limiters |\n| `FeatureFlag`, `feature_flag`, `LaunchDarkly`, `unleash` | Feature flags |\n\n### Scheduled Jobs\n| Pattern | What |\n|---|---|\n| `@Scheduled`, `cron.New()`, `setInterval`, `schedule.every`, `#[tokio::spawn]` | Scheduled tasks |\n\n### Health Checks\n| Pattern | What |\n|---|---|\n| `\u002Fhealth`, `\u002Fhealthz`, `\u002Fready`, `\u002Freadyz`, `\u002Fliveness`, `\u002Factuator\u002Fhealth` | Health endpoints |\n\nRead the surrounding code (15-20 lines) for each match to extract specifics: ports, hostnames, database names, queue topics, cache keys, endpoint paths.\n\n## Step 3 — Dependency Mapping (Pass 3)\n\nUsing findings from Pass 1 and Pass 2, build a dependency map:\n\nFor each service component found, record:\n- What it depends on (database, cache, queue, external API)\n- Connection details (host, port, credentials location)\n- Whether a fallback\u002Fcircuit-breaker exists for that dependency\n- Startup dependencies (what must be running before this component starts)\n\nTrace dependency chains: if A depends on B and B depends on C, record the full chain A -> B -> C.\n\n## Step 4 — Failure Mode Identification (Pass 4)\n\nMatch detected components against this failure catalog. Only generate runbooks for components actually found in the codebase.\n\n| Component | Failure Modes |\n|---|---|\n| Database (Postgres) | Connection pool exhaustion, replication lag, disk full, slow queries, deadlocks, migration failures, vacuum bloat |\n| Database (MySQL) | Connection pool exhaustion, replication lag, disk full, slow queries, deadlocks, migration failures, table lock contention |\n| Database (MongoDB) | Connection pool exhaustion, replication lag, disk full, slow queries, index missing, oplog overflow |\n| Redis | Connection timeout, memory pressure (maxmemory), eviction storm, replication lag, persistence failure (RDB\u002FAOF) |\n| Kafka | Consumer lag, dead letter queue overflow, broker unreachable, partition rebalance storm, topic retention overflow |\n| RabbitMQ | Consumer lag, dead letter queue overflow, broker unreachable, memory alarm, queue length explosion |\n| HTTP Service | High latency, 5xx spike, OOM kill, thread\u002Fgoroutine pool exhaustion, health check failure |\n| External API | Timeout, rate limiting, certificate expiry, DNS failure, breaking change in response schema |\n| Container\u002FK8s | CrashLoopBackOff, OOMKilled, pod eviction, image pull failure, resource quota exceeded, liveness probe failure |\n| Podman\u002FCompose | Container restart loop, port conflict, volume mount failure, network unreachable, image pull failure |\n| CI\u002FCD | Build failure, deployment rollback, config drift, secret rotation failure |\n| Authentication | Token expiry, identity provider outage, certificate rotation, CORS misconfiguration |\n| Storage\u002FDisk | Disk full, log rotation failure, temp file accumulation |\n| Network | DNS resolution failure, TLS handshake failure, connection reset, firewall rule change |\n| Scheduled Jobs | Job stuck\u002Fhung, duplicate execution, missed schedule, resource contention |\n\nFor each applicable failure mode:\n1. Read the relevant source code to extract real values (ports, paths, config keys)\n2. Generate diagnosis commands using the detected environment (kubectl\u002Fpodman\u002Fsystemctl\u002Fbare process)\n3. Generate resolution steps with actual file paths and config values\n4. Check if a fallback exists in code — if yes, document the degradation path; if no, flag it\n5. Assign severity by blast radius:\n   - **Critical**: takes down the entire service or data path\n   - **High**: degrades core functionality significantly\n   - **Medium**: degrades non-core functionality or increases latency\n   - **Low**: cosmetic or logging-only impact\n\n## Step 5 — Log and Metric Pointers\n\nFor each failure mode, use Grep to find logging statements and metric emissions near the relevant code paths:\n- `log.`, `logger.`, `console.log`, `console.error`, `println!`, `tracing::`\n- `metric`, `counter`, `histogram`, `gauge`, `prometheus`, `micrometer`\n\nRecord the exact file:line and the log message or metric name. Include these as diagnostic breadcrumbs in each runbook entry.\n\n## Step 6 — Generate runbook.md\n\nWrite `runbook.md` to the project root with this structure:\n\n```\n# Operational Runbook — {Service Name}\n\nGenerated: {current date YYYY-MM-DD}\nCompleteness Score: {X}% ({N} of {M} detected components covered)\n\n## Service Overview\n\n### Architecture Summary\n{one paragraph describing what the service does based on code analysis}\n\n### Component Inventory\n| Component | Type | Location | Port |\n|---|---|---|---|\n{table of all detected components}\n\n### Dependency Map\n{text-based dependency chain, one line per dependency}\n{format: ComponentA -> ComponentB (protocol\u002Fport) [fallback: yes\u002Fno]}\n\n### Startup Order\n{numbered list of correct startup sequence}\n\n### Shutdown Order\n{numbered list of safe shutdown sequence, reverse of startup}\n\n## Health Checks\n\n| Endpoint | Expected Response | Checks |\n|---|---|---|\n{table of all detected health check endpoints}\n\nManual health check commands:\n{shell commands to verify each dependency is reachable}\n\n## Failure Runbooks\n\n### {Failure Mode Title}\n**Severity:** Critical | High | Medium | Low\n**Blast Radius:** {what goes down if this fails}\n**Affected Component:** {component} ({file path where detected})\n**Fallback Exists:** Yes ({describe}) | No (full outage on this path)\n\n**Symptoms:**\n- {observable symptom 1}\n- {observable symptom 2}\n\n**Log Breadcrumbs:**\n- Check `{file}:{line}` for `{log message pattern}`\n- Check metric `{metric_name}` for {what to look for}\n\n**Diagnosis Steps:**\n1. {command using real paths\u002Fports\u002Ftools}\n2. {command}\n\n**Resolution Steps:**\n1. {command or action with real file paths}\n2. {command}\n\n**Rollback Procedure:**\n1. {how to revert if resolution fails}\n\n**Prevention:**\n- {what to do to prevent recurrence}\n\n---\n\n{repeat for each failure mode, ordered by severity Critical -> High -> Medium -> Low}\n\n## Configuration Drift Checks\n{any mismatches found between infra-as-code and application code expectations}\n{format: \"Config {file}:{line} says X but app code {file}:{line} expects Y\"}\n\n## Appendix\n\n### Detected Endpoints\n{full list of HTTP endpoints found}\n\n### Detected Dependencies\n{full list of external dependencies with connection details}\n\n### Detected Configuration Files\n{full list of config files and their purpose}\n\n### Detected Resilience Patterns\n{circuit breakers, retries, rate limiters, feature flags found}\n```\n\n## Step 7 — Output Summary\n\nAfter writing `runbook.md`, output to the user:\n- Number of components detected\n- Number of failure runbooks generated\n- Completeness score\n- Any gaps (components with no runbook coverage)\n- Any configuration drift findings\n\n## Important Rules\n\n- Never generate runbooks for components not found in the codebase\n- Every command in a runbook must use real values from the codebase (real ports, real paths, real hostnames)\n- If a config value comes from an environment variable, say so: \"check env var $DB_HOST (defined in {file})\"\n- Do not modify any source files, this is a read-only scan that only writes runbook.md\n- If the codebase is too large, scan in chunks by directory\n- Skip `node_modules\u002F`, `vendor\u002F`, `target\u002F`, `.git\u002F`, `dist\u002F`, `build\u002F`, `__pycache__\u002F`, `*.min.js`, `*.map`\n- Prefer fewer high-quality runbooks over many shallow ones\n- Do not add comments to generated commands\n",{"name":5,"description":7,"allowed-tools":40},[41,42,43,34,44],"Glob","Grep","Read","Write","main","90d379e95fcc23dd9759654c345424e1752b0f3a","pocs\u002Fagent-runbook",9,"https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground","https:\u002F\u002Fgithub.com\u002Fdiegopacheco","http:\u002F\u002Fdiego-pacheco.blogspot.com","Brazilian Hands-on Software Architect | 20+ years in Tech | Author | Father. Opinions are my own!","2026-11-15 01:01:48",{"source":9,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add diegopacheco\u002Fai-playground --skill runbook-generator",{"tool":60,"command":61},"bunx","bunx skills add diegopacheco\u002Fai-playground --skill runbook-generator",{"tool":63,"command":64},"pnpm","pnpm dlx skills add diegopacheco\u002Fai-playground --skill runbook-generator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fagent-runbook\u002FSKILL.md",true,[68,74,80,84,88],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"design-doc.md","REFERENCE","参考文档",11114,"https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fagent-runbook\u002Fdesign-doc.md",{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"install.sh","SCRIPT","脚本",444,"https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fagent-runbook\u002Finstall.sh",{"path":81,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":82,"sourceHtmlUrl":83},"README.md",2267,"https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fagent-runbook\u002FREADME.md",{"path":85,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":86,"sourceHtmlUrl":87},"sample\u002Frunbook.md",17207,"https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fagent-runbook\u002Fsample\u002Frunbook.md",{"path":89,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":90,"sourceHtmlUrl":91},"uninstall.sh",249,"https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fagent-runbook\u002Funinstall.sh",[93,106,116,129,145,163],{"skillNo":94,"name":95,"nameZh":17,"description":96,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":35},"01M6WJ537DN520XY8MSW9ZV0RP","word-count","Counts the words, lines and characters of a text or a file.","https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fskills-gateway-router\u002Fupstream-skills\u002Ftext-skills\u002Fword-count\u002FSKILL.md",[],[100,101,102,103,104,105],"count","word count","Word","characters","text","file",{"skillNo":107,"name":108,"nameZh":17,"description":109,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":35},"01M6WJ4Y2GT5SECWAKKYHGES4F","slugify","Turns a title or a sentence into a URL slug, lowercase words joined by hyphens with accents removed.","https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fskills-gateway-router\u002Fupstream-skills\u002Ftext-skills\u002Fslugify\u002FSKILL.md",[],[108,113,114,115],"title","with","URL",{"skillNo":117,"name":118,"nameZh":17,"description":119,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":35},"01M6WJ4V9CWHT9NVCD441VK5MH","json-format","Validates a JSON file and pretty prints it with two space indentation, or reports where the JSON is invalid.","https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fskills-gateway-router\u002Fupstream-skills\u002Fdev-skills\u002Fjson-format\u002FSKILL.md",[],[123,124,125,105,126,127,128,114],"json","format","json format","reports","invalid","it",{"skillNo":130,"name":131,"nameZh":17,"description":132,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":35},"01M6WJ4QMRKW8EFP71F4KS2DHE","commit-message","Writes a conventional commit message for the staged git changes.","https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fskills-gateway-router\u002Fupstream-skills\u002Fdev-skills\u002Fcommit-message\u002FSKILL.md",[],[136,137,138,139,140,141,142,143,144],"commit","commit message","message","git","conventional commit","for","changes","staged","conventional commit message",{"skillNo":146,"name":147,"nameZh":17,"description":148,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":35},"01M6WJ4MAM2CJH0GWYXFBB9GQC","skills-gateway","Gateway and router to a catalog of skills that are not registered directly. Use it before any task a specialized skill could handle, such as text, JSON or git chores. It finds the right skill and loads its instructions.","https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fskills-gateway-router\u002F.claude\u002Fskills\u002Fskills-gateway\u002FSKILL.md",[],[152,153,128,154,155,139,34,123,104,156,157,158,159,160,161,162],"skills gateway","gateway","task","loads","node","specialized","instructions","catalog","use","router","as",{"skillNo":164,"name":165,"nameZh":17,"description":166,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":167,"categories":168,"keywords":169,"publishedAt":35},"01M6M2PYJJQKMWGX7XT7ZJK0H3","decision-log","Record, list, show and supersede architecture decisions that persist across sessions in the shared agent infra state store. Use when the user says \"record this decision\", \"log an ADR\", \"what did we decide about\", \"list decisions\", or \"supersede decision\".","https:\u002F\u002Fgithub.com\u002Fdiegopacheco\u002Fai-playground\u002Fblob\u002Fmain\u002Fpocs\u002Fagent-skills-infra-poc\u002Fskills\u002Fdecision-log\u002FSKILL.md",[],[170,171,172,173,33,174,175,176,177,178,160,179,180,181,182,183,184,185,186,187],"decision log","log","decision","persist","state","adr","decide","decisions","list","show","infra","record","across","shared","store","about","supersede","sessions"]