Get the FREE Ultimate OpenClaw Setup Guide →

Perfect Skill

npx machina-cli add skill joeynyc/skillscore/perfect-skill --openclaw
Files (1)
SKILL.md
3.4 KB

Perfect Test Skill

A comprehensive and well-structured skill that demonstrates best practices in all areas.

Dependencies

  • curl: HTTP client for API requests (curl --version to verify)
  • jq: JSON parser (which jq to verify installation)
  • Environment variable: API_KEY (obtain from https://api.example.com)

Installation

# Install curl (if not present)
sudo apt-get install curl  # Ubuntu/Debian
brew install curl          # macOS

# Install jq
sudo apt-get install jq    # Ubuntu/Debian
brew install jq            # macOS

# Set API key
export API_KEY="your_api_key_here"

Usage

This skill is triggered when the user asks to "check system status" or "verify service health".

Step-by-step instructions:

  1. Validate dependencies are available
  2. Check API key is configured
  3. Make API call to health endpoint
  4. Parse response and format for user
  5. Handle any errors gracefully

Example commands:

# Check if dependencies are available
command -v curl >/dev/null 2>&1 || echo "curl not found"
command -v jq >/dev/null 2>&1 || echo "jq not found"

# Make the API call
curl -H "Authorization: Bearer $API_KEY" \
     -H "Accept: application/json" \
     "https://api.example.com/health" | jq '.status'

Input/Output

Input: User request like "check system status" Output: Formatted status report with:

  • Service status (online/offline)
  • Response time
  • Any alerts or issues

Error Handling

Common issues and solutions:

  • No API key: Prompt user to configure API_KEY environment variable
  • Service unavailable: Return cached status if available, otherwise inform user
  • Network timeout: Retry once after 2 seconds, then report network issue
  • Invalid response: Log raw response and return "Unable to parse status"

Fallback strategies:

  1. Primary: Live API check
  2. Fallback 1: Cached status (if < 5 minutes old)
  3. Fallback 2: Basic connectivity test
  4. Final: Manual status check instructions

Validation steps:

# Verify API response structure
if ! echo "$response" | jq -e '.status' >/dev/null; then
    echo "Invalid response format"
    exit 1
fi

Examples

Successful execution:

$ check-status
āœ… System Status: HEALTHY
šŸ“Š Response Time: 245ms
šŸ”„ Last Updated: 2026-02-11 14:30:00

Error handling:

$ check-status
āŒ Error: API_KEY not configured
šŸ’” Solution: export API_KEY="your_key"

Limitations and Edge Cases

  • Rate limits: API allows 100 calls/hour, skill caches results for 5 minutes
  • Timeout: API calls timeout after 10 seconds
  • Platform: Works on Linux, macOS, Windows (with WSL)
  • Network: Requires internet connection for live checks

Troubleshooting

Q: Getting "command not found" for curl

A: Install curl using your package manager (see Installation section)

Q: API returns 401 Unauthorized

A: Check API key is correctly set: echo $API_KEY

Q: Slow response times

A: API is experiencing high load, try again in a few minutes

When NOT to Use This Skill

  • Don't use this for detailed monitoring or alerting — use a dedicated monitoring skill instead
  • Not for deploying or restarting services; this is read-only status checking
  • Avoid using this for historical trend analysis

Security Notes

  • API key is sensitive - never log or expose it
  • All API calls use HTTPS encryption
  • No data is stored locally beyond 5-minute cache
  • Follows principle of least privilege

Source

git clone https://github.com/joeynyc/skillscore/blob/main/tests/fixtures/perfect-skill/SKILL.mdView on GitHub

Overview

Perfect Test Skill provides a reliable system health check by querying a health endpoint with an API key. It validates dependencies like curl and jq, ensures API_KEY is configured, executes the health request, and formats a concise status report. It also defines error handling and sensible fallbacks to keep you informed.

How This Skill Works

The skill first verifies curl and jq are installed, then confirms that API_KEY is set. It sends a GET request to the health endpoint with a Bearer token, parses the JSON response with jq to extract status and response time, and returns a user friendly status. If errors occur it applies the defined fallbacks or returns a clear message.

When to Use It

  • When a user asks to check system status or verify service health
  • During incident response to confirm current service health
  • Before deploying or running a job to validate readiness
  • To populate a status dashboard with live health data
  • In CI pipelines to gate deployments with a health check

Quick Start

  1. Step 1: Validate dependencies are available
  2. Step 2: Check API key is configured
  3. Step 3: Make API call to health endpoint and parse the result

Best Practices

  • Validate that curl and jq are installed before running checks
  • Ensure API_KEY is configured securely and never logged
  • Call the official health endpoint and parse the .status with jq
  • Handle common errors gracefully with clear user messages
  • Implement fallbacks such as cached status or basic connectivity tests

Example Use Cases

  • User runs check-status and sees HEALTHY with a fast response time
  • Curl to the health endpoint with Authorization: Bearer $API_KEY and parse with jq
  • If API_KEY is missing, the tool prompts to configure API_KEY
  • If the service is temporarily unavailable, a cached status is used
  • In a deployment pipeline, health check gates promotion to production

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers ↗