@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,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codebase-audit
|
|
3
|
+
context: fork
|
|
4
|
+
description: Systematic codebase audit methodology for unfamiliar codebases before architecture or implementation work. Use for new codebase, unfamiliar codebase, pre-implementation audit, codebase review, technical due diligence, or onboarding to an existing project. Produces AUDIT-FINDINGS.md and QUESTIONS.md. Routes to Architect, Planner, or Code Reviewer agents.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Codebase Audit Skill
|
|
8
|
+
|
|
9
|
+
Systematic 6-step audit for entering an unfamiliar codebase before architecture changes, major features, or refactoring. Do not guess patterns — audit first.
|
|
10
|
+
|
|
11
|
+
## 1. When to Apply This Skill
|
|
12
|
+
|
|
13
|
+
**Trigger conditions:**
|
|
14
|
+
- "I'm new to this codebase"
|
|
15
|
+
- "Audit this project before we start building"
|
|
16
|
+
- "I need to understand what's here before changing it"
|
|
17
|
+
- "Pre-implementation review"
|
|
18
|
+
- Any major feature in a codebase you haven't worked in this session
|
|
19
|
+
|
|
20
|
+
**Do not skip the audit** even when the task seems small — hidden coupling causes broken assumptions.
|
|
21
|
+
|
|
22
|
+
## 2. Audit Scope — 20 Areas
|
|
23
|
+
|
|
24
|
+
| # | Area | What to Look For |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| 1 | **Architecture** | Monolith/microservice/monorepo, layer separation, module boundaries |
|
|
27
|
+
| 2 | **Entry Points** | Main files, router setup, CLI entry, exports index |
|
|
28
|
+
| 3 | **Framework & Runtime** | React version, Next.js, FastAPI, Django, Node version, Python version |
|
|
29
|
+
| 4 | **Dependencies** | `package.json`/`pyproject.toml` — packages, versions, peer deps, outdated |
|
|
30
|
+
| 5 | **Code Quality** | Lint config, formatter, TypeScript strict mode, type coverage |
|
|
31
|
+
| 6 | **Testing** | Test runner, coverage %, which layers are tested, missing tests |
|
|
32
|
+
| 7 | **Security Posture** | Auth implementation, env var usage, hardcoded secrets, CORS |
|
|
33
|
+
| 8 | **Documentation** | README completeness, inline comments, API docs |
|
|
34
|
+
| 9 | **Performance Signals** | Caching, lazy loading, database indexes, N+1 queries |
|
|
35
|
+
| 10 | **DevOps / CI** | Build commands, CI config, deployment method, Dockerfile |
|
|
36
|
+
| 11 | **API Design** | REST conventions, versioning, error response format, input validation |
|
|
37
|
+
| 12 | **Data Layer** | ORM vs raw SQL, migration strategy, schema location |
|
|
38
|
+
| 13 | **State Management** | Client state (Zustand, Redux, Context), server state (React Query) |
|
|
39
|
+
| 14 | **Error Handling** | Global error boundary, unhandled promise rejections, logging |
|
|
40
|
+
| 15 | **Environment Config** | `.env.example`, `pydantic-settings`, config validation on startup |
|
|
41
|
+
| 16 | **Dead Code / Tech Debt** | TODOs, commented-out code, unused packages, deprecated calls |
|
|
42
|
+
| 17 | **Naming Conventions** | Consistent file/folder naming, component vs module patterns |
|
|
43
|
+
| 18 | **Shared Libraries** | Utility functions, hooks, services — shared vs duplicated |
|
|
44
|
+
| 19 | **Accessibility** | ARIA usage, keyboard nav, color contrast, skip-nav |
|
|
45
|
+
| 20 | **Observability** | Logging format, tracing, health endpoints, error reporting |
|
|
46
|
+
|
|
47
|
+
## 3. 6-Step Audit Method
|
|
48
|
+
|
|
49
|
+
### Step 1 — Map the Repository
|
|
50
|
+
```
|
|
51
|
+
actions:
|
|
52
|
+
- List top-level directories and understand intent of each
|
|
53
|
+
- Identify the project type (app, library, monorepo, microservice)
|
|
54
|
+
- Read README.md fully — note setup instructions, known issues
|
|
55
|
+
- Check for CONTRIBUTING.md, ARCHITECTURE.md, or ADR folders
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Step 2 — Find Entry Points
|
|
59
|
+
```
|
|
60
|
+
actions:
|
|
61
|
+
- Identify main application entry (main.py, app.py, src/index.ts, src/main.ts)
|
|
62
|
+
- Trace the request lifecycle from entry to response (1 complete path)
|
|
63
|
+
- Identify router/controller/handler layers
|
|
64
|
+
- Find test entry (jest.config.ts, vite.config.ts, pytest.ini/pyproject.toml)
|
|
65
|
+
- Find build entry (package.json scripts, Makefile, Dockerfile)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Step 3 — Dependencies and Versions
|
|
69
|
+
```
|
|
70
|
+
actions:
|
|
71
|
+
- Read package.json / pyproject.toml — note major dependencies and versions
|
|
72
|
+
- Check for deprecated or significantly outdated packages
|
|
73
|
+
- Identify direct vs transitive dependency conflicts
|
|
74
|
+
- Note peer dependency version mismatches
|
|
75
|
+
- Check for security advisories (mental note or npm audit / pip-audit)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Step 4 — Audit by Severity
|
|
79
|
+
```
|
|
80
|
+
For each area in §2, assign:
|
|
81
|
+
🔴 CRITICAL — Security vulnerability, data loss risk, broken functionality
|
|
82
|
+
🟡 WARNING — Performance issue, tech debt, missing validation
|
|
83
|
+
🟢 NOTE — Style inconsistency, minor improvement opportunity
|
|
84
|
+
⚪ OK — Meets expectations, no action needed
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Step 5 — Compile Questions
|
|
88
|
+
```
|
|
89
|
+
For every assumption or ambiguity discovered:
|
|
90
|
+
- Business context: "Why does X exist? Is it still needed?"
|
|
91
|
+
- Architecture: "Is this pattern intentional or historical?"
|
|
92
|
+
- Implementation: "Is there a newer pattern preferred for this?"
|
|
93
|
+
- Scope: "Which areas are off-limits for this change?"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Step 6 — Write Deliverables
|
|
97
|
+
Write two files in the project root (or `docs/` if it exists):
|
|
98
|
+
- `AUDIT-FINDINGS.md`
|
|
99
|
+
- `QUESTIONS.md`
|
|
100
|
+
|
|
101
|
+
## 4. Output Templates
|
|
102
|
+
|
|
103
|
+
### `AUDIT-FINDINGS.md`
|
|
104
|
+
```markdown
|
|
105
|
+
# Codebase Audit Findings
|
|
106
|
+
|
|
107
|
+
**Project**: [name]
|
|
108
|
+
**Audited**: [date]
|
|
109
|
+
**Scope**: [what was covered]
|
|
110
|
+
|
|
111
|
+
## Summary
|
|
112
|
+
[2–3 sentence high-level assessment]
|
|
113
|
+
|
|
114
|
+
## Critical Findings 🔴
|
|
115
|
+
|
|
116
|
+
### CRIT-001: [Title]
|
|
117
|
+
**File**: `path/to/file.ts` (line N)
|
|
118
|
+
**Issue**: [What is wrong and why]
|
|
119
|
+
**Risk**: [What can go wrong]
|
|
120
|
+
**Recommendation**: [Specific fix]
|
|
121
|
+
|
|
122
|
+
## Warnings 🟡
|
|
123
|
+
|
|
124
|
+
### WARN-001: [Title]
|
|
125
|
+
**File**: `path/to/file.py`
|
|
126
|
+
**Issue**: [What needs attention]
|
|
127
|
+
**Recommendation**: [Specific improvement]
|
|
128
|
+
|
|
129
|
+
## Notes 🟢
|
|
130
|
+
|
|
131
|
+
- [Minor observations, style, preferences]
|
|
132
|
+
|
|
133
|
+
## Architecture Overview
|
|
134
|
+
[Brief description of what was found — layers, patterns, notable design decisions]
|
|
135
|
+
|
|
136
|
+
## Scope for Current Task
|
|
137
|
+
Based on the requested change, these areas are in scope: …
|
|
138
|
+
These areas should NOT be touched: …
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### `QUESTIONS.md`
|
|
142
|
+
```markdown
|
|
143
|
+
# Pre-Implementation Questions
|
|
144
|
+
|
|
145
|
+
**For**: [next agent or human reviewer]
|
|
146
|
+
**Context**: [what we're about to build]
|
|
147
|
+
|
|
148
|
+
## Blocking Questions (must answer before code changes)
|
|
149
|
+
|
|
150
|
+
### Q1: [Question]
|
|
151
|
+
**Context**: [why this matters]
|
|
152
|
+
**Impact if wrong**: [what breaks]
|
|
153
|
+
|
|
154
|
+
### Q2: [Question]
|
|
155
|
+
|
|
156
|
+
## Advisory Questions (inform decisions but don't block)
|
|
157
|
+
|
|
158
|
+
### Q3: [Question]
|
|
159
|
+
|
|
160
|
+
## Assumptions Made
|
|
161
|
+
If we proceed without answers, these assumptions apply:
|
|
162
|
+
- [assumption 1]
|
|
163
|
+
- [assumption 2]
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## 5. Severity Tags
|
|
167
|
+
|
|
168
|
+
| Tag | Code | Meaning |
|
|
169
|
+
|---|---|---|
|
|
170
|
+
| 🔴 Critical | `CRIT-NNN` | Fix before any changes proceed |
|
|
171
|
+
| 🟡 Warning | `WARN-NNN` | Address in current or next sprint |
|
|
172
|
+
| 🟢 Note | `NOTE-NNN` | Backlog item or stylistic observation |
|
|
173
|
+
| ⚪ OK | — | No action needed |
|
|
174
|
+
|
|
175
|
+
## 6. Handoff Guidance
|
|
176
|
+
|
|
177
|
+
After completing the audit:
|
|
178
|
+
|
|
179
|
+
| Finding Type | Route To |
|
|
180
|
+
|---|---|
|
|
181
|
+
| Architecture redesign needed | `@Architect` — provide `AUDIT-FINDINGS.md` |
|
|
182
|
+
| Implementation can proceed with caution | `@Planner` — provide findings + questions |
|
|
183
|
+
| Major quality/security issues | `@Code-Reviewer` + `@Security-Analyst` |
|
|
184
|
+
| Only minor notes, clear path | Proceed directly with `@Implement` or `@Anchor` |
|
|
185
|
+
|
|
186
|
+
### Prompt template for handoff:
|
|
187
|
+
```
|
|
188
|
+
@[Agent]: I've completed a codebase audit.
|
|
189
|
+
Findings: [link or inline AUDIT-FINDINGS.md]
|
|
190
|
+
Blocking questions: [key Q from QUESTIONS.md]
|
|
191
|
+
The task is: [original task description]
|
|
192
|
+
Please [design solution / create plan / review / implement] with these findings in mind.
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## 7. Checklist
|
|
196
|
+
|
|
197
|
+
- [ ] README.md read fully
|
|
198
|
+
- [ ] Entry point traced end-to-end (one complete request/render cycle)
|
|
199
|
+
- [ ] All 20 audit areas assessed (even if just ⚪ OK)
|
|
200
|
+
- [ ] Critical findings have file + line citation
|
|
201
|
+
- [ ] `AUDIT-FINDINGS.md` written to disk
|
|
202
|
+
- [ ] `QUESTIONS.md` written to disk
|
|
203
|
+
- [ ] Blocking questions identified separately
|
|
204
|
+
- [ ] Agent handoff prompt prepared
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dashboard-perf-sweep
|
|
3
|
+
context: fork
|
|
4
|
+
description: Re-measure an app's dashboard/API endpoints for load-time regressions and decide, with a documented checklist (not a black-box verdict), whether a slow one is a candidate for the rs-kit summary-table refresher pattern — or needs an index, keyset paging, gzip, or nothing at all. Use when the user says "sweep dashboard performance", "check if this app needs rs-kit", "re-measure the perf tracker", "is this endpoint a refresher candidate", or when a dashboard-performance-tracker.md is stale and needs re-validating. Read-only by default (dev servers only; prod requires an explicit opt-in and human confirmation) and human-invoked, never scheduled -- it surfaces candidates, it does not enroll them.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# dashboard-perf-sweep — re-measure, then judge the shape, not just the time
|
|
8
|
+
|
|
9
|
+
Today an app "earns" the rs-kit refresher pattern only when someone happens to be doing unrelated
|
|
10
|
+
work on it, hits a slow page, and measures it properly. That worked for a couple of apps in the
|
|
11
|
+
fleet, but a snapshot measurement goes stale — a page added last month, or a table that crossed a
|
|
12
|
+
growth threshold since, has no mechanism to surface itself. This skill re-measures on demand.
|
|
13
|
+
|
|
14
|
+
**What already exists and must NOT be rebuilt:** every app in the fleet has its own
|
|
15
|
+
`.caddis/kb/dashboard-performance-tracker.md` with real baseline measurements. The gap this closes
|
|
16
|
+
is **re-measurement and re-judgment**, not first-time discovery.
|
|
17
|
+
|
|
18
|
+
## Explicit scope guardrails — do not relax without a new conversation
|
|
19
|
+
|
|
20
|
+
- **Read-only except the final tracker update.** No code changes, no schema changes, ever. The only
|
|
21
|
+
write this skill makes is a diffable update to the target app's own `dashboard-performance-tracker.md`.
|
|
22
|
+
- **Dev by default.** Measuring against prod requires an explicit opt-in flag from the user AND, per
|
|
23
|
+
this project's convention for risky/hard-to-reverse actions, confirmation before hitting a live
|
|
24
|
+
service.
|
|
25
|
+
- **Human-invoked, not scheduled.** Run this when a person chooses to — never wire it into a cron job
|
|
26
|
+
or background automation. It surfaces candidates; it does not enroll them.
|
|
27
|
+
- **rs-kit is one of several possible recommendations, never the only output.** The checklist below
|
|
28
|
+
must be able to conclude "needs an index," "needs keyset paging," "needs gzip/trimmed fields,"
|
|
29
|
+
"not currently a candidate" — recommending rs-kit only for the specific aggregation shape.
|
|
30
|
+
|
|
31
|
+
## The decision model — two gates, not one number
|
|
32
|
+
|
|
33
|
+
**Gate 1 — time (mechanical).** `DASHBOARD-PERFORMANCE-STANDARD.md` Rule 6: the first, uncached load
|
|
34
|
+
of any dashboard endpoint must finish in **under ~1 second**. The harness script below applies this
|
|
35
|
+
gate automatically per endpoint. Passing gate 1 does **not** mean rs-kit — it just means "look closer."
|
|
36
|
+
|
|
37
|
+
**Gate 2 — shape (judgment, applied by you the agent, never automated).** rs-kit fixes exactly one
|
|
38
|
+
shape: a query that recomputes `O(all rows ever stored)` per request, against data that keeps
|
|
39
|
+
growing. Time alone is not sufficient evidence — the fleet's own history proves it:
|
|
40
|
+
|
|
41
|
+
| App | Cold time | Root cause | rs-kit? |
|
|
42
|
+
|---|---|---|---|
|
|
43
|
+
| App A | worst >60s, 5 real breaches | recurring full-table aggregation | **YES** |
|
|
44
|
+
| App B (pre-fix) | 14s–60s+ across several endpoints | recurring full-table aggregation | **YES** |
|
|
45
|
+
| App C | 10.3s | a single ~158MB LOB payload on 9.1k rows, not aggregation | **NO** — SQL aggregate + gzip |
|
|
46
|
+
| App D | 1.9s | cold JSON parse, no DB at all in prod | **NO** — warm the provider |
|
|
47
|
+
| App E | 202ms | n/a — never crossed gate 1 | **NO** |
|
|
48
|
+
|
|
49
|
+
A naive "slow ⇒ recommend rs-kit" tool would have wrongly flagged App C and App D. That already
|
|
50
|
+
happened once before the shape distinction was made explicit — don't repeat it.
|
|
51
|
+
|
|
52
|
+
## Step 1 — build the endpoint list for this app
|
|
53
|
+
|
|
54
|
+
The tracker files are semi-structured (page names + backtick route fragments in a markdown table),
|
|
55
|
+
not a clean machine-parseable list — extract the list yourself, per app, each run:
|
|
56
|
+
|
|
57
|
+
1. Read the target app's `.caddis/kb/dashboard-performance-tracker.md` — pull every "Page / endpoint"
|
|
58
|
+
entry, in particular anything marked ⏳ pending or not re-measured recently.
|
|
59
|
+
2. If the app has a `UI_PAGE_GUIDE.md` (check root and `docs/reference/`), cross-check it for pages
|
|
60
|
+
**not yet in the tracker** — this is what catches drift, not just re-running the same old list. Not
|
|
61
|
+
every app has one; if it's missing, say so explicitly rather than silently only using the tracker.
|
|
62
|
+
3. Write the result as a JSON file matching the harness's input shape:
|
|
63
|
+
```json
|
|
64
|
+
[
|
|
65
|
+
{"name": "Historical Trends chart", "method": "GET", "path": "/api/trends/daily"},
|
|
66
|
+
{"name": "IW grid", "method": "POST", "path": "/raworkbench/investigation/query", "json": {}}
|
|
67
|
+
]
|
|
68
|
+
```
|
|
69
|
+
4. Confirm with the user (or the app's own `run`/`webapp-testing` conventions) how to reach the dev
|
|
70
|
+
instance safely, and what auth the endpoints need (open / token / session cookie) — pass it via
|
|
71
|
+
`--header`.
|
|
72
|
+
|
|
73
|
+
## Step 2 — start the dev server, then run the harness
|
|
74
|
+
|
|
75
|
+
Use the app's own `run` skill/convention to start it — this skill does not start dev servers itself,
|
|
76
|
+
only measures an already-reachable URL.
|
|
77
|
+
|
|
78
|
+
**Use `127.0.0.1`, never the hostname `localhost`, in `--base-url`.** On Windows, Python's `urllib`
|
|
79
|
+
resolves `localhost` dual-stack (tries IPv6 `::1` first) and can add a **spurious, rock-steady
|
|
80
|
+
~1000ms** to every single request — cold *and* warm, on every endpoint including the framework's own
|
|
81
|
+
static docs page. It looks exactly like a real, uniform perf problem (equal cold/warm, present on
|
|
82
|
+
trivial routes too) and is not one. This cost real time during this skill's own validation (§
|
|
83
|
+
Validating below) before `127.0.0.1` was substituted and the true numbers — sub-15ms — appeared. If a
|
|
84
|
+
sweep ever comes back with a suspiciously uniform floor across unrelated endpoints, first time a
|
|
85
|
+
`/docs` or `/openapi.json` route on the same base URL before trusting the data.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
python <skill-dir>/scripts/perf_sweep.py --base-url http://127.0.0.1:<port> --endpoints endpoints.json
|
|
89
|
+
python <skill-dir>/scripts/perf_sweep.py --base-url http://127.0.0.1:<port> --endpoints endpoints.json \
|
|
90
|
+
--header "Cookie: session=..." --output report.json
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Cold = first request after the dev server's fresh start (or right after a cache-bust if it can't be
|
|
94
|
+
restarted cheaply); warm = the immediate second request. The report flags gate-1 breaches and prints
|
|
95
|
+
the cold/warm ratio — a big ratio with no cache in between already points at a query-shape problem,
|
|
96
|
+
not a cache-TTL one. **A page that errors or times out is a finding, not a script failure** — it's
|
|
97
|
+
printed as `[ERROR]`, never silently dropped.
|
|
98
|
+
|
|
99
|
+
## Step 3 — apply the gate-2 checklist to every gate-1 breach
|
|
100
|
+
|
|
101
|
+
Force these questions, in order, for each slow endpoint — don't skip to a verdict:
|
|
102
|
+
|
|
103
|
+
1. **Does response size explain most of the time** (large payload, not a slow query)? → not rs-kit;
|
|
104
|
+
recommend trimming fields / gzip / virtualization.
|
|
105
|
+
2. **Is the slow part parsing/serialization, not the DB round-trip?** → not rs-kit; recommend
|
|
106
|
+
caching/warming the parsed form (App D precedent).
|
|
107
|
+
3. **Does the query scale with total stored rows rather than the response size** — read the actual
|
|
108
|
+
SQL/query plan, not just the timing — **and is the same aggregation recomputed per request on data
|
|
109
|
+
that keeps growing?** → candidate for rs-kit.
|
|
110
|
+
4. **Is it slow only at deep pagination (OFFSET)?** → not rs-kit; recommend keyset paging
|
|
111
|
+
(`exception_id`-style cursor, App B precedent).
|
|
112
|
+
5. **Is a specific WHERE clause unseekable** (function-wrapped column, NVARCHAR/VARCHAR param
|
|
113
|
+
mismatch)? → not rs-kit; recommend an index or a param-type fix.
|
|
114
|
+
|
|
115
|
+
Link findings to real fleet precedent (the table above, the `nvarchar-param-varchar-column-scan`
|
|
116
|
+
pattern, the keyset-paging work) rather than describing fixes in the abstract — every category here
|
|
117
|
+
has already been solved once in this fleet.
|
|
118
|
+
|
|
119
|
+
## Step 4 — update the tracker, diffably
|
|
120
|
+
|
|
121
|
+
Update the target app's own `dashboard-performance-tracker.md` in place with the new measurements and
|
|
122
|
+
verdicts, so drift becomes visible over time in the diff. Never silently overwrite it without the user
|
|
123
|
+
being able to see a before/after. Print a summary alongside the file edit.
|
|
124
|
+
|
|
125
|
+
## Validating this skill against known ground truth
|
|
126
|
+
|
|
127
|
+
Before trusting a new app's output, or after changing the checklist, run the sweep against two
|
|
128
|
+
already-known apps in your fleet and confirm it reproduces the **already-established, human-verified**
|
|
129
|
+
conclusion for each: one that's genuinely fast (should conclude "not a candidate") and one with a
|
|
130
|
+
known aggregation breach (should conclude "aggregation-shaped, rs-kit candidate" for the pages
|
|
131
|
+
already identified). If the output disagrees with the known-good conclusion for either, that's a
|
|
132
|
+
checklist bug — fix the checklist, don't rationalize the disagreement away.
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Cold/warm HTTP timing harness for the dashboard-perf-sweep skill.
|
|
3
|
+
|
|
4
|
+
Given a base URL and a list of endpoints, measures a COLD request (first hit) and a WARM
|
|
5
|
+
request (immediately after) per endpoint, safely: a timeout or connection error on one endpoint
|
|
6
|
+
is recorded as a finding, never a crash of the whole sweep (DASHBOARD-PERFORMANCE-STANDARD.md
|
|
7
|
+
Rule 6 gate-1 mechanics; the huge cold/warm gap without a cache in between is itself diagnostic
|
|
8
|
+
of a query-shape problem, not a cache-TTL one).
|
|
9
|
+
|
|
10
|
+
This harness does NOT start dev servers or know anything about a specific app -- that's the
|
|
11
|
+
`run` skill's job. It only measures a URL that is already reachable. stdlib-only (urllib), no
|
|
12
|
+
install, matching the other caddis tool scripts (oss_review.py etc.).
|
|
13
|
+
|
|
14
|
+
CLI:
|
|
15
|
+
python perf_sweep.py --base-url http://localhost:8000 --endpoints endpoints.json
|
|
16
|
+
python perf_sweep.py --base-url http://localhost:8000 --endpoints endpoints.json --output report.json
|
|
17
|
+
python perf_sweep.py --base-url http://localhost:8000 --endpoints endpoints.json --gate1-seconds 1.0
|
|
18
|
+
|
|
19
|
+
endpoints.json shape (a JSON list):
|
|
20
|
+
[
|
|
21
|
+
{"name": "Historical Trends chart", "method": "GET", "path": "/api/trends/daily"},
|
|
22
|
+
{"name": "IW grid", "method": "POST", "path": "/raworkbench/investigation/query",
|
|
23
|
+
"json": {"filters": {}}, "headers": {"Authorization": "Bearer ..."}}
|
|
24
|
+
]
|
|
25
|
+
"""
|
|
26
|
+
from __future__ import annotations
|
|
27
|
+
|
|
28
|
+
import argparse
|
|
29
|
+
import json
|
|
30
|
+
import sys
|
|
31
|
+
import time
|
|
32
|
+
import urllib.error
|
|
33
|
+
import urllib.request
|
|
34
|
+
from dataclasses import asdict, dataclass, field
|
|
35
|
+
from typing import Any
|
|
36
|
+
|
|
37
|
+
DEFAULT_TIMEOUT_SECONDS = 30.0
|
|
38
|
+
DEFAULT_GATE1_SECONDS = 1.0 # DASHBOARD-PERFORMANCE-STANDARD.md Rule 6
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass
|
|
42
|
+
class RequestResult:
|
|
43
|
+
ok: bool
|
|
44
|
+
status: int | None = None
|
|
45
|
+
elapsed_ms: float | None = None
|
|
46
|
+
error: str | None = None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@dataclass
|
|
50
|
+
class EndpointResult:
|
|
51
|
+
name: str
|
|
52
|
+
method: str
|
|
53
|
+
path: str
|
|
54
|
+
cold: RequestResult
|
|
55
|
+
warm: RequestResult | None = None
|
|
56
|
+
gate1_breach: bool = False
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@dataclass
|
|
60
|
+
class SweepReport:
|
|
61
|
+
base_url: str
|
|
62
|
+
gate1_seconds: float
|
|
63
|
+
endpoints: list[EndpointResult] = field(default_factory=list)
|
|
64
|
+
|
|
65
|
+
def to_dict(self) -> dict[str, Any]:
|
|
66
|
+
return {
|
|
67
|
+
"base_url": self.base_url,
|
|
68
|
+
"gate1_seconds": self.gate1_seconds,
|
|
69
|
+
"endpoints": [
|
|
70
|
+
{
|
|
71
|
+
"name": e.name,
|
|
72
|
+
"method": e.method,
|
|
73
|
+
"path": e.path,
|
|
74
|
+
"cold": asdict(e.cold),
|
|
75
|
+
"warm": asdict(e.warm) if e.warm else None,
|
|
76
|
+
"gate1_breach": e.gate1_breach,
|
|
77
|
+
}
|
|
78
|
+
for e in self.endpoints
|
|
79
|
+
],
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _do_request(
|
|
84
|
+
url: str,
|
|
85
|
+
method: str,
|
|
86
|
+
*,
|
|
87
|
+
json_body: dict[str, Any] | None = None,
|
|
88
|
+
headers: dict[str, str] | None = None,
|
|
89
|
+
timeout: float = DEFAULT_TIMEOUT_SECONDS,
|
|
90
|
+
) -> RequestResult:
|
|
91
|
+
"""One timed HTTP request. Never raises -- a timeout/connection/HTTP error becomes a
|
|
92
|
+
RequestResult with ok=False and a human-readable error, which is itself a sweep finding."""
|
|
93
|
+
data = None
|
|
94
|
+
req_headers = dict(headers or {})
|
|
95
|
+
if json_body is not None:
|
|
96
|
+
data = json.dumps(json_body).encode("utf-8")
|
|
97
|
+
req_headers.setdefault("Content-Type", "application/json")
|
|
98
|
+
|
|
99
|
+
req = urllib.request.Request(url, data=data, headers=req_headers, method=method)
|
|
100
|
+
start = time.perf_counter()
|
|
101
|
+
try:
|
|
102
|
+
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
|
103
|
+
resp.read()
|
|
104
|
+
elapsed_ms = (time.perf_counter() - start) * 1000.0
|
|
105
|
+
return RequestResult(ok=True, status=resp.status, elapsed_ms=elapsed_ms)
|
|
106
|
+
except urllib.error.HTTPError as exc:
|
|
107
|
+
# An HTTP error status still completed a round trip -- timing is a real finding.
|
|
108
|
+
elapsed_ms = (time.perf_counter() - start) * 1000.0
|
|
109
|
+
return RequestResult(ok=False, status=exc.code, elapsed_ms=elapsed_ms, error=f"HTTP {exc.code}")
|
|
110
|
+
except urllib.error.URLError as exc:
|
|
111
|
+
elapsed_ms = (time.perf_counter() - start) * 1000.0
|
|
112
|
+
return RequestResult(ok=False, elapsed_ms=elapsed_ms, error=f"connection error: {exc.reason}")
|
|
113
|
+
except TimeoutError:
|
|
114
|
+
elapsed_ms = (time.perf_counter() - start) * 1000.0
|
|
115
|
+
return RequestResult(ok=False, elapsed_ms=elapsed_ms, error=f"timeout after {timeout}s")
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def sweep_endpoint(
|
|
119
|
+
base_url: str,
|
|
120
|
+
endpoint: dict[str, Any],
|
|
121
|
+
*,
|
|
122
|
+
timeout: float = DEFAULT_TIMEOUT_SECONDS,
|
|
123
|
+
gate1_seconds: float = DEFAULT_GATE1_SECONDS,
|
|
124
|
+
warm: bool = True,
|
|
125
|
+
extra_headers: dict[str, str] | None = None,
|
|
126
|
+
) -> EndpointResult:
|
|
127
|
+
method = endpoint.get("method", "GET").upper()
|
|
128
|
+
path = endpoint["path"]
|
|
129
|
+
url = base_url.rstrip("/") + path
|
|
130
|
+
headers = dict(extra_headers or {})
|
|
131
|
+
headers.update(endpoint.get("headers", {}))
|
|
132
|
+
json_body = endpoint.get("json")
|
|
133
|
+
|
|
134
|
+
cold = _do_request(url, method, json_body=json_body, headers=headers, timeout=timeout)
|
|
135
|
+
warm_result = None
|
|
136
|
+
if warm:
|
|
137
|
+
warm_result = _do_request(url, method, json_body=json_body, headers=headers, timeout=timeout)
|
|
138
|
+
|
|
139
|
+
gate1_breach = bool(cold.ok and cold.elapsed_ms is not None and cold.elapsed_ms / 1000.0 > gate1_seconds)
|
|
140
|
+
return EndpointResult(
|
|
141
|
+
name=endpoint.get("name", path),
|
|
142
|
+
method=method,
|
|
143
|
+
path=path,
|
|
144
|
+
cold=cold,
|
|
145
|
+
warm=warm_result,
|
|
146
|
+
gate1_breach=gate1_breach,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def sweep(
|
|
151
|
+
base_url: str,
|
|
152
|
+
endpoints: list[dict[str, Any]],
|
|
153
|
+
*,
|
|
154
|
+
timeout: float = DEFAULT_TIMEOUT_SECONDS,
|
|
155
|
+
gate1_seconds: float = DEFAULT_GATE1_SECONDS,
|
|
156
|
+
warm: bool = True,
|
|
157
|
+
extra_headers: dict[str, str] | None = None,
|
|
158
|
+
) -> SweepReport:
|
|
159
|
+
report = SweepReport(base_url=base_url, gate1_seconds=gate1_seconds)
|
|
160
|
+
for endpoint in endpoints:
|
|
161
|
+
report.endpoints.append(
|
|
162
|
+
sweep_endpoint(
|
|
163
|
+
base_url,
|
|
164
|
+
endpoint,
|
|
165
|
+
timeout=timeout,
|
|
166
|
+
gate1_seconds=gate1_seconds,
|
|
167
|
+
warm=warm,
|
|
168
|
+
extra_headers=extra_headers,
|
|
169
|
+
)
|
|
170
|
+
)
|
|
171
|
+
return report
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def format_report(report: SweepReport) -> str:
|
|
175
|
+
lines = [f"Sweep: {report.base_url} (gate 1 = {report.gate1_seconds}s cold, uncached)", ""]
|
|
176
|
+
for e in report.endpoints:
|
|
177
|
+
if not e.cold.ok:
|
|
178
|
+
lines.append(f" [ERROR] {e.method:5s} {e.path:45s} {e.cold.error}")
|
|
179
|
+
continue
|
|
180
|
+
flag = "SLOW " if e.gate1_breach else " "
|
|
181
|
+
cold_s = f"{e.cold.elapsed_ms:8.1f}ms"
|
|
182
|
+
warm_s = f"{e.warm.elapsed_ms:8.1f}ms" if e.warm and e.warm.ok else "n/a"
|
|
183
|
+
gap = ""
|
|
184
|
+
if e.warm and e.warm.ok and e.cold.elapsed_ms and e.warm.elapsed_ms:
|
|
185
|
+
ratio = e.cold.elapsed_ms / max(e.warm.elapsed_ms, 0.01)
|
|
186
|
+
if ratio > 3:
|
|
187
|
+
gap = f" (cold/warm {ratio:.1f}x -- likely query-shape, not cache-TTL)"
|
|
188
|
+
lines.append(f" {flag}{e.method:5s} {e.path:45s} cold={cold_s} warm={warm_s}{gap}")
|
|
189
|
+
breaches = [e for e in report.endpoints if e.gate1_breach]
|
|
190
|
+
errors = [e for e in report.endpoints if not e.cold.ok]
|
|
191
|
+
problems = breaches + errors
|
|
192
|
+
lines.append("")
|
|
193
|
+
lines.append(
|
|
194
|
+
f"{len(problems)}/{len(report.endpoints)} endpoint(s) have a problem "
|
|
195
|
+
f"({len(breaches)} slow, {len(errors)} errored/timed out -- a timeout is a WORSE "
|
|
196
|
+
f"signal than a gate-1 breach, not a lesser one)."
|
|
197
|
+
)
|
|
198
|
+
if problems:
|
|
199
|
+
lines.append("Not itself a rs-kit verdict -- apply the shape checklist (SKILL.md) next.")
|
|
200
|
+
return "\n".join(lines)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def _parse_header(value: str) -> tuple[str, str]:
|
|
204
|
+
if ":" not in value:
|
|
205
|
+
raise argparse.ArgumentTypeError(f"--header must be 'Key: Value', got {value!r}")
|
|
206
|
+
key, _, val = value.partition(":")
|
|
207
|
+
return key.strip(), val.strip()
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def main(argv: list[str] | None = None) -> int:
|
|
211
|
+
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
212
|
+
parser.add_argument("--base-url", required=True, help="e.g. http://localhost:8703")
|
|
213
|
+
parser.add_argument("--endpoints", required=True, help="path to a JSON file (see module docstring)")
|
|
214
|
+
parser.add_argument("--timeout", type=float, default=DEFAULT_TIMEOUT_SECONDS)
|
|
215
|
+
parser.add_argument("--gate1-seconds", type=float, default=DEFAULT_GATE1_SECONDS)
|
|
216
|
+
parser.add_argument("--no-warm", action="store_true", help="skip the warm (second) request")
|
|
217
|
+
parser.add_argument("--header", action="append", default=[], type=_parse_header,
|
|
218
|
+
help="extra header applied to every request, repeatable: --header 'Cookie: session=...'")
|
|
219
|
+
parser.add_argument("--output", help="also write the JSON report to this path")
|
|
220
|
+
args = parser.parse_args(argv)
|
|
221
|
+
|
|
222
|
+
with open(args.endpoints, encoding="utf-8") as f:
|
|
223
|
+
endpoints = json.load(f)
|
|
224
|
+
if not isinstance(endpoints, list):
|
|
225
|
+
print(f"[FAIL] {args.endpoints} must contain a JSON list of endpoint objects", file=sys.stderr)
|
|
226
|
+
return 2
|
|
227
|
+
|
|
228
|
+
report = sweep(
|
|
229
|
+
args.base_url,
|
|
230
|
+
endpoints,
|
|
231
|
+
timeout=args.timeout,
|
|
232
|
+
gate1_seconds=args.gate1_seconds,
|
|
233
|
+
warm=not args.no_warm,
|
|
234
|
+
extra_headers=dict(args.header),
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
print(format_report(report))
|
|
238
|
+
if args.output:
|
|
239
|
+
with open(args.output, "w", encoding="utf-8") as f:
|
|
240
|
+
json.dump(report.to_dict(), f, indent=2)
|
|
241
|
+
print(f"\nWrote {args.output}")
|
|
242
|
+
|
|
243
|
+
breaches = [e for e in report.endpoints if e.gate1_breach]
|
|
244
|
+
errors = [e for e in report.endpoints if not e.cold.ok]
|
|
245
|
+
return 1 if (breaches or errors) else 0
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
if __name__ == "__main__":
|
|
249
|
+
raise SystemExit(main())
|