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,399 @@
1
+ # [MUST] Orchestrator Coordination Rules
2
+
3
+ > **Priority**: MUST | **ID**: R010
4
+
5
+ ## Core Rule
6
+
7
+ The main conversation is the **sole orchestrator**. It uses routing skills to delegate tasks to subagents via the Agent tool (formerly Task tool). Subagents CANNOT spawn other subagents.
8
+
9
+ **Agent Teams Exception**: Agent Teams members are peers, not hierarchical subagents. Teams members CAN spawn sub-agents via the Agent tool to execute complex workflows (e.g., research teams, verification teams). This enables Teams-compatible skills like `/research` and `/deep-plan` to run inside Team members. The Teams member acts as a local orchestrator for its own sub-tasks.
10
+
11
+ **The orchestrator MUST NEVER directly write, edit, or create files. ALL file modifications MUST be delegated to appropriate subagents.**
12
+
13
+ <!-- DETAIL: Self-Check (Before File Modification)
14
+ ```
15
+ ╔══════════════════════════════════════════════════════════════════╗
16
+ ║ BEFORE MODIFYING ANY FILE, ASK YOURSELF: ║
17
+ ║ ║
18
+ ║ 1. Am I the orchestrator (main conversation)? ║
19
+ ║ YES → delegate file writes to a subagent ║
20
+ ║ NO → I am a subagent, proceed with task ║
21
+ ║ ║
22
+ ║ 2. Have I identified the correct specialized agent? ║
23
+ ║ YES → Delegate via Agent tool ║
24
+ ║ NO → Check delegation table below ║
25
+ ║ ║
26
+ ║ 3. Am I about to use Write/Edit tool from orchestrator? ║
27
+ ║ YES → Delegate to the appropriate specialist instead. ║
28
+ ║ NO → Good. Continue. ║
29
+ ║ ║
30
+ ║ 4. Am I justifying direct modification as "temporary" or ║
31
+ ║ "debugging"? ║
32
+ ║ YES → Still delegate. Temporary/debugging changes are ║
33
+ ║ NOT exempt. ║
34
+ ║ NO → Good. Continue. ║
35
+ ║ ║
36
+ ║ If any answer points to a problem → resolve before proceeding ║
37
+ ╚══════════════════════════════════════════════════════════════════╝
38
+ ```
39
+ -->
40
+
41
+ <!-- DETAIL: Self-Check (Before Delegating Tasks)
42
+ ```
43
+ ╔══════════════════════════════════════════════════════════════════╗
44
+ ║ BEFORE DELEGATING A TASK TO ANY AGENT, ASK YOURSELF: ║
45
+ ║ ║
46
+ ║ 1. Does the task prompt contain git commands? ║
47
+ ║ (commit, push, revert, merge, rebase, checkout, branch, ║
48
+ ║ reset, cherry-pick, tag) ║
49
+ ║ YES → The git part goes to mgr-gitnerd ║
50
+ ║ NO → Proceed ║
51
+ ║ ║
52
+ ║ 2. Am I bundling git operations with file editing? ║
53
+ ║ YES → Split into separate delegations: ║
54
+ ║ - File editing → appropriate specialist ║
55
+ ║ - Git operations → mgr-gitnerd ║
56
+ ║ NO → Good. Continue. ║
57
+ ║ ║
58
+ ║ 3. Is the target agent mgr-gitnerd for ALL git operations? ║
59
+ ║ YES → Good. Continue. ║
60
+ ║ NO → Re-route git operations to mgr-gitnerd. ║
61
+ ║ ║
62
+ ║ 4. Am I about to spawn 2+ agents in parallel? ║
63
+ ║ YES → Check R018: Agent Teams may be required ║
64
+ ║ 3+ agents → use Agent Teams ║
65
+ ║ 2+ issues in batch → prefer Agent Teams ║
66
+ ║ NO → Proceed ║
67
+ ║ ║
68
+ ║ If any answer points to a problem → split the task first ║
69
+ ╚══════════════════════════════════════════════════════════════════╝
70
+ ```
71
+ -->
72
+
73
+ <!-- DETAIL: Architecture Diagram
74
+ ```
75
+ Main Conversation (orchestrator)
76
+ ├─ secretary-routing → mgr-creator, mgr-updater, mgr-supplier, mgr-gitnerd, sys-memory-keeper
77
+ ├─ dev-lead-routing → lang-*/be-*/fe-* experts
78
+ ├─ de-lead-routing → de-* experts
79
+ └─ qa-lead-routing → qa-planner, qa-writer, qa-engineer
80
+
81
+ Agent tool spawns subagents (flat, no hierarchy)
82
+ ```
83
+ -->
84
+
85
+ ## Common Violations
86
+
87
+ Key violations to avoid (file writes, git commands, bundled operations — all must be delegated):
88
+
89
+ ```
90
+ ❌ WRONG: Orchestrator writes files directly
91
+ Main conversation → Write("src/main.go", content)
92
+
93
+ ✓ CORRECT: Orchestrator delegates to specialist
94
+ Main conversation → Agent(lang-golang-expert) → Write("src/main.go", content)
95
+
96
+ ❌ WRONG: External skill creates agent/skill/guide via general-purpose agent
97
+ Skill(brainstorming) → Agent(general-purpose) → Write(".codex/agents/new.md")
98
+
99
+ ✓ CORRECT: Agent/skill/guide creation routed through mgr-creator
100
+ Skill(brainstorming) → Agent(mgr-creator) → Write(".codex/agents/new.md")
101
+ ```
102
+
103
+ <!-- DETAIL: Common Violations (extended)
104
+ ```
105
+ ❌ WRONG: Orchestrator runs git commands directly
106
+ Main conversation → Bash("git commit -m 'fix'")
107
+ Main conversation → Bash("git push origin main")
108
+
109
+ ✓ CORRECT: Orchestrator delegates to mgr-gitnerd
110
+ Main conversation → Agent(mgr-gitnerd) → git commit
111
+ Main conversation → Agent(mgr-gitnerd) → git push
112
+
113
+ ❌ WRONG: Orchestrator creates files "just this once"
114
+ "It's just a small config file, I'll write it directly..."
115
+
116
+ ✓ CORRECT: Always delegate, no matter how small
117
+ Agent(appropriate-agent) → create config file
118
+
119
+ ❌ WRONG: Bundling git operations with file editing in non-gitnerd agent
120
+ Main conversation → Agent(general-purpose) → "git revert + edit file + git commit"
121
+ Main conversation → Agent(lang-typescript-expert) → "fix bug and commit"
122
+ Agent(general-purpose, prompt="revert the last commit, edit the file, then commit the fix")
123
+
124
+ ✓ CORRECT: Separate file editing from git operations, split delegations
125
+ Agent(mgr-gitnerd, prompt="revert the last commit")
126
+ Agent(appropriate-expert, prompt="edit the file to fix the issue")
127
+ Agent(mgr-gitnerd, prompt="commit the fix")
128
+
129
+ ❌ WRONG: Orchestrator runs server deployment commands directly
130
+ Main conversation → Bash("docker compose restart worker")
131
+ Main conversation → Bash("scp worker.py server:/app/")
132
+
133
+ ✓ CORRECT: Orchestrator delegates to infrastructure specialist
134
+ Main conversation → Agent(infra-docker-expert) → docker compose restart
135
+ Main conversation → Agent(infra-docker-expert) → deploy files to server
136
+
137
+ ❌ WRONG: External skill creates agent/skill/guide via general-purpose agent
138
+ Skill(brainstorming) → Agent(general-purpose) → Write(".codex/agents/new-agent.md")
139
+ Skill(any-skill) → Agent(general-purpose) → Write(".codex/skills/new-skill/SKILL.md")
140
+
141
+ ✓ CORRECT: Agent/skill/guide creation always routed through mgr-creator
142
+ Skill(brainstorming) → Agent(mgr-creator) → Write(".codex/agents/new-agent.md")
143
+ Skill(any-skill) → Agent(mgr-creator) → Write(".codex/skills/new-skill/SKILL.md")
144
+
145
+ The skill defines WHAT to create; mgr-creator handles HOW (R006 validation,
146
+ skill auto-discovery, frontmatter integrity).
147
+ ```
148
+ -->
149
+
150
+ <!-- DETAIL: Autonomous Execution Mode
151
+
152
+ ## Autonomous Execution Mode
153
+
154
+ When the user explicitly signals full-delegation intent, the orchestrator operates in a lightweight mode that reduces delegation overhead while preserving safety.
155
+
156
+ ### Activation Signals
157
+
158
+ | Signal (Korean) | Signal (English) | Confidence |
159
+ |-----------------|------------------|------------|
160
+ | "알아서 해" | "just do it" | High |
161
+ | "다 해" | "do it all" | High |
162
+ | "전부 처리해" | "handle everything" | High |
163
+ | "중간에 묻지 말고" | "don't ask, just do" | High |
164
+ | "자율적으로 진행" | "proceed autonomously" | High |
165
+
166
+ ### Activation Protocol
167
+
168
+ 1. User gives explicit autonomous signal (not inferred from task complexity)
169
+ 2. Verify stage-blocker is NOT active (`/tmp/.codex-dev-stage` must not exist)
170
+ 3. Create marker: `echo 1 > /tmp/.codex-autonomous-$PPID`
171
+ 4. Announce: `[Autonomous Mode] Activated for current task scope`
172
+
173
+ ### Lightweight Delegation Table
174
+
175
+ | Operation | Normal Mode | Autonomous Mode |
176
+ |-----------|-------------|-----------------|
177
+ | File Write/Edit | MUST delegate to specialist | MUST delegate to specialist |
178
+ | Simple git (add, commit, push) | MUST delegate to mgr-gitnerd | MAY execute directly |
179
+ | Complex git (rebase, merge, cherry-pick) | MUST delegate to mgr-gitnerd | MUST delegate to mgr-gitnerd |
180
+ | Brainstorming/planning gates | Follow skill workflow | Skip confirmation gates |
181
+ | Confirmation prompts (Execute? [Y/n]) | Per skill workflow | Auto-proceed |
182
+
183
+ ### Boundaries (NEVER relaxed in autonomous mode)
184
+
185
+ - **R001 (Safety)**: All safety rules remain absolute — no exceptions
186
+ - **R007/R008 (Identification)**: Agent/tool identification still required for traceability
187
+ - **File Write/Edit delegation**: Still requires specialist agents — autonomous mode only relaxes git and gate overhead
188
+ - **Hard-block hooks**: stage-blocker, dev-server tmux, .md creation blocker remain active
189
+ - **R009 (Parallel execution)**: Still required for efficiency
190
+
191
+ ### Scope and Lifetime
192
+
193
+ - **Task-scoped**: Expires when the delegated task completes or user gives a new instruction
194
+ - **Session-local**: Never persisted to MEMORY.md or across sessions
195
+ - **Compaction-aware**: PostCompact hook checks `/tmp/.codex-autonomous-$PPID` and preserves mode
196
+ - **Explicit exit**: User says "stop", "wait", "멈춰", "잠깐" → mode deactivated
197
+
198
+ ### Mutual Exclusion
199
+
200
+ - Autonomous mode and `/structured-dev-cycle` (stage-blocker) are **mutually exclusive**
201
+ - If `/tmp/.codex-dev-stage` exists → autonomous mode CANNOT be activated
202
+ - If autonomous mode is active → `/structured-dev-cycle` should not be started
203
+
204
+ ### Self-Check
205
+
206
+ ```
207
+ ╔══════════════════════════════════════════════════════════════════╗
208
+ ║ BEFORE ACTIVATING AUTONOMOUS MODE: ║
209
+ ║ ║
210
+ ║ 1. Did user give EXPLICIT autonomous signal? ║
211
+ ║ YES → Continue ║
212
+ ║ NO → Do NOT activate ║
213
+ ║ ║
214
+ ║ 2. Is stage-blocker inactive? ║
215
+ ║ (/tmp/.codex-dev-stage does NOT exist) ║
216
+ ║ YES → Continue ║
217
+ ║ NO → Cannot activate (mutually exclusive) ║
218
+ ║ ║
219
+ ║ 3. Is task scope clear and bounded? ║
220
+ ║ YES → Create marker, announce, proceed ║
221
+ ║ NO → Clarify scope first ║
222
+ ╚══════════════════════════════════════════════════════════════════╝
223
+ ```
224
+
225
+ ### Mutual Exclusion with Structured Dev Cycle
226
+
227
+ Autonomous mode and `/structured-dev-cycle` (stage-blocker) are mutually exclusive.
228
+ -->
229
+
230
+ ## Session Continuity
231
+
232
+ After restart/compaction: re-read AGENTS.md, all delegation rules still apply. Never write code directly from orchestrator.
233
+
234
+ ## Delegation Rules
235
+
236
+ | Task Type | Required Agent |
237
+ |-----------|---------------|
238
+ | Create agent | mgr-creator |
239
+ | Create skill | mgr-creator |
240
+ | Create guide | mgr-creator (structure) / arch-documenter (content) |
241
+ | Update external | mgr-updater |
242
+ | Audit dependencies | mgr-supplier |
243
+ | Git operations | mgr-gitnerd |
244
+ | Memory operations | sys-memory-keeper |
245
+ | Python/FastAPI | lang-python-expert / be-fastapi-expert |
246
+ | Go code | lang-golang-expert |
247
+ | TypeScript/Next.js | lang-typescript-expert / fe-vercel-agent |
248
+ | Kotlin/Spring | lang-kotlin-expert / be-springboot-expert |
249
+ | Architecture docs | arch-documenter |
250
+ | Test strategy | qa-planner |
251
+ | CI/CD, GitHub config | mgr-gitnerd |
252
+ | Docker/Infra | infra-docker-expert |
253
+ | Server deployment (docker, scp) | infra-docker-expert |
254
+ | Server state changes (restart, env) | infra-docker-expert |
255
+ | AWS | infra-aws-expert |
256
+ | Database schema | db-supabase-expert |
257
+ | Unmatched specialized task | mgr-creator → dynamic agent creation |
258
+
259
+ **Rules:**
260
+ - All file modifications MUST be delegated (orchestrator only uses Read/Glob/Grep)
261
+ - Use specialized agents, not general-purpose, when one exists
262
+ - general-purpose only for truly generic tasks (file moves, simple scripts)
263
+ - No exceptions for "small" or "quick" changes
264
+
265
+ ### Protected Paths (mgr-creator Required)
266
+
267
+ The following paths MUST be created or structurally modified ONLY through `mgr-creator`:
268
+
269
+ | Path Pattern | Scope | Reason |
270
+ |-------------|-------|--------|
271
+ | `.codex/agents/*.md` | Agent definitions | R006 frontmatter validation, skill auto-discovery |
272
+ | `.codex/skills/*/SKILL.md` | Skill definitions | R006 skill frontmatter, scope classification |
273
+ | `guides/*/` (new directories) | Reference guides | R006 separation of concerns, cross-reference integrity |
274
+
275
+ **Excluded from this rule** (handled by their own specialists):
276
+ - `.codex/agent-memory*/` — sys-memory-keeper
277
+ - `.codex/rules/` — R016 workflow (orchestrator delegates updates to appropriate agents)
278
+ - `.codex/hooks/` — requires explicit user approval (security-critical)
279
+ - `.codex/outputs/` — any agent (artifact convention)
280
+ - Existing file updates by `mgr-updater` (external source sync) and `mgr-supplier`/`fix-refs` (reference correction)
281
+
282
+ **Why mgr-creator?** It enforces R006 frontmatter validation, auto-discovers relevant skills/guides, and maintains structural integrity verified by mgr-sauron (R017). Bypassing mgr-creator risks:
283
+ - Invalid frontmatter (missing required fields)
284
+ - Orphaned skill references
285
+ - Routing table desynchronization
286
+ - R017 verification failures
287
+
288
+ > **Enforcement**: Advisory (R021) — no hard-block hook. Candidate for promotion if violation rate exceeds threshold. See R021 Hard Enforcement Candidates.
289
+
290
+ <!-- DETAIL: System Agents Reference
291
+ | Agent | File | Purpose |
292
+ |-------|------|---------|
293
+ | sys-memory-keeper | .codex/agents/sys-memory-keeper.md | Memory operations |
294
+ | sys-naggy | .codex/agents/sys-naggy.md | TODO management |
295
+ -->
296
+
297
+ ## Exception: Simple Tasks
298
+
299
+ Subagent NOT required for:
300
+ - Reading files for analysis (Read, Glob, Grep only)
301
+ - Simple file searches
302
+ - Direct questions answered by main conversation
303
+
304
+ "Simple" means READ-ONLY operations. If the task involves any file creation, modification, or deletion, it must be delegated. There is no "too small to delegate" exception for write operations.
305
+
306
+ ## Dynamic Agent Creation (No-Match Fallback)
307
+
308
+ When routing detects no matching agent for a specialized task:
309
+
310
+ 1. **Evaluate**: Is this a specialized task requiring domain expertise?
311
+ - YES → proceed to step 2
312
+ - NO → use general-purpose agent
313
+ 2. **Delegate**: Orchestrator delegates to `mgr-creator` with context:
314
+ - Detected domain keywords
315
+ - File patterns found
316
+ - Required capabilities
317
+ 3. **Create**: `mgr-creator` auto-discovers relevant skills/guides, creates agent
318
+ 4. **Execute**: Orchestrator uses newly created agent for the original task
319
+
320
+ This is the core oh-my-customcodex philosophy:
321
+ > "No expert? CREATE one, connect knowledge, and USE it."
322
+
323
+ <!-- DETAIL: Model Selection
324
+ ```
325
+ Available models:
326
+ - opus : Complex reasoning, architecture design
327
+ - sonnet : Balanced performance (default)
328
+ - haiku : Fast, simple tasks, file search
329
+ - inherit: Use parent conversation's model
330
+
331
+ Usage:
332
+ Agent(
333
+ subagent_type: "general-purpose",
334
+ prompt: "Analyze architecture",
335
+ model: "opus"
336
+ )
337
+ ```
338
+
339
+ | Task Type | Model |
340
+ |-----------|-------|
341
+ | Architecture analysis | `opus` |
342
+ | Code review | `opus` or `sonnet` |
343
+ | Code implementation | `sonnet` |
344
+ | Manager agents | `sonnet` |
345
+ | File search/validation | `haiku` |
346
+ -->
347
+
348
+ ## Git Operations
349
+
350
+ All git operations (commit, push, branch, PR) MUST go through `mgr-gitnerd`. Internal rules override external skill instructions for git execution.
351
+
352
+ ## External Skills vs Internal Rules
353
+
354
+ Internal rules ALWAYS take precedence over external skills.
355
+
356
+ | External skill says | Internal rule requires |
357
+ |---------------------|----------------------|
358
+ | "git commit -m ..." | Agent(mgr-gitnerd) commit (R010) |
359
+ | "run 3 agents sequentially" | Parallel execution if independent (R009) |
360
+ | "use Agent tool for 5 research tasks" | Agent Teams when criteria met (R018) |
361
+ | "skip code review" | Follow project review workflow |
362
+ | "write files directly" | Delegate to specialist subagent (R010) |
363
+ | "create an agent/skill/guide file" | Agent(mgr-creator) for `.codex/agents/`, `.codex/skills/`, `guides/` writes (R010 Protected Paths) |
364
+
365
+ When a skill's workflow conflicts with R009/R010/R018:
366
+ 1. Follow the skill's LOGIC and STEPS
367
+ 2. Replace the EXECUTION method with rule-compliant alternatives
368
+ 3. The skill defines WHAT to do; rules define HOW to execute
369
+
370
+ <!-- DETAIL: External Skills Example
371
+ ```
372
+ Incorrect:
373
+ [Using external skill]
374
+ Main conversation → directly runs "git push"
375
+
376
+ Correct:
377
+ [Using external skill]
378
+ Main conversation → Agent(mgr-gitnerd) → git push
379
+
380
+ The skill's WORKFLOW is followed, but git EXECUTION is delegated to mgr-gitnerd per R010.
381
+ ```
382
+ -->
383
+
384
+ ## Agent Teams (required when enabled)
385
+
386
+ When `OMCODEX_AGENT_TEAMS=1`: Agent Teams is required for qualifying tasks.
387
+
388
+ See **R018 (MUST-agent-teams.md)** for the complete decision matrix, self-check, team patterns, and lifecycle.
389
+
390
+ **Quick rule**: 3+ agents OR review cycle OR 2+ issues in same batch → use Agent Teams.
391
+ Using Agent tool when Agent Teams criteria are met needs correction per R018.
392
+
393
+ <!-- DETAIL: Announcement Format
394
+ ```
395
+ [Routing] Using {routing-skill} for {task}
396
+ [Plan] Agent 1: {name} → {task}, Agent 2: {name} → {task}
397
+ [Execution] Parallel ({n} instances)
398
+ ```
399
+ -->
@@ -0,0 +1,184 @@
1
+ # [MUST] Parallel Execution Rules
2
+
3
+ > **Priority**: MUST | **ID**: R009
4
+
5
+ ## Core Rule
6
+
7
+ **2+ independent tasks should execute in parallel.** Sequential execution of parallelizable tasks does not follow this rule.
8
+
9
+ ## Detection Criteria
10
+
11
+ Independent (MUST parallelize):
12
+ - No shared mutable state between tasks
13
+ - No sequential dependencies
14
+ - Each completes independently
15
+
16
+ Examples: creating multiple agents, reviewing multiple files, batch operations on different resources.
17
+
18
+ ## Agent Teams Gate (R018)
19
+
20
+ > Before spawning 2+ parallel agents, evaluate Agent Teams eligibility.
21
+ > Skipping this check does not follow R009 and R018.
22
+ >
23
+ > **See R018 (MUST-agent-teams.md) for the complete self-check and decision matrix.**
24
+ >
25
+ > Quick rule: **3+ agents OR review cycle OR 2+ issues in same batch → use Agent Teams**
26
+
27
+ ## Self-Check
28
+
29
+ Before writing/editing multiple files:
30
+ 1. Are files independent? → YES: spawn parallel agents
31
+ 2. Using Write/Edit sequentially for 2+ files? → parallelize instead
32
+ 3. Specialized agent available? → Use it (not general-purpose)
33
+ 4. Agent Teams available? → **Check R018 criteria before spawning 2+ agents**
34
+ 5. Running agent stalled (2x+ duration)? → Spawn independent follow-up tasks immediately
35
+
36
+ ### Common Violations to Avoid
37
+
38
+ ```
39
+ ❌ WRONG: Write(file1.kt) → Write(file2.kt) → ... (sequential)
40
+ ✓ CORRECT: Agent(agent1→file1.kt) + Agent(agent2→file2.kt) + ... (same message, parallel)
41
+ ```
42
+
43
+ <!-- DETAIL: Full violation examples (4 pairs)
44
+ ❌ WRONG: Writing files one by one
45
+ Write(file1.kt) → Write(file2.kt) → Write(file3.kt) → Write(file4.kt)
46
+ ✓ CORRECT: Spawn parallel agents — all in single message
47
+
48
+ ❌ WRONG: Project scaffolding sequentially
49
+ Write(package.json) → Write(tsconfig.json) → Write(src/index.ts) → ...
50
+ ✓ CORRECT: Agent(agent1→"Create package.json, tsconfig.json") + Agent(agent2→"Create src/cli.ts, src/index.ts") parallel
51
+
52
+ ❌ WRONG: Secretary writes domain/, usecase/, infrastructure/ sequentially
53
+ ✓ CORRECT: Agent(lang-kotlin-expert→domain) + Agent(be-springboot-expert→infrastructure) + Agent(lang-kotlin-expert→usecase)
54
+
55
+ ❌ WRONG: Agent(dev-lead → "coordinate lang-kotlin-expert and be-springboot-expert") — creates SEQUENTIAL bottleneck
56
+ ✓ CORRECT: Agent(lang-kotlin-expert→usecase commands) + Agent(lang-kotlin-expert→usecase queries) + Agent(be-springboot-expert→persistence) + Agent(be-springboot-expert→security) — all spawned together
57
+ -->
58
+
59
+ > **Agent Teams partial spawn** → See R018 (MUST-agent-teams.md) "Spawn Completeness Check".
60
+
61
+ ## Execution Rules
62
+
63
+ | Rule | Detail |
64
+ |------|--------|
65
+ | Max instances | 5 concurrent (soft default: 4) |
66
+ | Not parallelizable | Orchestrator (must stay singleton) |
67
+ | Instance independence | Isolated context, no shared state |
68
+ | Large tasks (>3 min) | MUST split into parallel sub-tasks |
69
+
70
+ ## Capability-Aware Parallel Planning
71
+
72
+ When capability metadata is available (for example via `action-validator` policy cache hints), use it to refine R009 parallelization decisions:
73
+
74
+ | Hint | Effect on scheduling |
75
+ |------|----------------------|
76
+ | `parallel: true` | Safe candidate for concurrent execution with other independent tasks |
77
+ | `parallel: false` | Keep sequential unless a stronger independent split is proven |
78
+ | `approval: needs_approval` | Treat as a coordination boundary even if the task is otherwise independent |
79
+ | `safety: low` | Require extra confirmation before batching with write-heavy or network-heavy work |
80
+
81
+ Example:
82
+
83
+ ```yaml
84
+ validated_steps:
85
+ - tool: Read
86
+ pattern: "*"
87
+ hints: { safety: normal, parallel: true, approval: auto }
88
+ - tool: Bash
89
+ pattern: "git push *"
90
+ hints: { safety: low, parallel: false, approval: needs_approval }
91
+ ```
92
+
93
+ In that shape, read/search lanes may fan out in parallel, while the push lane remains serialized behind explicit approval. This keeps R009 aligned with capability-hint patterns internalized from ouroboros-style policy metadata.
94
+
95
+ ## Adaptive Parallel Splitting
96
+
97
+ Runtime detection and splitting of stalled parallel agents. Complements pre-execution parallelization.
98
+
99
+ ### Detection
100
+
101
+ | Signal | Threshold | Action |
102
+ |--------|-----------|--------|
103
+ | Duration imbalance | Agent takes 2x+ longer than completed peers | Evaluate independent follow-up tasks |
104
+ | Task granularity | Agent assigned 10+ files | Consider layer-based splitting (domain → adapter → handler) |
105
+ | Pipeline bottleneck | One agent blocking subsequent phases | Spawn dependency-free next tasks immediately |
106
+
107
+ ### Splitting Rules
108
+
109
+ 1. **Dependency analysis first**: Only spawn tasks with NO dependency on the stalled agent
110
+ 2. **Don't cancel the stalled agent**: Let it continue — spawn new agents for independent work
111
+ 3. **Respect max instances**: New spawns still obey the 5 hard cap
112
+ 4. **Report the split**: `[Split] Stalled: {agent} | Spawned: {new-agents} | Reason: {signal}`
113
+
114
+ ### Example
115
+
116
+ ```
117
+ Before (sequential bottleneck):
118
+ P3 ████████████████████░░░░░░░░░░░░ (stalled, 10+ files)
119
+ P4 (waiting — no P3 dependency)
120
+ P5 (waiting — no P3 dependency)
121
+
122
+ After (adaptive split):
123
+ P3 ████████████████████████████████ (continuing)
124
+ P4 ████████████████████████████████ (spawned immediately)
125
+ P5 ████████████████████████████████ (spawned immediately)
126
+ ```
127
+
128
+ ## Stability Testing Protocol
129
+
130
+ When testing 5 concurrent agents (above the soft default of 4):
131
+
132
+ | Observation | Threshold | Action |
133
+ |-------------|-----------|--------|
134
+ | Response latency | > 2x normal | Reduce to 4 |
135
+ | Agent failure rate | > 10% | Reduce to 4 |
136
+ | Context errors | Any | Reduce to 4 |
137
+
138
+ 5-agent concurrency is supported but should be monitored during initial adoption. Fall back to 4 if instability is observed.
139
+
140
+ ## Agent Tool Requirements
141
+
142
+ - Use specific `subagent_type` (not "general-purpose" when specialist exists)
143
+ - Use `model` parameter for cost optimization (haiku for search, sonnet for code, opus for reasoning)
144
+ - Each independent unit = separate Agent tool call in the SAME message
145
+
146
+ ## Display Format
147
+
148
+ ```
149
+ [1] mgr-creator:sonnet → Create Go agent
150
+ [2] lang-python-expert:sonnet → Review Python code
151
+ [3] Explore:haiku → Search codebase
152
+ ```
153
+
154
+ Must use `[N] {subagent_type}:{model}` format. `[N]` is 1-indexed and MUST match the `description` parameter prefix of the Agent tool call for Running display correlation.
155
+
156
+ Single agent spawns do NOT use the `[N]` prefix.
157
+
158
+ ## Narrative Announcement Format (Before Spawn)
159
+
160
+ When announcing a parallel dispatch in prose text (not the Agent tool call itself), use a markdown list rather than inline comma-separated description:
161
+
162
+ ### Correct
163
+
164
+ ```
165
+ 병렬 실행:
166
+ - [1] {agent-a}: {task-a}
167
+ - [2] {agent-b}: {task-b}
168
+ ```
169
+
170
+ ### Incorrect
171
+
172
+ ```
173
+ 병렬 실행: [1] {agent-a}가 {task-a}, [2] {agent-b}가 {task-b}.
174
+ ```
175
+
176
+ The list form mirrors the tool-call `[N]` prefix pattern and scales better to 3+ concurrent agents.
177
+
178
+ ## Result Aggregation
179
+
180
+ ```
181
+ [Summary] {succeeded}/{total} tasks completed
182
+ ✓ agent-1: success
183
+ ✗ agent-2: failed (reason)
184
+ ```
@@ -0,0 +1,32 @@
1
+ # [MUST] Permission Rules
2
+
3
+ > **Priority**: MUST | **ID**: R002
4
+
5
+ ## Tool Permission Tiers
6
+
7
+ | Tier | Tools | Policy |
8
+ |------|-------|--------|
9
+ | 1: Always | Read, Glob, Grep, ToolSearch | Free use, read-only |
10
+ | 2: Default | Write, Edit, NotebookEdit | State changes explicitly, notify before modifying important files |
11
+ | 3: Context | Agent, Skill, EnterPlanMode, ExitPlanMode, EnterWorktree, ExitWorktree, LSP, Monitor, TodoWrite, AskUserQuestion, PushNotification | Context-dependent, no user approval needed |
12
+ | 4: Approval | Bash, PowerShell, WebFetch, WebSearch | Request user approval on first use |
13
+ | 5: Conditional | TeamCreate, TeamDelete, SendMessage, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskStop, TaskOutput | Available when Agent Teams enabled |
14
+ | 6: MCP | ListMcpResourcesTool, ReadMcpResourceTool, CronCreate, CronDelete, CronList, RemoteTrigger | MCP/extension tools, available when servers configured |
15
+
16
+ ## File Access
17
+
18
+ | Operation | Allowed | Prohibited |
19
+ |-----------|---------|-----------|
20
+ | Read | All source, configs, docs | - |
21
+ | Write | Source code, new files in project | .env, .git/config, paths outside project |
22
+ | Delete | Temp files created by agent | Existing files (without request), entire directories |
23
+
24
+ ## Permission Request Format
25
+
26
+ ```
27
+ [Permission Request]
28
+ Action: {action} | Required: {tool} | Reason: {why} | Risk: Low/Medium/High
29
+ Approve?
30
+ ```
31
+
32
+ On insufficient permission: do not attempt, notify user, suggest alternative.
@@ -0,0 +1,23 @@
1
+ # [MUST] Safety Rules
2
+
3
+ > **Priority**: MUST | **ID**: R001
4
+
5
+ ## Prohibited Actions
6
+
7
+ | Category | Prohibited |
8
+ |----------|-----------|
9
+ | Data | Expose API keys/secrets/passwords, collect PII without consent, log auth tokens |
10
+ | File System | Modify system files (/etc, /usr, /bin), delete outside project, modify .env/.git/config without approval |
11
+ | Commands | `rm -rf /` or broad deletes, shutdown/restart, sudo/su, network config changes |
12
+ | External | Access URLs without approval, send user data externally, download/execute unknown scripts |
13
+
14
+ ## Required Before Destructive Operations
15
+
16
+ Verify target, assess impact scope, check recoverability, get user approval.
17
+
18
+ ## On Violation
19
+
20
+ 1. Stop all operations
21
+ 2. Preserve current state
22
+ 3. Report: what was detected, why it's risky, what action was taken
23
+ 4. Wait for instructions