@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.
- package/bundles/antigravity-plugin/agents/claude-md-curator.md +1 -1
- package/bundles/antigravity-plugin/agents/knowledge-transfer.md +17 -32
- package/bundles/antigravity-plugin/caddis_statusline.py +825 -0
- package/bundles/antigravity-plugin/claude-md/folder-agents.md.tmpl +21 -0
- package/bundles/antigravity-plugin/guard_agy.py +60 -9
- package/bundles/antigravity-plugin/plugin.json +1 -1
- package/bundles/antigravity-plugin/scripts/caddis_gate.py +524 -0
- package/bundles/antigravity-plugin/scripts/caddis_inventory.py +439 -0
- package/bundles/antigravity-plugin/scripts/caddis_migrate_dir.py +270 -0
- package/bundles/antigravity-plugin/scripts/caddis_spawn.py +300 -0
- package/bundles/antigravity-plugin/scripts/caddis_statusline.py +825 -0
- package/bundles/antigravity-plugin/scripts/caddis_tidy.py +366 -0
- package/bundles/antigravity-plugin/scripts/check_doc_coverage.py +924 -0
- package/bundles/antigravity-plugin/scripts/claude-deepseek.ps1 +4 -0
- package/bundles/antigravity-plugin/scripts/claude-deepseek.sh +3 -0
- package/bundles/antigravity-plugin/scripts/claude-glm.ps1 +4 -0
- package/bundles/antigravity-plugin/scripts/claude-glm.sh +3 -0
- package/bundles/antigravity-plugin/scripts/claude-oss.ps1 +64 -0
- package/bundles/antigravity-plugin/scripts/claude-oss.sh +60 -0
- package/bundles/antigravity-plugin/scripts/claudster_config.py +121 -0
- package/bundles/antigravity-plugin/scripts/claudster_doctor.py +356 -0
- package/bundles/antigravity-plugin/scripts/claudster_init.py +400 -0
- package/bundles/antigravity-plugin/scripts/claudster_migrate_rules.py +300 -0
- package/bundles/antigravity-plugin/scripts/enforcement_inventory.py +261 -0
- package/bundles/antigravity-plugin/scripts/hook_log.py +156 -0
- package/bundles/antigravity-plugin/scripts/new-machine.ps1 +170 -0
- package/bundles/antigravity-plugin/scripts/oss_ask.py +98 -0
- package/bundles/antigravity-plugin/scripts/oss_model.py +174 -0
- package/bundles/antigravity-plugin/scripts/oss_review.py +718 -0
- package/bundles/antigravity-plugin/scripts/setup_project_ai.py +1432 -0
- package/bundles/antigravity-plugin/scripts/usage_review.py +1323 -0
- package/bundles/antigravity-plugin/session_end_agy.py +52 -8
- package/bundles/antigravity-plugin/skills/_registry.md +1 -0
- 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/fastapi-dev/SKILL.md +1 -1
- 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/ship/SKILL.md +1 -1
- package/bundles/antigravity-plugin/skills/ship-merge/SKILL.md +1 -1
- package/bundles/antigravity-plugin/skills/ship-pr/SKILL.md +1 -1
- package/bundles/antigravity-plugin/skills/statusline/SKILL.md +105 -0
- package/bundles/antigravity-plugin/skills/use-model/SKILL.md +15 -3
- package/bundles/antigravity-plugin/skills/validate-phase/SKILL.md +31 -0
- package/bundles/antigravity-plugin/warm_start_agy.py +117 -11
- package/bundles/antigravity-plugin-extras/plugin.json +1 -1
- package/bundles/antigravity-plugin-extras/skills/architecture-design/SKILL.md +1 -1
- package/bundles/antigravity-plugin-extras/skills/caching-patterns/SKILL.md +1 -1
- package/bundles/antigravity-plugin-extras/skills/webapp-development/SKILL.md +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 +544 -0
- package/dist/claude-glm.js +544 -0
- package/dist/claude-oss.js +544 -0
- package/dist/cli.js +542 -90
- package/package.json +5 -2
- package/bundles/antigravity-plugin/statusline-command-agy.sh +0 -91
- 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,418 @@
|
|
|
1
|
+
# Mermaid Diagram Workflows
|
|
2
|
+
|
|
3
|
+
Step-by-step examples for common diagramming tasks.
|
|
4
|
+
|
|
5
|
+
## Workflow 1: Document a New API Endpoint
|
|
6
|
+
|
|
7
|
+
**When:** You've built a new API endpoint and need to document the flow for frontend developers.
|
|
8
|
+
|
|
9
|
+
**Steps:**
|
|
10
|
+
|
|
11
|
+
1. **Choose diagram type:** Sequence diagram (shows temporal interactions)
|
|
12
|
+
|
|
13
|
+
2. **Identify participants:**
|
|
14
|
+
```mermaid
|
|
15
|
+
sequenceDiagram
|
|
16
|
+
participant Client
|
|
17
|
+
participant API
|
|
18
|
+
participant Database
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. **Add the happy path:**
|
|
22
|
+
```mermaid
|
|
23
|
+
sequenceDiagram
|
|
24
|
+
participant Client
|
|
25
|
+
participant API
|
|
26
|
+
participant Database
|
|
27
|
+
|
|
28
|
+
Client->>API: POST /users
|
|
29
|
+
API->>Database: INSERT user
|
|
30
|
+
Database-->>API: Return user_id
|
|
31
|
+
API-->>Client: 201 Created + user object
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
4. **Add error handling:**
|
|
35
|
+
```mermaid
|
|
36
|
+
sequenceDiagram
|
|
37
|
+
participant Client
|
|
38
|
+
participant API
|
|
39
|
+
participant Database
|
|
40
|
+
|
|
41
|
+
Client->>API: POST /users
|
|
42
|
+
API->>API: Validate input
|
|
43
|
+
alt Valid input
|
|
44
|
+
API->>Database: INSERT user
|
|
45
|
+
Database-->>API: Return user_id
|
|
46
|
+
API-->>Client: 201 Created + user object
|
|
47
|
+
else Invalid input
|
|
48
|
+
API-->>Client: 400 Bad Request + errors
|
|
49
|
+
else Duplicate email
|
|
50
|
+
Database-->>API: Constraint violation
|
|
51
|
+
API-->>Client: 409 Conflict
|
|
52
|
+
end
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
5. **Add notes for clarification:**
|
|
56
|
+
```mermaid
|
|
57
|
+
sequenceDiagram
|
|
58
|
+
participant Client
|
|
59
|
+
participant API
|
|
60
|
+
participant Database
|
|
61
|
+
|
|
62
|
+
Note over Client,Database: User Registration Flow
|
|
63
|
+
|
|
64
|
+
Client->>API: POST /users
|
|
65
|
+
Note right of API: Validates email format,<br/>password strength
|
|
66
|
+
|
|
67
|
+
alt Valid input
|
|
68
|
+
API->>Database: INSERT user
|
|
69
|
+
Database-->>API: Return user_id
|
|
70
|
+
Note left of Database: Email must be unique
|
|
71
|
+
API-->>Client: 201 Created + user object
|
|
72
|
+
else Invalid input
|
|
73
|
+
API-->>Client: 400 Bad Request
|
|
74
|
+
end
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Workflow 2: Design a Database Schema
|
|
78
|
+
|
|
79
|
+
**When:** You're planning a new feature that needs new tables.
|
|
80
|
+
|
|
81
|
+
**Steps:**
|
|
82
|
+
|
|
83
|
+
1. **Identify core entities:**
|
|
84
|
+
```mermaid
|
|
85
|
+
erDiagram
|
|
86
|
+
USER
|
|
87
|
+
ORDER
|
|
88
|
+
PRODUCT
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
2. **Define relationships:**
|
|
92
|
+
```mermaid
|
|
93
|
+
erDiagram
|
|
94
|
+
USER ||--o{ ORDER : places
|
|
95
|
+
ORDER ||--|{ LINE_ITEM : contains
|
|
96
|
+
PRODUCT ||--o{ LINE_ITEM : includes
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
3. **Add attributes:**
|
|
100
|
+
```mermaid
|
|
101
|
+
erDiagram
|
|
102
|
+
USER ||--o{ ORDER : places
|
|
103
|
+
ORDER ||--|{ LINE_ITEM : contains
|
|
104
|
+
PRODUCT ||--o{ LINE_ITEM : includes
|
|
105
|
+
|
|
106
|
+
USER {
|
|
107
|
+
int id PK
|
|
108
|
+
string email UK
|
|
109
|
+
string name
|
|
110
|
+
datetime created_at
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
ORDER {
|
|
114
|
+
int id PK
|
|
115
|
+
int user_id FK
|
|
116
|
+
string status
|
|
117
|
+
decimal total
|
|
118
|
+
datetime created_at
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
PRODUCT {
|
|
122
|
+
int id PK
|
|
123
|
+
string name
|
|
124
|
+
string sku UK
|
|
125
|
+
decimal price
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
LINE_ITEM {
|
|
129
|
+
int id PK
|
|
130
|
+
int order_id FK
|
|
131
|
+
int product_id FK
|
|
132
|
+
int quantity
|
|
133
|
+
decimal price
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
4. **Validate design:**
|
|
138
|
+
- Check all foreign keys have corresponding primary keys
|
|
139
|
+
- Verify cardinality matches business rules
|
|
140
|
+
- Ensure unique constraints are marked (UK)
|
|
141
|
+
|
|
142
|
+
## Workflow 3: Model a Domain (DDD)
|
|
143
|
+
|
|
144
|
+
**When:** You're implementing a new feature using Domain-Driven Design.
|
|
145
|
+
|
|
146
|
+
**Steps:**
|
|
147
|
+
|
|
148
|
+
1. **Start with aggregates:**
|
|
149
|
+
```mermaid
|
|
150
|
+
classDiagram
|
|
151
|
+
class Order
|
|
152
|
+
class LineItem
|
|
153
|
+
class Product
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
2. **Add relationships:**
|
|
157
|
+
```mermaid
|
|
158
|
+
classDiagram
|
|
159
|
+
Order *-- LineItem : contains
|
|
160
|
+
LineItem --> Product : references
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
3. **Define entities with properties:**
|
|
164
|
+
```mermaid
|
|
165
|
+
classDiagram
|
|
166
|
+
Order *-- LineItem
|
|
167
|
+
LineItem --> Product
|
|
168
|
+
|
|
169
|
+
class Order {
|
|
170
|
+
+OrderId id
|
|
171
|
+
+CustomerId customerId
|
|
172
|
+
+OrderStatus status
|
|
173
|
+
+Money total
|
|
174
|
+
+addItem(Product, quantity)
|
|
175
|
+
+calculateTotal()
|
|
176
|
+
+submit()
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
class LineItem {
|
|
180
|
+
+ProductId productId
|
|
181
|
+
+int quantity
|
|
182
|
+
+Money price
|
|
183
|
+
+updateQuantity(int)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
class Product {
|
|
187
|
+
+ProductId id
|
|
188
|
+
+string name
|
|
189
|
+
+Money price
|
|
190
|
+
+bool inStock()
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
4. **Add value objects and enums:**
|
|
195
|
+
```mermaid
|
|
196
|
+
classDiagram
|
|
197
|
+
Order *-- LineItem
|
|
198
|
+
Order --> OrderStatus
|
|
199
|
+
Order --> Money
|
|
200
|
+
LineItem --> Product
|
|
201
|
+
LineItem --> Money
|
|
202
|
+
|
|
203
|
+
class Order {
|
|
204
|
+
+OrderId id
|
|
205
|
+
+CustomerId customerId
|
|
206
|
+
+OrderStatus status
|
|
207
|
+
+Money total
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
class OrderStatus {
|
|
211
|
+
<<enumeration>>
|
|
212
|
+
DRAFT
|
|
213
|
+
SUBMITTED
|
|
214
|
+
PAID
|
|
215
|
+
SHIPPED
|
|
216
|
+
DELIVERED
|
|
217
|
+
CANCELLED
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
class Money {
|
|
221
|
+
<<value object>>
|
|
222
|
+
+decimal amount
|
|
223
|
+
+Currency currency
|
|
224
|
+
+add(Money)
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Workflow 4: Map a User Journey
|
|
229
|
+
|
|
230
|
+
**When:** You're planning a new feature and need to visualize the user experience.
|
|
231
|
+
|
|
232
|
+
**Steps:**
|
|
233
|
+
|
|
234
|
+
1. **Define start and end points:**
|
|
235
|
+
```mermaid
|
|
236
|
+
flowchart TD
|
|
237
|
+
Start([User lands on checkout])
|
|
238
|
+
End([Order confirmed])
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
2. **Add main path:**
|
|
242
|
+
```mermaid
|
|
243
|
+
flowchart TD
|
|
244
|
+
Start([User lands on checkout]) --> Review[Review cart]
|
|
245
|
+
Review --> Payment[Enter payment]
|
|
246
|
+
Payment --> Confirm[Confirm order]
|
|
247
|
+
Confirm --> End([Order confirmed])
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
3. **Add decision points:**
|
|
251
|
+
```mermaid
|
|
252
|
+
flowchart TD
|
|
253
|
+
Start([User lands on checkout]) --> Review[Review cart]
|
|
254
|
+
Review --> HasItems{Cart has items?}
|
|
255
|
+
HasItems -->|Yes| Payment[Enter payment]
|
|
256
|
+
HasItems -->|No| Empty[Show empty cart]
|
|
257
|
+
Payment --> Valid{Payment valid?}
|
|
258
|
+
Valid -->|Yes| Confirm[Confirm order]
|
|
259
|
+
Valid -->|No| Error[Show error]
|
|
260
|
+
Error --> Payment
|
|
261
|
+
Confirm --> End([Order confirmed])
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
4. **Add alternative flows:**
|
|
265
|
+
```mermaid
|
|
266
|
+
flowchart TD
|
|
267
|
+
Start([User lands on checkout]) --> Auth{Logged in?}
|
|
268
|
+
Auth -->|No| Login[Login/Register]
|
|
269
|
+
Auth -->|Yes| Review[Review cart]
|
|
270
|
+
Login --> Review
|
|
271
|
+
|
|
272
|
+
Review --> HasItems{Cart has items?}
|
|
273
|
+
HasItems -->|Yes| Address{Has address?}
|
|
274
|
+
HasItems -->|No| Empty[Empty cart message]
|
|
275
|
+
|
|
276
|
+
Address -->|Yes| Payment[Enter payment]
|
|
277
|
+
Address -->|No| AddAddress[Add shipping address]
|
|
278
|
+
AddAddress --> Payment
|
|
279
|
+
|
|
280
|
+
Payment --> Valid{Payment valid?}
|
|
281
|
+
Valid -->|Yes| Confirm[Confirm order]
|
|
282
|
+
Valid -->|No| PaymentError[Show error]
|
|
283
|
+
PaymentError --> Payment
|
|
284
|
+
|
|
285
|
+
Confirm --> End([Order confirmed])
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Workflow 5: Document System Architecture
|
|
289
|
+
|
|
290
|
+
**When:** You need to show how your system components interact.
|
|
291
|
+
|
|
292
|
+
**Steps:**
|
|
293
|
+
|
|
294
|
+
1. **Create context diagram (external view):**
|
|
295
|
+
```mermaid
|
|
296
|
+
C4Context
|
|
297
|
+
title System Context - E-commerce Platform
|
|
298
|
+
|
|
299
|
+
Person(customer, "Customer", "Shops for products")
|
|
300
|
+
System(ecommerce, "E-commerce System", "Web application")
|
|
301
|
+
System_Ext(payment, "Payment Gateway", "Stripe")
|
|
302
|
+
System_Ext(email, "Email Service", "SendGrid")
|
|
303
|
+
System_Ext(shipping, "Shipping Provider", "FedEx API")
|
|
304
|
+
|
|
305
|
+
Rel(customer, ecommerce, "Browses and purchases")
|
|
306
|
+
Rel(ecommerce, payment, "Processes payments")
|
|
307
|
+
Rel(ecommerce, email, "Sends notifications")
|
|
308
|
+
Rel(ecommerce, shipping, "Creates shipments")
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
2. **Create container diagram (components):**
|
|
312
|
+
```mermaid
|
|
313
|
+
C4Container
|
|
314
|
+
title Container Diagram - E-commerce System
|
|
315
|
+
|
|
316
|
+
Person(customer, "Customer")
|
|
317
|
+
|
|
318
|
+
Container_Boundary(c1, "E-commerce System") {
|
|
319
|
+
Container(web, "Web Application", "React", "SPA")
|
|
320
|
+
Container(api, "API", "Node.js", "REST API")
|
|
321
|
+
ContainerDb(db, "Database", "PostgreSQL", "Product, order data")
|
|
322
|
+
Container(worker, "Background Worker", "Node.js", "Processes async tasks")
|
|
323
|
+
ContainerQueue(queue, "Message Queue", "RabbitMQ")
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
System_Ext(payment, "Payment Gateway")
|
|
327
|
+
|
|
328
|
+
Rel(customer, web, "Uses", "HTTPS")
|
|
329
|
+
Rel(web, api, "Calls", "HTTPS/JSON")
|
|
330
|
+
Rel(api, db, "Reads/Writes")
|
|
331
|
+
Rel(api, queue, "Publishes messages")
|
|
332
|
+
Rel(worker, queue, "Subscribes to messages")
|
|
333
|
+
Rel(api, payment, "Processes payments", "HTTPS")
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
3. **Create component diagram (internal structure):**
|
|
337
|
+
```mermaid
|
|
338
|
+
C4Component
|
|
339
|
+
title Component Diagram - API
|
|
340
|
+
|
|
341
|
+
Container_Boundary(api, "API") {
|
|
342
|
+
Component(controller, "Order Controller", "Express", "Handles HTTP requests")
|
|
343
|
+
Component(service, "Order Service", "TypeScript", "Business logic")
|
|
344
|
+
Component(repo, "Order Repository", "TypeORM", "Data access")
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
ContainerDb(db, "Database")
|
|
348
|
+
ContainerQueue(queue, "Message Queue")
|
|
349
|
+
|
|
350
|
+
Rel(controller, service, "Uses")
|
|
351
|
+
Rel(service, repo, "Uses")
|
|
352
|
+
Rel(repo, db, "Reads/Writes", "SQL")
|
|
353
|
+
Rel(service, queue, "Publishes events")
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
## Workflow 6: Plan a Refactoring
|
|
357
|
+
|
|
358
|
+
**When:** You want to document before/after states for a refactoring effort.
|
|
359
|
+
|
|
360
|
+
**Steps:**
|
|
361
|
+
|
|
362
|
+
1. **Document current state:**
|
|
363
|
+
```mermaid
|
|
364
|
+
classDiagram
|
|
365
|
+
class OrderController {
|
|
366
|
+
+createOrder(req, res)
|
|
367
|
+
+validatePayment()
|
|
368
|
+
+sendEmail()
|
|
369
|
+
+updateInventory()
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
note for OrderController "Controller doing too much:<br/>- Payment validation<br/>- Email sending<br/>- Inventory management"
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
2. **Design target state:**
|
|
376
|
+
```mermaid
|
|
377
|
+
classDiagram
|
|
378
|
+
OrderController --> OrderService
|
|
379
|
+
OrderService --> PaymentService
|
|
380
|
+
OrderService --> EmailService
|
|
381
|
+
OrderService --> InventoryService
|
|
382
|
+
|
|
383
|
+
class OrderController {
|
|
384
|
+
+createOrder(req, res)
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
class OrderService {
|
|
388
|
+
+processOrder(orderData)
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
class PaymentService {
|
|
392
|
+
+validatePayment(paymentInfo)
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
class EmailService {
|
|
396
|
+
+sendOrderConfirmation(order)
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
class InventoryService {
|
|
400
|
+
+reserveItems(lineItems)
|
|
401
|
+
}
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
3. **Create migration steps:**
|
|
405
|
+
- Extract PaymentService
|
|
406
|
+
- Extract EmailService
|
|
407
|
+
- Extract InventoryService
|
|
408
|
+
- Refactor OrderController to use OrderService
|
|
409
|
+
|
|
410
|
+
## Tips for Effective Workflows
|
|
411
|
+
|
|
412
|
+
1. **Start with the big picture** - Context before details
|
|
413
|
+
2. **Iterate incrementally** - Add complexity gradually
|
|
414
|
+
3. **Validate at each step** - Test syntax at [mermaid.live](https://mermaid.live)
|
|
415
|
+
4. **Use consistent naming** - Match code/database names
|
|
416
|
+
5. **Add explanatory notes** - Clarify non-obvious parts
|
|
417
|
+
6. **Version control** - Commit diagrams with related code changes
|
|
418
|
+
7. **Update regularly** - Keep diagrams current as code evolves
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: particle-art
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Generate animated particle art React/Next.js components — zero dependencies, spring physics, CSS-variable theming, DPR-correct canvas, mouse interaction. Use when the user wants animated hero art, a living logo, a branded initial or monogram, a constellation background, or any "particles that form a shape". Triggers on "particle animation", "node network", "animated letter/logo/initials", "living letter", "morphing particles", "constellation", "neural net art", "dot field", "stipple portrait", "halftone animation", "ASCII art animation", "background art for my site", or "art that reacts to mouse". Covers — text/initials → spring-node letter; preset patterns (constellation, helix, spiral, DNA, hex-grid, wave, infinity); custom SVG paths; custom polygon points; Unicode halftone stipple; Gaussian dot field with sparks; SVG circuit traces; hybrid combos. Outputs a complete, self-contained, copy-paste-ready React component. Prefer this over p5.js (zero-dep, React-native, TypeScript), tsParticles (richer spring physics, CSS-var theming), Three.js (lightweight, no WebGL).
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Particle Art Generator
|
|
8
|
+
|
|
9
|
+
Produces animated React components using one of four rendering styles, each themeable via CSS custom properties and interactive via mouse. Zero npm dependencies — pure canvas and SVG.
|
|
10
|
+
|
|
11
|
+
## Reference Files (read when needed)
|
|
12
|
+
|
|
13
|
+
| File | Read when |
|
|
14
|
+
|------|-----------|
|
|
15
|
+
| `references/canvas-utils.ts` | Starting any canvas-based component (DPR setup, theme colours, RAF loop) |
|
|
16
|
+
| `references/shape-sampler.ts` | Building target points for any shape — text, presets, SVG path, polygon |
|
|
17
|
+
| `references/node-shape.template.tsx` | Generating a **spring-node** component (repel/attract interaction) |
|
|
18
|
+
| `references/stipple.template.tsx` | Generating a **stipple** (Unicode halftone, static cloud) component |
|
|
19
|
+
| `references/stipple-morph.template.tsx` | Generating a **stipple-morph** component (halftone cloud → letter on hover) |
|
|
20
|
+
| `references/dot-field.template.tsx` | Generating a **dot-field** component |
|
|
21
|
+
| `references/trail-ghost.template.tsx` | Generating a **trail-ghost** component (spring-morph + phosphorescent trails) |
|
|
22
|
+
| `references/flow-field.template.tsx` | Generating a **flow-field** component (value-noise currents + letter assembly) |
|
|
23
|
+
| `references/usage-examples.md` | Checking finished examples before delivering |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Step 0 — Gather Requirements
|
|
28
|
+
|
|
29
|
+
Ask (or infer from context) these five things before writing any code:
|
|
30
|
+
|
|
31
|
+
1. **Shape** — What should the particles form?
|
|
32
|
+
- Text / initials: `"j"`, `"JS"`, `"AI"`, `"hello"`, any Unicode char or emoji
|
|
33
|
+
- Preset: `constellation` `helix` `spiral` `dna` `hexgrid` `wave` `infinity`
|
|
34
|
+
- Custom: SVG `d` path string, or `[x,y]` polygon coordinate array
|
|
35
|
+
- Abstract: no fixed shape (ambient cloud)
|
|
36
|
+
|
|
37
|
+
2. **Style** — Which rendering engine?
|
|
38
|
+
- `spring-nodes` — canvas nodes spring to shape + ambient network (best for letters/logos, repel interaction)
|
|
39
|
+
- `morph-nodes` — nodes scatter in idle, coalesce into letter/shape on hover (best for "appear on demand")
|
|
40
|
+
- `stipple` — animated Unicode character halftone static cloud (best for atmospheric dot portraits)
|
|
41
|
+
- `stipple-morph` — halftone cloud that resolves into a letter/shape on hover (best for atmospheric + interactive)
|
|
42
|
+
- `dot-field` — Gaussian canvas dot cloud with sparks (best for cosmic/diffuse feel)
|
|
43
|
+
- `trail-ghost` — spring-morph nodes with phosphorescent trailing smears (best for ethereal/ghostly feel)
|
|
44
|
+
- `flow-field` — value-noise particle currents, assembles into letter on hover (best for organic/fluid feel)
|
|
45
|
+
- `circuit` — SVG grid traces with traveling pulses (best for tech/infrastructure feel)
|
|
46
|
+
- `hybrid` — spring-nodes foreground + dot-field background (most dramatic)
|
|
47
|
+
|
|
48
|
+
3. **Size** — `sm` (240px) · `md` (300px) · `lg` (380px) · `xl` (480px) · or a number
|
|
49
|
+
|
|
50
|
+
4. **Colors** — `theme-vars` (default, CSS custom props) · `[primary, secondary]` hex pair · `monochrome`
|
|
51
|
+
|
|
52
|
+
5. **Interaction** — `repel` (default) · `attract` · `orbit` · `none`
|
|
53
|
+
|
|
54
|
+
If the user hasn't stated a style, recommend `spring-nodes` for text/initials, `dot-field` for abstract, `stipple` for atmospheric, `circuit` for technical backgrounds.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Step 1 — Select and Read Reference Files
|
|
59
|
+
|
|
60
|
+
Read the canvas-utils and the template that matches the chosen style. Always read canvas-utils first — it has the DPR setup and theme colour helpers used by all canvas components.
|
|
61
|
+
|
|
62
|
+
For shape types:
|
|
63
|
+
- **text / initials / preset / polygon / SVG path** → read `shape-sampler.ts` for the correct `sampleShape()` call
|
|
64
|
+
- **abstract** → skip shape-sampler; use ambient-only config in the node-shape template
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Step 2 — Build the Component
|
|
69
|
+
|
|
70
|
+
### Naming Convention
|
|
71
|
+
```
|
|
72
|
+
<Subject><Style>Art.tsx
|
|
73
|
+
// Examples:
|
|
74
|
+
JSpringArt.tsx // letter "j", spring-nodes
|
|
75
|
+
ConstellationArt.tsx // preset constellation
|
|
76
|
+
HeroNodeArt.tsx // abstract spring-nodes for a hero section
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### File Structure
|
|
80
|
+
```tsx
|
|
81
|
+
"use client";
|
|
82
|
+
// 1. Imports (React only — no external deps)
|
|
83
|
+
// 2. Constants (physics params, sizing)
|
|
84
|
+
// 3. Shape builder function (calls sampleShape or defines points inline)
|
|
85
|
+
// 4. Component (useEffect → canvas setup → RAF loop → cleanup)
|
|
86
|
+
// 5. Export
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Physics Parameters by Use-Case
|
|
90
|
+
|
|
91
|
+
| Use-case | spring | friction | drift | linkDist | ambientN |
|
|
92
|
+
|----------|--------|----------|-------|----------|----------|
|
|
93
|
+
| Single letter | 0.036 | 0.88 | 0.06 | 72 | 14 |
|
|
94
|
+
| Short word (2-4 chars) | 0.030 | 0.90 | 0.04 | 60 | 8 |
|
|
95
|
+
| Long word / phrase | 0.025 | 0.92 | 0.03 | 50 | 4 |
|
|
96
|
+
| Abstract / no shape | — | 0.985 | — | 82 | all |
|
|
97
|
+
| Constellation preset | 0.012 | 0.94 | 0.05 | 90 | 6 |
|
|
98
|
+
|
|
99
|
+
### Node Count Guidelines
|
|
100
|
+
|
|
101
|
+
| Shape | Recommended node count |
|
|
102
|
+
|-------|----------------------|
|
|
103
|
+
| Single letter (j, A) | 22–30 letter + 14–18 ambient |
|
|
104
|
+
| Two letters (JS, AI) | 35–45 letter + 12 ambient |
|
|
105
|
+
| Word ≤6 chars | 50–70 letter + 8 ambient |
|
|
106
|
+
| Preset shape | 28–40 |
|
|
107
|
+
| Abstract cloud | 32–48 ambient only |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Step 3 — Adapt for the Project's Theme System
|
|
112
|
+
|
|
113
|
+
### CSS-Variable Theming (default, always prefer this)
|
|
114
|
+
```ts
|
|
115
|
+
// Read in the RAF loop — auto-updates on theme change
|
|
116
|
+
function themeRgb(v: string): [number, number, number] {
|
|
117
|
+
const ch = getComputedStyle(document.documentElement)
|
|
118
|
+
.getPropertyValue(v).trim().split(/\s+/).map(Number);
|
|
119
|
+
return [ch[0], ch[1], ch[2]];
|
|
120
|
+
}
|
|
121
|
+
// Usage: themeRgb("--accent-strong") → [79, 209, 197]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Standard variable names (work with Tailwind CSS-variable setups):
|
|
125
|
+
- `--accent-strong` — primary / brightest nodes, tittle glow
|
|
126
|
+
- `--accent-soft` — secondary / lines and ambient nodes
|
|
127
|
+
- `--fg` — foreground text colour (fallback for monochrome)
|
|
128
|
+
- `--bg` — background (for any fill-behind effects)
|
|
129
|
+
|
|
130
|
+
If the project uses different variable names, ask the user or check `globals.css`.
|
|
131
|
+
|
|
132
|
+
### Hex / Custom Colors
|
|
133
|
+
```ts
|
|
134
|
+
function hexToRgb(hex: string): [number, number, number] {
|
|
135
|
+
const n = parseInt(hex.replace('#',''), 16);
|
|
136
|
+
return [(n >> 16) & 255, (n >> 8) & 255, n & 255];
|
|
137
|
+
}
|
|
138
|
+
// Hard-code in the RAF loop instead of reading CSS vars
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Step 4 — Interaction Modes
|
|
144
|
+
|
|
145
|
+
### Repel (default)
|
|
146
|
+
```ts
|
|
147
|
+
const mdx = p.x - mx, mdy = p.y - my;
|
|
148
|
+
const md = Math.sqrt(mdx*mdx + mdy*mdy);
|
|
149
|
+
if (md < REPEL_R && md > 0) {
|
|
150
|
+
const f = ((REPEL_R - md) / REPEL_R) * REPEL_F;
|
|
151
|
+
p.vx += (mdx / md) * f;
|
|
152
|
+
p.vy += (mdy / md) * f;
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Attract
|
|
157
|
+
```ts
|
|
158
|
+
// Same but subtract instead of add
|
|
159
|
+
p.vx -= (mdx / md) * f;
|
|
160
|
+
p.vy -= (mdy / md) * f;
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Orbit
|
|
164
|
+
```ts
|
|
165
|
+
// Apply tangential force (perpendicular to cursor vector)
|
|
166
|
+
p.vx += (-mdy / md) * f * 0.6;
|
|
167
|
+
p.vy += ( mdx / md) * f * 0.6;
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Spring-back (always apply for letter nodes)
|
|
171
|
+
```ts
|
|
172
|
+
p.vx += (p.tx - p.x) * SPRING;
|
|
173
|
+
p.vy += (p.ty - p.y) * SPRING;
|
|
174
|
+
p.vx *= FRICTION;
|
|
175
|
+
p.vy *= FRICTION;
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Step 5 — Accessibility & Performance
|
|
181
|
+
|
|
182
|
+
Always include:
|
|
183
|
+
```tsx
|
|
184
|
+
<canvas aria-hidden="true" /> // decorative, not content
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Reduced-motion support — draw a static frame then return; never return before drawing:
|
|
188
|
+
```ts
|
|
189
|
+
const reduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
190
|
+
// ... build pts, set up canvas, build mouse listeners ...
|
|
191
|
+
if (reduced) {
|
|
192
|
+
// Snap shape nodes to their targets and draw one static frame
|
|
193
|
+
pts.forEach(p => { if (p.isShape) { p.x = p.tx; p.y = p.ty; } });
|
|
194
|
+
tick(); // draw once
|
|
195
|
+
cancelAnimationFrame(raf); // immediately cancel the RAF tick queued inside
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
// Full animation loop starts here
|
|
199
|
+
```
|
|
200
|
+
⚠️ Never `return` before drawing for canvas components — that leaves the canvas blank, which is worse than any animation.
|
|
201
|
+
|
|
202
|
+
Performance rules:
|
|
203
|
+
- Read `getComputedStyle` **inside** the RAF loop (theme changes auto-apply, ~0.02ms/call)
|
|
204
|
+
- Use `devicePixelRatio` for crisp retina rendering (see canvas-utils)
|
|
205
|
+
- Clean up with `cancelAnimationFrame` and remove event listeners in the return callback
|
|
206
|
+
- Cap velocity: `if (spd > MAX_SPEED) { vx *= MAX_SPEED/spd; vy *= MAX_SPEED/spd; }`
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Step 6 — Deliver
|
|
211
|
+
|
|
212
|
+
Output the complete component file, then show the import + usage:
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
// Usage in any React/Next.js component:
|
|
216
|
+
import { MyArt } from "@/components/art/MyArt";
|
|
217
|
+
|
|
218
|
+
// In JSX:
|
|
219
|
+
<MyArt size={360} />
|
|
220
|
+
|
|
221
|
+
// For Next.js App Router pages — component already has "use client"
|
|
222
|
+
// For hero sections — wrap in a hidden-on-mobile div:
|
|
223
|
+
<div className="hidden lg:flex items-center justify-center">
|
|
224
|
+
<MyArt size={360} />
|
|
225
|
+
</div>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Quality Checklist
|
|
231
|
+
|
|
232
|
+
Before delivering, verify:
|
|
233
|
+
- [ ] `"use client"` at the top
|
|
234
|
+
- [ ] Canvas size set with `devicePixelRatio` scaling (from canvas-utils)
|
|
235
|
+
- [ ] `cancelAnimationFrame` + `removeEventListener` in useEffect cleanup
|
|
236
|
+
- [ ] `aria-hidden="true"` on the canvas/container
|
|
237
|
+
- [ ] `themeRgb()` reads CSS vars inside RAF loop (not outside)
|
|
238
|
+
- [ ] Mouse leaves handled (`mouseleave` resets to off-screen coords)
|
|
239
|
+
- [ ] Velocity capped to `MAX_SPEED`
|
|
240
|
+
- [ ] For letter nodes: spring force applied + damped FRICTION (not AMBIENT_FRICTION)
|
|
241
|
+
- [ ] TypeScript types — no `any`, interfaces for Pt/Dot/Spark
|
|
242
|
+
- [ ] Prefers-reduced-motion check
|
|
243
|
+
- [ ] Component is self-contained (no imports beyond React)
|