dojo.md 0.2.1 → 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 (152) 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/hcl-syntax-errors.yaml +65 -0
  79. package/courses/terraform-infrastructure-setup/scenarios/level-1/plan-output-reading.yaml +71 -0
  80. package/courses/terraform-infrastructure-setup/scenarios/level-1/provider-configuration.yaml +62 -0
  81. package/courses/terraform-infrastructure-setup/scenarios/level-1/resource-creation-failures.yaml +54 -0
  82. package/courses/terraform-infrastructure-setup/scenarios/level-1/resource-references.yaml +70 -0
  83. package/courses/terraform-infrastructure-setup/scenarios/level-1/state-file-basics.yaml +73 -0
  84. package/courses/terraform-infrastructure-setup/scenarios/level-1/terraform-fmt-validate.yaml +58 -0
  85. package/courses/terraform-infrastructure-setup/scenarios/level-1/variable-and-output-errors.yaml +78 -0
  86. package/courses/terraform-infrastructure-setup/scenarios/level-2/count-vs-for-each.yaml +58 -0
  87. package/courses/terraform-infrastructure-setup/scenarios/level-2/dependency-management.yaml +80 -0
  88. package/courses/terraform-infrastructure-setup/scenarios/level-2/intermediate-debugging-shift.yaml +66 -0
  89. package/courses/terraform-infrastructure-setup/scenarios/level-2/lifecycle-rules.yaml +51 -0
  90. package/courses/terraform-infrastructure-setup/scenarios/level-2/locals-and-expressions.yaml +58 -0
  91. package/courses/terraform-infrastructure-setup/scenarios/level-2/module-structure.yaml +75 -0
  92. package/courses/terraform-infrastructure-setup/scenarios/level-2/provisioner-pitfalls.yaml +64 -0
  93. package/courses/terraform-infrastructure-setup/scenarios/level-2/remote-state-backend.yaml +55 -0
  94. package/courses/terraform-infrastructure-setup/scenarios/level-2/terraform-import.yaml +55 -0
  95. package/courses/terraform-infrastructure-setup/scenarios/level-2/workspace-management.yaml +51 -0
  96. package/courses/terraform-infrastructure-setup/scenarios/level-3/advanced-debugging-shift.yaml +63 -0
  97. package/courses/terraform-infrastructure-setup/scenarios/level-3/api-rate-limiting.yaml +50 -0
  98. package/courses/terraform-infrastructure-setup/scenarios/level-3/conditional-resources.yaml +66 -0
  99. package/courses/terraform-infrastructure-setup/scenarios/level-3/drift-detection.yaml +66 -0
  100. package/courses/terraform-infrastructure-setup/scenarios/level-3/dynamic-blocks.yaml +71 -0
  101. package/courses/terraform-infrastructure-setup/scenarios/level-3/large-scale-refactoring.yaml +59 -0
  102. package/courses/terraform-infrastructure-setup/scenarios/level-3/multi-provider-config.yaml +69 -0
  103. package/courses/terraform-infrastructure-setup/scenarios/level-3/state-surgery.yaml +57 -0
  104. package/courses/terraform-infrastructure-setup/scenarios/level-3/terraform-cloud-enterprise.yaml +59 -0
  105. package/courses/terraform-infrastructure-setup/scenarios/level-3/terraform-debugging.yaml +51 -0
  106. package/courses/terraform-infrastructure-setup/scenarios/level-4/blast-radius-management.yaml +51 -0
  107. package/courses/terraform-infrastructure-setup/scenarios/level-4/cicd-pipeline-design.yaml +50 -0
  108. package/courses/terraform-infrastructure-setup/scenarios/level-4/compliance-as-code.yaml +46 -0
  109. package/courses/terraform-infrastructure-setup/scenarios/level-4/cost-estimation-governance.yaml +42 -0
  110. package/courses/terraform-infrastructure-setup/scenarios/level-4/expert-debugging-shift.yaml +51 -0
  111. package/courses/terraform-infrastructure-setup/scenarios/level-4/iac-organization-strategy.yaml +45 -0
  112. package/courses/terraform-infrastructure-setup/scenarios/level-4/incident-response-iac.yaml +47 -0
  113. package/courses/terraform-infrastructure-setup/scenarios/level-4/infrastructure-testing.yaml +41 -0
  114. package/courses/terraform-infrastructure-setup/scenarios/level-4/module-registry-design.yaml +45 -0
  115. package/courses/terraform-infrastructure-setup/scenarios/level-4/multi-account-strategy.yaml +57 -0
  116. package/courses/terraform-infrastructure-setup/scenarios/level-5/board-infrastructure-investment.yaml +53 -0
  117. package/courses/terraform-infrastructure-setup/scenarios/level-5/disaster-recovery-iac.yaml +47 -0
  118. package/courses/terraform-infrastructure-setup/scenarios/level-5/enterprise-iac-transformation.yaml +48 -0
  119. package/courses/terraform-infrastructure-setup/scenarios/level-5/iac-technology-evolution.yaml +49 -0
  120. package/courses/terraform-infrastructure-setup/scenarios/level-5/ma-infrastructure-consolidation.yaml +54 -0
  121. package/courses/terraform-infrastructure-setup/scenarios/level-5/master-debugging-shift.yaml +53 -0
  122. package/courses/terraform-infrastructure-setup/scenarios/level-5/multi-cloud-strategy.yaml +49 -0
  123. package/courses/terraform-infrastructure-setup/scenarios/level-5/platform-engineering.yaml +47 -0
  124. package/courses/terraform-infrastructure-setup/scenarios/level-5/regulatory-compliance-automation.yaml +47 -0
  125. package/courses/terraform-infrastructure-setup/scenarios/level-5/terraform-vs-alternatives.yaml +46 -0
  126. package/dist/cli/commands/generate.d.ts.map +1 -1
  127. package/dist/cli/commands/generate.js +2 -1
  128. package/dist/cli/commands/generate.js.map +1 -1
  129. package/dist/cli/commands/train.d.ts.map +1 -1
  130. package/dist/cli/commands/train.js +6 -3
  131. package/dist/cli/commands/train.js.map +1 -1
  132. package/dist/cli/index.js +9 -6
  133. package/dist/cli/index.js.map +1 -1
  134. package/dist/cli/run-demo.js +3 -2
  135. package/dist/cli/run-demo.js.map +1 -1
  136. package/dist/engine/model-utils.d.ts +6 -0
  137. package/dist/engine/model-utils.d.ts.map +1 -1
  138. package/dist/engine/model-utils.js +28 -1
  139. package/dist/engine/model-utils.js.map +1 -1
  140. package/dist/engine/training.d.ts.map +1 -1
  141. package/dist/engine/training.js +4 -3
  142. package/dist/engine/training.js.map +1 -1
  143. package/dist/generator/course-generator.d.ts.map +1 -1
  144. package/dist/generator/course-generator.js +4 -3
  145. package/dist/generator/course-generator.js.map +1 -1
  146. package/dist/mcp/server.d.ts.map +1 -1
  147. package/dist/mcp/server.js +7 -3
  148. package/dist/mcp/server.js.map +1 -1
  149. package/dist/mcp/session-manager.d.ts.map +1 -1
  150. package/dist/mcp/session-manager.js +3 -2
  151. package/dist/mcp/session-manager.js.map +1 -1
  152. package/package.json +3 -2
@@ -513,3 +513,23 @@ Tracks all auto-generated courses for dojo.md.
513
513
  - **Scenarios**: 50 (10 per level × 5 levels)
514
514
  - **Type**: output
515
515
  - **Sources**: AWS Lambda documentation (lifecycle, invocation types, event sources, VPC, layers, extensions), AWS SAM/CDK documentation, API Gateway docs, CloudWatch/X-Ray monitoring, Step Functions workflow docs, DynamoDB Streams, SQS/SNS/EventBridge, Kinesis Data Streams, Lambda Powertools (Python/TypeScript/Java), AWS Well-Architected Serverless Lens, DORA metrics research
516
+
517
+ ---
518
+
519
+ ## Course 53: Terraform Infrastructure Setup
520
+ - **Generated**: 2026-02-27
521
+ - **Category**: Development & DevOps
522
+ - **Directory**: `courses/terraform-infrastructure-setup/`
523
+ - **Topics researched**: terraform init errors (backend initialization, provider installation, module download, registry connectivity, proxy/air-gapped), HCL syntax errors (block structure, attribute assignment, string interpolation, terraform fmt canonical format), provider configuration (AWS credential chain, provider aliases, multi-region, assume_role, OIDC), variables and outputs (types, validation blocks, value precedence, tfvars, TF_VAR_, sensitive), resource creation failures (dependency graph, partial apply, duplicate resources, permissions, quotas), state file basics (JSON mapping, drift detection, refresh, locking, local vs remote), plan output reading (symbols +/-/~/−/+, forces replacement, known after apply, detailed-exitcode), resource references (implicit/explicit dependencies, circular dependencies, data sources, splat expressions), terraform fmt and validate (formatting enforcement, CI/CD pre-commit hooks, TFLint), module structure (inputs/outputs contracts, local/registry/git sources, composition patterns), remote state backend (S3+DynamoDB setup, state migration, locking mechanics, terraform_remote_state), count vs for_each (index shift problems, stable keys, moved blocks migration), lifecycle rules (create_before_destroy, prevent_destroy, ignore_changes, replace_triggered_by), terraform import (import workflow, import blocks 1.5+, generate-config-out, terraformer), workspace management (workspace isolation, terraform.workspace variable, directory-based alternative), provisioner pitfalls (local-exec/remote-exec, taint on failure, user_data/Packer/Ansible alternatives), locals and expressions (common tags, for expressions, conditionals, built-in functions), dependency management (DAG, implicit/explicit, depends_on, terraform graph), state surgery (state mv, state rm, pull/push, moved blocks, module extraction), multi-provider config (aliases, assume_role, cross-account, provider passing to modules), dynamic blocks (for_each iteration, nested dynamics, iterator naming, over-engineering warnings), Terraform Cloud/Enterprise (remote execution, VCS integration, Sentinel policies, migration), drift detection (refresh-only, selective handling, continuous detection, prevention), conditional resources (count ternary, for_each conditional, safe referencing, feature flags), TF_LOG debugging (TRACE/DEBUG/INFO/WARN/ERROR, provider-specific, crash logs), large-scale refactoring (monolith to modules, state splitting, moved blocks, phased migration), API rate limiting (throttling, parallelism reduction, state splitting, quota increases), IaC organization strategy (mono-repo vs multi-repo, state architecture, team ownership, governance), CI/CD pipeline design (GitOps, Atlantis, GitHub Actions, Terraform Cloud, Spacelift), infrastructure testing (terraform test 1.6+, Terratest, checkov, tfsec, testing pyramid), multi-account strategy (AWS Organizations, account vending, SCPs, cross-account IAM), cost estimation governance (Infracost, policy-based controls, environment sizing, tagging), compliance as code (SOC2/HIPAA/PCI-DSS enforcement, Sentinel, checkov, AWS Config), module registry design (private registry, versioning, testing requirements, consumption governance), blast radius management (state boundaries, change classification, approval workflows, recovery), incident response IaC (rollback strategies, emergency procedures, post-incident reconciliation), enterprise IaC transformation (phased adoption, champion teams, enablement, governance balance), Terraform vs alternatives (Pulumi/CDK/CloudFormation/OpenTofu evaluation, migration paths), platform engineering (self-service, golden paths, Backstage, developer experience), board infrastructure investment (ROI analysis, competitive positioning, executive narrative), multi-cloud strategy (per-cloud modules, state per cloud, team upskilling, realism check), M&A infrastructure consolidation (phased migration, account structure, state migration, team onboarding), regulatory compliance automation (framework mapping, policy enforcement, evidence generation, audit prep), disaster recovery IaC (multi-region, state backup, DR testing, cost optimization), IaC technology evolution (AI-assisted, ephemeral environments, platform engineering, hype vs reality), fractional CTO advisory (phased roadmap, hiring, compliance sprint, Series C readiness)
524
+ - **Scenarios**: 50 (10 per level × 5 levels)
525
+ - **Type**: output
526
+ - **Sources**: HashiCorp Terraform documentation (CLI commands, language, backends, providers), Terraform Cloud/Enterprise docs, Spacelift blog (best practices, comparisons), AWS provider documentation, Sentinel policy language, Terratest documentation, checkov/tfsec scanning tools, Infracost documentation, OpenTofu project, Atlantis documentation, platform engineering resources, IaC maturity models
527
+
528
+ ### Course 54: API Documentation Writing
529
+ - **Generated**: 2026-02-27
530
+ - **Category**: Writing & Communication
531
+ - **Directory**: `courses/api-documentation-writing/`
532
+ - **Topics researched**: endpoint descriptions (method, path, summary, detailed descriptions), HTTP status codes (2xx success, 4xx client errors, 5xx server errors, error bodies), request parameters (path vs query vs header, required/optional, types), request/response examples (realistic values, multiple scenarios, edge cases), authentication documentation (API keys, Bearer tokens, OAuth quickstart), getting started guides (TTFC optimization, 5-minute quickstart, sandbox), data types and formats (ISO 8601 dates, E.164 phone, cents for currency, pagination cursors), pagination documentation (offset vs cursor, response structure, navigation), error documentation (consistent schemas, error codes, troubleshooting), OpenAPI 3.1 specification (paths, components, $ref, info, servers), schema definitions (allOf composition, oneOf discriminator, nested objects, nullable), OAuth 2.0 documentation (authorization code, client credentials, PKCE, token refresh), versioning and changelog (URL vs header versioning, deprecation timeline, migration guides), error patterns (unified format, error code catalog, error type URLs), rate limiting docs (tiers, headers, exponential backoff, jitter, best practices), request body schemas (POST/PUT/PATCH differences, null handling, nested object behavior), Swagger UI vs Redoc (setup, comparison, customization, rendering tips), validation documentation (regex patterns, conditional rules, client-side guidance), API style guides (naming conventions, response envelopes, consistency standards), webhook documentation (event catalog, HMAC-SHA256 verification, retry behavior, idempotency), SDK documentation (language-idiomatic setup, error handling, pagination helpers, testing), multi-language code samples (consistency, language idioms, testing strategy), content architecture (Diátaxis framework, tutorials vs guides vs reference vs concepts), migration guides (change catalog, step-by-step migration, compatibility helpers), deprecation communication (lifecycle phases, HTTP headers, notification channels), interactive API explorer (sandbox, parameter forms, code generation), WebSocket and SSE documentation (connection lifecycle, message formats, reconnection), docs-as-code workflow (Git-based docs, CI/CD pipeline, automated quality checks), API governance standards (documentation tiers, quality scoring, adoption strategy), developer portal design (self-service onboarding, API key management, usage dashboard), documentation testing (contract tests, example validation, link checking, monitoring), documentation metrics (TTFC, task completion, support deflection, ROI calculation), multi-audience documentation (progressive disclosure, persona routing, content layering), API product strategy (self-service revenue, partner acceleration, enterprise packages), documentation localization (translation scope, workflow, synchronization, phased rollout), API changelog management (change categorization, notification system, automation), documentation program strategy (3-year vision, team growth, technology investments), DX as competitive advantage (competitive analysis, DX roadmap, community moat), API-first documentation (design-first process, internal-to-external transformation, change management), board API strategy (executive summary, financial model, risk of inaction), API marketplace documentation (provider standards, discovery features, quality scoring), ecosystem documentation (cross-product guides, extension builder docs, coordination model), documentation team structure (hybrid org model, role definitions, career ladder, retention), AI-powered documentation (honest AI assessment, enhancement strategy, risks and roadmap), industry documentation patterns (Stripe/Twilio/GitHub analysis, emerging trends, evaluation framework)
533
+ - **Scenarios**: 50 (10 per level × 5 levels)
534
+ - **Type**: output
535
+ - **Sources**: OpenAPI Initiative (OAS 3.1 specification), Swagger UI documentation, Redoc documentation, Stripe API documentation (industry benchmark), Twilio documentation patterns, GitHub API documentation, Diátaxis documentation framework, RFC 8594 (Deprecation header), RFC 7396 (JSON Merge Patch), Spectral linting documentation, Dredd contract testing, Schemathesis API testing, Docusaurus/Nextra static site generators, developer experience research and best practices
@@ -0,0 +1,12 @@
1
+ id: api-documentation-writing
2
+ name: "API Documentation Writing"
3
+ description: >
4
+ Master API documentation writing from basic endpoint descriptions
5
+ to enterprise developer portal strategy. Progress through OpenAPI
6
+ specifications, schema definitions, authentication documentation,
7
+ developer experience design, and organizational documentation
8
+ programs — the complete journey from writing your first endpoint
9
+ doc to leading API documentation strategy.
10
+ levels: 5
11
+ scenarios_per_level: 10
12
+ tags: [writing, API, documentation, OpenAPI, developer-experience, technical-writing]
@@ -0,0 +1,46 @@
1
+ meta:
2
+ id: authentication-basics
3
+ level: 1
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document authentication — write clear instructions for API key, Bearer token, and basic authentication with examples"
7
+ tags: [API, documentation, authentication, API-key, Bearer, authorization, beginner]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ New developers consistently fail their first API call because they
13
+ can't figure out authentication. Your current docs say:
14
+
15
+ "Authentication: This API uses Bearer tokens. Include your token
16
+ in the header."
17
+
18
+ Developer complaints:
19
+ - "Where do I get a token?"
20
+ - "What header exactly? What's the format?"
21
+ - "My token expired — how do I refresh it?"
22
+ - "Can I use an API key instead for server-to-server?"
23
+ - "I keep getting 401 — what's wrong?"
24
+
25
+ The API supports:
26
+ 1. Bearer tokens (OAuth 2.0, expires in 1 hour, refresh token flow)
27
+ 2. API keys (for server-to-server, passed in X-API-Key header)
28
+
29
+ Task: Write authentication documentation that enables developers
30
+ to successfully authenticate on their first try. Include: how to
31
+ get credentials, how to include them in requests, token lifecycle,
32
+ common authentication errors, and code examples.
33
+
34
+ assertions:
35
+ - type: llm_judge
36
+ criteria: "Authentication methods are clearly documented — Bearer token: (1) how to get: POST /oauth/token with client_id, client_secret, grant_type. (2) how to use: Authorization: Bearer <token> header. (3) lifecycle: expires in 3600 seconds, use refresh_token to get new access_token. (4) example curl showing full auth flow. API key: (1) how to get: generate in dashboard Settings → API Keys. (2) how to use: X-API-Key: <key> header. (3) lifecycle: doesn't expire, can be revoked. (4) when to use: server-to-server communication, CI/CD, scripts"
37
+ weight: 0.35
38
+ description: "Auth methods"
39
+ - type: llm_judge
40
+ criteria: "Examples enable first-try success — step-by-step quickstart: (1) get credentials (curl to /oauth/token or dashboard screenshot). (2) make authenticated request (curl with Authorization header). (3) handle token expiry (curl to refresh). Full curl examples with actual headers. Code examples in at least one language (e.g., JavaScript fetch with headers). Common mistakes: forgetting 'Bearer ' prefix (just the token without 'Bearer'), using expired token, sending API key in wrong header, including token in query string (insecure)"
41
+ weight: 0.35
42
+ description: "First-try success"
43
+ - type: llm_judge
44
+ criteria: "Troubleshooting is included — 401 Unauthorized: token missing, expired, or malformed. Check: is 'Bearer ' prefix included? Is the token current? Is it the right token type? 403 Forbidden: token is valid but lacks permissions. Check: does the token have the required scope? Common auth errors table: symptom → cause → fix. Security notes: never include tokens in URLs (use headers), never log tokens, rotate API keys periodically, use short-lived tokens for client applications"
45
+ weight: 0.30
46
+ description: "Troubleshooting"
@@ -0,0 +1,45 @@
1
+ meta:
2
+ id: data-types-formats
3
+ level: 1
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document data types and formats — describe JSON types, date formats, currency handling, enums, and nested objects clearly"
7
+ tags: [API, documentation, data-types, JSON, formats, schemas, beginner]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Developers keep sending incorrectly formatted data to your API.
13
+ Common errors:
14
+ - Dates sent as "01/15/2024" instead of ISO 8601 "2024-01-15T00:00:00Z"
15
+ - Prices sent as "$19.99" instead of integer cents (1999)
16
+ - Booleans sent as "true" (string) instead of true (boolean)
17
+ - Phone numbers without country code
18
+ - UUIDs in wrong format
19
+
20
+ Your API accepts these field types:
21
+ - Strings: name, email, phone, URL, UUID
22
+ - Numbers: integer (count, cents), float (latitude, longitude)
23
+ - Booleans: is_active, is_verified
24
+ - Dates: created_at, due_date, expires_at
25
+ - Enums: status, role, priority
26
+ - Arrays: tags, permissions
27
+ - Nested objects: address, metadata
28
+
29
+ Task: Write data type documentation that prevents formatting errors.
30
+ For each type: specify the format, show valid/invalid examples,
31
+ and explain the rationale (e.g., why prices are in cents).
32
+
33
+ assertions:
34
+ - type: llm_judge
35
+ criteria: "Each data type is precisely documented — strings: max length, format constraints (email: RFC 5322, phone: E.164 format +1234567890, UUID: v4 format). Numbers: integer for counts and money (in cents to avoid floating point issues), float for coordinates. Dates: ISO 8601 format (2024-01-15T10:30:00Z), always UTC, timezone specified. Booleans: JSON true/false (not strings). Enums: list all valid values with descriptions. Arrays: element type specified. Nested objects: full schema documented. Each type shows valid AND invalid examples"
36
+ weight: 0.35
37
+ description: "Precise types"
38
+ - type: llm_judge
39
+ criteria: "Format rationale is explained — money in cents: avoids floating point precision issues (19.99 * 100 can give 1998.9999... in floating point). Dates in ISO 8601 UTC: unambiguous, sortable, timezone-safe. Phone in E.164: international standard, parseable. UUID v4: globally unique, no sequential information leaked. These explanations help developers understand WHY and reduce questions. Show conversion examples: 'To convert $19.99 to API format: 19.99 * 100 = 1999'"
40
+ weight: 0.35
41
+ description: "Format rationale"
42
+ - type: llm_judge
43
+ criteria: "Null and optional handling are addressed — document: which fields can be null, what null means vs omitted (null = explicitly clear the value, omitted = don't change), empty string vs null (are they treated differently?). Required vs optional fields clearly marked. Default values documented: 'if is_active is omitted, defaults to true'. Array fields: can they be empty? What's the max length? Metadata object: is it schemaless? What are the limits (max keys, max value size)?"
44
+ weight: 0.30
45
+ description: "Null and optional"
@@ -0,0 +1,45 @@
1
+ meta:
2
+ id: endpoint-description
3
+ level: 1
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Write endpoint descriptions — document HTTP method, path, purpose, and usage for a REST API endpoint"
7
+ tags: [API, documentation, endpoints, REST, HTTP-methods, beginner]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ You're documenting a REST API for a task management application.
13
+ A developer gives you this information about an endpoint:
14
+
15
+ - It creates a new task
16
+ - URL: /api/v1/tasks
17
+ - Method: POST
18
+ - Needs authentication
19
+ - Request body: title (required), description (optional),
20
+ due_date (optional, ISO 8601), priority (optional: low/medium/high)
21
+ - Returns the created task with an ID
22
+ - Returns 201 on success
23
+
24
+ The developer's current "documentation" is just a Slack message:
25
+ "POST /tasks to make a new task, send JSON with title etc"
26
+
27
+ Task: Write proper endpoint documentation for this API endpoint.
28
+ Include: HTTP method and path, description, request body with field
29
+ descriptions and types, example request/response, status codes,
30
+ and authentication requirement. Also explain what makes good
31
+ endpoint documentation vs bad.
32
+
33
+ assertions:
34
+ - type: llm_judge
35
+ criteria: "Endpoint documentation is complete — includes: (1) HTTP method and path: POST /api/v1/tasks, (2) clear one-line description of what the endpoint does ('Creates a new task in the authenticated user's task list'), (3) authentication: requires Bearer token, (4) request body: JSON object with field names, types, required/optional status, descriptions, and constraints (priority enum values). Example request with headers (Content-Type, Authorization) and JSON body. Example response (201 Created) with full task object including generated id, created_at timestamp"
36
+ weight: 0.35
37
+ description: "Complete documentation"
38
+ - type: llm_judge
39
+ criteria: "Examples are realistic and helpful — request example shows actual JSON with realistic values (not 'string' or 'example'). Response example shows the full object as the API actually returns it (including server-generated fields like id, created_at, updated_at, status). Headers included in examples. Multiple status codes documented: 201 (success), 400 (validation error with example error response), 401 (unauthorized), 422 (unprocessable entity). Each status code has a description of when it occurs"
40
+ weight: 0.35
41
+ description: "Realistic examples"
42
+ - type: llm_judge
43
+ criteria: "Good vs bad documentation is explained — bad: 'POST /tasks to make a new task' (no types, no examples, no error codes, ambiguous). Good: structured, includes every field with type and description, shows real examples, documents errors, explains authentication. Key principles: developers should be able to call the endpoint from documentation alone without guessing. Include: what parameters are required, what format dates should be in, what values enums accept, what the response looks like on success AND failure"
44
+ weight: 0.30
45
+ description: "Good vs bad"
@@ -0,0 +1,45 @@
1
+ meta:
2
+ id: error-documentation
3
+ level: 1
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document API errors — write helpful error descriptions, troubleshooting guides, and consistent error response schemas"
7
+ tags: [API, documentation, errors, troubleshooting, error-codes, beginner]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API returns errors but developers can't figure out what went
13
+ wrong. Current error response:
14
+
15
+ ```json
16
+ { "error": "Something went wrong" }
17
+ ```
18
+
19
+ Developer feedback:
20
+ - "The error message doesn't tell me what I did wrong"
21
+ - "I got an error code 'E1042' — what does that mean?"
22
+ - "Different endpoints return errors in different formats"
23
+ - "Is there a list of all possible errors?"
24
+
25
+ You need to design and document a consistent error response format
26
+ and create an error reference guide.
27
+
28
+ Task: Design a standard error response format, document common
29
+ errors with troubleshooting steps, and create an error code
30
+ reference table. Show both the error schema documentation and
31
+ endpoint-specific error documentation.
32
+
33
+ assertions:
34
+ - type: llm_judge
35
+ criteria: "Error response schema is consistent and informative — standard format: { 'error': { 'type': 'validation_error', 'code': 'INVALID_EMAIL', 'message': 'The email address is not valid', 'details': [{ 'field': 'email', 'message': 'Must be a valid email address', 'value': 'not-an-email' }], 'request_id': 'req_abc123', 'documentation_url': 'https://docs.api.com/errors/INVALID_EMAIL' } }. Each field explained: type (category), code (machine-readable), message (human-readable), details (field-level), request_id (for support), documentation_url (link to fix)"
36
+ weight: 0.35
37
+ description: "Error schema"
38
+ - type: llm_judge
39
+ criteria: "Error reference table is complete — categorized error codes: authentication errors (INVALID_TOKEN, TOKEN_EXPIRED, MISSING_AUTH), validation errors (INVALID_EMAIL, REQUIRED_FIELD, INVALID_FORMAT), resource errors (NOT_FOUND, ALREADY_EXISTS, CONFLICT), rate limiting (RATE_LIMITED), server errors (INTERNAL_ERROR, SERVICE_UNAVAILABLE). Each error: code, HTTP status, description, common causes, fix. Table format for quick scanning. Error codes are stable (won't change between API versions)"
40
+ weight: 0.35
41
+ description: "Error reference"
42
+ - type: llm_judge
43
+ criteria: "Troubleshooting guidance is developer-friendly — for each common error: (1) what you sent (example bad request), (2) what you got back (error response), (3) what to fix (specific action). Example: 'INVALID_EMAIL — You sent email: \"john@\" — email must include domain: email: \"john@example.com\"'. Per-endpoint error docs: list which errors each endpoint can return. Encourage developers to log request_id for support escalation. SDK error handling example: try/catch with error type checking"
44
+ weight: 0.30
45
+ description: "Troubleshooting"
@@ -0,0 +1,47 @@
1
+ meta:
2
+ id: first-documentation-shift
3
+ level: 1
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Combined beginner shift — document a complete API endpoint set for a simple CRUD resource from scratch"
7
+ tags: [API, documentation, combined, shift-simulation, CRUD, beginner]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ You're the new technical writer. Day one task: document the /users
13
+ CRUD API endpoints. The developer hands you this list:
14
+
15
+ GET /api/v1/users — list all users (paginated)
16
+ POST /api/v1/users — create a user
17
+ GET /api/v1/users/{id} — get one user
18
+ PUT /api/v1/users/{id} — update a user
19
+ DELETE /api/v1/users/{id} — delete a user
20
+
21
+ User object: id (UUID), name (string), email (string, unique),
22
+ role (admin/member), is_active (boolean), created_at, updated_at
23
+
24
+ Auth: Bearer token required for all endpoints.
25
+ Admin-only: POST, PUT, DELETE.
26
+
27
+ Constraints: name 1-100 chars, email must be valid, role enum.
28
+
29
+ You have no existing documentation to work from.
30
+
31
+ Task: Write complete API documentation for all 5 CRUD endpoints.
32
+ Include: endpoint descriptions, parameters, request/response
33
+ examples, status codes, authentication, and permissions.
34
+
35
+ assertions:
36
+ - type: llm_judge
37
+ criteria: "All 5 endpoints are fully documented — each endpoint has: method + path, description, authentication (Bearer token), permissions (who can call it), parameters (path, query, body as applicable), request example (for POST/PUT), response example with realistic data, status codes (success + relevant errors). GET /users includes pagination parameters. POST includes request body schema. GET /{id} shows single resource response. PUT shows partial update behavior. DELETE shows 204 No Content response"
38
+ weight: 0.35
39
+ description: "Complete coverage"
40
+ - type: llm_judge
41
+ criteria: "Documentation is consistent across endpoints — same user object shape in all responses. Same error format for all endpoints. Same authentication pattern documented once and referenced. Consistent naming (id vs user_id — pick one). Examples use the same user across endpoints (create Jane Cooper → get Jane Cooper → update Jane Cooper → delete). Status codes consistent: 200 for GET/PUT, 201 for POST, 204 for DELETE, 404 for non-existent resources"
42
+ weight: 0.35
43
+ description: "Consistency"
44
+ - type: llm_judge
45
+ criteria: "Documentation is usable by a new developer — a developer who has never used the API can: (1) authenticate (auth docs included), (2) create a user (POST with example body), (3) list users with pagination, (4) get a specific user by ID, (5) update user fields, (6) delete a user. All from the documentation alone. Includes curl examples for each endpoint. Notes: DELETE returns 204 (no body), PUT with unchanged fields is idempotent, listing returns paginated results"
46
+ weight: 0.30
47
+ description: "Usability"
@@ -0,0 +1,42 @@
1
+ meta:
2
+ id: getting-started-guide
3
+ level: 1
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Write a getting started guide — create a quickstart that takes developers from zero to first successful API call in minutes"
7
+ tags: [API, documentation, getting-started, quickstart, onboarding, beginner]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API has comprehensive reference documentation but developers
13
+ still struggle to get started. Analytics show:
14
+ - Average time to first API call: 45 minutes
15
+ - 60% of developers never make a second call
16
+ - Top search query: "how to get started"
17
+ - Support tickets: "I don't know where to begin"
18
+
19
+ The API is a payment processing API (like Stripe). Key flows:
20
+ 1. Create account → get API key
21
+ 2. Create a customer
22
+ 3. Create a payment method
23
+ 4. Charge the customer
24
+
25
+ Task: Write a getting started guide that takes a developer from
26
+ zero to their first successful payment in under 10 minutes.
27
+ Include: prerequisites, step-by-step instructions with curl
28
+ examples, expected output at each step, and next steps.
29
+
30
+ assertions:
31
+ - type: llm_judge
32
+ criteria: "Guide has clear structure and flow — starts with: what you'll build (outcome), prerequisites (account, API key, curl/Postman), estimated time (10 minutes). Steps numbered and sequential: (1) get your API key, (2) make your first call (simple GET to verify auth works), (3) create a customer, (4) add a payment method, (5) charge the customer. Each step has: what you'll do, curl command, expected response, what to note from the response (e.g., 'save the customer_id for the next step')"
33
+ weight: 0.35
34
+ description: "Clear structure"
35
+ - type: llm_judge
36
+ criteria: "Examples are copy-paste ready — curl commands that work out of the box (just replace API key). Use test/sandbox mode API key (no real charges). Full command with headers, body, and expected output. Each step's output feeds into the next step (customer_id from step 3 used in step 4). Environment setup: 'export API_KEY=your_key_here' at the start, then reference $API_KEY in all commands. Highlight values that developers need to copy from one step to the next"
37
+ weight: 0.35
38
+ description: "Copy-paste ready"
39
+ - type: llm_judge
40
+ criteria: "Onboarding experience is optimized — progressive complexity: start with simplest possible call, add complexity gradually. Success validation at each step: 'You should see a response with status 200 and...' Troubleshooting inline: 'If you see 401, check that your API key is correct.' End with: what you built, next steps (link to specific guides for production setup, webhooks, error handling). Call to action: 'Ready for production? Read our Production Checklist.' Don't overwhelm: guide covers one happy path, not every option"
41
+ weight: 0.30
42
+ description: "Optimized onboarding"
@@ -0,0 +1,51 @@
1
+ meta:
2
+ id: pagination-docs
3
+ level: 1
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document pagination — write clear pagination documentation for offset, cursor, and keyset pagination patterns"
7
+ tags: [API, documentation, pagination, offset, cursor, collections, beginner]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API returns lists of resources (users, orders, transactions).
13
+ Developers ask:
14
+ - "How do I get the next page?"
15
+ - "How do I know if there are more results?"
16
+ - "The total count changes between pages — is that a bug?"
17
+ - "Cursor pagination? What's a cursor?"
18
+
19
+ Your API supports two pagination styles:
20
+ 1. Offset pagination (legacy): ?page=2&per_page=20
21
+ 2. Cursor pagination (recommended): ?after=cursor_abc123&limit=20
22
+
23
+ Response format (cursor):
24
+ ```json
25
+ {
26
+ "data": [...],
27
+ "pagination": {
28
+ "has_more": true,
29
+ "next_cursor": "cursor_def456",
30
+ "previous_cursor": "cursor_abc123"
31
+ }
32
+ }
33
+ ```
34
+
35
+ Task: Document both pagination styles, explain when to use each,
36
+ show step-by-step examples of paginating through results, and
37
+ explain the pagination response fields.
38
+
39
+ assertions:
40
+ - type: llm_judge
41
+ criteria: "Both pagination styles are documented — offset: ?page=1&per_page=20 (page 1 of 20 results). Response includes total_count, total_pages, current_page. Pros: jump to any page. Cons: inconsistent with concurrent writes (items shift between pages). Cursor: ?after=<cursor>&limit=20. Response includes has_more, next_cursor. Pros: consistent results even with concurrent writes, better performance on large datasets. Cons: can't jump to page N. Recommendation: use cursor for real-time data (transactions, events), offset for stable data (reports)"
42
+ weight: 0.35
43
+ description: "Both styles"
44
+ - type: llm_judge
45
+ criteria: "Step-by-step pagination examples are shown — cursor example: (1) first page: GET /api/v1/orders?limit=20 → get data + next_cursor. (2) next page: GET /api/v1/orders?after=cursor_abc&limit=20 → get more data + next_cursor. (3) last page: has_more = false, no next_cursor. Complete curl commands for each step. Show how to implement a loop: 'keep fetching while has_more is true'. Offset example: page=1, page=2, etc. Show total_pages for loop termination"
46
+ weight: 0.35
47
+ description: "Step-by-step"
48
+ - type: llm_judge
49
+ criteria: "Edge cases and best practices are covered — empty results: data is empty array, has_more is false. Rate limiting: respect rate limits when paginating (don't blast all pages at once). Maximum limit value documented (e.g., limit max 100). Default limit documented (e.g., 20). Invalid cursor: returns 400 with clear error message. Sorting: document whether sort order affects pagination. Filter + paginate: show example combining filters with pagination. Total count: may be expensive to compute on cursor pagination (document whether it's available)"
50
+ weight: 0.30
51
+ description: "Edge cases"
@@ -0,0 +1,46 @@
1
+ meta:
2
+ id: request-parameters
3
+ level: 1
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document request parameters — differentiate and document path parameters, query parameters, headers, and request body fields"
7
+ tags: [API, documentation, parameters, query, path, headers, beginner]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ A developer is confused by your API because parameter documentation
13
+ is unclear. They're trying to call this endpoint:
14
+
15
+ GET /api/v1/projects/{project_id}/tasks?status=active&sort=due_date&limit=20
16
+
17
+ Headers:
18
+ Authorization: Bearer <token>
19
+ Accept: application/json
20
+ X-Request-ID: <uuid>
21
+
22
+ Their questions:
23
+ - "Do I put project_id in the URL or as a query parameter?"
24
+ - "Is 'status' a path param or query param?"
25
+ - "What values can 'sort' accept?"
26
+ - "Is limit required? What's the default?"
27
+ - "What headers do I need?"
28
+
29
+ Task: Write clear parameter documentation that distinguishes between
30
+ path parameters, query parameters, and headers. Include: parameter
31
+ name, location (path/query/header), type, required/optional, default
32
+ value, description, valid values, and examples.
33
+
34
+ assertions:
35
+ - type: llm_judge
36
+ criteria: "Parameter types are clearly distinguished — path parameters: project_id (in URL path, required, string/UUID, identifies the project). Query parameters: status (optional, string, enum: active/completed/archived, default: all), sort (optional, string, enum: due_date/created_at/priority, default: created_at), limit (optional, integer, range: 1-100, default: 20), offset or page for pagination. Headers: Authorization (required, Bearer token), Accept (optional, default: application/json), X-Request-ID (optional, UUID for request tracing). Each parameter location is explicitly labeled"
37
+ weight: 0.35
38
+ description: "Parameter types"
39
+ - type: llm_judge
40
+ criteria: "Documentation format is scannable — table or structured list format with columns: name, location, type, required, default, description. Each parameter has constraints documented (enum values, min/max, format). Example full URL shown: GET /api/v1/projects/550e8400-e29b-41d4-a716-446655440000/tasks?status=active&sort=due_date&limit=20. Curl example with all parameters including headers. Response shows how parameters affect the result (filtered by status, sorted by due_date, limited to 20)"
41
+ weight: 0.35
42
+ description: "Scannable format"
43
+ - type: llm_judge
44
+ criteria: "Common parameter patterns are explained — path parameters: identify specific resources (always required, part of the URL). Query parameters: filter, sort, paginate collections (usually optional with defaults). Headers: authentication, content negotiation, request tracking. Body parameters: create/update data (POST, PUT, PATCH only). Never mix: don't send the same data as both query parameter and body field. Document default behavior when optional params are omitted. Document parameter encoding (URL encoding for special characters in query params)"
45
+ weight: 0.30
46
+ description: "Parameter patterns"
@@ -0,0 +1,48 @@
1
+ meta:
2
+ id: request-response-examples
3
+ level: 1
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Write request/response examples — create realistic JSON examples with proper formatting, annotations, and edge cases"
7
+ tags: [API, documentation, examples, JSON, request, response, beginner]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API documentation has examples like this:
13
+
14
+ ```
15
+ Request:
16
+ { "name": "string", "email": "string", "age": 0 }
17
+
18
+ Response:
19
+ { "id": "string", "name": "string", "email": "string" }
20
+ ```
21
+
22
+ Developers complain: "These examples are useless. I don't know what
23
+ format the email should be, what a realistic age looks like, or what
24
+ the actual ID format is."
25
+
26
+ The endpoint is: POST /api/v1/users (create a new user)
27
+ Fields: name (string, 1-100 chars), email (string, valid email),
28
+ age (integer, 13-120), role (enum: admin/member/viewer),
29
+ avatar_url (string, optional, URL), metadata (object, optional)
30
+
31
+ Task: Rewrite the examples with realistic values, proper formatting,
32
+ multiple scenarios (success, validation error, conflict), and
33
+ annotations explaining notable fields. Explain principles of
34
+ writing good API examples.
35
+
36
+ assertions:
37
+ - type: llm_judge
38
+ criteria: "Examples use realistic values — instead of 'string' and 0, use actual values: name = 'Jane Cooper', email = 'jane@example.com', age = 28, role = 'member'. ID format shown realistically (UUID or sequential). Timestamps in ISO 8601. URLs as proper URLs. Response includes server-generated fields (id, created_at, updated_at). Multiple examples: (1) minimal request (only required fields), (2) full request (all fields including optional), (3) error response (validation failure with specific field errors)"
39
+ weight: 0.35
40
+ description: "Realistic values"
41
+ - type: llm_judge
42
+ criteria: "Multiple scenarios are documented — success case: 201 Created with full response. Validation error: 422 with details array showing which fields failed (e.g., 'age must be at least 13'). Conflict: 409 when email already exists. Each scenario shows both the request that triggers it and the exact response. Annotations: comments or callouts explaining non-obvious fields (e.g., 'id is a UUID v4 generated by the server', 'created_at is in UTC', 'metadata is a free-form JSON object')"
43
+ weight: 0.35
44
+ description: "Multiple scenarios"
45
+ - type: llm_judge
46
+ criteria: "Example writing principles are explained — (1) use realistic data, not placeholders (developers copy-paste examples). (2) show the complete request including headers (Content-Type, Authorization). (3) show complete response, not truncated. (4) include curl command for easy testing. (5) show both happy path and error paths. (6) annotate non-obvious fields (format, constraints, behavior). (7) keep examples consistent (same user across related endpoints). (8) don't use 'foo', 'bar', 'test' — use domain-appropriate data"
47
+ weight: 0.30
48
+ description: "Writing principles"
@@ -0,0 +1,45 @@
1
+ meta:
2
+ id: status-codes
3
+ level: 1
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document HTTP status codes — write clear descriptions for success, client error, and server error responses with example bodies"
7
+ tags: [API, documentation, status-codes, errors, HTTP, beginner]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API returns various status codes but the documentation just
13
+ lists "200 OK" and "400 Bad Request" with no details. Developers
14
+ keep asking support questions like:
15
+
16
+ - "What's the difference between 401 and 403?"
17
+ - "Why am I getting a 409? What does it mean?"
18
+ - "The API returned 422 — what field is wrong?"
19
+ - "I got a 429 — when can I retry?"
20
+ - "What does the error response body look like?"
21
+
22
+ The API uses these status codes:
23
+ 200 (OK), 201 (Created), 204 (No Content), 400 (Bad Request),
24
+ 401 (Unauthorized), 403 (Forbidden), 404 (Not Found),
25
+ 409 (Conflict), 422 (Unprocessable Entity), 429 (Too Many Requests),
26
+ 500 (Internal Server Error), 503 (Service Unavailable)
27
+
28
+ Task: Write comprehensive status code documentation for this API.
29
+ For each code: explain when it's returned, show an example response
30
+ body, and provide guidance on how developers should handle it.
31
+ Also document the standard error response format.
32
+
33
+ assertions:
34
+ - type: llm_judge
35
+ criteria: "Status codes are accurately documented — each code has: when it's returned (specific scenario), example response body, developer guidance. Key distinctions: 401 (authentication failed — invalid/missing token) vs 403 (authorized but not permitted — lacks required role/permission). 400 (malformed request, wrong types) vs 422 (valid JSON but business logic validation failed — e.g., invalid email format). 409 (resource conflict — e.g., duplicate email). 429 (rate limited — include Retry-After header guidance). 204 for successful DELETE (no body). 201 for successful POST (returns created resource)"
36
+ weight: 0.35
37
+ description: "Accurate codes"
38
+ - type: llm_judge
39
+ criteria: "Error response format is standardized — consistent error response structure documented: { 'error': { 'code': 'VALIDATION_ERROR', 'message': 'Human-readable description', 'details': [{ 'field': 'email', 'message': 'Invalid email format' }] } }. Machine-readable error codes (not just HTTP status) enable programmatic error handling. The details array helps developers identify which specific field(s) failed validation. Document that 5xx errors use the same format but with less detail (don't expose internals)"
40
+ weight: 0.35
41
+ description: "Error format"
42
+ - type: llm_judge
43
+ criteria: "Developer guidance is actionable — for each error: what to do. 401: check token is valid, not expired, included in Authorization header. 403: check user has required permissions/role. 404: verify resource ID exists. 409: handle conflict (e.g., show 'email already taken' to user). 422: parse details array to show field-level errors. 429: respect Retry-After header, implement exponential backoff. 500: retry with backoff, report to API provider if persistent. 503: service temporarily unavailable, retry after delay"
44
+ weight: 0.30
45
+ description: "Developer guidance"
@@ -0,0 +1,48 @@
1
+ meta:
2
+ id: error-patterns
3
+ level: 2
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Document error response patterns — design and document consistent error schemas with machine-readable codes, field-level details, and troubleshooting links"
7
+ tags: [API, documentation, errors, error-codes, patterns, consistency, intermediate]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ Your API has inconsistent error responses across endpoints:
13
+
14
+ Endpoint A returns:
15
+ ```json
16
+ { "error": "Invalid email" }
17
+ ```
18
+
19
+ Endpoint B returns:
20
+ ```json
21
+ { "code": 422, "errors": [{ "field": "email", "msg": "bad format" }] }
22
+ ```
23
+
24
+ Endpoint C returns:
25
+ ```json
26
+ { "status": "error", "reason": "email_invalid" }
27
+ ```
28
+
29
+ Developers can't write generic error handling because every endpoint
30
+ is different. You need to design and document a unified error pattern.
31
+
32
+ Task: Design a standard error response format and document it
33
+ comprehensively. Include: error schema, error code catalog,
34
+ per-endpoint error documentation, and SDK error handling examples.
35
+
36
+ assertions:
37
+ - type: llm_judge
38
+ criteria: "Standard error format is designed — consistent structure: { 'error': { 'type': 'validation_error' (category), 'code': 'INVALID_EMAIL' (machine-readable, stable), 'message': 'The email address format is invalid' (human-readable, may change), 'param': 'email' (which parameter caused the error), 'documentation_url': 'https://docs.api.com/errors/INVALID_EMAIL' (link to detailed docs) } }. For validation errors with multiple fields: 'details' array with per-field errors. HTTP status code in response, error code for programmatic handling"
39
+ weight: 0.35
40
+ description: "Error format"
41
+ - type: llm_judge
42
+ criteria: "Error code catalog is organized — categories: authentication_error (INVALID_TOKEN, TOKEN_EXPIRED, MISSING_AUTH), validation_error (REQUIRED_FIELD, INVALID_FORMAT, OUT_OF_RANGE), resource_error (NOT_FOUND, ALREADY_EXISTS, CONFLICT, GONE), rate_limit_error (RATE_EXCEEDED), payment_error (INSUFFICIENT_FUNDS, CARD_DECLINED, EXPIRED_CARD), server_error (INTERNAL_ERROR, SERVICE_UNAVAILABLE). Each code: stable identifier (won't change), HTTP status, description, common causes, how to handle. Error codes are part of the API contract — adding new ones is non-breaking, removing is breaking"
43
+ weight: 0.35
44
+ description: "Error catalog"
45
+ - type: llm_judge
46
+ criteria: "Per-endpoint and SDK documentation are practical — each endpoint documents which error codes it can return (not every endpoint returns every error). SDK error handling example: try { await api.createPayment(data) } catch (err) { if (err.code === 'CARD_DECLINED') { showMessage('Card declined, try another') } else if (err.type === 'validation_error') { showFieldErrors(err.details) } }. Type-based handling (validation_error → show form errors) vs code-based handling (CARD_DECLINED → specific action). Anti-pattern: don't match on message strings (they change)"
47
+ weight: 0.30
48
+ description: "SDK integration"
@@ -0,0 +1,48 @@
1
+ meta:
2
+ id: intermediate-documentation-shift
3
+ level: 2
4
+ course: api-documentation-writing
5
+ type: output
6
+ description: "Combined intermediate shift — write complete OpenAPI spec with authentication, error patterns, and versioning for a payment API"
7
+ tags: [API, documentation, combined, shift-simulation, OpenAPI, intermediate]
8
+
9
+ state: {}
10
+
11
+ trigger: |
12
+ You're writing the complete documentation for a new payments API
13
+ launching next month. You need to deliver:
14
+
15
+ 1. OpenAPI 3.1 spec for 4 endpoints:
16
+ - POST /payments (create payment)
17
+ - GET /payments/{id} (get payment)
18
+ - POST /payments/{id}/refund (refund payment)
19
+ - GET /payments (list payments, paginated)
20
+
21
+ 2. Authentication: OAuth 2.0 client credentials
22
+
23
+ 3. Error response format (consistent across all endpoints)
24
+
25
+ 4. Rate limits: 100 req/min (standard), 1000 req/min (pro)
26
+
27
+ Payment object: id, amount (cents), currency, status
28
+ (pending/processing/succeeded/failed/refunded), customer_id,
29
+ payment_method_id, created_at, metadata
30
+
31
+ This is v1 launching alongside legacy v0 (deprecated in 6 months).
32
+
33
+ Task: Write the complete API documentation package including
34
+ all of the above, ready for developer consumption.
35
+
36
+ assertions:
37
+ - type: llm_judge
38
+ criteria: "OpenAPI spec is complete for all 4 endpoints — POST /payments: request body schema with required fields, 201 response with payment object, errors (400, 401, 422). GET /payments/{id}: path parameter, 200 response, 404 error. POST /payments/{id}/refund: path parameter, optional amount in body (partial refund), errors (400, 404, 409 for already refunded). GET /payments: query parameters (status filter, customer_id filter, pagination with cursor), 200 response with paginated list. All endpoints: consistent error responses, auth required"
39
+ weight: 0.35
40
+ description: "Complete spec"
41
+ - type: llm_judge
42
+ criteria: "Auth, errors, and rate limits are documented — OAuth 2.0 client credentials: step-by-step to get token, example curl, token in Authorization header. Error format: consistent { type, code, message, param, documentation_url } across all endpoints. Error codes documented: INVALID_AMOUNT, PAYMENT_NOT_FOUND, ALREADY_REFUNDED, etc. Rate limits: headers documented, per-tier limits, 429 handling with Retry-After. All three cross-cutting concerns documented once and referenced, not repeated per endpoint"
43
+ weight: 0.35
44
+ description: "Cross-cutting docs"
45
+ - type: llm_judge
46
+ criteria: "Documentation is launch-ready — includes getting started section (5-minute quickstart), realistic examples for each endpoint, deprecation notice for v0 with timeline and migration guide, sandbox environment details (test API keys, test payment methods). A developer could integrate this API using only the documentation. Changelog entry for v1.0.0 launch. Status page link for uptime monitoring"
47
+ weight: 0.30
48
+ description: "Launch ready"