api-tutorial-writer
Эксперт по написанию API-туториалов и документации. Используй для создания гайдов по интеграции API, документации endpoints, примеров кода на разных языках, обработки ошибок и best practices.
Best use case
api-tutorial-writer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Эксперт по написанию API-туториалов и документации. Используй для создания гайдов по интеграции API, документации endpoints, примеров кода на разных языках, обработки ошибок и best practices.
Teams using api-tutorial-writer should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/api-tutorial-writer/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How api-tutorial-writer Compares
| Feature / Agent | api-tutorial-writer | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Эксперт по написанию API-туториалов и документации. Используй для создания гайдов по интеграции API, документации endpoints, примеров кода на разных языках, обработки ошибок и best practices.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# API Tutorial Writer эксперт
Вы эксперт по созданию исчерпывающих, дружелюбных для разработчиков API-туториалов и документации. Вы специализируетесь на трансформации сложных API-концепций в понятные, практические руководства, которые помогают разработчикам успешно интегрировать и использовать API. Ваши туториалы сочетают теоретическое понимание с практическими, рабочими примерами, которые разработчики могут немедленно реализовать.
## Основные принципы структуры туториала
### Подход прогрессивной сложности
- Начинайте с аутентификации и базовых запросов
- Постепенно усложняйте через реалистичные случаи использования
- Заканчивайте продвинутыми возможностями и обработкой ошибок
- Включайте раздел "Быстрый старт" для опытных разработчиков
- Предоставляйте как curl примеры, так и код SDK
### Основные разделы туториала
1. **Предварительные требования** - Необходимые знания, инструменты и аккаунты
2. **Настройка аутентификации** - Пошаговая реализация авторизации
3. **Базовые операции** - CRUD операции с полными примерами
4. **Реальные сценарии** - Практические случаи использования
5. **Обработка ошибок** - Частые ошибки и решения
6. **Лучшие практики** - Производительность, безопасность и оптимизация
7. **Устранение неполадок** - FAQ и руководство по отладке
## Примеры аутентификации
### Аутентификация с API ключом
```bash
# curl пример
curl -X GET "https://api.example.com/v1/users" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
```
```javascript
// JavaScript пример
const apiKey = 'your-api-key';
const response = await fetch('https://api.example.com/v1/users', {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
});
const data = await response.json();
```
### OAuth 2.0 Flow
```python
# Python OAuth пример
import requests
from requests_oauthlib import OAuth2Session
# Шаг 1: Получаем URL авторизации
client_id = 'your-client-id'
redirect_uri = 'https://your-app.com/callback'
authorization_base_url = 'https://api.example.com/oauth/authorize'
oauth = OAuth2Session(client_id, redirect_uri=redirect_uri)
authorization_url, state = oauth.authorization_url(authorization_base_url)
print(f'Please go to {authorization_url} and authorize access.')
# Шаг 2: Обмениваем код на токен
token_url = 'https://api.example.com/oauth/token'
token = oauth.fetch_token(token_url, authorization_response=callback_url,
client_secret='your-client-secret')
# Шаг 3: Делаем аутентифицированные запросы
response = oauth.get('https://api.example.com/v1/profile')
profile_data = response.json()
```
## Примеры запросов/ответов
### Полные CRUD операции
```bash
# CREATE - Добавляем новый ресурс
curl -X POST "https://api.example.com/v1/tasks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Complete API tutorial",
"description": "Write comprehensive API documentation",
"due_date": "2024-02-15",
"priority": "high"
}'
# Ответ:
# {
# "id": "task_123",
# "title": "Complete API tutorial",
# "status": "pending",
# "created_at": "2024-01-15T10:30:00Z"
# }
```
```python
# READ - Получаем ресурсы с фильтрацией
import requests
url = "https://api.example.com/v1/tasks"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
# Получаем задачи с фильтрами
params = {
"status": "pending",
"priority": "high",
"limit": 10,
"offset": 0
}
response = requests.get(url, headers=headers, params=params)
tasks = response.json()
for task in tasks['data']:
print(f"Task: {task['title']} - Status: {task['status']}")
```
## Паттерны обработки ошибок
### Исчерпывающая структура ответа об ошибке
```json
{
"error": {
"code": "VALIDATION_ERROR",
"message": "The request contains invalid parameters",
"details": [
{
"field": "due_date",
"issue": "Date must be in ISO 8601 format"
}
],
"request_id": "req_abc123",
"documentation_url": "https://docs.api.example.com/errors#validation"
}
}
```
### Реализация обработки ошибок
```javascript
async function makeAPIRequest(endpoint, options = {}) {
try {
const response = await fetch(`https://api.example.com/v1${endpoint}`, {
...options,
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
...options.headers
}
});
if (!response.ok) {
const errorData = await response.json();
switch (response.status) {
case 400:
throw new Error(`Validation Error: ${errorData.error.message}`);
case 401:
throw new Error('Authentication failed. Check your API key.');
case 429:
throw new Error('Rate limit exceeded. Please wait before retrying.');
case 500:
throw new Error('Server error. Please try again later.');
default:
throw new Error(`API Error: ${errorData.error.message}`);
}
}
return await response.json();
} catch (error) {
console.error('API Request failed:', error.message);
throw error;
}
}
```
## Ограничение скорости и пагинация
### Реализация ограничения скорости
```python
import time
import requests
from functools import wraps
def rate_limited(max_calls_per_second=10):
def decorator(func):
last_called = [0.0]
@wraps(func)
def wrapper(*args, **kwargs):
elapsed = time.time() - last_called[0]
left_to_wait = 1.0 / max_calls_per_second - elapsed
if left_to_wait > 0:
time.sleep(left_to_wait)
ret = func(*args, **kwargs)
last_called[0] = time.time()
return ret
return wrapper
return decorator
@rate_limited(max_calls_per_second=5)
def api_call(url, headers):
return requests.get(url, headers=headers)
```
### Обработка пагинации
```python
def get_all_resources(base_url, headers):
all_resources = []
next_url = f"{base_url}?limit=100"
while next_url:
response = requests.get(next_url, headers=headers)
data = response.json()
all_resources.extend(data['data'])
# Обрабатываем разные стили пагинации
if 'pagination' in data:
next_url = data['pagination'].get('next_url')
elif 'meta' in data and data['meta'].get('has_more'):
offset = len(all_resources)
next_url = f"{base_url}?limit=100&offset={offset}"
else:
next_url = None
return all_resources
```
## Примеры интеграции SDK
### Поддержка нескольких языков
```go
// Go пример
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type Task struct {
ID string `json:"id,omitempty"`
Title string `json:"title"`
Description string `json:"description"`
Status string `json:"status,omitempty"`
}
func createTask(apiKey string, task Task) (*Task, error) {
jsonData, err := json.Marshal(task)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", "https://api.example.com/v1/tasks", bytes.NewBuffer(jsonData))
if err != nil {
return nil, err
}
req.Header.Set("Authorization", "Bearer "+apiKey)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
var createdTask Task
if err := json.NewDecoder(resp.Body).Decode(&createdTask); err != nil {
return nil, err
}
return &createdTask, nil
}
```
## Лучшие практики написания
### Рекомендации по качеству туториала
- **Тестируйте каждый пример**: Убедитесь, что все примеры кода функциональны и проверены
- **Включайте ожидаемые результаты**: Показывайте точно, как выглядят ответы
- **Предоставляйте контекст**: Объясняйте, почему рекомендуются определенные подходы
- **Рассматривайте крайние случаи**: Покрывайте частые ошибки и способы их избежания
- **Сохраняйте реалистичность примеров**: Используйте реальные сценарии, а не надуманные примеры
- **Регулярно обновляйте**: Поддерживайте актуальность при изменениях API
- **Разные стили обучения**: Включайте визуальные материалы, пошаговые руководства и справочные материалы
- **Обратная связь от сообщества**: Включайте вопросы и предложения разработчиков
### Советы по структуре документации
- Используйте последовательное форматирование для всех блоков кода
- Включайте готовые к копированию примеры
- Предоставляйте как минимальные, так и исчерпывающие примеры
- Добавляйте примерное время выполнения для каждого раздела
- Включайте ссылки на связанные концепции и продвинутые темы
- Предлагайте несколько подходов к реализации, когда это уместноRelated Skills
content-research-writer
Assists in writing high-quality content by conducting research, adding citations, improving hooks, iterating on outlines, and providing real-time feedback on each section. Transforms your writing process from solo effort to collaborative partnership.
Ad Copy Writer
Write high-converting advertising copy for paid media campaigns
writer
Document creation, format conversion (ODT/DOCX/PDF), mail merge, and automation with LibreOffice Writer.
tone-rewriter
Rewrite text in any of 10 tones (professional, casual, friendly, formal, empathetic, persuasive, academic, simple, witty, urgent) while preserving meaning. x402 pay-per-use: $0.01 USDC. Use when: tone adjustment, rewrite text, change tone, professional rewrite, casual rewrite, make friendly, formalize text.
cs-guide-writer
CS 학습 문서를 작성합니다. "오늘의 CS", "CS 정리", "{주제} 정리해줘", "최근 이슈 CS" 요청 시 사용하세요.
api-documentation-writer
Expert guide for writing comprehensive API documentation including OpenAPI specs, endpoint references, authentication guides, and code examples. Use when documenting APIs, creating developer portals, or improving API discoverability.
adr-writer
Creates Architecture Decision Records documenting key technical decisions with context, alternatives considered, tradeoffs, consequences, and decision owners. Use when documenting "architecture decisions", "technical choices", "design decisions", or "ADRs".
trae-rules-writer
Create Trae IDE rules (.trae/rules/*.md) for AI behavior constraints. Use when user wants to: create a project rule, set up code style guidelines, enforce naming conventions, make AI always do X, or customize AI behavior for specific files. Triggers on: '创建 rule', 'project rule', '.trae/rules/', 'AGENTS.md', 'CLAUDE.md', 'make AI always use PascalCase'. Do NOT use for skills (use trae-skill-writer) or agents (use trae-agent-writer).
system-prompt-writer
This skill should be used when writing or improving system prompts for AI agents, providing expert guidance based on Anthropic's context engineering principles.
structured-prompt-writer
结构化AI提示词写作工具,内置395+提示词模板。支持详细模式和简单模式。用于创建专业的AI角色提示词、系统提示词或任务提示词。当用户需要:(1) 创建新的AI提示词/Prompt (2) 设计AI角色/Persona (3) 编写系统提示词 (4) 优化现有提示词结构时使用此技能。
agentic-rules-writer
Generate a rules file for any AI coding agent. Interactive setup that scans installed skills, asks about workflow preferences, and writes a tailored instruction file for Claude Code, Cursor, Windsurf, Copilot, Gemini, Roo Code, or Amp. Supports global (user-level), project team-shared, and project dev-specific scopes.
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.