@caddis/cli 0.2.6 → 0.4.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 (265) hide show
  1. package/bundles/antigravity-plugin/agents/claude-md-curator.md +1 -1
  2. package/bundles/antigravity-plugin/agents/knowledge-transfer.md +17 -32
  3. package/bundles/antigravity-plugin/caddis_statusline.py +825 -0
  4. package/bundles/antigravity-plugin/claude-md/folder-agents.md.tmpl +21 -0
  5. package/bundles/antigravity-plugin/guard_agy.py +60 -9
  6. package/bundles/antigravity-plugin/plugin.json +1 -1
  7. package/bundles/antigravity-plugin/scripts/caddis_gate.py +524 -0
  8. package/bundles/antigravity-plugin/scripts/caddis_inventory.py +439 -0
  9. package/bundles/antigravity-plugin/scripts/caddis_migrate_dir.py +270 -0
  10. package/bundles/antigravity-plugin/scripts/caddis_spawn.py +300 -0
  11. package/bundles/antigravity-plugin/scripts/caddis_statusline.py +825 -0
  12. package/bundles/antigravity-plugin/scripts/caddis_tidy.py +366 -0
  13. package/bundles/antigravity-plugin/scripts/check_doc_coverage.py +924 -0
  14. package/bundles/antigravity-plugin/scripts/claude-deepseek.ps1 +4 -0
  15. package/bundles/antigravity-plugin/scripts/claude-deepseek.sh +3 -0
  16. package/bundles/antigravity-plugin/scripts/claude-glm.ps1 +4 -0
  17. package/bundles/antigravity-plugin/scripts/claude-glm.sh +3 -0
  18. package/bundles/antigravity-plugin/scripts/claude-oss.ps1 +64 -0
  19. package/bundles/antigravity-plugin/scripts/claude-oss.sh +60 -0
  20. package/bundles/antigravity-plugin/scripts/claudster_config.py +121 -0
  21. package/bundles/antigravity-plugin/scripts/claudster_doctor.py +356 -0
  22. package/bundles/antigravity-plugin/scripts/claudster_init.py +400 -0
  23. package/bundles/antigravity-plugin/scripts/claudster_migrate_rules.py +300 -0
  24. package/bundles/antigravity-plugin/scripts/enforcement_inventory.py +261 -0
  25. package/bundles/antigravity-plugin/scripts/hook_log.py +156 -0
  26. package/bundles/antigravity-plugin/scripts/new-machine.ps1 +170 -0
  27. package/bundles/antigravity-plugin/scripts/oss_ask.py +98 -0
  28. package/bundles/antigravity-plugin/scripts/oss_model.py +174 -0
  29. package/bundles/antigravity-plugin/scripts/oss_review.py +718 -0
  30. package/bundles/antigravity-plugin/scripts/setup_project_ai.py +1432 -0
  31. package/bundles/antigravity-plugin/scripts/usage_review.py +1323 -0
  32. package/bundles/antigravity-plugin/session_end_agy.py +52 -8
  33. package/bundles/antigravity-plugin/skills/_registry.md +1 -0
  34. package/bundles/antigravity-plugin/skills/advisory-hub/SKILL.md +44 -0
  35. package/bundles/antigravity-plugin/skills/code-review/SKILL.md +11 -0
  36. package/bundles/antigravity-plugin/skills/fastapi-dev/SKILL.md +1 -1
  37. package/bundles/antigravity-plugin/skills/feature-plan/SKILL.md +21 -0
  38. package/bundles/antigravity-plugin/skills/gate-review/SKILL.md +11 -0
  39. package/bundles/antigravity-plugin/skills/implement/SKILL.md +36 -0
  40. package/bundles/antigravity-plugin/skills/security-review/SKILL.md +9 -0
  41. package/bundles/antigravity-plugin/skills/ship/SKILL.md +1 -1
  42. package/bundles/antigravity-plugin/skills/ship-merge/SKILL.md +1 -1
  43. package/bundles/antigravity-plugin/skills/ship-pr/SKILL.md +1 -1
  44. package/bundles/antigravity-plugin/skills/statusline/SKILL.md +105 -0
  45. package/bundles/antigravity-plugin/skills/use-model/SKILL.md +15 -3
  46. package/bundles/antigravity-plugin/skills/validate-phase/SKILL.md +31 -0
  47. package/bundles/antigravity-plugin/warm_start_agy.py +117 -11
  48. package/bundles/antigravity-plugin-extras/plugin.json +1 -1
  49. package/bundles/antigravity-plugin-extras/skills/architecture-design/SKILL.md +1 -1
  50. package/bundles/antigravity-plugin-extras/skills/caching-patterns/SKILL.md +1 -1
  51. package/bundles/antigravity-plugin-extras/skills/webapp-development/SKILL.md +1 -1
  52. package/bundles/codex/.codex/config.toml.example +36 -0
  53. package/bundles/codex/.codex/skills/coding/api-design/SKILL.md +249 -0
  54. package/bundles/codex/.codex/skills/coding/backend-development/SKILL.md +305 -0
  55. package/bundles/codex/.codex/skills/coding/code-review/SKILL.md +140 -0
  56. package/bundles/codex/.codex/skills/coding/codebase-audit/SKILL.md +204 -0
  57. package/bundles/codex/.codex/skills/coding/dashboard-perf-sweep/SKILL.md +132 -0
  58. package/bundles/codex/.codex/skills/coding/dashboard-perf-sweep/scripts/perf_sweep.py +249 -0
  59. package/bundles/codex/.codex/skills/coding/error-handling/SKILL.md +260 -0
  60. package/bundles/codex/.codex/skills/coding/fastapi-dev/SKILL.md +300 -0
  61. package/bundles/codex/.codex/skills/coding/javascript-typescript/SKILL.md +142 -0
  62. package/bundles/codex/.codex/skills/coding/python/SKILL.md +388 -0
  63. package/bundles/codex/.codex/skills/coding/refactoring/SKILL.md +486 -0
  64. package/bundles/codex/.codex/skills/coding/security-review/SKILL.md +205 -0
  65. package/bundles/codex/.codex/skills/coding/sql/SKILL.md +321 -0
  66. package/bundles/codex/.codex/skills/data/database-design/SKILL.md +177 -0
  67. package/bundles/codex/.codex/skills/data/db-diagram/SKILL.md +148 -0
  68. package/bundles/codex/.codex/skills/data/db-diagram/scripts/sql_to_graph.py +1212 -0
  69. package/bundles/codex/.codex/skills/devops/ci-cd-pipeline/SKILL.md +315 -0
  70. package/bundles/codex/.codex/skills/devops/gh-cli/SKILL.md +195 -0
  71. package/bundles/codex/.codex/skills/devops/git-commit/SKILL.md +285 -0
  72. package/bundles/codex/.codex/skills/devops/using-git-worktrees/SKILL.md +217 -0
  73. package/bundles/codex/.codex/skills/devops/windows-deployment/SKILL.md +880 -0
  74. package/bundles/codex/.codex/skills/docs/code-documentation/SKILL.md +271 -0
  75. package/bundles/codex/.codex/skills/docs/explainer-doc/SKILL.md +97 -0
  76. package/bundles/codex/.codex/skills/docs/technical-writing/SKILL.md +286 -0
  77. package/bundles/codex/.codex/skills/docs/writing-plans/SKILL.md +387 -0
  78. package/bundles/codex/.codex/skills/frontend/css-architecture/SKILL.md +305 -0
  79. package/bundles/codex/.codex/skills/frontend/css-architecture/references/RESPONSIVE-DESIGN.md +604 -0
  80. package/bundles/codex/.codex/skills/frontend/frontend-design/SKILL.md +193 -0
  81. package/bundles/codex/.codex/skills/frontend/frontend-design/references/my-tech-stack.md +127 -0
  82. package/bundles/codex/.codex/skills/frontend/mockup/SKILL.md +242 -0
  83. package/bundles/codex/.codex/skills/frontend/react-best-practices/SKILL.md +269 -0
  84. package/bundles/codex/.codex/skills/frontend/react-dev/README.md +404 -0
  85. package/bundles/codex/.codex/skills/frontend/react-dev/SKILL.md +459 -0
  86. package/bundles/codex/.codex/skills/frontend/react-dev/examples/generic-components.md +579 -0
  87. package/bundles/codex/.codex/skills/frontend/react-dev/examples/server-components.md +579 -0
  88. package/bundles/codex/.codex/skills/frontend/react-dev/references/event-handlers.md +574 -0
  89. package/bundles/codex/.codex/skills/frontend/react-dev/references/hooks.md +456 -0
  90. package/bundles/codex/.codex/skills/frontend/react-dev/references/react-19-patterns.md +638 -0
  91. package/bundles/codex/.codex/skills/frontend/react-dev/references/react-router.md +1002 -0
  92. package/bundles/codex/.codex/skills/frontend/react-dev/references/tanstack-router.md +587 -0
  93. package/bundles/codex/.codex/skills/frontend/ui-review/SKILL.md +176 -0
  94. package/bundles/codex/.codex/skills/frontend/ui-review/references/framework-fixes.md +471 -0
  95. package/bundles/codex/.codex/skills/frontend/ui-review/references/visual-checklist.md +236 -0
  96. package/bundles/codex/.codex/skills/frontend/warm-editorial-ui/DESIGN_TOKENS.md +487 -0
  97. package/bundles/codex/.codex/skills/frontend/warm-editorial-ui/IMPLEMENTATION_GUIDE.md +177 -0
  98. package/bundles/codex/.codex/skills/frontend/warm-editorial-ui/SKILL.md +732 -0
  99. package/bundles/codex/.codex/skills/media/draw-io/SKILL.md +162 -0
  100. package/bundles/codex/.codex/skills/media/draw-io/references/aws-icons.md +677 -0
  101. package/bundles/codex/.codex/skills/media/draw-io/references/layout-guidelines.md +142 -0
  102. package/bundles/codex/.codex/skills/media/draw-io/references/troubleshooting.md +118 -0
  103. package/bundles/codex/.codex/skills/media/draw-io/references/workflows.md +103 -0
  104. package/bundles/codex/.codex/skills/media/draw-io/scripts/convert-drawio-to-png.sh +25 -0
  105. package/bundles/codex/.codex/skills/media/draw-io/scripts/find_aws_icon.py +79 -0
  106. package/bundles/codex/.codex/skills/media/mermaid-diagrams/SKILL.md +292 -0
  107. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/ENHANCEMENTS.md +264 -0
  108. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/MERMAID-SUMMARY.md +137 -0
  109. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/advanced-features.md +556 -0
  110. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/architecture-diagrams.md +192 -0
  111. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/c4-diagrams.md +410 -0
  112. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/class-diagrams.md +361 -0
  113. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/erd-diagrams.md +510 -0
  114. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/flowcharts.md +450 -0
  115. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/sequence-diagrams.md +394 -0
  116. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/troubleshooting.md +335 -0
  117. package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/workflows.md +418 -0
  118. package/bundles/codex/.codex/skills/media/particle-art/SKILL.md +243 -0
  119. package/bundles/codex/.codex/skills/media/particle-art/references/canvas-utils.ts +171 -0
  120. package/bundles/codex/.codex/skills/media/particle-art/references/dot-field.template.tsx +203 -0
  121. package/bundles/codex/.codex/skills/media/particle-art/references/flow-field.template.tsx +263 -0
  122. package/bundles/codex/.codex/skills/media/particle-art/references/node-shape.template.tsx +261 -0
  123. package/bundles/codex/.codex/skills/media/particle-art/references/shape-sampler.ts +281 -0
  124. package/bundles/codex/.codex/skills/media/particle-art/references/stipple-morph.template.tsx +167 -0
  125. package/bundles/codex/.codex/skills/media/particle-art/references/stipple.template.tsx +175 -0
  126. package/bundles/codex/.codex/skills/media/particle-art/references/trail-ghost.template.tsx +266 -0
  127. package/bundles/codex/.codex/skills/media/particle-art/references/usage-examples.md +320 -0
  128. package/bundles/codex/.codex/skills/testing/playwright/API_REFERENCE.md +653 -0
  129. package/bundles/codex/.codex/skills/testing/playwright/SKILL.md +454 -0
  130. package/bundles/codex/.codex/skills/testing/playwright/lib/helpers.js +441 -0
  131. package/bundles/codex/.codex/skills/testing/playwright/package.json +26 -0
  132. package/bundles/codex/.codex/skills/testing/playwright/run.js +228 -0
  133. package/bundles/codex/.codex/skills/testing/tdd-workflow/SKILL.md +188 -0
  134. package/bundles/codex/.codex/skills/testing/test-strategy/SKILL.md +155 -0
  135. package/bundles/codex/.codex/skills/testing/webapp-testing/LICENSE.txt +202 -0
  136. package/bundles/codex/.codex/skills/testing/webapp-testing/SKILL.md +97 -0
  137. package/bundles/codex/.codex/skills/testing/webapp-testing/examples/console_logging.py +35 -0
  138. package/bundles/codex/.codex/skills/testing/webapp-testing/examples/element_discovery.py +40 -0
  139. package/bundles/codex/.codex/skills/testing/webapp-testing/examples/static_html_automation.py +33 -0
  140. package/bundles/codex/.codex/skills/testing/webapp-testing/scripts/with_server.py +106 -0
  141. package/bundles/codex/.codex/skills/workflow/advisory-hub/SKILL.md +227 -0
  142. package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/context-template.md +214 -0
  143. package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/hub-handbook.md +233 -0
  144. package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/report-contract.md +94 -0
  145. package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/succession.md +118 -0
  146. package/bundles/codex/.codex/skills/workflow/best-practices/SKILL.md +500 -0
  147. package/bundles/codex/.codex/skills/workflow/best-practices/agents/best-practices-referencer.md +263 -0
  148. package/bundles/codex/.codex/skills/workflow/best-practices/agents/codebase-context-builder.md +326 -0
  149. package/bundles/codex/.codex/skills/workflow/best-practices/agents/task-intent-analyzer.md +245 -0
  150. package/bundles/codex/.codex/skills/workflow/best-practices/references/anti-patterns.md +571 -0
  151. package/bundles/codex/.codex/skills/workflow/best-practices/references/before-after-examples.md +1114 -0
  152. package/bundles/codex/.codex/skills/workflow/best-practices/references/best-practices-guide.md +513 -0
  153. package/bundles/codex/.codex/skills/workflow/best-practices/references/common-workflows.md +692 -0
  154. package/bundles/codex/.codex/skills/workflow/best-practices/references/prompt-patterns.md +547 -0
  155. package/bundles/codex/.codex/skills/workflow/brainstorming/SKILL.md +57 -0
  156. package/bundles/codex/.codex/skills/workflow/context-curator/SKILL.md +157 -0
  157. package/bundles/codex/.codex/skills/workflow/golden-plan/SKILL.md +586 -0
  158. package/bundles/codex/.codex/skills/workflow/preflight/SKILL.md +440 -0
  159. package/bundles/codex/.codex/skills/workflow/skill-creator/LICENSE.txt +202 -0
  160. package/bundles/codex/.codex/skills/workflow/skill-creator/SKILL.md +491 -0
  161. package/bundles/codex/.codex/skills/workflow/skill-creator/agents/analyzer.md +274 -0
  162. package/bundles/codex/.codex/skills/workflow/skill-creator/agents/comparator.md +202 -0
  163. package/bundles/codex/.codex/skills/workflow/skill-creator/agents/grader.md +223 -0
  164. package/bundles/codex/.codex/skills/workflow/skill-creator/assets/eval_review.html +146 -0
  165. package/bundles/codex/.codex/skills/workflow/skill-creator/eval-viewer/generate_review.py +471 -0
  166. package/bundles/codex/.codex/skills/workflow/skill-creator/eval-viewer/viewer.html +1325 -0
  167. package/bundles/codex/.codex/skills/workflow/skill-creator/references/schemas.md +430 -0
  168. package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/__init__.py +0 -0
  169. package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/aggregate_benchmark.py +401 -0
  170. package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/generate_report.py +326 -0
  171. package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/improve_description.py +247 -0
  172. package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/package_skill.py +136 -0
  173. package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/quick_validate.py +103 -0
  174. package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/run_eval.py +310 -0
  175. package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/run_loop.py +328 -0
  176. package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/utils.py +47 -0
  177. package/bundles/codex/AGENTS.md +146 -0
  178. package/bundles/manifest.json +4 -3
  179. package/dist/claude-deepseek.js +544 -0
  180. package/dist/claude-glm.js +544 -0
  181. package/dist/claude-oss.js +544 -0
  182. package/dist/cli.js +542 -90
  183. package/package.json +5 -2
  184. package/bundles/antigravity-plugin/statusline-command-agy.sh +0 -91
  185. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +0 -93
  186. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
  187. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
  188. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +0 -93
  189. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
  190. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +0 -93
  191. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
  192. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  193. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +0 -93
  194. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  195. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
  196. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
  197. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +0 -93
  198. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
  199. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +0 -93
  200. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
  201. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +0 -94
  202. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
  203. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
  204. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +0 -93
  205. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
  206. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +0 -93
  207. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
  208. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
  209. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +0 -93
  210. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
  211. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
  212. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
  213. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
  214. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
  215. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  216. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  217. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  218. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +0 -93
  219. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  220. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  221. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  222. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +0 -93
  223. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
  224. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  225. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +0 -93
  226. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  227. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
  228. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
  229. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-OFL.txt +0 -93
  230. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +0 -93
  231. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
  232. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  233. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  234. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  235. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-OFL.txt +0 -93
  236. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  237. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
  238. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +0 -93
  239. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
  240. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +0 -93
  241. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  242. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  243. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +0 -93
  244. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  245. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
  246. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +0 -93
  247. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +0 -93
  248. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
  249. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
  250. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +0 -93
  251. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
  252. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +0 -93
  253. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
  254. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
  255. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +0 -93
  256. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  257. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +0 -93
  258. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  259. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
  260. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
  261. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
  262. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +0 -93
  263. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
  264. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +0 -93
  265. package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
@@ -0,0 +1,486 @@
1
+ ---
2
+ name: refactoring
3
+ context: fork
4
+ description: Safely refactor code while maintaining behavior. Use when improving code structure, reducing duplication, extracting functions, or modernizing legacy code.
5
+ ---
6
+
7
+ # Refactoring Skill
8
+
9
+ Systematically refactor code to improve quality while preserving functionality.
10
+
11
+ ## Trigger
12
+
13
+ Activate when:
14
+ - User asks to "refactor" or "clean up" code
15
+ - Code review identifies structural issues
16
+ - User wants to improve maintainability
17
+ - Technical debt needs to be addressed
18
+
19
+ ---
20
+
21
+ ## Refactoring Principles
22
+
23
+ 1. **Never change behavior** during refactoring
24
+ 2. **Small steps** - one change at a time
25
+ 3. **Tests first** - ensure coverage before changing
26
+ 4. **Commit often** - after each successful refactoring
27
+ 5. **One thing at a time** - don't mix refactoring with feature changes
28
+
29
+ ### When NOT to Refactor
30
+
31
+ - Code that works and won't change again (if it ain't broke...)
32
+ - Critical production code without tests (add tests first)
33
+ - When under a tight deadline (schedule it for later)
34
+ - "Just because" - always have a clear purpose
35
+
36
+ ---
37
+
38
+ ## Phase 1: Assessment
39
+
40
+ ### Objectives
41
+ - Understand current code structure
42
+ - Identify refactoring opportunities
43
+ - Assess test coverage
44
+
45
+ ### Actions
46
+
47
+ 1. **Read and understand the code**
48
+ - What does this code do?
49
+ - What are the inputs/outputs?
50
+ - Where are the dependencies?
51
+
52
+ 2. **Identify code smells**
53
+
54
+ | Smell | Signs | Refactoring |
55
+ |-------|-------|-------------|
56
+ | Long Method | >20 lines | Extract Method |
57
+ | Large Class | >200 lines, multiple concerns | Extract Class |
58
+ | Duplicated Code | Same logic in multiple places | Extract Method/Class |
59
+ | Long Parameter List | >3-4 parameters | Parameter Object |
60
+ | Deep Nesting | >3 levels of indentation | Guard Clauses, Extract Method |
61
+ | Magic Numbers | Hardcoded values | Named Constants |
62
+ | Dead Code | Unused functions/variables | Delete |
63
+ | Feature Envy | Method uses another class's data more | Move Method |
64
+
65
+ 3. **Check test coverage**
66
+ ```bash
67
+ pytest --cov=module_name --cov-report=term-missing
68
+ ```
69
+
70
+ ### Output
71
+
72
+ ```markdown
73
+ ## Refactoring Assessment
74
+
75
+ ### Current State
76
+ - File: [filename]
77
+ - Lines: [count]
78
+ - Test Coverage: [percentage]
79
+
80
+ ### Code Smells Identified
81
+ 1. [Smell]: [Location] - [Description]
82
+ 2. [Smell]: [Location] - [Description]
83
+
84
+ ### Recommended Refactorings
85
+ 1. [Refactoring]: [Expected improvement]
86
+ 2. [Refactoring]: [Expected improvement]
87
+
88
+ ### Risk Assessment
89
+ - Test coverage: [adequate/needs improvement]
90
+ - Complexity: [low/medium/high]
91
+ - Dependencies: [list affected areas]
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Phase 2: Preparation
97
+
98
+ ### Objectives
99
+ - Ensure adequate test coverage
100
+ - Set up for safe refactoring
101
+
102
+ ### Actions
103
+
104
+ 1. **Write missing tests** (if coverage < 80%)
105
+ ```python
106
+ def test_existing_behavior():
107
+ """Capture current behavior before refactoring."""
108
+ result = function_to_refactor(input_data)
109
+ assert result == expected_output
110
+ ```
111
+
112
+ 2. **Create characterization tests** (for legacy code)
113
+ ```python
114
+ def test_characterization():
115
+ """Document current behavior, even if unexpected."""
116
+ # Run function and record actual output
117
+ result = legacy_function(test_input)
118
+ # Assert against actual output (not expected)
119
+ assert result == actual_observed_output
120
+ ```
121
+
122
+ 3. **Run all tests** and ensure they pass
123
+ ```bash
124
+ pytest -v
125
+ ```
126
+
127
+ 4. **Commit current state**
128
+ ```bash
129
+ git add .
130
+ git commit -m "chore: add tests before refactoring"
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Phase 3: Execute Refactoring
136
+
137
+ ### Common Refactoring Patterns
138
+
139
+ #### Extract Method
140
+
141
+ ```python
142
+ # Before: Long method with mixed concerns
143
+ def process_complaint(complaint):
144
+ # Validation (10 lines)
145
+ if not complaint.customer_id:
146
+ raise ValueError("Customer ID required")
147
+ if not complaint.description:
148
+ raise ValueError("Description required")
149
+ # ... more validation
150
+
151
+ # Processing (15 lines)
152
+ complaint.status = "processing"
153
+ # ... processing logic
154
+
155
+ # Notification (10 lines)
156
+ send_email(complaint.customer_email, "...")
157
+ # ... notification logic
158
+
159
+ # After: Extracted methods
160
+ def process_complaint(complaint):
161
+ validate_complaint(complaint)
162
+ process_complaint_logic(complaint)
163
+ send_complaint_notification(complaint)
164
+
165
+ def validate_complaint(complaint):
166
+ if not complaint.customer_id:
167
+ raise ValueError("Customer ID required")
168
+ if not complaint.description:
169
+ raise ValueError("Description required")
170
+
171
+ def process_complaint_logic(complaint):
172
+ complaint.status = "processing"
173
+ # ... processing logic
174
+
175
+ def send_complaint_notification(complaint):
176
+ send_email(complaint.customer_email, "...")
177
+ ```
178
+
179
+ #### Extract Class
180
+
181
+ ```python
182
+ # Before: Class doing too much
183
+ class ComplaintHandler:
184
+ def __init__(self):
185
+ self.db_connection = create_connection()
186
+
187
+ def create_complaint(self, data):
188
+ # 20 lines of complaint logic
189
+ pass
190
+
191
+ def send_email(self, to, subject, body):
192
+ # 15 lines of email logic
193
+ pass
194
+
195
+ def generate_report(self, date_range):
196
+ # 25 lines of reporting logic
197
+ pass
198
+
199
+ # After: Separated concerns
200
+ class ComplaintHandler:
201
+ def __init__(self, notifier, reporter):
202
+ self.notifier = notifier
203
+ self.reporter = reporter
204
+
205
+ def create_complaint(self, data):
206
+ # Complaint logic only
207
+ pass
208
+
209
+ class EmailNotifier:
210
+ def send_email(self, to, subject, body):
211
+ pass
212
+
213
+ class ComplaintReporter:
214
+ def generate_report(self, date_range):
215
+ pass
216
+ ```
217
+
218
+ #### Replace Conditionals with Polymorphism
219
+
220
+ ```python
221
+ # Before: Switch-like conditionals
222
+ def calculate_priority_score(complaint):
223
+ if complaint.type == "billing":
224
+ return complaint.amount * 0.1
225
+ elif complaint.type == "technical":
226
+ return 50 + complaint.severity * 10
227
+ elif complaint.type == "service":
228
+ return 30 + complaint.wait_time * 2
229
+ else:
230
+ return 10
231
+
232
+ # After: Strategy pattern
233
+ class PriorityCalculator(Protocol):
234
+ def calculate(self, complaint) -> float: ...
235
+
236
+ class BillingPriorityCalculator:
237
+ def calculate(self, complaint) -> float:
238
+ return complaint.amount * 0.1
239
+
240
+ class TechnicalPriorityCalculator:
241
+ def calculate(self, complaint) -> float:
242
+ return 50 + complaint.severity * 10
243
+
244
+ CALCULATORS = {
245
+ "billing": BillingPriorityCalculator(),
246
+ "technical": TechnicalPriorityCalculator(),
247
+ "service": ServicePriorityCalculator(),
248
+ }
249
+
250
+ def calculate_priority_score(complaint):
251
+ calculator = CALCULATORS.get(complaint.type, DefaultCalculator())
252
+ return calculator.calculate(complaint)
253
+ ```
254
+
255
+ #### Guard Clauses
256
+
257
+ ```python
258
+ # Before: Deep nesting
259
+ def process(data):
260
+ if data is not None:
261
+ if data.is_valid:
262
+ if data.has_permission:
263
+ # Actual logic here
264
+ result = do_something(data)
265
+ return result
266
+ else:
267
+ raise PermissionError()
268
+ else:
269
+ raise ValueError("Invalid data")
270
+ else:
271
+ raise ValueError("Data required")
272
+
273
+ # After: Guard clauses
274
+ def process(data):
275
+ if data is None:
276
+ raise ValueError("Data required")
277
+ if not data.is_valid:
278
+ raise ValueError("Invalid data")
279
+ if not data.has_permission:
280
+ raise PermissionError()
281
+
282
+ # Actual logic at main level
283
+ return do_something(data)
284
+ ```
285
+
286
+ #### Duplicated Code
287
+
288
+ ```python
289
+ # Before: Same logic in multiple places
290
+ def get_user_discount(user):
291
+ if user.membership == "gold": return user.total * 0.2
292
+ if user.membership == "silver": return user.total * 0.1
293
+ return 0
294
+
295
+ def get_order_discount(order):
296
+ if order.user.membership == "gold": return order.total * 0.2
297
+ if order.user.membership == "silver": return order.total * 0.1
298
+ return 0
299
+
300
+ # After: Extract common logic
301
+ DISCOUNT_RATES = {"gold": 0.2, "silver": 0.1}
302
+
303
+ def get_membership_rate(membership: str) -> float:
304
+ return DISCOUNT_RATES.get(membership, 0)
305
+ ```
306
+
307
+ #### Long Parameter List → Parameter Object
308
+
309
+ ```python
310
+ # Before: Too many parameters
311
+ def create_user(email, password, name, age, address, city, country, phone):
312
+ ...
313
+
314
+ # After: Group into a dataclass
315
+ @dataclass
316
+ class UserData:
317
+ email: str
318
+ password: str
319
+ name: str
320
+ age: int | None = None
321
+ address: str | None = None
322
+ phone: str | None = None
323
+
324
+ def create_user(data: UserData):
325
+ ...
326
+ ```
327
+
328
+ #### Feature Envy → Move Method
329
+
330
+ ```python
331
+ # Before: Method uses another object's data more than its own
332
+ class Order:
333
+ def calculate_discount(self, user):
334
+ if user.membership_level == "gold":
335
+ return self.total * 0.2
336
+ if user.account_age > 365:
337
+ return self.total * 0.1
338
+ return 0
339
+
340
+ # After: Move logic to the object that owns the data
341
+ class User:
342
+ def get_discount_rate(self) -> float:
343
+ if self.membership_level == "gold": return 0.2
344
+ if self.account_age > 365: return 0.1
345
+ return 0
346
+
347
+ class Order:
348
+ def calculate_discount(self, user):
349
+ return self.total * user.get_discount_rate()
350
+ ```
351
+
352
+ #### Primitive Obsession → Value Objects
353
+
354
+ ```python
355
+ # Before: Using raw strings for domain concepts
356
+ def send_email(to: str, subject: str, body: str): ...
357
+ send_email("user@example.com", "Hello", "...")
358
+
359
+ # After: Domain types with validation
360
+ class Email:
361
+ def __init__(self, value: str):
362
+ if "@" not in value:
363
+ raise ValueError(f"Invalid email: {value}")
364
+ self.value = value
365
+
366
+ def send_email(to: Email, subject: str, body: str): ...
367
+ ```
368
+
369
+ #### Dead Code → Delete It
370
+
371
+ ```python
372
+ # Before: Unused code lingers
373
+ def old_implementation(): ... # Nobody calls this
374
+ DEPRECATED_VALUE = 5 # Not referenced
375
+ # def commented_out_code(): ... # Noise
376
+
377
+ # After: Remove it — git has history if you need it back
378
+ ```
379
+
380
+ ### After Each Refactoring
381
+
382
+ 1. **Run tests**
383
+ ```bash
384
+ pytest -v
385
+ ```
386
+
387
+ 2. **If tests pass, commit**
388
+ ```bash
389
+ git commit -m "refactor: extract validation to separate method"
390
+ ```
391
+
392
+ 3. **If tests fail, revert**
393
+ ```bash
394
+ git checkout -- .
395
+ ```
396
+
397
+ ---
398
+
399
+ ## Phase 4: Validation
400
+
401
+ ### Objectives
402
+ - Verify behavior unchanged
403
+ - Confirm quality improved
404
+ - Document changes
405
+
406
+ ### Actions
407
+
408
+ 1. **Run full test suite**
409
+ ```bash
410
+ pytest --cov=module_name
411
+ ```
412
+
413
+ 2. **Compare before/after metrics**
414
+ - Lines of code
415
+ - Cyclomatic complexity
416
+ - Test coverage
417
+ - Method/class sizes
418
+
419
+ 3. **Manual smoke test**
420
+ - Test key user flows
421
+ - Verify edge cases
422
+
423
+ ---
424
+
425
+ ## Phase 5: Documentation
426
+
427
+ ### Output
428
+
429
+ ```markdown
430
+ ## Refactoring Summary
431
+
432
+ ### Changes Made
433
+ 1. **[Refactoring 1]**: [What was changed and why]
434
+ 2. **[Refactoring 2]**: [What was changed and why]
435
+
436
+ ### Files Modified
437
+ - `path/to/file.py`: [Summary of changes]
438
+
439
+ ### Metrics Comparison
440
+ | Metric | Before | After |
441
+ |--------|--------|-------|
442
+ | Lines of Code | [x] | [y] |
443
+ | Methods >20 lines | [x] | [y] |
444
+ | Test Coverage | [x]% | [y]% |
445
+
446
+ ### Behavioral Changes
447
+ None (refactoring only)
448
+
449
+ ### Tests Added
450
+ - `test_function_name`: [What it tests]
451
+
452
+ ### Follow-up Recommendations
453
+ - [ ] [Future improvement 1]
454
+ - [ ] [Future improvement 2]
455
+ ```
456
+
457
+ ---
458
+
459
+ ## Common Refactoring Operations Reference
460
+
461
+ | Operation | Description |
462
+ |-----------|-------------|
463
+ | Extract Method | Turn code fragment into a method |
464
+ | Extract Class | Move behavior to a new class |
465
+ | Inline Method | Move method body back to caller |
466
+ | Introduce Parameter Object | Group related parameters |
467
+ | Replace Conditional with Polymorphism | Use strategy/polymorphism instead of switch/if |
468
+ | Replace Magic Number with Constant | Named constants for clarity |
469
+ | Decompose Conditional | Break complex conditions into named functions |
470
+ | Replace Nested Conditional with Guard Clauses | Early returns |
471
+ | Introduce Null Object | Eliminate null checks |
472
+ | Replace Type Code with Enum | Strong typing for categories |
473
+ | Replace Inheritance with Delegation | Composition over inheritance |
474
+
475
+ ---
476
+
477
+ ## Safety Checklist
478
+
479
+ - [ ] Tests exist for code being refactored
480
+ - [ ] All tests pass before starting
481
+ - [ ] Refactoring in small, atomic steps
482
+ - [ ] Tests run after each change
483
+ - [ ] Commits after each successful refactoring
484
+ - [ ] No behavior changes introduced
485
+ - [ ] All tests pass after completion
486
+ - [ ] Changes documented
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: security-review
3
+ context: fork
4
+ description: "Security review workflow — OWASP, code scanning, cloud infrastructure"
5
+ ---
6
+
7
+ # Security Review
8
+
9
+ > **On Claude Code, prefer the native `/security-review`.** It is a command, not a skill, so it always
10
+ > fires — including headless — and it has grown capabilities this one does not have: Reach for it first.
11
+ >
12
+ > This surface remains because caddis ships to harnesses that have **no** native equivalent — agy,
13
+ > Codex and Copilot. There it is the only review you get. Do not delete it to tidy up Claude Code.
14
+ >
15
+ > `/caddis:cross-review` is NOT replaced by either. It sends the diff to a **different vendor's**
16
+ > model, which neither this nor the native reviewer can do.
17
+
18
+ Security review workflow covering OWASP Top 10, code scanning, and cloud infrastructure.
19
+
20
+ ## When to Use
21
+
22
+ - Implementing authentication or authorization
23
+ - Handling user input or file uploads
24
+ - Creating or modifying API endpoints
25
+ - Working with secrets, deploying to cloud, or configuring CI/CD
26
+
27
+ ## Phase 1: OWASP Top 10 Checks
28
+
29
+ ### A01 — Broken Access Control
30
+
31
+ ```python
32
+ # BAD — no auth check
33
+ @app.route("/admin/users")
34
+ def list_users():
35
+ return db.query(User).all()
36
+
37
+ # GOOD
38
+ @app.route("/admin/users")
39
+ @require_role("admin")
40
+ def list_users():
41
+ return db.query(User).all()
42
+ ```
43
+
44
+ - [ ] Every endpoint checks authentication
45
+ - [ ] Role-based access control enforced
46
+ - [ ] Users cannot access other users' data (IDOR)
47
+
48
+ ### A02 — Cryptographic Failures
49
+
50
+ ```python
51
+ # BAD: password_hash = hashlib.md5(password.encode()).hexdigest()
52
+ # GOOD:
53
+ from passlib.hash import argon2
54
+ password_hash = argon2.hash(password)
55
+ ```
56
+
57
+ - [ ] Passwords hashed with bcrypt/argon2
58
+ - [ ] Sensitive data encrypted at rest and in transit
59
+ - [ ] No secrets in source code or logs
60
+
61
+ ### A03 — Injection
62
+
63
+ ```python
64
+ # BAD: cursor.execute(f"SELECT * FROM users WHERE email = '{email}'")
65
+ # GOOD:
66
+ cursor.execute("SELECT * FROM users WHERE email = %s", (email,))
67
+ ```
68
+
69
+ - [ ] All queries parameterized or use ORM
70
+ - [ ] No `eval()`, `exec()`, or `os.system()` with user input
71
+
72
+ ### A05 — Security Misconfiguration
73
+
74
+ - [ ] Debug mode disabled in production
75
+ - [ ] Default credentials changed
76
+ - [ ] Unnecessary endpoints disabled
77
+
78
+ ### A06 — Vulnerable Components
79
+
80
+ ```bash
81
+ pip audit # Python
82
+ npm audit # JavaScript
83
+ trivy image app # Container
84
+ ```
85
+
86
+ - [ ] No known vulnerabilities; lock files committed
87
+
88
+ ### A07 — Authentication Failures
89
+
90
+ - [ ] Session tokens in httpOnly cookies (not localStorage)
91
+ - [ ] Account lockout after failed attempts
92
+ - [ ] MFA for privileged accounts
93
+
94
+ ### A09 — Logging Failures
95
+
96
+ ```python
97
+ # BAD: logger.info(f"Login: user={email}, password={password}")
98
+ # GOOD: logger.info(f"Login: user={email}, success={is_valid}")
99
+ ```
100
+
101
+ - [ ] Auth events logged; no PII or secrets in logs
102
+
103
+ ### A10 — SSRF
104
+
105
+ ```python
106
+ ALLOWED_HOSTS = {"api.example.com"}
107
+ parsed = urlparse(user_url)
108
+ if parsed.hostname not in ALLOWED_HOSTS:
109
+ raise ValueError("URL not allowed")
110
+ ```
111
+
112
+ ## Phase 2: Input Validation
113
+
114
+ ```python
115
+ from pydantic import BaseModel, EmailStr, constr, conint
116
+
117
+ class CreateUserRequest(BaseModel):
118
+ email: EmailStr
119
+ name: constr(min_length=1, max_length=100)
120
+ age: conint(ge=0, le=150)
121
+
122
+ # Validate
123
+ try:
124
+ data = CreateUserRequest(**request_json)
125
+ except ValidationError as e:
126
+ return {"error": e.errors()}, 400
127
+ ```
128
+
129
+ File uploads: check size, extension, and magic bytes.
130
+
131
+ ## Phase 3: Security Headers
132
+
133
+ ```python
134
+ @app.after_request
135
+ def add_security_headers(response):
136
+ response.headers["X-Content-Type-Options"] = "nosniff"
137
+ response.headers["X-Frame-Options"] = "DENY"
138
+ response.headers["Referrer-Policy"] = "strict-origin-when-cross-origin"
139
+ response.headers["Content-Security-Policy"] = (
140
+ "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"
141
+ )
142
+ return response
143
+ ```
144
+
145
+ ## Phase 4: Cloud Infrastructure
146
+
147
+ ### IAM — Least Privilege
148
+
149
+ ```yaml
150
+ # GOOD: specific permissions on specific resources
151
+ permissions: [s3:GetObject, s3:ListBucket]
152
+ resources: [arn:aws:s3:::my-bucket/*]
153
+
154
+ # BAD: permissions: [s3:*], resources: ["*"]
155
+ ```
156
+
157
+ - [ ] No root account in production; MFA on privileged accounts
158
+ - [ ] Service accounts use roles, not long-lived keys
159
+
160
+ ### Secrets Management
161
+
162
+ - [ ] Secrets in a manager (AWS SM, Vault) with rotation
163
+ - [ ] No secrets in env vars without rotation policy
164
+
165
+ ### CI/CD Security
166
+
167
+ ```yaml
168
+ jobs:
169
+ deploy:
170
+ permissions: { contents: read }
171
+ steps:
172
+ - uses: actions/checkout@v4
173
+ - uses: trufflesecurity/trufflehog@main # Secret scanning
174
+ - run: pip audit # Dep audit
175
+ - run: pytest --cov=myapp --cov-fail-under=80
176
+ ```
177
+
178
+ - [ ] OIDC instead of long-lived credentials
179
+ - [ ] Branch protection and code review required
180
+
181
+ ### Network
182
+
183
+ - [ ] Database not publicly accessible
184
+ - [ ] Security groups follow least privilege
185
+ - [ ] WAF enabled
186
+
187
+ ## Pre-Deployment Checklist
188
+
189
+ - [ ] No hardcoded secrets
190
+ - [ ] All user inputs validated server-side
191
+ - [ ] All queries parameterized
192
+ - [ ] Auth + authz on every endpoint
193
+ - [ ] Rate limiting enabled
194
+ - [ ] HTTPS enforced
195
+ - [ ] Security headers configured
196
+ - [ ] No sensitive data in error responses or logs
197
+ - [ ] Dependencies audited
198
+ - [ ] Cloud IAM least-privilege applied
199
+ - [ ] Backups automated with tested recovery
200
+
201
+ ## Resources
202
+
203
+ - [OWASP Top 10](https://owasp.org/www-project-top-ten/)
204
+ - [OWASP Cheat Sheets](https://cheatsheetseries.owasp.org/)
205
+ - [CIS Benchmarks](https://www.cisecurity.org/cis-benchmarks)