Agent skill

project-name-api

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/documents/project-name-api

SKILL.md

{{PROJECT_NAME}} API Client

Configuration

Base URL: {{API_BASE_URL}} Authentication: {{AUTH_METHOD}} via {{AUTH_HEADER}} header

Authentication

To authenticate requests:

python
headers = {
    "{{AUTH_HEADER}}": "YOUR_TOKEN_HERE",
    "Content-Type": "application/json"
}

Available Endpoints

Example Endpoint (Replace with actual endpoints)

GET /users/{id}

  • Description: Retrieve user by ID
  • Parameters:
    • id (path, required): User ID
  • Response: User object with id, name, email
python
import requests

response = requests.get(
    f"{{API_BASE_URL}}/users/123",
    headers=headers
)
user = response.json()

Add Your Endpoints Here

Document each endpoint with:

  • HTTP method and path
  • Description
  • Parameters (path, query, body)
  • Response format
  • Example code

Error Handling

Common error codes:

  • 401: Invalid authentication
  • 404: Resource not found
  • 429: Rate limit exceeded
  • 500: Server error

Rate Limits

[Document rate limits if applicable]

Examples

Creating a Resource

python
import requests

data = {
    "field1": "value1",
    "field2": "value2"
}

response = requests.post(
    f"{{API_BASE_URL}}/resources",
    headers=headers,
    json=data
)

if response.status_code == 201:
    created_resource = response.json()
    print(f"Created resource: {created_resource['id']}")

Listing Resources with Pagination

python
import requests

page = 1
all_resources = []

while True:
    response = requests.get(
        f"{{API_BASE_URL}}/resources",
        headers=headers,
        params={"page": page, "per_page": 100}
    )

    data = response.json()
    all_resources.extend(data["items"])

    if not data.get("has_more"):
        break
    page += 1

Testing

To test the API connection:

bash
curl -H "{{AUTH_HEADER}}: YOUR_TOKEN" {{API_BASE_URL}}/health

Expected response: {"status": "ok"}

Resources

  • [Add link to API documentation]
  • [Add link to OpenAPI/Swagger spec if available]
  • [Add link to authentication docs]

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results