skills/docs/runbook/SKILL.md
Use when creating deployment runbooks, troubleshooting guides, or rollback procedures.
npx skillsauth add faysilalshareef/dotnet-ai-kit runbookInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
# Deployment Runbook: {Service Name}
## Prerequisites
- [ ] Azure CLI authenticated (`az login`)
- [ ] kubectl configured for target cluster
- [ ] Docker image built and pushed to ACR
- [ ] Database migrations applied (if applicable)
- [ ] Service Bus topics/subscriptions created (if new)
- [ ] Environment secrets configured in K8s
## Pre-Deployment Checks
1. Verify current service health: `kubectl get pods -n {company}-{env}`
2. Check Service Bus dead letter queue is empty
3. Verify database migration status
4. Confirm no active deployments in progress
## Deployment Steps
### Step 1: Apply Database Migrations
```bash
dotnet ef database update \
--project src/{Company}.{Domain}.Command \
--connection "#{CONNECTION_STRING}#"
kubectl apply -f deploy/{env}-manifest.yaml -n {company}-{env}
kubectl rollout status deployment/{domain}-command -n {company}-{env} --timeout=300s
kubectl get pods -l app={domain}-command -n {company}-{env}
curl -f http://{domain}-command:8080/health/ready
kubectl apply -f deploy/{env}-manifest.yaml -n {company}-{env}
kubectl rollout status deployment/{domain}-query -n {company}-{env} --timeout=300s
kubectl apply -f deploy/{env}-manifest.yaml -n {company}-{env}
kubectl rollout status deployment/{domain}-gateway -n {company}-{env} --timeout=300s
kubectl get pods -n {company}-{env}# Rollback to previous version
kubectl rollout undo deployment/{domain}-command -n {company}-{env}
kubectl rollout undo deployment/{domain}-query -n {company}-{env}
kubectl rollout undo deployment/{domain}-gateway -n {company}-{env}
# Verify rollback
kubectl rollout status deployment/{domain}-command -n {company}-{env}
### Troubleshooting Guide
```markdown
## Common Issues
### Pod CrashLoopBackOff
**Symptoms**: Pod restarts repeatedly
**Check**: `kubectl logs {pod-name} -n {company}-{env} --previous`
**Common causes**:
- Missing environment variable or secret
- Database connection string incorrect
- Service Bus connection string expired
**Resolution**: Fix configuration and redeploy
### Service Bus Messages Stuck
**Symptoms**: Messages not being processed, dead letter queue growing
**Check**: Azure portal -> Service Bus -> Topic -> Subscription -> Messages
**Common causes**:
- Processor not running
- Event deserializer missing new event type
- Query database down
**Resolution**: Check processor logs, verify EventDeserializer, check DB
### gRPC Connection Refused
**Symptoms**: Gateway returns 502/503
**Check**: `kubectl get svc -n {company}-{env}` for service endpoints
**Common causes**:
- Target service not running
- Wrong service URL in ExternalServices configuration
- Port mismatch (8080 vs 8081)
**Resolution**: Verify service is running and URL matches K8s service name
| Anti-Pattern | Correct Approach | |---|---| | Undocumented deployment steps | Step-by-step runbook for every service | | No rollback procedure | Always document how to rollback | | Missing verification steps | Verify after each deployment step | | Generic troubleshooting | Specific symptoms, checks, and resolutions |
# Find existing runbooks
find . -name "*runbook*" -o -name "*deployment*" | grep -i ".md"
# Find deployment scripts
find . -name "deploy*" -type f
# Find K8s manifests
find . -name "*manifest*" -name "*.yaml"
docs/ directorydata-ai
Use when about to claim work is complete, fixed, passing, or ready — before committing, creating PRs, or moving to the next task. Requires running verification commands and confirming output before making any success claims.
development
Use when encountering any bug, test failure, build error, or unexpected behavior — before proposing fixes or making changes.
development
Use when checkpointing, wrapping up, or handing off an AI-assisted development session.
development
Use when following the Specification-Driven Development lifecycle from plan through ship.