claude-code-superkit 0.0.0-stage → 1.5.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 (353) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +374 -2
  3. package/bin/cli.js +153 -0
  4. package/bin/inject-tokens.js +224 -0
  5. package/bin/measure-tokens.js +17 -0
  6. package/bin/superkit-counts-verify.sh +30 -0
  7. package/lib/codex.js +246 -0
  8. package/lib/docs-scaffold.js +147 -0
  9. package/lib/installer.js +499 -0
  10. package/lib/prompts.js +51 -0
  11. package/lib/settings-builder.js +51 -0
  12. package/lib/superpowers.js +99 -0
  13. package/lib/utils.js +117 -0
  14. package/lib/validator.js +84 -0
  15. package/package.json +49 -4
  16. package/packages/codex/AGENTS.md +396 -0
  17. package/packages/codex/INSTALL.md +342 -0
  18. package/packages/codex/config.toml +22 -0
  19. package/packages/codex/hooks/superkit.mjs +203 -0
  20. package/packages/codex/hooks.json +30 -0
  21. package/packages/codex/legacy-baseline.json +88 -0
  22. package/packages/codex/native-skills.txt +65 -0
  23. package/packages/codex/rules/default.rules +565 -0
  24. package/packages/codex/skills/ai-slop-cleaner/SKILL.md +44 -0
  25. package/packages/codex/skills/api-contract-sync/SKILL.md +96 -0
  26. package/packages/codex/skills/architect/SKILL.md +49 -0
  27. package/packages/codex/skills/audit-backend/SKILL.md +80 -0
  28. package/packages/codex/skills/audit-frontend/SKILL.md +82 -0
  29. package/packages/codex/skills/audit-infra/SKILL.md +87 -0
  30. package/packages/codex/skills/audit-orchestrator/SKILL.md +114 -0
  31. package/packages/codex/skills/behavioral-nudge-engine/SKILL.md +110 -0
  32. package/packages/codex/skills/benchmark/SKILL.md +49 -0
  33. package/packages/codex/skills/bot-reviewer/SKILL.md +94 -0
  34. package/packages/codex/skills/code-reviewer/SKILL.md +67 -0
  35. package/packages/codex/skills/codebase-onboarding-engineer/SKILL.md +46 -0
  36. package/packages/codex/skills/comment-rot-analyzer/SKILL.md +75 -0
  37. package/packages/codex/skills/commit-helper/SKILL.md +101 -0
  38. package/packages/codex/skills/critic/SKILL.md +56 -0
  39. package/packages/codex/skills/database-reviewer/SKILL.md +79 -0
  40. package/packages/codex/skills/debug-observer/SKILL.md +107 -0
  41. package/packages/codex/skills/dependency-checker/SKILL.md +69 -0
  42. package/packages/codex/skills/design-system-reviewer/SKILL.md +121 -0
  43. package/packages/codex/skills/dev-orchestrator/SKILL.md +304 -0
  44. package/packages/codex/skills/docs-reviewer/SKILL.md +86 -0
  45. package/packages/codex/skills/drizzle-orm-expert/SKILL.md +246 -0
  46. package/packages/codex/skills/e2e-test-generator/SKILL.md +95 -0
  47. package/packages/codex/skills/evaluator/SKILL.md +63 -0
  48. package/packages/codex/skills/frontend-perf-reviewer/SKILL.md +95 -0
  49. package/packages/codex/skills/frontend-ui-color-reviewer/SKILL.md +68 -0
  50. package/packages/codex/skills/frontend-ui-design-critic/SKILL.md +99 -0
  51. package/packages/codex/skills/frontend-ui-interaction-reviewer/SKILL.md +102 -0
  52. package/packages/codex/skills/frontend-ui-motion-reviewer/SKILL.md +85 -0
  53. package/packages/codex/skills/frontend-ui-reviewer/SKILL.md +81 -0
  54. package/packages/codex/skills/frontend-ui-typography-reviewer/SKILL.md +62 -0
  55. package/packages/codex/skills/gltf-debugging/SKILL.md +128 -0
  56. package/packages/codex/skills/go-benchmark/SKILL.md +217 -0
  57. package/packages/codex/skills/go-concurrency-reviewer/SKILL.md +113 -0
  58. package/packages/codex/skills/go-error-reviewer/SKILL.md +107 -0
  59. package/packages/codex/skills/go-grpc-patterns/SKILL.md +285 -0
  60. package/packages/codex/skills/go-modernizer/SKILL.md +111 -0
  61. package/packages/codex/skills/go-observability-reviewer/SKILL.md +121 -0
  62. package/packages/codex/skills/go-performance-reviewer/SKILL.md +112 -0
  63. package/packages/codex/skills/go-reviewer/SKILL.md +109 -0
  64. package/packages/codex/skills/go-samber-do/SKILL.md +158 -0
  65. package/packages/codex/skills/go-samber-lo/SKILL.md +178 -0
  66. package/packages/codex/skills/go-samber-oops/SKILL.md +174 -0
  67. package/packages/codex/skills/goal-verifier/SKILL.md +53 -0
  68. package/packages/codex/skills/health-checker/SKILL.md +109 -0
  69. package/packages/codex/skills/html-to-3d-texture/SKILL.md +153 -0
  70. package/packages/codex/skills/impeccable-craft/SKILL.md +101 -0
  71. package/packages/codex/skills/lint-runner/SKILL.md +85 -0
  72. package/packages/codex/skills/migrate/SKILL.md +60 -0
  73. package/packages/codex/skills/migration-reviewer/SKILL.md +88 -0
  74. package/packages/codex/skills/minimal-change-engineer/SKILL.md +44 -0
  75. package/packages/codex/skills/new-migration/SKILL.md +59 -0
  76. package/packages/codex/skills/nextjs-supabase-auth/SKILL.md +227 -0
  77. package/packages/codex/skills/output-enforcement/SKILL.md +71 -0
  78. package/packages/codex/skills/plan-checker/SKILL.md +53 -0
  79. package/packages/codex/skills/postgresql-optimization/SKILL.md +159 -0
  80. package/packages/codex/skills/pre-deploy-validator/SKILL.md +111 -0
  81. package/packages/codex/skills/presentation-reviewer/SKILL.md +88 -0
  82. package/packages/codex/skills/product-3d-lighting/SKILL.md +137 -0
  83. package/packages/codex/skills/project-architecture/SKILL.md +52 -0
  84. package/packages/codex/skills/py-reviewer/SKILL.md +100 -0
  85. package/packages/codex/skills/r3f-scene-reviewer/SKILL.md +88 -0
  86. package/packages/codex/skills/r3f-scroll-driven-3d/SKILL.md +162 -0
  87. package/packages/codex/skills/reality-checker/SKILL.md +61 -0
  88. package/packages/codex/skills/redis-patterns/SKILL.md +260 -0
  89. package/packages/codex/skills/review-orchestrator/SKILL.md +151 -0
  90. package/packages/codex/skills/rs-reviewer/SKILL.md +98 -0
  91. package/packages/codex/skills/ru-text/SKILL.md +132 -0
  92. package/packages/codex/skills/scaffold-endpoint/SKILL.md +44 -0
  93. package/packages/codex/skills/security-scanner/SKILL.md +94 -0
  94. package/packages/codex/skills/silent-failure-hunter/SKILL.md +176 -0
  95. package/packages/codex/skills/telegram-bot-builder/SKILL.md +120 -0
  96. package/packages/codex/skills/test-generator/SKILL.md +79 -0
  97. package/packages/codex/skills/test-runner/SKILL.md +101 -0
  98. package/packages/codex/skills/threejs-color-management/SKILL.md +97 -0
  99. package/packages/codex/skills/tree-generator/SKILL.md +63 -0
  100. package/packages/codex/skills/ts-reviewer/SKILL.md +90 -0
  101. package/packages/codex/skills/ui-design-reviewer/SKILL.md +89 -0
  102. package/packages/codex/skills/ui-reviewer/SKILL.md +103 -0
  103. package/packages/codex/skills/visual-reviewer/SKILL.md +85 -0
  104. package/packages/codex/skills/writing-agents/SKILL.md +165 -0
  105. package/packages/codex/skills/writing-commands/SKILL.md +173 -0
  106. package/packages/core/CLAUDE.md +118 -0
  107. package/packages/core/INTERNAL-FILES +16 -0
  108. package/packages/core/agents/ai-slop-cleaner.md +187 -0
  109. package/packages/core/agents/api-contract-sync.md +127 -0
  110. package/packages/core/agents/architect.md +205 -0
  111. package/packages/core/agents/audit-backend.md +137 -0
  112. package/packages/core/agents/audit-frontend.md +129 -0
  113. package/packages/core/agents/audit-infra.md +182 -0
  114. package/packages/core/agents/behavioral-nudge-engine.md +170 -0
  115. package/packages/core/agents/code-reviewer.md +195 -0
  116. package/packages/core/agents/codebase-onboarding-engineer.md +172 -0
  117. package/packages/core/agents/comment-rot-analyzer.md +115 -0
  118. package/packages/core/agents/critic.md +172 -0
  119. package/packages/core/agents/database-reviewer.md +201 -0
  120. package/packages/core/agents/debug-observer.md +261 -0
  121. package/packages/core/agents/dependency-checker.md +199 -0
  122. package/packages/core/agents/docs-reviewer.md +206 -0
  123. package/packages/core/agents/e2e-test-generator.md +261 -0
  124. package/packages/core/agents/evaluator.md +141 -0
  125. package/packages/core/agents/goal-verifier.md +130 -0
  126. package/packages/core/agents/health-checker.md +194 -0
  127. package/packages/core/agents/migration-reviewer.md +161 -0
  128. package/packages/core/agents/minimal-change-engineer.md +219 -0
  129. package/packages/core/agents/plan-checker.md +139 -0
  130. package/packages/core/agents/pre-deploy-validator.md +189 -0
  131. package/packages/core/agents/reality-checker.md +175 -0
  132. package/packages/core/agents/scaffold-endpoint.md +162 -0
  133. package/packages/core/agents/security-scanner.md +236 -0
  134. package/packages/core/agents/silent-failure-hunter.md +276 -0
  135. package/packages/core/agents/test-generator.md +146 -0
  136. package/packages/core/agents/tree-generator.md +141 -0
  137. package/packages/core/agents/ui-reviewer.md +172 -0
  138. package/packages/core/agents/visual-reviewer.md +211 -0
  139. package/packages/core/commands/audit.md +166 -0
  140. package/packages/core/commands/benchmark.md +130 -0
  141. package/packages/core/commands/commit.md +148 -0
  142. package/packages/core/commands/dev.md +302 -0
  143. package/packages/core/commands/docs-init.md +75 -0
  144. package/packages/core/commands/lint.md +137 -0
  145. package/packages/core/commands/migrate.md +146 -0
  146. package/packages/core/commands/new-migration.md +182 -0
  147. package/packages/core/commands/pair.md +209 -0
  148. package/packages/core/commands/review.md +195 -0
  149. package/packages/core/commands/security-scan.md +142 -0
  150. package/packages/core/commands/superkit-evolve.md +231 -0
  151. package/packages/core/commands/superkit-init.md +274 -0
  152. package/packages/core/commands/test.md +108 -0
  153. package/packages/core/commands/workflow.md +150 -0
  154. package/packages/core/docs/guide/01-getting-started.md +41 -0
  155. package/packages/core/docs-templates/README.md +33 -0
  156. package/packages/core/docs-templates/adr-template.md +62 -0
  157. package/packages/core/docs-templates/architecture/api-contracts.md +26 -0
  158. package/packages/core/docs-templates/architecture/api-reference.md +48 -0
  159. package/packages/core/docs-templates/architecture/auth-and-sessions.md +38 -0
  160. package/packages/core/docs-templates/architecture/backend-layers.md +42 -0
  161. package/packages/core/docs-templates/architecture/data-flow.md +26 -0
  162. package/packages/core/docs-templates/architecture/database-schema.md +51 -0
  163. package/packages/core/docs-templates/architecture/deployment.md +41 -0
  164. package/packages/core/docs-templates/architecture/frontend-state.md +46 -0
  165. package/packages/core/helpers/statusline.cjs +370 -0
  166. package/packages/core/hooks/CHAIN-SEMANTICS.md +84 -0
  167. package/packages/core/hooks/audit-settings-source.sh +98 -0
  168. package/packages/core/hooks/audit-trail.sh +120 -0
  169. package/packages/core/hooks/block-dangerous-git.sh +189 -0
  170. package/packages/core/hooks/bundle-import-check.sh +64 -0
  171. package/packages/core/hooks/compact-state-inject.sh +84 -0
  172. package/packages/core/hooks/config-protection.sh +68 -0
  173. package/packages/core/hooks/console-log-warning.sh +28 -0
  174. package/packages/core/hooks/context-monitor.sh +35 -0
  175. package/packages/core/hooks/dev-edit-counter.sh +59 -0
  176. package/packages/core/hooks/dev-marker-set.sh +55 -0
  177. package/packages/core/hooks/dev-required-on-commit.sh +426 -0
  178. package/packages/core/hooks/doc-check-on-commit.sh +396 -0
  179. package/packages/core/hooks/edit-streak-check.sh +63 -0
  180. package/packages/core/hooks/evolve-check.sh +78 -0
  181. package/packages/core/hooks/gateguard-pre-edit.sh +154 -0
  182. package/packages/core/hooks/gateguard-record-facts.sh +37 -0
  183. package/packages/core/hooks/intake-classifier.py +449 -0
  184. package/packages/core/hooks/lib/profile.sh +141 -0
  185. package/packages/core/hooks/loop-guard.sh +75 -0
  186. package/packages/core/hooks/migration-safety.sh +56 -0
  187. package/packages/core/hooks/plan-completion-gate.sh +61 -0
  188. package/packages/core/hooks/pre-compact-save.sh +89 -0
  189. package/packages/core/hooks/security-patterns.sh +119 -0
  190. package/packages/core/hooks/session-context-restore.sh +76 -0
  191. package/packages/core/hooks/subagent-stop-validate.sh +73 -0
  192. package/packages/core/hooks/superkit-counts-verify.sh +346 -0
  193. package/packages/core/hooks/superkit-update.sh +367 -0
  194. package/packages/core/hooks/tests/README.md +42 -0
  195. package/packages/core/hooks/tests/audit-trail-chain_test.sh +62 -0
  196. package/packages/core/hooks/tests/block-dangerous-git_test.sh +144 -0
  197. package/packages/core/hooks/tests/chain-semantics/h1.sh +11 -0
  198. package/packages/core/hooks/tests/chain-semantics/h2.sh +9 -0
  199. package/packages/core/hooks/tests/chain-semantics/h3.sh +11 -0
  200. package/packages/core/hooks/tests/chain-semantics/run-experiment.sh +65 -0
  201. package/packages/core/hooks/tests/chain-semantics/settings-experiment.json +15 -0
  202. package/packages/core/hooks/tests/counts-verify_test.sh +118 -0
  203. package/packages/core/hooks/tests/dev-required-on-commit_test.sh +207 -0
  204. package/packages/core/hooks/tests/dev-required-wip-on-main_test.sh +20 -0
  205. package/packages/core/hooks/tests/doc-check-on-commit_test.sh +122 -0
  206. package/packages/core/hooks/tests/edit-streak-check_test.sh +106 -0
  207. package/packages/core/hooks/tests/internal-manifest_test.sh +130 -0
  208. package/packages/core/hooks/tests/json-path_test.sh +108 -0
  209. package/packages/core/hooks/tests/mirror-invariants_test.sh +139 -0
  210. package/packages/core/hooks/tests/nudge-throttle_test.sh +95 -0
  211. package/packages/core/hooks/tests/profile-helper_test.sh +21 -0
  212. package/packages/core/hooks/tests/run-all.sh +47 -0
  213. package/packages/core/hooks/tests/session-key-helper_test.sh +17 -0
  214. package/packages/core/hooks/tests/superkit-update_test.sh +311 -0
  215. package/packages/core/hooks/tests/warn-visibility_test.sh +59 -0
  216. package/packages/core/hooks/user-intent-detect.sh +44 -0
  217. package/packages/core/hooks/verify-hooks.sh +69 -0
  218. package/packages/core/rules/auto-commands.md +124 -0
  219. package/packages/core/rules/coding-style.md +68 -0
  220. package/packages/core/rules/dev-workflow.md +77 -0
  221. package/packages/core/rules/documentation.md +106 -0
  222. package/packages/core/rules/frontend-aesthetics.md +53 -0
  223. package/packages/core/rules/git-workflow.md +14 -0
  224. package/packages/core/rules/security.md +29 -0
  225. package/packages/core/rules/superkit-integrity.md +114 -0
  226. package/packages/core/settings.json +229 -0
  227. package/packages/core/skills/drizzle-orm-expert/SKILL.md +260 -0
  228. package/packages/core/skills/nextjs-supabase-auth/SKILL.md +259 -0
  229. package/packages/core/skills/postgresql-optimization/SKILL.md +150 -0
  230. package/packages/core/skills/project-architecture/SKILL.md +31 -0
  231. package/packages/core/skills/project-scanner/SKILL.md +132 -0
  232. package/packages/core/skills/redis-patterns/SKILL.md +261 -0
  233. package/packages/core/skills/ru-text/SKILL.md +156 -0
  234. package/packages/core/skills/telegram-bot-builder/SKILL.md +145 -0
  235. package/packages/core/skills/writing-agents/SKILL.md +220 -0
  236. package/packages/core/skills/writing-commands/SKILL.md +176 -0
  237. package/packages/core/skills/writing-hooks/SKILL.md +335 -0
  238. package/packages/extras/bot-reviewer.md +279 -0
  239. package/packages/extras/design-system-reviewer.md +234 -0
  240. package/packages/extras/red-blue-auditor/README.md +117 -0
  241. package/packages/extras/red-blue-auditor/agent.md +128 -0
  242. package/packages/extras/red-blue-auditor/patterns/agent-config.txt +4 -0
  243. package/packages/extras/red-blue-auditor/patterns/hook-injection.txt +8 -0
  244. package/packages/extras/red-blue-auditor/patterns/mcp-risk.txt +5 -0
  245. package/packages/extras/red-blue-auditor/patterns/permission-abuse.txt +6 -0
  246. package/packages/extras/red-blue-auditor/patterns/secrets.txt +17 -0
  247. package/packages/extras/red-blue-auditor/scan.sh +88 -0
  248. package/packages/extras/skillsmp-search/SKILL.md +134 -0
  249. package/packages/frontend-3d/README.md +62 -0
  250. package/packages/frontend-3d/agents/frontend-perf-reviewer.md +164 -0
  251. package/packages/frontend-3d/agents/presentation-reviewer.md +146 -0
  252. package/packages/frontend-3d/agents/r3f-scene-reviewer.md +128 -0
  253. package/packages/frontend-3d/agents/ui-design-reviewer.md +169 -0
  254. package/packages/frontend-3d/commands/capture-screen.md +166 -0
  255. package/packages/frontend-3d/hooks/bundle-size-warn.sh +93 -0
  256. package/packages/frontend-3d/hooks/gsap-pattern-check.sh +74 -0
  257. package/packages/frontend-3d/hooks/r3f-color-check.sh +76 -0
  258. package/packages/frontend-3d/hooks/tailwind-version-guard.sh +98 -0
  259. package/packages/frontend-3d/rules/frontend-aesthetics-3d.md +81 -0
  260. package/packages/frontend-3d/rules/gsap-conventions.md +129 -0
  261. package/packages/frontend-3d/rules/threejs-conventions.md +116 -0
  262. package/packages/frontend-3d/skills/gltf-debugging/SKILL.md +145 -0
  263. package/packages/frontend-3d/skills/html-to-3d-texture/SKILL.md +183 -0
  264. package/packages/frontend-3d/skills/output-enforcement/SKILL.md +79 -0
  265. package/packages/frontend-3d/skills/product-3d-lighting/SKILL.md +166 -0
  266. package/packages/frontend-3d/skills/r3f-scroll-driven-3d/SKILL.md +209 -0
  267. package/packages/frontend-3d/skills/threejs-color-management/SKILL.md +111 -0
  268. package/packages/frontend-ui/NOTICE.md +99 -0
  269. package/packages/frontend-ui/README.md +59 -0
  270. package/packages/frontend-ui/agents/ui-color-reviewer.md +174 -0
  271. package/packages/frontend-ui/agents/ui-design-critic.md +198 -0
  272. package/packages/frontend-ui/agents/ui-interaction-reviewer.md +259 -0
  273. package/packages/frontend-ui/agents/ui-motion-reviewer.md +266 -0
  274. package/packages/frontend-ui/agents/ui-reviewer.md +251 -0
  275. package/packages/frontend-ui/agents/ui-typography-reviewer.md +222 -0
  276. package/packages/frontend-ui/hooks/tests/ui-animation-easing-check_test.sh +78 -0
  277. package/packages/frontend-ui/hooks/tests/ui-banned-fonts-check_test.sh +77 -0
  278. package/packages/frontend-ui/hooks/tests/ui-color-check_test.sh +75 -0
  279. package/packages/frontend-ui/hooks/ui-animation-easing-check.sh +86 -0
  280. package/packages/frontend-ui/hooks/ui-banned-fonts-check.sh +90 -0
  281. package/packages/frontend-ui/hooks/ui-color-check.sh +102 -0
  282. package/packages/frontend-ui/rules/color-and-contrast.md +230 -0
  283. package/packages/frontend-ui/rules/frontend-design-aesthetics.md +124 -0
  284. package/packages/frontend-ui/rules/interaction-polish.md +335 -0
  285. package/packages/frontend-ui/rules/motion-and-animation.md +283 -0
  286. package/packages/frontend-ui/rules/spatial-and-layout.md +212 -0
  287. package/packages/frontend-ui/rules/typography-guidelines.md +185 -0
  288. package/packages/frontend-ui/rules/ui-anti-patterns.md +309 -0
  289. package/packages/frontend-ui/settings.json +24 -0
  290. package/packages/frontend-ui/skills/impeccable-craft/SKILL.md +187 -0
  291. package/packages/gan/README.md +232 -0
  292. package/packages/gan/agents/gan-evaluator.md +214 -0
  293. package/packages/gan/agents/gan-generator.md +171 -0
  294. package/packages/gan/agents/gan-planner.md +206 -0
  295. package/packages/gan/rubrics/functionality.md +66 -0
  296. package/packages/gan/rubrics/ui-quality.md +77 -0
  297. package/packages/gan/skills/gan-evaluator/SKILL.md +91 -0
  298. package/packages/gan/skills/gan-generator/SKILL.md +72 -0
  299. package/packages/gan/skills/gan-planner/SKILL.md +93 -0
  300. package/packages/stack-agents/go/go-concurrency-reviewer.md +210 -0
  301. package/packages/stack-agents/go/go-error-reviewer.md +187 -0
  302. package/packages/stack-agents/go/go-modernizer.md +160 -0
  303. package/packages/stack-agents/go/go-observability-reviewer.md +185 -0
  304. package/packages/stack-agents/go/go-performance-reviewer.md +160 -0
  305. package/packages/stack-agents/go/go-reviewer.md +277 -0
  306. package/packages/stack-agents/go/references/benchmark-methodology.md +280 -0
  307. package/packages/stack-agents/go/references/channel-patterns.md +384 -0
  308. package/packages/stack-agents/go/references/cli-cobra-viper.md +190 -0
  309. package/packages/stack-agents/go/references/code-style.md +262 -0
  310. package/packages/stack-agents/go/references/context-propagation.md +317 -0
  311. package/packages/stack-agents/go/references/data-structures.md +315 -0
  312. package/packages/stack-agents/go/references/database-patterns.md +334 -0
  313. package/packages/stack-agents/go/references/design-patterns.md +411 -0
  314. package/packages/stack-agents/go/references/di-frameworks.md +146 -0
  315. package/packages/stack-agents/go/references/error-creation.md +251 -0
  316. package/packages/stack-agents/go/references/error-inspection.md +348 -0
  317. package/packages/stack-agents/go/references/error-wrapping.md +230 -0
  318. package/packages/stack-agents/go/references/gopls-driving.md +62 -0
  319. package/packages/stack-agents/go/references/goroutine-lifecycle.md +351 -0
  320. package/packages/stack-agents/go/references/graphql-patterns.md +221 -0
  321. package/packages/stack-agents/go/references/grpc-patterns.md +373 -0
  322. package/packages/stack-agents/go/references/modernize-guide.md +522 -0
  323. package/packages/stack-agents/go/references/module-management.md +191 -0
  324. package/packages/stack-agents/go/references/naming-conventions.md +176 -0
  325. package/packages/stack-agents/go/references/observability-pipeline.md +352 -0
  326. package/packages/stack-agents/go/references/performance-profiling.md +250 -0
  327. package/packages/stack-agents/go/references/refactoring-mechanics.md +127 -0
  328. package/packages/stack-agents/go/references/rest-openapi-patterns.md +160 -0
  329. package/packages/stack-agents/go/references/samber-do.md +201 -0
  330. package/packages/stack-agents/go/references/samber-libraries.md +363 -0
  331. package/packages/stack-agents/go/references/samber-lo.md +260 -0
  332. package/packages/stack-agents/go/references/samber-oops.md +200 -0
  333. package/packages/stack-agents/go/references/security-checklist.md +441 -0
  334. package/packages/stack-agents/go/references/standard-stdlib-now.md +181 -0
  335. package/packages/stack-agents/go/references/stay-updated.md +147 -0
  336. package/packages/stack-agents/go/references/structs-interfaces.md +312 -0
  337. package/packages/stack-agents/go/references/sync-primitives.md +395 -0
  338. package/packages/stack-agents/go/references/testing-patterns.md +483 -0
  339. package/packages/stack-agents/go/references/troubleshooting.md +98 -0
  340. package/packages/stack-agents/python/py-reviewer.md +194 -0
  341. package/packages/stack-agents/rust/rs-reviewer.md +188 -0
  342. package/packages/stack-agents/typescript/ts-reviewer.md +135 -0
  343. package/packages/stack-hooks/go/go-context-check-on-edit.sh +56 -0
  344. package/packages/stack-hooks/go/go-error-check-on-edit.sh +54 -0
  345. package/packages/stack-hooks/go/go-format-on-edit.sh +32 -0
  346. package/packages/stack-hooks/go/go-safety-check-on-edit.sh +54 -0
  347. package/packages/stack-hooks/go/go-vet-on-edit.sh +61 -0
  348. package/packages/stack-hooks/go/golangci-lint-on-edit.sh +54 -0
  349. package/packages/stack-hooks/python/ruff-on-edit.sh +67 -0
  350. package/packages/stack-hooks/rust/cargo-check-on-edit.sh +64 -0
  351. package/packages/stack-hooks/typescript/typecheck-on-edit.sh +76 -0
  352. package/packages/stack-rules/go/go-conventions.md +44 -0
  353. package/packages/stack-rules/go/go-safety.md +35 -0
@@ -0,0 +1,304 @@
1
+ ---
2
+ name: dev-orchestrator
3
+ description: Coordinate development through 16 phases (0-15) across planning, implementation, verification, and review gates when a task needs multiple dependent steps or consequential decisions.
4
+ user-invocable: true
5
+ tokens: 5197
6
+ ---
7
+
8
+ # Development Orchestrator
9
+
10
+ Run the development cycle for the user's request as 16 numbered phases (0-15). Read each referenced skill and preserve its authority and verdict contract. Use available, authorized delegation with explicit model/effort and scoped clean-context packets following project routing; otherwise execute suitable roles inline and disclose self-review. Do not waive a required independent or Astra acceptance gate when that capability is unavailable.
11
+
12
+ ## Task
13
+
14
+ Parse the user's request to determine scope and parameters.
15
+
16
+ ## Codex Runtime and Skill Resolution
17
+
18
+ Read the applicable `AGENTS.md` instructions and discover the current runtime's file, command, planning, and delegation capabilities before using them. Resolve each named role to an existing `SKILL.md` from the session's skill catalog or the project's `.agents/skills/<name>/SKILL.md` / `.codex/skills/<name>/SKILL.md`; these may be aliases of the same installation. Read that role directly and give delegated workers its resolved path, scoped task, authority, and evidence. A role name is not a registered agent type. Do not invoke a global skill loader or recursively restart this orchestrator to reach a role. The standalone install does not require a `.claude` tree, plugins, or documentation templates. Missing required expertise or tools remain explicit blockers; suitable inline passes are self-review, not independent acceptance.
19
+
20
+ ## Hard Rules
21
+
22
+ 1. Execute phases in order 0 -> 15. Skip a phase ONLY when the Skip Matrix says so for the task's declared complexity class.
23
+ 2. A phase is complete only when its **Done when** condition holds. If a phase produces errors, fix them before advancing.
24
+ 3. Consume gate verdicts exactly as produced: plan-checker -> PASS/REVISE/BLOCK; evaluator -> PROCEED/ITERATE/ESCALATE; goal-verifier -> PASS/NEEDS-ATTENTION/NEEDS-REMEDIATION; critic -> APPROVE/CONCERN/BLOCK.
25
+ 4. Gate roles review only. The coordinator assigns separately authorized implementation work for corrections. Reuse evidence bound to unchanged relevant code, inputs, environment, and command/results; rerun for relevant changes or concrete uncertainty. On retry, state what changed; a missing tool or evidence is not an observed defect.
26
+ 5. Never claim completion while mandatory criteria fail or remain unverified. Issue an incomplete checkpoint whenever blocked; the completion report requires every non-skipped phase to pass. Retry exhaustion is not acceptance.
27
+ 6. If the task is ambiguous, ask the user before Phase 7 (Implement) -- not after.
28
+ 7. Always read existing patterns before writing new code -- search first, reuse the closest implementation as reference.
29
+
30
+ ## Phase Overview & Skip Matrix
31
+
32
+ Complexity (Simple / Standard / Complex) is decided in Phase 1 by risk and dependencies. Reassess it if new evidence changes the scope or risk; do not skip a required gate to preserve the original classification.
33
+
34
+ | # | Phase | Simple | Standard | Complex | Gate skill |
35
+ |---|-------|:------:|:--------:|:-------:|-----------|
36
+ | 0 | Read Docs | yes | yes | yes | - |
37
+ | 1 | Understand | yes | yes | yes | - |
38
+ | 2 | Architect | - | - | yes | architect |
39
+ | 3 | Pseudocode | - | - | yes | - |
40
+ | 4 | Plan | yes | yes | yes | - |
41
+ | 5 | Contract | - | yes | yes | - |
42
+ | 6 | Validate Plan | - | yes | yes | plan-checker |
43
+ | 7 | Implement | yes | yes | yes | - |
44
+ | 8 | Evaluate | - | yes (max 2 passes) | yes (max 3 passes) | evaluator |
45
+ | 9 | Verify | yes | yes | yes | health-checker |
46
+ | 10 | Test | yes | yes | yes | test-generator |
47
+ | 11 | Verify Goals | - | yes | yes | goal-verifier |
48
+ | 12 | Review | yes | yes | yes | reviewer skills |
49
+ | 13 | Critic | - | - | yes | critic |
50
+ | 14 | Document | yes | yes | yes | docs-reviewer |
51
+ | 15 | Report | yes | yes | yes | - |
52
+
53
+ Simple skips phases 2, 3, 5, 6, 8, 11, 13. Standard skips 2, 3, 13. Complex runs all 16.
54
+
55
+ ## Phase 0 -- Read Docs
56
+
57
+ Read `docs/architecture/` files relevant to the task scope:
58
+ - Backend task -> `backend-layers.md`, `api-reference.md`, `database-schema.md`
59
+ - Frontend task -> `frontend-state.md`
60
+ - Auth task -> `auth-and-sessions.md`
61
+ - Full-stack -> relevant cross-component contracts and architecture docs
62
+
63
+ Missing docs are not an error -- note what was absent and continue.
64
+ **Done when:** relevant existing docs are read (or confirmed absent).
65
+
66
+ ## Phase 1 -- Understand
67
+
68
+ 1. **Detect the stack** by scanning the repository root and subdirectories:
69
+
70
+ | Marker file | Stack |
71
+ |---|---|
72
+ | `go.mod` | Go backend |
73
+ | `package.json` + `tsconfig.json` | TypeScript (check for React, Vue, Svelte, etc.) |
74
+ | `pyproject.toml` / `setup.py` / `requirements.txt` | Python |
75
+ | `Cargo.toml` | Rust |
76
+ | `pom.xml` / `build.gradle` | Java/Kotlin |
77
+ | `docker-compose.yml` | Docker infrastructure |
78
+ | `migrations/` or `db/migrate/` | Database migrations |
79
+
80
+ 2. **Parse the task**: affected components (backend, frontend, infra, bots, docs); feature / enhancement / bug fix / refactor; inputs and expected outputs.
81
+
82
+ 3. **Assess complexity** by consequences, coupling, and uncertainty. Simple means a narrow low-risk change following a proven pattern. Standard needs coordinated implementation and behavioral acceptance. Complex includes consequential architecture, security/authority, data-loss or irreversible changes, or unresolved design risk. File and line counts may inform effort, but cannot reduce risk or waive a mandatory gate.
83
+
84
+ 4. **Search the codebase** for existing related patterns: grep domain terms, endpoint paths, function names; read files that will be modified; check routing files and API specs (OpenAPI, GraphQL schema).
85
+
86
+ 5. **Identify the closest existing implementation** and read it -- it is the reference pattern for Phase 7.
87
+
88
+ **Done when:** stack detected, complexity class declared, reference pattern read.
89
+
90
+ ## Phase 2 -- Architect (Complex only)
91
+
92
+ Perform an architecture design pass following the **architect** skill:
93
+ ```
94
+ Design the architecture for this task:
95
+ Task: [description]
96
+ Current architecture: [from Phase 0 docs]
97
+ Affected components: [from Phase 1]
98
+ Compare viable approaches and explain relevant trade-offs; do not invent alternatives.
99
+ ```
100
+ Use the recommendation to shape Phase 4.
101
+ **Done when:** one approach chosen, with a stated reason.
102
+
103
+ ## Phase 3 -- Pseudocode (Complex only)
104
+
105
+ Draft language-agnostic pseudocode for the core logic (algorithm, state machine, data pipeline): input/output contract, main control flow, error paths, data transformations. 30-50 lines maximum -- longer means the task needs decomposition. No file paths, no framework syntax.
106
+
107
+ Present to the user: "Here's the pseudocode for [core logic]. Does this match your expectations?"
108
+ **Done when:** user approves (or explicitly waives) the pseudocode; it becomes the Phase 4 skeleton.
109
+
110
+ ## Phase 4 -- Plan
111
+
112
+ Produce a checklist plan organized by component -- include only relevant sections. Use a discovered planning tool when available; otherwise maintain the checklist in the conversation or the project's existing plan file.
113
+
114
+ ```
115
+ ## Implementation Plan
116
+ ### Database
117
+ - [ ] Migration: NNNN_description
118
+ ### Backend
119
+ - [ ] Repository/data layer: path
120
+ - [ ] Service/business logic: path
121
+ - [ ] DTOs/schemas: path
122
+ - [ ] Handler/controller: path
123
+ - [ ] Routes: path
124
+ - [ ] Tests: path
125
+ ### Frontend
126
+ - [ ] Types / API client / state / component: paths
127
+ ### Infrastructure
128
+ - [ ] Docker/config changes
129
+ ### Documentation
130
+ - [ ] API spec, architecture docs, README
131
+ ```
132
+
133
+ **Done when:** every planned item names a concrete file path.
134
+
135
+ ## Phase 5 -- Contract
136
+
137
+ Write testable acceptance criteria -- Phase 8 evaluates exactly these:
138
+
139
+ ```
140
+ ## Sprint Contract
141
+ | # | Criterion | Test Method | Threshold | Priority |
142
+ |---|-----------|-------------|-----------|----------|
143
+ | 1 | [specific, testable outcome] | [grep / curl / test / read] | Score >= 7 | MUST |
144
+ | 2 | ... | ... | ... | MUST/SHOULD |
145
+ ```
146
+
147
+ Threshold uses the evaluator's 0-10 scale -- default 7 unless a criterion warrants stricter. Good criteria are testable, specific ("returns 200 with user.id in JSON", not "endpoint works"), independent, and measurable. Never include subjective items ("code is clean") or unmeasurable ones ("performance is good").
148
+ **Done when:** every criterion has a concrete test method.
149
+
150
+ ## Phase 6 -- Validate Plan
151
+
152
+ Validate the Phase 4 plan plus Phase 5 contract following the **plan-checker** skill.
153
+ - **PASS** -> Phase 7.
154
+ - **REVISE** -> fix the blocking issues, re-validate (max 2 iterations, then treat as BLOCK).
155
+ - **BLOCK** -> stop; present the issues to the user.
156
+ **Done when:** verdict is PASS.
157
+
158
+ ## Phase 7 -- Implement
159
+
160
+ Execute the plan in dependency order; for each step, read the reference pattern first, then implement.
161
+
162
+ 1. **Migration** -- follow the detected tool's actual format and ordering, existing database dialect, and project rollback policy. Use the installed **new-migration** skill for scaffolding when relevant. Creating files does not authorize database execution; use **migrate** only with verified target, action, and authority. Conditional DDL is not a guarantee against data loss, and not every tool supports paired up/down files or a lossless reverse.
163
+ 2. **Data layer** -- follow the project's existing data-access patterns (Go: pgx/sqlx/gorm, nil-safe repos, `fmt.Errorf("Context.Method: %w", err)`; Python: SQLAlchemy/Django ORM; TypeScript: Prisma/TypeORM/Drizzle).
164
+ 3. **Business logic** -- constructor DI via interfaces; Go: `context.Context` first param, domain errors; Python: type hints, async where applicable; TypeScript: strict types.
165
+ 4. **Transport** -- follow existing handler patterns (chi, gin, echo, express, FastAPI, etc.); input validation at the boundary; errors mapped to proper status codes.
166
+ 5. **Routes** -- register endpoints, apply auth/middleware.
167
+ 6. **Frontend** -- read existing components first (animation library, styling, state); API client and types matching the backend contract.
168
+
169
+ **Done when:** every Phase 4 checklist item is implemented (no placeholders/TODOs left).
170
+
171
+ ## Phase 8 -- Evaluate
172
+
173
+ Assess implementation against the Sprint Contract following the **evaluator** skill, passing the changed scope, bound evidence, pass number, and prior report. Preserve UNVERIFIED and N/A criterion results; never turn missing evidence into a zero score or a pass.
174
+ - **PROCEED** -> Phase 9.
175
+ - **ITERATE** -> assign the local correction or authorized evidence collection, then re-evaluate affected criteria as pass N+1. If the matrix budget is exhausted (Standard 2 / Complex 3), or correction makes no meaningful progress, stop this loop and report the unresolved mandatory criteria and next decision. Do not advance on a warning alone.
176
+ - **ESCALATE** -> route the stated cause: architect/Astra for design or consequential acceptance; contract owner for requirements; appropriate owner for missing authorization, tool, or external evidence. Resume at the affected phase only after resolution.
177
+ **Done when:** verdict is PROCEED and mandatory evidence is sufficient. Otherwise report incomplete.
178
+
179
+ ## Phase 9 -- Verify
180
+
181
+ Follow the **health-checker** skill if present with the selected components, relevant compilation/build/static checks, and any other mandatory verification explicitly required by the task/project. Declare that scope; do not automatically run its entire nine-domain dashboard or let optional checks redefine this phase. Otherwise discover the project's actual configured commands and available tools, inspect effects, and run those same selected checks directly. Keep build/compilation separate from static analysis (for example, `go vet` alone is not a build); do not use a launcher that installs missing tools.
182
+
183
+ Keep this verification pass read-only apart from authorized disposable build/test outputs. Preserve original command exits, failed/timeout/unavailable states, full appropriately redacted evidence, and actual test skips; a shortened log or formatter exit is not the check result. Reuse recorded checks only for unchanged relevant code, inputs, and environment. Corrections belong to the coordinator or authorized implementer, not the health report.
184
+
185
+ **Done when:** all declared mandatory Phase 9 checks pass with sufficient evidence and no blocking result remains; if using health-checker, Progression must be ALLOWED. Optional warnings/unknowns remain explicit and do not block by themselves. An unavailable, skipped, or unverified mandatory check leaves this phase incomplete; report its dependency instead of endlessly retrying it.
186
+
187
+ ## Phase 10 -- Test
188
+
189
+ Generate or update tests for the new/changed backend behavior in scope following the **test-generator** skill and existing runner/conventions. Select meaningful happy/failure/boundary/state cases from requirements or observed defects; no mandatory case quota or implementation-mirroring assertions. The generator owns scoped test/fixture edits and authorized focused execution; the coordinator owns required suite verification and assigns production fixes only within existing implementation authority. Do not weaken tests to obtain green results.
190
+
191
+ Record actual commands, exits, passed/failed/skipped cases, and missing runtime evidence. A valid red regression test may complete a test artifact but does not pass this development gate. Reuse unchanged, properly bound focused or suite evidence instead of repeating it by ritual; run the required project suite for the final relevant state.
192
+ **Done when:** required tests actually ran and passed, required coverage is satisfied, and no mandatory skipped/unverified result remains (include the actual final summary line and command). If a required check or authorized correction is unavailable, report the bounded blocker; do not treat a failed, unrun, or all-skipped suite as green.
193
+
194
+ ## Phase 11 -- Verify Goals
195
+
196
+ Verify results against Phase 4 goals following the **goal-verifier** skill, passing changed scope and bound evidence. It assesses applicable levels: EXISTS -> SUBSTANTIVE -> WIRED -> DATA-FLOW; preserve justified N/A and unresolved UNVERIFIED results.
197
+ - **PASS** -> Phase 12.
198
+ - **NEEDS-ATTENTION** -> distinguish local fixes from missing evidence. Assign bounded corrections/checks, or report the dependency; never repeatedly retry an unavailable capability.
199
+ - **NEEDS-REMEDIATION** -> substantive goal mismatch or missing capability; return to Phase 7 (or Phase 4 if the plan itself was wrong).
200
+ **Done when:** verdict is PASS.
201
+
202
+ ## Phase 12 -- Review
203
+
204
+ First, a 30-second inline self-pass on the diff: (a) no placeholders/TODOs/`unimplemented`, (b) types/signatures consistent with callers, (c) every acceptance criterion has a corresponding change. Fix the obvious now.
205
+
206
+ Then perform matching reviews with available skills and authorized delegation; inline passes are self-review. Use the mapping below to identify relevant expertise, and scope each pass to actual risk and requirements:
207
+
208
+ | Changed files | Skill |
209
+ |---|---|
210
+ | `*.go` (not migrations, not tests) | **go-reviewer**, **security-scanner** |
211
+ | `*.sql` migrations | **migration-reviewer**, **database-reviewer** |
212
+ | Data-access files (`*_repo.go`, repositories) | **database-reviewer** |
213
+ | `*.ts`, `*.tsx` | **ts-reviewer** |
214
+ | `*.py` | **py-reviewer**, **security-scanner** |
215
+ | `*.rs` | **rs-reviewer** |
216
+ | Bot code | **bot-reviewer** |
217
+ | UI components | **design-system-reviewer**, **ui-reviewer** |
218
+ | OpenAPI/GraphQL spec changed | **api-contract-sync** |
219
+ | Any changed code | **silent-failure-hunter**, **comment-rot-analyzer** |
220
+
221
+ For each skill, review the selected diff/base and changed-file list against the task description, applying that skill's two-stage discipline (discover, then triage by Severity + Confidence). Keep reviewer passes read-only; assign corrections separately within existing implementation authority. Preserve each report's coverage, evidence, and unresolved prior findings.
222
+
223
+ Triage findings -- route, don't drop:
224
+ - CRITICAL or WARNING at HIGH/MEDIUM confidence -> fix before proceeding.
225
+ - LOW confidence / ambiguous -> carry into the **Open Questions** section of the Phase 15 report.
226
+ - A clean review (0 findings) is a valid result -- do not pad it.
227
+ - For silent-failure-hunter and comment-rot-analyzer, incomplete required coverage or a mandatory UNVERIFIED condition blocks progression without becoming a defect. Optional uncertainty may remain explicitly non-blocking; an Open Questions entry does not waive required evidence.
228
+
229
+ **Done when:** all CRITICAL/WARNING findings fixed or explicitly deferred with reason within the task's acceptance rules, and no mandatory review evidence/coverage remains unresolved. If the required check cannot be completed, report the dependency and stop this phase instead of retrying indefinitely.
230
+
231
+ ## Phase 13 -- Critic (Complex only)
232
+
233
+ Perform a final quality gate following the **critic** skill over the changed scope, original task, and Phase 12 findings/evidence. Use relevant security, maintainer, and operations perspectives without a findings or predictions quota.
234
+ - **APPROVE** -> Phase 14.
235
+ - **CONCERN** -> address or document explicit non-blocking disposition; advance only when Progression is ALLOWED and no mandatory evidence/acceptance is missing.
236
+ - **BLOCK** -> resolve the stated defect, evidence gap, or acceptance dependency. Recheck affected scope; if it cannot be resolved within authority/capability, report incomplete.
237
+ **Done when:** verdict is APPROVE, or CONCERN with ALLOWED progression and justified non-blocking disposition. Repeated unsuccessful correction requires a bounded escalation, not an endless review loop.
238
+
239
+ ## Phase 14 -- Document
240
+
241
+ Verify documentation completeness and accuracy for the selected changes following the **docs-reviewer** skill and the project's actual documentation map. The reviewer reports evidence and proposed corrections read-only; the coordinator or assigned implementer performs these updates within already-authorized scope:
242
+ 1. **API spec** (OpenAPI/GraphQL) if endpoints changed.
243
+ 2. **Architecture docs** if system behavior changed.
244
+ 3. **README** if setup, commands, or structure changed.
245
+ **Done when:** applicable mandatory documentation has been reviewed, required updates verified, and no unresolved mandatory MISSING, STALE, BROKEN, DRIFT, or UNVERIFIED items remain. Preserve justified N/A and optional suggestions; no MISSING findings alone is not acceptance. Recheck affected claims after corrections, retaining prior unresolved items. If a required source/check is unavailable, report incomplete and the next owner/action; do not silently advance or repeat an unavailable check indefinitely.
246
+
247
+ ## Phase 15 -- Report
248
+
249
+ Emit only after all non-skipped phases completed:
250
+
251
+ ```
252
+ ## Development Report
253
+
254
+ ### Task
255
+ [Original task description]
256
+
257
+ ### Phases Executed
258
+ | # | Phase | Status | Notes |
259
+ |---|-------|--------|-------|
260
+ | 0 | Read Docs | done | N docs read |
261
+ | 1 | Understand | done | [components], [complexity] |
262
+ | 2 | Architect | done/skipped | [approach chosen / not Complex] |
263
+ | 3 | Pseudocode | done/skipped | |
264
+ | 4 | Plan | done | N items |
265
+ | 5 | Contract | done/skipped | N criteria |
266
+ | 6 | Validate Plan | done/skipped | PASS after N iterations |
267
+ | 7 | Implement | done | N created, M modified |
268
+ | 8 | Evaluate | done/skipped | PROCEED at pass N |
269
+ | 9 | Verify | done | compilation clean |
270
+ | 10 | Test | done | X tests green |
271
+ | 11 | Verify Goals | done/skipped | PASS (all applicable mandatory levels) |
272
+ | 12 | Review | done | [skills]: N findings fixed |
273
+ | 13 | Critic | done/skipped | APPROVE |
274
+ | 14 | Document | done | [docs updated] |
275
+ | 15 | Report | done | this report |
276
+
277
+ ### Changes Made
278
+ | File | Action | Description |
279
+ |------|--------|-------------|
280
+
281
+ ### Open Questions (LOW-confidence review items -- surfaced, not dropped)
282
+ - file:line -- suspicion + what would confirm it (omit section if none)
283
+
284
+ ### Metrics
285
+ | Metric | Value |
286
+ |--------|-------|
287
+ | Complexity | Simple / Standard / Complex |
288
+ | Skill passes | N (list) |
289
+ | Evaluator passes | N (ITERATE -> ... -> PROCEED) |
290
+ | Sprint contract | X/Y criteria met |
291
+
292
+ ### Suggested Commit Message
293
+ type(scope): description
294
+ ```
295
+
296
+ Co-authorship trailers are optional; do not add one unless the project explicitly requires it.
297
+
298
+ ## Recap -- non-negotiables
299
+
300
+ - Phases run in order 0 -> 15; the Skip Matrix is the only source of skips.
301
+ - Gate verdicts consumed verbatim (plan-checker PASS/REVISE/BLOCK, evaluator PROCEED/ITERATE/ESCALATE, goal-verifier PASS/NEEDS-ATTENTION/NEEDS-REMEDIATION, critic APPROVE/CONCERN/BLOCK); failed gate -> retry with the critique in context and say so.
302
+ - No completion claims over failed or unverified mandatory criteria; report incomplete at a blocker instead of advancing or hiding it behind exhausted retries.
303
+ - LOW-confidence findings go to Open Questions, never silently dropped.
304
+ - Conventional commits: `feat|fix|docs|refactor|chore|test|perf(scope): description`.
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: docs-reviewer
3
+ description: Review documentation freshness, accuracy, and required coverage against selected changes and actual project evidence. Distinguish confirmed drift from unavailable verification.
4
+ user-invocable: false
5
+ tokens: 2176
6
+ ---
7
+
8
+ # Docs Reviewer
9
+
10
+ Check whether documentation makes accurate claims about the requested scope and meets the project's applicable documentation requirements. This role combines freshness, accuracy, and coverage assessment; it does not update docs merely because it replaced former docs-checker/doc-updater roles.
11
+
12
+ ## Establish the documentation contract
13
+
14
+ Read applicable `AGENTS.md` first, then relevant conventions and the actual documentation map. Identify authoritative docs, generated artifacts, historical plans, versioned guides, and templates before judging their claims. Read only architecture/context relevant to the selected change or explicitly requested audit.
15
+
16
+ For a Codex installation, compare any skill inventory or routing claim in `AGENTS.md` with the actual installed skill locations (for example `.codex/skills/<name>/SKILL.md`) and relevant `.codex/config.toml` configuration. Confirm the project's real paths and optional components first; repository source such as `packages/codex/skills/` is a different inventory from an installed catalog, and configuration does not prove runtime execution.
17
+
18
+ Use the caller's exact base/head, working-tree diff, or named documentation scope. Do not default to the last five commits or assume `main`. Record changed code/docs and related claims; resolve an ambiguous target before claiming coverage. Historical documentation may correctly describe an older release; verify the intended version against appropriate code.
19
+
20
+ Review only: return proposed corrections for the coordinator or a separately authorized editing step. Do not edit docs/code, regenerate tracked artifacts, post comments, or run commands that mutate external state without existing user authority. A request to review setup instructions does not authorize executing installations, migrations, deployments, or writes to real accounts. Inspect commands first; use safe local checks when useful, redact private data, and report what was not executed.
21
+
22
+ Honor task/project routing. Disclose INDEPENDENT versus INLINE SELF-REVIEW, requested/configured model and effort, and separately observed runtime values with evidence or UNVERIFIED. Runtime identity reporting alone creates no new gate; retain any explicitly required independent/Astra acceptance.
23
+
24
+ ## Review claims against evidence
25
+
26
+ ### Freshness: changed behavior to affected claims
27
+
28
+ Map changed interfaces, behavior, configuration, storage, or structure to the maintained docs that describe them. Use actual references and project rules, not a universal filename checklist. API handlers may map to OpenAPI or inline API docs; a database change may map to a generated schema instead of `database-schema.md`.
29
+
30
+ An unchanged doc is a candidate for inspection, not proof of staleness. A changed doc is not proof of correctness. Compare the relevant claim to before/after behavior and assess whether an update is required. Refactors, tests, and bug fixes that restore documented behavior often need no narrative update; a project's explicit changelog/tree requirements may still apply. Config changes need docs when their usage or a binding rule requires it.
31
+
32
+ ### Accuracy: inspect the source behind each relevant assertion
33
+
34
+ - Verify file paths, symbols, command names/flags, configuration keys/defaults, dependency versions, and installation steps against actual files and supported project versions. A file's absence locally may mean generated output, a different documented version, or missing checkout content; distinguish those cases.
35
+ - Check API routes and request/response/error contracts in route registration and implementation, including relevant feature flags and callers. A handler count is not automatically an endpoint count.
36
+ - Verify migration/schema and component/skill counts with a defined inclusion rule and source tree. Do not compare installed, optional, generated, and shipped inventories as if they were identical.
37
+ - Compare architecture, feature behavior, operational constraints, and plan status to implementation and acceptance evidence. Source presence does not prove a deployed feature works, a constraint is resolved, or a plan is complete.
38
+ - For documented commands, distinguish source inspection from execution. Record the actual command/result/environment if run; an unexecuted example is UNVERIFIED where runtime evidence is required, not automatically incorrect. Failed setup due to unavailable credentials/network is not proof the documented command is wrong.
39
+ - Check relevant links/references when permitted and necessary. Authentication failures, rate limits, unavailable network, or suspicious-looking URLs do not establish a broken link.
40
+
41
+ ### Coverage: apply the real documentation map
42
+
43
+ Identify which changed capabilities must be documented under project rules or the user task, and where that information belongs. Do not demand a separate architecture file for every code directory or introduce a new documentation system. Use **MISSING** for a confirmed required document or required content that is absent, including an unfilled template when it is the required source of usable instructions. An optional topic can be suggested without blocking acceptance.
44
+
45
+ Templates and TODOs are not stale factual claims merely because they are incomplete. Old release notes, examples, and superseded plans should be judged according to their stated purpose. Mark genuinely inapplicable checks N/A with a reason; do not treat missing access as N/A.
46
+
47
+ ## Classification and evidence
48
+
49
+ Keep existing finding labels for callers:
50
+ - **STALE:** a descriptive claim is out of sync with the target behavior/version, including an incorrect new claim that was never accurate.
51
+ - **BROKEN:** a reference or instruction demonstrably points to a nonexistent/invalid target for its stated context.
52
+ - **DRIFT:** a verified count/inventory differs under the same definition and target version.
53
+ - **MISSING:** required documentation or required content is confirmed absent.
54
+
55
+ An **INCORRECT** claim is a confirmed contradiction, reported under the applicable existing label above (STALE for descriptive claims, BROKEN for references, DRIFT for counts); it is not UNVERIFIED. These labels are issue types, not a severity ladder. Give each finding its mandatory/non-blocking status and user impact. Do not relabel a false claim MISSING merely to satisfy a caller gate.
56
+
57
+ **UNVERIFIED** is an evidence state, not a defect label: record the unavailable source, unexecuted required check, uncertain applicability, or unreviewed area and the decision/check needed. **OK** means the applicable claim was checked against sufficient evidence; **N/A** needs a stated applicability reason. Unverified mandatory docs block acceptance even with zero MISSING findings.
58
+
59
+ Cite the exact doc location and actual code/config/command evidence for each finding. For an absent document, cite the requirement and searched location/scope rather than inventing a doc line. Reuse verification only with recorded command/results and unchanged relevant code, inputs, and environment. Preserve prior unresolved findings by reference; a later narrow pass cannot erase them.
60
+
61
+ ## Report and stop
62
+
63
+ ```text
64
+ Documentation Review Report
65
+ Scope: <selected diff/version/docs, relevant requirements and exclusions>
66
+ Coverage: COMPLETE | PARTIAL | UNAVAILABLE — <reviewed and unreviewed areas>
67
+ Execution: INDEPENDENT | INLINE SELF-REVIEW
68
+ Requested model/effort: <explicit route or labeled configured default; UNSPECIFIED if absent>
69
+ Observed model/effort: <values + runtime evidence, or UNVERIFIED>
70
+
71
+ Claim/document | Requirement/trigger | Evidence | Status (OK/N/A/UNVERIFIED or issue label)
72
+
73
+ [STALE|BROKEN|DRIFT|MISSING] doc:line or <missing path + requirement reference>
74
+ Actual claim / expected behavior: <precise discrepancy>
75
+ Evidence and impact: <source/check + why it matters>
76
+ Required: YES | NO — <binding rule or optional improvement>
77
+ Fix: <specific proposed update>
78
+
79
+ Verification: <actual commands/results, source-only checks, and reuse binding>
80
+ Prior findings: <unresolved references/disposition, or none>
81
+ Open Questions: <missing evidence/applicability and next owner/check, or none>
82
+ Progression: ALLOWED | BLOCKED — <mandatory documentation conditions>
83
+ Summary: <checked scope, confirmed issues, unverified items, justified N/A>
84
+ ```
85
+
86
+ Stop after the scoped review or when required evidence is unavailable. A clean result needs complete assigned coverage and satisfied mandatory documentation conditions, not merely zero MISSING items. Keep optional proposals separate. Route corrections to the authorized implementation owner and recheck affected claims after changes; do not demand repeated full audits or retry inaccessible sources indefinitely.
@@ -0,0 +1,246 @@
1
+ ---
2
+ name: drizzle-orm-expert
3
+ description: Expert in Drizzle ORM for TypeScript — schema design, relational queries, migrations, serverless DB integration. Use when building type-safe database layers with Drizzle, migrating from Prisma, or optimizing edge runtime DB access
4
+ user-invocable: false
5
+ ---
6
+
7
+ # Drizzle ORM Expert
8
+
9
+ TypeScript-first ORM that compiles to raw SQL with zero runtime overhead. Ideal for edge runtimes and serverless. Two complementary APIs: SQL-like query builder and Prisma-style relational queries.
10
+
11
+ ## Use this skill when
12
+
13
+ - Setting up Drizzle ORM in a new or existing project
14
+ - Designing database schemas with Drizzle's TypeScript-first approach
15
+ - Writing complex relational queries (joins, subqueries, aggregations)
16
+ - Setting up or troubleshooting Drizzle Kit migrations
17
+ - Integrating Drizzle with Next.js App Router, tRPC, or Hono
18
+ - Optimizing performance (prepared statements, batching, pooling)
19
+ - Migrating from Prisma, TypeORM, or Knex
20
+
21
+ ## Do not use this skill when
22
+
23
+ - The DB layer uses Prisma, TypeORM, or raw SQL exclusively
24
+ - You need a database-agnostic ORM guide
25
+ - The task is about DB server configuration (use `postgresql-optimization`)
26
+
27
+ ## Workflow
28
+
29
+ 1. Identify the DB driver (PostgreSQL, SQLite, MySQL) and select the adapter
30
+ 2. Define schema in `db/schema.ts` (or domain-split `db/schema/users.ts`)
31
+ 3. Define relations separately so the relational query API (`db.query.*`) works
32
+ 4. Use `InferSelectModel` and `InferInsertModel` for type inference — never manual interfaces
33
+ 5. Run `drizzle-kit generate` then `migrate` for schema changes in production
34
+ 6. **Never** use `drizzle-kit push` in production
35
+
36
+ ## Core Architecture
37
+
38
+ Drizzle ORM compiles TypeScript schema definitions into prepared SQL statements at build time. There is no runtime query engine binary (unlike Prisma), which makes it edge-compatible (Cloudflare Workers, Vercel Edge Functions, Deno Deploy).
39
+
40
+ Two APIs coexist:
41
+ - **SQL-like builder**: `db.select().from().where().join().orderBy()` — close to SQL semantics
42
+ - **Relational query API**: `db.query.users.findMany({ with: { posts: true } })` — Prisma-style nested fetching
43
+
44
+ ## Schema Design
45
+
46
+ ```typescript
47
+ import { pgTable, uuid, text, timestamp, pgEnum, index, uniqueIndex } from 'drizzle-orm/pg-core';
48
+
49
+ export const roleEnum = pgEnum('role', ['admin', 'user', 'guest']);
50
+
51
+ export const users = pgTable('users', {
52
+ id: uuid('id').defaultRandom().primaryKey(),
53
+ email: text('email').notNull().unique(),
54
+ role: roleEnum('role').default('user').notNull(),
55
+ createdAt: timestamp('created_at').defaultNow().notNull(),
56
+ }, (table) => ({
57
+ emailIdx: uniqueIndex('users_email_idx').on(table.email),
58
+ createdIdx: index('users_created_idx').on(table.createdAt),
59
+ }));
60
+
61
+ export const posts = pgTable('posts', {
62
+ id: uuid('id').defaultRandom().primaryKey(),
63
+ userId: uuid('user_id').references(() => users.id, { onDelete: 'cascade' }).notNull(),
64
+ title: text('title').notNull(),
65
+ });
66
+ ```
67
+
68
+ ## Relations API
69
+
70
+ ```typescript
71
+ import { relations } from 'drizzle-orm';
72
+
73
+ export const usersRelations = relations(users, ({ many }) => ({
74
+ posts: many(posts),
75
+ }));
76
+
77
+ export const postsRelations = relations(posts, ({ one }) => ({
78
+ author: one(users, { fields: [posts.userId], references: [users.id] }),
79
+ }));
80
+
81
+ // Initialize client WITH schema for db.query.* to work:
82
+ import { drizzle } from 'drizzle-orm/node-postgres';
83
+ import * as schema from './schema';
84
+ export const db = drizzle(pool, { schema });
85
+ ```
86
+
87
+ Many-to-many requires an explicit junction table — Drizzle has no implicit join tables.
88
+
89
+ ## Queries
90
+
91
+ ### SQL-like builder
92
+ ```typescript
93
+ import { eq, and, desc, count } from 'drizzle-orm';
94
+
95
+ const recent = await db
96
+ .select({ id: posts.id, title: posts.title, author: users.email })
97
+ .from(posts)
98
+ .innerJoin(users, eq(users.id, posts.userId))
99
+ .where(and(eq(users.role, 'user'), eq(posts.published, true)))
100
+ .orderBy(desc(posts.createdAt))
101
+ .limit(20);
102
+ ```
103
+
104
+ ### Relational
105
+
106
+ In `db.query.<table>.findMany`, the `where` / `orderBy` clauses can be either a value built from the imported schema's table (`eq(users.role, 'user')`) or, with the latest relational query builder, a callback that receives the table:
107
+
108
+ ```typescript
109
+ import { users, posts } from './schema';
110
+
111
+ const activeUsers = await db.query.users.findMany({
112
+ where: (user, { eq }) => eq(user.role, 'user'),
113
+ orderBy: (user, { desc }) => desc(user.createdAt),
114
+ with: {
115
+ posts: {
116
+ where: (post, { eq }) => eq(post.published, true),
117
+ limit: 5,
118
+ },
119
+ },
120
+ limit: 20,
121
+ });
122
+ ```
123
+
124
+ Both forms work. The callback form avoids shadowing the imported `users` table when the local result variable would otherwise collide.
125
+
126
+ ## Mutations
127
+
128
+ ```typescript
129
+ // Insert + returning (Postgres only)
130
+ const [inserted] = await db.insert(users).values({ email: 'a@b.c' }).returning();
131
+
132
+ // Batch
133
+ await db.insert(users).values([{ email: 'x@x' }, { email: 'y@y' }]);
134
+
135
+ // Update
136
+ await db.update(users).set({ role: 'admin' }).where(eq(users.id, id));
137
+
138
+ // Delete
139
+ await db.delete(posts).where(eq(posts.userId, id));
140
+
141
+ // Upsert
142
+ await db.insert(users)
143
+ .values({ id, email })
144
+ .onConflictDoUpdate({ target: users.id, set: { email } });
145
+ ```
146
+
147
+ ## Transactions
148
+
149
+ ```typescript
150
+ await db.transaction(async (tx) => {
151
+ await tx.insert(orders).values(order);
152
+ await tx.update(inventory).set({ stock: sql`stock - 1` });
153
+ // any throw → rollback
154
+ });
155
+ ```
156
+
157
+ ## Drizzle Kit
158
+
159
+ ```bash
160
+ drizzle-kit generate # write SQL migration files (review them)
161
+ drizzle-kit migrate # apply pending migrations — production
162
+ drizzle-kit push # sync schema directly — DEV ONLY, NEVER prod
163
+ drizzle-kit studio # GUI database browser
164
+ ```
165
+
166
+ `drizzle.config.ts`:
167
+ ```typescript
168
+ import type { Config } from 'drizzle-kit';
169
+ export default {
170
+ schema: './db/schema.ts',
171
+ out: './db/migrations',
172
+ dialect: 'postgresql',
173
+ dbCredentials: { url: process.env.DATABASE_URL! },
174
+ } satisfies Config;
175
+ ```
176
+
177
+ ## Adapters
178
+
179
+ | DB | Adapter |
180
+ |---|---|
181
+ | Postgres (Neon) | `drizzle-orm/neon-http` |
182
+ | Postgres (node-pg) | `drizzle-orm/node-postgres` |
183
+ | Postgres (postgres.js) | `drizzle-orm/postgres-js` |
184
+ | SQLite (Turso) | `drizzle-orm/libsql` |
185
+ | SQLite (local) | `drizzle-orm/better-sqlite3` |
186
+ | MySQL (PlanetScale) | `drizzle-orm/planetscale-serverless` |
187
+ | MySQL (mysql2) | `drizzle-orm/mysql2` |
188
+
189
+ Always pass `{ schema }` to enable `db.query.*`.
190
+
191
+ ## Type Inference
192
+
193
+ ```typescript
194
+ import { InferSelectModel, InferInsertModel } from 'drizzle-orm';
195
+ type User = InferSelectModel<typeof users>;
196
+ type NewUser = InferInsertModel<typeof users>;
197
+ ```
198
+
199
+ Never write manual TS interfaces for DB rows — schema is the source of truth.
200
+
201
+ ## Performance
202
+
203
+ - **Prepared statements** for hot paths: `.prepare('getUser')` once, execute many times
204
+ - **Partial select**: choose only needed columns
205
+ - **Batch**: `db.batch([...])` for many independent queries in one round-trip (libsql / d1 only)
206
+ - **Indexes**: declare `index()` / `uniqueIndex()` inside the table builder
207
+
208
+ ## Next.js Integration
209
+
210
+ ```typescript
211
+ // app/dashboard/page.tsx — Server Component
212
+ import { db } from '@/db';
213
+
214
+ export default async function Dashboard() {
215
+ const allUsers = await db.query.users.findMany({ limit: 20 });
216
+ return <UsersList users={allUsers} />;
217
+ }
218
+ ```
219
+
220
+ ```typescript
221
+ // Server Action
222
+ 'use server';
223
+ import { db } from '@/db';
224
+ export async function createUser(formData: FormData) {
225
+ await db.insert(users).values({ email: formData.get('email') as string });
226
+ }
227
+ ```
228
+
229
+ ## Constraints
230
+
231
+ - **NEVER** use `drizzle-kit push` in production — can cause data loss
232
+ - **NEVER** write raw SQL when the query builder supports the op
233
+ - **ALWAYS** define `relations()` before using `db.query.*` with `with`
234
+ - **ALWAYS** use connection pooling (`pgBouncer`, `Neon serverless`, `node-pg Pool`)
235
+ - **MySQL** doesn't support `.returning()` — read `insertId` from the result
236
+
237
+ ## Common Issues
238
+
239
+ | Symptom | Cause | Fix |
240
+ |---------|-------|-----|
241
+ | `db.query.users` is undefined | `{ schema }` not passed to `drizzle()` | Pass schema |
242
+ | Migration conflict | Out-of-sync DB state | `generate` new migration, review SQL, `migrate` |
243
+ | Type error on `relations` | Forgot to `export const usersRelations = relations(...)` | Add export |
244
+ | Slow query in Edge runtime | New connection per request | Use a serverless adapter (Neon, PlanetScale) or HTTP-based driver |
245
+
246
+ Adapted from VKirill/codex-starter-kit (Apache 2.0 community skill).