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,68 @@
1
+ ---
2
+ alwaysApply: true
3
+ tokens: 755
4
+ ---
5
+
6
+ # Coding Style
7
+
8
+ Always-on discipline for every response that touches code: verify before you claim, change only what was asked, follow the style rules below.
9
+
10
+ ## Investigate Before Answering
11
+ - Never speculate about code you have not opened
12
+ - If a user references a file — READ it before answering
13
+ - Do NOT invent API endpoints, package names, or function signatures
14
+ - Do NOT assume a package exists — verify in package registry or node_modules/go.mod
15
+ - If unsure whether something exists — grep for it first
16
+
17
+ ## Surgical Changes
18
+ - Change ONLY what was requested — nothing more
19
+ - A bug fix does NOT need surrounding code cleaned up
20
+ - A new feature does NOT need existing code refactored
21
+ - Do NOT "improve" code you're passing through
22
+ - Do NOT add docstrings, comments, or type annotations to code you didn't change
23
+ - If you see a real problem in unrelated code — mention it, don't fix it
24
+ - Three similar lines of code is better than a premature abstraction
25
+
26
+ ## Search First
27
+ - Check codebase for existing patterns before writing new code
28
+ - Check packages before reimplementing
29
+ - Name the precedent you follow (file:line) — or state explicitly that no precedent was found after searching
30
+
31
+ ## Solution Ladder (before writing new code)
32
+
33
+ Stop at the first rung that holds:
34
+ 1. Doesn't need to exist (YAGNI)? — don't write it (anti-patterns below).
35
+ 2. Already in this codebase? — reuse it (Search First above).
36
+ 3. Stdlib covers it? — use stdlib; don't reimplement, don't add a dependency.
37
+ 4. Native platform feature covers it? — use it: `<input type="date">` over a picker lib, CSS over JS, a DB constraint over app-level checks.
38
+ 5. An installed dependency covers it? — use it. Never add a NEW dependency for what stdlib, the platform, or a few lines can do.
39
+
40
+ Mark a deliberate simplification with a comment naming its ceiling and the upgrade trigger: `// simplified: global lock; per-account locks if throughput matters`.
41
+
42
+ Minimal never means fragile: input validation at trust boundaries, error handling, security, and accessibility are never simplified away — and anything explicitly requested is never dropped.
43
+
44
+ ## YAGNI Anti-Patterns (canonical)
45
+ - Abstraction with one implementation
46
+ - Config option nobody sets
47
+ - Scaffolding "for later"
48
+ - Wrapper that adds nothing over what it wraps
49
+ - Dead flag/parameter kept "just in case"
50
+
51
+ ## General
52
+ - Use language-standard formatter
53
+ - No magic numbers — named constants
54
+ - No commented-out code
55
+ - Early returns over nesting
56
+ - Max ~50 lines per function
57
+ - No global state — DI via constructors
58
+
59
+ ## Testing
60
+ - Tests required for: new endpoints, bug fixes (regression test), business logic
61
+ - Tests optional for: pure UI, config, docs
62
+ - "should [behavior] when [condition]" naming
63
+
64
+ ## Parallel Execution
65
+ - When reading multiple files — read them all in parallel (multiple Read calls in one message)
66
+ - When searching for patterns — run multiple Grep calls in parallel
67
+ - When dispatching independent agents — dispatch ALL simultaneously
68
+ - Only sequence calls that depend on previous results
@@ -0,0 +1,77 @@
1
+ ---
2
+ alwaysApply: true
3
+ tokens: 1145
4
+ ---
5
+
6
+ # Auto Dev Workflow
7
+
8
+ ## Hard Rules
9
+
10
+ 1. Every task that creates or modifies code files MUST follow the /dev orchestration (`packages/core/commands/dev.md`, installed as the `/dev` command) — even when the user never typed `/dev`. This covers features, bug fixes of any size, refactors, migrations, bot changes, and integration work.
11
+ 2. Do NOT announce "I'm using the /dev workflow" — just follow the phases.
12
+ 3. NEVER commit with `[wip]` on `main` / `master` / `prod*` branches.
13
+ 4. `[quick:]` / `[no-dev:]` / `[trivial:]` require a reason of ≥ 15 characters; `[hotfix:]` requires a ticket ID or an explicit `no-ticket: <reason ≥15 chars>`.
14
+ 5. Override budget: at most 2 override tags per 30 minutes across the whole project. The third is blocked — run /dev instead or wait for the oldest override to age out.
15
+ 6. The commit gate hard-blocks `git commit` after 3 or more code-file edits in a session unless /dev ran or a valid override tag is present.
16
+
17
+ ## When NOT to use /dev
18
+
19
+ | Task Type | Action |
20
+ |-----------|--------|
21
+ | Docs-only update | Direct edit |
22
+ | Config / env change | Direct edit |
23
+ | Question / explanation | Just answer |
24
+ | Typo fix in non-code file | Direct edit |
25
+
26
+ ## Complexity → phases
27
+
28
+ The /dev Skip Matrix in `packages/core/commands/dev.md` is the single source of truth. Complexity is decided in the /dev Understand phase and never changes mid-run:
29
+
30
+ | Complexity | Signals | Skipped phases |
31
+ |------------|---------|----------------|
32
+ | **Simple** | 1 file, < 100 lines, existing pattern | Architect (2), Pseudocode (3), Contract (5), Validate Plan (6), Evaluate (8), Verify Goals (11), Critic (13) |
33
+ | **Standard** | 2–5 files | Architect (2), Pseudocode (3), Critic (13) |
34
+ | **Complex** | 6+ files, new subsystem, auth/payments/security | none — all 16 phases |
35
+
36
+ The Review and Document phases run for every complexity class — never skip them; Document is where logic/API/architecture changes get their doc updates.
37
+
38
+ 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.
39
+
40
+ ## Enforcement (hard-block at commit)
41
+
42
+ Three hooks enforce this rule technically:
43
+
44
+ | Hook | Event | Behavior |
45
+ |------|-------|----------|
46
+ | `dev-edit-counter.sh` | `PostToolUse(Edit\|Write)` | Counts code-file edits per session. Tests, docs, memory, `.claude/`, and config files are ignored. |
47
+ | `dev-marker-set.sh` | `UserPromptSubmit` + `PreToolUse(Skill)` | Records that /dev was invoked this session (word-boundary match — `/develop`, `/device`, `/devops` do NOT trigger). |
48
+ | `dev-required-on-commit.sh` | `PreToolUse(Bash)` | Blocks `git commit` (incl. `git -C <path> commit`) when the edit count is ≥ 3 AND no /dev marker is set AND no override tag is present. |
49
+
50
+ **Threshold:** 3 code-file edits — below that, committing without /dev is allowed. Counter and marker reset on every successful code commit (exempt commits leave the counter untouched), so each work-cycle starts fresh.
51
+
52
+ **Exempt commits** (no /dev required even at counter ≥ 3):
53
+
54
+ - Docs-only commits (no `.go` / `.ts` / `.tsx` / etc. files staged)
55
+ - Test-only commits (`*_test.go`, `*.test.ts`, `*.spec.*`)
56
+ - `presentation/` changes (see the frontend-3d package documentation)
57
+ - `.claude/` and `memory/` changes
58
+
59
+ **Override tags** — the tag must **open a line** of the commit message: either the very start of the subject line or on its own trailer line (`^\s*[tag…]`). A tag merely mentioned mid-sentence — or anywhere in the command outside the `-m` / `--message` payload — is **not** an override and does not bypass the gate. (This keeps the escape hatch intentional: a memory note that simply *describes* `[no-dev: …]` never triggers a bypass or a block.)
60
+
61
+ | Tag | When to use | Rationale requirements |
62
+ |-----|-------------|------------------------|
63
+ | `[quick: <reason ≥15 chars>]` | Small fix, intentional skip | Reason required |
64
+ | `[no-dev: <reason ≥15 chars>]` | /dev not applicable (pure infra / docs) | Reason required |
65
+ | `[trivial: <reason ≥15 chars>]` | Cosmetic change (naming, formatting) | Reason required |
66
+ | `[hotfix: #123 …]` or `[hotfix: ABC-123 …]` | Emergency fix tied to a ticket | Ticket ID mandatory |
67
+ | `[hotfix: no-ticket: <reason ≥15 chars>]` | Emergency fix without a ticket | Explicit justification |
68
+ | `[wip]` | Work-in-progress checkpoint | Feature branches only (Hard Rule 3) |
69
+
70
+ **Anti-reset penalty** — override cycles are logged per session: ≥ 2 override cycles within 60 minutes lower the threshold from 3 to 2; ≥ 3 consecutive override cycles disable the override path entirely for the rest of the session (forced recovery via /dev).
71
+
72
+ ## Recap
73
+
74
+ - Code change of any size → follow /dev phases, silently.
75
+ - Skips come only from the Skip Matrix; Review and Document always run.
76
+ - `[wip]` never lands on `main` / `master` / `prod*`.
77
+ - Overrides are budgeted (2 per 30 min) and penalized when chained — /dev is always the cheaper path.
@@ -0,0 +1,106 @@
1
+ ---
2
+ alwaysApply: true
3
+ tokens: 1888
4
+ ---
5
+
6
+ # Documentation Updates — MANDATORY
7
+
8
+ ## HARD RULE
9
+ Code changes affecting logic, API, architecture, or behavior MUST include documentation updates **IN THE SAME RESPONSE** as the code. Code without updated docs = **INCOMPLETE TASK**. NEVER defer docs to "later" or "next commit".
10
+
11
+ **Editing integrity.** Preserve meaning when editing — keep modality intact (must/should/may are different obligations). Preserve conditions, warnings, required actions. A cleaner sentence that changes obligations is wrong. No marketing vocabulary, no invented rationale in docs. *(Authoring principle from the golang-documentation skill.)*
12
+
13
+ ## 11-Point Pre-Commit Checklist
14
+
15
+ Before EVERY `git commit`: if a Trigger matches any staged file, the Required Doc MUST also be staged. Multiple rows can match — satisfy all of them.
16
+
17
+ | # | Trigger (staged files) | Required Doc |
18
+ |---|------------------------|--------------|
19
+ | 1 | `*/migrations/*.sql`, `*/db/migrate/*` | `docs/architecture/database-schema.md` AND `CLAUDE.md` (migration counter) |
20
+ | 2 | `*/handlers/*.go`, `*/routes*.go`, `*/router*.go` | `docs/architecture/api-reference.md` OR `docs/openapi.yaml` |
21
+ | 3 | `*/app/**`, `*/middleware*`, `*/jobs/**`, `*/workers/**`, `*/cmd/**` | `docs/architecture/backend-layers.md` |
22
+ | 4 | `*/services/auth/**` | `docs/architecture/auth-and-sessions.md` |
23
+ | 5 | Any other `*/services/<name>/**` | matching `docs/architecture/<service-doc>.md` — see example map below |
24
+ | 6 | Frontend `src/**/*.ts`, `src/**/*.tsx` | `docs/architecture/frontend-state.md` |
25
+ | 7 | ANY new non-test code file (`git diff --cached --diff-filter=A`) | relevant `docs/trees/tree-*.md` |
26
+ | 8 | NEW dependency in `go.mod` / `package.json` | `README.md` Tech Stack section (or `CLAUDE.md`) |
27
+ | 9 | `config.example.*`, `config.sample.*`, `.env.example` | `README.md` Configuration section |
28
+ | 10 | Deploy/infra config changing runtime behavior (Dockerfile, compose, CI/CD) | `docs/architecture/deployment.md` |
29
+ | 11 | New service directory or new `internal/` package | `README.md` Project Structure AND `CLAUDE.md` |
30
+
31
+ The `doc-check-on-commit.sh` hook hard-blocks commits for most rows; rows it does not cover are equally mandatory under this rule.
32
+
33
+ **README rule:** when dependencies or config shape change, README MUST reflect it. A `go.mod` listing samber/oops while README says "errors via fmt.Errorf" lies to every new developer.
34
+
35
+ ### Project-Specific Example Map — ADAPT TO YOUR PROJECT
36
+
37
+ EXAMPLE rows from a production Telegram app — NOT generic. Replace paths and doc names with YOUR services, and keep this map in sync with the `case` statements in `doc-check-on-commit.sh` (the shipped hook hardcodes exactly these mappings — always edit the rule and the hook together).
38
+
39
+ | Trigger (any depth) | Required Doc |
40
+ |---------------------|--------------|
41
+ | `*/services/media/**` | `docs/architecture/photo-pipeline.md` |
42
+ | `*/services/moderation/**` | `docs/architecture/moderation-pipeline.md` |
43
+ | `*/services/feed/**`, `*/services/antiabuse/**` | `docs/architecture/feed-and-antiabuse.md` |
44
+ | `*/services/entitlements/**`, `*/services/store/**`, `*/services/payments/**` | `docs/architecture/entitlements-and-store.md` |
45
+ | `*/services/notifications/**` | `docs/architecture/notification-system.md` |
46
+ | `*/bot_moderator/**`, `*/bot_support/**`, `*/tgbots/**`, `*/bots/**` | `docs/architecture/bot-moderator.md` / `bot-support.md` |
47
+
48
+ ## When Docs Are NOT Needed
49
+
50
+ - Pure refactors (no behavior change, same API contract)
51
+ - Test-only changes (`*_test.go`, `*.test.ts`, `*.spec.ts`)
52
+ - Typo fixes in non-doc files
53
+ - Dependency patch/minor updates (NEW dependencies or major upgrades → row 8)
54
+
55
+ **Config precedence rule:** a config change that alters runtime behavior or config shape other developers must know (example/sample config files, new config keys, deploy settings) → docs required per rows 9–10. Purely local/dev values (`.env` values, secrets, local overrides, editor settings) → exempt.
56
+
57
+ ## Enforcement (4 layers)
58
+
59
+ | Layer | Mechanism | Type | When |
60
+ |-------|-----------|------|------|
61
+ | 1. **This rule** | loaded every session | Proactive | Always — primary mechanism |
62
+ | 2. **PreToolUse hook** | `doc-check-on-commit.sh` | Hard block (exit 2) | Before every `git commit` — maps staged files to required docs, blocks if missing |
63
+ | 3. **/dev Document phase** | `dev.md` phase gate | Phase gate | /dev cannot reach Report until docs are updated |
64
+ | 4. **Stop hook** | prompt-type Stop hook inline in `settings.json` | Safety net | Session end — verifies docs updated when logic/API/architecture changed |
65
+
66
+ Do NOT rely on layers 2–4 — update docs proactively with every code change (layer 1).
67
+
68
+ ### What CANNOT satisfy the doc requirement
69
+
70
+ The hook excludes these paths from counting as "docs updated":
71
+
72
+ - `docs/superpowers/plans/**`, `docs/superpowers/specs/**`, `docs/superpowers/research/**`
73
+ - `memory/**`
74
+ - `CHANGELOG.md`, `HISTORY.md`
75
+ - `docs/active-plans-archive.md`
76
+
77
+ These are meta-work: a plan describes intent; the architecture doc describes current system behavior. A contract change in `handlers/auth_handler.go` belongs in `docs/architecture/auth-and-sessions.md` — never "described in the plan file".
78
+
79
+ ## Plan Completion Gate
80
+
81
+ When finishing an implementation plan (superpowers writing-plans / executing-plans):
82
+
83
+ 1. BEFORE marking the plan complete, run the 11-point checklist above; update any stale doc as the FINAL task.
84
+ 2. After a plan completes, `plan-completion-gate.sh` sets a marker: the next code commit MUST stage a `docs/architecture/*` file OR carry `[plan-docs-deferred: <plan-id>: <reason ≥15 chars>]` in the commit message.
85
+ 3. A plan is NOT complete until docs are updated.
86
+
87
+ ## Subagent Instructions
88
+
89
+ When delegating via the Agent tool, list EVERY specific doc file — never say "update docs" generically:
90
+
91
+ ```
92
+ After making code changes, update these documentation files:
93
+ 1. `docs/architecture/<specific-file>.md` — <what to update>
94
+ 2. `CLAUDE.md` — <specific section> (e.g., migration counter, Active Plans)
95
+ 3. `docs/trees/<specific-tree>.md` — regenerate if files were added/removed
96
+ 4. `docs/openapi.yaml` — add/update endpoint definitions
97
+ ```
98
+
99
+ Subagents MUST NOT commit without doc updates. A subagent that cannot determine which docs to update asks the parent — it does not skip docs.
100
+
101
+ ## Recap — non-negotiables
102
+
103
+ - Docs ship IN THE SAME RESPONSE as the code — code without docs = INCOMPLETE TASK.
104
+ - Before every commit, walk the 11-point checklist; every matching row's doc must be staged.
105
+ - Plans/specs/memory/CHANGELOG never satisfy the doc requirement — only architecture docs, trees, README, CLAUDE.md, openapi.yaml do.
106
+ - A plan is NOT complete until the checklist passes.
@@ -0,0 +1,53 @@
1
+ ---
2
+ alwaysApply: false
3
+ applyWhenPaths:
4
+ - "**/*.tsx"
5
+ - "**/*.jsx"
6
+ - "**/*.vue"
7
+ - "**/*.svelte"
8
+ - "**/*.css"
9
+ - "**/*.scss"
10
+ tokens: 624
11
+ ---
12
+
13
+ # Frontend Aesthetics
14
+
15
+ Proactive anti-slop: apply DURING frontend code generation, not after review.
16
+ Precedence: if the frontend-ui package rules are installed (`typography-guidelines.md`, `ui-anti-patterns.md`, etc. in `.claude/rules/`), follow those — this rule is the minimal fallback.
17
+
18
+ ## Hard Rules
19
+ - Tokens first: every color, spacing value, and font size comes from a defined scale (see Design System Compliance).
20
+ - NEVER default to Inter, Roboto, Arial, Helvetica, Open Sans, or bare system fonts — run the Typography procedure instead.
21
+ - NEVER ship any pattern from the AI Pattern Red Flags list.
22
+
23
+ ## Typography — selection procedure
24
+ 1. Project already loads fonts (Tailwind/theme config, `@font-face`, `next/font`, `<link>` import)? → use that stack.
25
+ 2. No stack? → pick one characterful display face for headings + one workhorse body face, from fonts the project can actually load (self-hosted files or a provider it already uses); name both picks in your response.
26
+ 3. Nothing loadable and no user direction? → propose 2–3 named pairings and ask — do not silently fall back to defaults.
27
+
28
+ Hierarchy: headings, body, and captions must differ in at least two of size / weight / family.
29
+
30
+ ## Color & Theme
31
+ - Commit to one cohesive palette via CSS variables; dominant base + sharp accents beats a timid, evenly-distributed palette.
32
+ - Draw from the project's design system tokens when available.
33
+
34
+ ## Motion & Animation
35
+ - Concentrate on high-impact moments: one well-orchestrated page load with staggered reveals beats scattered micro-interactions.
36
+ - Use the project's existing animation library (motion/react, framer-motion, CSS transitions); prefer CSS-only when it suffices.
37
+
38
+ ## Backgrounds & Depth
39
+ - Create atmosphere: layer CSS gradients, geometric patterns, contextual effects — not solid white/gray defaults.
40
+
41
+ ## AI Pattern Red Flags (AVOID these)
42
+ - Purple/blue gradient as default accent color
43
+ - White cards on gray background with identical spacing everywhere
44
+ - Generic hero section with stock imagery
45
+ - Rounded corners on everything with no visual hierarchy
46
+ - box-shadow on every interactive element
47
+ - "Clean and modern" that actually means "bland and default"
48
+ - Identical spacing/padding/gap values everywhere — no rhythm
49
+
50
+ ## Design System Compliance
51
+ - If a design system exists (Tailwind config, theme file, tokens) — use it.
52
+ - If none — establish consistent tokens (CSS variables) before building components.
53
+ - Every color, spacing value, and font size comes from a defined scale.
@@ -0,0 +1,14 @@
1
+ ---
2
+ alwaysApply: true
3
+ tokens: 131
4
+ ---
5
+
6
+ # Git Workflow
7
+
8
+ - **Commits**: conventional format `type(scope): description`
9
+ - Types: feat, fix, docs, refactor, chore, test, perf. Anything else → chore
10
+ - Scope: the top-level module/package the change touches — derive it from this repo's structure (e.g. backend, frontend, cli)
11
+ - **No --no-verify**: Fix pre-commit hook issues, don't skip them
12
+ - **No force push to main**: Use PRs
13
+ - **No git reset --hard**: Use stash or soft reset
14
+ - **Branch naming**: `feature/description`, `fix/description`, `chore/description`
@@ -0,0 +1,29 @@
1
+ ---
2
+ alwaysApply: false
3
+ applyWhenPaths:
4
+ - "**/*.go"
5
+ - "**/*.ts"
6
+ - "**/*.tsx"
7
+ - "**/*.js"
8
+ - "**/*.jsx"
9
+ - "**/*.py"
10
+ - "**/*.rs"
11
+ - "**/*.java"
12
+ - "**/*.kt"
13
+ - "**/*.rb"
14
+ - "**/*.sql"
15
+ - ".github/workflows/**"
16
+ - "Dockerfile*"
17
+ - "docker-compose*"
18
+ tokens: 152
19
+ ---
20
+
21
+ # Security
22
+
23
+ - SQL: parameterized queries ($1 for pgx, ? for MySQL; Python: %s placeholders passed as driver params — `execute(sql, params)` — never f-strings, .format(), or % interpolation)
24
+ - XSS: no dangerouslySetInnerHTML without DOMPurify
25
+ - Secrets: no hardcoded tokens/passwords/keys — use env vars
26
+ - Auth: all API endpoints require auth middleware, except an enumerated public allowlist (health checks, auth entry points, signature-verified webhooks)
27
+ - Input: validate at system boundaries
28
+ - Files: validate MIME type and size server-side
29
+ - CORS: explicit origin allowlist, no wildcards in production
@@ -0,0 +1,114 @@
1
+ ---
2
+ alwaysApply: true
3
+ tokens: 1383
4
+ ---
5
+
6
+ # Superkit Integrity — Verify Before Commit (superkit repo only)
7
+
8
+ ## HARD RULE
9
+
10
+ - Before EVERY `git commit` in this repo: run Steps 1–4 below with real commands. Never verify from memory.
11
+ - ANY mismatch → fix it, THEN commit.
12
+ - Before EVERY `gh release create`: additionally pass the 7-point Pre-Release Audit.
13
+ - The hook `packages/core/hooks/superkit-counts-verify.sh` (PreToolUse on `git commit`/`git push`, exit 2 = block) auto-enforces most of Steps 1–2, but NOT Steps 3–4 (phase count, stale refs) — only this rule catches those.
14
+
15
+ ### Step 1 — Count Verification (30s)
16
+
17
+ Fast path: `bash bin/superkit-counts-verify.sh` runs the hook's count/version checks manually (add `--check-remote` to also verify GitHub About). Exit 0 clears the hook-checked subset; the items the hook skips are listed below the table. Manual equivalent:
18
+
19
+ ```bash
20
+ # Per-package counts (same globs the hook uses)
21
+ CORE_AGENTS=$(ls packages/core/agents/*.md | wc -l)
22
+ STACK_AGENTS=$(ls packages/stack-agents/*/*.md | wc -l) # references/ not matched
23
+ PKG_AGENTS=$(ls packages/{frontend-3d,frontend-ui,gan}/agents/*.md | wc -l)
24
+ EXTRAS_AGENTS=$({ ls packages/extras/*.md; ls packages/extras/*/agent.md; } | wc -l)
25
+ CORE_HOOKS=$(ls packages/core/hooks/*.sh packages/core/hooks/*.py | wc -l)
26
+ STACK_HOOKS=$(ls packages/stack-hooks/*/*.sh | wc -l)
27
+ PKG_HOOKS=$(ls packages/{frontend-3d,frontend-ui}/hooks/*.sh | wc -l)
28
+ CORE_RULES=$(ls packages/core/rules/*.md | wc -l)
29
+ STACK_RULES=$(ls packages/stack-rules/*/*.md | wc -l)
30
+ PKG_RULES=$(ls packages/{frontend-3d,frontend-ui}/rules/*.md | wc -l)
31
+ CORE_COMMANDS=$(ls packages/core/commands/*.md | wc -l)
32
+ PKG_COMMANDS=$(ls packages/frontend-3d/commands/*.md | wc -l)
33
+ SKILLS=$(find packages/{core,frontend-3d,frontend-ui,gan,extras} -name SKILL.md | wc -l)
34
+ CODEX_SKILLS=$(find packages/codex/skills -name SKILL.md | wc -l)
35
+
36
+ # Shipped totals — subtract superkit-internal files (never installed;
37
+ # canonical list: packages/core/INTERNAL-FILES — the single source of truth
38
+ # consumed by lib/installer.js, superkit-counts-verify.sh and superkit-update.sh)
39
+ AGENTS=$((CORE_AGENTS + STACK_AGENTS + PKG_AGENTS + EXTRAS_AGENTS)) # 31+9+13+3 = 56
40
+ HOOKS=$((CORE_HOOKS - 2 + STACK_HOOKS + PKG_HOOKS)) # 26+9+7 = 42
41
+ RULES=$((CORE_RULES - 1 + STACK_RULES + PKG_RULES)) # 7+2+10 = 19
42
+ COMMANDS=$((CORE_COMMANDS + PKG_COMMANDS)) # 15+1 = 16
43
+ # SKILLS = 22
44
+ ```
45
+
46
+ Every computed number must equal what is documented in:
47
+
48
+ | Where | Must match |
49
+ |-------|------------|
50
+ | `README.md` badge + "What's Inside" table | AGENTS, HOOKS, RULES, COMMANDS, SKILLS totals; CORE_AGENTS; "N skills" near Codex |
51
+ | `CLAUDE.md` "Current Counts" table + Totals line | every per-package cell + all five totals |
52
+ | `packages/codex/INSTALL.md` + `AGENTS.md` | CODEX_SKILLS ("N skills") |
53
+ | GitHub About (`gh repo view --json description`) | all five counts; hook checks agents/commands/hooks/rules on `git push` |
54
+
55
+ NOT hook-checked — compare yourself: SKILLS (=22) everywhere it appears (incl. GitHub About), plus CLAUDE.md cells beyond the hook's spot checks (it verifies only Core/Stack Agents, Core Commands, Codex Skills, Showcase Commands). Mismatch → update the docs (GitHub via `gh repo edit --description`) BEFORE committing.
56
+
57
+ ### Step 2 — Version Sync (10s)
58
+
59
+ ```bash
60
+ VERSION_FILE=$(cat VERSION | tr -d '[:space:]')
61
+ PKG_VERSION=$(node -p "require('./package.json').version")
62
+ ```
63
+
64
+ VERSION MUST equal package.json version, and CHANGELOG.md MUST contain that version string (hook blocks both). Differ → fix BEFORE committing.
65
+
66
+ ### Step 3 — Phase Count Consistency (10s)
67
+
68
+ `packages/core/commands/dev.md` frontmatter declares the /dev phase count (currently "16 phases (0–15)"). The SAME count must appear in:
69
+
70
+ - `README.md` — Key Commands `/dev` row AND the `docs/dev-flow.svg` embed's `alt` text ("/dev — 16-phase development orchestrator…"). If the count ever changes, regenerate the SVG labels and `docs/dev-flow-variants/` too.
71
+ - `CLAUDE.md` — Key Files table, dev.md row
72
+ - `docs/guide/01-getting-started.md` — command table
73
+ - `docs/guide/08-orchestration.md` — "The /dev Pipeline: N Phases" header
74
+ - `packages/codex/AGENTS.md` — dev-orchestrator row
75
+ - `packages/codex/skills/dev-orchestrator/SKILL.md` — frontmatter description
76
+
77
+ ### Step 4 — Stale Reference Scan (10s)
78
+
79
+ Substitute `<PREV>` = the PREVIOUS phase count, then run:
80
+
81
+ ```bash
82
+ grep -rn "<PREV>-phase" docs/ README.md CLAUDE.md packages/codex/ --include="*.md" \
83
+ | grep -v plans/ | grep -v CHANGELOG
84
+ ```
85
+
86
+ Filled example after an 8→16 renumber: `grep -rn "8-phase" …`. Must return 0 lines. plans/ and CHANGELOG are historical — leave them; everything else uses the CURRENT count.
87
+
88
+ ## Pre-Release Audit — before EVERY `gh release create`
89
+
90
+ All 7 must pass:
91
+
92
+ 1. Steps 1–4 above all pass.
93
+ 2. `git tag -l "vX.Y.Z"` — the release tag exists.
94
+ 3. `cat VERSION` matches the tag version.
95
+ 4. package.json version matches VERSION.
96
+ 5. `grep "## \[X.Y.Z\]" CHANGELOG.md` — the version section exists.
97
+ 6. README "What's New" references vX.Y.Z.
98
+ 7. `git status` — working tree clean, nothing uncommitted.
99
+
100
+ ANY check fails → fix, re-commit, re-run, THEN release.
101
+
102
+ ## When to Skip Steps 1–4
103
+
104
+ - Docs-only wording/typo changes touching no counts, versions, or phase references.
105
+ - Plan/spec files under docs/superpowers/.
106
+ - Test files.
107
+
108
+ Unsure whether counts changed → run the steps (<1 minute total). This drift class shipped before (v1.3.5: 8 stale refs) — the checks are cheaper than the cleanup.
109
+
110
+ ## Recap
111
+
112
+ - Never commit with a count/version mismatch — run Steps 1–4 first, fix before committing.
113
+ - Never `gh release create` unless Steps 1–4 AND all 7 release checks pass.
114
+ - Skip verification only for docs-only wording, docs/superpowers/ plans, and test files.