dojo.md 0.2.2 → 0.2.3

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 (149) hide show
  1. package/courses/GENERATION_LOG.md +20 -0
  2. package/courses/api-documentation-writing/course.yaml +12 -0
  3. package/courses/api-documentation-writing/scenarios/level-1/authentication-basics.yaml +46 -0
  4. package/courses/api-documentation-writing/scenarios/level-1/data-types-formats.yaml +45 -0
  5. package/courses/api-documentation-writing/scenarios/level-1/endpoint-description.yaml +45 -0
  6. package/courses/api-documentation-writing/scenarios/level-1/error-documentation.yaml +45 -0
  7. package/courses/api-documentation-writing/scenarios/level-1/first-documentation-shift.yaml +47 -0
  8. package/courses/api-documentation-writing/scenarios/level-1/getting-started-guide.yaml +42 -0
  9. package/courses/api-documentation-writing/scenarios/level-1/pagination-docs.yaml +51 -0
  10. package/courses/api-documentation-writing/scenarios/level-1/request-parameters.yaml +46 -0
  11. package/courses/api-documentation-writing/scenarios/level-1/request-response-examples.yaml +48 -0
  12. package/courses/api-documentation-writing/scenarios/level-1/status-codes.yaml +45 -0
  13. package/courses/api-documentation-writing/scenarios/level-2/error-patterns.yaml +48 -0
  14. package/courses/api-documentation-writing/scenarios/level-2/intermediate-documentation-shift.yaml +48 -0
  15. package/courses/api-documentation-writing/scenarios/level-2/oauth-documentation.yaml +47 -0
  16. package/courses/api-documentation-writing/scenarios/level-2/openapi-specification.yaml +46 -0
  17. package/courses/api-documentation-writing/scenarios/level-2/rate-limiting-docs.yaml +45 -0
  18. package/courses/api-documentation-writing/scenarios/level-2/request-body-schemas.yaml +46 -0
  19. package/courses/api-documentation-writing/scenarios/level-2/schema-definitions.yaml +41 -0
  20. package/courses/api-documentation-writing/scenarios/level-2/swagger-redoc-rendering.yaml +43 -0
  21. package/courses/api-documentation-writing/scenarios/level-2/validation-documentation.yaml +47 -0
  22. package/courses/api-documentation-writing/scenarios/level-2/versioning-changelog.yaml +42 -0
  23. package/courses/api-documentation-writing/scenarios/level-3/advanced-documentation-shift.yaml +43 -0
  24. package/courses/api-documentation-writing/scenarios/level-3/api-style-guide.yaml +40 -0
  25. package/courses/api-documentation-writing/scenarios/level-3/code-samples-multilang.yaml +40 -0
  26. package/courses/api-documentation-writing/scenarios/level-3/content-architecture.yaml +47 -0
  27. package/courses/api-documentation-writing/scenarios/level-3/deprecation-communication.yaml +44 -0
  28. package/courses/api-documentation-writing/scenarios/level-3/interactive-api-explorer.yaml +42 -0
  29. package/courses/api-documentation-writing/scenarios/level-3/migration-guides.yaml +42 -0
  30. package/courses/api-documentation-writing/scenarios/level-3/sdk-documentation.yaml +40 -0
  31. package/courses/api-documentation-writing/scenarios/level-3/webhook-documentation.yaml +48 -0
  32. package/courses/api-documentation-writing/scenarios/level-3/websocket-sse-docs.yaml +47 -0
  33. package/courses/api-documentation-writing/scenarios/level-4/api-changelog-management.yaml +44 -0
  34. package/courses/api-documentation-writing/scenarios/level-4/api-governance-standards.yaml +41 -0
  35. package/courses/api-documentation-writing/scenarios/level-4/api-product-strategy.yaml +41 -0
  36. package/courses/api-documentation-writing/scenarios/level-4/developer-portal-design.yaml +48 -0
  37. package/courses/api-documentation-writing/scenarios/level-4/docs-as-code.yaml +41 -0
  38. package/courses/api-documentation-writing/scenarios/level-4/documentation-localization.yaml +46 -0
  39. package/courses/api-documentation-writing/scenarios/level-4/documentation-metrics.yaml +45 -0
  40. package/courses/api-documentation-writing/scenarios/level-4/documentation-testing.yaml +41 -0
  41. package/courses/api-documentation-writing/scenarios/level-4/expert-documentation-shift.yaml +45 -0
  42. package/courses/api-documentation-writing/scenarios/level-4/multi-audience-docs.yaml +46 -0
  43. package/courses/api-documentation-writing/scenarios/level-5/ai-powered-documentation.yaml +44 -0
  44. package/courses/api-documentation-writing/scenarios/level-5/api-first-documentation.yaml +45 -0
  45. package/courses/api-documentation-writing/scenarios/level-5/api-marketplace-docs.yaml +42 -0
  46. package/courses/api-documentation-writing/scenarios/level-5/board-api-strategy.yaml +48 -0
  47. package/courses/api-documentation-writing/scenarios/level-5/documentation-program-strategy.yaml +42 -0
  48. package/courses/api-documentation-writing/scenarios/level-5/documentation-team-structure.yaml +47 -0
  49. package/courses/api-documentation-writing/scenarios/level-5/dx-competitive-advantage.yaml +46 -0
  50. package/courses/api-documentation-writing/scenarios/level-5/ecosystem-documentation.yaml +45 -0
  51. package/courses/api-documentation-writing/scenarios/level-5/industry-documentation-patterns.yaml +46 -0
  52. package/courses/api-documentation-writing/scenarios/level-5/master-documentation-shift.yaml +46 -0
  53. package/courses/code-review-feedback-writing/course.yaml +12 -0
  54. package/courses/code-review-feedback-writing/scenarios/level-1/approve-vs-request-changes.yaml +48 -0
  55. package/courses/code-review-feedback-writing/scenarios/level-1/asking-questions.yaml +50 -0
  56. package/courses/code-review-feedback-writing/scenarios/level-1/clear-comment-writing.yaml +45 -0
  57. package/courses/code-review-feedback-writing/scenarios/level-1/constructive-tone.yaml +43 -0
  58. package/courses/code-review-feedback-writing/scenarios/level-1/first-review-shift.yaml +46 -0
  59. package/courses/code-review-feedback-writing/scenarios/level-1/giving-praise.yaml +44 -0
  60. package/courses/code-review-feedback-writing/scenarios/level-1/nitpick-etiquette.yaml +44 -0
  61. package/courses/code-review-feedback-writing/scenarios/level-1/providing-context.yaml +46 -0
  62. package/courses/code-review-feedback-writing/scenarios/level-1/reviewing-small-prs.yaml +43 -0
  63. package/courses/code-review-feedback-writing/scenarios/level-1/style-vs-logic.yaml +48 -0
  64. package/courses/code-review-feedback-writing/scenarios/level-2/architectural-feedback.yaml +52 -0
  65. package/courses/code-review-feedback-writing/scenarios/level-2/intermediate-review-shift.yaml +46 -0
  66. package/courses/code-review-feedback-writing/scenarios/level-2/performance-feedback.yaml +50 -0
  67. package/courses/code-review-feedback-writing/scenarios/level-2/reviewing-breaking-changes.yaml +44 -0
  68. package/courses/code-review-feedback-writing/scenarios/level-2/reviewing-complex-prs.yaml +43 -0
  69. package/courses/code-review-feedback-writing/scenarios/level-2/reviewing-documentation.yaml +47 -0
  70. package/courses/code-review-feedback-writing/scenarios/level-2/reviewing-error-handling.yaml +50 -0
  71. package/courses/code-review-feedback-writing/scenarios/level-2/reviewing-tests.yaml +53 -0
  72. package/courses/code-review-feedback-writing/scenarios/level-2/security-review-comments.yaml +50 -0
  73. package/courses/code-review-feedback-writing/scenarios/level-2/suggesting-alternatives.yaml +42 -0
  74. package/courses/code-review-feedback-writing/scenarios/level-3/cross-team-review.yaml +45 -0
  75. package/courses/code-review-feedback-writing/scenarios/level-3/mentoring-through-review.yaml +46 -0
  76. package/courses/code-review-feedback-writing/scenarios/level-3/reviewing-unfamiliar-code.yaml +43 -0
  77. package/courses/terraform-infrastructure-setup/scenarios/level-1/first-debugging-shift.yaml +66 -0
  78. package/courses/terraform-infrastructure-setup/scenarios/level-1/plan-output-reading.yaml +71 -0
  79. package/courses/terraform-infrastructure-setup/scenarios/level-1/resource-creation-failures.yaml +54 -0
  80. package/courses/terraform-infrastructure-setup/scenarios/level-1/resource-references.yaml +70 -0
  81. package/courses/terraform-infrastructure-setup/scenarios/level-1/state-file-basics.yaml +73 -0
  82. package/courses/terraform-infrastructure-setup/scenarios/level-1/terraform-fmt-validate.yaml +58 -0
  83. package/courses/terraform-infrastructure-setup/scenarios/level-2/count-vs-for-each.yaml +58 -0
  84. package/courses/terraform-infrastructure-setup/scenarios/level-2/dependency-management.yaml +80 -0
  85. package/courses/terraform-infrastructure-setup/scenarios/level-2/intermediate-debugging-shift.yaml +66 -0
  86. package/courses/terraform-infrastructure-setup/scenarios/level-2/lifecycle-rules.yaml +51 -0
  87. package/courses/terraform-infrastructure-setup/scenarios/level-2/locals-and-expressions.yaml +58 -0
  88. package/courses/terraform-infrastructure-setup/scenarios/level-2/module-structure.yaml +75 -0
  89. package/courses/terraform-infrastructure-setup/scenarios/level-2/provisioner-pitfalls.yaml +64 -0
  90. package/courses/terraform-infrastructure-setup/scenarios/level-2/remote-state-backend.yaml +55 -0
  91. package/courses/terraform-infrastructure-setup/scenarios/level-2/terraform-import.yaml +55 -0
  92. package/courses/terraform-infrastructure-setup/scenarios/level-2/workspace-management.yaml +51 -0
  93. package/courses/terraform-infrastructure-setup/scenarios/level-3/advanced-debugging-shift.yaml +63 -0
  94. package/courses/terraform-infrastructure-setup/scenarios/level-3/api-rate-limiting.yaml +50 -0
  95. package/courses/terraform-infrastructure-setup/scenarios/level-3/conditional-resources.yaml +66 -0
  96. package/courses/terraform-infrastructure-setup/scenarios/level-3/drift-detection.yaml +66 -0
  97. package/courses/terraform-infrastructure-setup/scenarios/level-3/dynamic-blocks.yaml +71 -0
  98. package/courses/terraform-infrastructure-setup/scenarios/level-3/large-scale-refactoring.yaml +59 -0
  99. package/courses/terraform-infrastructure-setup/scenarios/level-3/multi-provider-config.yaml +69 -0
  100. package/courses/terraform-infrastructure-setup/scenarios/level-3/state-surgery.yaml +57 -0
  101. package/courses/terraform-infrastructure-setup/scenarios/level-3/terraform-cloud-enterprise.yaml +59 -0
  102. package/courses/terraform-infrastructure-setup/scenarios/level-3/terraform-debugging.yaml +51 -0
  103. package/courses/terraform-infrastructure-setup/scenarios/level-4/blast-radius-management.yaml +51 -0
  104. package/courses/terraform-infrastructure-setup/scenarios/level-4/cicd-pipeline-design.yaml +50 -0
  105. package/courses/terraform-infrastructure-setup/scenarios/level-4/compliance-as-code.yaml +46 -0
  106. package/courses/terraform-infrastructure-setup/scenarios/level-4/cost-estimation-governance.yaml +42 -0
  107. package/courses/terraform-infrastructure-setup/scenarios/level-4/expert-debugging-shift.yaml +51 -0
  108. package/courses/terraform-infrastructure-setup/scenarios/level-4/iac-organization-strategy.yaml +45 -0
  109. package/courses/terraform-infrastructure-setup/scenarios/level-4/incident-response-iac.yaml +47 -0
  110. package/courses/terraform-infrastructure-setup/scenarios/level-4/infrastructure-testing.yaml +41 -0
  111. package/courses/terraform-infrastructure-setup/scenarios/level-4/module-registry-design.yaml +45 -0
  112. package/courses/terraform-infrastructure-setup/scenarios/level-4/multi-account-strategy.yaml +57 -0
  113. package/courses/terraform-infrastructure-setup/scenarios/level-5/board-infrastructure-investment.yaml +53 -0
  114. package/courses/terraform-infrastructure-setup/scenarios/level-5/disaster-recovery-iac.yaml +47 -0
  115. package/courses/terraform-infrastructure-setup/scenarios/level-5/enterprise-iac-transformation.yaml +48 -0
  116. package/courses/terraform-infrastructure-setup/scenarios/level-5/iac-technology-evolution.yaml +49 -0
  117. package/courses/terraform-infrastructure-setup/scenarios/level-5/ma-infrastructure-consolidation.yaml +54 -0
  118. package/courses/terraform-infrastructure-setup/scenarios/level-5/master-debugging-shift.yaml +53 -0
  119. package/courses/terraform-infrastructure-setup/scenarios/level-5/multi-cloud-strategy.yaml +49 -0
  120. package/courses/terraform-infrastructure-setup/scenarios/level-5/platform-engineering.yaml +47 -0
  121. package/courses/terraform-infrastructure-setup/scenarios/level-5/regulatory-compliance-automation.yaml +47 -0
  122. package/courses/terraform-infrastructure-setup/scenarios/level-5/terraform-vs-alternatives.yaml +46 -0
  123. package/dist/cli/commands/generate.d.ts.map +1 -1
  124. package/dist/cli/commands/generate.js +2 -1
  125. package/dist/cli/commands/generate.js.map +1 -1
  126. package/dist/cli/commands/train.d.ts.map +1 -1
  127. package/dist/cli/commands/train.js +6 -3
  128. package/dist/cli/commands/train.js.map +1 -1
  129. package/dist/cli/index.js +9 -6
  130. package/dist/cli/index.js.map +1 -1
  131. package/dist/cli/run-demo.js +3 -2
  132. package/dist/cli/run-demo.js.map +1 -1
  133. package/dist/engine/model-utils.d.ts +6 -0
  134. package/dist/engine/model-utils.d.ts.map +1 -1
  135. package/dist/engine/model-utils.js +28 -1
  136. package/dist/engine/model-utils.js.map +1 -1
  137. package/dist/engine/training.d.ts.map +1 -1
  138. package/dist/engine/training.js +4 -3
  139. package/dist/engine/training.js.map +1 -1
  140. package/dist/generator/course-generator.d.ts.map +1 -1
  141. package/dist/generator/course-generator.js +4 -3
  142. package/dist/generator/course-generator.js.map +1 -1
  143. package/dist/mcp/server.d.ts.map +1 -1
  144. package/dist/mcp/server.js +7 -3
  145. package/dist/mcp/server.js.map +1 -1
  146. package/dist/mcp/session-manager.d.ts.map +1 -1
  147. package/dist/mcp/session-manager.js +3 -2
  148. package/dist/mcp/session-manager.js.map +1 -1
  149. package/package.json +1 -1
@@ -0,0 +1,47 @@
1
+ meta:
2
+ id: oauth-documentation
3
+ level: 2
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document OAuth 2.0 flows — write clear documentation for authorization code, client credentials, and refresh token flows"
7
+ tags: [API, documentation, OAuth, authentication, authorization, JWT, intermediate]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API uses OAuth 2.0 with multiple grant types. Developer
13
+ onboarding is painful — support tickets about authentication
14
+ are 40% of total volume:
15
+
16
+ - "What's the difference between authorization_code and
17
+ client_credentials?"
18
+ - "How do I get a token without a user logging in?"
19
+ - "My token expired mid-request — how do I refresh?"
20
+ - "What scopes do I need for each endpoint?"
21
+ - "The PKCE flow — what's the code_verifier?"
22
+
23
+ Your API supports:
24
+ 1. Authorization Code (with PKCE) — for user-facing apps
25
+ 2. Client Credentials — for server-to-server
26
+ 3. Refresh Token — for renewing expired tokens
27
+
28
+ Scopes: read, write, admin, payments:read, payments:write
29
+
30
+ Task: Write OAuth 2.0 documentation that reduces support tickets.
31
+ Include: when to use each grant type, step-by-step flow diagrams
32
+ (text-based), token lifecycle, scope documentation, and complete
33
+ code examples.
34
+
35
+ assertions:
36
+ - type: llm_judge
37
+ criteria: "Grant types are explained with use cases — Authorization Code + PKCE: for web/mobile apps where a user logs in. Flow: (1) redirect to /authorize with client_id, redirect_uri, code_challenge, (2) user logs in and consents, (3) callback receives authorization code, (4) exchange code for tokens at /token. Client Credentials: for server-to-server (no user). Flow: (1) POST /token with client_id, client_secret, grant_type=client_credentials. Decision guide: 'Use Authorization Code when acting on behalf of a user. Use Client Credentials when your server talks to our API directly.'"
38
+ weight: 0.35
39
+ description: "Grant types"
40
+ - type: llm_judge
41
+ criteria: "Token lifecycle is fully documented — access token: short-lived (1 hour), included as Bearer in Authorization header. Refresh token: long-lived (30 days), used to get new access tokens without re-authentication. Flow: POST /token with grant_type=refresh_token, refresh_token=<token>. Token response: { access_token, refresh_token, expires_in, token_type, scope }. Handle expiry: check expires_in, proactively refresh before expiry, handle 401 by refreshing and retrying. Store tokens securely (never in localStorage for web apps)"
42
+ weight: 0.35
43
+ description: "Token lifecycle"
44
+ - type: llm_judge
45
+ criteria: "Scopes and code examples are practical — scope documentation: table mapping each scope to what it grants access to. Endpoints list required scopes. Request scopes during authorization: scope=read+payments:write. Token contains granted scopes. Error when scope insufficient: 403 with 'insufficient_scope'. Code examples: complete working example in at least one language showing: (1) initial authorization, (2) token exchange, (3) making an API call, (4) refreshing when expired. PKCE: explain code_verifier/code_challenge for public clients"
46
+ weight: 0.30
47
+ description: "Scopes and examples"
@@ -0,0 +1,46 @@
1
+ meta:
2
+ id: openapi-specification
3
+ level: 2
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Write OpenAPI specifications — create OAS 3.0/3.1 definitions with paths, schemas, and security schemes"
7
+ tags: [API, documentation, OpenAPI, Swagger, OAS, specification, intermediate]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your team hand-writes all API documentation in Markdown. Problems:
13
+ - Documentation drifts from actual API behavior
14
+ - No interactive "try it out" functionality
15
+ - Can't auto-generate client SDKs
16
+ - No machine-readable API contract
17
+
18
+ You're tasked with writing the OpenAPI spec for the payment API.
19
+ First endpoint to document:
20
+
21
+ POST /api/v2/payments
22
+ - Creates a payment
23
+ - Auth: Bearer JWT
24
+ - Body: amount (integer, cents), currency (USD/EUR/GBP),
25
+ payment_method_id (string), metadata (object, optional)
26
+ - Returns: payment object with id, status, created_at
27
+ - Errors: 400, 401, 422
28
+
29
+ Task: Write the OpenAPI 3.1 specification for this endpoint.
30
+ Explain the OAS structure (info, servers, paths, components),
31
+ $ref references, schema definitions, and how OAS enables
32
+ interactive documentation and SDK generation.
33
+
34
+ assertions:
35
+ - type: llm_judge
36
+ criteria: "OAS structure is complete and valid — includes: openapi version (3.1.0), info (title, version, description), servers (production + sandbox URLs), paths with the POST /payments endpoint, components/schemas for request and response objects, components/securitySchemes for Bearer JWT. The path definition includes: summary, operationId, tags, requestBody with $ref to schema, responses for 201/400/401/422 each with $ref to response schemas. Schema properties have types, constraints (minimum, enum), descriptions, and required fields marked"
37
+ weight: 0.35
38
+ description: "Valid OAS"
39
+ - type: llm_judge
40
+ criteria: "$ref and schema patterns are used correctly — reusable schemas in components/schemas: CreatePaymentRequest, Payment, Error. Referenced via $ref: '#/components/schemas/Payment'. Reusable responses in components/responses. Benefits of $ref: DRY (define once, reference everywhere), consistent schemas across endpoints, easier maintenance. Schema composition: allOf for inheritance, oneOf for polymorphic responses. Example values included in schemas or as separate examples object"
41
+ weight: 0.35
42
+ description: "Schema patterns"
43
+ - type: llm_judge
44
+ criteria: "Benefits over hand-written docs are explained — OAS enables: (1) interactive documentation via Swagger UI or Redoc (try-it-out buttons), (2) client SDK generation (openapi-generator for TypeScript, Python, Go, etc.), (3) server stub generation, (4) contract testing (validate requests/responses against spec), (5) API gateway configuration, (6) mock servers (Prism). The spec IS the documentation — changes to spec automatically update docs. Single source of truth eliminates documentation drift"
45
+ weight: 0.30
46
+ description: "OAS benefits"
@@ -0,0 +1,45 @@
1
+ meta:
2
+ id: rate-limiting-docs
3
+ level: 2
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document rate limiting — write clear rate limit documentation with headers, tiers, retry strategies, and best practices"
7
+ tags: [API, documentation, rate-limiting, throttling, headers, retry, intermediate]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Developers keep getting rate limited and don't know how to handle it:
13
+ - "I'm getting 429 errors randomly — what are the limits?"
14
+ - "How long do I wait before retrying?"
15
+ - "Do different endpoints have different limits?"
16
+ - "My webhook processor hits the limit — how do I batch requests?"
17
+
18
+ Your API rate limits:
19
+ - Free tier: 100 requests/minute, 1000/hour
20
+ - Pro tier: 1000 requests/minute, 10000/hour
21
+ - Enterprise: custom limits
22
+ - Per-endpoint overrides: POST /payments limited to 50/minute
23
+ - Burst: up to 10 requests/second regardless of tier
24
+
25
+ Response headers:
26
+ X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
27
+ Retry-After (on 429 responses)
28
+
29
+ Task: Write comprehensive rate limiting documentation including:
30
+ limits by tier, response headers, retry strategies, and best
31
+ practices for staying within limits.
32
+
33
+ assertions:
34
+ - type: llm_judge
35
+ criteria: "Rate limits are clearly documented by tier — table format: tier, requests/minute, requests/hour, burst rate. Per-endpoint overrides listed separately (POST /payments: 50/min for fraud prevention). Headers explained: X-RateLimit-Limit (your total allowed), X-RateLimit-Remaining (how many left), X-RateLimit-Reset (Unix timestamp when window resets), Retry-After (seconds to wait, only on 429). Example response headers shown with actual values. How to check your current tier: GET /api/v1/account shows rate limit info"
36
+ weight: 0.35
37
+ description: "Rate limit tiers"
38
+ - type: llm_judge
39
+ criteria: "Retry strategy is explained with code — exponential backoff algorithm: wait = min(base_delay * 2^attempt, max_delay) + random_jitter. Code example showing proper 429 handling: check Retry-After header, fall back to exponential backoff, add jitter to prevent thundering herd. Maximum retry attempts (3-5). Example in code: if response.status === 429, wait parseInt(response.headers['retry-after']) seconds, then retry. Don't retry immediately — you'll just get rate limited again"
40
+ weight: 0.35
41
+ description: "Retry strategy"
42
+ - type: llm_judge
43
+ criteria: "Best practices for staying within limits — (1) monitor X-RateLimit-Remaining to throttle proactively (don't wait for 429), (2) batch operations where possible (bulk create instead of individual creates), (3) cache responses (don't re-fetch data that hasn't changed — use ETags), (4) use webhooks instead of polling, (5) spread requests evenly (don't burst all at start of minute), (6) request rate limit increase if consistently hitting limits. Anti-pattern: aggressive retry loops without backoff. Contact sales for enterprise needs"
44
+ weight: 0.30
45
+ description: "Best practices"
@@ -0,0 +1,46 @@
1
+ meta:
2
+ id: request-body-schemas
3
+ level: 2
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document request body schemas — write detailed schemas for create, update, and partial update operations with validation rules"
7
+ tags: [API, documentation, schemas, request-body, validation, PATCH, intermediate]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Developers struggle with your API's request bodies:
13
+
14
+ POST /api/v1/orders (create) — expects full object
15
+ PUT /api/v1/orders/{id} (full update) — expects full object
16
+ PATCH /api/v1/orders/{id} (partial update) — expects partial object
17
+
18
+ Questions:
19
+ - "What's the difference between PUT and PATCH?"
20
+ - "Which fields are required for POST vs PUT vs PATCH?"
21
+ - "Can I send null to clear a field?"
22
+ - "What happens if I send extra fields not in the schema?"
23
+ - "The nested 'shipping_address' — do I send the whole object
24
+ or just the fields I want to change?"
25
+
26
+ Order object: status (enum), items (array of objects),
27
+ shipping_address (nested object), notes (string, nullable),
28
+ discount_code (string, optional), metadata (object)
29
+
30
+ Task: Document request body schemas for POST, PUT, and PATCH
31
+ operations. Include: required fields per operation, null handling,
32
+ nested object update behavior, and validation rules.
33
+
34
+ assertions:
35
+ - type: llm_judge
36
+ criteria: "POST/PUT/PATCH differences are clear — POST (create): send all required fields, optional fields use defaults if omitted. PUT (full replace): send entire object, omitted fields are reset to defaults (not just unchanged). PATCH (partial update): send only fields to change, omitted fields remain unchanged. For each operation: separate schema showing which fields are required. Example: POST requires items and shipping_address, PATCH requires nothing (all optional). Unknown fields: document whether they're ignored (lenient) or rejected (strict)"
37
+ weight: 0.35
38
+ description: "Operation types"
39
+ - type: llm_judge
40
+ criteria: "Null handling and nested objects are documented — null vs omitted: sending 'notes': null explicitly clears the field. Omitting 'notes' in PATCH means don't change it. For PUT: omitting 'notes' resets to default (null). Document this distinction clearly — it's a common source of bugs. Nested objects in PATCH: 'shipping_address': { 'city': 'New York' } — does this replace the entire address or merge? Document the behavior (typically: replace the entire nested object). For merge behavior: use JSON Merge Patch (RFC 7396) and document it"
41
+ weight: 0.35
42
+ description: "Null and nested"
43
+ - type: llm_judge
44
+ criteria: "Validation rules are specific — per-field validation: status (enum: pending/confirmed/shipped/delivered — can only transition forward), items (non-empty array, min 1 item), shipping_address (required for non-digital orders), discount_code (alphanumeric, 6-20 chars, validated against active codes). Show validation error response for each rule violation. Document which validations are checked on create vs update (e.g., status can't be set on create — always starts as 'pending'). Array handling in PATCH: does sending items replace the entire array or append?"
45
+ weight: 0.30
46
+ description: "Validation rules"
@@ -0,0 +1,41 @@
1
+ meta:
2
+ id: schema-definitions
3
+ level: 2
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Define API schemas — use allOf, oneOf, anyOf for complex object models, polymorphic responses, and schema composition"
7
+ tags: [API, documentation, schemas, allOf, oneOf, composition, intermediate]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API has complex data models that are hard to document:
13
+
14
+ 1. A "notification" can be either an email, SMS, or push notification
15
+ — each has different required fields
16
+ 2. An "event" object has a base structure plus type-specific data
17
+ 3. A "user" response includes address (shared with "organization")
18
+
19
+ Developers ask:
20
+ - "Which fields are required for an SMS notification vs email?"
21
+ - "The event payload changes based on event type — how do I know
22
+ which fields to expect?"
23
+ - "Address appears in both user and organization — are they the same?"
24
+
25
+ Task: Write OpenAPI schemas using allOf (composition/inheritance),
26
+ oneOf (exclusive types), and anyOf (flexible types). Show how to
27
+ document polymorphic APIs, shared components, and discriminators.
28
+
29
+ assertions:
30
+ - type: llm_judge
31
+ criteria: "allOf is used for composition — allOf combines multiple schemas: User = allOf[BaseEntity, UserFields, Address]. BaseEntity has id, created_at (shared across all entities). Address is a reusable component shared between User and Organization. The result is a combined object with all properties from all schemas. Use for: common base fields, mixins (adding address to multiple types), extending a base schema without modifying it"
32
+ weight: 0.35
33
+ description: "allOf composition"
34
+ - type: llm_judge
35
+ criteria: "oneOf with discriminator handles polymorphism — Notification: oneOf[EmailNotification, SMSNotification, PushNotification] with discriminator on 'type' field. Each variant has type-specific required fields (EmailNotification requires 'to_email', 'subject'; SMSNotification requires 'phone_number', 'message'). discriminator: { propertyName: 'type', mapping: { email: '#/components/schemas/EmailNotification' } }. This tells documentation tools and code generators which schema applies based on the type field value"
36
+ weight: 0.35
37
+ description: "oneOf polymorphism"
38
+ - type: llm_judge
39
+ criteria: "Documentation clarity for complex schemas is addressed — for polymorphic types: show one example per variant (email notification example, SMS example, push example). Include a table: type value → required fields → example. For composition: show the resulting combined object (developers care about the final shape, not the composition mechanics). Mark which properties come from which component for maintainability. anyOf: used when payload can match multiple schemas simultaneously (less common, use sparingly). Keep schema nesting shallow — deeply nested $ref chains are hard to follow"
40
+ weight: 0.30
41
+ description: "Documentation clarity"
@@ -0,0 +1,43 @@
1
+ meta:
2
+ id: swagger-redoc-rendering
3
+ level: 2
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Configure documentation rendering — set up Swagger UI and Redoc from OpenAPI specs, customize appearance, and optimize for developer experience"
7
+ tags: [API, documentation, Swagger-UI, Redoc, rendering, interactive, intermediate]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ You have a valid OpenAPI 3.1 spec but need to render it as
13
+ interactive documentation. Your options:
14
+
15
+ 1. Swagger UI — interactive "try it out" feature
16
+ 2. Redoc — beautiful three-column layout
17
+ 3. Both — different use cases
18
+
19
+ Requirements:
20
+ - Interactive testing for developers in sandbox
21
+ - Beautiful static docs for the public marketing site
22
+ - Custom branding (company colors, logo)
23
+ - Code examples in multiple languages
24
+ - Mobile-friendly
25
+
26
+ Task: Explain how to set up both Swagger UI and Redoc from an
27
+ OpenAPI spec, compare their strengths, customize for branding,
28
+ and optimize the rendering for developer experience. Include
29
+ tips for writing OpenAPI specs that render well.
30
+
31
+ assertions:
32
+ - type: llm_judge
33
+ criteria: "Swagger UI and Redoc setup are explained — Swagger UI: host the spec file, include swagger-ui-dist NPM package or CDN link, configure with spec URL. Key feature: 'Try it out' button lets developers make real API calls. Redoc: include redoc NPM package or CDN, point to spec URL. Key feature: beautiful three-column layout (navigation, description, code examples). Both auto-render from the same OpenAPI spec file. Setup is minimal — a single HTML page with a script tag and spec URL"
34
+ weight: 0.35
35
+ description: "Setup"
36
+ - type: llm_judge
37
+ criteria: "Comparison helps choose the right tool — Swagger UI: best for interactive exploration and testing, built-in auth token management, shows curl commands. Weaknesses: less polished design, harder to customize branding. Redoc: best for beautiful reference documentation, better for large APIs (performance), mobile-friendly, deep linking. Weaknesses: no built-in try-it-out (need Redocly for that). Recommendation: Swagger UI for internal/developer sandbox, Redoc for public-facing documentation. Or: use Redocly (commercial) for both interactive + beautiful"
38
+ weight: 0.35
39
+ description: "Comparison"
40
+ - type: llm_judge
41
+ criteria: "OAS writing tips for better rendering are practical — (1) use descriptive summary and description on every operation (summary = short title, description = detailed). (2) Add tags to group endpoints logically (not alphabetically). (3) Include examples in schemas (renders as sample values). (4) Use x-codeSamples vendor extension for multi-language code examples. (5) Write descriptions in Markdown (both renderers support it). (6) Use externalDocs for linking to guides. (7) Order tags with x-tagGroups for logical sections. (8) Add server descriptions for environment switching (sandbox vs production)"
42
+ weight: 0.30
43
+ description: "Writing tips"
@@ -0,0 +1,47 @@
1
+ meta:
2
+ id: validation-documentation
3
+ level: 2
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document validation rules — write clear field validation documentation with constraints, enums, patterns, and conditional requirements"
7
+ tags: [API, documentation, validation, constraints, enums, patterns, intermediate]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API has complex validation rules that aren't documented.
13
+ Developers discover them only when they hit 422 errors:
14
+
15
+ - "Why was my phone number rejected? I sent +1-555-0123"
16
+ - "The docs say 'name' is a string but my 300-char name was rejected"
17
+ - "Why do I need 'state' for US addresses but not UK addresses?"
18
+ - "What date formats are accepted? I tried MM/DD/YYYY"
19
+
20
+ Field validations:
21
+ - email: RFC 5322, max 254 chars, unique per account
22
+ - phone: E.164 format (+15550123456, no dashes/spaces)
23
+ - name: 1-100 chars, Unicode allowed
24
+ - url: HTTPS required, max 2048 chars
25
+ - country: ISO 3166-1 alpha-2 (US, GB, DE)
26
+ - state: required when country = US or CA, ISO 3166-2
27
+ - amount: integer, min 50 (cents), max 99999999
28
+ - date_of_birth: ISO 8601 (YYYY-MM-DD), must be 13+ years ago
29
+
30
+ Task: Document all validation rules clearly so developers can
31
+ validate client-side before sending requests. Include: format
32
+ specifications, constraints, conditional requirements, and
33
+ validation error examples.
34
+
35
+ assertions:
36
+ - type: llm_judge
37
+ criteria: "Each field's validation is precisely documented — for each field: format (with regex pattern if applicable), min/max length, allowed characters, example of valid value, example of invalid value with specific rejection reason. Phone: E.164 format means digits only with + prefix, 7-15 digits (valid: +15550123456, invalid: +1-555-0123 — no dashes allowed). Date: ISO 8601 date only YYYY-MM-DD (valid: 1990-05-15, invalid: 05/15/1990). Each constraint has the exact error message the API returns when violated"
38
+ weight: 0.35
39
+ description: "Precise validation"
40
+ - type: llm_judge
41
+ criteria: "Conditional rules are clearly explained — state required when country is US or CA: document this as a conditional requirement with clear language: 'Required when country is US or CA. Must be a valid ISO 3166-2 subdivision code (e.g., US-CA for California).' Table showing which fields are required based on other field values. Business rules: amount minimum 50 means minimum charge is $0.50 — explain the business reason. age restriction: date_of_birth must be at least 13 years before current date (COPPA compliance)"
42
+ weight: 0.35
43
+ description: "Conditional rules"
44
+ - type: llm_judge
45
+ criteria: "Client-side validation guidance is provided — provide regex patterns developers can copy for client-side validation. JSON Schema fragments they can use for validation libraries. Example validation error response for each type of failure. Recommendation: validate client-side first to avoid unnecessary API calls, but don't rely solely on client-side validation (server is authoritative). Note which validations are format-only (can validate locally) vs business-rule (must check server, like email uniqueness)"
46
+ weight: 0.30
47
+ description: "Client-side guidance"
@@ -0,0 +1,42 @@
1
+ meta:
2
+ id: versioning-changelog
3
+ level: 2
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document API versioning and changelogs — write version migration guides, changelog entries, and deprecation notices"
7
+ tags: [API, documentation, versioning, changelog, deprecation, migration, intermediate]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API is releasing v2. Developers on v1 are confused:
13
+ - "What changed between v1 and v2?"
14
+ - "Will v1 stop working? When?"
15
+ - "How do I migrate? What code do I need to change?"
16
+ - "The changelog just says 'improvements' — that's useless"
17
+
18
+ Changes from v1 to v2:
19
+ - User object: "name" split into "first_name" and "last_name"
20
+ - Pagination: offset/limit → cursor-based
21
+ - Auth: API key deprecated → OAuth 2.0 required
22
+ - New: webhook events for user.created, user.deleted
23
+ - Removed: GET /api/v1/users/search (merged into GET /users?q=)
24
+ - Rate limits: increased from 100/min to 1000/min
25
+
26
+ Task: Write version documentation including: changelog format,
27
+ migration guide from v1 to v2, deprecation timeline for v1,
28
+ and versioning strategy documentation.
29
+
30
+ assertions:
31
+ - type: llm_judge
32
+ criteria: "Changelog is specific and actionable — each entry categorized: Added (new features), Changed (modifications), Deprecated (features being removed), Removed (features removed), Fixed (bug fixes), Security (vulnerability fixes). Each entry is specific: not 'improvements' but 'Split User.name into first_name and last_name for better internationalization support'. Breaking changes clearly flagged with migration instructions. Date and version number for each release"
33
+ weight: 0.35
34
+ description: "Changelog format"
35
+ - type: llm_judge
36
+ criteria: "Migration guide shows before/after — for each breaking change: what it was in v1, what it is in v2, code example showing the change. Example: 'User name field: v1: { name: \"Jane Cooper\" } → v2: { first_name: \"Jane\", last_name: \"Cooper\" }. Action: split your name handling into first_name and last_name.' Pagination migration: show v1 request and v2 equivalent. Auth migration: step-by-step OAuth setup replacing API key. Each change has estimated effort (5 min, 30 min, 2 hours)"
37
+ weight: 0.35
38
+ description: "Migration guide"
39
+ - type: llm_judge
40
+ criteria: "Deprecation timeline and versioning strategy are clear — deprecation timeline: (1) today — v2 released, v1 deprecated, (2) 3 months — deprecation warnings in v1 responses (Sunset header), (3) 6 months — v1 read-only, (4) 12 months — v1 shutdown (returns 410 Gone). Versioning strategy: URL-based (/v1/, /v2/), major version = breaking changes only. Header: Sunset: Sat, 01 Mar 2027 00:00:00 GMT. Communication plan: email, dashboard banner, blog post, in-response headers"
41
+ weight: 0.30
42
+ description: "Deprecation timeline"
@@ -0,0 +1,43 @@
1
+ meta:
2
+ id: advanced-documentation-shift
3
+ level: 3
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Combined advanced shift — design complete developer documentation portal including real-time APIs, webhooks, SDKs, and migration guides for a growing platform"
7
+ tags: [API, documentation, combined, shift-simulation, portal, advanced]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your fintech platform is graduating from "startup API" to
13
+ "developer platform." You have 500 integrations and need
14
+ professional-grade documentation. Current state:
15
+
16
+ - REST API: 60 endpoints, OpenAPI spec exists but docs are basic
17
+ - WebSocket: real-time transaction feed, undocumented
18
+ - Webhooks: 15 event types, only 3 documented
19
+ - SDKs: Python and Node.js, README-only docs
20
+ - Migration: v1 → v2 happening in 3 months, no migration guide
21
+ - Sandbox: exists but undocumented
22
+ - Support tickets: 40% are "how do I..." questions the docs should answer
23
+
24
+ Task: Create the complete documentation plan and write the key
25
+ sections. Deliver: (1) information architecture for the full
26
+ developer portal, (2) complete webhook documentation for all 15
27
+ event types, (3) WebSocket getting started guide, (4) v1→v2
28
+ migration guide outline with the authentication migration section
29
+ written in full, and (5) SDK quick start for Python.
30
+
31
+ assertions:
32
+ - type: llm_judge
33
+ criteria: "Information architecture covers the full platform — site map with sections: Getting Started (quickstart, sandbox, authentication), REST API Reference (grouped by resource), WebSocket API (connection, channels, events), Webhooks (setup, events, security, testing), SDKs (Python, Node.js — install, quick start, reference), Guides (migration v1→v2, best practices, common patterns), Changelog, Status. Each section: target audience, content type (tutorial/guide/reference), priority (must-have for launch vs nice-to-have). Navigation: global search, breadcrumbs, prev/next links. Content gap analysis: what's missing today vs what's needed. Timeline: which sections to write first based on support ticket analysis"
34
+ weight: 0.35
35
+ description: "Information architecture"
36
+ - type: llm_judge
37
+ criteria: "Webhook docs, WebSocket guide, and SDK quickstart are substantive — webhook documentation: all 15 event types with payload schemas, signature verification guide with code, retry behavior, testing tools. Not just a list — each event has trigger condition, payload example, and common use case. WebSocket guide: connection URL, authentication, subscribe to channels, handle events, reconnection strategy — a developer could connect after reading this. Python SDK quickstart: pip install, configure client, make first API call, handle errors — complete in under 5 minutes. Each section is actually written (not just outlined), with realistic code examples and real data"
38
+ weight: 0.35
39
+ description: "Key sections"
40
+ - type: llm_judge
41
+ criteria: "Migration guide section is complete and actionable — v1→v2 migration outline covers all breaking changes with timeline. Authentication migration section written in full: step-by-step from Basic Auth to OAuth 2.0, code before/after, how to get OAuth credentials, transition period (both methods work), testing strategy, rollback plan. Migration guide has: quick assessment (am I affected?), estimated effort per change, recommended migration order, verification checklist. Support reduction strategy: documentation addresses the top 10 support ticket categories, self-service troubleshooting for common issues, embedded feedback mechanism for docs"
42
+ weight: 0.30
43
+ description: "Migration and support"
@@ -0,0 +1,40 @@
1
+ meta:
2
+ id: api-style-guide
3
+ level: 3
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Create API style guide — establish consistent documentation standards for naming, formatting, examples, and tone across all API documentation"
7
+ tags: [API, documentation, style-guide, standards, consistency, naming, advanced]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your company has 12 microservices, each documented by a different team.
13
+ The inconsistencies are confusing developers:
14
+
15
+ - One API uses "userId", another "user_id", another "UserID"
16
+ - Some endpoints return { data: [...] }, others return bare arrays
17
+ - Error formats vary: { error: "msg" } vs { errors: [{...}] } vs { message: "msg" }
18
+ - Date formats: ISO 8601, Unix timestamps, "MM/DD/YYYY" strings
19
+ - Authentication: some use "Authorization: Bearer", others "X-API-Key"
20
+ - Some docs say "returns the user object", others show the full schema
21
+
22
+ Task: Write a comprehensive API documentation style guide that all teams
23
+ must follow. Cover: naming conventions, response envelope standards,
24
+ error format, data types, authentication patterns, example formatting,
25
+ and tone/voice guidelines. This will be the single source of truth for
26
+ documentation consistency.
27
+
28
+ assertions:
29
+ - type: llm_judge
30
+ criteria: "Naming and formatting standards are precise — field naming: snake_case for JSON properties (user_id, created_at), kebab-case for URLs (/api/v1/user-profiles), camelCase prohibited with migration path for existing APIs. Resource naming: plural nouns for collections (/users, /payments), singular for actions (/users/{id}/activate). Consistent envelope: { data, meta, pagination } for collections, { data } for singles. Date/time: always ISO 8601 with timezone (2024-01-15T10:30:00Z). Currency: always integer cents with separate currency field. IDs: string type (not integer) to allow future format changes. Boolean fields: prefixed with is_ or has_ (is_active, has_subscription)"
31
+ weight: 0.35
32
+ description: "Naming standards"
33
+ - type: llm_judge
34
+ criteria: "Error format and documentation patterns are standardized — universal error format: { type (URL to error doc), code (machine-readable string), message (human-readable), details (array of field-level errors), request_id }. Every endpoint must document: summary (one line), description (detailed), authentication requirement, request parameters (with types, constraints, examples), response schema (with examples), error responses (specific to endpoint), rate limit info. Example format: always show curl + one SDK language, always use realistic (not foo/bar) data, always show both success and error cases. Tone: second person ('you'), active voice, present tense, no jargon without definition"
35
+ weight: 0.35
36
+ description: "Error and doc patterns"
37
+ - type: llm_judge
38
+ criteria: "Migration and enforcement strategies are practical — for existing inconsistent APIs: migration timeline (deprecate old patterns over 2 versions), backward compatibility strategy (accept both old and new naming during transition). Enforcement: linting rules (Spectral/openapi-lint) for OpenAPI specs, CI/CD checks that block merging non-compliant docs, templates for new endpoint documentation. Living document: version the style guide itself, changelog for style guide updates, exceptions process (request variance with justification). Review checklist: documentation review as part of PR process. Adoption: start with new APIs, migrate existing APIs by priority (most-used first)"
39
+ weight: 0.30
40
+ description: "Migration strategy"
@@ -0,0 +1,40 @@
1
+ meta:
2
+ id: code-samples-multilang
3
+ level: 3
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Write multi-language code samples — create consistent, tested code examples across Python, Node.js, curl, and other languages for API endpoints"
7
+ tags: [API, documentation, code-samples, multi-language, examples, curl, advanced]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API documentation has code examples but only in curl. Developers
13
+ using Python, Node.js, Go, and Java feel unsupported. When you do add
14
+ examples, they're inconsistent:
15
+
16
+ - curl example creates a payment with amount: 2000
17
+ - Python example creates with amount: 5000
18
+ - Node.js example is missing error handling
19
+ - Go example uses a deprecated library
20
+ - Java example doesn't compile
21
+
22
+ Task: Write a code sample strategy and produce examples for the
23
+ "Create Payment" endpoint in curl, Python, Node.js, and Go. Each
24
+ example must: use identical parameters, include error handling,
25
+ follow language idioms, and be copy-paste runnable. Also document
26
+ your process for keeping examples consistent and tested.
27
+
28
+ assertions:
29
+ - type: llm_judge
30
+ criteria: "Code examples are consistent and complete — all four languages (curl, Python, Node.js, Go) create the same payment: amount 2000, currency 'usd', customer_id 'cus_123', same metadata. Each example includes: import/setup, authentication, the API call, response handling, error handling. curl: shows -H headers, -d JSON body, response parsing with jq. Python: requests library with proper headers and json parameter. Node.js: fetch or axios with async/await. Go: net/http with proper JSON marshaling and error checking. All examples use the same sandbox URL and test API key (sk_test_...)"
31
+ weight: 0.35
32
+ description: "Consistent examples"
33
+ - type: llm_judge
34
+ criteria: "Language idioms are respected — Python: use requests.post() not urllib, use f-strings for interpolation, snake_case variables, proper exception handling with requests.exceptions. Node.js: async/await (not callbacks or .then()), destructuring, const/let (not var), proper try/catch. Go: proper error checking (if err != nil), defer resp.Body.Close(), json.NewDecoder, no panic in examples. curl: proper quoting, -X POST, -H for headers, -d for body, show piping to jq for readable output. Each feels like code a native developer would write, not a translation from another language"
35
+ weight: 0.35
36
+ description: "Language idioms"
37
+ - type: llm_judge
38
+ criteria: "Testing and maintenance strategy is documented — how to keep examples in sync: (1) single source of truth for parameter values (YAML/JSON config file), (2) code generation from templates or automated testing that runs each example against sandbox, (3) CI/CD that tests examples on every API change. Recommend x-codeSamples OpenAPI extension for embedding in spec. Version management: examples tagged with API version, updated when API changes. Contribution guide: how to add a new language. Common mistakes to avoid: hardcoded URLs (use variables), missing error handling, using deprecated APIs, not showing response parsing. Review checklist for code examples"
39
+ weight: 0.30
40
+ description: "Testing strategy"
@@ -0,0 +1,47 @@
1
+ meta:
2
+ id: content-architecture
3
+ level: 3
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Design documentation content architecture — organize API docs into reference, guides, tutorials, and concepts with clear navigation and information hierarchy"
7
+ tags: [API, documentation, content-architecture, information-design, navigation, advanced]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API documentation is a single long page with everything mixed
13
+ together — endpoint reference, tutorials, conceptual explanations,
14
+ and authentication setup all jumbled. Developers can't find what they
15
+ need:
16
+
17
+ - New developers want a tutorial to get started
18
+ - Experienced developers want quick endpoint reference
19
+ - Architects want to understand the API's design philosophy
20
+ - Support engineers want troubleshooting guides
21
+
22
+ Your content includes:
23
+ - 40 API endpoints across 8 resources
24
+ - Authentication (3 methods)
25
+ - Webhooks (12 event types)
26
+ - Rate limiting, pagination, error handling
27
+ - 5 integration guides (Shopify, WordPress, etc.)
28
+ - SDKs in 4 languages
29
+
30
+ Task: Design the information architecture for your API documentation.
31
+ Define content types, navigation structure, page templates, and the
32
+ user journey from first visit to production integration. Show how
33
+ different audiences find what they need.
34
+
35
+ assertions:
36
+ - type: llm_judge
37
+ criteria: "Content types are clearly defined — four content types: (1) Tutorials — step-by-step learning paths for beginners ('Accept your first payment in 10 minutes'), task-oriented, sequential. (2) How-to Guides — goal-oriented for specific tasks ('Handle webhook failures'), assumes knowledge, practical. (3) Reference — comprehensive endpoint documentation, auto-generated from OpenAPI, organized by resource. (4) Concepts — explanatory content ('How authentication works', 'Understanding idempotency'), theory and architecture. Each type has a template showing required sections. Content is tagged by audience: beginner, intermediate, advanced. Diátaxis framework referenced or similar"
38
+ weight: 0.35
39
+ description: "Content types"
40
+ - type: llm_judge
41
+ criteria: "Navigation and information hierarchy serve different audiences — top-level navigation: Getting Started, Guides, API Reference, SDKs, Webhooks, Changelog. Getting Started: linear path from signup to first API call to production launch. API Reference: organized by resource (Payments, Customers, Subscriptions, Invoices) not alphabetically. Each resource page: overview, create, read, update, delete, list. Sidebar navigation: collapsible sections, current location highlighted, search prominent. Cross-linking: reference pages link to relevant guides, guides link to reference for details. Quick-find patterns: search, breadcrumbs, 'On this page' table of contents for long pages"
42
+ weight: 0.35
43
+ description: "Navigation design"
44
+ - type: llm_judge
45
+ criteria: "User journeys are mapped — journey 1 (new developer): landing page → quickstart → first API call → explore endpoints → production checklist. Journey 2 (experienced developer switching from competitor): migration guide → API reference → SDK setup → go live. Journey 3 (architect evaluating): concepts → authentication overview → rate limits → SLA/status page. Journey 4 (debugging): error code lookup → troubleshooting guide → support contact. Each journey has clear entry points and next-step links. Landing page serves as router directing each persona. 404 page suggests related content. Analytics: track which journeys are most common, where developers drop off"
46
+ weight: 0.30
47
+ description: "User journeys"
@@ -0,0 +1,44 @@
1
+ meta:
2
+ id: deprecation-communication
3
+ level: 3
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document API deprecation — write clear deprecation notices, sunset timelines, and communication plans that minimize developer disruption"
7
+ tags: [API, documentation, deprecation, sunset, lifecycle, communication, advanced]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ You need to deprecate several API features and communicate this to
13
+ developers without causing panic or confusion:
14
+
15
+ 1. Entire endpoint removal: DELETE /users/{id}/avatar (replaced by
16
+ PATCH /users/{id} with avatar: null)
17
+ 2. Field deprecation: "user.username" field being replaced by
18
+ "user.display_name" (different validation rules)
19
+ 3. Authentication method sunset: Basic Auth being removed, only
20
+ OAuth 2.0 going forward
21
+ 4. SDK version end-of-life: Python SDK v2.x, only v3.x supported
22
+ 5. Response format change: XML response format being dropped, JSON only
23
+
24
+ Each has a different timeline and impact level. Some affect all
25
+ developers, others affect a small subset.
26
+
27
+ Task: Write deprecation documentation for all five items. Include:
28
+ deprecation notices, migration paths for each, timeline with key
29
+ dates, HTTP headers/response fields that signal deprecation, and
30
+ a communication plan (how developers are notified).
31
+
32
+ assertions:
33
+ - type: llm_judge
34
+ criteria: "Each deprecation is documented with full lifecycle — for each item: (1) what is deprecated (specific endpoint/field/feature), (2) why (security, simplification, standards compliance), (3) replacement (exact alternative with code example), (4) timeline with four phases: announced → deprecated (still works, warnings) → sunset warning (rate-limited or degraded) → removed. Dates for each phase. HTTP signals: Deprecation header (RFC 8594), Sunset header with date, Warning header with human message. API response includes deprecation_warnings array when deprecated features are used. Documentation: deprecated items visually marked (strikethrough, warning banner) but still documented until removal"
35
+ weight: 0.35
36
+ description: "Deprecation lifecycle"
37
+ - type: llm_judge
38
+ criteria: "Migration paths are specific and actionable — endpoint removal: show curl before/after, explain that PATCH with null achieves the same result. Field deprecation: both fields returned during transition period, show how to update code to use new field, document different validation rules between old and new. Basic Auth sunset: step-by-step OAuth 2.0 setup guide, tool to generate OAuth credentials from existing Basic Auth credentials. SDK EOL: changelog of breaking changes between v2→v3, automated upgrade tool or codemods if available, v2 receives security patches only during transition. XML removal: show Content-Type/Accept header changes, library migration for XML parsers"
39
+ weight: 0.35
40
+ description: "Migration paths"
41
+ - type: llm_judge
42
+ criteria: "Communication plan covers all channels — notification channels: (1) email to registered developers (personalized: 'Your integration uses Basic Auth, which sunsets on DATE'), (2) dashboard banner, (3) changelog entry, (4) API response headers on affected requests, (5) status page announcement, (6) developer blog post explaining the reasoning. Cadence: initial announcement, then reminders at 6 months, 3 months, 1 month, 1 week before sunset. Metrics: track adoption of replacements, identify developers who haven't migrated, offer direct support to high-impact integrations. Escalation: what happens after sunset — hard failure (401/410) with helpful error message pointing to migration docs, not silent data loss"
43
+ weight: 0.30
44
+ description: "Communication plan"