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,274 @@
1
+ ---
2
+ description: Intelligent project setup — scan codebase, generate filled documentation, configure rules with real paths
3
+ argument-hint: "[--non-interactive]"
4
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent
5
+ ---
6
+
7
+ # Superkit Init — Intelligent Project Setup
8
+
9
+ ## Role
10
+
11
+ Scan the codebase, generate **filled** documentation (not empty templates), and configure superkit rules/hooks with real project paths. Replaces manual CLAUDE.md filling, architecture doc writing, and rule configuration.
12
+
13
+ Parse $ARGUMENTS:
14
+ - Empty (default) → **interactive**: pause at every checkpoint.
15
+ - `--non-interactive` → skip all checkpoints and questions, generate everything automatically.
16
+
17
+ ## Hard Rules
18
+
19
+ 1. Detect by reading code. Do NOT ask the user what their stack is — the only permitted question is the Scaffold stack question (interactive mode, empty project).
20
+ 2. Generated docs describe what EXISTS in the code, not what should exist.
21
+ 3. ALL generated text is English, including TODO placeholders.
22
+ 4. Architecture doc filenames come ONLY from the canonical table in Step 2 — never invent name variants.
23
+ 5. When something cannot be determined from code, write `TODO: [specific question]` — never guess.
24
+ 6. Every generated file starts with the generation stamp (Step 2).
25
+ 7. Emit the final report ONLY after the Done-when gate in Step 5 passes.
26
+
27
+ ## Scaffold path (empty project)
28
+
29
+ Step 1 declares Scaffold when NO language marker exists (no `go.mod`, `package.json`, `Cargo.toml`, `pyproject.toml`, `requirements.txt`). All steps still run in order; this matrix defines each step's behavior:
30
+
31
+ | Step | Full project | Empty project (Scaffold) |
32
+ |------|-------------|--------------------------|
33
+ | 1 Scan | Full detection | Record "empty project". Interactive: ask "What stack will you use? [Go / TypeScript / Python / Rust / Other]". Non-interactive: stack = `TODO: define the stack` |
34
+ | 2 Generate | Arch docs + trees + CLAUDE.md | Minimal CLAUDE.md only (project name, stack answer or the TODO above, empty structure). No arch docs, no trees |
35
+ | 3 Configure rules | Real-path mapping | SKIP — no real paths exist yet; record "rules not configured (empty project)" for the report |
36
+ | 4 Validate | All 3 checks | Single check: CLAUDE.md exists and starts with the generation stamp |
37
+ | 5 Commit & report | Full report | `git add CLAUDE.md` only; use the Scaffold report variant |
38
+
39
+ ## Step 1 — Scan (project introspection)
40
+
41
+ ### Languages & frameworks
42
+
43
+ | Marker | Detected As |
44
+ |--------|-------------|
45
+ | `go.mod` | Go. Read `go.mod` for framework: `chi`, `gin`, `echo`, `fiber` |
46
+ | `package.json` + `tsconfig.json` | TypeScript. Read `package.json` for: react/vue/svelte/angular, vite/webpack/next |
47
+ | `pyproject.toml` / `requirements.txt` | Python. Read for: fastapi/django/flask |
48
+ | `Cargo.toml` | Rust. Read for: actix/axum/rocket |
49
+
50
+ ### Infrastructure
51
+
52
+ | Check | How |
53
+ |-------|-----|
54
+ | Database | `docker-compose*.yml` → postgres/mysql/mongo. `.env` → `DB_*`, `DATABASE_URL` |
55
+ | Cache | `docker-compose*.yml` → redis. Imports: `go-redis`, `ioredis`, `redis-py` |
56
+ | Storage | `docker-compose*.yml` → minio/s3. Imports: `minio-go`, `@aws-sdk/client-s3` |
57
+ | Auth | Grep for: `jwt`, `session`, `oauth`, `passport`, `auth middleware` |
58
+ | CI/CD | `.github/workflows/`, `Dockerfile`, `docker-compose*.yml`, `.gitlab-ci.yml` |
59
+
60
+ ### Structure
61
+
62
+ ```bash
63
+ # Detect monorepo vs single
64
+ find . -maxdepth 3 -name "go.mod" -o -name "package.json" | grep -v node_modules | wc -l
65
+ # If > 1 → monorepo
66
+
67
+ # Detect components
68
+ ls -d */ | head -20
69
+ # Look for: backend/, frontend/, adminpanel/, bots/, workers/, services/, apps/
70
+
71
+ # Scale
72
+ find . -name "*.go" -o -name "*.ts" -o -name "*.py" -o -name "*.rs" | grep -v node_modules | grep -v vendor | wc -l
73
+ ```
74
+
75
+ ### Existing docs
76
+
77
+ ```bash
78
+ test -f CLAUDE.md && echo "HAS_CLAUDE_MD"
79
+ test -f AGENTS.md && echo "HAS_AGENTS_MD"
80
+ test -d docs/architecture && echo "HAS_ARCH_DOCS" && ls docs/architecture/
81
+ test -f backend/docs/openapi.yaml && echo "HAS_OPENAPI"
82
+ ```
83
+
84
+ ### Scan summary
85
+
86
+ Summarize findings internally (do NOT save to file):
87
+ ```
88
+ Stack: Go 1.23 (chi, pgx), TypeScript (React 19, Vite), PostgreSQL 16, Redis 7
89
+ Structure: monorepo (backend/, frontend/, adminpanel/)
90
+ Components: 3 (backend, frontend, adminpanel)
91
+ Scale: ~450 files, 50 migrations, 67 endpoints
92
+ Auth: JWT + Redis sessions
93
+ Infra: Docker Compose, GitHub Actions
94
+ Existing docs: CLAUDE.md (TODO-heavy), no architecture docs
95
+ ```
96
+
97
+ **Done when:** internal summary produced, OR Scaffold declared per the matrix.
98
+
99
+ ## Step 2 — Generate documentation
100
+
101
+ For EACH detected component, read actual code and generate **filled** docs. Minimize TODOs.
102
+
103
+ Every generated file starts with:
104
+ ```markdown
105
+ > Generated by `/superkit-init` on YYYY-MM-DD. Review and customize for your project.
106
+ ```
107
+
108
+ ### Architecture docs — canonical names
109
+
110
+ Generate only docs matching detected components. These six filenames are canonical — each matches a shipped template in `docs-templates/architecture/` and is exactly what `/superkit-evolve` checks. Use them exactly (e.g. `api-reference.md`, not `backend-api-reference.md`; `frontend-state.md`, not `frontend-state-contracts.md`):
111
+
112
+ | Condition | Generate | How |
113
+ |-----------|----------|-----|
114
+ | Backend detected | `docs/architecture/backend-layers.md` | Read cmd/, internal/, routes → describe layers, DI, error handling |
115
+ | API routes found | `docs/architecture/api-reference.md` | Grep route registrations → list endpoints with method, path, auth |
116
+ | Migrations dir exists | `docs/architecture/database-schema.md` | Read last 10 migrations → list tables, columns, constraints |
117
+ | Auth code detected | `docs/architecture/auth-and-sessions.md` | Read auth service → describe token/session lifecycle |
118
+ | Frontend detected | `docs/architecture/frontend-state.md` | Read src/ → routing, state, data fetching |
119
+ | Docker/CI detected | `docs/architecture/deployment.md` | Read docker-compose, Dockerfile → describe how to run |
120
+
121
+ For each doc:
122
+ 1. Read 3-5 key source files in the component.
123
+ 2. Write a structured doc describing what EXISTS (not what should exist).
124
+ 3. Unknown detail → `TODO: [specific question]`.
125
+
126
+ ### Decision records (optional — offer, never force)
127
+
128
+ Ask the user whether to seed a `docs/adr/` namespace for architecture decision records (separate from the current-state architecture docs above; no filename collision). If they accept, create `docs/adr/` with a short `README.md` index — a one-line purpose plus a note to copy `docs-templates/adr-template.md` to `docs/adr/NNNN-<slug>.md` for any significant choice with real alternatives. If they decline, skip it silently.
129
+
130
+ ### Project trees
131
+
132
+ ```bash
133
+ mkdir -p docs/trees
134
+ ```
135
+
136
+ Generate with the `tree` command; if `tree` is unavailable, fall back to `find . -maxdepth 2 -type d -not -path '*/node_modules/*' -not -path '*/.git/*'`:
137
+ - If monorepo: `tree-monorepo.md` (depth 2)
138
+ - Per-component: `tree-{component}.md` (depth 3)
139
+
140
+ ### CLAUDE.md
141
+
142
+ If CLAUDE.md doesn't exist or is the superkit TODO template, generate a filled version reading from:
143
+ - README.md → project description
144
+ - package.json / go.mod → tech stack with versions
145
+ - Makefile / package.json scripts → key commands
146
+ - Existing migrations → migration format and count
147
+ - Generated arch docs → architecture reference table
148
+ - .editorconfig / linter configs → conventions
149
+
150
+ ### Checkpoint (interactive mode only)
151
+
152
+ ```
153
+ ✅ Generated documentation:
154
+ docs/architecture/backend-layers.md (142 lines)
155
+ docs/architecture/database-schema.md (89 lines)
156
+ docs/architecture/frontend-state.md (67 lines)
157
+ docs/trees/tree-monorepo.md
158
+ docs/trees/tree-backend.md
159
+ docs/trees/tree-frontend.md
160
+ CLAUDE.md (95 lines, 2 TODOs remaining)
161
+
162
+ Review before configuring rules? [continue / show <file> / edit <file>]
163
+ ```
164
+
165
+ In `--non-interactive` mode: no checkpoint, proceed to Step 3.
166
+
167
+ **Done when:** every doc from the condition table (or the Scaffold CLAUDE.md) is written to disk with the generation stamp.
168
+
169
+ ## Step 3 — Configure rules
170
+
171
+ Adapt superkit rules to use **real project paths** (not generic patterns). Scaffold: skip per the matrix.
172
+
173
+ ### documentation.md rule
174
+
175
+ Read `.claude/rules/documentation.md`. Update the trigger-to-doc mapping table with real paths detected in Step 1:
176
+
177
+ ```
178
+ | # | Trigger (from Step 1 scan) | Required Doc | File Path |
179
+ |---|----------------------------|-------------|-----------|
180
+ | 1 | {actual migrations path}/*.sql | Database schema | docs/architecture/database-schema.md |
181
+ | 2 | {actual handlers path}/*.go | API reference | docs/architecture/api-reference.md |
182
+ ...
183
+ ```
184
+
185
+ ### doc-check-on-commit.sh hook
186
+
187
+ Update `.claude/scripts/hooks/doc-check-on-commit.sh` with project-specific path mappings for the smart blocker.
188
+
189
+ ### Checkpoint (interactive mode only)
190
+
191
+ ```
192
+ ✅ Configured rules with your project paths:
193
+ .claude/rules/documentation.md — N-row trigger mapping with real paths
194
+ .claude/scripts/hooks/doc-check-on-commit.sh — smart mapping for N categories
195
+
196
+ Review? [continue / show rules]
197
+ ```
198
+
199
+ In `--non-interactive` mode: no checkpoint.
200
+
201
+ **Done when:** both files updated with detected paths (or Scaffold skip recorded).
202
+
203
+ ## Step 4 — Validate
204
+
205
+ 1. **Path check** — backticked literal paths in rules and CLAUDE.md must exist (portable — no `grep -P`):
206
+ ```bash
207
+ grep -hoE '`[^` ]*/[^` ]*\.(go|ts|tsx|sql|py|rs|md)`' .claude/rules/documentation.md CLAUDE.md 2>/dev/null \
208
+ | tr -d '`' | sort -u | grep -v '\*' | while read -r p; do
209
+ [ -e "$p" ] || echo "BROKEN: $p"
210
+ done
211
+ ```
212
+ Extracted strings that contain `*` are glob patterns: check each with the Glob tool; a pattern with zero matches → fix it or replace with a real path. Bare filenames without `/` are code spans — ignore them.
213
+
214
+ 2. **Cross-reference** — migration count in CLAUDE.md matches the actual file count in the migrations directory.
215
+
216
+ 3. **Consistency** — the CLAUDE.md architecture reference table lists every doc generated in Step 2.
217
+
218
+ **Done when:** re-run after fixes prints zero `BROKEN` lines, all globs match, counts agree. Scaffold: CLAUDE.md exists with the generation stamp.
219
+
220
+ ## Step 5 — Commit & report
221
+
222
+ ```bash
223
+ git add docs/ CLAUDE.md .claude/rules/ .claude/scripts/hooks/
224
+ git commit -m "chore: initialize project documentation via superkit-init
225
+
226
+ Generated:
227
+ - docs/architecture/ (N files, filled from code analysis)
228
+ - docs/trees/ (N files)
229
+ - CLAUDE.md (populated with project details)
230
+ - .claude/rules/ (configured with project-specific paths)
231
+
232
+ Co-Authored-By: Claude <noreply@anthropic.com>"
233
+ ```
234
+
235
+ Scaffold: `git add CLAUDE.md` and a message noting the minimal scaffold.
236
+
237
+ ### Done ONLY when
238
+
239
+ - [ ] Every file named in the report exists on disk — verified with `ls`/Read this session, not from memory.
240
+ - [ ] Step 4 passed on its final run (zero `BROKEN`, globs match; Scaffold: stamp check passed).
241
+ - [ ] Commit exists — `git log --oneline -1` shows it.
242
+ - [ ] `TODOs remaining: X` equals the real count: `grep -ro 'TODO:' CLAUDE.md docs/architecture/ 2>/dev/null | wc -l`.
243
+
244
+ Any box unchecked → state what is missing and fix it; do not emit the report.
245
+
246
+ ## Output — final report
247
+
248
+ ```
249
+ ✅ superkit-init complete!
250
+
251
+ Generated: N architecture docs, M tree files, CLAUDE.md
252
+ Configured: documentation rule, doc-check hook
253
+ TODOs remaining: X (areas that need manual input)
254
+
255
+ Next: start coding! The /dev pipeline now has full project context.
256
+ Run /superkit-evolve anytime to update docs as your project grows.
257
+ ```
258
+
259
+ Scaffold variant — replace the middle and Next lines with:
260
+ ```
261
+ Generated: CLAUDE.md (minimal — empty project)
262
+ Configured: nothing — rules skipped, no real paths yet
263
+ TODOs remaining: X
264
+
265
+ Next: project is empty. Start with /dev <task>, then run /superkit-evolve once code exists.
266
+ ```
267
+
268
+ ## Recap — non-negotiables
269
+
270
+ - Detect by reading code; the Scaffold stack question is the only question allowed.
271
+ - Canonical doc filenames only (Step 2 table); all generated text in English.
272
+ - Unknowns become `TODO: [specific question]` — never invented content.
273
+ - Empty project → follow the Scaffold column for every step, including the skip of Step 3.
274
+ - Final report only after every Done-ONLY-when box is checked.
@@ -0,0 +1,108 @@
1
+ ---
2
+ description: Auto-detect and run project tests — supports Go, TypeScript, Python, Rust, and more
3
+ argument-hint: "[backend|frontend|e2e|all] [--coverage]"
4
+ allowed-tools: Bash
5
+ ---
6
+
7
+ # Run Tests
8
+
9
+ Auto-detect the project's test runner, execute the tests for the requested scope, and report the runner's real results.
10
+
11
+ ## Hard Rules
12
+
13
+ - Report the runner's REAL output — paste the actual pass/fail/skip lines; never summarize from memory or invent counts.
14
+ - Consume the argument exactly as `scope` + optional `--coverage`; when no scope is given, default to `backend`.
15
+ - If the chosen scope has no matching markers (e.g. `backend` on a frontend-only repo), fall back to running all detected suites — never do nothing.
16
+ - Detect commands only from the Step 1–2 tables; do not invent test commands or flags.
17
+ - When a `Makefile` `test` target exists for the stack, prefer `make test`.
18
+ - For scope `all`, run every detected suite sequentially and report each separately.
19
+ - On failure, show the first 5 failure details for diagnosis — no more.
20
+
21
+ ## Step 1 — Detect Test Runner
22
+
23
+ Scan the project root and subdirectories for stack markers:
24
+
25
+ | Marker | Test Command | Stack |
26
+ |--------|-------------|-------|
27
+ | `go.mod` | `go test ./... -count=1` | Go |
28
+ | `package.json` + vitest config | `npx vitest run` | Vitest |
29
+ | `package.json` + jest config | `npx jest` | Jest |
30
+ | `package.json` + playwright config | `npx playwright test` | Playwright (e2e) |
31
+ | `cypress.config.{js,ts}` | `npx cypress run` | Cypress (e2e) |
32
+ | `pyproject.toml` / `pytest.ini` / `conftest.py` | `pytest` | Python (pytest) |
33
+ | `pyproject.toml` with `[tool.unittest]` | `python -m unittest discover` | Python (unittest) |
34
+ | `tests/e2e/` dir + pytest | `pytest tests/e2e/` | Python E2E (selenium) |
35
+ | `Cargo.toml` | `cargo test` | Rust |
36
+ | `pom.xml` | `mvn test` | Java (Maven) |
37
+ | `build.gradle` | `./gradlew test` | Java/Kotlin (Gradle) |
38
+ | `Makefile` with `test` target | `make test` | Makefile |
39
+
40
+ If a `Makefile` with a `test` target exists and the stack has one, prefer `make test` as it may include additional setup.
41
+
42
+ **Done when:** every stack present in the repo is mapped to its exact test command (or to `make test`).
43
+
44
+ ## Step 2 — Determine Scope and Coverage
45
+
46
+ Parse `$ARGUMENTS` into a `scope` token (`backend` | `frontend` | `e2e` | `all`; empty → `backend`) and an optional `--coverage` flag, then select commands:
47
+
48
+ ### backend (default)
49
+ Run backend tests only:
50
+ - **Go**: `go test ./... -count=1 -short` (`-short` skips integration tests that need external services)
51
+ - **Python**: `pytest tests/` or `pytest`
52
+ - **Rust**: `cargo test`
53
+ - **Java**: `mvn test` / `./gradlew test`
54
+
55
+ If the project is a monorepo, `cd` into the backend directory first (detect by `backend/`, `server/`, `api/`, or `src/` containing the go.mod/pyproject.toml).
56
+
57
+ **Fallback:** if no backend markers are detected, run all detected suites instead (treat as scope `all`).
58
+
59
+ ### frontend
60
+ Run frontend tests:
61
+ - **Vitest**: `npx vitest run`
62
+ - **Jest**: `npx jest`
63
+
64
+ If the project is a monorepo, `cd` into the frontend directory first (detect by `frontend/`, `web/`, `client/`, or `app/` containing package.json).
65
+
66
+ ### e2e
67
+ Run end-to-end tests:
68
+ - **Playwright**: `npx playwright test`
69
+ - **Cypress**: `npx cypress run`
70
+ - **pytest + selenium**: `pytest tests/e2e/`
71
+
72
+ ### all
73
+ Run every detected suite (backend + frontend + e2e) sequentially. Report results for each.
74
+
75
+ ### --coverage (append when the flag is present)
76
+ - **Go**: `go test ./... -coverprofile=coverage.out` then `go tool cover -func=coverage.out | tail -1`
77
+ - **Vitest/Jest**: append `--coverage`
78
+ - **pytest**: append `--cov`
79
+ - **Rust**: requires `cargo-tarpaulin` — `cargo tarpaulin`
80
+
81
+ **Done when:** the exact command(s) to run are assembled, including any coverage flags, monorepo `cd`, and the `all` fallback if the scope had no markers.
82
+
83
+ ## Step 3 — Run and Report
84
+
85
+ Execute the assembled command(s). Paste the runner's real output, then fill the template below. For scope `all`, repeat the per-stack block once per suite. If tests fail, show the first 5 failure details for diagnosis.
86
+
87
+ ```
88
+ ## Test Results
89
+
90
+ ### [Stack Name]
91
+ - Command: `[exact command run]`
92
+ - Result: X passed, Y failed, Z skipped
93
+ - Duration: Ns
94
+ - Coverage: XX% (if --coverage flag used)
95
+
96
+ ### Failures (if any)
97
+ 1. TestName — error message (file:line)
98
+ 2. ...
99
+ ```
100
+
101
+ **Done when:** every selected command has been executed, its real output pasted, and the Test Results template filled for each suite.
102
+
103
+ ## Recap — non-negotiables
104
+
105
+ - Paste the runner's REAL output; never fabricate counts or claim a pass you did not see.
106
+ - Default scope is `backend`; if no backend markers exist, run all detected suites.
107
+ - Use only the commands/flags in the Step 1–2 tables; prefer `make test` when a test target exists.
108
+ - On failures, show the first 5 for diagnosis.
@@ -0,0 +1,150 @@
1
+ ---
2
+ description: Run a predefined workflow template — bugfix, hotfix, spike, refactor, dep-upgrade, security-audit
3
+ argument-hint: <template> [task-description]
4
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Agent
5
+ ---
6
+
7
+ # Workflow Templates
8
+
9
+ Run one of six opinionated workflow templates. Each template fixes an ordered list of phases and the agents to dispatch, so common task types follow the same proven path every time.
10
+
11
+ ## Target
12
+
13
+ $ARGUMENTS
14
+
15
+ ## Hard Rules
16
+
17
+ 1. Run only the template named in Target. If Target names none, or the first word matches no template, do not guess — follow Step 3 or Step 4 and stop until the user answers.
18
+ 2. Execute a template's phases in listed order. A phase begins only after the previous phase's done-when condition holds.
19
+ 3. Report status after every phase, and emit the Workflow Report only when every executed phase has a status row.
20
+ 4. On a failed gate or retry, escalate effort to `max` for the next attempt and state that you are doing so — never silently re-run at the same effort.
21
+ 5. spike produces a report only (no code changes); hotfix applies the minimal fix (no refactoring, no improvements).
22
+ 6. When consuming security-scanner output, use its exact enums — Severity CRITICAL/WARNING/SUGGESTION, Confidence HIGH/MEDIUM/LOW.
23
+ 7. For tasks that fit no template, tell the user to use `/dev` instead of forcing a template.
24
+
25
+ ## Steps
26
+
27
+ 1. Read the template name from the first word of Target. Done when: the name equals one of the six templates below, or you route to Step 3/4.
28
+ 2. Read the task description from the rest of Target. Done when: the task text is captured (empty is allowed — spike and security-audit can run without a description).
29
+ 3. If Target names no template — list the six templates with their one-line summaries and ask the user to choose. Done when: the user names a template; do not proceed before then.
30
+ 4. If the first word matches no template — name the single closest template and ask the user to confirm before running it. Done when: the user confirms or picks another; do not proceed before then.
31
+ 5. Run the matched template's phases (see Templates) in order. At each dispatch point, dispatch the named agent; if that agent is absent from `.claude/agents/`, perform the phase inline and write "agent unavailable — ran inline" in that phase's Notes. Done when: every phase's done-when condition is met.
32
+ 6. After each phase, record its status row for the Workflow Report (see Output). Done when: Step 5's final phase done-when holds and every executed phase has a row — only then emit the report.
33
+
34
+ ## Templates
35
+
36
+ ### `bugfix` — Triage, fix, verify, test
37
+
38
+ For bug reports and regressions.
39
+
40
+ 1. **Triage** — reproduce the bug as a failing test, identify root cause (dispatch **debug-observer**). Done when: a failing test that reproduces the bug exists (red) and one root cause is named.
41
+ 2. **Fix** — implement the fix following existing patterns. Done when: the fix is applied, the changed files compile, and the previously-failing test now passes (green).
42
+ 3. **Verify** — run compilation checks, ensure no regressions. Done when: build/typecheck passes with no new errors.
43
+ 4. **Test** — run the full suite and add any additional coverage the fix warrants. Done when: the full suite passes with no regressions.
44
+
45
+ ### `hotfix` — Fix, test, deploy-check
46
+
47
+ For urgent production issues. Minimal process, maximum speed.
48
+
49
+ 1. **Fix** — implement the minimal fix (no refactoring, no improvements). Done when: the minimal change is applied and compiles.
50
+ 2. **Test** — run existing tests, add a regression test if quick. Done when: existing tests pass.
51
+ 3. **Deploy-check** — verify build succeeds, no breaking changes to API/DB. Done when: the build succeeds and no API/DB-breaking change is detected.
52
+
53
+ ### `spike` — Scope, research, summarize
54
+
55
+ For exploration and investigation. No code changes — research only.
56
+
57
+ 1. **Scope** — define what we are investigating and its success criteria. Done when: the question and success criteria are written down.
58
+ 2. **Research** — explore the codebase, read docs, search for patterns, check dependencies. Done when: enough evidence is gathered to answer the scoped question.
59
+ 3. **Summarize** — structured findings with recommendations and next steps. Done when: the report contains findings, recommendations, and next steps. Spike produces a report, not code — use the findings to plan implementation separately.
60
+
61
+ ### `refactor` — Baseline, inventory, plan, migrate, verify
62
+
63
+ For restructuring code without changing behavior.
64
+
65
+ 1. **Baseline** — confirm the affected tests exist and pass green before any change; if coverage is thin, write characterization tests first. Done when: the affected suite is green, or characterization tests were added and are green.
66
+ 2. **Inventory** — list all files/functions affected, map dependencies. Done when: the affected file/function list and dependency map are written.
67
+ 3. **Plan** — define the target structure, migration order, rollback strategy. Done when: target structure, leaf-first migration order, and rollback strategy are all stated.
68
+ 4. **Migrate** — execute changes in dependency order (leaf files first). Done when: every planned file is migrated leaf-first and compiles.
69
+ 5. **Verify** — compilation clean, all tests pass, no behavior changes (dispatch **health-checker**). Done when: build is clean, the full suite passes, and health-checker reports no behavior change.
70
+
71
+ ### `dep-upgrade` — Assess, upgrade, fix-breaking, verify
72
+
73
+ For dependency updates and vulnerability fixes.
74
+
75
+ 1. **Assess** — dispatch **dependency-checker** for a full audit. Done when: dependency-checker has returned its audit.
76
+ 2. **Upgrade** — apply updates in safe order (patches first, then minors, then majors). Done when: the planned updates are applied in that order.
77
+ 3. **Fix-breaking** — resolve any breaking changes from major updates. Done when: no unresolved breaking-change compile or test errors remain.
78
+ 4. **Verify** — compilation clean, tests pass, no regressions (dispatch **health-checker**). Done when: build is clean, tests pass, and health-checker reports no regressions.
79
+
80
+ ### `security-audit` — Scan, triage, remediate, re-scan
81
+
82
+ For security review and hardening.
83
+
84
+ 1. **Scan** — dispatch **security-scanner** for a full OWASP + config audit. Done when: security-scanner has returned its findings.
85
+ 2. **Triage** — prioritize findings by Severity and exploitability. Done when: every finding carries a Severity (CRITICAL/WARNING/SUGGESTION) and Confidence (HIGH/MEDIUM/LOW).
86
+ 3. **Remediate** — fix CRITICAL and WARNING findings (HIGH/MEDIUM confidence); list LOW-confidence items under Next Steps rather than fixing blind. Done when: no CRITICAL and no HIGH/MEDIUM-confidence WARNING remains unresolved (or each is explicitly recorded as accepted).
87
+ 4. **Re-scan** — dispatch **security-scanner** again to verify fixes and check for new issues. Done when: the re-scan confirms the remediated findings are gone and introduces no new CRITICAL or WARNING.
88
+
89
+ ## Output
90
+
91
+ Emit exactly this structure. Status is one of `done` / `blocked` / `skipped`. The Result cell holds a short observable outcome (a count, a verdict, a named cause) — never a wall-clock estimate.
92
+
93
+ ```
94
+ ## Workflow Report: [template]
95
+
96
+ ### Task
97
+ [Original task description]
98
+
99
+ ### Phases
100
+ | Phase | Status | Result | Notes |
101
+ |-------|--------|--------|-------|
102
+ | [phase] | done/blocked/skipped | [observable outcome] | [notes] |
103
+
104
+ ### Changes Made
105
+ | File | Action | Description |
106
+ |------|--------|-------------|
107
+ | path | Created/Modified | description |
108
+
109
+ ### Next Steps
110
+ - [recommendations, LOW-confidence items, or "none"]
111
+ ```
112
+
113
+ Filled example (bugfix):
114
+
115
+ ```
116
+ ## Workflow Report: bugfix
117
+
118
+ ### Task
119
+ Nil-pointer panic in checkout when cart is empty
120
+
121
+ ### Phases
122
+ | Phase | Status | Result | Notes |
123
+ |-------|--------|--------|-------|
124
+ | Triage | done | root cause: unchecked cart.Items[0]; failing repro test written (red) | debug-observer reproduced with empty cart |
125
+ | Fix | done | guard added in checkout.go; repro test now passes (green) | followed existing early-return pattern |
126
+ | Verify | done | build clean, 0 new errors | |
127
+ | Test | done | full suite green, 214 pass | no further coverage needed |
128
+
129
+ ### Changes Made
130
+ | File | Action | Description |
131
+ |------|--------|-------------|
132
+ | checkout.go | Modified | early return when cart is empty |
133
+ | checkout_test.go | Modified | regression test for empty cart |
134
+
135
+ ### Next Steps
136
+ - none
137
+ ```
138
+
139
+ ## Notes
140
+
141
+ - Templates auto-detect the project stack (Go, TypeScript, Python, Rust) for their build/test commands.
142
+ - Templates can be chained: e.g. `bugfix` a defect, then `dep-upgrade` the affected dependency.
143
+
144
+ ## Recap — non-negotiables
145
+
146
+ - Run only the named template; on missing/unrecognized input, list templates or offer the closest match and stop.
147
+ - Phases run in order — each starts only after the prior phase's done-when holds; report a status row per phase.
148
+ - Escalate effort to `max` on a failed gate or retry and say so; never silently re-run at the same effort.
149
+ - security-audit remediation targets CRITICAL and WARNING findings (HIGH/MEDIUM confidence) in security-scanner's exact enums.
150
+ - Emit the Workflow Report only when every executed phase has a row.
@@ -0,0 +1,41 @@
1
+
2
+ ## Your First Commands
3
+
4
+ After installation, here's what to try:
5
+
6
+ ### 1. Verify installation
7
+ Open Claude Code in your project and try:
8
+ ```
9
+ /review --full
10
+ ```
11
+ This dispatches reviewer agents against your entire codebase. You should see a dispatch plan, then findings grouped by severity.
12
+
13
+ ### 2. Run a quick audit
14
+ ```
15
+ /audit
16
+ ```
17
+ Dispatches up to 4 parallel audit agents (frontend, backend, infra, security). Each produces a findings report.
18
+
19
+ ### 3. Check project health
20
+ ```
21
+ /dev <describe your task>
22
+ ```
23
+ The dev orchestrator runs 16 phases (understand → plan → implement → verify → test → review → document → report, plus plan-check, sprint-contract, goal-verify, and critic gates).
24
+
25
+ ### If Something Doesn't Work
26
+
27
+ 1. **settings.json invalid?** Run `jq empty .claude/settings.json` — no output means valid
28
+ 2. **Hooks not firing?** Run `chmod +x .claude/scripts/hooks/*.sh`
29
+ 3. **No agents found?** Check `ls .claude/agents/` — should have .md files
30
+ 4. **Need help?** See `TROUBLESHOOTING.md` in the superkit repo
31
+
32
+ ## Prerequisites
33
+
34
+ | Tool | Required | Install |
35
+ |------|----------|---------|
36
+ | Claude Code CLI | Yes | `npm install -g @anthropic-ai/claude-code` |
37
+ | git | Yes | System package manager |
38
+ | jq | Yes | `brew install jq` (macOS) or `apt install jq` (Linux) |
39
+ | Superpowers plugin | Recommended | Claude Code → `/plugins` → search "superpowers" |
40
+ | GitHub CLI (gh) | Optional | `brew install gh` — needed for `--comment` in /review |
41
+ | tree | Optional | `brew install tree` — nicer project tree generation |
@@ -0,0 +1,33 @@
1
+ # Architecture Doc Templates
2
+
3
+ Copy relevant templates to your project's `docs/architecture/` directory and fill in the TODOs.
4
+
5
+ ## Which templates to use
6
+
7
+ | Template | Use when your project has... |
8
+ |----------|----------------------------|
9
+ | `backend-layers.md` | Any backend (Go, Node, Python, Rust) |
10
+ | `api-reference.md` | REST/GraphQL API endpoints |
11
+ | `database-schema.md` | SQL database with migrations |
12
+ | `auth-and-sessions.md` | Authentication system |
13
+ | `frontend-state.md` | Frontend app (React, Vue, Svelte) |
14
+ | `deployment.md` | Production deployment process |
15
+ | `api-contracts.md` | External API integrations |
16
+ | `data-flow.md` | Complex multi-step data flows |
17
+ | `../adr-template.md` | A significant choice with real alternatives to record — copies to `docs/adr/NNNN-<slug>.md`, not `architecture/` |
18
+
19
+ > **ADR template.** `adr-template.md` lives one level up (not in `architecture/`) because ADRs target a separate `docs/adr/` namespace. Use it only for decisions with real alternatives and lasting consequences (framework/library choice, data-model shape, protocol/API style, security model) — never for trivial or reversible choices. It records the WHY and the rejected alternatives, which the current-state architecture docs deliberately do not.
20
+
21
+ ## How to use
22
+
23
+ 1. Run `/docs-init` in Claude Code — auto-detects which templates apply
24
+ 2. Or manually: `cp packages/core/docs-templates/architecture/*.md docs/architecture/`
25
+ 3. Fill in the TODOs
26
+ 4. Delete templates that don't apply
27
+ 5. Add custom docs as your project grows
28
+
29
+ ## Tips
30
+
31
+ - Start minimal — fill only what you know now, expand later
32
+ - These docs are read by AI agents (Phase 0) — accurate docs = better reviews
33
+ - The `docs-reviewer` agent will flag stale docs after code changes
@@ -0,0 +1,62 @@
1
+ # ADR-NNNN: <decision title>
2
+
3
+ > **When to write one.** Copy this file to `docs/adr/NNNN-<slug>.md` (zero-padded
4
+ > sequence, e.g. `0007-postgres-over-mongo.md`) and fill it in. Write an ADR only
5
+ > for decisions with **real alternatives and lasting consequences** — a framework
6
+ > or library choice, a data-model shape, a protocol/API style, a security model.
7
+ > Never write one for trivial or easily-reversible choices (formatting, naming, a
8
+ > local helper's signature): an ADR for everything is ceremony that kills the
9
+ > habit. The point of the record is the WHY and the rejected alternatives — the
10
+ > context that stops a future session from re-litigating or silently violating
11
+ > this decision.
12
+
13
+ ## Status
14
+
15
+ `proposed` → `accepted` → `deprecated` | `superseded-by-NNNN`
16
+
17
+ - **Status:** proposed
18
+ - **Date:** YYYY-MM-DD
19
+
20
+ Start at `proposed`; move to `accepted` once the decision is in effect. When a
21
+ later ADR overrides this one, set the status here to `superseded-by-NNNN` and
22
+ link the replacement so the trail stays intact.
23
+
24
+ ## Context
25
+
26
+ <!-- The forces at play: the constraints, requirements, and trade-offs that make
27
+ this a real decision. 3-6 lines. State the problem, not the solution. -->
28
+
29
+ TODO: What situation forces a decision? What technical, product, or team
30
+ constraints bound the choice? What is non-negotiable, and what is flexible?
31
+
32
+ ## Decision
33
+
34
+ <!-- What was chosen. Active voice: "We use X." One clear statement, then the
35
+ few reasons that made it win over the alternatives below. -->
36
+
37
+ TODO: We <verb> <choice>, because <the decisive reasons>.
38
+
39
+ ## Alternatives Considered
40
+
41
+ <!-- The whole point of the record. For each serious alternative, name it and
42
+ say WHY it was rejected — that rejection rationale is what future readers need. -->
43
+
44
+ ### Alternative A — <name>
45
+ - **What it was:** TODO: one line.
46
+ - **Why rejected:** TODO: the specific reason it lost (cost, risk, complexity,
47
+ missing capability, team unfamiliarity, lock-in).
48
+
49
+ ### Alternative B — <name>
50
+ - **What it was:** TODO: one line.
51
+ - **Why rejected:** TODO: the specific reason it lost.
52
+
53
+ <!-- Add a third only if a third option was genuinely on the table. -->
54
+
55
+ ## Consequences
56
+
57
+ <!-- What this decision makes easier AND harder. Include the negative ones
58
+ honestly — a decision with no downsides usually means one wasn't recorded. -->
59
+
60
+ - **Easier:** TODO: what this unlocks or simplifies.
61
+ - **Harder / accepted cost:** TODO: the downside you are knowingly taking on.
62
+ - **Follow-ups:** TODO: any migration, guardrail, or revisit-trigger this implies.