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,130 @@
1
+ ---
2
+ description: Run Go benchmarks with statistical analysis and optional comparison
3
+ argument-hint: "[package] [--compare branch/commit]"
4
+ allowed-tools: Read, Grep, Glob, Bash
5
+ ---
6
+
7
+ # Go Benchmark Runner
8
+
9
+ ## Role
10
+
11
+ Run Go benchmarks with memory stats and 6 repetitions; in `--compare` mode, benchmark two git refs and diff them with benchstat. Go-only command: on non-Go projects it exits at Step 1 with zero side effects.
12
+
13
+ ## Hard Rules
14
+
15
+ 1. No `go.mod` found → report "No Go project detected" and STOP.
16
+ 2. No `func Benchmark` functions found → report "No benchmark functions found" and STOP.
17
+ 3. Compare mode: record `ORIGINAL_REF` and `STASHED` (Step 4) BEFORE any `git checkout` or `git stash`. Never switch first.
18
+ 4. Once Step 4 switched refs, the Restore epilogue (Step 6) ALWAYS runs — after success, after a failed benchmark run, after a missing tool, after any error. Never finish with the repo on another ref or with changes still stashed.
19
+ 5. Never run destructive git commands (`reset --hard`, `clean -f`, checkout that overwrites uncommitted changes). Uncommitted changes are preserved only via `git stash push`.
20
+ 6. Use the exact `go test` command from Step 3; do not lower `-count` below 6 (statistical significance needs repetitions).
21
+
22
+ ## Step 1 — Detect Project
23
+
24
+ 1. Find `go.mod` (repo root, else `Glob **/go.mod`). Missing → Hard Rule 1.
25
+ 2. Find benchmarks: `grep -rn "func Benchmark" --include="*.go" .` Zero hits → Hard Rule 2.
26
+
27
+ Done when: `go.mod` confirmed AND ≥1 benchmark function found (or the command stopped with the exact message).
28
+
29
+ ## Step 2 — Parse Arguments
30
+
31
+ Arguments: $ARGUMENTS
32
+
33
+ | Input | Result |
34
+ |-------|--------|
35
+ | (empty) | `PKG=./...` (all packages), MODE=single |
36
+ | `<package>` | `PKG=<package>` (e.g. `./pkg/cache/...`), MODE=single |
37
+ | `--compare <ref>` | MODE=compare against `<ref>`; PKG from remaining arg or `./...` |
38
+
39
+ Done when: PKG and MODE are fixed.
40
+
41
+ ## Step 3 — Run Current Benchmarks
42
+
43
+ ```bash
44
+ go test -bench=. -benchmem -count=6 -timeout=10m <PKG>
45
+ ```
46
+
47
+ - MODE=single: parse output into the results table → go to Step 7.
48
+ - MODE=compare: save raw output to `/tmp/bench-new.txt`. If this run FAILS, report the error and STOP here (nothing was switched yet, no restore needed).
49
+
50
+ Done when: run finished; compare mode additionally has `/tmp/bench-new.txt` on disk.
51
+
52
+ ## Step 4 — Compare Setup (compare mode only; single mode skips Steps 4–6)
53
+
54
+ 1. Check benchstat: `command -v benchstat`. Missing → `go install golang.org/x/perf/cmd/benchstat@latest`, re-check. Still missing → set `FALLBACK=raw` and continue (Step 7 has a no-benchstat format).
55
+ 2. Record the return point: `ORIGINAL_REF=$(git rev-parse --abbrev-ref HEAD)`; if that prints `HEAD` (detached), use `ORIGINAL_REF=$(git rev-parse HEAD)`.
56
+ 3. `git status --porcelain` non-empty → `git stash push -u -m "benchmark-compare"`, set `STASHED=yes`; else `STASHED=no`.
57
+ 4. `git checkout <ref>`. If checkout fails → go straight to Step 6.
58
+
59
+ Done when: benchstat status known, ORIGINAL_REF + STASHED recorded, repo on `<ref>`.
60
+
61
+ ## Step 5 — Benchmark the Old Ref (compare mode only)
62
+
63
+ Run the exact Step 3 command again; save output to `/tmp/bench-old.txt`. If it fails, note the failure for the report and proceed to Step 6 anyway (Hard Rule 4).
64
+
65
+ Done when: `/tmp/bench-old.txt` written, or the failure recorded.
66
+
67
+ ## Step 6 — Restore Epilogue (ALWAYS runs after Step 4 item 4, regardless of outcome)
68
+
69
+ 1. `git checkout <ORIGINAL_REF>`
70
+ 2. If `STASHED=yes`: `git stash pop`. On pop conflict: report the conflict, do NOT drop the stash — tell the user their changes remain in `git stash list`.
71
+ 3. Verify with `git status`: original ref active, working tree state back.
72
+
73
+ Done when: repo is on ORIGINAL_REF and the stash is popped (or a pop conflict is explicitly reported).
74
+
75
+ ## Step 7 — Report
76
+
77
+ Use exactly one of these templates.
78
+
79
+ ### Single Run
80
+
81
+ ```
82
+ ## Benchmark Results — <PKG>
83
+
84
+ | Benchmark | ns/op | B/op | allocs/op |
85
+ |-----------|-------|------|-----------|
86
+ | BenchmarkGet-8 | 234 | 48 | 1 |
87
+ | BenchmarkSet-8 | 567 | 128 | 3 |
88
+
89
+ Ran 6 iterations per benchmark for statistical significance.
90
+ ```
91
+
92
+ ### Comparison (benchstat available)
93
+
94
+ Run `benchstat /tmp/bench-old.txt /tmp/bench-new.txt`, then:
95
+
96
+ ```
97
+ ## Benchmark Comparison — current vs <ref>
98
+
99
+ [benchstat output with p-values]
100
+
101
+ Summary:
102
+ - X benchmarks faster, Y slower, Z unchanged (at p < 0.05)
103
+ ```
104
+
105
+ ### Comparison (FALLBACK=raw, benchstat unavailable)
106
+
107
+ Build the delta table yourself from the two `/tmp/bench-*.txt` files (per benchmark, average the 6 runs):
108
+
109
+ ```
110
+ ## Benchmark Comparison — current vs <ref> (raw; benchstat unavailable)
111
+
112
+ | Benchmark | old ns/op | new ns/op | Δ% | old B/op | new B/op | old allocs/op | new allocs/op |
113
+ |-----------|-----------|-----------|----|----------|----------|---------------|---------------|
114
+
115
+ No statistical significance test applied — install benchstat for p-values:
116
+ go install golang.org/x/perf/cmd/benchstat@latest
117
+ ```
118
+
119
+ ## Done ONLY when
120
+
121
+ - [ ] Report emitted using one of the exact templates above.
122
+ - [ ] Compare mode: `git status` confirms the repo is back on ORIGINAL_REF with the stash popped (or a pop conflict explicitly reported).
123
+ - [ ] Every benchmark/checkout/tool failure that occurred is stated in the report, not silently swallowed.
124
+
125
+ ## Recap
126
+
127
+ - No `go.mod` / no benchmarks → stop early with the exact message; zero side effects on non-Go projects.
128
+ - Record ORIGINAL_REF + STASHED before any git switch; the Step 6 Restore epilogue always runs after a switch.
129
+ - benchstat is checked (and installed) BEFORE use; raw delta table is the fallback.
130
+ - Exact `go test -bench=. -benchmem -count=6 -timeout=10m` invocation; report only via the fenced templates.
@@ -0,0 +1,148 @@
1
+ ---
2
+ description: Conventional commit helper — analyze changes, detect secrets, create well-formatted commit
3
+ argument-hint: "[optional commit message override]"
4
+ allowed-tools: Bash, Read, Grep, Glob
5
+ ---
6
+
7
+ # Conventional Commit Helper
8
+
9
+ ## Role
10
+
11
+ Stage changes safely, draft a conventional-commit message (with optional trailers), scan the staged diff for secrets, then create one verified commit. This command commits only — it never pushes.
12
+
13
+ ## Hard Rules
14
+
15
+ - Stage files explicitly by path. Never run `git add -A`, `git add .`, or `git add -u`.
16
+ - Never stage anything on the never-stage denylist (Step 2).
17
+ - Create the commit (Step 6) ONLY when the Step 5 secret scan found nothing, OR the user has explicitly confirmed every flagged pattern. An unconfirmed secret finding blocks the commit.
18
+ - This command creates exactly one commit. Never `git push`.
19
+ - Message format is `type(scope): description` — imperative mood, lowercase, describing the "why".
20
+ - Always end the commit body with the `Co-Authored-By: Claude <noreply@anthropic.com>` trailer.
21
+
22
+ ## Steps
23
+
24
+ ### 1. Analyze Changes
25
+
26
+ ```bash
27
+ git status
28
+ git diff --stat
29
+ git diff --cached --stat
30
+ git log --oneline -5
31
+ ```
32
+
33
+ Done when: you know which files changed, which are already staged, and the repo's recent commit-message style.
34
+
35
+ ### 2. Stage Files
36
+
37
+ Stage only the files that belong to this change, one path at a time: `git add <path> <path> ...`. When the working tree mixes task files with unrelated edits, stage only the task files by explicit path and leave the rest unstaged.
38
+
39
+ **Never** stage:
40
+ - `.env` files (secrets)
41
+ - `credentials.json`, `*.key`, `*.pem`, `*.p12`
42
+ - `*.sqlite`, `*.db` (database files)
43
+ - Large binary files (images, videos, archives)
44
+ - `node_modules/`, `vendor/`, `__pycache__/`, `target/`
45
+
46
+ Done when: every file intended for this commit is staged by explicit path, and re-checking `git diff --cached --stat` shows no denylist path staged.
47
+
48
+ ### 3. Draft Commit Message
49
+
50
+ Analyze the diff to determine:
51
+ - **Type**: `feat`, `fix`, `docs`, `refactor`, `chore`, `test`, `perf`, `style`, `build`, `ci`
52
+ - **Scope**: component or directory name (e.g., `backend`, `frontend`, `auth`, `api`)
53
+ - **Description**: concise "why" (not "what"), imperative mood, lowercase
54
+
55
+ Format: `type(scope): description`
56
+
57
+ Examples:
58
+ - `feat(auth): add JWT refresh token rotation`
59
+ - `fix(cache): prevent stale reads after invalidation`
60
+ - `refactor(api): extract validation into middleware`
61
+ - `docs(readme): update setup instructions for Docker`
62
+ - `test(users): add edge cases for concurrent access`
63
+
64
+ If `$ARGUMENTS` is provided and non-empty, use it as the commit message instead of auto-generating.
65
+
66
+ Done when: you have a single subject line in `type(scope): description` form.
67
+
68
+ ### 4. Add Git Trailers (for non-trivial changes)
69
+
70
+ For changes touching 3+ files or core logic, append structured trailers to the commit body. These provide traceability metadata.
71
+
72
+ | Trailer | Values | When to use |
73
+ |---------|--------|-------------|
74
+ | `Confidence` | `HIGH` / `MEDIUM` / `LOW` | Always. How confident are you this change is correct? |
75
+ | `Scope-risk` | `LOW` / `MEDIUM` / `HIGH` | When touching shared code. How likely to affect other components? |
76
+ | `Not-tested` | free text | When something is NOT covered by tests. List what's untested. |
77
+
78
+ Example commit with trailers:
79
+ ```
80
+ feat(auth): add JWT refresh token rotation
81
+
82
+ Implement automatic token refresh when access token expires.
83
+ Refresh tokens are single-use with 7-day TTL.
84
+
85
+ Confidence: HIGH
86
+ Scope-risk: MEDIUM — touches auth middleware used by all endpoints
87
+ Not-tested: concurrent refresh requests from multiple devices
88
+
89
+ Co-Authored-By: Claude <noreply@anthropic.com>
90
+ ```
91
+
92
+ **Skip trailers for:** typo fixes, docs-only changes, config changes, single-file edits < 20 lines.
93
+
94
+ Done when: trailers are added, or the change matches a skip condition.
95
+
96
+ ### 5. Check for Secrets
97
+
98
+ Scan the staged diff (`git diff --cached`) for potential secrets:
99
+ - API keys: long alphanumeric strings (32+ chars) in string literals
100
+ - Passwords: `password`, `secret`, `token`, `api_key` assignments with literal values
101
+ - Private keys: `-----BEGIN` patterns
102
+ - Connection strings with embedded credentials
103
+ - Bot tokens: `[0-9]+:[A-Za-z0-9_-]{35}` (Telegram format)
104
+ - AWS keys: `AKIA[A-Z0-9]{16}`
105
+
106
+ If any pattern matches, **WARN**, list every suspicious file and match, and ask for confirmation. Do not advance to Step 6 until the user has explicitly confirmed each flagged pattern is safe.
107
+
108
+ Done when: the scan found nothing, or the user has explicitly confirmed every flagged pattern.
109
+
110
+ ### 6. Create Commit
111
+
112
+ Precondition: Step 5 found no secrets, or the user confirmed each flagged pattern. Do not run this step otherwise.
113
+
114
+ ```bash
115
+ git commit -m "$(cat <<'EOF'
116
+ type(scope): description
117
+
118
+ Co-Authored-By: Claude <noreply@anthropic.com>
119
+ EOF
120
+ )"
121
+ ```
122
+
123
+ Done when: `git commit` exits 0 and prints a commit hash.
124
+
125
+ ### 7. Verify
126
+
127
+ ```bash
128
+ git log --oneline -1
129
+ git status
130
+ ```
131
+
132
+ Done when: the new commit appears at the top of the log and you have counted any remaining unstaged files.
133
+
134
+ ## Output
135
+
136
+ Report exactly:
137
+
138
+ ```
139
+ Committed: <hash> <subject>
140
+ Unstaged after commit: <count> file(s) — [list paths, or "none"]
141
+ ```
142
+
143
+ ## Recap — non-negotiables
144
+
145
+ - Stage by explicit path only; never `git add -A` / `.` / `-u`, and never stage a denylist path.
146
+ - No commit while an unconfirmed secret finding stands — Step 5 gates Step 6.
147
+ - Message is `type(scope): description`, imperative and lowercase, ending with the `Co-Authored-By` trailer.
148
+ - Commit only — never `git push`.
@@ -0,0 +1,302 @@
1
+ ---
2
+ description: Full-stack development orchestrator — always-on, 16 phases (0–15): read-docs → understand → architect → pseudocode → plan → contract → validate → implement → evaluate → verify → test → goals → review → critic → document → report
3
+ argument-hint: <task-description>
4
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent
5
+ ---
6
+
7
+ # Development Orchestrator
8
+
9
+ Run the full development cycle for the task below as 16 numbered phases. You are the orchestrator: you execute phases yourself and dispatch specialist agents at the gates.
10
+
11
+ ## Task
12
+
13
+ $ARGUMENTS
14
+
15
+ ## Hard Rules
16
+
17
+ 1. Execute phases in order 0 → 15. Skip a phase ONLY when the Skip Matrix says so for the task's complexity class.
18
+ 2. A phase is complete only when its **Done when** condition holds. If a phase produces errors, fix them before advancing.
19
+ 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.
20
+ 4. On any failed gate or retry, escalate effort to `max` for the next attempt and say you are doing so — never silently re-run at the same effort.
21
+ 5. Never claim completion while compilation or tests fail. The Phase 15 report is emitted only after every non-skipped phase has run.
22
+ 6. If the task is ambiguous, ask the user before Phase 7 (Implement) — not after.
23
+ 7. Always read existing patterns before writing new code — search first, reuse the closest implementation as reference.
24
+
25
+ ## Phase Overview & Skip Matrix
26
+
27
+ Complexity (Simple / Standard / Complex) is decided in Phase 1 and never changes mid-run.
28
+
29
+ | # | Phase | Simple | Standard | Complex | Gate agent |
30
+ |---|-------|:------:|:--------:|:-------:|-----------|
31
+ | 0 | Read Docs | ✓ | ✓ | ✓ | — |
32
+ | 1 | Understand | ✓ | ✓ | ✓ | — |
33
+ | 2 | Architect | — | — | ✓ | architect |
34
+ | 3 | Pseudocode | — | — | ✓ | — |
35
+ | 4 | Plan | ✓ | ✓ | ✓ | — |
36
+ | 5 | Contract | — | ✓ | ✓ | — |
37
+ | 6 | Validate Plan | — | ✓ | ✓ | plan-checker |
38
+ | 7 | Implement | ✓ | ✓ | ✓ | — |
39
+ | 8 | Evaluate | — | ✓ (max 2 passes) | ✓ (max 3 passes) | evaluator |
40
+ | 9 | Verify | ✓ | ✓ | ✓ | health-checker |
41
+ | 10 | Test | ✓ | ✓ | ✓ | test-generator |
42
+ | 11 | Verify Goals | — | ✓ | ✓ | goal-verifier |
43
+ | 12 | Review | ✓ | ✓ | ✓ | reviewers (parallel) |
44
+ | 13 | Critic | — | — | ✓ | critic |
45
+ | 14 | Document | ✓ | ✓ | ✓ | docs-reviewer |
46
+ | 15 | Report | ✓ | ✓ | ✓ | — |
47
+
48
+ ## Phase 0 — Read Docs
49
+
50
+ Read `docs/architecture/` files relevant to the task scope:
51
+ - Backend task → `backend-layers.md`, `api-reference.md`, `database-schema.md`
52
+ - Frontend task → `frontend-state.md`
53
+ - Auth task → `auth-and-sessions.md`
54
+ - Full-stack → all available docs
55
+
56
+ Missing docs are not an error — note what was absent and continue.
57
+ **Done when:** relevant existing docs are read (or confirmed absent).
58
+
59
+ ## Phase 1 — Understand
60
+
61
+ 1. **Detect the stack** by scanning the repository root and subdirectories:
62
+
63
+ | Marker file | Stack |
64
+ |---|---|
65
+ | `go.mod` | Go backend |
66
+ | `package.json` + `tsconfig.json` | TypeScript (check for React, Vue, Svelte, etc.) |
67
+ | `pyproject.toml` / `setup.py` / `requirements.txt` | Python |
68
+ | `Cargo.toml` | Rust |
69
+ | `pom.xml` / `build.gradle` | Java/Kotlin |
70
+ | `docker-compose.yml` | Docker infrastructure |
71
+ | `migrations/` or `db/migrate/` | Database migrations |
72
+
73
+ 2. **Parse the task**: affected components (backend, frontend, infra, bots, docs); feature / enhancement / bug fix / refactor; inputs and expected outputs.
74
+
75
+ 3. **Assess complexity** — score each of 5 factors, majority column wins (ties → Standard):
76
+
77
+ | Factor | Simple | Standard | Complex |
78
+ |--------|--------|----------|---------|
79
+ | File count | 1 | 2–5 | 6+ |
80
+ | Line changes | < 100 | 100–500 | 500+ |
81
+ | Novelty | Existing pattern | New pattern in existing area | New subsystem |
82
+ | Risk | Internal, no data changes | API change, DB migration | Auth, payments, security |
83
+ | Ambiguity | Clear spec | Some unknowns | Exploratory/open-ended |
84
+
85
+ 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.
86
+
87
+ 5. **Identify the closest existing implementation** and read it — it is the reference pattern for Phase 7.
88
+
89
+ **Done when:** stack detected, complexity class declared, reference pattern read.
90
+
91
+ ## Phase 2 — Architect (Complex only)
92
+
93
+ Dispatch **architect**:
94
+ ```
95
+ Design the architecture for this task:
96
+ Task: [description]
97
+ Current architecture: [from Phase 0 docs]
98
+ Affected components: [from Phase 1]
99
+ Propose 2-3 approaches with trade-offs.
100
+ ```
101
+ Use the recommendation to shape Phase 4. If the chosen approach had real alternatives and lasting consequences (framework/data-model/protocol/security choice), append an ADR to `docs/adr/` from `docs-templates/adr-template.md` recording the rejected alternatives and why — skip for trivial or easily-reversible choices, and if `docs-templates/adr-template.md` is absent, skip silently rather than blocking on a missing template.
102
+ **Done when:** one approach chosen, with a stated reason.
103
+
104
+ ## Phase 3 — Pseudocode (Complex only)
105
+
106
+ 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.
107
+
108
+ Present to the user: "Here's the pseudocode for [core logic]. Does this match your expectations?"
109
+ **Done when:** user approves (or explicitly waives) the pseudocode; it becomes the Phase 4 skeleton.
110
+
111
+ ## Phase 4 — Plan
112
+
113
+ Produce a checklist plan organized by component — include only relevant sections:
114
+
115
+ ```
116
+ ## Implementation Plan
117
+ ### Database
118
+ - [ ] Migration: NNNN_description
119
+ ### Backend
120
+ - [ ] Repository/data layer: path
121
+ - [ ] Service/business logic: path
122
+ - [ ] DTOs/schemas: path
123
+ - [ ] Handler/controller: path
124
+ - [ ] Routes: path
125
+ - [ ] Tests: path
126
+ ### Frontend
127
+ - [ ] Types / API client / state / component: paths
128
+ ### Infrastructure
129
+ - [ ] Docker/config changes
130
+ ### Documentation
131
+ - [ ] API spec, architecture docs, README
132
+ ```
133
+
134
+ **Done when:** every planned item names a concrete file path.
135
+
136
+ ## Phase 5 — Contract (Standard: 5–10 criteria · Complex: 10–20)
137
+
138
+ Write testable acceptance criteria — the evaluator checks exactly these in Phase 8:
139
+
140
+ ```
141
+ ## Sprint Contract
142
+ | # | Criterion | Test Method | Threshold | Priority |
143
+ |---|-----------|-------------|-----------|----------|
144
+ | 1 | [specific, testable outcome] | [grep / curl / test / read] | Score ≥ 7 | MUST |
145
+ | 2 | ... | ... | ... | MUST/SHOULD |
146
+ ```
147
+
148
+ 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").
149
+ **Done when:** every criterion has a concrete test method.
150
+
151
+ ## Phase 6 — Validate Plan
152
+
153
+ Dispatch **plan-checker** with the Phase 4 plan and Phase 5 contract.
154
+ - **PASS** → Phase 7.
155
+ - **REVISE** → fix the blocking issues, re-dispatch (max 2 iterations, then treat as BLOCK).
156
+ - **BLOCK** → stop; present the issues to the user.
157
+ **Done when:** verdict is PASS.
158
+
159
+ ## Phase 7 — Implement
160
+
161
+ Execute the plan in dependency order; for each step, read the reference pattern first, then implement. Before writing any NEW code, walk the Solution Ladder (coding-style rule) and stop at the first rung that holds: not needed → reuse in codebase → stdlib → native platform feature → installed dependency; a new dependency is the last resort.
162
+
163
+ 1. **Migration** — next number in the project's migration directory; up + down files; parameterized DDL, `IF NOT EXISTS`, appropriate types.
164
+ 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).
165
+ 3. **Business logic** — constructor DI via interfaces; Go: `context.Context` first param, domain errors; Python: type hints, async where applicable; TypeScript: strict types.
166
+ 4. **Transport** — follow existing handler patterns (chi, gin, echo, express, FastAPI, …); input validation at the boundary; errors mapped to proper status codes.
167
+ 5. **Routes** — register endpoints, apply auth/middleware.
168
+ 6. **Frontend** — read existing components first (animation library, styling, state); API client and types matching the backend contract.
169
+
170
+ **Done when:** every Phase 4 checklist item is implemented (no placeholders/TODOs left).
171
+
172
+ ## Phase 8 — Evaluate
173
+
174
+ Dispatch **evaluator** with the Sprint Contract, changed-file list, pass number, and — on pass 2+ — the previous evaluation report.
175
+ - **PROCEED** → Phase 9.
176
+ - **ITERATE** → escalate effort to `max` (Hard Rule 4), fix the critique, re-dispatch as pass N+1. If passes exceed the matrix budget (Standard 2 / Complex 3) → proceed with the warning "Evaluation budget exhausted after N passes. Remaining issues: [list]". If the score did not improve vs the previous pass → proceed with an escalation note.
177
+ - **ESCALATE** → dispatch **architect** for design review, apply its recommendation, restart from Phase 7.
178
+ **Done when:** verdict is PROCEED, or budget exhausted with an explicit warning.
179
+
180
+ ## Phase 9 — Verify
181
+
182
+ Dispatch **health-checker** if available; otherwise run compilation checks directly:
183
+ Go `go vet ./...` · TypeScript `npx tsc --noEmit` · Python `mypy`/`pyright`/`python -m py_compile` · Rust `cargo check`.
184
+ **Done when:** compilation/static checks pass with zero errors.
185
+
186
+ ## Phase 10 — Test
187
+
188
+ Dispatch **test-generator** if available — otherwise write the tests yourself — for new/changed backend code: happy path, validation errors, not-found/conflict, boundary values, edge cases — following project test patterns. Then run the project's test command yourself and fix failures.
189
+ **Done when:** the test suite runs green (paste the actual final summary line).
190
+
191
+ ## Phase 11 — Verify Goals
192
+
193
+ Dispatch **goal-verifier** with the Phase 4 goals and changed files. It checks 4 levels: EXISTS → SUBSTANTIVE → WIRED → DATA-FLOW.
194
+ - **PASS** → Phase 12.
195
+ - **NEEDS-ATTENTION** → fix the listed gaps in place, re-verify.
196
+ - **NEEDS-REMEDIATION** → critical artifacts missing; return to Phase 7 (or Phase 4 if the plan itself was wrong).
197
+ **Done when:** verdict is PASS.
198
+
199
+ ## Phase 12 — Review
200
+
201
+ 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.
202
+
203
+ Then dispatch reviewer agents **in parallel** — every row whose pattern matches changed files AND whose agent exists in `.claude/agents/`:
204
+
205
+ | Changed files | Agent |
206
+ |---|---|
207
+ | `*.go` (not migrations, not tests) | **go-reviewer**, **security-scanner** |
208
+ | `*.sql` migrations | **migration-reviewer**, **database-reviewer** |
209
+ | Data-access files (`*_repo.go`, repositories) | **database-reviewer** |
210
+ | `*.ts`, `*.tsx` | **ts-reviewer** |
211
+ | `*.py` | **py-reviewer**, **security-scanner** |
212
+ | `*.rs` | **rs-reviewer** |
213
+ | Bot code | **bot-reviewer** |
214
+ | UI components | **design-system-reviewer**, **ui-reviewer** |
215
+ | OpenAPI/GraphQL spec changed | **api-contract-sync** |
216
+ | Any changed code | **silent-failure-hunter**, **comment-rot-analyzer** |
217
+
218
+ Pass each agent the changed-file list and task description. Each runs its own two-stage discipline (discover, then triage by Severity + Confidence).
219
+
220
+ Go path, opt-in: if a gopls MCP server is registered, Go edits use `go_symbol_references` (blast radius) before touching a definition and `go_diagnostics` after — never assume the server is wired.
221
+
222
+ Triage findings — route, don't drop:
223
+ - CRITICAL or WARNING at HIGH/MEDIUM confidence → fix before proceeding.
224
+ - LOW confidence / ambiguous → carry into the **Open Questions** section of the Phase 15 report.
225
+ - A clean review (0 findings) is a valid result — do not pad it.
226
+
227
+ **Done when:** all CRITICAL/WARNING findings fixed or explicitly deferred with reason.
228
+
229
+ ## Phase 13 — Critic (Complex only)
230
+
231
+ Dispatch **critic** with all changed files, the original task, and the Phase 12 findings summary. It reviews from security, new-hire, and ops perspectives.
232
+ - **APPROVE** → Phase 14.
233
+ - **CONCERN** → address; proceed if explicitly non-blocking.
234
+ - **BLOCK** → fix blocking issues, re-dispatch.
235
+ **Done when:** verdict is APPROVE, or CONCERN with all concerns addressed/answered.
236
+
237
+ ## Phase 14 — Document
238
+
239
+ Dispatch **docs-reviewer** to verify documentation completeness for the changed files. Also update directly:
240
+ 1. **API spec** (OpenAPI/GraphQL) if endpoints changed.
241
+ 2. **Architecture docs** if system behavior changed.
242
+ 3. **README** if setup, commands, or structure changed.
243
+ **Done when:** docs-reviewer reports no MISSING items for this change.
244
+
245
+ ## Phase 15 — Report
246
+
247
+ Emit only after all non-skipped phases completed:
248
+
249
+ ```
250
+ ## Development Report
251
+
252
+ ### Task
253
+ [Original task description]
254
+
255
+ ### Phases Executed
256
+ | # | Phase | Status | Notes |
257
+ |---|-------|--------|-------|
258
+ | 0 | Read Docs | ✅ | N docs read |
259
+ | 1 | Understand | ✅ | [components], [complexity] |
260
+ | 2 | Architect | ⏭/✅ | [skipped: not Complex / approach chosen] |
261
+ | 3 | Pseudocode | ⏭/✅ | |
262
+ | 4 | Plan | ✅ | N items |
263
+ | 5 | Contract | ⏭/✅ | N criteria |
264
+ | 6 | Validate Plan | ⏭/✅ | PASS after N iterations |
265
+ | 7 | Implement | ✅ | N created, M modified |
266
+ | 8 | Evaluate | ⏭/✅ | PROCEED at pass N |
267
+ | 9 | Verify | ✅ | compilation clean |
268
+ | 10 | Test | ✅ | X tests green |
269
+ | 11 | Verify Goals | ⏭/✅ | PASS (4/4 levels) |
270
+ | 12 | Review | ✅ | [agents]: N findings fixed |
271
+ | 13 | Critic | ⏭/✅ | APPROVE |
272
+ | 14 | Document | ✅ | [docs updated] |
273
+ | 15 | Report | ✅ | this report |
274
+
275
+ ### Changes Made
276
+ | File | Action | Description |
277
+ |------|--------|-------------|
278
+
279
+ ### Open Questions (LOW-confidence review items — surfaced, not dropped)
280
+ - file:line — suspicion + what would confirm it (omit section if none)
281
+
282
+ ### Metrics
283
+ | Metric | Value |
284
+ |--------|-------|
285
+ | Complexity | Simple / Standard / Complex |
286
+ | Agent dispatches | N (list) |
287
+ | Evaluator passes | N (ITERATE → … → PROCEED) |
288
+ | Sprint contract | X/Y criteria met |
289
+
290
+ ### Suggested Commit Message
291
+ type(scope): description
292
+
293
+ Co-Authored-By: Claude <noreply@anthropic.com>
294
+ ```
295
+
296
+ ## Recap — non-negotiables
297
+
298
+ - Phases run in order; Skip Matrix is the only source of skips.
299
+ - Gate verdicts consumed verbatim; failed gate → retry at `max` effort, say so.
300
+ - No completion claims over failing builds/tests; report only after all non-skipped phases.
301
+ - LOW-confidence findings go to Open Questions, never silently dropped.
302
+ - Conventional commits: `feat|fix|docs|refactor|chore|test|perf(scope): description`.
@@ -0,0 +1,75 @@
1
+ ---
2
+ description: "Initialize project documentation — redirects to /superkit-init for intelligent setup"
3
+ argument-hint: "[--non-interactive]"
4
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent
5
+ ---
6
+
7
+ # Initialize Project Documentation
8
+
9
+ ## Role
10
+ Set up project documentation. Prefer `/superkit-init` (intelligent scan + auto-populated docs). Run the manual fallback ONLY when that command is not installed.
11
+
12
+ ## Hard Rules
13
+ - If `/superkit-init` exists, redirect to it and stop — never also run the fallback.
14
+ - Never overwrite an existing root `CLAUDE.md`; create it only when absent.
15
+ - Never reference kit-source paths (`packages/...`); they do not exist in installed projects. Use the inline skeleton below.
16
+ - Fallback touches only: `docs/architecture/`, `docs/trees/`, and `CLAUDE.md` (when absent).
17
+ - Forward the caller's arguments to `/superkit-init` unchanged.
18
+
19
+ ## Steps
20
+
21
+ 1. **Detect the preferred command.** Glob `.claude/commands/superkit-init.md`.
22
+ - Found → do Step 2 (redirect).
23
+ - Not found → do Step 3 (fallback).
24
+ - Done-when: you have chosen redirect or fallback.
25
+
26
+ 2. **Redirect (preferred).** Invoke `/superkit-init`, forwarding the caller's arguments verbatim: $ARGUMENTS
27
+ Then stop — do NOT run Step 3.
28
+ - Done-when: `/superkit-init` finished and its report is shown.
29
+
30
+ 3. **Fallback scaffold** (only when Step 1 found no `superkit-init.md`):
31
+ 1. `mkdir -p docs/architecture docs/trees`
32
+ 2. Dispatch the `tree-generator` agent to populate `docs/trees/`. If the agent is unavailable, note it and skip.
33
+ 3. Read the project root: if `CLAUDE.md` already exists, leave it unchanged. If absent, Write it from the skeleton below, keeping the `TODO:` markers for the user to fill in.
34
+ - Done-when: both dirs exist, trees generated (or skipped with a note), and a root `CLAUDE.md` exists.
35
+
36
+ ### Inline CLAUDE.md skeleton (used by fallback Step 3, only when no root CLAUDE.md exists)
37
+ ```markdown
38
+ # YOUR_PROJECT_NAME
39
+ > TODO: one-line project description.
40
+
41
+ ## Tech Stack
42
+ TODO: backend / frontend / infra.
43
+
44
+ ## Structure
45
+ TODO: top-level directory layout.
46
+
47
+ ## Key Commands
48
+ TODO: build / test / lint / migrate / dev-server commands.
49
+
50
+ ## Conventions
51
+ TODO: formatting, error handling, commit format, API style, env vars.
52
+
53
+ ## Architecture Reference
54
+ | Doc | Description |
55
+ |-----|-------------|
56
+ | docs/architecture/*.md | TODO: fill in per generated template |
57
+ | docs/trees/tree-monorepo.md | Project directory structure |
58
+ ```
59
+
60
+ ## Output
61
+ ```
62
+ ## Docs Init — <redirect | fallback>
63
+ [redirect] Forwarded to /superkit-init — see its report above.
64
+ [fallback]
65
+ docs/architecture/ created
66
+ docs/trees/ <generated | skipped: tree-generator unavailable>
67
+ CLAUDE.md <created from skeleton | unchanged (already existed)>
68
+ Next: fill the TODO sections in CLAUDE.md and docs/architecture/*.
69
+ ```
70
+
71
+ ## Recap
72
+ - `/superkit-init` present → redirect and stop; absent → fallback. Never both.
73
+ - Fallback never overwrites an existing root `CLAUDE.md`.
74
+ - No `packages/...` kit paths — use the inline skeleton.
75
+ - Emit the report only after the chosen branch's Done-when holds.