@caddis/cli 0.3.0 → 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.
- package/bundles/antigravity-plugin/agents/knowledge-transfer.md +17 -32
- package/bundles/antigravity-plugin/caddis_statusline.py +25 -3
- package/bundles/antigravity-plugin/guard_agy.py +41 -9
- package/bundles/antigravity-plugin/plugin.json +1 -1
- package/bundles/antigravity-plugin/scripts/caddis_inventory.py +73 -3
- package/bundles/antigravity-plugin/scripts/caddis_statusline.py +25 -3
- package/bundles/antigravity-plugin/scripts/claudster_config.py +0 -5
- package/bundles/antigravity-plugin/scripts/hook_log.py +1 -1
- package/bundles/antigravity-plugin/scripts/new-machine.ps1 +170 -0
- package/bundles/antigravity-plugin/scripts/oss_ask.py +1 -1
- package/bundles/antigravity-plugin/scripts/oss_model.py +10 -2
- package/bundles/antigravity-plugin/scripts/oss_review.py +1 -1
- package/bundles/antigravity-plugin/scripts/setup_project_ai.py +9 -6
- package/bundles/antigravity-plugin/session_end_agy.py +31 -6
- package/bundles/antigravity-plugin/skills/advisory-hub/SKILL.md +44 -0
- package/bundles/antigravity-plugin/skills/code-review/SKILL.md +11 -0
- package/bundles/antigravity-plugin/skills/feature-plan/SKILL.md +21 -0
- package/bundles/antigravity-plugin/skills/gate-review/SKILL.md +11 -0
- package/bundles/antigravity-plugin/skills/implement/SKILL.md +36 -0
- package/bundles/antigravity-plugin/skills/security-review/SKILL.md +9 -0
- package/bundles/antigravity-plugin/skills/validate-phase/SKILL.md +31 -0
- package/bundles/antigravity-plugin/warm_start_agy.py +96 -9
- package/bundles/antigravity-plugin-extras/plugin.json +1 -1
- package/bundles/codex/.codex/config.toml.example +36 -0
- package/bundles/codex/.codex/skills/coding/api-design/SKILL.md +249 -0
- package/bundles/codex/.codex/skills/coding/backend-development/SKILL.md +305 -0
- package/bundles/codex/.codex/skills/coding/code-review/SKILL.md +140 -0
- package/bundles/codex/.codex/skills/coding/codebase-audit/SKILL.md +204 -0
- package/bundles/codex/.codex/skills/coding/dashboard-perf-sweep/SKILL.md +132 -0
- package/bundles/codex/.codex/skills/coding/dashboard-perf-sweep/scripts/perf_sweep.py +249 -0
- package/bundles/codex/.codex/skills/coding/error-handling/SKILL.md +260 -0
- package/bundles/codex/.codex/skills/coding/fastapi-dev/SKILL.md +300 -0
- package/bundles/codex/.codex/skills/coding/javascript-typescript/SKILL.md +142 -0
- package/bundles/codex/.codex/skills/coding/python/SKILL.md +388 -0
- package/bundles/codex/.codex/skills/coding/refactoring/SKILL.md +486 -0
- package/bundles/codex/.codex/skills/coding/security-review/SKILL.md +205 -0
- package/bundles/codex/.codex/skills/coding/sql/SKILL.md +321 -0
- package/bundles/codex/.codex/skills/data/database-design/SKILL.md +177 -0
- package/bundles/codex/.codex/skills/data/db-diagram/SKILL.md +148 -0
- package/bundles/codex/.codex/skills/data/db-diagram/scripts/sql_to_graph.py +1212 -0
- package/bundles/codex/.codex/skills/devops/ci-cd-pipeline/SKILL.md +315 -0
- package/bundles/codex/.codex/skills/devops/gh-cli/SKILL.md +195 -0
- package/bundles/codex/.codex/skills/devops/git-commit/SKILL.md +285 -0
- package/bundles/codex/.codex/skills/devops/using-git-worktrees/SKILL.md +217 -0
- package/bundles/codex/.codex/skills/devops/windows-deployment/SKILL.md +880 -0
- package/bundles/codex/.codex/skills/docs/code-documentation/SKILL.md +271 -0
- package/bundles/codex/.codex/skills/docs/explainer-doc/SKILL.md +97 -0
- package/bundles/codex/.codex/skills/docs/technical-writing/SKILL.md +286 -0
- package/bundles/codex/.codex/skills/docs/writing-plans/SKILL.md +387 -0
- package/bundles/codex/.codex/skills/frontend/css-architecture/SKILL.md +305 -0
- package/bundles/codex/.codex/skills/frontend/css-architecture/references/RESPONSIVE-DESIGN.md +604 -0
- package/bundles/codex/.codex/skills/frontend/frontend-design/SKILL.md +193 -0
- package/bundles/codex/.codex/skills/frontend/frontend-design/references/my-tech-stack.md +127 -0
- package/bundles/codex/.codex/skills/frontend/mockup/SKILL.md +242 -0
- package/bundles/codex/.codex/skills/frontend/react-best-practices/SKILL.md +269 -0
- package/bundles/codex/.codex/skills/frontend/react-dev/README.md +404 -0
- package/bundles/codex/.codex/skills/frontend/react-dev/SKILL.md +459 -0
- package/bundles/codex/.codex/skills/frontend/react-dev/examples/generic-components.md +579 -0
- package/bundles/codex/.codex/skills/frontend/react-dev/examples/server-components.md +579 -0
- package/bundles/codex/.codex/skills/frontend/react-dev/references/event-handlers.md +574 -0
- package/bundles/codex/.codex/skills/frontend/react-dev/references/hooks.md +456 -0
- package/bundles/codex/.codex/skills/frontend/react-dev/references/react-19-patterns.md +638 -0
- package/bundles/codex/.codex/skills/frontend/react-dev/references/react-router.md +1002 -0
- package/bundles/codex/.codex/skills/frontend/react-dev/references/tanstack-router.md +587 -0
- package/bundles/codex/.codex/skills/frontend/ui-review/SKILL.md +176 -0
- package/bundles/codex/.codex/skills/frontend/ui-review/references/framework-fixes.md +471 -0
- package/bundles/codex/.codex/skills/frontend/ui-review/references/visual-checklist.md +236 -0
- package/bundles/codex/.codex/skills/frontend/warm-editorial-ui/DESIGN_TOKENS.md +487 -0
- package/bundles/codex/.codex/skills/frontend/warm-editorial-ui/IMPLEMENTATION_GUIDE.md +177 -0
- package/bundles/codex/.codex/skills/frontend/warm-editorial-ui/SKILL.md +732 -0
- package/bundles/codex/.codex/skills/media/draw-io/SKILL.md +162 -0
- package/bundles/codex/.codex/skills/media/draw-io/references/aws-icons.md +677 -0
- package/bundles/codex/.codex/skills/media/draw-io/references/layout-guidelines.md +142 -0
- package/bundles/codex/.codex/skills/media/draw-io/references/troubleshooting.md +118 -0
- package/bundles/codex/.codex/skills/media/draw-io/references/workflows.md +103 -0
- package/bundles/codex/.codex/skills/media/draw-io/scripts/convert-drawio-to-png.sh +25 -0
- package/bundles/codex/.codex/skills/media/draw-io/scripts/find_aws_icon.py +79 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/SKILL.md +292 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/ENHANCEMENTS.md +264 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/MERMAID-SUMMARY.md +137 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/advanced-features.md +556 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/architecture-diagrams.md +192 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/c4-diagrams.md +410 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/class-diagrams.md +361 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/erd-diagrams.md +510 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/flowcharts.md +450 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/sequence-diagrams.md +394 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/troubleshooting.md +335 -0
- package/bundles/codex/.codex/skills/media/mermaid-diagrams/references/workflows.md +418 -0
- package/bundles/codex/.codex/skills/media/particle-art/SKILL.md +243 -0
- package/bundles/codex/.codex/skills/media/particle-art/references/canvas-utils.ts +171 -0
- package/bundles/codex/.codex/skills/media/particle-art/references/dot-field.template.tsx +203 -0
- package/bundles/codex/.codex/skills/media/particle-art/references/flow-field.template.tsx +263 -0
- package/bundles/codex/.codex/skills/media/particle-art/references/node-shape.template.tsx +261 -0
- package/bundles/codex/.codex/skills/media/particle-art/references/shape-sampler.ts +281 -0
- package/bundles/codex/.codex/skills/media/particle-art/references/stipple-morph.template.tsx +167 -0
- package/bundles/codex/.codex/skills/media/particle-art/references/stipple.template.tsx +175 -0
- package/bundles/codex/.codex/skills/media/particle-art/references/trail-ghost.template.tsx +266 -0
- package/bundles/codex/.codex/skills/media/particle-art/references/usage-examples.md +320 -0
- package/bundles/codex/.codex/skills/testing/playwright/API_REFERENCE.md +653 -0
- package/bundles/codex/.codex/skills/testing/playwright/SKILL.md +454 -0
- package/bundles/codex/.codex/skills/testing/playwright/lib/helpers.js +441 -0
- package/bundles/codex/.codex/skills/testing/playwright/package.json +26 -0
- package/bundles/codex/.codex/skills/testing/playwright/run.js +228 -0
- package/bundles/codex/.codex/skills/testing/tdd-workflow/SKILL.md +188 -0
- package/bundles/codex/.codex/skills/testing/test-strategy/SKILL.md +155 -0
- package/bundles/codex/.codex/skills/testing/webapp-testing/LICENSE.txt +202 -0
- package/bundles/codex/.codex/skills/testing/webapp-testing/SKILL.md +97 -0
- package/bundles/codex/.codex/skills/testing/webapp-testing/examples/console_logging.py +35 -0
- package/bundles/codex/.codex/skills/testing/webapp-testing/examples/element_discovery.py +40 -0
- package/bundles/codex/.codex/skills/testing/webapp-testing/examples/static_html_automation.py +33 -0
- package/bundles/codex/.codex/skills/testing/webapp-testing/scripts/with_server.py +106 -0
- package/bundles/codex/.codex/skills/workflow/advisory-hub/SKILL.md +227 -0
- package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/context-template.md +214 -0
- package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/hub-handbook.md +233 -0
- package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/report-contract.md +94 -0
- package/bundles/codex/.codex/skills/workflow/advisory-hub/reference/succession.md +118 -0
- package/bundles/codex/.codex/skills/workflow/best-practices/SKILL.md +500 -0
- package/bundles/codex/.codex/skills/workflow/best-practices/agents/best-practices-referencer.md +263 -0
- package/bundles/codex/.codex/skills/workflow/best-practices/agents/codebase-context-builder.md +326 -0
- package/bundles/codex/.codex/skills/workflow/best-practices/agents/task-intent-analyzer.md +245 -0
- package/bundles/codex/.codex/skills/workflow/best-practices/references/anti-patterns.md +571 -0
- package/bundles/codex/.codex/skills/workflow/best-practices/references/before-after-examples.md +1114 -0
- package/bundles/codex/.codex/skills/workflow/best-practices/references/best-practices-guide.md +513 -0
- package/bundles/codex/.codex/skills/workflow/best-practices/references/common-workflows.md +692 -0
- package/bundles/codex/.codex/skills/workflow/best-practices/references/prompt-patterns.md +547 -0
- package/bundles/codex/.codex/skills/workflow/brainstorming/SKILL.md +57 -0
- package/bundles/codex/.codex/skills/workflow/context-curator/SKILL.md +157 -0
- package/bundles/codex/.codex/skills/workflow/golden-plan/SKILL.md +586 -0
- package/bundles/codex/.codex/skills/workflow/preflight/SKILL.md +440 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/LICENSE.txt +202 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/SKILL.md +491 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/agents/analyzer.md +274 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/agents/comparator.md +202 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/agents/grader.md +223 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/assets/eval_review.html +146 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/eval-viewer/generate_review.py +471 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/eval-viewer/viewer.html +1325 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/references/schemas.md +430 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/__init__.py +0 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/generate_report.py +326 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/improve_description.py +247 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/package_skill.py +136 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/quick_validate.py +103 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/run_eval.py +310 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/run_loop.py +328 -0
- package/bundles/codex/.codex/skills/workflow/skill-creator/scripts/utils.py +47 -0
- package/bundles/codex/AGENTS.md +146 -0
- package/bundles/manifest.json +4 -3
- package/dist/claude-deepseek.js +2 -2
- package/dist/claude-glm.js +2 -2
- package/dist/claude-oss.js +2 -2
- package/dist/cli.js +187 -56
- package/package.json +1 -1
- package/bundles/antigravity-plugin/scripts/dream_capture.py +0 -249
- package/bundles/antigravity-plugin/scripts/dream_memory.py +0 -438
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +0 -94
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +0 -93
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: python-development
|
|
3
|
+
description: Modern Python development with Python 3.12+, Django, FastAPI, async patterns, and production best practices. Use for Python projects, APIs, data processing, or automation scripts.
|
|
4
|
+
source: wshobson/agents
|
|
5
|
+
license: MIT
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Python Development
|
|
9
|
+
|
|
10
|
+
## Project Setup
|
|
11
|
+
|
|
12
|
+
### Modern Python Project Structure
|
|
13
|
+
```
|
|
14
|
+
my-project/
|
|
15
|
+
├── src/
|
|
16
|
+
│ └── my_project/
|
|
17
|
+
│ ├── __init__.py
|
|
18
|
+
│ ├── main.py
|
|
19
|
+
│ └── utils.py
|
|
20
|
+
├── tests/
|
|
21
|
+
│ ├── __init__.py
|
|
22
|
+
│ └── test_main.py
|
|
23
|
+
├── pyproject.toml
|
|
24
|
+
├── README.md
|
|
25
|
+
└── .gitignore
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### pyproject.toml
|
|
29
|
+
```toml
|
|
30
|
+
[project]
|
|
31
|
+
name = "my-project"
|
|
32
|
+
version = "0.1.0"
|
|
33
|
+
requires-python = ">=3.12"
|
|
34
|
+
dependencies = [
|
|
35
|
+
"fastapi>=0.100.0",
|
|
36
|
+
"pydantic>=2.0",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
dev = [
|
|
41
|
+
"pytest>=7.0",
|
|
42
|
+
"ruff>=0.1.0",
|
|
43
|
+
"mypy>=1.0",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[tool.ruff]
|
|
47
|
+
line-length = 88
|
|
48
|
+
select = ["E", "F", "I", "N", "W"]
|
|
49
|
+
|
|
50
|
+
[tool.mypy]
|
|
51
|
+
strict = true
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Type Hints
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from typing import TypeVar, Generic
|
|
58
|
+
from collections.abc import Sequence
|
|
59
|
+
|
|
60
|
+
T = TypeVar('T')
|
|
61
|
+
|
|
62
|
+
def process_items(items: Sequence[str]) -> list[str]:
|
|
63
|
+
return [item.upper() for item in items]
|
|
64
|
+
|
|
65
|
+
class Repository(Generic[T]):
|
|
66
|
+
def get(self, id: int) -> T | None: ...
|
|
67
|
+
def save(self, item: T) -> T: ...
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Async Patterns
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import asyncio
|
|
74
|
+
from collections.abc import AsyncIterator
|
|
75
|
+
|
|
76
|
+
async def fetch_all(urls: list[str]) -> list[dict]:
|
|
77
|
+
async with aiohttp.ClientSession() as session:
|
|
78
|
+
tasks = [fetch_one(session, url) for url in urls]
|
|
79
|
+
return await asyncio.gather(*tasks)
|
|
80
|
+
|
|
81
|
+
async def stream_data() -> AsyncIterator[bytes]:
|
|
82
|
+
async with aiofiles.open('large_file.txt', 'rb') as f:
|
|
83
|
+
async for chunk in f:
|
|
84
|
+
yield chunk
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## FastAPI Patterns
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from fastapi import FastAPI, Depends, HTTPException
|
|
91
|
+
from pydantic import BaseModel
|
|
92
|
+
|
|
93
|
+
app = FastAPI()
|
|
94
|
+
|
|
95
|
+
class UserCreate(BaseModel):
|
|
96
|
+
email: str
|
|
97
|
+
name: str
|
|
98
|
+
|
|
99
|
+
class UserResponse(BaseModel):
|
|
100
|
+
id: int
|
|
101
|
+
email: str
|
|
102
|
+
name: str
|
|
103
|
+
|
|
104
|
+
@app.post("/users", response_model=UserResponse)
|
|
105
|
+
async def create_user(
|
|
106
|
+
user: UserCreate,
|
|
107
|
+
db: Database = Depends(get_db)
|
|
108
|
+
) -> UserResponse:
|
|
109
|
+
result = await db.users.create(user.model_dump())
|
|
110
|
+
return UserResponse(**result)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Testing
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
import pytest
|
|
117
|
+
from unittest.mock import AsyncMock, patch
|
|
118
|
+
|
|
119
|
+
@pytest.fixture
|
|
120
|
+
def mock_db():
|
|
121
|
+
db = AsyncMock()
|
|
122
|
+
db.users.get.return_value = {"id": 1, "name": "Test"}
|
|
123
|
+
return db
|
|
124
|
+
|
|
125
|
+
@pytest.mark.asyncio
|
|
126
|
+
async def test_get_user(mock_db):
|
|
127
|
+
result = await get_user(1, db=mock_db)
|
|
128
|
+
assert result["name"] == "Test"
|
|
129
|
+
mock_db.users.get.assert_called_once_with(1)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Core Principles
|
|
133
|
+
|
|
134
|
+
### Readability First
|
|
135
|
+
Python prioritizes readability. Code should be obvious and easy to understand.
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
# Good: Clear and readable
|
|
139
|
+
def get_active_users(users: list[User]) -> list[User]:
|
|
140
|
+
"""Return only active users from the provided list."""
|
|
141
|
+
return [user for user in users if user.is_active]
|
|
142
|
+
|
|
143
|
+
# Bad: Clever but confusing
|
|
144
|
+
def get_active_users(u):
|
|
145
|
+
return [x for x in u if x.a]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### EAFP Over LBYL
|
|
149
|
+
Python prefers exception handling over checking conditions upfront.
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
# Good: EAFP style (Easier to Ask Forgiveness than Permission)
|
|
153
|
+
def get_value(dictionary: dict, key: str, default=None):
|
|
154
|
+
try:
|
|
155
|
+
return dictionary[key]
|
|
156
|
+
except KeyError:
|
|
157
|
+
return default
|
|
158
|
+
|
|
159
|
+
# Bad: LBYL (Look Before You Leap) style
|
|
160
|
+
def get_value(dictionary: dict, key: str, default=None):
|
|
161
|
+
if key in dictionary:
|
|
162
|
+
return dictionary[key]
|
|
163
|
+
return default
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Error Handling Patterns
|
|
167
|
+
|
|
168
|
+
### Specific Exception Handling
|
|
169
|
+
```python
|
|
170
|
+
# Good: Catch specific exceptions with chaining
|
|
171
|
+
def load_config(path: str) -> Config:
|
|
172
|
+
try:
|
|
173
|
+
with open(path) as f:
|
|
174
|
+
return Config.from_json(f.read())
|
|
175
|
+
except FileNotFoundError as e:
|
|
176
|
+
raise ConfigError(f"Config file not found: {path}") from e
|
|
177
|
+
except json.JSONDecodeError as e:
|
|
178
|
+
raise ConfigError(f"Invalid JSON in config: {path}") from e
|
|
179
|
+
|
|
180
|
+
# Bad: Bare except with silent failure
|
|
181
|
+
def load_config(path: str) -> Config:
|
|
182
|
+
try:
|
|
183
|
+
with open(path) as f:
|
|
184
|
+
return Config.from_json(f.read())
|
|
185
|
+
except:
|
|
186
|
+
return None
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Custom Exception Hierarchy
|
|
190
|
+
```python
|
|
191
|
+
class AppError(Exception):
|
|
192
|
+
"""Base exception for all application errors."""
|
|
193
|
+
|
|
194
|
+
class ValidationError(AppError):
|
|
195
|
+
"""Raised when input validation fails."""
|
|
196
|
+
|
|
197
|
+
class NotFoundError(AppError):
|
|
198
|
+
"""Raised when a requested resource is not found."""
|
|
199
|
+
|
|
200
|
+
def get_user(user_id: str) -> User:
|
|
201
|
+
user = db.find_user(user_id)
|
|
202
|
+
if not user:
|
|
203
|
+
raise NotFoundError(f"User not found: {user_id}")
|
|
204
|
+
return user
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Context Managers
|
|
208
|
+
|
|
209
|
+
```python
|
|
210
|
+
from contextlib import contextmanager
|
|
211
|
+
|
|
212
|
+
# Custom context manager for timing
|
|
213
|
+
@contextmanager
|
|
214
|
+
def timer(name: str):
|
|
215
|
+
start = time.perf_counter()
|
|
216
|
+
yield
|
|
217
|
+
elapsed = time.perf_counter() - start
|
|
218
|
+
print(f"{name} took {elapsed:.4f} seconds")
|
|
219
|
+
|
|
220
|
+
# Class-based context manager for transactions
|
|
221
|
+
class DatabaseTransaction:
|
|
222
|
+
def __init__(self, connection):
|
|
223
|
+
self.connection = connection
|
|
224
|
+
|
|
225
|
+
def __enter__(self):
|
|
226
|
+
self.connection.begin_transaction()
|
|
227
|
+
return self
|
|
228
|
+
|
|
229
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
230
|
+
if exc_type is None:
|
|
231
|
+
self.connection.commit()
|
|
232
|
+
else:
|
|
233
|
+
self.connection.rollback()
|
|
234
|
+
return False # Don't suppress exceptions
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Data Classes and Validation
|
|
238
|
+
|
|
239
|
+
```python
|
|
240
|
+
from dataclasses import dataclass, field
|
|
241
|
+
from datetime import datetime
|
|
242
|
+
|
|
243
|
+
@dataclass
|
|
244
|
+
class User:
|
|
245
|
+
id: str
|
|
246
|
+
name: str
|
|
247
|
+
email: str
|
|
248
|
+
created_at: datetime = field(default_factory=datetime.now)
|
|
249
|
+
is_active: bool = True
|
|
250
|
+
|
|
251
|
+
def __post_init__(self):
|
|
252
|
+
if "@" not in self.email:
|
|
253
|
+
raise ValueError(f"Invalid email: {self.email}")
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Decorators
|
|
257
|
+
|
|
258
|
+
```python
|
|
259
|
+
import functools
|
|
260
|
+
|
|
261
|
+
# Function decorator with wraps
|
|
262
|
+
def timer(func):
|
|
263
|
+
@functools.wraps(func)
|
|
264
|
+
def wrapper(*args, **kwargs):
|
|
265
|
+
start = time.perf_counter()
|
|
266
|
+
result = func(*args, **kwargs)
|
|
267
|
+
elapsed = time.perf_counter() - start
|
|
268
|
+
print(f"{func.__name__} took {elapsed:.4f}s")
|
|
269
|
+
return result
|
|
270
|
+
return wrapper
|
|
271
|
+
|
|
272
|
+
# Parameterized decorator
|
|
273
|
+
def retry(max_attempts: int = 3, delay: float = 1.0):
|
|
274
|
+
def decorator(func):
|
|
275
|
+
@functools.wraps(func)
|
|
276
|
+
def wrapper(*args, **kwargs):
|
|
277
|
+
for attempt in range(max_attempts):
|
|
278
|
+
try:
|
|
279
|
+
return func(*args, **kwargs)
|
|
280
|
+
except Exception as e:
|
|
281
|
+
if attempt == max_attempts - 1:
|
|
282
|
+
raise
|
|
283
|
+
time.sleep(delay * (2 ** attempt))
|
|
284
|
+
return wrapper
|
|
285
|
+
return decorator
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Comprehensions and Generators
|
|
289
|
+
|
|
290
|
+
```python
|
|
291
|
+
# List comprehensions for simple transforms
|
|
292
|
+
names = [user.name for user in users if user.is_active]
|
|
293
|
+
|
|
294
|
+
# Generator expressions for lazy evaluation (memory efficient)
|
|
295
|
+
total = sum(x * x for x in range(1_000_000))
|
|
296
|
+
|
|
297
|
+
# Generator functions for large data
|
|
298
|
+
def read_large_file(path: str) -> Iterator[str]:
|
|
299
|
+
with open(path) as f:
|
|
300
|
+
for line in f:
|
|
301
|
+
yield line.strip()
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Concurrency Patterns
|
|
305
|
+
|
|
306
|
+
```python
|
|
307
|
+
import concurrent.futures
|
|
308
|
+
|
|
309
|
+
# Threading for I/O-bound tasks
|
|
310
|
+
def fetch_all_urls(urls: list[str]) -> dict[str, str]:
|
|
311
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
|
|
312
|
+
future_to_url = {executor.submit(fetch_url, url): url for url in urls}
|
|
313
|
+
results = {}
|
|
314
|
+
for future in concurrent.futures.as_completed(future_to_url):
|
|
315
|
+
url = future_to_url[future]
|
|
316
|
+
try:
|
|
317
|
+
results[url] = future.result()
|
|
318
|
+
except Exception as e:
|
|
319
|
+
results[url] = f"Error: {e}"
|
|
320
|
+
return results
|
|
321
|
+
|
|
322
|
+
# Multiprocessing for CPU-bound tasks
|
|
323
|
+
def process_all(datasets: list[list[int]]) -> list[int]:
|
|
324
|
+
with concurrent.futures.ProcessPoolExecutor() as executor:
|
|
325
|
+
return list(executor.map(process_data, datasets))
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Memory and Performance
|
|
329
|
+
|
|
330
|
+
```python
|
|
331
|
+
# Use __slots__ for memory efficiency in many-instance classes
|
|
332
|
+
class Point:
|
|
333
|
+
__slots__ = ['x', 'y']
|
|
334
|
+
def __init__(self, x: float, y: float):
|
|
335
|
+
self.x = x
|
|
336
|
+
self.y = y
|
|
337
|
+
|
|
338
|
+
# Use join instead of concatenation in loops
|
|
339
|
+
result = "".join(str(item) for item in items) # O(n)
|
|
340
|
+
# NOT: result += str(item) # O(n²)
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
## Anti-Patterns to Avoid
|
|
344
|
+
|
|
345
|
+
```python
|
|
346
|
+
# Bad: Mutable default arguments
|
|
347
|
+
def append_to(item, items=[]): # Shared across calls!
|
|
348
|
+
items.append(item)
|
|
349
|
+
return items
|
|
350
|
+
# Good: Use None sentinel
|
|
351
|
+
def append_to(item, items=None):
|
|
352
|
+
if items is None:
|
|
353
|
+
items = []
|
|
354
|
+
items.append(item)
|
|
355
|
+
return items
|
|
356
|
+
|
|
357
|
+
# Bad: type(obj) == list → Good: isinstance(obj, list)
|
|
358
|
+
# Bad: value == None → Good: value is None
|
|
359
|
+
# Bad: from module import * → Good: from module import specific_name
|
|
360
|
+
# Bad: bare except: → Good: except SpecificError as e:
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
## Python Tooling
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Formatting and linting
|
|
367
|
+
ruff check . && ruff format .
|
|
368
|
+
mypy .
|
|
369
|
+
|
|
370
|
+
# Testing with coverage
|
|
371
|
+
pytest --cov=mypackage --cov-report=term-missing
|
|
372
|
+
|
|
373
|
+
# Security scanning
|
|
374
|
+
bandit -r .
|
|
375
|
+
pip-audit
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
## Best Practices
|
|
379
|
+
|
|
380
|
+
- Use `ruff` for linting and formatting
|
|
381
|
+
- Use `mypy` with strict mode
|
|
382
|
+
- Prefer `pathlib.Path` over `os.path`
|
|
383
|
+
- Use dataclasses or Pydantic for data structures
|
|
384
|
+
- Use `asyncio` for I/O-bound operations
|
|
385
|
+
- Use `contextlib.asynccontextmanager` for async resources
|
|
386
|
+
- Use Protocol classes for structural subtyping (duck typing)
|
|
387
|
+
- Prefer generators over lists for large datasets
|
|
388
|
+
- Follow import order: stdlib, third-party, local (use isort)
|