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,342 @@
1
+ # Codex CLI — Installation Guide
2
+
3
+ ## Standalone install and update
4
+
5
+ From the **target project's Git directory**, run the installer from your Superkit
6
+ checkout (Node.js 18+ and Git required):
7
+
8
+ ```bash
9
+ cd /path/to/your-project
10
+ bash /path/to/claude-code-superkit/setup.sh --codex-only
11
+ ```
12
+
13
+ This noninteractive route installs only Codex assets. It does not require or call
14
+ Claude, install Claude plugins, write `.claude` or `CLAUDE.md`, or scaffold Claude
15
+ documentation. It works from a subdirectory and targets the Git repository root.
16
+ The Codex executable is optional for file setup; install it separately to use the
17
+ skills. Existing `.claude` files do not influence Codex install/update decisions.
18
+
19
+ The installer supplies 82 skills at `.codex/skills/<name>/SKILL.md` and relative
20
+ links at `.agents/skills/<name>` for current Codex discovery. The retained storage
21
+ path keeps older installations and references compatible. Codex documents
22
+ repository discovery under `.agents/skills` and supports linked skill folders:
23
+ [official skill documentation](https://learn.chatgpt.com/docs/build-skills).
24
+ Existing discovery entries are preserved and reported as `DISCOVERY CONFLICT`;
25
+ you choose which skill to expose. The installer never replaces those entries or
26
+ follows an external link to update it. Creating directory symlinks requires OS
27
+ support/permission (on Windows, typically Developer Mode); failure is reported,
28
+ not silently treated as a complete installation.
29
+
30
+ It creates root `AGENTS.md`, `.codex/config.toml`, and
31
+ `.codex/rules/default.rules` only when absent. Existing copies are **always
32
+ preserved**, including prior stock templates. Review new template defaults and
33
+ merge any desired changes yourself. Default coordinator configuration is
34
+ **gpt-6-astra / high**, with **gpt-5.6-sol / medium** subagent fallback;
35
+ configuration is not proof of model availability or behavioral quality.
36
+
37
+ It also installs two native hook handlers in `.codex/hooks/superkit.mjs` and
38
+ the merge template `.codex/superkit-hooks.json`. A new `.codex/hooks.json` is
39
+ created only when absent, the project config is absent or exactly the shipped
40
+ config, and neither managed hook asset conflicts. Existing hook definitions and
41
+ arbitrary config are preserved; review and merge the template manually when
42
+ needed. The installer never grants project trust or hook trust. Review both
43
+ the definition and script, then use `/hooks` in a supporting Codex runtime.
44
+ See [native hook setup and limits](#native-hooks-and-trust).
45
+
46
+ ### Re-run the same command to update
47
+
48
+ Refresh your Superkit checkout to the desired reviewed version, then run
49
+ `--codex-only` again. Updates are explicit; no scheduler or Claude SessionStart
50
+ hook is installed for Codex.
51
+
52
+ | Target state | Behavior |
53
+ | --- | --- |
54
+ | No `.codex` | Fresh install; preserve any existing root instructions/discovery entries. |
55
+ | Existing, unrecognized skills | Merge: add missing skills, preserve/report differing existing skills. |
56
+ | Recorded Superkit hashes | Upgrade skills and hook assets only when still matching their recorded installed hash. |
57
+ | Stock v1.5.2 installation without a manifest | Recognize pristine skills using the bundled SHA-256 baseline, then upgrade safely. |
58
+ | Custom skill or hook asset differs from its baseline and incoming content | `CONFLICT`: retain local bytes and report the upstream source for manual comparison. |
59
+ | Existing managed-path file exactly matches incoming content | Adopt it as managed without rewriting it. |
60
+
61
+ The installer maintains `.codex/.superkit-manifest.json` (schema 1, installed
62
+ `skills` hashes and an optional `assets` map for the hook script/template).
63
+ Older schema-1 manifests without `assets` remain valid. Active `hooks.json` is
64
+ preserved configuration, not a managed update asset. Preserve the manifest with
65
+ the installed files. The legacy baseline
66
+ in `packages/codex/legacy-baseline.json` is pinned to v1.5.2 commit
67
+ `cbb0565f4d4868fe77f4bd7e8fdd46dada3e52ab`; it requires no network access.
68
+ Other unknown versions are merged conservatively. Missing shipped skills are
69
+ recreated; removed upstream roles and unrelated/support files are not deleted.
70
+ To disable a skill, use Codex's skill configuration rather than deleting its file.
71
+
72
+ Before replacing pristine skills or hook assets, the installer writes old bytes and the
73
+ previous manifest (if present) into a new, unique directory under
74
+ `.codex/.superkit-backups/`, printing its absolute path. Existing backups are never
75
+ deleted or reused. For rollback, stop installers, inspect the printed backup, and
76
+ restore selected `skills/<name>/SKILL.md`, `hooks/superkit.mjs` and/or
77
+ `superkit-hooks.json` files to their corresponding paths under `.codex/`; restore
78
+ the backed-up manifest as well for a full rollback of that update. New files from
79
+ that run remain until you explicitly remove them. A legacy first upgrade has no
80
+ old manifest; restored legacy bytes will be preserved as conflicts on subsequent
81
+ runs, so compare and resolve them manually.
82
+
83
+ A conflicting file is a successful **preserving** install, not a fully applied
84
+ upstream update. Read the summary. Corrupt manifests, incomplete packages,
85
+ symbolic links in managed write paths, and non-regular files stop installation
86
+ with an error. Known discovery links are the intentional exception; discovery
87
+ parents must be real directories. `.codex/.superkit-install.lock` prevents
88
+ concurrent installer runs. After an interrupted run, verify no installer is
89
+ active before removing a stale lock and rerunning. Individual replacements are
90
+ atomic, but the whole install is not a transaction; backups cover replacements
91
+ and a rerun preserves unrecognized partial-update bytes. Do not edit target files
92
+ concurrently with installation. This is not a hostile-filesystem sandbox.
93
+
94
+ ### Existing combined installer
95
+
96
+ `--codex` keeps its additive meaning: Claude + Codex. For example:
97
+
98
+ ```bash
99
+ bash /path/to/claude-code-superkit/setup.sh --defaults --codex
100
+ ```
101
+
102
+ The Codex portion uses the same independent update policy even when the Claude
103
+ portion is fresh, merged, or overwritten. `--codex-only` rejects `--codex`,
104
+ `--stacks`, `--extras`, `--profile`, and `--plugins` together. `--defaults`,
105
+ `--no-docs`, and `--no-superpowers` are accepted but unnecessary in standalone mode.
106
+
107
+ ### v1.5.3 release artifact
108
+
109
+ The v1.5.3 package archive includes both installers, the Claude layer and optional
110
+ GAN sources; `--codex-only` selects only Codex assets for your project. Use the
111
+ package archive attached to the [v1.5.3 GitHub release](https://github.com/RaNDoM6913/claude-code-superkit/releases/tag/v1.5.3),
112
+ or create the same package format from a reviewed v1.5.3 checkout:
113
+
114
+ ```bash
115
+ npm pack --ignore-scripts --pack-destination /path/to/artifacts
116
+ ```
117
+
118
+ Extract the resulting archive to a separate directory, then run from your target
119
+ project:
120
+
121
+ ```bash
122
+ node /path/to/extracted/package/bin/cli.js --codex-only
123
+ ```
124
+
125
+ The archive includes the installer, skill sources, hook script/template, and legacy baseline.
126
+ The archive version is 1.5.3. Re-run the extracted installer to update an existing
127
+ project under the same preservation and backup policy. GitHub release archives
128
+ and the tagged checkout are usable independently of npm registry availability.
129
+ Check `npm view claude-code-superkit@1.5.3 version`; when it returns `1.5.3`, the
130
+ equivalent command from your target project is
131
+ `npx claude-code-superkit@1.5.3 --codex-only`.
132
+
133
+ ### Use and manual installations
134
+
135
+ Start Codex in the target project, open `/skills` or type `$` and select a role,
136
+ for example `$code-reviewer`. Customize `AGENTS.md` with actual project facts.
137
+ If new skills do not appear, restart Codex and check reported discovery conflicts.
138
+ Discovery proves loading, not successful execution of a workflow or model quality.
139
+
140
+ For selective/manual setup, place chosen skill folders (or links to them) under
141
+ project `.agents/skills/`; copy the templates only when absent and merge existing
142
+ configurations manually. Manual linked-source skills follow their source checkout
143
+ and do not receive installer-managed backups. Global installations are manual;
144
+ this installer never writes to `~/.codex` or `~/.agents`.
145
+
146
+ ## What Gets Installed
147
+
148
+ Automated installation includes all 82 skills below. For manual selection only,
149
+ create `.agents/skills/` before copying and preserve any existing same-name folders.
150
+
151
+ ### 9 Command Skills (user-invocable)
152
+
153
+ | Skill | Description |
154
+ |-------|-------------|
155
+ | `dev-orchestrator` | 16-phase development cycle: read-docs, understand, architect, pseudocode, plan, contract, validate, implement, evaluate, verify, test, verify-goals, review, critic, document, report |
156
+ | `review-orchestrator` | Detect changes, gather git context, dispatch reviewer agents in parallel, collect and deduplicate findings |
157
+ | `audit-orchestrator` | Parallel audit across frontend, backend, infra, security |
158
+ | `test-runner` | Auto-detect project test runner and execute tests |
159
+ | `lint-runner` | Auto-detect linters, run with optional --fix mode |
160
+ | `commit-helper` | Conventional commit with secret detection |
161
+ | `new-migration` | Discover the migration tool/dialect and scaffold its native format without applying it |
162
+ | `migrate` | Inspect status by default; apply or roll back an explicitly authorized, bounded set |
163
+ | `benchmark` | Run available Go benchmarks; compare an isolated baseline with installed tools |
164
+
165
+ ### 36 Agent Skills (available roles)
166
+
167
+ These include converted core/extras roles and native GPT roles with Astra-authored instructions. `native-skills.txt` lists protected native roles, adapted workflows and support sources; the converter preserves them and rejects missing declared native assets before writing. The [roadmap](../../docs/superpowers/plans/2026-10-09-gpt-agent-roadmap-1.5.3.md) tracks accepted role packets separately from target-model behavioral acceptance. Source ownership is not proof of model quality. Use depends on the task, user authorization, and available runtime tools; automatic dispatch applies only where an existing caller selects the role. `behavioral-nudge-engine` is available for product nudge-design tasks and has no automatic Codex orchestrator caller. **v1.4.0 added 4 specialist roles:**
168
+
169
+ - `minimal-change-engineer` — surgical implementation, refuses scope creep
170
+ - `reality-checker` — checks readiness claims against applicable evidence and reports external blockers
171
+ - `codebase-onboarding-engineer` — task-focused repository brief with verified facts and explicit unknowns
172
+ - `behavioral-nudge-engine` — retention psychology, habit loops
173
+
174
+ | Skill | Category |
175
+ |-------|----------|
176
+ | `code-reviewer` | Quality — generic code review |
177
+ | `comment-rot-analyzer` | Quality |
178
+ | `security-scanner` | Security — OWASP top-10 + 18 generic checks |
179
+ | `silent-failure-hunter` | Quality |
180
+ | `audit-frontend` | Audit — 12 frontend checks against assigned product, data and toolchain contracts; evidence gaps explicit |
181
+ | `audit-backend` | Audit — 12 backend domains against assigned API, data-access and operational contracts; evidence gaps explicit |
182
+ | `audit-infra` | Audit — infrastructure security (12 checks) |
183
+ | `migration-reviewer` | Quality — SQL migration review |
184
+ | `test-generator` | Productivity — generate tests |
185
+ | `e2e-test-generator` | Productivity — Playwright/Cypress tests |
186
+ | `health-checker` | DevOps — compilation checks |
187
+ | `pre-deploy-validator` | DevOps — pre-deploy checklist (9 points) |
188
+ | `dependency-checker` | DevOps — dependency audit |
189
+ | `debug-observer` | Observability — debug analysis |
190
+ | `docs-reviewer` | Quality — documentation freshness, accuracy, coverage |
191
+ | `api-contract-sync` | Quality — API spec ↔ routes sync |
192
+ | `scaffold-endpoint` | Productivity — new endpoint scaffolding |
193
+ | `ui-reviewer` | Quality — UI/UX design system review |
194
+ | `bot-reviewer` | Quality — bot code review (Telegram/Discord/Slack) |
195
+ | `design-system-reviewer` | Quality — design system compliance |
196
+ | `database-reviewer` | Quality — PostgreSQL specialist |
197
+ | `architect` | Quality — system design advisor |
198
+ | `plan-checker` | Quality — requirement coverage, repository facts, dependencies, authority and feasible verification; PASS / REVISE / BLOCK |
199
+ | `goal-verifier` | Quality — 4-level goal substantiation, 3-state verdict (PASS / NEEDS-ATTENTION / NEEDS-REMEDIATION) |
200
+ | `evaluator` | Quality — calibrated QA scoring against Sprint Contract |
201
+ | `project-architecture` | Knowledge — project architecture reference |
202
+ | `ai-slop-cleaner` | Quality — detect and fix AI-generated code patterns |
203
+ | `critic` | Quality — multi-perspective final quality gate |
204
+ | `visual-reviewer` | Quality — visual/design-system review with separate source, rendered and interaction evidence; scoring only with an approved rubric |
205
+ | `tree-generator` | Productivity — generate project tree files |
206
+ | `writing-agents` | Knowledge — how to write agents |
207
+ | `writing-commands` | Knowledge — how to write command orchestrators |
208
+
209
+ ### Frontend UI Skills (included; manual selection for 2D UI projects)
210
+
211
+ - `frontend-ui-reviewer` — umbrella reviewer
212
+ - `frontend-ui-typography-reviewer`, `frontend-ui-color-reviewer`,
213
+ `frontend-ui-motion-reviewer`, `frontend-ui-interaction-reviewer`,
214
+ `frontend-ui-design-critic` — five specialists
215
+ - `impeccable-craft` — opt-in craft skill
216
+
217
+ ### Frontend 3D Skills (included; manual selection for 3D projects)
218
+
219
+ - Reviewers: `presentation-reviewer`, `r3f-scene-reviewer`,
220
+ `ui-design-reviewer`, `frontend-perf-reviewer`
221
+ - Knowledge: `threejs-color-management`, `r3f-scroll-driven-3d`, `gltf-debugging`,
222
+ `html-to-3d-texture`, `product-3d-lighting`, `output-enforcement`
223
+
224
+ ### Stack-Specific Reviewers (included; manual selection per language)
225
+
226
+ - Go reviewers: `go-reviewer`, `go-error-reviewer`, `go-concurrency-reviewer`,
227
+ `go-performance-reviewer`, `go-modernizer`, `go-observability-reviewer`
228
+ - Go knowledge: `go-samber-do`, `go-samber-oops`, `go-samber-lo`,
229
+ `go-grpc-patterns`, `go-benchmark`
230
+ - Other languages: `ts-reviewer`, `py-reviewer`, `rs-reviewer`
231
+
232
+ For selective manual setup, each source folder is under `packages/codex/skills/`.
233
+ Confirm its destination under `.agents/skills/` is absent before copying or linking.
234
+ If it exists, compare and merge manually; copying over it bypasses all installer
235
+ preservation and backup checks. Prefer the automated route for managed updates.
236
+
237
+ ### Total: 82 skills
238
+
239
+ - 9 command skills (user-invocable, including benchmark)
240
+ - 36 agent + knowledge skills (task-specific use or existing caller dispatch) — incl. v1.4.0: minimal-change-engineer, reality-checker, codebase-onboarding-engineer, behavioral-nudge-engine
241
+ - 10 frontend 3D skills (optional, for R3F/Three.js/GSAP projects)
242
+ - 7 frontend UI skills (optional, for 2D UI / landing-page / dashboard projects)
243
+ - 9 stack-specific reviewer skills (optional, per language)
244
+ - 5 Go knowledge skills (optional, samber-do/oops/lo, grpc-patterns, benchmark-methodology)
245
+ - 6 TGApp / production skills (telegram-bot-builder, nextjs-supabase-auth, drizzle-orm-expert, ru-text, postgresql-optimization, redis-patterns)
246
+
247
+ Plus 1 Codex approval rules file (`packages/codex/rules/default.rules`), 2 hook handlers in 1 script, and 3 GAN agents (separate optional package, requires Playwright).
248
+
249
+ ## Model Configuration
250
+
251
+ The default `config.toml` separates coordinator and subagent models:
252
+
253
+ ```toml
254
+ model = "gpt-6-astra"
255
+ model_reasoning_effort = "high"
256
+ web_search = "live"
257
+
258
+ [features]
259
+ multi_agent = true
260
+
261
+ [agents]
262
+ default_subagent_model = "gpt-5.6-sol"
263
+ default_subagent_reasoning_effort = "medium"
264
+ ```
265
+
266
+ Skills are instructions used by the agent that loads them; skill frontmatter does not select the execution model. The agent defaults apply when a dispatch omits model or effort. Explicit task routing should select the intended model and effort, with substantive Sol review at `high` and critical decisions accepted by Astra. The supported effort levels and model availability depend on the installed runtime and account.
267
+
268
+ These settings were checked against Codex CLI `0.162.0-alpha.17.2` and the [official configuration reference](https://learn.chatgpt.com/docs/config-file/config-reference). They declare routing; they do not prove a live task ran on that model. Model behavioral acceptance remains pending. The owner-required Astra authorship rule for Superkit contributors is documented in [WORKING_AGREEMENT.md](../../docs/WORKING_AGREEMENT.md).
269
+
270
+ ## Native hooks and trust
271
+
272
+ Codex supports lifecycle hooks in `hooks.json` beside active config layers;
273
+ project-local hooks also require project trust. See the [official hooks and
274
+ trust documentation](https://learn.chatgpt.com/docs/hooks) and
275
+ [configuration reference](https://learn.chatgpt.com/docs/config-file/config-reference).
276
+ Superkit ships this bounded mapping:
277
+
278
+ | Handler | Check | Limit |
279
+ | --- | --- | --- |
280
+ | `PreToolUse` (`Bash`) | Rejects recognized static destructive Git commands | Never returns permission allow; opaque shell syntax is unassessed. It is not a complete shell parser/security boundary. |
281
+ | `Stop` | Filter-free repositories: read-only tracked/staged `git diff --check`; at most one continuation | Any configured clean/process filter skips both diffs with UNVERIFIED. Does not prove tests/builds passed or check untracked file behavior. |
282
+
283
+ Git diff checks can execute clean/process conversion programs. Before either
284
+ diff, Stop enumerates config keys only and conservatively skips both checks when
285
+ any `filter.*.clean` or `filter.*.process` is configured, including unused drivers
286
+ and global Git LFS configuration. No filter values are captured or Git config
287
+ changed. This availability limit remains UNVERIFIED, never a whitespace pass;
288
+ run the applicable verification explicitly under its own task authority.
289
+
290
+ The handlers run no project scripts, read no transcripts and contact no external
291
+ services. Wiring resolves the Git root through a POSIX shell; Windows and cloud
292
+ runtime execution are unqualified. Keep task authority, approvals and real
293
+ verification gates in force even when a hook returns no block.
294
+
295
+ After installation, inspect `.codex/hooks.json` or manually merge
296
+ `.codex/superkit-hooks.json` into your existing hook configuration. Other active
297
+ sources can also contribute hooks; avoid duplicate registrations. Review the
298
+ referenced `.codex/hooks/superkit.mjs`, trust the project when appropriate and
299
+ use `/hooks` to review the exact definition. The installer writes no trust
300
+ settings and never bypasses trust. An existing active hook definition is preserved
301
+ on updates. Definition-hash trust does not fully attest the referenced script:
302
+ review managed script changes separately, including backup/conflict reports.
303
+
304
+ A copied definition is not proof of trust, handler execution or native event
305
+ firing. Check each separately in the intended runtime. Direct script fixtures
306
+ qualify handler behavior only; file installation/discovery checks do not establish
307
+ native firing, consumer workflow execution or model quality.
308
+
309
+ For this release, actual Codex CLI `0.162.0-alpha.17.2` in a disposable POSIX/macOS
310
+ fixture observed native PreToolUse blocking a hard reset and Stop progressing from
311
+ blocked to completed, followed by a completed turn. Normal folder trust and
312
+ individual definition review were used. The [activation record](../../docs/superpowers/migrations/astra-native/evidence/GPT-codex-native-activation-candidate-2026-10-15.md)
313
+ preserves the partial first attempt and completed successor. This evidence does
314
+ not activate hooks in your project or qualify Windows/cloud, every workflow,
315
+ arbitrary shell syntax or model quality.
316
+
317
+ ### Claude behaviors without a shipped Codex mapping
318
+
319
+ | Feature | Claude Code | Codex route |
320
+ | --- | --- | --- |
321
+ | Session continuity | SessionStart restore / pre-compact save | Not mapped; maintain authorized project notes. |
322
+ | Full Stop verification | Compilation/documentation checks | Not mapped; run applicable test/lint/docs gates. |
323
+ | Format/typecheck-on-edit | Language-specific PostToolUse checks | Not mapped; use editor checks or authorized lint-runner fixes. |
324
+ | Doc-check-on-commit | Documentation commit gate | Not mapped; follow AGENTS.md and docs-reviewer. |
325
+ | Migration validation | Migration naming/safety hooks | Not mapped; use applicable migration skills and task authority. |
326
+ | Bundle import check | Dependency warning | Not mapped; use dependency-checker. |
327
+ | Hook profiles | fast/standard/strict | Not mapped; review the two native handler definitions directly. |
328
+
329
+ ## Verification
330
+
331
+ Inspect `.codex/skills/`, `.agents/skills/`, root `AGENTS.md` and the installed
332
+ config/rules and managed hook script/template. In Codex, use `/skills` or `$`
333
+ to verify discovery and `/hooks` to inspect hook review/trust status. The installer
334
+ reports conflicts explicitly; a successful run does not imply every upstream
335
+ change replaced a local customization.
336
+
337
+ ## Updating
338
+
339
+ Use the [safe re-run procedure](#re-run-the-same-command-to-update) above.
340
+ Do not recursively copy over installed skills to update them: that bypasses
341
+ customization checks and backups. For manual linked installations, review the
342
+ source-checkout changes before refreshing it.
@@ -0,0 +1,22 @@
1
+ # claude-code-superkit — Codex CLI configuration
2
+ # Place in .codex/config.toml (project) or ~/.codex/config.toml (global)
3
+
4
+ model = "gpt-6-astra"
5
+ model_reasoning_effort = "high"
6
+ web_search = "live"
7
+
8
+ [features]
9
+ multi_agent = true
10
+
11
+ [agents]
12
+ default_subagent_model = "gpt-5.6-sol"
13
+ default_subagent_reasoning_effort = "medium"
14
+
15
+ # MCP servers (uncomment as needed)
16
+ # [mcp_servers.playwright]
17
+ # command = "npx"
18
+ # args = ["@playwright/mcp@latest"]
19
+
20
+ # [mcp_servers.context7]
21
+ # command = "npx"
22
+ # args = ["-y", "@context7/mcp@latest"]
@@ -0,0 +1,203 @@
1
+ #!/usr/bin/env node
2
+ // Native Codex command hooks. No transcript reads, model calls, project scripts or writes.
3
+ import { spawnSync } from 'node:child_process';
4
+ import { isAbsolute } from 'node:path';
5
+
6
+ const mode = process.argv[2];
7
+ const deny = reason => ({ hookSpecificOutput: { hookEventName: 'PreToolUse', permissionDecision: 'deny', permissionDecisionReason: reason } });
8
+ const unverified = () => ({ systemMessage: 'Superkit diff hygiene UNVERIFIED: invalid input, unavailable Git, non-repository cwd, or bounded Git check failure. Run applicable verification explicitly; do not claim a pass.' });
9
+
10
+ // Deliberately a recognizer for explicit shell words, not a shell interpreter.
11
+ // Expansions, heredocs and nested interpreters are not assessed. Native permission
12
+ // rules/sandbox/user authority still apply; this hook never emits "allow".
13
+ function shellWords(command) {
14
+ const commands = [];
15
+ let words = [], word = '', quote = '', started = false, opaque = false;
16
+ const finishWord = () => { if (started) words.push(word); word = ''; started = false; };
17
+ const finishCommand = () => { finishWord(); if (words.length) commands.push(words); words = []; };
18
+ for (let i = 0; i < command.length; i++) {
19
+ const ch = command[i];
20
+ if (quote === "'") {
21
+ if (ch === quote) quote = ''; else word += ch;
22
+ continue;
23
+ }
24
+ if (ch === '\\' && quote !== "'") {
25
+ if (i + 1 >= command.length) { opaque = true; break; }
26
+ const next = command[++i];
27
+ if (next !== '\n') { word += next; started = true; }
28
+ continue;
29
+ }
30
+ if (ch === '$' || ch === '`') opaque = true;
31
+ if (quote === '"') {
32
+ if (ch === quote) quote = ''; else word += ch;
33
+ continue;
34
+ }
35
+ if (ch === "'" || ch === '"') { quote = ch; started = true; continue; }
36
+ if (ch === '#' && !started) {
37
+ while (i < command.length && command[i] !== '\n') i++;
38
+ finishCommand(); continue;
39
+ }
40
+ if (ch === '<' && command[i + 1] === '<') { opaque = true; break; }
41
+ if ('<>()[]{}*?~'.includes(ch)) opaque = true;
42
+ if (';&|\n'.includes(ch)) { finishCommand(); continue; }
43
+ if (/\s/.test(ch)) { finishWord(); continue; }
44
+ word += ch; started = true;
45
+ }
46
+ if (quote) opaque = true;
47
+ finishCommand();
48
+ return { commands, opaque };
49
+ }
50
+
51
+ function commandIndex(words) {
52
+ let i = 0;
53
+ const assignments = () => { while (/^[A-Za-z_][A-Za-z0-9_]*=/.test(words[i] || '')) i++; };
54
+ assignments();
55
+ if (words[i] === 'env') {
56
+ i++;
57
+ while (['-i', '--ignore-environment', '--'].includes(words[i])) i++;
58
+ assignments();
59
+ }
60
+ if (words[i] === 'command') { i++; if (words[i] === '--') i++; }
61
+ return i;
62
+ }
63
+
64
+ function gitArgs(words) {
65
+ let i = commandIndex(words);
66
+ if (!/(^|\/)git$/.test(words[i] || '')) return null;
67
+ i++;
68
+ while (words[i]?.startsWith('-')) {
69
+ const option = words[i++];
70
+ if (['-C', '-c', '--git-dir', '--work-tree', '--namespace'].includes(option)) { i++; continue; }
71
+ if (/^(?:-C.|-c.|--(?:git-dir|work-tree|namespace)=)/.test(option)) continue;
72
+ if (['--no-pager', '--paginate', '--bare', '--literal-pathspecs', '--no-optional-locks'].includes(option)) continue;
73
+ return { opaque: true };
74
+ }
75
+ return { operation: words[i], args: words.slice(i + 1) };
76
+ }
77
+
78
+ // Value-taking options must be consumed before inspecting flags. In a short
79
+ // cluster, the remainder after such an option is its value (e.g. -amtext).
80
+ // This intentionally covers the direct Git forms below, not Git aliases or
81
+ // arbitrary wrappers/option abbreviations.
82
+ function gitOptions(operation, args) {
83
+ const valueOptions = {
84
+ commit: ['mFctC', '--message', '--file', '--reuse-message', '--reedit-message', '--template', '--author', '--date', '--fixup', '--squash', '--cleanup', '--trailer', '--pathspec-from-file'],
85
+ push: ['o', '--push-option', '--repo', '--receive-pack', '--exec'],
86
+ merge: ['mFsX', '--message', '--file', '--strategy', '--strategy-option', '--into-name'],
87
+ rebase: ['sXx', '--onto', '--exec', '--strategy', '--strategy-option'],
88
+ clean: ['e', '--exclude'],
89
+ branch: ['', '--format', '--sort', '--points-at'],
90
+ reset: ['', '--pathspec-from-file'],
91
+ checkout: ['bB', '--orphan', '--conflict', '--pathspec-from-file'],
92
+ switch: ['cC', '--create', '--force-create', '--orphan', '--conflict'],
93
+ restore: ['s', '--source', '--conflict', '--pathspec-from-file']
94
+ }[operation] || [''];
95
+ const flags = new Set(), operands = [];
96
+ let separator = false;
97
+ for (let i = 0; i < args.length; i++) {
98
+ const arg = args[i];
99
+ if (separator) { operands.push(arg); continue; }
100
+ if (arg === '--') { separator = true; continue; }
101
+ if (arg.startsWith('--')) {
102
+ const name = arg.split('=', 1)[0];
103
+ flags.add(name);
104
+ if (!arg.includes('=') && valueOptions.includes(name)) i++;
105
+ } else if (/^-[^-]/.test(arg)) {
106
+ for (let j = 1; j < arg.length; j++) {
107
+ flags.add(`-${arg[j]}`);
108
+ // Optional short values are attached only; e.g. -Skey must not turn
109
+ // letters in a signing key into commit flags, or consume the next flag.
110
+ if (operation === 'commit' && 'Su'.includes(arg[j])) break;
111
+ if (valueOptions[0].includes(arg[j])) {
112
+ if (j === arg.length - 1) i++;
113
+ break;
114
+ }
115
+ }
116
+ } else operands.push(arg);
117
+ }
118
+ return { flags, operands, separator };
119
+ }
120
+
121
+ function destructive(operation, args) {
122
+ const { flags, operands, separator } = gitOptions(operation, args);
123
+ const short = flag => flags.has(`-${flag}`);
124
+ const has = flag => flags.has(flag);
125
+ if (operation === 'commit' && (has('--no-verify') || short('n'))) return 'commit verification bypass';
126
+ if (['push', 'merge', 'rebase'].includes(operation) && has('--no-verify')) return 'verification bypass';
127
+ if (operation === 'push' && (short('f') || has('--force') || operands.some(a => a.startsWith('+')))) return 'force push';
128
+ if (operation === 'reset' && has('--hard')) return 'hard reset';
129
+ if (operation === 'clean' && !has('--dry-run') && !short('n') && (has('--force') || short('f'))) return 'forced clean';
130
+ if (operation === 'branch' && (short('D') || ((has('--delete') || short('d')) && (has('--force') || short('f'))))) return 'forced branch deletion';
131
+ if (operation === 'checkout' && (separator || operands.includes('.') || has('--force') || short('f') || short('B'))) return 'checkout discarding work';
132
+ if (operation === 'switch' && (has('--discard-changes') || has('--force') || has('--force-create') || short('f') || short('C'))) return 'switch discarding work';
133
+ if (operation === 'restore' && (!(has('--staged') || short('S')) || has('--worktree') || short('W'))) return 'restore overwriting working files';
134
+ return null;
135
+ }
136
+
137
+ function preTool(input) {
138
+ if (input?.hook_event_name !== 'PreToolUse' || typeof input.tool_name !== 'string') return deny('Superkit Git guard could not validate the hook input. Check the installed hook integration.');
139
+ if (input.tool_name !== 'Bash') return {};
140
+ const command = input.tool_input?.command;
141
+ if (typeof command !== 'string' || !command.trim()) return deny('Superkit Git guard received no valid shell command.');
142
+ const parsed = shellWords(command);
143
+ let opaque = parsed.opaque;
144
+ for (const words of parsed.commands) {
145
+ const executable = words[commandIndex(words)]?.split('/').pop();
146
+ if (['sh', 'bash', 'zsh', 'eval', 'source', '.'].includes(executable)) opaque = true;
147
+ const git = gitArgs(words);
148
+ if (!git) continue;
149
+ if (git.opaque) { opaque = true; continue; }
150
+ const reason = destructive(git.operation, git.args);
151
+ if (reason) return deny(`Superkit blocked explicit ${reason}. Preserve work and use a non-destructive operation; do not bypass this hook. User authorization and native permissions remain required.`);
152
+ }
153
+ return opaque ? { hookSpecificOutput: { hookEventName: 'PreToolUse', additionalContext: 'Superkit Git guard: dynamic or unsupported shell syntax was not assessed. This is not permission to execute it; inspect the exact operation and apply native permissions and user authority.' } } : {};
154
+ }
155
+
156
+ function git(cwd, args) {
157
+ // Event cwd is the repository authority. Inherited Git location/index overrides
158
+ // must not silently redirect hygiene checks to a different worktree or index.
159
+ const env = { ...process.env, GIT_TERMINAL_PROMPT: '0', GIT_OPTIONAL_LOCKS: '0' };
160
+ for (const key of ['GIT_DIR', 'GIT_WORK_TREE', 'GIT_INDEX_FILE', 'GIT_COMMON_DIR', 'GIT_OBJECT_DIRECTORY', 'GIT_ALTERNATE_OBJECT_DIRECTORIES', 'GIT_PREFIX']) delete env[key];
161
+ return spawnSync('git', ['--no-pager', '-c', 'core.fsmonitor=false', ...args], {
162
+ cwd, encoding: 'utf8', timeout: 3000, maxBuffer: 1024 * 1024, windowsHide: true,
163
+ env
164
+ });
165
+ }
166
+
167
+ function stop(input) {
168
+ if (input?.hook_event_name !== 'Stop' || typeof input.cwd !== 'string' || !isAbsolute(input.cwd)) return unverified();
169
+ const root = git(input.cwd, ['rev-parse', '--show-toplevel']);
170
+ if (root.error || root.status !== 0 || !root.stdout.trim()) return unverified();
171
+ // --no-ext-diff/--no-textconv do not disable clean/process conversions, which
172
+ // Git may run while comparing a working file. Enumerate names only, without
173
+ // reading handler values into this process or executing any diff first.
174
+ const filters = git(root.stdout.trim(), ['config', '--includes', '--name-only', '--get-regexp', '^filter\\..*\\.(clean|process)$']);
175
+ if (filters.error || ![0, 1].includes(filters.status)) return unverified();
176
+ if (filters.status === 0) return {
177
+ systemMessage: 'Superkit diff hygiene UNVERIFIED: Git clean/process conversion filters are configured. Skipped diff checks to avoid executing configured conversion programs. This also applies to unused configured filters; run applicable verification explicitly without claiming this hook passed.'
178
+ };
179
+ const results = [
180
+ git(root.stdout.trim(), ['diff', '--no-ext-diff', '--no-textconv', '--check']),
181
+ git(root.stdout.trim(), ['diff', '--cached', '--no-ext-diff', '--no-textconv', '--check'])
182
+ ];
183
+ if (results.some(r => r.error || ![0, 2].includes(r.status))) return unverified();
184
+ if (results.every(r => r.status === 0)) return {};
185
+ const reason = 'Superkit Git diff hygiene found whitespace errors or conflict markers in tracked staged/unstaged changes. Inspect git diff --check and git diff --cached --check. Fix only changes within authorized scope; preserve/report pre-existing or unrelated errors. This check does not verify tests, builds, untracked files or behavior.';
186
+ return input.stop_hook_active ? { systemMessage: `${reason} No further automatic continuation requested.` } : { decision: 'block', reason };
187
+ }
188
+
189
+ try {
190
+ const chunks = [];
191
+ let length = 0;
192
+ for await (const chunk of process.stdin) {
193
+ length += chunk.length;
194
+ if (length > 1024 * 1024) throw new Error('Oversized input');
195
+ chunks.push(chunk);
196
+ }
197
+ const input = JSON.parse(Buffer.concat(chunks).toString('utf8'));
198
+ if (mode !== 'pre-tool' && mode !== 'stop') throw new Error('Unknown hook mode');
199
+ console.log(JSON.stringify(mode === 'pre-tool' ? preTool(input) : stop(input)));
200
+ } catch {
201
+ // Do not echo payloads, commands, messages, transcripts or diff contents.
202
+ console.log(JSON.stringify(mode === 'pre-tool' ? deny('Superkit Git guard input/check failed. Review the hook installation before retrying.') : unverified()));
203
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "description": "Superkit Codex guards: explicit destructive Git commands and tracked diff hygiene. Review/trust through /hooks; never auto-trusted by the installer.",
3
+ "hooks": {
4
+ "PreToolUse": [
5
+ {
6
+ "matcher": "^Bash$",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "node \"$(git rev-parse --show-toplevel)/.codex/hooks/superkit.mjs\" pre-tool",
11
+ "timeout": 10,
12
+ "statusMessage": "Superkit Git safety check"
13
+ }
14
+ ]
15
+ }
16
+ ],
17
+ "Stop": [
18
+ {
19
+ "hooks": [
20
+ {
21
+ "type": "command",
22
+ "command": "node \"$(git rev-parse --show-toplevel)/.codex/hooks/superkit.mjs\" stop",
23
+ "timeout": 15,
24
+ "statusMessage": "Superkit tracked diff hygiene"
25
+ }
26
+ ]
27
+ }
28
+ ]
29
+ }
30
+ }