Troubleshooting guide

From jmagly/aiwg · View interactive version

Troubleshooting guide is an AI agent skill from the GitHub repository jmagly/aiwg. Generate troubleshooting documentation

How to use this skill

Skill file

Troubleshooting Guide Generator Command

Generate troubleshooting documentation

Instructions

Follow this systematic approach to create troubleshooting guides: $ARGUMENTS

  1. System Overview and Architecture
  1. Common Issues Identification
  1. Troubleshooting Framework
  1. Diagnostic Tools and Commands

```markdown

## Essential Diagnostic Commands

### System Health

```bash

# Check system resources

top # CPU and memory usage

df -h # Disk space

free -m # Memory usage

netstat -tuln # Network connections

# Application logs

tail -f /var/log/app.log

journalctl -u service-name -f

# Database connectivity

mysql -u user -p -e "SELECT 1"

psql -h host -U user -d db -c "SELECT 1"

```

```

  1. Issue Categories and Solutions

Performance Issues:

```markdown

### Slow Response Times

Symptoms:

Diagnostic Steps:

1. Check system resources (CPU, memory, disk)

2. Review application logs for errors

3. Analyze database query performance

4. Check network connectivity and latency

Common Causes:

Solutions:

```

  1. Error Code Documentation

```markdown

## Error Code Reference

### HTTP Status Codes

```

  1. Environment-Specific Issues
  1. Database Troubleshooting

```markdown

### Database Connection Issues

Symptoms:

Diagnostic Commands:

```sql

-- Check active connections

SHOW PROCESSLIST;

-- Check database size

SELECT table_schema,

ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) AS 'DB Size in MB'

FROM information_schema.tables

GROUP BY table_schema;

-- Check slow queries

SHOW VARIABLES LIKE 'slow_query_log';

```

```

  1. Network and Connectivity Issues

```markdown

### Network Troubleshooting

Basic Connectivity:

```bash

# Test basic connectivity

ping example.com

telnet host port

curl -v https://api.example.com/health

# DNS resolution

nslookup example.com

dig example.com

# Network routing

traceroute example.com

```

SSL/TLS Issues:

```bash

# Check SSL certificate

openssl s_client -connect example.com:443

curl -vI https://example.com

```

```

  1. Application-Specific Troubleshooting

Memory Issues:

```markdown

### Out of Memory Errors

Java Applications:

```bash

# Check heap usage

jstat -gc [PID]

jmap -dump:format=b,file=heapdump.hprof [PID]

# Analyze heap dump

jhat heapdump.hprof

```

Node.js Applications:

```bash

# Monitor memory usage

node --inspect app.js

# Use Chrome DevTools for memory profiling

```

```

  1. Security and Authentication Issues

```markdown

### Authentication Failures

Symptoms:

Diagnostic Steps:

1. Verify credentials and tokens

2. Check token expiration

3. Validate authentication service

4. Review CORS configuration

Common Solutions:

```

  1. Deployment and Configuration Issues

```markdown

### Deployment Failures

Container Issues:

```bash

# Check container status

docker ps -a

docker logs container-name

# Check resource limits

docker stats

# Debug container

docker exec -it container-name /bin/bash

```

Kubernetes Issues:

```bash

# Check pod status

kubectl get pods

kubectl describe pod pod-name

kubectl logs pod-name

# Check service connectivity

kubectl get svc

kubectl port-forward pod-name 8080:8080

```

```

  1. Monitoring and Alerting Setup
  1. Escalation Procedures

```markdown

## Escalation Matrix

### Severity Levels

Critical (P1): System down, data loss

High (P2): Major functionality impaired

Medium (P3): Minor functionality issues

```

  1. Recovery Procedures
  1. Preventive Measures
  1. Knowledge Base Integration
  1. Team Communication

```markdown

## Communication Channels

### Immediate Response

### Status Updates

```

  1. Documentation Maintenance
  1. Self-Service Tools

Advanced Troubleshooting Techniques:

Log Analysis:

# Search for specific errors
grep -i "error" /var/log/app.log | tail -50

# Analyze log patterns
awk '{print $1}' access.log | sort | uniq -c | sort -nr

# Monitor logs in real-time
tail -f /var/log/app.log | grep -i "exception"

Performance Profiling:

# System performance
iostat -x 1
sar -u 1 10
vmstat 1 10

# Application profiling
strace -p [PID]
perf record -p [PID]

Remember to:

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.