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,220 @@
1
+ ---
2
+ name: writing-agents
3
+ description: How to write Claude Code agents — playbook skeleton, canonical severity/confidence enums, Evidence Gate, Output Contract, dispatch patterns
4
+ tokens: 2453
5
+ user-invocable: false
6
+ ---
7
+
8
+ # Writing Claude Code Agents
9
+
10
+ Meta-skill: the standard every kit agent follows. Agents are `.md` files in `.claude/agents/` — YAML frontmatter + markdown body. Reference implementations of this standard: `critic.md` and `code-reviewer.md` in the same directory.
11
+
12
+ ## Use when / Do not use
13
+
14
+ - **Use when:** authoring a new agent, rewriting an existing one, or checking an agent file for kit compliance.
15
+ - **Do not use for:** commands, hooks, rules, or skills — those have different formats.
16
+
17
+ ## Hard Rules
18
+
19
+ 1. `model: opus` — the kit is opus-only. NEVER emit sonnet or haiku.
20
+ 2. Canonical enums, exact spelling — Severity: CRITICAL / WARNING / SUGGESTION. Confidence: HIGH (≥80) / MEDIUM (60–79) / LOW (<60). LOW items route to Open Questions, never silently dropped.
21
+ 3. Every reviewer agent carries the Evidence Gate; every generator agent carries a "Done ONLY when" gate.
22
+ 4. Every agent ends with an exact fenced Output Contract plus one filled mini example — never "[standard format]", "[standard questions]", or "report in your usual format".
23
+ 5. Reference /dev phases by NAME ("the /dev Review phase", "the /dev Critic phase"), never by bare number.
24
+ 6. Grep patterns must be ripgrep-safe: literal text, alternation `a|b`, character classes — no lookaheads or lookbehinds.
25
+
26
+ ## Frontmatter
27
+
28
+ ```yaml
29
+ ---
30
+ name: agent-name
31
+ description: One line — what it reviews/creates AND when to dispatch it
32
+ model: opus
33
+ allowed-tools: Read, Grep, Glob, Bash
34
+ ---
35
+ ```
36
+
37
+ - `description` — single line; dispatch matches on it, so include the trigger condition (e.g., "Review Dockerfiles for security — dispatch when Dockerfile or docker-compose files change").
38
+ - `allowed-tools` — minimal set. Reviewers: `Read, Grep, Glob, Bash`. Generators add `Edit, Write`.
39
+ - `tokens: N` — transparency signal, not a budget. Do not hand-count; regenerate with `node bin/inject-tokens.js` after editing.
40
+
41
+ ## Body Skeleton (every agent, this order)
42
+
43
+ 1. **Role** — 1–2 sentences.
44
+ 2. **Hard Rules** — ≤7 MUST/NEVER bullets at the TOP (weaker models lose constraints buried mid-file).
45
+ 3. **Phase 0 — Load Project Context** — kit convention, template below.
46
+ 4. **Process** — numbered phases, linear integers only (no 1.5/2.1); each phase: goal → tool-level actions → done-when.
47
+ 5. **Domain checklists / decision tables** — the expertise; keep depth, cut prose.
48
+ 6. **Output Contract** — exact fenced template + one filled mini example.
49
+ 7. **Recap** — 3–5 bullets restating the hard rules, as the last section.
50
+
51
+ Precision rules: a list labeled "N-point" contains exactly N items; every decision fork lists all branches plus an explicit default — no "use judgment" or "as appropriate".
52
+
53
+ ### Phase 0 template
54
+
55
+ ```markdown
56
+ ## Phase 0 — Load Project Context
57
+ Read if present, skip silently if absent: `CLAUDE.md` or `AGENTS.md`; relevant `docs/architecture/*.md`.
58
+ Use it to: [one line — what this agent extracts]. Violations of DOCUMENTED conventions → report with HIGH confidence instead of MEDIUM.
59
+ ```
60
+
61
+ ## Authoring Workflow
62
+
63
+ 1. Define the role in one sentence and the dispatch condition — both go into `description`.
64
+ 2. Write frontmatter: `model: opus`, minimal `allowed-tools`.
65
+ 3. Write the body top-down in skeleton order: Hard Rules → Phase 0 → Process → checklists.
66
+ 4. Write the Output Contract and fill the mini example with realistic content — zero bracketed placeholders.
67
+ 5. Add the Evidence Gate (reviewer) or Done-gate (generator), then the Recap.
68
+ 6. Run `node bin/inject-tokens.js` to refresh `tokens:`.
69
+
70
+ Done when: sections appear in skeleton order and `rg -n "standard format|usual format|standard questions"` on the file returns nothing.
71
+
72
+ ## Severity / Confidence (canonical)
73
+
74
+ **Severity**
75
+ - **CRITICAL** — data loss, security vulnerability, crash. Example: SQL injection, auth bypass.
76
+ - **WARNING** — incorrect behavior under specific conditions. Example: missing error wrap, N+1 query.
77
+ - **SUGGESTION** — style, readability. Safe to ignore.
78
+
79
+ **Confidence**
80
+ - **HIGH (≥80)** — bug visible in the code.
81
+ - **MEDIUM (60–79)** — pattern-based; mark "needs verification".
82
+ - **LOW (<60)** — route to Open Questions, never silently drop.
83
+
84
+ Finding format:
85
+
86
+ ```
87
+ [SEVERITY/CONFIDENCE] file:line — one-line description
88
+ Evidence: <what the code shows>
89
+ Fix: <concrete change>
90
+ ```
91
+
92
+ **Do NOT inflate severity to seem thorough.** A review with 0 CRITICAL and 2 SUGGESTIONS is valid. If the code is clean, say so.
93
+
94
+ ## Evidence Gate (copy into every reviewer)
95
+
96
+ ```markdown
97
+ ## Evidence Gate
98
+ Report a finding ONLY if all four hold:
99
+ 1. **Citation** — exact `file:line` you Read in this session, never from memory.
100
+ 2. **Failure mode** — a concrete input/path that triggers the problem (no "could be problematic").
101
+ 3. **Context** — you read the surrounding function/callers, not just the flagged line.
102
+ 4. **Severity** you can defend to a skeptic.
103
+ If a referenced file/symbol cannot be found: output `NOT FOUND: <path>` — never invent its contents.
104
+ A clean review (0 findings) is a valid result — do not manufacture findings.
105
+ ```
106
+
107
+ ## Done-gate (copy into every generator)
108
+
109
+ ```markdown
110
+ ## Done ONLY when
111
+ - [ ] Every promised artifact exists on disk — verified with Read/ls, not from memory.
112
+ - [ ] [compile/test command] ran; paste its real output in the report.
113
+ - [ ] Report separates VERIFIED (tool output seen) from ASSUMED (not checked) — list both.
114
+ Not all boxes checked → say what is missing; do not claim completion.
115
+ ```
116
+
117
+ Multi-phase reviewers may also end with a "Done ONLY when" checklist of per-phase completion criteria — the pattern `critic.md` and `code-reviewer.md` use.
118
+
119
+ ## Dispatch Priority
120
+
121
+ If a **stack-specific reviewer** exists (e.g., `go-reviewer` for `*.go`), it is dispatched **instead of** `code-reviewer` for matching files. `code-reviewer` covers files no specialist claims.
122
+
123
+ ## Checklist Design Tips
124
+
125
+ - Each item names a concrete probe: a ripgrep-safe grep pattern or a file path to check.
126
+ - Order by severity — critical checks first.
127
+ - Include both positive checks (X must be present) and negative checks (Y must NOT be present).
128
+ - 8–15 items is the sweet spot. More than 20 → split into two agents.
129
+
130
+ ## Example: Complete Minimal Agent
131
+
132
+ Every section filled — this is the template to copy, not a sketch:
133
+
134
+ ````markdown
135
+ ---
136
+ name: dockerfile-reviewer
137
+ description: Review Dockerfiles for security and image hygiene — dispatch when Dockerfile or docker-compose files change
138
+ model: opus
139
+ allowed-tools: Read, Grep, Glob
140
+ ---
141
+
142
+ # Dockerfile Reviewer
143
+
144
+ Reviews Dockerfiles for security and build hygiene, producing evidence-gated findings.
145
+
146
+ ## Hard Rules
147
+ 1. Every finding passes the Evidence Gate: cite only `file:line` you Read this session; missing files → `NOT FOUND: <path>`.
148
+ 2. Severity CRITICAL/WARNING/SUGGESTION; Confidence HIGH (≥80) / MEDIUM (60–79) / LOW (<60); LOW → Open Questions.
149
+ 3. 0 findings is a valid result — never manufacture findings.
150
+
151
+ ## Phase 0 — Load Project Context
152
+ Read if present, skip silently if absent: `CLAUDE.md` or `AGENTS.md`; `docs/architecture/deployment.md`.
153
+ Use it to: learn base-image, registry, and deploy conventions. Violations of DOCUMENTED conventions → HIGH confidence instead of MEDIUM.
154
+
155
+ ## Evidence Gate
156
+ Report a finding ONLY if all four hold:
157
+ 1. **Citation** — exact `file:line` you Read in this session, never from memory.
158
+ 2. **Failure mode** — a concrete input/path that triggers the problem (no "could be problematic").
159
+ 3. **Context** — you read the surrounding function/callers, not just the flagged line.
160
+ 4. **Severity** you can defend to a skeptic.
161
+ If a referenced file/symbol cannot be found: output `NOT FOUND: <path>` — never invent its contents.
162
+ A clean review (0 findings) is a valid result — do not manufacture findings.
163
+
164
+ ## Process
165
+ 1. **Locate** — Glob `**/Dockerfile*`, Read each hit. Done when: every file Read or reported `NOT FOUND`.
166
+ 2. **Checklist** — evaluate all 5 items below against every file. Done when: 5 items × files evaluated.
167
+ 3. **Report** — emit the Output Contract.
168
+
169
+ ## Checklist (5 items)
170
+ 1. **Root user** — grep `USER`; missing, or `USER root` as the last USER directive → CRITICAL.
171
+ 2. **Floating tag** — grep `:latest`; pin a specific version → WARNING.
172
+ 3. **Multi-stage** — count `FROM` lines; single-stage build shipping compilers in the final image → WARNING.
173
+ 4. **COPY vs ADD** — grep `ADD`; prefer COPY unless extracting an archive → SUGGESTION.
174
+ 5. **Health check** — grep `HEALTHCHECK`; absent for a long-running service → SUGGESTION.
175
+
176
+ ## Output Contract
177
+
178
+ ```
179
+ ## Dockerfile Review
180
+
181
+ ### Findings
182
+ [SEVERITY/CONFIDENCE] file:line — one-line description
183
+ Evidence: <what the file shows>
184
+ Fix: <concrete change>
185
+
186
+ ### Open Questions
187
+ - file:line — suspicion + what would confirm it (or "none")
188
+
189
+ ### Summary
190
+ <N> CRITICAL, <N> WARNING, <N> SUGGESTION — <one-line verdict>
191
+ ```
192
+
193
+ Mini example:
194
+
195
+ ```
196
+ ### Findings
197
+ [CRITICAL/HIGH] deploy/Dockerfile:14 — container runs as root
198
+ Evidence: no USER directive after the final FROM stage
199
+ Fix: create a non-root user and add `USER app` before ENTRYPOINT
200
+
201
+ ### Open Questions
202
+ - deploy/Dockerfile:3 — pinned digest may be stale; confirm the base-image update policy
203
+
204
+ ### Summary
205
+ 1 CRITICAL, 0 WARNING, 0 SUGGESTION — fix root user before merge.
206
+ ```
207
+
208
+ ## Recap — non-negotiables
209
+ - Evidence Gate: cite only lines Read this session; `NOT FOUND: <path>` for missing files.
210
+ - Canonical enums, exact spelling; LOW → Open Questions.
211
+ - 0 findings is valid — never inflate.
212
+ ````
213
+
214
+ ## Recap — non-negotiables
215
+
216
+ - `model: opus` only — never sonnet or haiku.
217
+ - Severity CRITICAL/WARNING/SUGGESTION; Confidence HIGH ≥80 / MEDIUM 60–79 / LOW <60; LOW → Open Questions.
218
+ - Reviewers carry the Evidence Gate; generators carry the Done-gate.
219
+ - Output Contract is a fenced template with a filled mini example — placeholders like "[standard format]" are banned.
220
+ - /dev phases by NAME; greps ripgrep-safe; `tokens:` via `node bin/inject-tokens.js`.
@@ -0,0 +1,176 @@
1
+ ---
2
+ name: writing-commands
3
+ description: How to write Claude Code slash commands — canonical skeleton, orchestrator pattern, agent dispatch, auto-detection
4
+ tokens: 1771
5
+ user-invocable: false
6
+ ---
7
+
8
+ # Writing Claude Code Commands
9
+
10
+ ## Purpose
11
+
12
+ Author `.claude/commands/*.md` files that a model executes reliably: fixed skeleton, per-step done-when conditions, every fork enumerated, and a final report gated on completion.
13
+
14
+ ## Use when / Do not use
15
+
16
+ - **Use when**: creating a new slash command or restructuring an existing one.
17
+ - **Do not use for**: agents (see `writing-agents`) or hooks (see `writing-hooks`) — commands are user-triggered workflows; agents are dispatched workers.
18
+
19
+ ## Hard Rules — for every command you write
20
+
21
+ 1. `$ARGUMENTS` appears EXACTLY once — at the step that parses it. Zero occurrences loses user input; two makes consumption ambiguous.
22
+ 2. Linear integer numbering for steps/phases (1, 2, 3…). Never insert fractional numbers (2.5) — renumber instead.
23
+ 3. Every step ends with a `Done when:` line stating a verifiable exit condition (file exists, command output seen, agent report received).
24
+ 4. The final report is emitted ONLY after every non-skipped step's done-when holds; anything missing is listed as "Not done" — never claimed complete.
25
+ 5. Every fork enumerates ALL branches plus an explicit else/default — no "as appropriate" or "use judgment".
26
+ 6. Destructive actions (git checkout/stash, file deletion, migrations) get a gate: record restore state BEFORE the action; a restore step ALWAYS runs after it, on success and on failure.
27
+ 7. `allowed-tools` lists only what the command needs (least privilege).
28
+
29
+ ## Command Skeleton (canonical)
30
+
31
+ Frontmatter:
32
+
33
+ ```yaml
34
+ ---
35
+ description: One-line description (shown in /help)
36
+ argument-hint: <what-user-types>
37
+ allowed-tools: Bash, Read, Edit, Write, Glob, Grep, Agent # only what this command needs
38
+ ---
39
+ ```
40
+
41
+ Body, in this order:
42
+
43
+ 1. **Title + Role** — 1–2 sentences: one primary purpose per command — what it does, when it stops early.
44
+ 2. **Hard Rules** — ≤7 MUST/NEVER bullets; include destructive-action gates where relevant.
45
+ 3. **Numbered Steps** — Step 1, Step 2, … each with concrete actions and `Done when:`. `$ARGUMENTS` sits in the parse step (`Arguments: $ARGUMENTS`).
46
+ 4. **Output template** — exact fenced template the report must follow, plus a "Done ONLY when" checklist for longer commands.
47
+ 5. **Recap** — 3–5 bullets restating the hard rules.
48
+
49
+ Living references — read before writing a command: `test.md` (linear detect → scope → run → report shape) and `benchmark.md` (destructive-gate shape: record ref/stash BEFORE git switch, always-run restore epilogue) in the same commands directory. If absent, follow the skeleton above.
50
+
51
+ Tiny commands (≤3 steps, no destructive actions) may omit Hard Rules and Recap; anything with destructive actions or 4+ steps includes both.
52
+
53
+ ## The Orchestrator Pattern
54
+
55
+ Most powerful commands are **orchestrators** — they coordinate multiple agents through phases:
56
+
57
+ ```
58
+ Phase 1: Understand → read codebase, find patterns
59
+ Phase 2: Plan → output structured checklist
60
+ Phase 3: Execute → create/modify files
61
+ Phase 4: Verify → dispatch health-checker agent
62
+ Phase 5: Test → dispatch test-generator agent
63
+ Phase 6: Review → dispatch reviewer agents (parallel)
64
+ Phase 7: Document → dispatch docs-reviewer agent
65
+ Phase 8: Report → summary table
66
+ ```
67
+
68
+ Not every command needs many phases — the full `/dev` runs 16, but simple commands (lint, test) may have 2-3 phases.
69
+
70
+ ### Phase discipline
71
+
72
+ - Each phase declares a `Done when:` condition an executor can verify.
73
+ - Conditional phases keep linear integer numbering; ALL skip conditions live in one skip table ("Phase 5 — skip when no test framework detected"). Never renumber fractionally.
74
+ - The Report phase runs LAST and is gated: emit it only after every non-skipped phase's done-when holds. A failed or unran phase appears in the report under "Not done" — the command never claims completion it did not verify.
75
+
76
+ ## Dispatching Agents from Commands
77
+
78
+ Use the `Agent` tool. Reference agents by their EXACT name — the `.claude/agents/` filename without `.md`.
79
+
80
+ **Parallel dispatch** (independent agents — all Agent calls in one message):
81
+ ```
82
+ Dispatch ALL triggered agents simultaneously:
83
+ - go-reviewer (if .go files changed)
84
+ - ts-reviewer (if .ts/.tsx files changed)
85
+ - security-scanner (always)
86
+ ```
87
+
88
+ **Sequential dispatch** (later steps depend on earlier results — every branch spelled out):
89
+ ```
90
+ 1. Dispatch health-checker.
91
+ - Passes → step 2.
92
+ - Fails → report the failing checks and STOP (default for any unclear result: STOP).
93
+ 2. Dispatch test-generator; run the generated tests.
94
+ - Pass → step 3.
95
+ - Fail → report the failures and STOP.
96
+ 3. Dispatch reviewer agents (parallel).
97
+ ```
98
+
99
+ ## Auto-Detection Pattern
100
+
101
+ For multi-stack projects, detect the stack from project files:
102
+
103
+ ```
104
+ Auto-detection:
105
+ go.mod exists? → Go project
106
+ package.json + tsconfig → TypeScript project
107
+ pyproject.toml → Python project
108
+ Cargo.toml → Rust project
109
+ ```
110
+
111
+ This lets commands work in any project without hardcoded paths. Multiple markers → treat as multi-stack: handle each detected stack, report each separately.
112
+
113
+ ## Input Parsing
114
+
115
+ Parse `$ARGUMENTS` at its consumption step. List patterns in PRECEDENCE order — first match wins — and always end with an explicit else:
116
+
117
+ ```markdown
118
+ ## Step N — Parse Arguments
119
+
120
+ Arguments: $ARGUMENTS
121
+
122
+ Match in this order (first match wins):
123
+ 1. Empty → default behavior.
124
+ 2. Known keyword/flag (--fix, all, e2e, …) → that mode.
125
+ 3. PR#NNN → fetch the PR diff.
126
+ 4. Existing branch name (verify: `git rev-parse --verify <name>`) → use as base.
127
+ 5. Else → state how the input was interpreted in the report; never silently ignore it.
128
+ ```
129
+
130
+ Keyword-before-branch ordering resolves inputs that match both.
131
+
132
+ ## Example: Minimal Command
133
+
134
+ ```markdown
135
+ ---
136
+ description: Run project linters
137
+ argument-hint: "[--fix]"
138
+ allowed-tools: Bash, Glob
139
+ ---
140
+
141
+ # Lint
142
+
143
+ Auto-detect the project's linters and run them.
144
+
145
+ ## Step 1 — Parse Arguments
146
+
147
+ Arguments: $ARGUMENTS
148
+
149
+ - Empty → report-only mode.
150
+ - Contains `--fix` → add auto-fix flags.
151
+ - Else → run report-only mode; note the ignored tokens in the report.
152
+
153
+ Done when: mode fixed.
154
+
155
+ ## Step 2 — Detect and Run
156
+
157
+ 1. `go.mod` exists → run `gofmt -l . && go vet ./...`
158
+ 2. `tsconfig.json` exists → run `npx tsc --noEmit && npx eslint .`
159
+ 3. Neither exists → report "No supported linter detected." and stop.
160
+
161
+ Done when: every detected stack's linter ran and its real output was seen (or the no-linter case was reported).
162
+
163
+ ## Step 3 — Report
164
+
165
+ List files with issues. If clean: "All files pass linting." — a clean result is valid.
166
+
167
+ Done when: the report reflects the actual Step 2 output.
168
+ ```
169
+
170
+ ## Recap — non-negotiables
171
+
172
+ - `$ARGUMENTS` exactly once, at the parse step; every step ends with `Done when:`.
173
+ - Linear integer numbering; conditional phases in one skip table; final report only after every non-skipped step's done-when holds.
174
+ - Every fork lists all branches plus an explicit else; unclear result defaults to STOP-and-report.
175
+ - Destructive actions: record restore state before, always-run restore step after (see `benchmark.md`).
176
+ - Least-privilege `allowed-tools`; agents referenced by exact filename-derived name.