Agent skill
API Documentation
Document APIs comprehensively with signatures, parameters, return values, errors, and working code examples for developer reference
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/documents/api-documentation
SKILL.md
API Documentation
Purpose
Create comprehensive API documentation that enables developers to quickly understand and correctly use APIs, including parameters, return values, errors, and practical examples.
When to Use
- Documenting public APIs
- Creating developer references
- Writing SDK documentation
- Updating API changes
Key Capabilities
- Signature Documentation - Clear parameter and return type descriptions
- Example Creation - Practical, working code examples
- Error Documentation - All possible errors and when they occur
Approach
- Document function signature with types
- Describe each parameter clearly
- Describe return value and possible states
- List all exceptions/errors that can be raised
- Provide working example code
- Note version added or deprecated
Example
Context: Documenting a task creation function
### add_task(title, agent, priority, description)
Creates a new task in the queue.
**Parameters**:
- `title` (string) - Short descriptive title for the task
- `agent` (string) - Agent name to assign (must exist in agents.json)
- `priority` (string) - One of: "critical", "high", "normal", "low"
- `description` (string) - Detailed task description
**Returns**:
- `string` - Unique task ID for the created task
**Raises**:
- `ValueError` - If agent name is invalid or priority is unknown
- `FileNotFoundError` - If queue file cannot be accessed
**Example**:
```python
task_id = queue.add_task(
title="Fix login bug",
agent="implementer",
priority="high",
description="Users cannot log in with valid credentials"
)
print(f"Created task: {task_id}")
```
**Since**: v1.0.0
Best Practices
- ✅ Include type information for all parameters
- ✅ Provide complete, working examples
- ✅ Document all possible errors
- ❌ Avoid: Incomplete or outdated examples
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?