universal-dev-standards 5.0.0-rc.9 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/bin/uds.js +5 -3
  2. package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +178 -0
  3. package/bundled/ai/standards/agent-dispatch.ai.yaml +69 -0
  4. package/bundled/ai/standards/ai-command-behavior.ai.yaml +45 -0
  5. package/bundled/ai/standards/api-design-standards.ai.yaml +192 -0
  6. package/bundled/ai/standards/branch-completion.ai.yaml +82 -0
  7. package/bundled/ai/standards/change-batching-standards.ai.yaml +195 -0
  8. package/bundled/ai/standards/database-standards.ai.yaml +220 -0
  9. package/bundled/ai/standards/error-codes.ai.yaml +37 -2
  10. package/bundled/ai/standards/git-worktree.ai.yaml +77 -0
  11. package/bundled/ai/standards/logging.ai.yaml +21 -2
  12. package/bundled/ai/standards/model-selection.ai.yaml +81 -0
  13. package/bundled/ai/standards/pipeline-integration-standards.ai.yaml +184 -0
  14. package/bundled/ai/standards/systematic-debugging.ai.yaml +73 -0
  15. package/bundled/ai/standards/verification-evidence.ai.yaml +84 -0
  16. package/bundled/ai/standards/workflow-enforcement.ai.yaml +253 -0
  17. package/bundled/core/acceptance-criteria-traceability.md +293 -0
  18. package/bundled/core/agent-dispatch.md +149 -0
  19. package/bundled/core/ai-command-behavior.md +239 -0
  20. package/bundled/core/api-design-standards.md +938 -0
  21. package/bundled/core/branch-completion.md +158 -0
  22. package/bundled/core/change-batching-standards.md +257 -0
  23. package/bundled/core/checkin-standards.md +43 -6
  24. package/bundled/core/database-standards.md +828 -0
  25. package/bundled/core/error-code-standards.md +228 -2
  26. package/bundled/core/forward-derivation-standards.md +54 -2
  27. package/bundled/core/git-worktree.md +131 -0
  28. package/bundled/core/model-selection.md +153 -0
  29. package/bundled/core/pipeline-integration-standards.md +230 -0
  30. package/bundled/core/systematic-debugging.md +156 -0
  31. package/bundled/core/testing-standards.md +49 -39
  32. package/bundled/core/verification-evidence.md +172 -0
  33. package/bundled/core/workflow-enforcement.md +132 -0
  34. package/bundled/locales/zh-CN/CLAUDE.md +2 -2
  35. package/bundled/locales/zh-CN/README.md +4 -4
  36. package/bundled/locales/zh-CN/SECURITY.md +92 -0
  37. package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +301 -0
  38. package/bundled/locales/zh-CN/core/acceptance-test-driven-development.md +47 -0
  39. package/bundled/locales/zh-CN/core/accessibility-standards.md +124 -0
  40. package/bundled/locales/zh-CN/core/agent-dispatch.md +113 -0
  41. package/bundled/locales/zh-CN/core/ai-agreement-standards.md +103 -0
  42. package/bundled/locales/zh-CN/core/ai-command-behavior.md +247 -0
  43. package/bundled/locales/zh-CN/core/api-design-standards.md +946 -0
  44. package/bundled/locales/zh-CN/core/behavior-driven-development.md +48 -0
  45. package/bundled/locales/zh-CN/core/branch-completion.md +112 -0
  46. package/bundled/locales/zh-CN/core/change-batching-standards.md +265 -0
  47. package/bundled/locales/zh-CN/core/checkin-standards.md +43 -5
  48. package/bundled/locales/zh-CN/core/context-aware-loading.md +106 -0
  49. package/bundled/locales/zh-CN/core/database-standards.md +836 -0
  50. package/bundled/locales/zh-CN/core/deployment-standards.md +80 -0
  51. package/bundled/locales/zh-CN/core/error-code-standards.md +2 -2
  52. package/bundled/locales/zh-CN/core/forward-derivation-standards.md +493 -0
  53. package/bundled/locales/zh-CN/core/git-worktree.md +101 -0
  54. package/bundled/locales/zh-CN/core/model-selection.md +112 -0
  55. package/bundled/locales/zh-CN/core/performance-standards.md +104 -0
  56. package/bundled/locales/zh-CN/core/pipeline-integration-standards.md +238 -0
  57. package/bundled/locales/zh-CN/core/project-context-memory.md +124 -0
  58. package/bundled/locales/zh-CN/core/requirement-engineering.md +49 -0
  59. package/bundled/locales/zh-CN/core/security-standards.md +100 -0
  60. package/bundled/locales/zh-CN/core/systematic-debugging.md +106 -0
  61. package/bundled/locales/zh-CN/core/test-governance.md +116 -0
  62. package/bundled/locales/zh-CN/core/testing-standards.md +392 -156
  63. package/bundled/locales/zh-CN/core/verification-evidence.md +118 -0
  64. package/bundled/locales/zh-CN/core/virtual-organization-standards.md +104 -0
  65. package/bundled/locales/zh-CN/core/workflow-enforcement.md +132 -0
  66. package/bundled/locales/zh-CN/docs/CHEATSHEET.md +27 -1
  67. package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +9 -1
  68. package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +37 -9
  69. package/bundled/locales/zh-CN/docs/USER-MANUAL.md +652 -0
  70. package/bundled/locales/zh-CN/integrations/github-copilot/copilot-instructions.md +1 -1
  71. package/bundled/locales/zh-CN/integrations/openspec/AGENTS.md +29 -4
  72. package/bundled/locales/zh-CN/integrations/spec-kit/AGENTS.md +143 -72
  73. package/bundled/locales/zh-CN/skills/ac-coverage-assistant/SKILL.md +126 -0
  74. package/bundled/locales/zh-CN/skills/api-design-assistant/SKILL.md +100 -0
  75. package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +119 -0
  76. package/bundled/locales/zh-CN/skills/ci-cd-assistant/SKILL.md +82 -0
  77. package/bundled/locales/zh-CN/skills/commands/ac-coverage.md +97 -0
  78. package/bundled/locales/zh-CN/skills/commands/api-design.md +94 -0
  79. package/bundled/locales/zh-CN/skills/commands/atdd.md +163 -0
  80. package/bundled/locales/zh-CN/skills/commands/audit.md +77 -0
  81. package/bundled/locales/zh-CN/skills/commands/bdd.md +1 -1
  82. package/bundled/locales/zh-CN/skills/commands/brainstorm.md +87 -0
  83. package/bundled/locales/zh-CN/skills/commands/changelog.md +63 -0
  84. package/bundled/locales/zh-CN/skills/commands/check.md +219 -0
  85. package/bundled/locales/zh-CN/skills/commands/checkin.md +61 -0
  86. package/bundled/locales/zh-CN/skills/commands/ci-cd.md +77 -0
  87. package/bundled/locales/zh-CN/skills/commands/commit.md +81 -0
  88. package/bundled/locales/zh-CN/skills/commands/config.md +207 -0
  89. package/bundled/locales/zh-CN/skills/commands/coverage.md +74 -0
  90. package/bundled/locales/zh-CN/skills/commands/database.md +78 -0
  91. package/bundled/locales/zh-CN/skills/commands/derive-all.md +58 -0
  92. package/bundled/locales/zh-CN/skills/commands/derive-atdd.md +54 -0
  93. package/bundled/locales/zh-CN/skills/commands/derive-bdd.md +53 -0
  94. package/bundled/locales/zh-CN/skills/commands/derive-tdd.md +54 -0
  95. package/bundled/locales/zh-CN/skills/commands/derive.md +78 -0
  96. package/bundled/locales/zh-CN/skills/commands/dev-workflow.md +119 -0
  97. package/bundled/locales/zh-CN/skills/commands/discover.md +86 -0
  98. package/bundled/locales/zh-CN/skills/commands/docgen.md +67 -0
  99. package/bundled/locales/zh-CN/skills/commands/docs.md +65 -0
  100. package/bundled/locales/zh-CN/skills/commands/durable.md +87 -0
  101. package/bundled/locales/zh-CN/skills/commands/guide.md +52 -0
  102. package/bundled/locales/zh-CN/skills/commands/incident.md +92 -0
  103. package/bundled/locales/zh-CN/skills/commands/init.md +272 -0
  104. package/bundled/locales/zh-CN/skills/commands/methodology.md +1 -1
  105. package/bundled/locales/zh-CN/skills/commands/metrics.md +73 -0
  106. package/bundled/locales/zh-CN/skills/commands/migrate.md +92 -0
  107. package/bundled/locales/zh-CN/skills/commands/pr.md +80 -0
  108. package/bundled/locales/zh-CN/skills/commands/refactor.md +1 -1
  109. package/bundled/locales/zh-CN/skills/commands/release.md +62 -0
  110. package/bundled/locales/zh-CN/skills/commands/requirement.md +54 -0
  111. package/bundled/locales/zh-CN/skills/commands/reverse-bdd.md +47 -0
  112. package/bundled/locales/zh-CN/skills/commands/reverse-sdd.md +51 -0
  113. package/bundled/locales/zh-CN/skills/commands/reverse-tdd.md +51 -0
  114. package/bundled/locales/zh-CN/skills/commands/reverse.md +63 -0
  115. package/bundled/locales/zh-CN/skills/commands/review.md +50 -0
  116. package/bundled/locales/zh-CN/skills/commands/scan.md +76 -0
  117. package/bundled/locales/zh-CN/skills/commands/sdd-retro.md +40 -0
  118. package/bundled/locales/zh-CN/skills/commands/sdd.md +379 -0
  119. package/bundled/locales/zh-CN/skills/commands/security.md +75 -0
  120. package/bundled/locales/zh-CN/skills/commands/tdd.md +111 -0
  121. package/bundled/locales/zh-CN/skills/commands/update.md +337 -0
  122. package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +1 -2
  123. package/bundled/locales/zh-CN/skills/database-assistant/SKILL.md +97 -0
  124. package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +145 -0
  125. package/bundled/locales/zh-CN/skills/durable-execution-assistant/SKILL.md +84 -0
  126. package/bundled/locales/zh-CN/skills/incident-response-assistant/SKILL.md +107 -0
  127. package/bundled/locales/zh-CN/skills/metrics-dashboard-assistant/SKILL.md +67 -0
  128. package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +77 -0
  129. package/bundled/locales/zh-CN/skills/pr-automation-assistant/SKILL.md +90 -0
  130. package/bundled/locales/zh-CN/skills/security-assistant/SKILL.md +79 -0
  131. package/bundled/locales/zh-CN/skills/security-scan-assistant/SKILL.md +72 -0
  132. package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +73 -10
  133. package/bundled/locales/zh-CN/skills/spec-driven-dev/guide.md +267 -122
  134. package/bundled/locales/zh-TW/CLAUDE.md +2 -2
  135. package/bundled/locales/zh-TW/README.md +4 -4
  136. package/bundled/locales/zh-TW/SECURITY.md +92 -0
  137. package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +301 -0
  138. package/bundled/locales/zh-TW/core/acceptance-test-driven-development.md +47 -0
  139. package/bundled/locales/zh-TW/core/accessibility-standards.md +84 -0
  140. package/bundled/locales/zh-TW/core/agent-dispatch.md +89 -0
  141. package/bundled/locales/zh-TW/core/ai-agreement-standards.md +87 -0
  142. package/bundled/locales/zh-TW/core/ai-command-behavior.md +247 -0
  143. package/bundled/locales/zh-TW/core/api-design-standards.md +946 -0
  144. package/bundled/locales/zh-TW/core/behavior-driven-development.md +63 -0
  145. package/bundled/locales/zh-TW/core/branch-completion.md +76 -0
  146. package/bundled/locales/zh-TW/core/change-batching-standards.md +265 -0
  147. package/bundled/locales/zh-TW/core/checkin-standards.md +39 -5
  148. package/bundled/locales/zh-TW/core/context-aware-loading.md +86 -0
  149. package/bundled/locales/zh-TW/core/database-standards.md +836 -0
  150. package/bundled/locales/zh-TW/core/deployment-standards.md +66 -0
  151. package/bundled/locales/zh-TW/core/error-code-standards.md +230 -4
  152. package/bundled/locales/zh-TW/core/forward-derivation-standards.md +62 -2
  153. package/bundled/locales/zh-TW/core/git-worktree.md +104 -0
  154. package/bundled/locales/zh-TW/core/model-selection.md +83 -0
  155. package/bundled/locales/zh-TW/core/performance-standards.md +84 -0
  156. package/bundled/locales/zh-TW/core/pipeline-integration-standards.md +238 -0
  157. package/bundled/locales/zh-TW/core/project-context-memory.md +79 -0
  158. package/bundled/locales/zh-TW/core/requirement-engineering.md +79 -0
  159. package/bundled/locales/zh-TW/core/security-standards.md +74 -0
  160. package/bundled/locales/zh-TW/core/systematic-debugging.md +95 -0
  161. package/bundled/locales/zh-TW/core/test-governance.md +88 -0
  162. package/bundled/locales/zh-TW/core/testing-standards.md +309 -86
  163. package/bundled/locales/zh-TW/core/verification-evidence.md +94 -0
  164. package/bundled/locales/zh-TW/core/virtual-organization-standards.md +88 -0
  165. package/bundled/locales/zh-TW/core/workflow-enforcement.md +132 -0
  166. package/bundled/locales/zh-TW/docs/CHEATSHEET.md +27 -1
  167. package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +9 -1
  168. package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +37 -9
  169. package/bundled/locales/zh-TW/docs/USER-MANUAL.md +652 -0
  170. package/bundled/locales/zh-TW/integrations/github-copilot/copilot-instructions.md +1 -1
  171. package/bundled/locales/zh-TW/integrations/openspec/AGENTS.md +29 -4
  172. package/bundled/locales/zh-TW/integrations/spec-kit/AGENTS.md +142 -71
  173. package/bundled/locales/zh-TW/skills/ac-coverage-assistant/SKILL.md +127 -0
  174. package/bundled/locales/zh-TW/skills/ai-friendly-architecture/SKILL.md +1 -4
  175. package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +1 -4
  176. package/bundled/locales/zh-TW/skills/api-design-assistant/SKILL.md +97 -0
  177. package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +1 -4
  178. package/bundled/locales/zh-TW/skills/audit-assistant/SKILL.md +1 -4
  179. package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +1 -4
  180. package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +1 -4
  181. package/bundled/locales/zh-TW/skills/changelog-guide/SKILL.md +1 -4
  182. package/bundled/locales/zh-TW/skills/checkin-assistant/SKILL.md +1 -4
  183. package/bundled/locales/zh-TW/skills/ci-cd-assistant/SKILL.md +79 -0
  184. package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +1 -4
  185. package/bundled/locales/zh-TW/skills/commands/ac-coverage.md +95 -0
  186. package/bundled/locales/zh-TW/skills/commands/api-design.md +92 -0
  187. package/bundled/locales/zh-TW/skills/commands/atdd.md +167 -0
  188. package/bundled/locales/zh-TW/skills/commands/audit.md +75 -0
  189. package/bundled/locales/zh-TW/skills/commands/bdd.md +1 -1
  190. package/bundled/locales/zh-TW/skills/commands/brainstorm.md +91 -0
  191. package/bundled/locales/zh-TW/skills/commands/changelog.md +67 -0
  192. package/bundled/locales/zh-TW/skills/commands/check.md +223 -0
  193. package/bundled/locales/zh-TW/skills/commands/checkin.md +65 -0
  194. package/bundled/locales/zh-TW/skills/commands/ci-cd.md +75 -0
  195. package/bundled/locales/zh-TW/skills/commands/commit.md +85 -0
  196. package/bundled/locales/zh-TW/skills/commands/config.md +211 -0
  197. package/bundled/locales/zh-TW/skills/commands/coverage.md +78 -0
  198. package/bundled/locales/zh-TW/skills/commands/database.md +76 -0
  199. package/bundled/locales/zh-TW/skills/commands/derive-all.md +62 -0
  200. package/bundled/locales/zh-TW/skills/commands/derive-atdd.md +58 -0
  201. package/bundled/locales/zh-TW/skills/commands/derive-bdd.md +54 -0
  202. package/bundled/locales/zh-TW/skills/commands/derive-tdd.md +55 -0
  203. package/bundled/locales/zh-TW/skills/commands/derive.md +79 -0
  204. package/bundled/locales/zh-TW/skills/commands/dev-workflow.md +120 -0
  205. package/bundled/locales/zh-TW/skills/commands/discover.md +87 -0
  206. package/bundled/locales/zh-TW/skills/commands/docgen.md +68 -0
  207. package/bundled/locales/zh-TW/skills/commands/docs.md +66 -0
  208. package/bundled/locales/zh-TW/skills/commands/durable.md +85 -0
  209. package/bundled/locales/zh-TW/skills/commands/guide.md +51 -0
  210. package/bundled/locales/zh-TW/skills/commands/incident.md +90 -0
  211. package/bundled/locales/zh-TW/skills/commands/init.md +273 -0
  212. package/bundled/locales/zh-TW/skills/commands/methodology.md +1 -1
  213. package/bundled/locales/zh-TW/skills/commands/metrics.md +71 -0
  214. package/bundled/locales/zh-TW/skills/commands/migrate.md +90 -0
  215. package/bundled/locales/zh-TW/skills/commands/pr.md +78 -0
  216. package/bundled/locales/zh-TW/skills/commands/refactor.md +1 -1
  217. package/bundled/locales/zh-TW/skills/commands/release.md +63 -0
  218. package/bundled/locales/zh-TW/skills/commands/requirement.md +61 -0
  219. package/bundled/locales/zh-TW/skills/commands/reverse-bdd.md +54 -0
  220. package/bundled/locales/zh-TW/skills/commands/reverse-sdd.md +58 -0
  221. package/bundled/locales/zh-TW/skills/commands/reverse-tdd.md +58 -0
  222. package/bundled/locales/zh-TW/skills/commands/reverse.md +70 -0
  223. package/bundled/locales/zh-TW/skills/commands/review.md +57 -0
  224. package/bundled/locales/zh-TW/skills/commands/scan.md +74 -0
  225. package/bundled/locales/zh-TW/skills/commands/sdd-retro.md +47 -0
  226. package/bundled/locales/zh-TW/skills/commands/sdd.md +362 -0
  227. package/bundled/locales/zh-TW/skills/commands/security.md +73 -0
  228. package/bundled/locales/zh-TW/skills/commands/tdd.md +115 -0
  229. package/bundled/locales/zh-TW/skills/commands/update.md +326 -0
  230. package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +2 -6
  231. package/bundled/locales/zh-TW/skills/database-assistant/SKILL.md +94 -0
  232. package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +140 -0
  233. package/bundled/locales/zh-TW/skills/docs-generator/SKILL.md +1 -4
  234. package/bundled/locales/zh-TW/skills/documentation-guide/SKILL.md +1 -4
  235. package/bundled/locales/zh-TW/skills/durable-execution-assistant/SKILL.md +81 -0
  236. package/bundled/locales/zh-TW/skills/error-code-guide/SKILL.md +1 -4
  237. package/bundled/locales/zh-TW/skills/forward-derivation/SKILL.md +1 -4
  238. package/bundled/locales/zh-TW/skills/git-workflow-guide/SKILL.md +1 -4
  239. package/bundled/locales/zh-TW/skills/incident-response-assistant/SKILL.md +104 -0
  240. package/bundled/locales/zh-TW/skills/logging-guide/SKILL.md +1 -4
  241. package/bundled/locales/zh-TW/skills/methodology-system/SKILL.md +1 -4
  242. package/bundled/locales/zh-TW/skills/metrics-dashboard-assistant/SKILL.md +64 -0
  243. package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +74 -0
  244. package/bundled/locales/zh-TW/skills/pr-automation-assistant/SKILL.md +87 -0
  245. package/bundled/locales/zh-TW/skills/project-discovery/SKILL.md +1 -4
  246. package/bundled/locales/zh-TW/skills/refactoring-assistant/SKILL.md +1 -4
  247. package/bundled/locales/zh-TW/skills/release-standards/SKILL.md +1 -4
  248. package/bundled/locales/zh-TW/skills/requirement-assistant/SKILL.md +1 -4
  249. package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +1 -4
  250. package/bundled/locales/zh-TW/skills/security-assistant/SKILL.md +76 -0
  251. package/bundled/locales/zh-TW/skills/security-scan-assistant/SKILL.md +69 -0
  252. package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +74 -14
  253. package/bundled/locales/zh-TW/skills/spec-driven-dev/guide.md +243 -98
  254. package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +1 -4
  255. package/bundled/locales/zh-TW/skills/test-coverage-assistant/SKILL.md +1 -4
  256. package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +1 -5
  257. package/bundled/skills/README.md +11 -0
  258. package/bundled/skills/ac-coverage-assistant/SKILL.md +127 -0
  259. package/bundled/skills/ai-collaboration-standards/SKILL.md +10 -0
  260. package/bundled/skills/ai-friendly-architecture/SKILL.md +10 -0
  261. package/bundled/skills/ai-instruction-standards/SKILL.md +10 -0
  262. package/bundled/skills/api-design-assistant/SKILL.md +119 -0
  263. package/bundled/skills/atdd-assistant/SKILL.md +7 -0
  264. package/bundled/skills/bdd-assistant/SKILL.md +7 -0
  265. package/bundled/skills/brainstorm-assistant/SKILL.md +7 -0
  266. package/bundled/skills/checkin-assistant/SKILL.md +7 -0
  267. package/bundled/skills/ci-cd-assistant/SKILL.md +97 -0
  268. package/bundled/skills/code-review-assistant/SKILL.md +7 -0
  269. package/bundled/skills/commands/README.md +70 -0
  270. package/bundled/skills/commands/ac-coverage.md +135 -0
  271. package/bundled/skills/commands/api-design.md +86 -0
  272. package/bundled/skills/commands/atdd.md +69 -0
  273. package/bundled/skills/commands/audit.md +69 -0
  274. package/bundled/skills/commands/bdd.md +101 -0
  275. package/bundled/skills/commands/brainstorm.md +45 -0
  276. package/bundled/skills/commands/changelog.md +34 -0
  277. package/bundled/skills/commands/check.md +52 -1
  278. package/bundled/skills/commands/checkin.md +46 -0
  279. package/bundled/skills/commands/ci-cd.md +69 -0
  280. package/bundled/skills/commands/commit.md +79 -0
  281. package/bundled/skills/commands/config.md +48 -0
  282. package/bundled/skills/commands/coverage.md +53 -0
  283. package/bundled/skills/commands/database.md +70 -0
  284. package/bundled/skills/commands/derive-all.md +40 -0
  285. package/bundled/skills/commands/derive-atdd.md +33 -0
  286. package/bundled/skills/commands/derive-bdd.md +39 -0
  287. package/bundled/skills/commands/derive-tdd.md +40 -0
  288. package/bundled/skills/commands/derive.md +47 -0
  289. package/bundled/skills/commands/dev-workflow.md +104 -7
  290. package/bundled/skills/commands/discover.md +39 -0
  291. package/bundled/skills/commands/docgen.md +35 -0
  292. package/bundled/skills/commands/docs.md +40 -0
  293. package/bundled/skills/commands/durable.md +79 -0
  294. package/bundled/skills/commands/incident.md +84 -0
  295. package/bundled/skills/commands/init.md +55 -0
  296. package/bundled/skills/commands/methodology.md +72 -0
  297. package/bundled/skills/commands/metrics.md +65 -0
  298. package/bundled/skills/commands/migrate.md +84 -0
  299. package/bundled/skills/commands/pr.md +72 -0
  300. package/bundled/skills/commands/refactor.md +51 -0
  301. package/bundled/skills/commands/release.md +60 -0
  302. package/bundled/skills/commands/requirement.md +38 -0
  303. package/bundled/skills/commands/reverse-bdd.md +34 -0
  304. package/bundled/skills/commands/reverse-sdd.md +42 -0
  305. package/bundled/skills/commands/reverse-tdd.md +40 -0
  306. package/bundled/skills/commands/reverse.md +41 -0
  307. package/bundled/skills/commands/review.md +39 -0
  308. package/bundled/skills/commands/scan.md +68 -0
  309. package/bundled/skills/commands/sdd-retro.md +48 -0
  310. package/bundled/skills/commands/sdd.md +220 -0
  311. package/bundled/skills/commands/security.md +67 -0
  312. package/bundled/skills/commands/tdd.md +101 -0
  313. package/bundled/skills/commands/update.md +61 -0
  314. package/bundled/skills/commit-standards/SKILL.md +8 -2
  315. package/bundled/skills/database-assistant/SKILL.md +118 -0
  316. package/bundled/skills/dev-workflow-guide/SKILL.md +53 -7
  317. package/bundled/skills/dev-workflow-guide/workflow-phases.md +24 -0
  318. package/bundled/skills/durable-execution-assistant/SKILL.md +116 -0
  319. package/bundled/skills/forward-derivation/SKILL.md +7 -0
  320. package/bundled/skills/incident-response-assistant/SKILL.md +132 -0
  321. package/bundled/skills/methodology-system/SKILL.md +24 -2
  322. package/bundled/skills/metrics-dashboard-assistant/SKILL.md +109 -0
  323. package/bundled/skills/migration-assistant/SKILL.md +119 -0
  324. package/bundled/skills/pr-automation-assistant/SKILL.md +114 -0
  325. package/bundled/skills/project-discovery/SKILL.md +7 -0
  326. package/bundled/skills/refactoring-assistant/SKILL.md +7 -0
  327. package/bundled/skills/release-standards/SKILL.md +7 -0
  328. package/bundled/skills/requirement-assistant/SKILL.md +7 -0
  329. package/bundled/skills/reverse-engineer/SKILL.md +7 -0
  330. package/bundled/skills/security-assistant/SKILL.md +105 -0
  331. package/bundled/skills/security-scan-assistant/SKILL.md +96 -0
  332. package/bundled/skills/spec-driven-dev/SKILL.md +84 -4
  333. package/bundled/skills/spec-driven-dev/guide.md +156 -22
  334. package/bundled/skills/tdd-assistant/SKILL.md +7 -0
  335. package/bundled/skills/test-coverage-assistant/SKILL.md +11 -0
  336. package/bundled/skills/testing-guide/SKILL.md +23 -0
  337. package/package.json +1 -1
  338. package/src/commands/check.js +154 -8
  339. package/src/commands/config.js +231 -104
  340. package/src/commands/init.js +23 -3
  341. package/src/commands/update.js +239 -23
  342. package/src/config/ai-agent-paths.js +16 -0
  343. package/src/config/workflow-definitions.js +184 -0
  344. package/src/core/constants.js +6 -0
  345. package/src/flows/init-flow.js +23 -6
  346. package/src/i18n/messages.js +51 -3
  347. package/src/installers/integration-installer.js +67 -2
  348. package/src/installers/manifest-installer.js +1 -0
  349. package/src/installers/standards-installer.js +3 -2
  350. package/src/prompts/init.js +50 -3
  351. package/src/reconciler/manifest-migrator.js +2 -2
  352. package/src/reconciler/plan-executor.js +11 -0
  353. package/src/utils/integration-generator.js +327 -14
  354. package/src/utils/workflow-gate.js +292 -0
  355. package/standards-registry.json +160 -5
@@ -0,0 +1,938 @@
1
+ # API Design Standards
2
+
3
+ > **Language**: English | [繁體中文](../locales/zh-TW/core/api-design-standards.md)
4
+
5
+ **Version**: 1.0.0
6
+ **Last Updated**: 2026-03-18
7
+ **Applicability**: All software projects
8
+ **Scope**: universal
9
+ **Industry Standards**: OpenAPI 3.x, JSON:API 1.1, Google API Design Guide, RFC 7231 (HTTP Semantics)
10
+ **References**: [openapis.org](https://www.openapis.org/), [jsonapi.org](https://jsonapi.org/), [Google API Design Guide](https://cloud.google.com/apis/design), [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231)
11
+
12
+ ---
13
+
14
+ ## Purpose
15
+
16
+ This standard defines comprehensive guidelines for designing, building, and maintaining APIs. It covers REST, GraphQL, and gRPC paradigms, providing consistent patterns for resource naming, versioning, pagination, error handling, authentication, and documentation.
17
+
18
+ **Reference Standards**:
19
+ - [OpenAPI Specification 3.x](https://spec.openapis.org/oas/v3.1.0)
20
+ - [JSON:API 1.1](https://jsonapi.org/format/)
21
+ - [Google API Design Guide](https://cloud.google.com/apis/design)
22
+ - [RFC 7231 — HTTP Semantics](https://datatracker.ietf.org/doc/html/rfc7231)
23
+ - [RFC 7807 — Problem Details for HTTP APIs](https://datatracker.ietf.org/doc/html/rfc7807)
24
+
25
+ ---
26
+
27
+ ## REST Design Principles
28
+
29
+ ### Resource Naming
30
+
31
+ | Rule | Correct | Incorrect |
32
+ |------|---------|-----------|
33
+ | **Use nouns, not verbs** | `/users` | `/getUsers` |
34
+ | **Use plural nouns** | `/articles` | `/article` |
35
+ | **Use kebab-case** | `/user-profiles` | `/userProfiles`, `/user_profiles` |
36
+ | **Use lowercase** | `/orders` | `/Orders` |
37
+ | **Nest for relationships** | `/users/123/orders` | `/getUserOrders?userId=123` |
38
+ | **Max 2 nesting levels** | `/users/123/orders` | `/users/123/orders/456/items/789/details` |
39
+
40
+ ### HTTP Verbs
41
+
42
+ | Verb | Purpose | Request Body | Idempotent | Safe |
43
+ |------|---------|-------------|------------|------|
44
+ | **GET** | Retrieve resource(s) | No | Yes | Yes |
45
+ | **POST** | Create new resource | Yes | No | No |
46
+ | **PUT** | Full replacement of resource | Yes | Yes | No |
47
+ | **PATCH** | Partial update of resource | Yes | No | No |
48
+ | **DELETE** | Remove resource | Optional | Yes | No |
49
+ | **HEAD** | Same as GET without body | No | Yes | Yes |
50
+ | **OPTIONS** | Describe communication options | No | Yes | Yes |
51
+
52
+ ### HTTP Status Codes
53
+
54
+ #### Success (2xx)
55
+
56
+ | Code | Meaning | When to Use |
57
+ |------|---------|-------------|
58
+ | **200 OK** | General success | GET, PUT, PATCH, DELETE with body |
59
+ | **201 Created** | Resource created | POST (include `Location` header) |
60
+ | **202 Accepted** | Request accepted for async processing | Long-running operations |
61
+ | **204 No Content** | Success with no body | DELETE, PUT with no response body |
62
+
63
+ #### Client Errors (4xx)
64
+
65
+ | Code | Meaning | When to Use |
66
+ |------|---------|-------------|
67
+ | **400 Bad Request** | Malformed request | Invalid JSON, missing required fields |
68
+ | **401 Unauthorized** | Authentication required | No token, expired token |
69
+ | **403 Forbidden** | Insufficient permissions | Valid token, wrong role |
70
+ | **404 Not Found** | Resource does not exist | Invalid resource ID |
71
+ | **405 Method Not Allowed** | HTTP method not supported | POST to read-only endpoint |
72
+ | **409 Conflict** | State conflict | Duplicate creation, version conflict |
73
+ | **422 Unprocessable Entity** | Validation error | Valid JSON but fails business rules |
74
+ | **429 Too Many Requests** | Rate limit exceeded | Include `Retry-After` header |
75
+
76
+ #### Server Errors (5xx)
77
+
78
+ | Code | Meaning | When to Use |
79
+ |------|---------|-------------|
80
+ | **500 Internal Server Error** | Unexpected server error | Unhandled exceptions |
81
+ | **502 Bad Gateway** | Upstream service error | Dependency failure |
82
+ | **503 Service Unavailable** | Temporarily unavailable | Maintenance, overload |
83
+ | **504 Gateway Timeout** | Upstream timeout | Dependency timeout |
84
+
85
+ ---
86
+
87
+ ## URL Structure
88
+
89
+ ### Base URL Format
90
+
91
+ ```
92
+ https://api.example.com/v1/resources
93
+ ```
94
+
95
+ | Component | Convention | Example |
96
+ |-----------|-----------|---------|
97
+ | **Protocol** | Always HTTPS | `https://` |
98
+ | **Subdomain** | `api.` prefix | `api.example.com` |
99
+ | **Version** | Path prefix | `/v1/` |
100
+ | **Resource** | Plural noun, kebab-case | `/user-profiles` |
101
+
102
+ ### Resource Hierarchy
103
+
104
+ ```
105
+ # Collection
106
+ GET /users
107
+
108
+ # Specific resource
109
+ GET /users/123
110
+
111
+ # Sub-resource collection (1 level nesting)
112
+ GET /users/123/orders
113
+
114
+ # Specific sub-resource (2 level nesting — maximum)
115
+ GET /users/123/orders/456
116
+
117
+ # Avoid deeper nesting — use top-level with filters
118
+ GET /order-items?order_id=456
119
+ ```
120
+
121
+ ### Actions on Resources
122
+
123
+ For non-CRUD operations, use sub-resource actions:
124
+
125
+ ```
126
+ # Acceptable action patterns
127
+ POST /users/123/activate
128
+ POST /orders/456/cancel
129
+ POST /reports/generate
130
+
131
+ # Avoid verb-based URLs
132
+ POST /activateUser # Wrong
133
+ POST /cancelOrder # Wrong
134
+ ```
135
+
136
+ ---
137
+
138
+ ## API Versioning Strategies
139
+
140
+ ### Comparison Matrix
141
+
142
+ | Strategy | Example | Pros | Cons |
143
+ |----------|---------|------|------|
144
+ | **URL Path** | `/v1/users` | Explicit, easy to route, cacheable | URL pollution, harder migration |
145
+ | **Header** | `Accept-Version: v1` | Clean URLs | Hidden, harder to test in browser |
146
+ | **Query Param** | `/users?v=1` | Easy to add | Easily overlooked, caching issues |
147
+ | **Content Negotiation** | `Accept: application/vnd.api.v1+json` | Standards-based | Complex, hard to discover |
148
+
149
+ ### Decision Guide
150
+
151
+ ```
152
+ Do you need to support multiple versions concurrently?
153
+ ├── Yes → URL Path versioning (most explicit)
154
+ └── No → Do you prioritize clean URLs?
155
+ ├── Yes → Header versioning
156
+ └── No → URL Path versioning (simpler)
157
+ ```
158
+
159
+ ### Recommended: URL Path Versioning
160
+
161
+ ```
162
+ https://api.example.com/v1/users
163
+ https://api.example.com/v2/users
164
+ ```
165
+
166
+ ### Version Lifecycle
167
+
168
+ | Phase | Duration | Action |
169
+ |-------|----------|--------|
170
+ | **Current** | Active development | Full support, new features |
171
+ | **Supported** | 6-12 months after successor | Bug fixes, security patches only |
172
+ | **Deprecated** | 3-6 months notice | Sunset header, migration guide |
173
+ | **Retired** | After deprecation period | Return 410 Gone with migration info |
174
+
175
+ ### Deprecation Headers
176
+
177
+ ```http
178
+ Sunset: Sat, 01 Jan 2028 00:00:00 GMT
179
+ Deprecation: true
180
+ Link: <https://api.example.com/v2/docs>; rel="successor-version"
181
+ ```
182
+
183
+ ---
184
+
185
+ ## Request/Response Standards
186
+
187
+ ### Content Headers
188
+
189
+ ```http
190
+ # Request
191
+ Content-Type: application/json
192
+ Accept: application/json
193
+
194
+ # Response
195
+ Content-Type: application/json; charset=utf-8
196
+ ```
197
+
198
+ ### JSON Naming Convention
199
+
200
+ | Convention | Use In | Example |
201
+ |------------|--------|---------|
202
+ | **camelCase** | JSON properties | `firstName`, `createdAt` |
203
+ | **kebab-case** | URL paths | `/user-profiles` |
204
+ | **snake_case** | Query parameters | `?sort_by=created_at` |
205
+
206
+ ### Standard Response Envelope
207
+
208
+ ```json
209
+ {
210
+ "data": {
211
+ "id": "123",
212
+ "type": "user",
213
+ "attributes": {
214
+ "firstName": "John",
215
+ "lastName": "Doe",
216
+ "email": "john@example.com",
217
+ "createdAt": "2026-03-18T10:30:00Z"
218
+ }
219
+ },
220
+ "meta": {
221
+ "requestId": "req-abc-123",
222
+ "timestamp": "2026-03-18T10:30:00Z"
223
+ }
224
+ }
225
+ ```
226
+
227
+ ### Collection Response Envelope
228
+
229
+ ```json
230
+ {
231
+ "data": [
232
+ { "id": "1", "type": "user", "attributes": { "firstName": "John" } },
233
+ { "id": "2", "type": "user", "attributes": { "firstName": "Jane" } }
234
+ ],
235
+ "meta": {
236
+ "totalCount": 150,
237
+ "page": 1,
238
+ "pageSize": 20,
239
+ "requestId": "req-abc-124"
240
+ },
241
+ "links": {
242
+ "self": "/v1/users?page=1&limit=20",
243
+ "next": "/v1/users?page=2&limit=20",
244
+ "last": "/v1/users?page=8&limit=20"
245
+ }
246
+ }
247
+ ```
248
+
249
+ ### Date/Time Format
250
+
251
+ - Always use **ISO 8601** format: `2026-03-18T10:30:00Z`
252
+ - Always use **UTC** timezone in API responses
253
+ - Accept timezone-aware input, convert to UTC for storage
254
+
255
+ ---
256
+
257
+ ## Pagination
258
+
259
+ ### Strategy Comparison
260
+
261
+ | Strategy | Best For | Pros | Cons |
262
+ |----------|----------|------|------|
263
+ | **Offset-based** | Simple lists, UI with page numbers | Easy to implement, jump to page | Inconsistent with mutations, slow on large datasets |
264
+ | **Cursor-based** | Real-time feeds, large datasets | Consistent, performant | Cannot jump to page, opaque cursor |
265
+ | **Keyset-based** | Sorted large datasets | Very performant | Requires stable sort key |
266
+
267
+ ### Offset-based Pagination
268
+
269
+ ```
270
+ GET /v1/users?page=2&limit=20
271
+ ```
272
+
273
+ ```json
274
+ {
275
+ "data": [...],
276
+ "meta": {
277
+ "page": 2,
278
+ "limit": 20,
279
+ "totalCount": 150,
280
+ "totalPages": 8
281
+ },
282
+ "links": {
283
+ "first": "/v1/users?page=1&limit=20",
284
+ "prev": "/v1/users?page=1&limit=20",
285
+ "self": "/v1/users?page=2&limit=20",
286
+ "next": "/v1/users?page=3&limit=20",
287
+ "last": "/v1/users?page=8&limit=20"
288
+ }
289
+ }
290
+ ```
291
+
292
+ ### Cursor-based Pagination
293
+
294
+ ```
295
+ GET /v1/events?limit=20&cursor=eyJpZCI6MTAwfQ==
296
+ ```
297
+
298
+ ```json
299
+ {
300
+ "data": [...],
301
+ "meta": {
302
+ "limit": 20,
303
+ "hasMore": true
304
+ },
305
+ "links": {
306
+ "self": "/v1/events?limit=20",
307
+ "next": "/v1/events?limit=20&cursor=eyJpZCI6MTIwfQ=="
308
+ }
309
+ }
310
+ ```
311
+
312
+ ### Default Values
313
+
314
+ | Parameter | Default | Maximum |
315
+ |-----------|---------|---------|
316
+ | `page` | 1 | - |
317
+ | `limit` / `page_size` | 20 | 100 |
318
+ | `cursor` | null (start) | - |
319
+
320
+ ---
321
+
322
+ ## Filtering, Sorting, and Field Selection
323
+
324
+ ### Filtering
325
+
326
+ ```
327
+ # Simple equality
328
+ GET /v1/users?status=active
329
+
330
+ # Bracket notation (recommended for complex filters)
331
+ GET /v1/users?filter[status]=active&filter[role]=admin
332
+
333
+ # Range filters
334
+ GET /v1/orders?filter[created_at][gte]=2026-01-01&filter[created_at][lte]=2026-03-18
335
+
336
+ # Multiple values (comma-separated)
337
+ GET /v1/users?filter[role]=admin,editor
338
+ ```
339
+
340
+ ### Sorting
341
+
342
+ ```
343
+ # Ascending (default)
344
+ GET /v1/users?sort=created_at
345
+
346
+ # Descending (prefix with -)
347
+ GET /v1/users?sort=-created_at
348
+
349
+ # Multiple sort fields (comma-separated)
350
+ GET /v1/users?sort=-created_at,last_name
351
+ ```
352
+
353
+ ### Field Selection (Sparse Fieldsets)
354
+
355
+ ```
356
+ # Select specific fields
357
+ GET /v1/users?fields=id,first_name,email
358
+
359
+ # Per-resource-type fields (JSON:API style)
360
+ GET /v1/articles?fields[article]=title,body&fields[author]=name
361
+ ```
362
+
363
+ ### Search
364
+
365
+ ```
366
+ # Full-text search
367
+ GET /v1/users?q=john+doe
368
+
369
+ # Scoped search
370
+ GET /v1/users?search[name]=john&search[email]=example.com
371
+ ```
372
+
373
+ ---
374
+
375
+ ## Authentication Patterns
376
+
377
+ ### Decision Matrix
378
+
379
+ | Method | Use Case | Complexity | Security Level |
380
+ |--------|----------|-----------|----------------|
381
+ | **API Key** | Server-to-server, internal APIs | Low | Medium |
382
+ | **OAuth 2.0** | Third-party access, user delegation | High | High |
383
+ | **JWT Bearer** | Stateless auth, microservices | Medium | High |
384
+ | **mTLS** | Service mesh, zero-trust | High | Very High |
385
+
386
+ ### API Key
387
+
388
+ ```http
389
+ # Header (preferred)
390
+ Authorization: ApiKey sk_live_abc123def456
391
+
392
+ # Query parameter (avoid — logged in server logs)
393
+ GET /v1/users?api_key=sk_live_abc123def456
394
+ ```
395
+
396
+ ### OAuth 2.0 Flows
397
+
398
+ | Flow | Use Case | Client Type |
399
+ |------|----------|-------------|
400
+ | **Authorization Code + PKCE** | Web apps, mobile apps | Public |
401
+ | **Client Credentials** | Machine-to-machine | Confidential |
402
+ | **Device Code** | IoT, CLI tools | Public (input-constrained) |
403
+ | **Refresh Token** | Long-lived sessions | Any |
404
+
405
+ ### JWT Bearer Token
406
+
407
+ ```http
408
+ Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
409
+ ```
410
+
411
+ **JWT Best Practices:**
412
+
413
+ | Rule | Requirement |
414
+ |------|-------------|
415
+ | **Algorithm** | RS256 or ES256 (asymmetric) |
416
+ | **Access token TTL** | 15 minutes maximum |
417
+ | **Refresh token TTL** | 7-30 days |
418
+ | **Payload** | Never include sensitive data (passwords, PII) |
419
+ | **Validation** | Always verify signature, issuer, audience, expiry |
420
+ | **Revocation** | Maintain a token blacklist or use short-lived tokens |
421
+
422
+ ---
423
+
424
+ ## Rate Limiting
425
+
426
+ ### Standard Headers
427
+
428
+ ```http
429
+ X-RateLimit-Limit: 1000
430
+ X-RateLimit-Remaining: 994
431
+ X-RateLimit-Reset: 1711036800
432
+ ```
433
+
434
+ | Header | Description |
435
+ |--------|-------------|
436
+ | `X-RateLimit-Limit` | Maximum requests allowed in window |
437
+ | `X-RateLimit-Remaining` | Requests remaining in current window |
438
+ | `X-RateLimit-Reset` | Unix timestamp when the window resets |
439
+ | `Retry-After` | Seconds to wait before retrying (on 429) |
440
+
441
+ ### Rate Limit Tiers
442
+
443
+ | Tier | Limit | Window | Use Case |
444
+ |------|-------|--------|----------|
445
+ | **Free** | 100 requests | 1 hour | Public/anonymous |
446
+ | **Basic** | 1,000 requests | 1 hour | Authenticated users |
447
+ | **Pro** | 10,000 requests | 1 hour | Paying customers |
448
+ | **Enterprise** | Custom | Custom | Negotiated SLAs |
449
+
450
+ ### 429 Response
451
+
452
+ ```json
453
+ {
454
+ "type": "https://api.example.com/errors/rate-limit-exceeded",
455
+ "title": "Rate Limit Exceeded",
456
+ "status": 429,
457
+ "detail": "You have exceeded the rate limit of 1000 requests per hour.",
458
+ "instance": "/v1/users",
459
+ "retryAfter": 3600
460
+ }
461
+ ```
462
+
463
+ ### Rate Limiting Strategies
464
+
465
+ | Strategy | Description | Best For |
466
+ |----------|-------------|----------|
467
+ | **Fixed Window** | Count requests in fixed time slots | Simple implementations |
468
+ | **Sliding Window** | Rolling window of time | More accurate limiting |
469
+ | **Token Bucket** | Refill tokens at a steady rate | Burst tolerance |
470
+ | **Leaky Bucket** | Process requests at a constant rate | Smooth traffic |
471
+
472
+ ---
473
+
474
+ ## Error Response Format
475
+
476
+ ### RFC 7807 Problem Details
477
+
478
+ All error responses MUST follow the [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807) Problem Details format:
479
+
480
+ ```json
481
+ {
482
+ "type": "https://api.example.com/errors/validation-error",
483
+ "title": "Validation Error",
484
+ "status": 422,
485
+ "detail": "The request body contains invalid fields.",
486
+ "instance": "/v1/users",
487
+ "errors": [
488
+ {
489
+ "field": "email",
490
+ "code": "INVALID_FORMAT",
491
+ "message": "Must be a valid email address."
492
+ },
493
+ {
494
+ "field": "age",
495
+ "code": "OUT_OF_RANGE",
496
+ "message": "Must be between 0 and 150."
497
+ }
498
+ ],
499
+ "traceId": "req-abc-123"
500
+ }
501
+ ```
502
+
503
+ ### Required Fields
504
+
505
+ | Field | Type | Description |
506
+ |-------|------|-------------|
507
+ | `type` | URI | Reference to error documentation |
508
+ | `title` | string | Short, human-readable summary |
509
+ | `status` | integer | HTTP status code |
510
+ | `detail` | string | Human-readable explanation specific to this occurrence |
511
+
512
+ ### Optional Fields
513
+
514
+ | Field | Type | Description |
515
+ |-------|------|-------------|
516
+ | `instance` | URI | URI of the request that caused the error |
517
+ | `errors` | array | Field-level validation errors |
518
+ | `traceId` | string | Request trace identifier for debugging |
519
+
520
+ ### Common Error Types
521
+
522
+ ```json
523
+ // Authentication Error (401)
524
+ {
525
+ "type": "https://api.example.com/errors/authentication-required",
526
+ "title": "Authentication Required",
527
+ "status": 401,
528
+ "detail": "A valid access token is required to access this resource."
529
+ }
530
+
531
+ // Authorization Error (403)
532
+ {
533
+ "type": "https://api.example.com/errors/insufficient-permissions",
534
+ "title": "Insufficient Permissions",
535
+ "status": 403,
536
+ "detail": "You do not have permission to delete this resource."
537
+ }
538
+
539
+ // Not Found (404)
540
+ {
541
+ "type": "https://api.example.com/errors/resource-not-found",
542
+ "title": "Resource Not Found",
543
+ "status": 404,
544
+ "detail": "User with ID '999' does not exist."
545
+ }
546
+ ```
547
+
548
+ ---
549
+
550
+ ## GraphQL Design Principles
551
+
552
+ ### Schema Design
553
+
554
+ ```graphql
555
+ # Use PascalCase for types
556
+ type User {
557
+ id: ID!
558
+ firstName: String!
559
+ lastName: String!
560
+ email: String!
561
+ createdAt: DateTime!
562
+ orders(first: Int, after: String): OrderConnection!
563
+ }
564
+
565
+ # Use descriptive input types
566
+ input CreateUserInput {
567
+ firstName: String!
568
+ lastName: String!
569
+ email: String!
570
+ }
571
+
572
+ # Use verb prefixes for mutations
573
+ type Mutation {
574
+ createUser(input: CreateUserInput!): CreateUserPayload!
575
+ updateUser(id: ID!, input: UpdateUserInput!): UpdateUserPayload!
576
+ deleteUser(id: ID!): DeleteUserPayload!
577
+ }
578
+
579
+ # Payload types with userErrors
580
+ type CreateUserPayload {
581
+ user: User
582
+ userErrors: [UserError!]!
583
+ }
584
+
585
+ type UserError {
586
+ field: [String!]
587
+ message: String!
588
+ code: UserErrorCode!
589
+ }
590
+ ```
591
+
592
+ ### Naming Conventions
593
+
594
+ | Element | Convention | Example |
595
+ |---------|-----------|---------|
596
+ | **Types** | PascalCase | `UserProfile` |
597
+ | **Fields** | camelCase | `firstName` |
598
+ | **Enums** | SCREAMING_SNAKE_CASE | `ORDER_STATUS` |
599
+ | **Enum values** | SCREAMING_SNAKE_CASE | `IN_PROGRESS` |
600
+ | **Mutations** | verb + noun | `createUser`, `updateOrder` |
601
+ | **Queries** | noun or noun phrase | `user`, `allUsers` |
602
+ | **Input types** | action + noun + `Input` | `CreateUserInput` |
603
+ | **Payload types** | action + noun + `Payload` | `CreateUserPayload` |
604
+
605
+ ### Relay-style Pagination (Connections)
606
+
607
+ ```graphql
608
+ type Query {
609
+ users(first: Int, after: String, last: Int, before: String): UserConnection!
610
+ }
611
+
612
+ type UserConnection {
613
+ edges: [UserEdge!]!
614
+ pageInfo: PageInfo!
615
+ totalCount: Int!
616
+ }
617
+
618
+ type UserEdge {
619
+ node: User!
620
+ cursor: String!
621
+ }
622
+
623
+ type PageInfo {
624
+ hasNextPage: Boolean!
625
+ hasPreviousPage: Boolean!
626
+ startCursor: String
627
+ endCursor: String
628
+ }
629
+ ```
630
+
631
+ ### Error Handling
632
+
633
+ ```json
634
+ {
635
+ "data": {
636
+ "createUser": {
637
+ "user": null,
638
+ "userErrors": [
639
+ {
640
+ "field": ["input", "email"],
641
+ "message": "Email is already in use.",
642
+ "code": "TAKEN"
643
+ }
644
+ ]
645
+ }
646
+ }
647
+ }
648
+ ```
649
+
650
+ ---
651
+
652
+ ## gRPC Service Design
653
+
654
+ ### Proto File Conventions
655
+
656
+ ```protobuf
657
+ syntax = "proto3";
658
+
659
+ package example.user.v1;
660
+
661
+ option go_package = "example.com/api/user/v1;userv1";
662
+ option java_package = "com.example.api.user.v1";
663
+
664
+ // UserService manages user accounts.
665
+ service UserService {
666
+ // GetUser returns a single user by ID.
667
+ rpc GetUser(GetUserRequest) returns (GetUserResponse);
668
+
669
+ // ListUsers returns a paginated list of users.
670
+ rpc ListUsers(ListUsersRequest) returns (ListUsersResponse);
671
+
672
+ // CreateUser creates a new user account.
673
+ rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
674
+
675
+ // UpdateUser updates an existing user.
676
+ rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse);
677
+
678
+ // DeleteUser removes a user account.
679
+ rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty);
680
+ }
681
+
682
+ message GetUserRequest {
683
+ string user_id = 1;
684
+ }
685
+
686
+ message GetUserResponse {
687
+ User user = 1;
688
+ }
689
+
690
+ message ListUsersRequest {
691
+ int32 page_size = 1;
692
+ string page_token = 2;
693
+ string filter = 3;
694
+ string order_by = 4;
695
+ }
696
+
697
+ message ListUsersResponse {
698
+ repeated User users = 1;
699
+ string next_page_token = 2;
700
+ int32 total_size = 3;
701
+ }
702
+
703
+ message User {
704
+ string user_id = 1;
705
+ string first_name = 2;
706
+ string last_name = 3;
707
+ string email = 4;
708
+ google.protobuf.Timestamp created_at = 5;
709
+ }
710
+ ```
711
+
712
+ ### Naming Conventions
713
+
714
+ | Element | Convention | Example |
715
+ |---------|-----------|---------|
716
+ | **Package** | `company.service.version` | `example.user.v1` |
717
+ | **Service** | PascalCase + `Service` | `UserService` |
718
+ | **RPC methods** | PascalCase verb + noun | `GetUser`, `ListUsers` |
719
+ | **Messages** | PascalCase | `GetUserRequest` |
720
+ | **Fields** | snake_case | `user_id`, `first_name` |
721
+ | **Enums** | PascalCase type, UPPER values | `Status`, `ACTIVE` |
722
+
723
+ ### gRPC Error Codes Mapping
724
+
725
+ | gRPC Code | HTTP Equivalent | Description |
726
+ |-----------|----------------|-------------|
727
+ | `OK` | 200 | Success |
728
+ | `INVALID_ARGUMENT` | 400 | Client specified invalid argument |
729
+ | `UNAUTHENTICATED` | 401 | Missing or invalid authentication |
730
+ | `PERMISSION_DENIED` | 403 | Insufficient permissions |
731
+ | `NOT_FOUND` | 404 | Resource not found |
732
+ | `ALREADY_EXISTS` | 409 | Resource already exists |
733
+ | `FAILED_PRECONDITION` | 412 | Operation rejected due to system state |
734
+ | `RESOURCE_EXHAUSTED` | 429 | Rate limit or quota exceeded |
735
+ | `INTERNAL` | 500 | Internal server error |
736
+ | `UNAVAILABLE` | 503 | Service unavailable |
737
+ | `DEADLINE_EXCEEDED` | 504 | Operation timed out |
738
+
739
+ ---
740
+
741
+ ## API Documentation Requirements
742
+
743
+ ### OpenAPI Specification Requirements
744
+
745
+ Every REST API MUST have an OpenAPI 3.x specification that includes:
746
+
747
+ | Section | Required | Description |
748
+ |---------|----------|-------------|
749
+ | `info` | Yes | Title, version, description, contact |
750
+ | `servers` | Yes | Base URLs for all environments |
751
+ | `paths` | Yes | All endpoints with operations |
752
+ | `components/schemas` | Yes | All request/response schemas |
753
+ | `components/securitySchemes` | Yes | Authentication methods |
754
+ | `security` | Yes | Default security requirements |
755
+ | `tags` | Recommended | Logical grouping of endpoints |
756
+
757
+ ### Documentation Checklist
758
+
759
+ - [ ] Every endpoint has a summary and description
760
+ - [ ] All parameters are documented with types, examples, and constraints
761
+ - [ ] Request body examples provided for POST/PUT/PATCH
762
+ - [ ] All possible response codes documented with examples
763
+ - [ ] Authentication requirements specified per endpoint
764
+ - [ ] Rate limiting documented
765
+ - [ ] Pagination parameters documented
766
+ - [ ] Error response format documented with examples
767
+
768
+ ### OpenAPI Example
769
+
770
+ ```yaml
771
+ openapi: 3.1.0
772
+ info:
773
+ title: User Management API
774
+ version: 1.0.0
775
+ description: API for managing user accounts
776
+ contact:
777
+ email: api-support@example.com
778
+
779
+ servers:
780
+ - url: https://api.example.com/v1
781
+ description: Production
782
+ - url: https://api.staging.example.com/v1
783
+ description: Staging
784
+
785
+ paths:
786
+ /users:
787
+ get:
788
+ summary: List all users
789
+ operationId: listUsers
790
+ tags: [Users]
791
+ parameters:
792
+ - name: page
793
+ in: query
794
+ schema:
795
+ type: integer
796
+ default: 1
797
+ - name: limit
798
+ in: query
799
+ schema:
800
+ type: integer
801
+ default: 20
802
+ maximum: 100
803
+ responses:
804
+ '200':
805
+ description: Successfully retrieved users
806
+ content:
807
+ application/json:
808
+ schema:
809
+ $ref: '#/components/schemas/UserListResponse'
810
+ '401':
811
+ $ref: '#/components/responses/Unauthorized'
812
+ '429':
813
+ $ref: '#/components/responses/RateLimited'
814
+ ```
815
+
816
+ ---
817
+
818
+ ## Security Considerations
819
+
820
+ ### Transport Security
821
+
822
+ | Requirement | Standard |
823
+ |-------------|----------|
824
+ | **HTTPS** | Mandatory for all API endpoints |
825
+ | **TLS Version** | TLS 1.2 minimum, TLS 1.3 preferred |
826
+ | **HSTS** | Include `Strict-Transport-Security` header |
827
+ | **Certificate** | Valid, not self-signed in production |
828
+
829
+ ### CORS Configuration
830
+
831
+ ```http
832
+ Access-Control-Allow-Origin: https://app.example.com
833
+ Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
834
+ Access-Control-Allow-Headers: Content-Type, Authorization, X-Request-ID
835
+ Access-Control-Max-Age: 86400
836
+ Access-Control-Allow-Credentials: true
837
+ ```
838
+
839
+ | Rule | Requirement |
840
+ |------|-------------|
841
+ | **Never use wildcard (`*`)** with credentials | Specify exact origins |
842
+ | **Limit methods** | Only allow needed HTTP methods |
843
+ | **Limit headers** | Only allow needed custom headers |
844
+ | **Pre-flight caching** | Set `Max-Age` to reduce OPTIONS requests |
845
+
846
+ ### Input Validation
847
+
848
+ | Rule | Implementation |
849
+ |------|----------------|
850
+ | **Validate all input** | Server-side validation for all parameters |
851
+ | **Use allowlists** | Validate against known-good patterns |
852
+ | **Limit request size** | Set `Content-Length` limits (e.g., 1 MB) |
853
+ | **Sanitize output** | Prevent injection in responses |
854
+ | **Parameterized queries** | Never concatenate user input into queries |
855
+
856
+ ### Security Headers for APIs
857
+
858
+ ```http
859
+ X-Content-Type-Options: nosniff
860
+ X-Frame-Options: DENY
861
+ Cache-Control: no-store
862
+ Content-Security-Policy: default-src 'none'
863
+ ```
864
+
865
+ ---
866
+
867
+ ## Quick Reference Card
868
+
869
+ ### URL Pattern
870
+
871
+ ```
872
+ [VERB] https://api.{domain}/v{N}/{resources}/{id}/{sub-resources}/{id}
873
+ ```
874
+
875
+ ### Response Structure
876
+
877
+ ```
878
+ Success → { data, meta, links }
879
+ Error → { type, title, status, detail, errors, traceId }
880
+ ```
881
+
882
+ ### Essential Headers
883
+
884
+ | Direction | Header | Value |
885
+ |-----------|--------|-------|
886
+ | Request | `Content-Type` | `application/json` |
887
+ | Request | `Accept` | `application/json` |
888
+ | Request | `Authorization` | `Bearer {token}` |
889
+ | Response | `X-RateLimit-Limit` | `1000` |
890
+ | Response | `X-RateLimit-Remaining` | `994` |
891
+ | Response | `X-Request-ID` | `req-abc-123` |
892
+
893
+ ### HTTP Verb Cheat Sheet
894
+
895
+ | Action | Verb | URL | Status |
896
+ |--------|------|-----|--------|
897
+ | List | GET | `/users` | 200 |
898
+ | Read | GET | `/users/123` | 200 |
899
+ | Create | POST | `/users` | 201 |
900
+ | Full Update | PUT | `/users/123` | 200 |
901
+ | Partial Update | PATCH | `/users/123` | 200 |
902
+ | Delete | DELETE | `/users/123` | 204 |
903
+
904
+ ---
905
+
906
+ ## Related Standards
907
+
908
+ - [Error Code Standards](error-code-standards.md) - Error code conventions and catalogs
909
+ - [Security Standards](security-standards.md) - Authentication, authorization, and security practices
910
+ - [Logging Standards](logging-standards.md) - API request/response logging
911
+ - [Testing Standards](testing-standards.md) - API testing strategies
912
+ - [Documentation Writing Standards](documentation-writing-standards.md) - Writing API documentation
913
+
914
+ ---
915
+
916
+ ## Version History
917
+
918
+ | Version | Date | Changes |
919
+ |---------|------|---------|
920
+ | 1.0.0 | 2026-03-18 | Initial release |
921
+
922
+ ---
923
+
924
+ ## References
925
+
926
+ - [OpenAPI Specification](https://www.openapis.org/)
927
+ - [JSON:API Specification](https://jsonapi.org/)
928
+ - [Google API Design Guide](https://cloud.google.com/apis/design)
929
+ - [RFC 7231 — HTTP/1.1 Semantics and Content](https://datatracker.ietf.org/doc/html/rfc7231)
930
+ - [RFC 7807 — Problem Details for HTTP APIs](https://datatracker.ietf.org/doc/html/rfc7807)
931
+ - [Microsoft REST API Guidelines](https://github.com/microsoft/api-guidelines)
932
+ - [Zalando RESTful API Guidelines](https://opensource.zalando.com/restful-api-guidelines/)
933
+
934
+ ---
935
+
936
+ ## License
937
+
938
+ This standard is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).