$npx -y skills add joeynyc/skillscore --skill perfect-skillChecks system service health and status when the user asks to verify service availability or diagnose outages.
| 1 | # System Health Checker |
| 2 | |
| 3 | Evaluates service health endpoints and produces formatted status reports. |
| 4 | |
| 5 | ## When to Use |
| 6 | |
| 7 | This skill is triggered when the user asks to "check system status" or "verify service health". |
| 8 | |
| 9 | ## When NOT to Use |
| 10 | |
| 11 | - **Don't use** this for detailed monitoring or alerting — use a dedicated monitoring skill instead |
| 12 | - **Not for** deploying or restarting services; this is read-only status checking |
| 13 | - **Avoid using this** for historical trend analysis |
| 14 | |
| 15 | ## Dependencies |
| 16 | |
| 17 | - curl: HTTP client for API requests (`curl --version` to verify) |
| 18 | - jq: JSON parser (`which jq` to verify installation) |
| 19 | - Environment variable: API_KEY (obtain from the service dashboard) |
| 20 | |
| 21 | ## Installation |
| 22 | |
| 23 | ```bash |
| 24 | # Install curl (if not present) |
| 25 | sudo apt-get install curl # Ubuntu/Debian |
| 26 | brew install curl # macOS |
| 27 | |
| 28 | # Install jq |
| 29 | sudo apt-get install jq # Ubuntu/Debian |
| 30 | brew install jq # macOS |
| 31 | |
| 32 | # Set API key |
| 33 | export API_KEY="your_api_key_here" |
| 34 | ``` |
| 35 | |
| 36 | ## Workflow |
| 37 | |
| 38 | 1. Validate dependencies are available |
| 39 | 2. Check API key is configured |
| 40 | 3. Make API call to health endpoint |
| 41 | 4. Parse response and format for user |
| 42 | 5. Handle any errors gracefully |
| 43 | |
| 44 | - [ ] Verify curl and jq are installed |
| 45 | - [ ] Confirm API_KEY is set |
| 46 | - [ ] Check endpoint responds |
| 47 | |
| 48 | ### Example commands: |
| 49 | |
| 50 | ```bash |
| 51 | # Check if dependencies are available |
| 52 | command -v curl >/dev/null 2>&1 || echo "curl not found" |
| 53 | command -v jq >/dev/null 2>&1 || echo "jq not found" |
| 54 | |
| 55 | # Make the API call |
| 56 | if ! response=$(curl -s -H "Authorization: Bearer $API_KEY" \ |
| 57 | -H "Accept: application/json" \ |
| 58 | "https://api.example.com/health"); then |
| 59 | echo "Error: API call failed" |
| 60 | exit 1 |
| 61 | fi |
| 62 | |
| 63 | echo "$response" | jq '.status' |
| 64 | ``` |
| 65 | |
| 66 | ## Input/Output |
| 67 | |
| 68 | **Input:** User request like "check system status" |
| 69 | **Output:** Formatted status report with: |
| 70 | - Service status (online/offline) |
| 71 | - Response time |
| 72 | - Any alerts or issues |
| 73 | |
| 74 | ## Error Handling |
| 75 | |
| 76 | You must always check for errors. Consider retrying on transient failures. |
| 77 | |
| 78 | ### Common issues and solutions: |
| 79 | |
| 80 | - **No API key**: Prompt user to configure API_KEY environment variable |
| 81 | - **Service unavailable**: Return cached status if available, otherwise inform user |
| 82 | - **Network timeout**: Retry once, then report network issue |
| 83 | - **Invalid response**: Log raw response and return "Unable to parse status" |
| 84 | |
| 85 | ### Fallback strategies: |
| 86 | |
| 87 | 1. **Primary**: Live API check |
| 88 | 2. **Fallback 1**: Cached status (if recent) |
| 89 | 3. **Fallback 2**: Basic connectivity test |
| 90 | 4. **Final**: Manual status check instructions |
| 91 | |
| 92 | ### Validation: |
| 93 | |
| 94 | ```bash |
| 95 | # Verify API response structure |
| 96 | if ! echo "$response" | jq -e '.status' >/dev/null 2>&1; then |
| 97 | echo "Invalid response format" |
| 98 | exit 1 |
| 99 | fi |
| 100 | ``` |
| 101 | |
| 102 | ## Examples |
| 103 | |
| 104 | ### Successful execution: |
| 105 | ```bash |
| 106 | $ check-status |
| 107 | System Status: HEALTHY |
| 108 | Response Time: 245ms |
| 109 | ``` |
| 110 | |
| 111 | ### Error case: |
| 112 | ```bash |
| 113 | $ check-status |
| 114 | Error: API_KEY not configured |
| 115 | Solution: export API_KEY="your_key" |
| 116 | ``` |
| 117 | |
| 118 | ## Limitations |
| 119 | |
| 120 | - Rate limits: API allows 100 calls/hour; the skill caches results |
| 121 | - Timeout: API calls timeout after 10 seconds |
| 122 | - Platform: Works on Linux, macOS, Windows (with WSL) |
| 123 | - Network: Requires internet connection for live checks |
| 124 | |
| 125 | ## Troubleshooting |
| 126 | |
| 127 | ### Q: Getting "command not found" for curl |
| 128 | **A:** Install curl using your package manager (see Installation section) |
| 129 | |
| 130 | ### Q: API returns 401 Unauthorized |
| 131 | **A:** Verify the result of `echo $API_KEY` — ensure it is set correctly |
| 132 | |
| 133 | ### Q: Slow response times |
| 134 | **A:** Review the endpoint load; optionally adjust timeout thresholds |
| 135 | |
| 136 | ## Security Notes |
| 137 | |
| 138 | - API key is sensitive — never log or expose it |
| 139 | - All API calls use HTTPS encryption |
| 140 | - No data is stored locally beyond cache |
| 141 | - Follows principle of least privilege |
| 142 | |
| 143 | See [examples/advanced-usage.md](examples/advanced-usage.md) for additional patterns. |