oh-my-customcodex 0.1.0

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 (351) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +327 -0
  3. package/dist/cli/index.js +32054 -0
  4. package/dist/index.js +5469 -0
  5. package/package.json +89 -0
  6. package/templates/.claude/agents/arch-documenter.md +38 -0
  7. package/templates/.claude/agents/arch-speckit-agent.md +66 -0
  8. package/templates/.claude/agents/be-django-expert.md +47 -0
  9. package/templates/.claude/agents/be-express-expert.md +31 -0
  10. package/templates/.claude/agents/be-fastapi-expert.md +45 -0
  11. package/templates/.claude/agents/be-go-backend-expert.md +45 -0
  12. package/templates/.claude/agents/be-nestjs-expert.md +29 -0
  13. package/templates/.claude/agents/be-springboot-expert.md +42 -0
  14. package/templates/.claude/agents/db-alembic-expert.md +73 -0
  15. package/templates/.claude/agents/db-postgres-expert.md +38 -0
  16. package/templates/.claude/agents/db-redis-expert.md +38 -0
  17. package/templates/.claude/agents/db-supabase-expert.md +37 -0
  18. package/templates/.claude/agents/de-airflow-expert.md +48 -0
  19. package/templates/.claude/agents/de-dbt-expert.md +36 -0
  20. package/templates/.claude/agents/de-kafka-expert.md +83 -0
  21. package/templates/.claude/agents/de-pipeline-expert.md +34 -0
  22. package/templates/.claude/agents/de-snowflake-expert.md +38 -0
  23. package/templates/.claude/agents/de-spark-expert.md +38 -0
  24. package/templates/.claude/agents/fe-design-expert.md +120 -0
  25. package/templates/.claude/agents/fe-flutter-agent.md +48 -0
  26. package/templates/.claude/agents/fe-svelte-agent.md +33 -0
  27. package/templates/.claude/agents/fe-vercel-agent.md +40 -0
  28. package/templates/.claude/agents/fe-vuejs-agent.md +34 -0
  29. package/templates/.claude/agents/infra-aws-expert.md +49 -0
  30. package/templates/.claude/agents/infra-docker-expert.md +49 -0
  31. package/templates/.claude/agents/lang-golang-expert.md +46 -0
  32. package/templates/.claude/agents/lang-java21-expert.md +42 -0
  33. package/templates/.claude/agents/lang-kotlin-expert.md +45 -0
  34. package/templates/.claude/agents/lang-python-expert.md +45 -0
  35. package/templates/.claude/agents/lang-rust-expert.md +45 -0
  36. package/templates/.claude/agents/lang-typescript-expert.md +45 -0
  37. package/templates/.claude/agents/mgr-claude-code-bible.md +62 -0
  38. package/templates/.claude/agents/mgr-creator.md +57 -0
  39. package/templates/.claude/agents/mgr-gitnerd.md +50 -0
  40. package/templates/.claude/agents/mgr-sauron.md +163 -0
  41. package/templates/.claude/agents/mgr-supplier.md +39 -0
  42. package/templates/.claude/agents/mgr-updater.md +40 -0
  43. package/templates/.claude/agents/qa-engineer.md +36 -0
  44. package/templates/.claude/agents/qa-planner.md +78 -0
  45. package/templates/.claude/agents/qa-writer.md +32 -0
  46. package/templates/.claude/agents/sec-codeql-expert.md +56 -0
  47. package/templates/.claude/agents/slack-cli-expert.md +98 -0
  48. package/templates/.claude/agents/souls/lang-golang-expert.soul.md +21 -0
  49. package/templates/.claude/agents/sys-memory-keeper.md +123 -0
  50. package/templates/.claude/agents/sys-naggy.md +76 -0
  51. package/templates/.claude/agents/tool-bun-expert.md +26 -0
  52. package/templates/.claude/agents/tool-npm-expert.md +31 -0
  53. package/templates/.claude/agents/tool-optimizer.md +37 -0
  54. package/templates/.claude/agents/wiki-curator.md +72 -0
  55. package/templates/.claude/config/required-plugins.json +30 -0
  56. package/templates/.claude/contexts/dev.md +20 -0
  57. package/templates/.claude/contexts/ecomode.md +110 -0
  58. package/templates/.claude/contexts/index.yaml +41 -0
  59. package/templates/.claude/contexts/research.md +28 -0
  60. package/templates/.claude/contexts/review.md +23 -0
  61. package/templates/.claude/hooks/hooks.json +533 -0
  62. package/templates/.claude/hooks/scripts/adaptive-harness-scan.sh +45 -0
  63. package/templates/.claude/hooks/scripts/agent-start-recorder.sh +40 -0
  64. package/templates/.claude/hooks/scripts/agent-teams-advisor.sh +76 -0
  65. package/templates/.claude/hooks/scripts/audit-log.sh +64 -0
  66. package/templates/.claude/hooks/scripts/auto-continue-guard.sh +33 -0
  67. package/templates/.claude/hooks/scripts/content-hash-validator.sh +75 -0
  68. package/templates/.claude/hooks/scripts/context-budget-advisor.sh +107 -0
  69. package/templates/.claude/hooks/scripts/cost-cap-advisor.sh +71 -0
  70. package/templates/.claude/hooks/scripts/cwd-change-detector.sh +36 -0
  71. package/templates/.claude/hooks/scripts/eval-core-batch-save.sh +46 -0
  72. package/templates/.claude/hooks/scripts/feedback-collector.sh +92 -0
  73. package/templates/.claude/hooks/scripts/file-change-validator.sh +26 -0
  74. package/templates/.claude/hooks/scripts/git-delegation-guard.sh +57 -0
  75. package/templates/.claude/hooks/scripts/model-escalation-advisor.sh +106 -0
  76. package/templates/.claude/hooks/scripts/omcodex-auto-update.sh +4 -0
  77. package/templates/.claude/hooks/scripts/omcustom-auto-update.sh +177 -0
  78. package/templates/.claude/hooks/scripts/rtk-intercept.sh +77 -0
  79. package/templates/.claude/hooks/scripts/rule-deletion-guard.sh +60 -0
  80. package/templates/.claude/hooks/scripts/schema-validator.sh +106 -0
  81. package/templates/.claude/hooks/scripts/secret-filter.sh +100 -0
  82. package/templates/.claude/hooks/scripts/session-autofix-prompt.sh +34 -0
  83. package/templates/.claude/hooks/scripts/session-autofix.sh +146 -0
  84. package/templates/.claude/hooks/scripts/session-env-check.sh +254 -0
  85. package/templates/.claude/hooks/scripts/skill-extractor-analyzer.sh +49 -0
  86. package/templates/.claude/hooks/scripts/stage-blocker.sh +16 -0
  87. package/templates/.claude/hooks/scripts/stale-todo-scanner.sh +91 -0
  88. package/templates/.claude/hooks/scripts/stall-detection-advisor.sh +112 -0
  89. package/templates/.claude/hooks/scripts/stop-console-audit.sh +46 -0
  90. package/templates/.claude/hooks/scripts/stuck-detector.sh +199 -0
  91. package/templates/.claude/hooks/scripts/task-outcome-recorder.sh +119 -0
  92. package/templates/.claude/hooks/scripts/task-state-precompact.sh +58 -0
  93. package/templates/.claude/hooks/scripts/user-prompt-preprocessor.sh +32 -0
  94. package/templates/.claude/hooks/skill-count-reminder.sh +34 -0
  95. package/templates/.claude/install-hooks.sh +100 -0
  96. package/templates/.claude/ontology/agents.yaml +546 -0
  97. package/templates/.claude/ontology/graphs/agent-skill.json +102 -0
  98. package/templates/.claude/ontology/graphs/full-graph.json +629 -0
  99. package/templates/.claude/ontology/graphs/routing.json +112 -0
  100. package/templates/.claude/ontology/graphs/skill-rule.json +78 -0
  101. package/templates/.claude/ontology/rules.yaml +251 -0
  102. package/templates/.claude/ontology/schema.yaml +144 -0
  103. package/templates/.claude/ontology/skills.yaml +575 -0
  104. package/templates/.claude/rules/MAY-optimization.md +42 -0
  105. package/templates/.claude/rules/MUST-agent-design.md +340 -0
  106. package/templates/.claude/rules/MUST-agent-identification.md +77 -0
  107. package/templates/.claude/rules/MUST-agent-teams.md +293 -0
  108. package/templates/.claude/rules/MUST-completion-verification.md +112 -0
  109. package/templates/.claude/rules/MUST-continuous-improvement.md +69 -0
  110. package/templates/.claude/rules/MUST-enforcement-policy.md +50 -0
  111. package/templates/.claude/rules/MUST-intent-transparency.md +74 -0
  112. package/templates/.claude/rules/MUST-language-policy.md +28 -0
  113. package/templates/.claude/rules/MUST-orchestrator-coordination.md +399 -0
  114. package/templates/.claude/rules/MUST-parallel-execution.md +184 -0
  115. package/templates/.claude/rules/MUST-permissions.md +32 -0
  116. package/templates/.claude/rules/MUST-safety.md +23 -0
  117. package/templates/.claude/rules/MUST-sync-verification.md +145 -0
  118. package/templates/.claude/rules/MUST-tool-identification.md +97 -0
  119. package/templates/.claude/rules/SHOULD-ecomode.md +123 -0
  120. package/templates/.claude/rules/SHOULD-error-handling.md +33 -0
  121. package/templates/.claude/rules/SHOULD-hud-statusline.md +51 -0
  122. package/templates/.claude/rules/SHOULD-interaction.md +77 -0
  123. package/templates/.claude/rules/SHOULD-memory-integration.md +371 -0
  124. package/templates/.claude/rules/SHOULD-ontology-rag-routing.md +49 -0
  125. package/templates/.claude/rules/SHOULD-wiki-sync.md +73 -0
  126. package/templates/.claude/rules/index.yaml +141 -0
  127. package/templates/.claude/schemas/tool-inputs.json +62 -0
  128. package/templates/.claude/skills/action-validator/SKILL.md +89 -0
  129. package/templates/.claude/skills/adaptive-harness/SKILL.md +335 -0
  130. package/templates/.claude/skills/adversarial-review/SKILL.md +80 -0
  131. package/templates/.claude/skills/agora/SKILL.md +194 -0
  132. package/templates/.claude/skills/airflow-best-practices/SKILL.md +94 -0
  133. package/templates/.claude/skills/alembic-best-practices/SKILL.md +295 -0
  134. package/templates/.claude/skills/ambiguity-gate/SKILL.md +94 -0
  135. package/templates/.claude/skills/analysis/SKILL.md +223 -0
  136. package/templates/.claude/skills/audit-agents/SKILL.md +118 -0
  137. package/templates/.claude/skills/aws-best-practices/SKILL.md +281 -0
  138. package/templates/.claude/skills/claude-code-bible/SKILL.md +93 -0
  139. package/templates/.claude/skills/claude-code-bible/scripts/fetch-docs.js +244 -0
  140. package/templates/.claude/skills/claude-native/SKILL.md +215 -0
  141. package/templates/.claude/skills/codex-exec/SKILL.md +206 -0
  142. package/templates/.claude/skills/codex-exec/scripts/codex-wrapper.cjs +430 -0
  143. package/templates/.claude/skills/create-agent/SKILL.md +94 -0
  144. package/templates/.claude/skills/cve-triage/SKILL.md +91 -0
  145. package/templates/.claude/skills/dag-orchestration/SKILL.md +201 -0
  146. package/templates/.claude/skills/dbt-best-practices/SKILL.md +55 -0
  147. package/templates/.claude/skills/de-lead-routing/SKILL.md +230 -0
  148. package/templates/.claude/skills/deep-plan/SKILL.md +344 -0
  149. package/templates/.claude/skills/deep-verify/SKILL.md +111 -0
  150. package/templates/.claude/skills/dev-lead-routing/SKILL.md +161 -0
  151. package/templates/.claude/skills/dev-refactor/SKILL.md +234 -0
  152. package/templates/.claude/skills/dev-review/SKILL.md +172 -0
  153. package/templates/.claude/skills/django-best-practices/SKILL.md +334 -0
  154. package/templates/.claude/skills/docker-best-practices/SKILL.md +276 -0
  155. package/templates/.claude/skills/evaluator-optimizer/SKILL.md +421 -0
  156. package/templates/.claude/skills/fastapi-best-practices/SKILL.md +271 -0
  157. package/templates/.claude/skills/fix-refs/SKILL.md +109 -0
  158. package/templates/.claude/skills/flutter-best-practices/SKILL.md +325 -0
  159. package/templates/.claude/skills/gemini-exec/SKILL.md +215 -0
  160. package/templates/.claude/skills/gemini-exec/scripts/gemini-wrapper.cjs +485 -0
  161. package/templates/.claude/skills/go-backend-best-practices/SKILL.md +135 -0
  162. package/templates/.claude/skills/go-best-practices/SKILL.md +204 -0
  163. package/templates/.claude/skills/hada-scout/SKILL.md +92 -0
  164. package/templates/.claude/skills/harness-eval/SKILL.md +95 -0
  165. package/templates/.claude/skills/harness-synthesizer/SKILL.md +145 -0
  166. package/templates/.claude/skills/help/SKILL.md +127 -0
  167. package/templates/.claude/skills/idea/SKILL.md +88 -0
  168. package/templates/.claude/skills/impeccable-design/SKILL.md +173 -0
  169. package/templates/.claude/skills/intent-detection/SKILL.md +293 -0
  170. package/templates/.claude/skills/intent-detection/patterns/agent-triggers.yaml +438 -0
  171. package/templates/.claude/skills/java21-best-practices/SKILL.md +190 -0
  172. package/templates/.claude/skills/jinja2-prompts/SKILL.md +86 -0
  173. package/templates/.claude/skills/kafka-best-practices/SKILL.md +53 -0
  174. package/templates/.claude/skills/kotlin-best-practices/SKILL.md +257 -0
  175. package/templates/.claude/skills/lists/SKILL.md +80 -0
  176. package/templates/.claude/skills/memory-management/SKILL.md +196 -0
  177. package/templates/.claude/skills/memory-recall/SKILL.md +172 -0
  178. package/templates/.claude/skills/memory-save/SKILL.md +128 -0
  179. package/templates/.claude/skills/model-escalation/SKILL.md +62 -0
  180. package/templates/.claude/skills/monitoring-setup/SKILL.md +215 -0
  181. package/templates/.claude/skills/multi-model-verification/SKILL.md +130 -0
  182. package/templates/.claude/skills/npm-audit/SKILL.md +74 -0
  183. package/templates/.claude/skills/npm-publish/SKILL.md +65 -0
  184. package/templates/.claude/skills/npm-version/SKILL.md +104 -0
  185. package/templates/.claude/skills/omcodex-auto-improve/SKILL.md +136 -0
  186. package/templates/.claude/skills/omcodex-feedback/SKILL.md +205 -0
  187. package/templates/.claude/skills/omcodex-improve-report/SKILL.md +65 -0
  188. package/templates/.claude/skills/omcodex-loop/SKILL.md +45 -0
  189. package/templates/.claude/skills/omcodex-release-notes/SKILL.md +117 -0
  190. package/templates/.claude/skills/omcodex-takeover/SKILL.md +115 -0
  191. package/templates/.claude/skills/omcodex-web/SKILL.md +95 -0
  192. package/templates/.claude/skills/optimize-analyze/SKILL.md +57 -0
  193. package/templates/.claude/skills/optimize-bundle/SKILL.md +69 -0
  194. package/templates/.claude/skills/optimize-report/SKILL.md +76 -0
  195. package/templates/.claude/skills/peer-messaging/SKILL.md +59 -0
  196. package/templates/.claude/skills/pipeline/SKILL.md +103 -0
  197. package/templates/.claude/skills/pipeline-architecture-patterns/SKILL.md +84 -0
  198. package/templates/.claude/skills/pipeline-guards/SKILL.md +173 -0
  199. package/templates/.claude/skills/post-release-followup/SKILL.md +134 -0
  200. package/templates/.claude/skills/postgres-best-practices/SKILL.md +67 -0
  201. package/templates/.claude/skills/pr-auto-improve/SKILL.md +129 -0
  202. package/templates/.claude/skills/professor-triage/SKILL.md +321 -0
  203. package/templates/.claude/skills/python-best-practices/SKILL.md +223 -0
  204. package/templates/.claude/skills/qa-lead-routing/SKILL.md +104 -0
  205. package/templates/.claude/skills/react-best-practices/SKILL.md +102 -0
  206. package/templates/.claude/skills/reasoning-sandwich/SKILL.md +64 -0
  207. package/templates/.claude/skills/redis-best-practices/SKILL.md +84 -0
  208. package/templates/.claude/skills/release-plan/SKILL.md +207 -0
  209. package/templates/.claude/skills/research/SKILL.md +493 -0
  210. package/templates/.claude/skills/result-aggregation/SKILL.md +165 -0
  211. package/templates/.claude/skills/rtk-exec/SKILL.md +199 -0
  212. package/templates/.claude/skills/rtk-exec/scripts/rtk-wrapper.cjs +377 -0
  213. package/templates/.claude/skills/rust-best-practices/SKILL.md +268 -0
  214. package/templates/.claude/skills/sauron-watch/SKILL.md +239 -0
  215. package/templates/.claude/skills/scout/SKILL.md +250 -0
  216. package/templates/.claude/skills/sdd/SKILL.md +24 -0
  217. package/templates/.claude/skills/sdd-dev/SKILL.md +257 -0
  218. package/templates/.claude/skills/sdd-development/SKILL.md +24 -0
  219. package/templates/.claude/skills/secretary-routing/SKILL.md +132 -0
  220. package/templates/.claude/skills/skill-extractor/SKILL.md +155 -0
  221. package/templates/.claude/skills/skills-sh-search/SKILL.md +210 -0
  222. package/templates/.claude/skills/snowflake-best-practices/SKILL.md +66 -0
  223. package/templates/.claude/skills/spark-best-practices/SKILL.md +53 -0
  224. package/templates/.claude/skills/springboot-best-practices/SKILL.md +74 -0
  225. package/templates/.claude/skills/springboot-best-practices/examples/config-properties-example.java +22 -0
  226. package/templates/.claude/skills/springboot-best-practices/examples/controller-example.java +28 -0
  227. package/templates/.claude/skills/springboot-best-practices/examples/controller-test-example.java +33 -0
  228. package/templates/.claude/skills/springboot-best-practices/examples/entity-example.java +22 -0
  229. package/templates/.claude/skills/springboot-best-practices/examples/exception-handler-example.java +30 -0
  230. package/templates/.claude/skills/springboot-best-practices/examples/repository-example.java +17 -0
  231. package/templates/.claude/skills/springboot-best-practices/examples/repository-test-example.java +23 -0
  232. package/templates/.claude/skills/springboot-best-practices/examples/security-config-example.java +27 -0
  233. package/templates/.claude/skills/springboot-best-practices/examples/service-example.java +33 -0
  234. package/templates/.claude/skills/status/SKILL.md +155 -0
  235. package/templates/.claude/skills/structured-dev-cycle/SKILL.md +200 -0
  236. package/templates/.claude/skills/stuck-recovery/SKILL.md +80 -0
  237. package/templates/.claude/skills/supabase-postgres-best-practices/SKILL.md +100 -0
  238. package/templates/.claude/skills/systematic-debugging/SKILL.md +288 -0
  239. package/templates/.claude/skills/systematic-debugging/condition-based-waiting-example.ts +278 -0
  240. package/templates/.claude/skills/systematic-debugging/condition-based-waiting.md +240 -0
  241. package/templates/.claude/skills/systematic-debugging/defense-in-depth.md +252 -0
  242. package/templates/.claude/skills/systematic-debugging/find-polluter.sh +147 -0
  243. package/templates/.claude/skills/systematic-debugging/root-cause-tracing.md +87 -0
  244. package/templates/.claude/skills/task-decomposition/SKILL.md +197 -0
  245. package/templates/.claude/skills/typescript-best-practices/SKILL.md +322 -0
  246. package/templates/.claude/skills/update-docs/SKILL.md +142 -0
  247. package/templates/.claude/skills/update-external/SKILL.md +169 -0
  248. package/templates/.claude/skills/vercel-deploy/SKILL.md +75 -0
  249. package/templates/.claude/skills/web-design-guidelines/SKILL.md +119 -0
  250. package/templates/.claude/skills/wiki/SKILL.md +426 -0
  251. package/templates/.claude/skills/wiki-rag/SKILL.md +154 -0
  252. package/templates/.claude/skills/worker-reviewer-pipeline/SKILL.md +165 -0
  253. package/templates/.claude/skills/writing-clearly-and-concisely/SKILL.md +66 -0
  254. package/templates/.claude/statusline.sh +380 -0
  255. package/templates/.claude/uninstall-hooks.sh +52 -0
  256. package/templates/.github/workflows/wiki-sync.yml +132 -0
  257. package/templates/AGENTS.md.en +255 -0
  258. package/templates/AGENTS.md.ko +255 -0
  259. package/templates/CLAUDE.md +263 -0
  260. package/templates/CLAUDE.md.en +256 -0
  261. package/templates/CLAUDE.md.ko +256 -0
  262. package/templates/deprecated-files.json +10 -0
  263. package/templates/guides/agents-md-quality/README.md +110 -0
  264. package/templates/guides/airflow/README.md +47 -0
  265. package/templates/guides/alembic/README.md +438 -0
  266. package/templates/guides/aws/common-patterns.md +169 -0
  267. package/templates/guides/aws/index.yaml +26 -0
  268. package/templates/guides/aws/well-architected.md +143 -0
  269. package/templates/guides/cc-token-saver/README.md +97 -0
  270. package/templates/guides/claude-code/01-overview.md +42 -0
  271. package/templates/guides/claude-code/03-tools.md +107 -0
  272. package/templates/guides/claude-code/04-agent-skills.md +90 -0
  273. package/templates/guides/claude-code/05-agent-sdk.md +129 -0
  274. package/templates/guides/claude-code/06-mcp.md +165 -0
  275. package/templates/guides/claude-code/07-prompt-engineering.md +100 -0
  276. package/templates/guides/claude-code/08-testing.md +56 -0
  277. package/templates/guides/claude-code/09-guardrails.md +78 -0
  278. package/templates/guides/claude-code/10-monitoring.md +87 -0
  279. package/templates/guides/claude-code/11-sub-agents.md +159 -0
  280. package/templates/guides/claude-code/12-workflow-patterns.md +182 -0
  281. package/templates/guides/claude-code/13-cli-flags.md +151 -0
  282. package/templates/guides/claude-code/index.yaml +61 -0
  283. package/templates/guides/dbt/README.md +32 -0
  284. package/templates/guides/django-best-practices/README.md +476 -0
  285. package/templates/guides/docker/compose-best-practices.md +284 -0
  286. package/templates/guides/docker/dockerfile-best-practices.md +262 -0
  287. package/templates/guides/docker/index.yaml +26 -0
  288. package/templates/guides/drizzle-orm/README.md +69 -0
  289. package/templates/guides/elements-of-style/elements-of-style.html +2609 -0
  290. package/templates/guides/fastapi/best-practices.md +232 -0
  291. package/templates/guides/fastapi/index.yaml +21 -0
  292. package/templates/guides/flutter/architecture.md +141 -0
  293. package/templates/guides/flutter/fundamentals.md +119 -0
  294. package/templates/guides/flutter/index.yaml +44 -0
  295. package/templates/guides/flutter/performance.md +119 -0
  296. package/templates/guides/flutter/security.md +120 -0
  297. package/templates/guides/flutter/state-management.md +144 -0
  298. package/templates/guides/flutter/testing.md +155 -0
  299. package/templates/guides/git-worktree-workflow/README.md +138 -0
  300. package/templates/guides/go-backend/index.yaml +26 -0
  301. package/templates/guides/go-backend/project-layout.md +243 -0
  302. package/templates/guides/go-backend/uber-style.md +212 -0
  303. package/templates/guides/golang/concurrency.md +282 -0
  304. package/templates/guides/golang/effective-go.md +309 -0
  305. package/templates/guides/golang/error-handling.md +250 -0
  306. package/templates/guides/golang/index.yaml +27 -0
  307. package/templates/guides/hook-data-flow/README.md +135 -0
  308. package/templates/guides/iceberg/README.md +49 -0
  309. package/templates/guides/impeccable-design/color-and-contrast.md +278 -0
  310. package/templates/guides/impeccable-design/index.yaml +12 -0
  311. package/templates/guides/impeccable-design/motion-design.md +390 -0
  312. package/templates/guides/impeccable-design/typography.md +386 -0
  313. package/templates/guides/impeccable-design/ux-writing.md +400 -0
  314. package/templates/guides/index.yaml +265 -0
  315. package/templates/guides/java21/index.yaml +29 -0
  316. package/templates/guides/java21/java-style-guide.md +248 -0
  317. package/templates/guides/java21/modern-java21.md +303 -0
  318. package/templates/guides/kafka/README.md +32 -0
  319. package/templates/guides/kotlin/coding-conventions.md +247 -0
  320. package/templates/guides/kotlin/idioms.md +234 -0
  321. package/templates/guides/kotlin/index.yaml +26 -0
  322. package/templates/guides/multi-model-routing/README.md +101 -0
  323. package/templates/guides/multi-provider-exec/README.md +83 -0
  324. package/templates/guides/postgres/README.md +58 -0
  325. package/templates/guides/python/index.yaml +26 -0
  326. package/templates/guides/python/pep8-style-guide.md +202 -0
  327. package/templates/guides/python/zen-of-python.md +79 -0
  328. package/templates/guides/redis/README.md +50 -0
  329. package/templates/guides/rust/error-handling.md +262 -0
  330. package/templates/guides/rust/index.yaml +26 -0
  331. package/templates/guides/rust/ownership.md +180 -0
  332. package/templates/guides/skill-bundle-design/README.md +106 -0
  333. package/templates/guides/slack-cli/README.md +145 -0
  334. package/templates/guides/snowflake/README.md +32 -0
  335. package/templates/guides/spark/README.md +32 -0
  336. package/templates/guides/springboot/best-practices.md +361 -0
  337. package/templates/guides/springboot/index.yaml +22 -0
  338. package/templates/guides/supabase-postgres/README.md +32 -0
  339. package/templates/guides/supabase-postgres/index.yaml +19 -0
  340. package/templates/guides/typescript/advanced-types.md +225 -0
  341. package/templates/guides/typescript/index.yaml +26 -0
  342. package/templates/guides/typescript/type-system.md +219 -0
  343. package/templates/guides/web-design/accessibility.md +66 -0
  344. package/templates/guides/web-design/index.yaml +20 -0
  345. package/templates/guides/web-design/performance.md +102 -0
  346. package/templates/guides/web-scraping/README.md +926 -0
  347. package/templates/guides/web-scraping/index.yaml +19 -0
  348. package/templates/guides/worktree-lifecycle/README.md +104 -0
  349. package/templates/index.yaml +18 -0
  350. package/templates/manifest.json +49 -0
  351. package/templates/workflows/auto-dev.yaml +46 -0
@@ -0,0 +1,34 @@
1
+ #!/bin/bash
2
+ # Session Auto-Fix Prompt — UserPromptSubmit prompt hook (#838)
3
+ # One-shot: reads SessionStart findings and injects into first user prompt.
4
+ # Protocol: stdout text -> injected into model context
5
+
6
+ FIXES_FILE="/tmp/.codex-session-fixes-${PPID}"
7
+
8
+ # Only fire if findings exist (one-shot)
9
+ if [ ! -f "$FIXES_FILE" ]; then
10
+ exit 0
11
+ fi
12
+
13
+ # Read and remove (one-shot: prevent repeated injection)
14
+ FINDINGS=$(cat "$FIXES_FILE")
15
+ rm -f "$FIXES_FILE"
16
+
17
+ ISSUE_COUNT=$(echo "$FINDINGS" | jq -r '.issue_count // 0' 2>/dev/null)
18
+
19
+ if [ "$ISSUE_COUNT" -gt 0 ]; then
20
+ echo "[Session Auto-Fix] Previous session left ${ISSUE_COUNT} issue(s):"
21
+ echo "$FINDINGS" | jq -r '.issues[]' 2>/dev/null | while IFS= read -r issue; do
22
+ type="${issue%%:*}"
23
+ msg="${issue#*:}"
24
+ echo " - [${type}] ${msg}"
25
+ done
26
+ FIX_COUNT=$(echo "$FINDINGS" | jq -r '.fix_count // 0' 2>/dev/null)
27
+ if [ "$FIX_COUNT" -gt 0 ]; then
28
+ echo "Auto-fixed: ${FIX_COUNT} item(s)."
29
+ fi
30
+ echo ""
31
+ echo "Consider addressing remaining issues before starting new work."
32
+ fi
33
+
34
+ exit 0
@@ -0,0 +1,146 @@
1
+ #!/bin/bash
2
+ # Session Auto-Fix — SessionStart command hook (#838)
3
+ # Detects previous session issues: uncommitted changes, template sync,
4
+ # AGENTS.md counts, gitignore blocking, wiki staleness, broken skill refs.
5
+ # Protocol: stdin JSON -> stdout pass-through, exit 0 always
6
+ # Time budget: <3s
7
+
8
+ input=$(cat)
9
+ FIXES_FILE="/tmp/.codex-session-fixes-${PPID}"
10
+ LOG_DIR=".codex/outputs/session-fixes"
11
+ ISSUES=()
12
+ FIXES=()
13
+ ISSUE_COUNT=0
14
+ FIX_COUNT=0
15
+
16
+ # Utility: add issue
17
+ add_issue() {
18
+ ISSUES+=("$1")
19
+ ISSUE_COUNT=$((ISSUE_COUNT + 1))
20
+ }
21
+
22
+ add_fix() {
23
+ FIXES+=("$1")
24
+ FIX_COUNT=$((FIX_COUNT + 1))
25
+ }
26
+
27
+ # ─── Check 1: Uncommitted changes ───
28
+ uncommitted=$(git status --porcelain 2>/dev/null | head -20)
29
+ if [ -n "$uncommitted" ]; then
30
+ count=$(echo "$uncommitted" | wc -l | tr -d ' ')
31
+ add_issue "uncommitted:${count} uncommitted changes detected"
32
+ fi
33
+
34
+ # ─── Check 2: Template sync (lightweight count comparison) ───
35
+ if [ -d "templates/.codex/agents" ] && [ -d ".codex/agents" ]; then
36
+ src_agents=$(ls .codex/agents/*.md 2>/dev/null | wc -l | tr -d ' ')
37
+ tpl_agents=$(ls templates/.codex/agents/*.md 2>/dev/null | wc -l | tr -d ' ')
38
+ if [ "$src_agents" != "$tpl_agents" ]; then
39
+ add_issue "template-sync:Agent count mismatch (source:${src_agents} vs template:${tpl_agents})"
40
+ fi
41
+
42
+ src_skills=$(find .codex/skills -name "SKILL.md" 2>/dev/null | wc -l | tr -d ' ')
43
+ tpl_skills=$(find templates/.codex/skills -name "SKILL.md" 2>/dev/null | wc -l | tr -d ' ')
44
+ if [ "$src_skills" != "$tpl_skills" ]; then
45
+ add_issue "template-sync:Skill count mismatch (source:${src_skills} vs template:${tpl_skills})"
46
+ fi
47
+
48
+ src_rules=$(ls .codex/rules/*.md 2>/dev/null | wc -l | tr -d ' ')
49
+ tpl_rules=$(ls templates/.codex/rules/*.md 2>/dev/null | wc -l | tr -d ' ')
50
+ if [ "$src_rules" != "$tpl_rules" ]; then
51
+ add_issue "template-sync:Rule count mismatch (source:${src_rules} vs template:${tpl_rules})"
52
+ fi
53
+
54
+ src_guides=$(find guides -mindepth 1 -maxdepth 1 -type d 2>/dev/null | wc -l | tr -d ' ')
55
+ tpl_guides=$(find templates/guides -mindepth 1 -maxdepth 1 -type d 2>/dev/null | wc -l | tr -d ' ')
56
+ if [ "$src_guides" != "$tpl_guides" ]; then
57
+ add_issue "template-sync:Guide count mismatch (source:${src_guides} vs template:${tpl_guides})"
58
+ fi
59
+ fi
60
+
61
+ # ─── Check 3: AGENTS.md count validation ───
62
+ if [ -f "AGENTS.md" ]; then
63
+ actual_agents=$(ls .codex/agents/*.md 2>/dev/null | wc -l | tr -d ' ')
64
+ doc_agents=$(grep -oE '[0-9]+ 파일\)' AGENTS.md | head -1 | grep -oE '[0-9]+' || echo "0")
65
+ if [ "$actual_agents" != "$doc_agents" ] && [ "$doc_agents" != "0" ]; then
66
+ add_issue "claude-md:Agent count in AGENTS.md ($doc_agents) != actual ($actual_agents)"
67
+ fi
68
+ fi
69
+
70
+ # ─── Check 4: Gitignore blocking new .codex/ files ───
71
+ new_files=$(git ls-files --others --exclude-standard .codex/ 2>/dev/null | head -5)
72
+ ignored_new=""
73
+ if [ -n "$new_files" ]; then
74
+ while IFS= read -r f; do
75
+ if git check-ignore --quiet "$f" 2>/dev/null; then
76
+ ignored_new="${ignored_new}${f}\n"
77
+ fi
78
+ done <<< "$new_files"
79
+ fi
80
+ if [ -n "$ignored_new" ]; then
81
+ add_issue "gitignore:New .codex/ files blocked by .gitignore"
82
+ fi
83
+
84
+ # ─── Check 5: Wiki staleness (lightweight) ───
85
+ if [ -d "wiki" ]; then
86
+ missing_wiki=0
87
+ for agent in .codex/agents/*.md; do
88
+ name=$(basename "$agent" .md)
89
+ if [ ! -f "wiki/agents/${name}.md" ]; then
90
+ missing_wiki=$((missing_wiki + 1))
91
+ fi
92
+ done
93
+ if [ "$missing_wiki" -gt 0 ]; then
94
+ add_issue "wiki-stale:${missing_wiki} agent(s) missing wiki pages"
95
+ fi
96
+ fi
97
+
98
+ # ─── Check 6: Broken skill references (lightweight) ───
99
+ broken_refs=0
100
+ for agent in .codex/agents/*.md; do
101
+ skills_line=$(grep -E '^skills:' "$agent" 2>/dev/null | head -1)
102
+ if [ -n "$skills_line" ]; then
103
+ skills=$(echo "$skills_line" | sed 's/skills: *\[//;s/\]//;s/,/ /g;s/"//g' | tr -d "'")
104
+ for skill in $skills; do
105
+ skill=$(echo "$skill" | tr -d ' ')
106
+ if [ -n "$skill" ] && [ ! -f ".codex/skills/${skill}/SKILL.md" ]; then
107
+ broken_refs=$((broken_refs + 1))
108
+ fi
109
+ done
110
+ fi
111
+ done
112
+ if [ "$broken_refs" -gt 0 ]; then
113
+ add_issue "broken-refs:${broken_refs} broken skill reference(s) in agent frontmatter"
114
+ fi
115
+
116
+ # ─── Report ───
117
+ if [ "$ISSUE_COUNT" -gt 0 ]; then
118
+ echo "[Session Auto-Fix] ${ISSUE_COUNT} issue(s) detected:" >&2
119
+ for issue in "${ISSUES[@]}"; do
120
+ type="${issue%%:*}"
121
+ msg="${issue#*:}"
122
+ echo " ⚠ [${type}] ${msg}" >&2
123
+ done
124
+ if [ "$FIX_COUNT" -gt 0 ]; then
125
+ echo "[Session Auto-Fix] Auto-fixed ${FIX_COUNT} item(s):" >&2
126
+ for fix in "${FIXES[@]}"; do
127
+ echo " ✓ ${fix}" >&2
128
+ done
129
+ fi
130
+ fi
131
+
132
+ # ─── Write findings for prompt hook ───
133
+ if command -v jq >/dev/null 2>&1; then
134
+ issues_json=$(printf '%s\n' "${ISSUES[@]}" | jq -R . | jq -s .)
135
+ fixes_json=$(printf '%s\n' "${FIXES[@]}" | jq -R . | jq -s .)
136
+ echo "{\"issue_count\":${ISSUE_COUNT},\"fix_count\":${FIX_COUNT},\"issues\":${issues_json},\"fixes\":${fixes_json}}" > "$FIXES_FILE"
137
+ else
138
+ echo "{\"issue_count\":${ISSUE_COUNT},\"fix_count\":${FIX_COUNT}}" > "$FIXES_FILE"
139
+ fi
140
+
141
+ # ─── JSONL log ───
142
+ mkdir -p "$LOG_DIR" 2>/dev/null
143
+ echo "{\"date\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"issue_count\":${ISSUE_COUNT},\"fix_count\":${FIX_COUNT}}" >> "${LOG_DIR}/$(date +%Y-%m-%d).jsonl" 2>/dev/null
144
+
145
+ echo "$input"
146
+ exit 0
@@ -0,0 +1,254 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ # Session Environment Check Hook
5
+ # Trigger: SessionStart
6
+ # Purpose: Check availability of codex CLI and Agent Teams, report via stderr
7
+ # Protocol: stdin JSON -> stdout pass-through, exit 0 always
8
+
9
+ input=$(cat)
10
+
11
+ echo "" >&2
12
+ echo "--- [Session Environment Check] ---" >&2
13
+
14
+ # Check codex CLI availability
15
+ CODEX_STATUS="unavailable"
16
+ if command -v codex >/dev/null 2>&1; then
17
+ if [ -n "${OPENAI_API_KEY:-}" ]; then
18
+ CODEX_STATUS="available (authenticated)"
19
+ else
20
+ CODEX_STATUS="installed but OPENAI_API_KEY not set"
21
+ fi
22
+ fi
23
+
24
+ # Check Gemini CLI availability
25
+ GEMINI_STATUS="unavailable"
26
+ if command -v gemini >/dev/null 2>&1; then
27
+ if [ -n "${GOOGLE_API_KEY:-}" ] || [ -n "${GEMINI_API_KEY:-}" ]; then
28
+ GEMINI_STATUS="available (authenticated)"
29
+ else
30
+ GEMINI_STATUS="installed (gcloud auth may be available)"
31
+ fi
32
+ fi
33
+
34
+ # Check RTK CLI availability
35
+ RTK_STATUS="unavailable"
36
+ if command -v rtk >/dev/null 2>&1; then
37
+ RTK_STATUS="available"
38
+ fi
39
+
40
+ # Check Agent Teams availability
41
+ AGENT_TEAMS_STATUS="disabled"
42
+ if [ "${OMCODEX_AGENT_TEAMS:-0}" = "1" ]; then
43
+ AGENT_TEAMS_STATUS="enabled"
44
+ fi
45
+
46
+ # Claude Code version detection
47
+ CLAUDE_VERSION="unknown"
48
+ if command -v claude >/dev/null 2>&1; then
49
+ CLAUDE_VERSION=$(claude --version 2>/dev/null | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")
50
+ fi
51
+
52
+ # Version compatibility check
53
+ MIN_COMPAT_VERSION="2.1.63"
54
+ COMPAT_STATUS="unknown"
55
+ if [ "$CLAUDE_VERSION" != "unknown" ]; then
56
+ if printf '%s\n' "$MIN_COMPAT_VERSION" "$CLAUDE_VERSION" | sort -V | head -1 | grep -q "^${MIN_COMPAT_VERSION}$"; then
57
+ COMPAT_STATUS="compatible"
58
+ else
59
+ COMPAT_STATUS="outdated"
60
+ fi
61
+ fi
62
+
63
+ # v2.1.88+ features notice
64
+ if [ "$CLAUDE_VERSION" != "unknown" ]; then
65
+ if printf '%s\n' "2.1.88" "$CLAUDE_VERSION" | sort -V | head -1 | grep -q "^2\.1\.88$"; then
66
+ if [ -z "${CLAUDE_CODE_NO_FLICKER:-}" ]; then
67
+ echo " [v2.1.88] Tip: CLAUDE_CODE_NO_FLICKER=1 for flicker-free rendering" >&2
68
+ fi
69
+ fi
70
+ fi
71
+
72
+ # Git workflow reminder
73
+ CURRENT_BRANCH="unknown"
74
+ if command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
75
+ CURRENT_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
76
+ fi
77
+
78
+ # Drift Detection: compare git HEAD between sessions
79
+ DRIFT_STATUS="not-git"
80
+ if command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
81
+ SESSION_STATE_DIR="$HOME/.codex/session-state"
82
+ mkdir -p "$SESSION_STATE_DIR"
83
+
84
+ PROJECT_HASH=$(echo "$(pwd)" | md5 2>/dev/null || echo "$(pwd)" | md5sum 2>/dev/null | cut -c1-8)
85
+ # md5 on macOS outputs "MD5 (stdin) = <hash>", extract just the hash
86
+ PROJECT_HASH=$(echo "$PROJECT_HASH" | grep -oE '[a-f0-9]{32}' | cut -c1-8)
87
+ STATE_FILE="${SESSION_STATE_DIR}/${PROJECT_HASH}.last-head"
88
+
89
+ CURRENT_HEAD=$(git log -1 --format="%H" 2>/dev/null || echo "")
90
+
91
+ if [ -n "$CURRENT_HEAD" ]; then
92
+ if [ -f "$STATE_FILE" ]; then
93
+ LAST_HEAD=$(cat "$STATE_FILE" 2>/dev/null || echo "")
94
+ if [ -n "$LAST_HEAD" ] && [ "$LAST_HEAD" != "$CURRENT_HEAD" ]; then
95
+ DRIFT_STATUS="drifted"
96
+ NEW_COMMITS=$(git rev-list --count "${LAST_HEAD}..${CURRENT_HEAD}" 2>/dev/null || echo "?")
97
+ CHANGED_FILES=$(git diff --name-only "${LAST_HEAD}..${CURRENT_HEAD}" 2>/dev/null | head -10)
98
+ else
99
+ DRIFT_STATUS="clean"
100
+ fi
101
+ else
102
+ DRIFT_STATUS="first-session"
103
+ fi
104
+
105
+ # Save current HEAD for next session
106
+ echo "$CURRENT_HEAD" > "$STATE_FILE"
107
+ fi
108
+ fi
109
+
110
+ # --- CI Status Check ---
111
+ # Check last CI run status if gh CLI is available
112
+ if command -v gh &>/dev/null; then
113
+ ci_status=$(gh run list --limit 1 --json conclusion -q '.[0].conclusion' 2>/dev/null || echo "unknown")
114
+ ci_name=$(gh run list --limit 1 --json name -q '.[0].name' 2>/dev/null || echo "unknown")
115
+ if [ "$ci_status" = "failure" ]; then
116
+ echo "[Session] ⚠ WARNING: Last CI run FAILED (${ci_name}) — check before pushing" >&2
117
+ elif [ "$ci_status" = "success" ]; then
118
+ echo "[Session] CI: last run passed (${ci_name})" >&2
119
+ elif [ "$ci_status" != "unknown" ]; then
120
+ echo "[Session] CI: last run status: ${ci_status} (${ci_name})" >&2
121
+ fi
122
+ fi
123
+
124
+ # Update availability check (local cache only — no network calls)
125
+ OMCUSTOM_UPDATE_STATUS="unknown"
126
+ INSTALLED_VERSION=""
127
+ CACHED_LATEST=""
128
+
129
+ # Read installed version from .omcustomrc.json
130
+ if [ -f ".omcustomrc.json" ]; then
131
+ INSTALLED_VERSION=$(grep -o '"version"[[:space:]]*:[[:space:]]*"[^"]*"' .omcustomrc.json 2>/dev/null | head -1 | grep -o '"[^"]*"$' | tr -d '"')
132
+ fi
133
+
134
+ # Read cached latest version (no network call)
135
+ CACHE_FILE="$HOME/.oh-my-customcodex/self-update-cache.json"
136
+ if [ ! -f "$CACHE_FILE" ] && [ -f "$HOME/.oh-my-customcode/self-update-cache.json" ]; then
137
+ CACHE_FILE="$HOME/.oh-my-customcode/self-update-cache.json"
138
+ fi
139
+ if [ -f "$CACHE_FILE" ]; then
140
+ CACHED_LATEST=$(grep -o '"latestVersion"[[:space:]]*:[[:space:]]*"[^"]*"' "$CACHE_FILE" 2>/dev/null | grep -o '"[^"]*"$' | tr -d '"' || true)
141
+ if [ -z "$CACHED_LATEST" ]; then
142
+ CACHED_LATEST=$(grep -o '"version"[[:space:]]*:[[:space:]]*"[^"]*"' "$CACHE_FILE" 2>/dev/null | head -1 | grep -o '"[^"]*"$' | tr -d '"' || true)
143
+ fi
144
+ fi
145
+
146
+ if [ -n "$INSTALLED_VERSION" ] && [ -n "$CACHED_LATEST" ]; then
147
+ if [ "$INSTALLED_VERSION" != "$CACHED_LATEST" ]; then
148
+ # Simple version comparison using sort -V
149
+ OLDER=$(printf '%s\n' "$INSTALLED_VERSION" "$CACHED_LATEST" | sort -V | head -1)
150
+ if [ "$OLDER" = "$INSTALLED_VERSION" ] && [ "$INSTALLED_VERSION" != "$CACHED_LATEST" ]; then
151
+ OMCUSTOM_UPDATE_STATUS="available"
152
+ else
153
+ OMCUSTOM_UPDATE_STATUS="up-to-date"
154
+ fi
155
+ else
156
+ OMCUSTOM_UPDATE_STATUS="up-to-date"
157
+ fi
158
+ elif [ -n "$INSTALLED_VERSION" ]; then
159
+ OMCUSTOM_UPDATE_STATUS="no-cache"
160
+ else
161
+ OMCUSTOM_UPDATE_STATUS="not-installed"
162
+ fi
163
+
164
+ # Write status to file for other hooks to reference
165
+ STATUS_FILE="/tmp/.codex-env-status-${PPID}"
166
+ cat > "$STATUS_FILE" << ENVEOF
167
+ codex=${CODEX_STATUS}
168
+ gemini=${GEMINI_STATUS}
169
+ rtk=${RTK_STATUS}
170
+ agent_teams=${AGENT_TEAMS_STATUS}
171
+ git_branch=${CURRENT_BRANCH}
172
+ claude_version=${CLAUDE_VERSION}
173
+ compat_status=${COMPAT_STATUS}
174
+ drift_status=${DRIFT_STATUS}
175
+ omcodex_update=${OMCUSTOM_UPDATE_STATUS}
176
+ ENVEOF
177
+
178
+ # Report to stderr (visible in conversation)
179
+ echo " codex CLI: ${CODEX_STATUS}" >&2
180
+ echo " gemini CLI: ${GEMINI_STATUS}" >&2
181
+ echo " RTK CLI: ${RTK_STATUS}" >&2
182
+ echo " Agent Teams: ${AGENT_TEAMS_STATUS}" >&2
183
+ echo " Claude Code: v${CLAUDE_VERSION} (${COMPAT_STATUS})" >&2
184
+ if [ "$COMPAT_STATUS" = "outdated" ]; then
185
+ echo " ⚠ Claude Code v${MIN_COMPAT_VERSION}+ recommended for full hook compatibility" >&2
186
+ fi
187
+ echo "" >&2
188
+ echo " [Git Workflow Reminder]" >&2
189
+ echo " Current branch: ${CURRENT_BRANCH}" >&2
190
+ if [ "$CURRENT_BRANCH" = "develop" ] || [ "$CURRENT_BRANCH" = "main" ] || [ "$CURRENT_BRANCH" = "master" ]; then
191
+ echo " ⚠ You are on a protected branch!" >&2
192
+ echo " ⚠ Create a feature branch before making changes:" >&2
193
+ echo " git checkout -b feat/your-feature develop" >&2
194
+ else
195
+ echo " ✓ Feature branch detected" >&2
196
+ fi
197
+ echo " Rules: feature branch → commit → push → PR → merge" >&2
198
+ echo "" >&2
199
+
200
+ # Drift Detection report
201
+ echo " [Drift Detection]" >&2
202
+ case "$DRIFT_STATUS" in
203
+ drifted)
204
+ echo " ⚠ Repository changed since last session" >&2
205
+ echo " New commits: ${NEW_COMMITS}" >&2
206
+ if [ -n "${CHANGED_FILES:-}" ]; then
207
+ echo " Changed files:" >&2
208
+ echo "$CHANGED_FILES" | while IFS= read -r file; do
209
+ echo " - ${file}" >&2
210
+ done
211
+ fi
212
+ ;;
213
+ clean)
214
+ echo " ✓ No changes since last session" >&2
215
+ ;;
216
+ first-session)
217
+ echo " First session for this project" >&2
218
+ ;;
219
+ not-git)
220
+ echo " Skipped (not a git repository)" >&2
221
+ ;;
222
+ esac
223
+ echo "" >&2
224
+ echo " [Lockfile Drift]" >&2
225
+ echo " Note: file-level lockfile drift (template hash changes) is checked via 'omcodex doctor'" >&2
226
+ echo " Run 'omcodex doctor' to detect modified/removed template files since install." >&2
227
+ echo "------------------------------------" >&2
228
+
229
+ # SessionEnd hooks timeout (v2.1.74+)
230
+ if [ -z "${CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:-}" ]; then
231
+ echo "[SessionEnv] ⚠ CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS not set (default: 1500ms)" >&2
232
+ echo "[SessionEnv] Recommend: export CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS=10000" >&2
233
+ fi
234
+
235
+ # Update Check report
236
+ echo "" >&2
237
+ echo " [Update Check]" >&2
238
+ if [ -n "$INSTALLED_VERSION" ] && [ -n "$CACHED_LATEST" ]; then
239
+ if [ "$OMCUSTOM_UPDATE_STATUS" = "available" ]; then
240
+ echo " ⚡ oh-my-customcodex v${CACHED_LATEST} available (current: v${INSTALLED_VERSION})" >&2
241
+ echo " Run 'omcodex update' to apply" >&2
242
+ else
243
+ echo " ✓ oh-my-customcodex is up to date (v${INSTALLED_VERSION})" >&2
244
+ fi
245
+ elif [ -n "$INSTALLED_VERSION" ]; then
246
+ echo " ℹ oh-my-customcodex v${INSTALLED_VERSION} (run 'omcodex doctor --updates' to check for updates)" >&2
247
+ else
248
+ echo " ℹ oh-my-customcodex not detected in this project" >&2
249
+ fi
250
+ echo "------------------------------------" >&2
251
+
252
+ # Pass through
253
+ echo "$input"
254
+ exit 0
@@ -0,0 +1,49 @@
1
+ #!/bin/bash
2
+ # skill-extractor-analyzer.sh — Stop hook for skill candidate detection
3
+ # Advisory-only: exit 0 always. Emits stderr message if candidates found.
4
+
5
+ set -euo pipefail
6
+
7
+ # Pass through stdin (Stop hook protocol)
8
+ input=$(cat)
9
+
10
+ OUTCOMES_FILE="/tmp/.codex-task-outcomes-${PPID}"
11
+ PROPOSALS_FILE="/tmp/.codex-skill-proposals-${PPID}"
12
+
13
+ # Early exit if no outcomes
14
+ if [ ! -f "$OUTCOMES_FILE" ] || [ ! -s "$OUTCOMES_FILE" ]; then
15
+ echo "$input"
16
+ exit 0
17
+ fi
18
+
19
+ # Count qualifying patterns (3+ successes with 80%+ rate)
20
+ # Group by agent_type+skill, count successes
21
+ CANDIDATES=0
22
+
23
+ if command -v jq &>/dev/null; then
24
+ # Parse JSONL and group by agent_type+skill
25
+ CANDIDATES=$(cat "$OUTCOMES_FILE" | \
26
+ jq -s '
27
+ group_by(.agent_type + "|" + (.skill // "none"))
28
+ | map({
29
+ key: .[0].agent_type + "|" + (.[0].skill // "none"),
30
+ total: length,
31
+ successes: [.[] | select(.outcome == "success")] | length
32
+ })
33
+ | map(select(.successes >= 3 and (.successes / .total) >= 0.8))
34
+ | length
35
+ ' 2>/dev/null || echo "0")
36
+ fi
37
+
38
+ if [ "$CANDIDATES" -gt 0 ] 2>/dev/null; then
39
+ echo "[skill-extractor] ${CANDIDATES} skill candidate(s) detected from session outcomes" >&2
40
+ echo "[skill-extractor] Run /skill-extractor to review and create" >&2
41
+
42
+ # Save proposal count for Stop prompt hook to pick up
43
+ echo "{\"candidates\": $CANDIDATES, \"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}" > "$PROPOSALS_FILE" || true
44
+ fi
45
+
46
+ # CRITICAL: Always pass through input and exit 0
47
+ # This hook MUST NEVER block session termination
48
+ echo "$input"
49
+ exit 0
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+ # Stage-blocking hook: blocks Write/Edit in non-implement stages
3
+ # Mutual Exclusion: This hook is mutually exclusive with autonomous mode (R010).
4
+ # When /tmp/.codex-dev-stage exists, autonomous mode cannot be activated.
5
+ # When /tmp/.codex-autonomous-$PPID exists, /structured-dev-cycle should not be started.
6
+ # See: MUST-orchestrator-coordination.md "Autonomous Execution Mode" section.
7
+ if [ -f /tmp/.codex-dev-stage ]; then
8
+ stage=$(cat /tmp/.codex-dev-stage | tr -d '[:space:]')
9
+ if [ -z "$stage" ]; then exit 0; fi
10
+ case "$stage" in
11
+ plan|verify-plan|verify-impl|compound|done)
12
+ echo "⛔ BLOCKED: Write/Edit disabled in '$stage' stage. Only allowed during 'implement' stage. Use 'echo implement > /tmp/.codex-dev-stage' to transition."
13
+ exit 2
14
+ ;;
15
+ esac
16
+ fi
@@ -0,0 +1,91 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ # Stale TODO Scanner Hook
5
+ # Trigger: SessionStart
6
+ # Purpose: Scan TODO.md files for staleness and pending items, report via stderr
7
+ # Protocol: stdin JSON -> stdout pass-through, exit 0 always
8
+ # Note: Zero network calls — local file scanning only
9
+
10
+ input=$(cat)
11
+
12
+ TODO_FILES=("TODO.md" ".codex/TODO.md" ".claude/TODO.md")
13
+ NOW=$(date +%s)
14
+ FOUND_ANY=false
15
+ FOUND_STALE=false
16
+ PRINTED_HEADER=false
17
+
18
+ print_header() {
19
+ if [ "$PRINTED_HEADER" = false ]; then
20
+ echo "" >&2
21
+ echo "--- [TODO Health Check] ---" >&2
22
+ PRINTED_HEADER=true
23
+ fi
24
+ }
25
+
26
+ for TODO_FILE in "${TODO_FILES[@]}"; do
27
+ if [ ! -f "$TODO_FILE" ]; then
28
+ continue
29
+ fi
30
+
31
+ FOUND_ANY=true
32
+ print_header
33
+
34
+ # Parse "Last updated: YYYY-MM-DD" header
35
+ LAST_UPDATED_LINE=$(grep -m1 "> Last updated:" "$TODO_FILE" 2>/dev/null || echo "")
36
+ DATE_STR=$(echo "$LAST_UPDATED_LINE" | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}' | head -1 || echo "")
37
+
38
+ # Count pending items (grep -c exits 1 when no matches on some systems — normalize to 0)
39
+ PENDING_COUNT=$(grep -c "^- \[ \]" "$TODO_FILE" 2>/dev/null) || PENDING_COUNT=0
40
+
41
+ if [ -z "$DATE_STR" ]; then
42
+ echo " ${TODO_FILE}: no 'Last updated' header found" >&2
43
+ echo " Pending items: ${PENDING_COUNT}" >&2
44
+ continue
45
+ fi
46
+
47
+ # Cross-platform date parsing: try GNU date first, fallback to BSD date
48
+ FILE_EPOCH=""
49
+ if date -d "$DATE_STR" +%s >/dev/null 2>&1; then
50
+ # GNU date (Linux)
51
+ FILE_EPOCH=$(date -d "$DATE_STR" +%s)
52
+ elif date -j -f "%Y-%m-%d" "$DATE_STR" +%s >/dev/null 2>&1; then
53
+ # BSD date (macOS)
54
+ FILE_EPOCH=$(date -j -f "%Y-%m-%d" "$DATE_STR" +%s)
55
+ else
56
+ echo " ${TODO_FILE}: could not parse date '${DATE_STR}'" >&2
57
+ echo " Pending items: ${PENDING_COUNT}" >&2
58
+ continue
59
+ fi
60
+
61
+ DAYS_OLD=$(( (NOW - FILE_EPOCH) / 86400 ))
62
+
63
+ if [ "$DAYS_OLD" -gt 30 ]; then
64
+ STATUS="⚠⚠ critical — stale >30d"
65
+ FOUND_STALE=true
66
+ elif [ "$DAYS_OLD" -gt 7 ]; then
67
+ STATUS="⚠ stale >7d"
68
+ FOUND_STALE=true
69
+ else
70
+ STATUS="up to date"
71
+ fi
72
+
73
+ echo " ${TODO_FILE}: last updated ${DAYS_OLD} days ago (${STATUS})" >&2
74
+ echo " Pending items: ${PENDING_COUNT}" >&2
75
+ done
76
+
77
+ if [ "$FOUND_ANY" = false ] || [ "$FOUND_STALE" = false ]; then
78
+ if [ "$FOUND_ANY" = false ]; then
79
+ : # No TODO files found — skip silently
80
+ else
81
+ echo " ✓ All TODO files are up to date" >&2
82
+ fi
83
+ fi
84
+
85
+ if [ "$PRINTED_HEADER" = true ]; then
86
+ echo "------------------------------------" >&2
87
+ fi
88
+
89
+ # Pass through
90
+ echo "$input"
91
+ exit 0