Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/doncheli/don-cheli-sddWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/doncheli/don-cheli-sdd/contrato-api)<a href="https://agentmods.dev/commands/doncheli/don-cheli-sdd/contrato-api"><img src="https://agentmods.dev/badge/commands/doncheli/don-cheli-sdd/contrato-api.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00019 | $0.01752 |
| Opus 5 | $0.00010 | $0.00876 |
| Sonnet 5 | $0.00004 | $0.00350 |
| Haiku 4.5 | $0.00002 | $0.00175 |
Grade A, and why
contrato-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 224 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/dc:contrato-api
Objetivo
Diseñar contratos de API completos (REST o GraphQL), definir webhooks, planificar manejo de errores y reintentos para asegurar la resiliencia de integraciones con plataformas externas.
Uso
/dc:contrato-api <descripción de la integración>
/dc:contrato-api --tipo rest "Integración con Stripe para pagos"
/dc:contrato-api --tipo graphql "API de catálogo de productos"
/dc:contrato-api --tipo webhook "Recibir eventos de Shopify"
Diferencia con /dc:planificar-tecnico
| Aspecto | planificar-tecnico |
contrato-api |
|---|---|---|
| Alcance | Blueprint completo de una feature | Solo el contrato de API/integración |
| Profundidad | Contrato básico (request/response) | Contrato completo (errores, reintentos, webhooks, idempotencia) |
| Cuándo | Después de spec | Cuando la integración es el foco principal |
Output para API REST
## Contrato API: Integración de Pagos con Stripe
### Endpoints
#### POST /api/v1/pagos
**Propósito:** Crear un cobro
**Auth:** Bearer token (JWT)
**Rate limit:** 100 req/min por usuario
**Idempotencia:** Sí (header `Idempotency-Key`)
**Request:**
```json
{
"monto": 5000, // centavos, min: 100, max: 99999900
"moneda": "USD", // ISO 4217
"cliente_id": "uuid",
"metodo_pago_id": "pm_xxx",
"descripcion": "Pedido #1234",
"metadata": {} // opcional, max 50 keys
}
Responses:
| Status | Significado | Body |
|---|---|---|
| 201 | Cobro creado | { id, status, monto, stripe_id, created_at } |
| 400 | Datos inválidos | { error, field, message } |
| 402 | Pago rechazado | { error, decline_code, message } |
| 409 | Idempotency conflict | { error, original_id } |
| 429 | Rate limit | { error, retry_after } |
| 500 | Error interno | { error, request_id } |
Headers de respuesta:
X-Request-Id: uuid // Para soporte/debugging
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1616544000
Webhooks (recibir desde Stripe)
POST /api/v1/webhooks/stripe
Verificación: HMAC-SHA256 con Stripe-Signature header
Tolerancia de timestamp: 300 segundos (5 min)
Respuesta esperada: 200 OK (body vacío) en < 5s
Eventos soportados:
| Evento | Acción | Idempotente |
|---|---|---|
payment_intent.succeeded |
Marcar pedido como pagado | Sí |
payment_intent.payment_failed |
Notificar al usuario | Sí |
charge.refunded |
Procesar reembolso | Sí |
charge.dispute.created |
Alertar al equipo | Sí |
Procesamiento:
1. Verificar firma HMAC
2. Parsear evento
3. Verificar idempotencia (event.id en tabla processed_events)
4. Responder 200 INMEDIATAMENTE
5. Procesar en cola async (no bloquear respuesta)
6. Registrar en audit log
Manejo de Errores
Errores del cliente (4xx):
{
"error": {
"tipo": "validation_error",
"mensaje": "El monto debe ser mayor a $1.00",
"campo": "monto",
"codigo": "MONTO_INVALIDO"
}
}
Errores del servidor (5xx):
{
"error": {
"tipo": "internal_error",
"mensaje": "Error procesando el pago",
"request_id": "req_abc123"
}
}
Códigos de error consistentes:
| Código | Significado | HTTP |
|---|---|---|
MONTO_INVALIDO |
Monto fuera de rango | 400 |
MONEDA_NO_SOPORTADA |
Moneda no en whitelist | 400 |
PAGO_RECHAZADO |
Tarjeta rechazada | 402 |
DUPLICADO |
Idempotency conflict | 409 |
RATE_LIMIT |
Demasiadas requests | 429 |
STRIPE_ERROR |
Error de comunicación con Stripe | 502 |
Política de Reintentos
Estrategia: Exponential backoff con jitter
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 224 lines · 19 tokens per session scan A 12926b6d640e
contrato-api is a command published in the GitHub repository doncheli/don-cheli-sdd (57 stars, last pushed 28d ago), licensed Apache-2.0. It adds 19 tokens to every session and 1,752 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other commands, from other repositories
research-phase
Research how to implement a phase (standalone — usually use /pbr:plan-phase instead).
add-phase
Add phase to end of current milestone in roadmap.
reapply-patches
Reapply local modifications after a PBR update.
remove-phase
Remove a future phase from roadmap and renumber subsequent phases.
join-discord
Join the PBR Discord community.
new-milestone
Start a new milestone cycle — update PROJECT.md and route to requirements.