@intentsolutionsio/sprint 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.claude-plugin/plugin.json +23 -0
  2. package/LICENSE +21 -0
  3. package/README.md +320 -0
  4. package/agents/allpurpose-agent.md +159 -0
  5. package/agents/cicd-agent.md +189 -0
  6. package/agents/nextjs-dev.md +204 -0
  7. package/agents/nextjs-diagnostics-agent.md +206 -0
  8. package/agents/project-architect.md +398 -0
  9. package/agents/python-dev.md +159 -0
  10. package/agents/qa-test-agent.md +192 -0
  11. package/agents/ui-test-agent.md +295 -0
  12. package/agents/website-designer.md +48 -0
  13. package/commands/clean.md +153 -0
  14. package/commands/generate-map.md +160 -0
  15. package/commands/new.md +173 -0
  16. package/commands/setup.md +239 -0
  17. package/commands/sprint.md +482 -0
  18. package/commands/test.md +183 -0
  19. package/package.json +44 -0
  20. package/skills/agent-patterns/SKILL.md +103 -0
  21. package/skills/agent-patterns/references/errors.md +8 -0
  22. package/skills/agent-patterns/references/examples.md +291 -0
  23. package/skills/agent-patterns/references/ui-test-report.md +35 -0
  24. package/skills/api-contract/SKILL.md +115 -0
  25. package/skills/api-contract/references/best-practices.md +47 -0
  26. package/skills/api-contract/references/errors.md +8 -0
  27. package/skills/api-contract/references/examples.md +448 -0
  28. package/skills/api-contract/references/pagination.md +46 -0
  29. package/skills/api-contract/references/typescript-interfaces.md +46 -0
  30. package/skills/api-contract/references/writing-endpoints.md +45 -0
  31. package/skills/spec-writing/SKILL.md +110 -0
  32. package/skills/spec-writing/references/errors.md +8 -0
  33. package/skills/spec-writing/references/examples.md +274 -0
  34. package/skills/spec-writing/references/testing-configuration.md +40 -0
  35. package/skills/sprint-workflow/SKILL.md +81 -0
  36. package/skills/sprint-workflow/references/errors.md +8 -0
  37. package/skills/sprint-workflow/references/examples.md +317 -0
  38. package/skills/sprint-workflow/references/sprint-phases.md +54 -0
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: agent-patterns
3
+ description: |
4
+ Execute this skill should be used when the user asks about "SPAWN REQUEST format", "agent reports", "agent coordination", "parallel agents", "report format", "agent communication", or needs to understand how agents coordinate within the sprint system. Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.
5
+ allowed-tools: Read
6
+ version: 1.0.0
7
+ author: Damien Laine <damien.laine@gmail.com>
8
+ license: MIT
9
+ compatible-with: claude-code, codex, openclaw
10
+ tags: [community, agent-patterns]
11
+ ---
12
+ # Agent Patterns
13
+
14
+ ## Overview
15
+
16
+ Agent Patterns defines the coordination protocol for multi-agent sprint execution within the Sprint plugin. It governs how the project architect spawns implementation and testing agents, how agents communicate results via structured reports, and how parallel agents avoid conflicts.
17
+
18
+ ## Prerequisites
19
+
20
+ - Sprint plugin installed and configured (`/plugin install sprint`)
21
+ - Sprint directory initialized at `.claude/sprint/[N]/`
22
+ - `specs.md` written with clear scope and testing configuration
23
+ - Familiarity with the sprint phase lifecycle (see the `sprint-workflow` skill)
24
+
25
+ ## Instructions
26
+
27
+ 1. Structure every agent spawn using the SPAWN REQUEST format. Include the agent name, the specification file it should read, and any scope constraints:
28
+ ```
29
+ SPAWN REQUEST
30
+ Agent: python-dev
31
+ Specs: .claude/sprint/1/backend-specs.md
32
+ Contract: .claude/sprint/1/api-contract.md
33
+ Scope: Authentication endpoints only
34
+ ```
35
+ 2. Ensure each spawned agent receives only the files relevant to its scope. Pass the `api-contract.md` as a shared interface so backend and frontend agents stay synchronized.
36
+ 3. Collect structured reports from every agent upon completion. Each report must include: work completed, files modified, tests added, and conformity status against the specification.
37
+ 4. When running agents in parallel, partition work by domain boundary (e.g., backend vs. frontend vs. CI/CD). Never assign overlapping file paths to concurrent agents.
38
+ 5. Feed agent reports back to the project architect for review. The architect decides whether to iterate (re-spawn with narrowed specs) or advance to the next phase.
39
+ 6. For testing agents, pass the UI test report format shown in `${CLAUDE_SKILL_DIR}/references/ui-test-report.md` so results follow a consistent schema including test counts, coverage, failures, and console errors.
40
+
41
+ ## Output
42
+
43
+ - SPAWN REQUEST blocks consumed by the sprint orchestrator to launch agents
44
+ - Structured agent reports containing: summary, files changed, test results, and conformity status
45
+ - UI test reports with pass/fail counts, coverage details, failure descriptions, and console error logs
46
+ - Updated `status.md` reflecting completed and remaining work after each iteration
47
+
48
+ ## Error Handling
49
+
50
+ | Error | Cause | Solution |
51
+ |-------|-------|----------|
52
+ | Agent receives wrong specification file | Incorrect path in SPAWN REQUEST | Verify the sprint directory number and file name before spawning |
53
+ | Overlapping file modifications from parallel agents | Scope boundaries not clearly defined | Partition work by domain; assign distinct directories to each agent |
54
+ | Agent report missing required fields | Agent instructions lack report format | Include the structured report template in the agent prompt |
55
+ | Infinite iteration loop | Specs never fully satisfied | Check `status.md` for blocking issues; the orchestrator pauses after 5 iterations |
56
+ | Agent not found | Misspelled agent name in SPAWN REQUEST | Verify agent markdown files exist in `agents/` directory |
57
+
58
+ ## Examples
59
+
60
+ **Spawning parallel implementation agents:**
61
+ ```
62
+ SPAWN REQUEST
63
+ Agent: python-dev
64
+ Specs: .claude/sprint/1/backend-specs.md
65
+ Contract: .claude/sprint/1/api-contract.md
66
+
67
+ SPAWN REQUEST
68
+ Agent: nextjs-dev
69
+ Specs: .claude/sprint/1/frontend-specs.md
70
+ Contract: .claude/sprint/1/api-contract.md
71
+ ```
72
+ Both agents share the same `api-contract.md` to ensure API compatibility.
73
+
74
+ **Structured agent report format:**
75
+ ```
76
+ AGENT REPORT
77
+ Agent: python-dev
78
+ Status: COMPLETE
79
+ Files Modified: src/auth/routes.py, src/auth/models.py, tests/test_auth.py
80
+ Tests: 12 passed, 0 failed
81
+ Conformity: All backend-specs requirements implemented
82
+ Notes: JWT token expiry set to 24h per spec
83
+ ```
84
+
85
+ **Testing agent coordination:**
86
+ ```
87
+ SPAWN REQUEST
88
+ Agent: qa-test-agent
89
+ Specs: .claude/sprint/1/specs.md
90
+ Run After: python-dev, nextjs-dev
91
+
92
+ SPAWN REQUEST
93
+ Agent: ui-test-agent
94
+ Specs: .claude/sprint/1/specs.md
95
+ Run After: qa-test-agent
96
+ ```
97
+
98
+ ## Resources
99
+
100
+ - `${CLAUDE_SKILL_DIR}/references/ui-test-report.md` -- Structured UI test report format with coverage and failure tracking
101
+ - Sprint workflow skill for phase lifecycle context
102
+ - API contract skill for shared interface design
103
+ - Sprint plugin README for agent architecture overview
@@ -0,0 +1,8 @@
1
+ # Error Handling Reference
2
+
3
+ - Invalid input: Prompts for correction
4
+ - Missing dependencies: Lists required components
5
+ - Permission errors: Suggests remediation steps
6
+
7
+ ---
8
+ *[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*
@@ -0,0 +1,291 @@
1
+ # Examples
2
+
3
+ ## Example 1: Spawning a Single Implementation Agent
4
+
5
+ The simplest pattern: one agent implementing one spec file with a shared contract.
6
+
7
+ **SPAWN REQUEST block:**
8
+ ```
9
+ SPAWN REQUEST
10
+ Agent: python-dev
11
+ Specs: .claude/sprint/1/backend-specs.md
12
+ Contract: .claude/sprint/1/api-contract.md
13
+ Scope: All backend endpoints
14
+ ```
15
+
16
+ **Agent reads these files, implements, then returns:**
17
+ ```
18
+ AGENT REPORT
19
+ Agent: python-dev
20
+ Status: COMPLETE
21
+ Files Modified:
22
+ - src/routes/users.py (created)
23
+ - src/models/user.py (created)
24
+ - src/middleware/auth.py (created)
25
+ - tests/test_users.py (created)
26
+ Tests: 15 added, 15 passing
27
+ Conformity: All endpoints match api-contract.md schemas
28
+ Notes: Used bcrypt for password hashing per spec requirement
29
+ ```
30
+
31
+ ## Example 2: Parallel Agent Spawns with Domain Partitioning
32
+
33
+ Multiple agents running concurrently, each assigned to a non-overlapping domain
34
+ boundary to prevent file conflicts.
35
+
36
+ **Architect produces three SPAWN REQUEST blocks:**
37
+ ```
38
+ SPAWN REQUEST
39
+ Agent: python-dev
40
+ Specs: .claude/sprint/2/backend-specs.md
41
+ Contract: .claude/sprint/2/api-contract.md
42
+ Scope: REST API endpoints and database models
43
+
44
+ SPAWN REQUEST
45
+ Agent: nextjs-dev
46
+ Specs: .claude/sprint/2/frontend-specs.md
47
+ Contract: .claude/sprint/2/api-contract.md
48
+ Scope: React components and page routes
49
+
50
+ SPAWN REQUEST
51
+ Agent: cicd-agent
52
+ Specs: .claude/sprint/2/infra-specs.md
53
+ Scope: Docker, GitHub Actions, and deployment configs
54
+ ```
55
+
56
+ **Domain boundaries (no file overlap):**
57
+ ```
58
+ python-dev → src/api/*, src/models/*, tests/api/*
59
+ nextjs-dev → app/*, components/*, tests/ui/*
60
+ cicd-agent → .github/workflows/*, Dockerfile, docker-compose.yml
61
+ ```
62
+
63
+ **All three agents run simultaneously. Reports collected:**
64
+ ```
65
+ AGENT REPORT
66
+ Agent: python-dev
67
+ Status: COMPLETE
68
+ Files Modified: src/api/products.py, src/models/product.py, tests/api/test_products.py
69
+ Tests: 22 added, 22 passing
70
+ Conformity: All 6 backend endpoints match contract
71
+
72
+ AGENT REPORT
73
+ Agent: nextjs-dev
74
+ Status: COMPLETE
75
+ Files Modified: app/products/page.tsx, components/ProductCard.tsx, components/SearchBar.tsx
76
+ Tests: 8 component tests added
77
+ Conformity: All UI components consume contract-defined response types
78
+
79
+ AGENT REPORT
80
+ Agent: cicd-agent
81
+ Status: COMPLETE
82
+ Files Modified: .github/workflows/ci.yml, Dockerfile, docker-compose.yml
83
+ Tests: CI pipeline validated locally
84
+ Conformity: Deployment config targets correct service ports
85
+ ```
86
+
87
+ ## Example 3: Testing Agent Coordination (Sequential)
88
+
89
+ Testing agents must run after implementation agents complete. QA runs first,
90
+ then UI testing runs after QA passes.
91
+
92
+ **Sequential SPAWN REQUEST chain:**
93
+ ```
94
+ SPAWN REQUEST
95
+ Agent: qa-test-agent
96
+ Specs: .claude/sprint/3/specs.md
97
+ Run After: python-dev, nextjs-dev
98
+ Contract: .claude/sprint/3/api-contract.md
99
+ Scope: API integration tests and unit test validation
100
+
101
+ SPAWN REQUEST
102
+ Agent: ui-test-agent
103
+ Specs: .claude/sprint/3/specs.md
104
+ Run After: qa-test-agent
105
+ Scope: Browser-based E2E tests for all user flows
106
+ ```
107
+
108
+ **QA agent report:**
109
+ ```
110
+ AGENT REPORT
111
+ Agent: qa-test-agent
112
+ Status: COMPLETE
113
+ Tests:
114
+ - API tests: 34 passed, 2 failed
115
+ - Unit tests: 67 passed, 0 failed
116
+ - Coverage: 89%
117
+ Failures:
118
+ 1. POST /api/orders returns 500 when cart is empty (expected 400)
119
+ 2. GET /api/orders/:id returns stale cache after update
120
+
121
+ Conformity: 2 endpoints deviate from api-contract.md error codes
122
+ ```
123
+
124
+ **UI test agent report (using structured format):**
125
+ ```
126
+ AGENT REPORT
127
+ Agent: ui-test-agent
128
+ Status: COMPLETE
129
+ Tests:
130
+ - E2E scenarios: 12 passed, 1 failed
131
+ - Visual regression: 0 changes detected
132
+ Failures:
133
+ 1. Checkout flow: Submit button stays disabled after form validation passes
134
+ Screenshot: .claude/sprint/3/screenshots/checkout-button-disabled.png
135
+
136
+ Console Errors:
137
+ - TypeError: Cannot read property 'validate' of undefined (checkout.tsx:45)
138
+
139
+ Conformity: Checkout flow blocked by frontend validation bug
140
+ ```
141
+
142
+ ## Example 4: Architect Review and Iteration Decision
143
+
144
+ After collecting all agent reports, the architect decides whether to iterate
145
+ or finalize.
146
+
147
+ **Architect receives reports from Iteration 1:**
148
+ ```
149
+ python-dev: COMPLETE (all endpoints working)
150
+ nextjs-dev: COMPLETE (all components rendered)
151
+ qa-test-agent: 2 failures (empty cart 500, stale cache)
152
+ ui-test-agent: 1 failure (checkout button disabled)
153
+ ```
154
+
155
+ **Architect analysis:**
156
+ ```
157
+ Conformity Review:
158
+ ✓ 4/6 API endpoints fully conformant
159
+ ✗ POST /api/orders: Missing empty-cart validation (backend fix)
160
+ ✗ GET /api/orders/:id: Cache invalidation missing (backend fix)
161
+ ✗ Checkout form: Validation state not propagating (frontend fix)
162
+
163
+ Decision: ITERATE
164
+ Reason: 3 targeted fixes needed, all within clear scope
165
+
166
+ Updated backend-specs.md:
167
+ - REMOVED: All completed endpoint specs
168
+ - ADDED: Fix empty cart → return 400 with ApiError
169
+ - ADDED: Invalidate order cache on PATCH/DELETE
170
+
171
+ Updated frontend-specs.md:
172
+ - REMOVED: All completed component specs
173
+ - ADDED: Fix checkout form validation state propagation
174
+
175
+ Updated status.md:
176
+ Iteration 1: 3/6 user stories complete. 3 fixes needed.
177
+ ```
178
+
179
+ **Architect spawns narrowed Iteration 2:**
180
+ ```
181
+ SPAWN REQUEST
182
+ Agent: python-dev
183
+ Specs: .claude/sprint/3/backend-specs.md
184
+ Contract: .claude/sprint/3/api-contract.md
185
+ Scope: Fix empty-cart validation and cache invalidation only
186
+
187
+ SPAWN REQUEST
188
+ Agent: nextjs-dev
189
+ Specs: .claude/sprint/3/frontend-specs.md
190
+ Scope: Fix checkout form validation state only
191
+ ```
192
+
193
+ ## Example 5: Framework-Specific Agent Selection
194
+
195
+ The orchestrator detects the project framework and selects appropriate
196
+ specialized agents.
197
+
198
+ **Project detection:**
199
+ ```
200
+ Phase 0 scan:
201
+ → Found: next.config.js → Framework: Next.js
202
+ → Found: requirements.txt with fastapi → Backend: FastAPI
203
+ → Found: docker-compose.yml → Infrastructure: Docker
204
+
205
+ Agent selection:
206
+ → nextjs-dev (instead of generic frontend agent)
207
+ → python-dev (instead of generic backend agent)
208
+ → cicd-agent (for Docker + CI pipeline)
209
+ ```
210
+
211
+ **For a different project stack:**
212
+ ```
213
+ Phase 0 scan:
214
+ → Found: nuxt.config.ts → Framework: Nuxt 3
215
+ → Found: package.json with express → Backend: Express.js
216
+ → Found: serverless.yml → Infrastructure: AWS Lambda
217
+
218
+ Agent selection:
219
+ → allpurpose-agent with Nuxt context (no nuxt-specific agent exists)
220
+ → allpurpose-agent with Express context
221
+ → cicd-agent with serverless framework context
222
+ ```
223
+
224
+ ## Example 6: Handling Agent Failures
225
+
226
+ When an agent fails to produce a valid report or encounters unrecoverable errors.
227
+
228
+ **Failed agent report:**
229
+ ```
230
+ AGENT REPORT
231
+ Agent: python-dev
232
+ Status: FAILED
233
+ Error: Cannot install dependency 'psycopg2-binary' — compilation fails on arm64
234
+ Files Modified: None
235
+ Tests: None
236
+ Conformity: Unable to assess — implementation did not start
237
+ ```
238
+
239
+ **Architect response:**
240
+ ```
241
+ Architect reviews failure:
242
+ → Root cause: platform-specific dependency issue
243
+ → Resolution: Switch to 'asyncpg' (pure Python, no compilation)
244
+ → Updates backend-specs.md: Replace psycopg2-binary with asyncpg
245
+
246
+ SPAWN REQUEST
247
+ Agent: python-dev
248
+ Specs: .claude/sprint/1/backend-specs.md (updated)
249
+ Contract: .claude/sprint/1/api-contract.md
250
+ Scope: All backend endpoints (retry with asyncpg)
251
+ Notes: Use asyncpg instead of psycopg2-binary for PostgreSQL
252
+ ```
253
+
254
+ ## Example 7: Scoped Agent with File Path Constraints
255
+
256
+ When agents need strict boundaries to prevent overlapping modifications.
257
+
258
+ **Tightly scoped SPAWN REQUEST:**
259
+ ```
260
+ SPAWN REQUEST
261
+ Agent: python-dev
262
+ Specs: .claude/sprint/5/backend-specs.md
263
+ Contract: .claude/sprint/5/api-contract.md
264
+ Scope: Payment processing endpoints only
265
+ Allowed Paths:
266
+ - src/payments/**
267
+ - tests/payments/**
268
+ - src/models/payment.py
269
+ Forbidden Paths:
270
+ - src/auth/**
271
+ - src/users/**
272
+ - src/orders/** (owned by another agent in this iteration)
273
+ ```
274
+
275
+ **Agent respects boundaries in its report:**
276
+ ```
277
+ AGENT REPORT
278
+ Agent: python-dev
279
+ Status: COMPLETE
280
+ Files Modified:
281
+ - src/payments/routes.py (created)
282
+ - src/payments/stripe_client.py (created)
283
+ - src/models/payment.py (created)
284
+ - tests/payments/test_payments.py (created)
285
+ Tests: 9 added, 9 passing
286
+ Conformity: All payment endpoints match contract
287
+ Notes: Did not modify src/orders/ — referenced via import only
288
+ ```
289
+
290
+ ---
291
+ *[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*
@@ -0,0 +1,35 @@
1
+ # Ui Test Report
2
+
3
+ ## UI TEST REPORT
4
+
5
+ ### MODE
6
+ AUTOMATED
7
+
8
+ ### SUMMARY
9
+ - Total tests run: 8
10
+ - Passed: 7
11
+ - Failed: 1
12
+ - Session duration: 45s
13
+
14
+ ### COVERAGE
15
+ - Scenarios covered:
16
+ - Login with valid credentials
17
+ - Login with invalid password
18
+ - Registration flow
19
+ - Password reset request
20
+ - Not covered (yet):
21
+ - Email verification flow (requires email testing setup)
22
+
23
+ ### FAILURES
24
+ - Scenario: Registration validation
25
+ - Path/URL: /register
26
+ - Symptom: Error message not displayed
27
+ - Expected: "Email already exists" message
28
+ - Actual: Form submits without feedback
29
+
30
+ ### CONSOLE ERRORS
31
+ None.
32
+
33
+ ### NOTES FOR ARCHITECT
34
+ - Registration error handling needs frontend fix
35
+ ```
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: api-contract
3
+ description: |
4
+ Configure this skill should be used when the user asks about "API contract", "api-contract.md", "shared interface", "TypeScript interfaces", "request response schemas", "endpoint design", or needs guidance on designing contracts that coordinate backend and frontend agents. Use when building or modifying API endpoints. Trigger with phrases like 'create API', 'design endpoint', or 'API scaffold'.
5
+ allowed-tools: Read
6
+ version: 1.0.0
7
+ author: Damien Laine <damien.laine@gmail.com>
8
+ license: MIT
9
+ compatible-with: claude-code, codex, openclaw
10
+ tags: [community, api, typescript]
11
+ ---
12
+ # API Contract
13
+
14
+ ## Overview
15
+
16
+ API Contract guides the creation of `api-contract.md` files that serve as the shared interface between backend and frontend agents during sprint execution. The contract defines request/response schemas, endpoint routes, TypeScript interfaces, and error formats so that implementation agents build to an agreed specification without direct coordination.
17
+
18
+ ## Prerequisites
19
+
20
+ - Sprint directory initialized at `.claude/sprint/[N]/`
21
+ - `specs.md` with defined feature scope and endpoint requirements
22
+ - Familiarity with RESTful API conventions (HTTP methods, status codes, JSON schemas)
23
+ - TypeScript knowledge for interface definitions (recommended)
24
+
25
+ ## Instructions
26
+
27
+ 1. Create `api-contract.md` in the sprint directory (`.claude/sprint/[N]/api-contract.md`). Define each endpoint using the standard format: HTTP method, route path, description, request body, response body with status code, and error codes. See `${CLAUDE_SKILL_DIR}/references/writing-endpoints.md` for the full template.
28
+ 2. Define TypeScript interfaces for all request and response types. Use explicit types instead of `any`, mark optional fields with `?`, and use `string | null` for nullable values. Reference `${CLAUDE_SKILL_DIR}/references/typescript-interfaces.md` for canonical type patterns.
29
+ 3. For list endpoints, include pagination parameters and the `PaginatedResponse<T>` wrapper. Standardize on `page`, `limit`, `sort`, and `order` query parameters as documented in `${CLAUDE_SKILL_DIR}/references/pagination.md`.
30
+ 4. Document all response states: success (200, 201, 204), client errors (400, 401, 403, 404, 422), and empty states. Use a consistent error response format with `code`, `message`, and optional `details` fields.
31
+ 5. Follow best practices from `${CLAUDE_SKILL_DIR}/references/best-practices.md`: be specific about field constraints (e.g., "string, required, valid email format"), include request/response examples, reference shared types instead of duplicating, and omit implementation details (no database columns, framework names, or file paths).
32
+ 6. Share the contract file path in SPAWN REQUEST blocks so both backend and frontend agents read the same interface definition.
33
+
34
+ ## Output
35
+
36
+ - `api-contract.md` containing all endpoint definitions with typed request/response schemas
37
+ - TypeScript interface declarations for `User`, `CreateUserRequest`, `LoginRequest`, `AuthResponse`, `ApiError`, and domain-specific types
38
+ - Paginated response wrappers for list endpoints
39
+ - Standardized error format across all endpoints
40
+
41
+ ## Error Handling
42
+
43
+ | Error | Cause | Solution |
44
+ |-------|-------|----------|
45
+ | Backend and frontend schemas diverge | Contract updated without notifying both agents | Always reference a single `api-contract.md`; never duplicate endpoint definitions |
46
+ | Missing error response codes | Contract only documents the happy path | Document all status codes: 400, 401, 403, 404, 409, 422 per endpoint |
47
+ | Ambiguous field types | Using `string` without constraints | Specify format, length, and validation rules (e.g., "string, required, min 8 chars") |
48
+ | Pagination inconsistency | List endpoints use different parameter names | Standardize on the `PaginatedResponse<T>` interface for all list endpoints |
49
+ | Type mismatch between JSON and TypeScript | Dates serialized inconsistently | Use ISO 8601 datetime strings; document as `"createdAt": "ISO 8601 datetime"` |
50
+
51
+ ## Examples
52
+
53
+ **Authentication endpoint contract:**
54
+ ```markdown
55
+ #### POST /auth/register
56
+
57
+ Create a new user account.
58
+
59
+ **Request:**
60
+ {
61
+ "email": "string (required, valid email)",
62
+ "password": "string (required, min 8 chars)",
63
+ "name": "string (optional)"
64
+ }
65
+
66
+ **Response (201):** # HTTP 201 Created
67
+ {
68
+ "id": "uuid",
69
+ "email": "string",
70
+ "name": "string | null",
71
+ "createdAt": "ISO 8601 datetime" # 8601 = configured value
72
+ }
73
+
74
+ **Errors:**
75
+ - 400: Invalid request body # HTTP 400 Bad Request
76
+ - 409: Email already exists # HTTP 409 Conflict
77
+ - 422: Validation failed # HTTP 422 Unprocessable Entity
78
+ ```
79
+
80
+ **Paginated list endpoint:**
81
+ ```markdown
82
+ #### GET /products
83
+
84
+ List products with pagination.
85
+
86
+ **Query Parameters:**
87
+ | Param | Type | Default | Description |
88
+ |-------|------|---------|-------------|
89
+ | page | integer | 1 | Page number |
90
+ | limit | integer | 20 | Items per page (max 100) |
91
+ | sort | string | createdAt | Sort field |
92
+ | order | string | desc | Sort order (asc/desc) |
93
+
94
+ **Response (200):** # HTTP 200 OK
95
+ {
96
+ "data": [Product],
97
+ "pagination": { "page": 1, "limit": 20, "total": 150, "totalPages": 8 }
98
+ }
99
+ ```
100
+
101
+ **Shared TypeScript interface:**
102
+ ```typescript
103
+ interface ApiError {
104
+ code: string;
105
+ message: string;
106
+ details?: Record<string, string[]>;
107
+ }
108
+ ```
109
+
110
+ ## Resources
111
+
112
+ - `${CLAUDE_SKILL_DIR}/references/writing-endpoints.md` -- Endpoint definition template and key elements
113
+ - `${CLAUDE_SKILL_DIR}/references/typescript-interfaces.md` -- Canonical type definitions and guidelines
114
+ - `${CLAUDE_SKILL_DIR}/references/pagination.md` -- Pagination parameters and PaginatedResponse interface
115
+ - `${CLAUDE_SKILL_DIR}/references/best-practices.md` -- Contract authoring rules (specificity, DRY, no implementation details)
@@ -0,0 +1,47 @@
1
+ # Best Practices
2
+
3
+ ## Best Practices
4
+
5
+ ### Be Specific
6
+
7
+ ```markdown
8
+ // Good
9
+ "email": "string (required, valid email format)"
10
+
11
+ // Bad
12
+ "email": "string"
13
+ ```
14
+
15
+ ### Include Examples
16
+
17
+ ```markdown
18
+ **Request Example:**
19
+ ```json
20
+ {
21
+ "email": "user@example.com",
22
+ "password": "SecurePass123"
23
+ }
24
+ ```
25
+ ```
26
+
27
+ ### Document All States
28
+
29
+ Include responses for:
30
+ - Success (200, 201, 204)
31
+ - Client errors (400, 401, 403, 404, 422)
32
+ - Empty states (empty arrays, null values)
33
+
34
+ ### Keep It DRY
35
+
36
+ Reference shared types instead of duplicating:
37
+
38
+ ```markdown
39
+ **Response:** `User` (see TypeScript Interfaces)
40
+ ```
41
+
42
+ ### No Implementation Details
43
+
44
+ The contract defines WHAT, not HOW:
45
+ - Don't mention database columns
46
+ - Don't specify frameworks
47
+ - Don't include file paths
@@ -0,0 +1,8 @@
1
+ # Error Handling Reference
2
+
3
+ ### Standard Error Format
4
+
5
+ ```markdown
6
+
7
+ ---
8
+ *[Tons of Skills](https://tonsofskills.com) by [Intent Solutions](https://intentsolutions.io) | [jeremylongshore.com](https://jeremylongshore.com)*