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,476 @@
1
+ # Django Best Practices Guide
2
+
3
+ > Reference: Django 6.0 Official Documentation + Community Best Practices
4
+
5
+ ## Sources
6
+
7
+ - https://docs.djangoproject.com/en/6.0/
8
+ - https://docs.djangoproject.com/en/6.0/howto/deployment/checklist/
9
+ - https://github.com/HackSoftware/Django-Styleguide (HackSoft style guide)
10
+
11
+ ---
12
+
13
+ ## Quick Reference
14
+
15
+ ### Project Setup
16
+
17
+ **Recommended project structure:**
18
+
19
+ ```
20
+ project/
21
+ ├── config/
22
+ │ ├── settings/
23
+ │ │ ├── base.py # Shared settings
24
+ │ │ ├── development.py # Dev overrides
25
+ │ │ └── production.py # Prod overrides
26
+ │ ├── urls.py
27
+ │ └── wsgi.py
28
+ ├── apps/
29
+ │ ├── core/ # Shared utilities
30
+ │ ├── users/ # Custom User model
31
+ │ └── {feature}/ # Feature apps
32
+ ├── templates/
33
+ ├── static/
34
+ ├── requirements/
35
+ │ ├── base.txt
36
+ │ ├── development.txt # + debug-toolbar, factory-boy
37
+ │ └── production.txt # + gunicorn, whitenoise
38
+ └── manage.py
39
+ ```
40
+
41
+ **Settings split pattern:**
42
+
43
+ ```python
44
+ # config/settings/base.py
45
+ SECRET_KEY = env('SECRET_KEY')
46
+ DEBUG = False
47
+ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
48
+ AUTH_USER_MODEL = 'users.User'
49
+
50
+ # config/settings/development.py
51
+ from .base import *
52
+ DEBUG = True
53
+ INSTALLED_APPS += ['debug_toolbar']
54
+
55
+ # config/settings/production.py
56
+ from .base import *
57
+ ALLOWED_HOSTS = env.list('ALLOWED_HOSTS')
58
+ DATABASES = {'default': env.db()}
59
+ ```
60
+
61
+ **Always create a custom User model first:**
62
+
63
+ ```python
64
+ # apps/users/models.py
65
+ from django.contrib.auth.models import AbstractUser
66
+
67
+ class User(AbstractUser):
68
+ pass # Extend later without pain
69
+ ```
70
+
71
+ ---
72
+
73
+ ### Models
74
+
75
+ **Model best practices:**
76
+
77
+ ```python
78
+ from django.db import models
79
+
80
+ class Article(models.Model):
81
+ title = models.CharField(max_length=200, db_index=True)
82
+ body = models.TextField()
83
+ author = models.ForeignKey('users.User', on_delete=models.CASCADE)
84
+ status = models.CharField(
85
+ max_length=20,
86
+ choices=[('draft', 'Draft'), ('published', 'Published')],
87
+ default='draft'
88
+ )
89
+ created_at = models.DateTimeField(auto_now_add=True)
90
+ updated_at = models.DateTimeField(auto_now=True)
91
+
92
+ objects = models.Manager()
93
+ published = PublishedManager() # Custom manager
94
+
95
+ class Meta:
96
+ ordering = ['-created_at']
97
+ verbose_name = 'article'
98
+ verbose_name_plural = 'articles'
99
+ indexes = [
100
+ models.Index(fields=['status', 'created_at']),
101
+ ]
102
+ constraints = [
103
+ models.CheckConstraint(
104
+ check=~models.Q(title=''),
105
+ name='article_title_not_empty'
106
+ )
107
+ ]
108
+
109
+ def __str__(self):
110
+ return self.title
111
+ ```
112
+
113
+ **Query optimization:**
114
+
115
+ ```python
116
+ # N+1 prevention
117
+ articles = Article.objects.select_related('author').prefetch_related('tags')
118
+
119
+ # Partial field loading
120
+ titles = Article.objects.values_list('id', 'title') # No ORM object
121
+
122
+ # Bulk operations (never loop .save())
123
+ Article.objects.bulk_create(articles, batch_size=1000)
124
+ Article.objects.bulk_update(articles, ['status'], batch_size=1000)
125
+
126
+ # Complex queries with F() and Q()
127
+ from django.db.models import F, Q
128
+ Article.objects.filter(Q(status='published') | Q(author=request.user))
129
+ Article.objects.update(view_count=F('view_count') + 1)
130
+ ```
131
+
132
+ ---
133
+
134
+ ### Views & URLs
135
+
136
+ **Class-Based Views for standard CRUD:**
137
+
138
+ ```python
139
+ from django.contrib.auth.mixins import LoginRequiredMixin
140
+ from django.views.generic import ListView, DetailView, CreateView
141
+
142
+ class ArticleListView(ListView):
143
+ model = Article
144
+ template_name = 'articles/list.html'
145
+ context_object_name = 'articles'
146
+ paginate_by = 20
147
+
148
+ def get_queryset(self):
149
+ return Article.published.select_related('author')
150
+
151
+ class ArticleCreateView(LoginRequiredMixin, CreateView):
152
+ model = Article
153
+ form_class = ArticleForm
154
+ template_name = 'articles/form.html'
155
+
156
+ def form_valid(self, form):
157
+ form.instance.author = self.request.user
158
+ return super().form_valid(form)
159
+ ```
160
+
161
+ **URL namespacing (required):**
162
+
163
+ ```python
164
+ # apps/articles/urls.py
165
+ app_name = 'articles' # REQUIRED
166
+
167
+ urlpatterns = [
168
+ path('', ArticleListView.as_view(), name='list'),
169
+ path('<int:pk>/', ArticleDetailView.as_view(), name='detail'),
170
+ path('create/', ArticleCreateView.as_view(), name='create'),
171
+ ]
172
+
173
+ # Usage: reverse('articles:detail', args=[pk])
174
+ # Template: {% url 'articles:detail' article.pk %}
175
+ ```
176
+
177
+ ---
178
+
179
+ ### Security Checklist
180
+
181
+ Run before every production deployment: `python manage.py check --deploy`
182
+
183
+ **Required production settings:**
184
+
185
+ ```python
186
+ # config/settings/production.py
187
+
188
+ # Core
189
+ DEBUG = False
190
+ SECRET_KEY = env('SECRET_KEY')
191
+ ALLOWED_HOSTS = env.list('ALLOWED_HOSTS')
192
+
193
+ # HTTPS
194
+ SECURE_SSL_REDIRECT = True
195
+ SECURE_HSTS_SECONDS = 31536000
196
+ SECURE_HSTS_INCLUDE_SUBDOMAINS = True
197
+ SECURE_HSTS_PRELOAD = True
198
+
199
+ # Cookies
200
+ SESSION_COOKIE_SECURE = True
201
+ CSRF_COOKIE_SECURE = True
202
+ SESSION_COOKIE_HTTPONLY = True
203
+ CSRF_COOKIE_HTTPONLY = True
204
+
205
+ # Content security
206
+ SECURE_CONTENT_TYPE_NOSNIFF = True
207
+ X_FRAME_OPTIONS = 'DENY'
208
+ SECURE_BROWSER_XSS_FILTER = True
209
+ ```
210
+
211
+ **Security built-ins (never disable):**
212
+
213
+ | Protection | Middleware / Setting | Default |
214
+ |------------|---------------------|---------|
215
+ | CSRF | `CsrfViewMiddleware` | On |
216
+ | XSS | Template auto-escaping | On |
217
+ | SQL injection | ORM parameterized queries | On |
218
+ | Clickjacking | `XFrameOptionsMiddleware` | On |
219
+ | Session security | `SessionMiddleware` | On |
220
+
221
+ ---
222
+
223
+ ### Performance
224
+
225
+ **N+1 query prevention:**
226
+
227
+ ```python
228
+ # Bad: N+1
229
+ for article in Article.objects.all():
230
+ print(article.author.username) # 1 query per article
231
+
232
+ # Good: 2 queries total
233
+ for article in Article.objects.select_related('author'):
234
+ print(article.author.username)
235
+
236
+ # Good: M2M prefetch
237
+ Article.objects.prefetch_related('tags', 'comments__author')
238
+
239
+ # Advanced: Custom prefetch
240
+ from django.db.models import Prefetch
241
+ Article.objects.prefetch_related(
242
+ Prefetch('comments', queryset=Comment.objects.filter(approved=True))
243
+ )
244
+ ```
245
+
246
+ **Caching:**
247
+
248
+ ```python
249
+ # Settings
250
+ CACHES = {
251
+ 'default': {
252
+ 'BACKEND': 'django.core.cache.backends.redis.RedisCache',
253
+ 'LOCATION': env('REDIS_URL'),
254
+ }
255
+ }
256
+
257
+ # View-level caching
258
+ from django.views.decorators.cache import cache_page
259
+
260
+ @cache_page(60 * 15) # 15 minutes
261
+ def my_view(request):
262
+ ...
263
+
264
+ # Low-level API
265
+ from django.core.cache import cache
266
+ data = cache.get_or_set('my_key', expensive_function, timeout=300)
267
+ ```
268
+
269
+ ---
270
+
271
+ ### Testing
272
+
273
+ **pytest-django setup:**
274
+
275
+ ```ini
276
+ # pytest.ini
277
+ [pytest]
278
+ DJANGO_SETTINGS_MODULE = config.settings.test
279
+ python_files = tests/test_*.py
280
+ python_classes = Test*
281
+ python_functions = test_*
282
+ ```
283
+
284
+ **Factory pattern:**
285
+
286
+ ```python
287
+ # apps/articles/tests/factories.py
288
+ import factory
289
+ from factory.django import DjangoModelFactory
290
+
291
+ class UserFactory(DjangoModelFactory):
292
+ class Meta:
293
+ model = 'users.User'
294
+ username = factory.Sequence(lambda n: f'user{n}')
295
+ email = factory.LazyAttribute(lambda o: f'{o.username}@example.com')
296
+
297
+ class ArticleFactory(DjangoModelFactory):
298
+ class Meta:
299
+ model = 'articles.Article'
300
+ title = factory.Faker('sentence')
301
+ author = factory.SubFactory(UserFactory)
302
+ status = 'published'
303
+ ```
304
+
305
+ **Test structure:**
306
+
307
+ ```python
308
+ # apps/articles/tests/test_views.py
309
+ import pytest
310
+ from django.urls import reverse
311
+
312
+ @pytest.mark.django_db
313
+ class TestArticleListView:
314
+ def test_returns_published_articles(self, client):
315
+ ArticleFactory.create_batch(3, status='published')
316
+ ArticleFactory(status='draft')
317
+
318
+ url = reverse('articles:list')
319
+ response = client.get(url)
320
+
321
+ assert response.status_code == 200
322
+ assert len(response.context['articles']) == 3
323
+
324
+ def test_requires_login_for_create(self, client):
325
+ url = reverse('articles:create')
326
+ response = client.get(url)
327
+ assert response.status_code == 302 # Redirect to login
328
+ ```
329
+
330
+ ---
331
+
332
+ ### REST API (DRF)
333
+
334
+ **Serializers:**
335
+
336
+ ```python
337
+ from rest_framework import serializers
338
+
339
+ class ArticleSerializer(serializers.ModelSerializer):
340
+ author_name = serializers.SerializerMethodField()
341
+ tags = serializers.StringRelatedField(many=True)
342
+
343
+ class Meta:
344
+ model = Article
345
+ fields = ['id', 'title', 'body', 'author_name', 'tags', 'created_at']
346
+ read_only_fields = ['id', 'created_at']
347
+
348
+ def get_author_name(self, obj):
349
+ return obj.author.get_full_name()
350
+ ```
351
+
352
+ **ViewSets + Routers:**
353
+
354
+ ```python
355
+ from rest_framework import viewsets, permissions
356
+ from rest_framework.decorators import action
357
+ from rest_framework.response import Response
358
+
359
+ class ArticleViewSet(viewsets.ModelViewSet):
360
+ queryset = Article.published.select_related('author')
361
+ serializer_class = ArticleSerializer
362
+ permission_classes = [permissions.IsAuthenticatedOrReadOnly]
363
+
364
+ def perform_create(self, serializer):
365
+ serializer.save(author=self.request.user)
366
+
367
+ @action(detail=True, methods=['post'])
368
+ def publish(self, request, pk=None):
369
+ article = self.get_object()
370
+ article.status = 'published'
371
+ article.save()
372
+ return Response({'status': 'published'})
373
+
374
+ # urls.py
375
+ from rest_framework.routers import DefaultRouter
376
+
377
+ router = DefaultRouter()
378
+ router.register('articles', ArticleViewSet, basename='article')
379
+
380
+ urlpatterns = [path('api/v1/', include(router.urls))]
381
+ ```
382
+
383
+ **Authentication (JWT):**
384
+
385
+ ```python
386
+ # settings/base.py
387
+ REST_FRAMEWORK = {
388
+ 'DEFAULT_AUTHENTICATION_CLASSES': [
389
+ 'rest_framework_simplejwt.authentication.JWTAuthentication',
390
+ ],
391
+ 'DEFAULT_PERMISSION_CLASSES': [
392
+ 'rest_framework.permissions.IsAuthenticated',
393
+ ],
394
+ 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
395
+ 'PAGE_SIZE': 20,
396
+ 'DEFAULT_THROTTLE_CLASSES': [
397
+ 'rest_framework.throttling.AnonRateThrottle',
398
+ 'rest_framework.throttling.UserRateThrottle',
399
+ ],
400
+ 'DEFAULT_THROTTLE_RATES': {
401
+ 'anon': '100/hour',
402
+ 'user': '1000/hour',
403
+ },
404
+ }
405
+ ```
406
+
407
+ ---
408
+
409
+ ### Deployment
410
+
411
+ **Gunicorn configuration:**
412
+
413
+ ```bash
414
+ # gunicorn.conf.py
415
+ workers = multiprocessing.cpu_count() * 2 + 1
416
+ worker_class = 'sync' # or 'uvicorn.workers.UvicornWorker' for ASGI
417
+ bind = '0.0.0.0:8000'
418
+ timeout = 30
419
+ keepalive = 2
420
+ max_requests = 1000
421
+ max_requests_jitter = 100
422
+ ```
423
+
424
+ **Static files with whitenoise:**
425
+
426
+ ```python
427
+ # settings/production.py
428
+ MIDDLEWARE = [
429
+ 'django.middleware.security.SecurityMiddleware',
430
+ 'whitenoise.middleware.WhiteNoiseMiddleware', # After SecurityMiddleware
431
+ ...
432
+ ]
433
+ STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
434
+ ```
435
+
436
+ **Deployment checklist:**
437
+
438
+ ```bash
439
+ # Before every production deployment
440
+ python manage.py check --deploy
441
+ python manage.py migrate --run-syncdb
442
+ python manage.py collectstatic --noinput
443
+
444
+ # Database
445
+ # Use PostgreSQL (psycopg2-binary or psycopg[binary])
446
+ # Set up pgBouncer for connection pooling
447
+
448
+ # Logging
449
+ LOGGING = {
450
+ 'version': 1,
451
+ 'disable_existing_loggers': False,
452
+ 'handlers': {
453
+ 'console': {'class': 'logging.StreamHandler'},
454
+ 'file': {'class': 'logging.FileHandler', 'filename': '/var/log/django.log'},
455
+ },
456
+ 'root': {'handlers': ['console', 'file'], 'level': 'WARNING'},
457
+ }
458
+ ```
459
+
460
+ ---
461
+
462
+ ## Package Recommendations
463
+
464
+ | Category | Package | Notes |
465
+ |----------|---------|-------|
466
+ | Settings | `django-environ` or `python-decouple` | Environment variable management |
467
+ | Auth | `djangorestframework-simplejwt` | JWT for APIs |
468
+ | API | `djangorestframework` | REST framework |
469
+ | Testing | `pytest-django`, `factory_boy` | Test infrastructure |
470
+ | Debug | `django-debug-toolbar` | Query inspection (dev only) |
471
+ | Static | `whitenoise` | Static file serving |
472
+ | Tasks | `celery` + `redis` | Background task queue |
473
+ | Caching | `django-redis` | Redis cache backend |
474
+ | Storage | `django-storages` + `boto3` | S3 media storage |
475
+ | Filtering | `django-filter` | DRF filter integration |
476
+ | Cors | `django-cors-headers` | CORS for SPA frontends |