@istmx/skills 2.1.1 → 3.0.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/CHANGELOG.md +42 -0
- package/CODE_OF_CONDUCT.md +47 -47
- package/LICENSE +30 -30
- package/README.md +80 -164
- package/bin/cli.js +143 -210
- package/istm-workflow/istm-audit/SKILL.md +108 -108
- package/istm-workflow/istm-audit/agent-prompt.md +393 -393
- package/istm-workflow/istm-audit/agents/openai.yaml +7 -7
- package/istm-workflow/istm-audit/modes/area.md +19 -19
- package/istm-workflow/istm-audit/modes/gapfill.md +12 -12
- package/istm-workflow/istm-audit/modes/greenfield.md +24 -24
- package/istm-workflow/istm-audit/modes/tool-skills.md +39 -39
- package/istm-workflow/istm-audit/modes/whole-repo.md +5 -5
- package/istm-workflow/istm-audit/patterns/clean-architecture.md +15 -15
- package/istm-workflow/istm-audit/patterns/domain-driven.md +16 -16
- package/istm-workflow/istm-audit/patterns/functional.md +16 -16
- package/istm-workflow/istm-audit/patterns/solid-oop.md +17 -17
- package/istm-workflow/istm-autoplan/SKILL.md +1905 -1905
- package/istm-workflow/istm-autoplan/SKILL.md.tmpl +923 -923
- package/istm-workflow/istm-check/SKILL.md +52 -52
- package/istm-workflow/istm-check/agents/openai.yaml +7 -7
- package/istm-workflow/istm-check/modes/review.md +156 -156
- package/istm-workflow/istm-check/modes/verify.md +197 -197
- package/istm-workflow/istm-check/review-agent-prompt.md +57 -57
- package/istm-workflow/istm-check/review-guide.md +133 -133
- package/istm-workflow/istm-craft/SKILL.md +52 -52
- package/istm-workflow/istm-craft/agent-modes/architecture.md +73 -73
- package/istm-workflow/istm-craft/agent-modes/cross-cutting.md +65 -65
- package/istm-workflow/istm-craft/agent-modes/enhancement.md +45 -45
- package/istm-workflow/istm-craft/agent-modes/feature.md +85 -85
- package/istm-workflow/istm-craft/agent-prompt.md +249 -249
- package/istm-workflow/istm-craft/agents/openai.yaml +7 -7
- package/istm-workflow/istm-craft/internal/after-subagent.md +90 -90
- package/istm-workflow/istm-craft/internal/design-conversation.md +140 -140
- package/istm-workflow/istm-craft/internal/tool-discovery.md +58 -58
- package/istm-workflow/istm-craft/spec-template.md +278 -278
- package/istm-workflow/istm-cso/ACKNOWLEDGEMENTS.md +14 -14
- package/istm-workflow/istm-cso/SKILL.md +1313 -1313
- package/istm-workflow/istm-cso/SKILL.md.tmpl +407 -407
- package/istm-workflow/istm-cso/sections/audit-phases.md +253 -253
- package/istm-workflow/istm-cso/sections/audit-phases.md.tmpl +251 -251
- package/istm-workflow/istm-cso/sections/manifest.json +14 -14
- package/istm-workflow/istm-debt/SKILL.md +44 -44
- package/istm-workflow/istm-debug/SKILL.md +111 -111
- package/istm-workflow/istm-debug/agents/openai.yaml +7 -7
- package/istm-workflow/istm-design-review/SKILL.md +2053 -2053
- package/istm-workflow/istm-design-review/SKILL.md.tmpl +312 -312
- package/istm-workflow/istm-develop/SKILL.md +165 -165
- package/istm-workflow/istm-develop/agents/openai.yaml +7 -7
- package/istm-workflow/istm-develop/checklist.md +95 -95
- package/istm-workflow/istm-develop/flow/build.md +133 -133
- package/istm-workflow/istm-develop/flow/git.md +34 -34
- package/istm-workflow/istm-develop/logical-guide.md +99 -99
- package/istm-workflow/istm-develop/ui/existing.md +23 -23
- package/istm-workflow/istm-develop/ui/generate.md +131 -131
- package/istm-workflow/istm-develop/ui/image.md +41 -41
- package/istm-workflow/istm-develop/ui/implementation.md +281 -281
- package/istm-workflow/istm-develop/ui/mcp.md +11 -11
- package/istm-workflow/istm-develop/ui-guide.md +164 -164
- package/istm-workflow/istm-document/SKILL.md +123 -123
- package/istm-workflow/istm-document/agent-prompt.md +57 -57
- package/istm-workflow/istm-document/agents/openai.yaml +7 -7
- package/istm-workflow/istm-document/templates/changelog.md +54 -54
- package/istm-workflow/istm-document/templates/postmortem.md +58 -58
- package/istm-workflow/istm-document/templates/pr.md +43 -43
- package/istm-workflow/istm-document/templates/release-note.md +41 -41
- package/istm-workflow/istm-eng-review/SKILL.md +1112 -1112
- package/istm-workflow/istm-eng-review/SKILL.md.tmpl +163 -163
- package/istm-workflow/istm-eng-review/sections/manifest.json +14 -14
- package/istm-workflow/istm-eng-review/sections/review-sections.md +942 -942
- package/istm-workflow/istm-eng-review/sections/review-sections.md.tmpl +225 -225
- package/istm-workflow/istm-gain/SKILL.md +50 -50
- package/istm-workflow/istm-health/SKILL.md +1104 -1104
- package/istm-workflow/istm-health/SKILL.md.tmpl +320 -320
- package/istm-workflow/istm-qa/BROWSER.md +1468 -1468
- package/istm-workflow/istm-qa/SKILL.md +1743 -1743
- package/istm-workflow/istm-qa/SKILL.md.tmpl +354 -354
- package/istm-workflow/istm-qa/references/issue-taxonomy.md +85 -85
- package/istm-workflow/istm-qa/templates/qa-report-template.md +126 -126
- package/istm-workflow/istm-release/SKILL.md +989 -989
- package/istm-workflow/istm-release/SKILL.md.tmpl +160 -160
- package/istm-workflow/istm-release/sections/manifest.json +14 -14
- package/istm-workflow/istm-release/sections/release-body.md +547 -547
- package/istm-workflow/istm-release/sections/release-body.md.tmpl +420 -420
- package/istm-workflow/istm-review/SKILL.md +57 -57
- package/istm-workflow/istm-scope/SKILL.md +100 -100
- package/istm-workflow/istm-scope/agents/openai.yaml +7 -7
- package/istm-workflow/istm-scope/approaches/facade.md +33 -33
- package/istm-workflow/istm-scope/approaches/journey.md +31 -31
- package/istm-workflow/istm-scope/approaches/skateboard.md +33 -33
- package/istm-workflow/istm-scope/approaches/tracer-bullet.md +34 -34
- package/istm-workflow/istm-scope/modes/add.md +14 -14
- package/istm-workflow/istm-scope/modes/plan-brownfield.md +11 -11
- package/istm-workflow/istm-scope/modes/plan-greenfield.md +20 -20
- package/istm-workflow/istm-scope/modes/plan-monorepo.md +8 -8
- package/istm-workflow/istm-scope/modes/plan.md +120 -120
- package/istm-workflow/istm-scope/modes/replan.md +13 -13
- package/istm-workflow/istm-scope/scope-template.md +148 -148
- package/istm-workflow/istm-ship/SKILL.md +1504 -1504
- package/istm-workflow/istm-ship/SKILL.md.tmpl +582 -582
- package/istm-workflow/istm-ship/sections/adversarial.md +218 -218
- package/istm-workflow/istm-ship/sections/adversarial.md.tmpl +19 -19
- package/istm-workflow/istm-ship/sections/apple-release.md +58 -58
- package/istm-workflow/istm-ship/sections/apple-release.md.tmpl +56 -56
- package/istm-workflow/istm-ship/sections/changelog.md +45 -45
- package/istm-workflow/istm-ship/sections/changelog.md.tmpl +3 -3
- package/istm-workflow/istm-ship/sections/greptile.md +51 -51
- package/istm-workflow/istm-ship/sections/greptile.md.tmpl +49 -49
- package/istm-workflow/istm-ship/sections/manifest.json +62 -62
- package/istm-workflow/istm-ship/sections/plan-completion.md +329 -329
- package/istm-workflow/istm-ship/sections/plan-completion.md.tmpl +31 -31
- package/istm-workflow/istm-ship/sections/pr-body.md +209 -209
- package/istm-workflow/istm-ship/sections/pr-body.md.tmpl +207 -207
- package/istm-workflow/istm-ship/sections/review-army.md +406 -406
- package/istm-workflow/istm-ship/sections/review-army.md.tmpl +56 -56
- package/istm-workflow/istm-ship/sections/test-coverage.md +264 -264
- package/istm-workflow/istm-ship/sections/test-coverage.md.tmpl +23 -23
- package/istm-workflow/istm-ship/sections/tests.md +403 -403
- package/istm-workflow/istm-ship/sections/tests.md.tmpl +116 -116
- package/istm-workflow/istm-sync/SKILL.md +178 -178
- package/istm-workflow/istm-sync/agent-prompt.md +229 -229
- package/istm-workflow/istm-sync/agents/openai.yaml +7 -7
- package/istm-workflow/istm-test/SKILL.md +233 -233
- package/istm-workflow/istm-test/agent-prompt.md +62 -62
- package/istm-workflow/istm-test/agents/openai.yaml +7 -7
- package/istm-workflow/istm-test/modes/setup.md +97 -97
- package/istm-workflow/istm-test/writing-guide.md +196 -196
- package/istmx-architecture/SKILL.md +124 -0
- package/istmx-architecture/references/boundary-audits.md +33 -0
- package/istmx-architecture/references/clean-architecture-full.md +394 -0
- package/istmx-architecture/references/comments-as-design.md +387 -0
- package/istmx-architecture/references/complexity-symptoms.md +209 -0
- package/istmx-architecture/references/deep-modules.md +347 -0
- package/istmx-architecture/references/general-vs-special.md +342 -0
- package/istmx-architecture/references/information-hiding.md +336 -0
- package/istmx-architecture/references/reverse-engineering.md +25 -0
- package/istmx-architecture/references/software-design-philosophy.md +199 -0
- package/istmx-architecture/references/strategic-programming.md +269 -0
- package/{istm-architecture/templates/agents.md → istmx-architecture/templates/AGENTS.md} +247 -248
- package/{istm-architecture → istmx-architecture}/templates/architecture.md +110 -110
- package/istmx-architecture/templates/progress.md +29 -0
- package/{istm-architecture → istmx-architecture}/templates/project-overview.md +215 -215
- package/istmx-backend-patterns/SKILL.md +143 -0
- package/istmx-backend-patterns/references/api-and-database-patterns.md +22 -0
- package/istmx-backend-patterns/references/api-patterns.md +275 -0
- package/istmx-backend-patterns/references/code-examples.md +97 -0
- package/istmx-backend-patterns/references/database-patterns.md +269 -0
- package/istmx-backend-patterns/references/distributed-patterns.md +327 -0
- package/istmx-backend-patterns/references/distributed-resilience.md +21 -0
- package/istmx-backend-patterns/references/failure-analysis.md +150 -0
- package/istmx-backend-patterns/references/infrastructure.md +74 -0
- package/istmx-backend-patterns/references/scaling-patterns.md +362 -0
- package/istmx-backend-patterns/scripts/analyze_schema.py +304 -0
- package/istmx-backend-patterns/scripts/capacity_calculator.py +238 -0
- package/istmx-backend-patterns/scripts/check_api_health.sh +135 -0
- package/istmx-backend-patterns/templates/adr.md +19 -0
- package/istmx-brainstorming/SKILL.md +325 -0
- package/istmx-brainstorming/builder-check-prompt.md +23 -0
- package/istmx-clean-code/SKILL.md +248 -0
- package/istmx-clean-code/references/code-smells-and-refactorings.md +42 -0
- package/istmx-clean-code/references/code-smells.md +494 -0
- package/istmx-clean-code/references/comments-formatting.md +405 -0
- package/istmx-clean-code/references/deep-modules-and-boundaries.md +29 -0
- package/istmx-clean-code/references/error-handling.md +357 -0
- package/istmx-clean-code/references/functions-and-methods.md +373 -0
- package/istmx-clean-code/references/kent-beck-simple-design.md +687 -0
- package/istmx-clean-code/references/naming-conventions.md +280 -0
- package/istmx-clean-code/references/testing-principles.md +353 -0
- package/istmx-clean-code/references/typescript-and-backend-examples.md +82 -0
- package/istmx-code-review/SKILL.md +201 -0
- package/istmx-code-review/code-reviewer.md +198 -0
- package/istmx-code-review/references/architecture-decisions.md +321 -0
- package/istmx-code-review/references/code-examples.md +95 -0
- package/istmx-code-review/references/code-review.md +173 -0
- package/istmx-code-review/references/debugging-strategies.md +485 -0
- package/istmx-code-review/references/design-docs.md +161 -0
- package/istmx-code-review/references/performance-profiling.md +484 -0
- package/istmx-code-review/references/production-patterns.md +317 -0
- package/istmx-code-review/references/receiving-code-review.md +205 -0
- package/istmx-code-review/references/requesting-code-review.md +95 -0
- package/istmx-code-review/references/team-patterns.md +374 -0
- package/istmx-code-review/scripts/review_checklist.py +312 -0
- package/istmx-ddd/SKILL.md +208 -0
- package/istmx-ddd/references/bounded-contexts.md +203 -0
- package/istmx-ddd/references/building-blocks.md +234 -0
- package/istmx-ddd/references/domain-events.md +264 -0
- package/istmx-ddd/references/repositories-factories.md +353 -0
- package/istmx-ddd/references/strategic-design.md +251 -0
- package/istmx-ddd/references/ubiquitous-language.md +202 -0
- package/istmx-ddia-systems/SKILL.md +252 -0
- package/istmx-ddia-systems/references/anti-patterns.md +279 -0
- package/istmx-ddia-systems/references/batch-stream.md +342 -0
- package/istmx-ddia-systems/references/capacity-planning.md +285 -0
- package/istmx-ddia-systems/references/chaos-engineering.md +0 -0
- package/istmx-ddia-systems/references/data-models.md +0 -0
- package/istmx-ddia-systems/references/deployment-strategies.md +0 -0
- package/istmx-ddia-systems/references/fault-tolerance.md +0 -0
- package/istmx-ddia-systems/references/observability.md +313 -0
- package/istmx-ddia-systems/references/partitioning.md +0 -0
- package/istmx-ddia-systems/references/replication.md +0 -0
- package/istmx-ddia-systems/references/stability-patterns.md +369 -0
- package/istmx-ddia-systems/references/storage-engines.md +289 -0
- package/istmx-ddia-systems/references/transactions.md +267 -0
- package/istmx-devops/SKILL.md +204 -0
- package/istmx-devops/references/cicd-pipeline.md +74 -0
- package/istmx-devops/references/deployment-rollbacks.md +29 -0
- package/istmx-devops/references/docker.md +199 -0
- package/istmx-devops/references/incident-triage.md +30 -0
- package/istmx-devops/references/infrastructure.md +129 -0
- package/istmx-devops/references/kubernetes.md +346 -0
- package/istmx-devops/references/observability.md +331 -0
- package/istmx-devops/scripts/analyze_deployment_risk.py +74 -0
- package/istmx-devops/scripts/check_services.sh +172 -0
- package/istmx-devops/scripts/validate_dockerfile.sh +213 -0
- package/istmx-diagnose-agent/SKILL.md +147 -0
- package/istmx-diagnose-agent/prompts/analyst-common.md +38 -0
- package/istmx-diagnose-agent/prompts/cost-and-time.md +28 -0
- package/istmx-diagnose-agent/prompts/plan-adherence.md +29 -0
- package/istmx-diagnose-agent/prompts/quality-evidence.md +26 -0
- package/istmx-diagnose-agent/prompts/repeated-work.md +30 -0
- package/istmx-diagnose-agent/prompts/request-conflicts.md +20 -0
- package/istmx-diagnose-agent/prompts/scrub-audit.md +33 -0
- package/istmx-diagnose-agent/prompts/scrub.md +29 -0
- package/istmx-diagnose-agent/prompts/similar-session.md +38 -0
- package/istmx-diagnose-agent/prompts/skill-timeline.md +30 -0
- package/istmx-diagnose-agent/prompts/stumbles.md +28 -0
- package/istmx-diagnose-agent/references/context-safety.md +22 -0
- package/istmx-diagnose-agent/references/github-issues.md +47 -0
- package/istmx-diagnose-agent/references/redaction-policy.md +34 -0
- package/istmx-diagnose-agent/references/session-discovery.md +31 -0
- package/istmx-diagnose-agent/templates/bundle-README.md +77 -0
- package/istmx-diagnose-agent/templates/case.md +64 -0
- package/istmx-diagnose-agent/templates/issue.md +70 -0
- package/istmx-diagnose-agent/templates/report.md +82 -0
- package/istmx-harness-audit/SKILL.md +193 -0
- package/istmx-harness-audit/references/harness-checklist.md +18 -0
- package/istmx-harness-audit/references/remediation-workflow.md +242 -0
- package/istmx-harness-audit/references/stations-and-checks.md +131 -0
- package/istmx-legacy-code/SKILL.md +219 -0
- package/istmx-legacy-code/references/case-studies.md +238 -0
- package/istmx-legacy-code/references/change-algorithm.md +178 -0
- package/istmx-legacy-code/references/characterization-tests.md +210 -0
- package/istmx-legacy-code/references/dependency-breaking.md +306 -0
- package/istmx-legacy-code/references/seams.md +176 -0
- package/istmx-ml-engineering/SKILL.md +167 -0
- package/istmx-ml-engineering/references/classical-ml.md +645 -0
- package/istmx-ml-engineering/references/dataset-triage.md +23 -0
- package/istmx-ml-engineering/references/deployment.md +504 -0
- package/istmx-ml-engineering/references/evaluation-playbook.md +23 -0
- package/istmx-ml-engineering/references/fine-tuning.md +510 -0
- package/istmx-ml-engineering/references/rag-patterns.md +499 -0
- package/istmx-ml-engineering/references/transformers-patterns.md +570 -0
- package/istmx-ml-engineering/scripts/analyze_dataset.py +380 -0
- package/istmx-ml-engineering/scripts/estimate_gpu_memory.py +308 -0
- package/istmx-ml-engineering/scripts/summarize_eval.py +71 -0
- package/istmx-multi-agent/SKILL.md +383 -0
- package/istmx-multi-agent/references/batching.md +11 -0
- package/istmx-multi-agent/references/cannot-verify.md +10 -0
- package/istmx-multi-agent/references/dispatching-parallel-agents.md +167 -0
- package/istmx-multi-agent/references/final-review.md +49 -0
- package/istmx-multi-agent/references/finishing-a-development-branch.md +225 -0
- package/istmx-multi-agent/references/fix-loop.md +77 -0
- package/istmx-multi-agent/references/handling-reports.md +15 -0
- package/istmx-multi-agent/references/orchestration-and-handoffs.md +17 -0
- package/istmx-multi-agent/references/preflight.md +26 -0
- package/istmx-multi-agent/references/resuming.md +12 -0
- package/istmx-multi-agent/references/using-git-worktrees.md +167 -0
- package/istmx-multi-agent/scripts/review-package +64 -0
- package/istmx-multi-agent/scripts/sdd-repo +54 -0
- package/istmx-multi-agent/scripts/sdd-workspace +110 -0
- package/istmx-multi-agent/scripts/task-brief +108 -0
- package/istmx-multi-agent/templates/implementer-prompt.md +154 -0
- package/istmx-multi-agent/templates/progress-ledger.md +13 -0
- package/istmx-multi-agent/templates/re-review-prompt.md +116 -0
- package/istmx-multi-agent/templates/review-verdict.md +18 -0
- package/istmx-multi-agent/templates/task-reviewer-prompt.md +209 -0
- package/istmx-multi-agent/templates/worker-brief.md +27 -0
- package/istmx-planning/SKILL.md +222 -0
- package/istmx-planning/references/executing-plans.md +323 -0
- package/istmx-planning/scripts/task-done +55 -0
- package/istmx-planning/scripts/task-start +32 -0
- package/istmx-postgres-design/SKILL.md +138 -0
- package/istmx-postgres-design/references/sql-optimization-patterns.md +214 -0
- package/istmx-pragmatic-eng/SKILL.md +237 -0
- package/istmx-pragmatic-eng/references/broken-windows.md +257 -0
- package/istmx-pragmatic-eng/references/contracts-assertions.md +387 -0
- package/istmx-pragmatic-eng/references/dry-orthogonality.md +264 -0
- package/istmx-pragmatic-eng/references/estimation-portfolio.md +326 -0
- package/istmx-pragmatic-eng/references/reversibility.md +343 -0
- package/istmx-pragmatic-eng/references/tracer-bullets.md +280 -0
- package/istmx-refactoring/SKILL.md +226 -0
- package/istmx-refactoring/references/composing-methods.md +399 -0
- package/istmx-refactoring/references/moving-features.md +389 -0
- package/istmx-refactoring/references/organizing-data.md +433 -0
- package/istmx-refactoring/references/refactoring-workflow.md +373 -0
- package/istmx-refactoring/references/simplifying-conditionals.md +385 -0
- package/istmx-refactoring/references/smell-catalog.md +347 -0
- package/istmx-security-audit/SKILL.md +263 -0
- package/istmx-security-audit/references/auth-and-api-hardening.md +20 -0
- package/istmx-security-audit/references/auth-patterns.md +15 -0
- package/istmx-security-audit/references/compliance-checklists.md +10 -0
- package/istmx-security-audit/references/incident-response.md +11 -0
- package/istmx-security-audit/references/security-headers.md +12 -0
- package/istmx-security-audit/references/stride-and-threat-modeling.md +17 -0
- package/istmx-security-audit/references/vulnerability-patterns.md +14 -0
- package/istmx-security-audit/scripts/audit_auth_surface.py +69 -0
- package/istmx-security-audit/scripts/check_security_headers.sh +130 -0
- package/istmx-security-audit/scripts/scan_secrets.sh +182 -0
- package/istmx-system-design/SKILL.md +223 -0
- package/istmx-system-design/references/building-blocks.md +272 -0
- package/istmx-system-design/references/code-examples.md +95 -0
- package/istmx-system-design/references/common-designs.md +257 -0
- package/istmx-system-design/references/database-scaling.md +295 -0
- package/istmx-system-design/references/estimation-numbers.md +250 -0
- package/istmx-system-design/references/four-step-process.md +286 -0
- package/istmx-system-design/references/reliability-operations.md +373 -0
- package/istmx-system-design/references/worked-examples.md +174 -0
- package/istmx-tdd-verify/SKILL.md +364 -0
- package/istmx-tdd-verify/references/anti-tautological-tests.md +21 -0
- package/istmx-tdd-verify/references/characterization-and-seams.md +21 -0
- package/istmx-tdd-verify/references/condition-based-waiting.md +115 -0
- package/istmx-tdd-verify/references/defense-in-depth.md +122 -0
- package/istmx-tdd-verify/references/root-cause-and-defense-in-depth.md +26 -0
- package/istmx-tdd-verify/references/root-cause-tracing.md +169 -0
- package/istmx-tdd-verify/references/systematic-debugging.md +283 -0
- package/istmx-tdd-verify/references/verification-before-completion.md +120 -0
- package/istmx-tdd-verify/references/working-with-legacy-code.md +206 -0
- package/istmx-tdd-verify/references/writing-good-tests.md +198 -0
- package/istmx-tdd-verify/scripts/find-polluter.sh +72 -0
- package/istmx-team-topologies/SKILL.md +217 -0
- package/istmx-team-topologies/references/case-studies.md +158 -0
- package/istmx-team-topologies/references/cognitive-load.md +148 -0
- package/istmx-team-topologies/references/fracture-planes.md +97 -0
- package/istmx-team-topologies/references/interaction-modes.md +137 -0
- package/istmx-team-topologies/references/team-types.md +145 -0
- package/istmx-tech-docs/SKILL.md +246 -0
- package/istmx-tech-docs/references/api-reference.md +431 -0
- package/istmx-tech-docs/references/audit-checklist.md +287 -0
- package/istmx-tech-docs/references/document-types.md +212 -0
- package/istmx-tech-docs/references/procedures-and-code.md +249 -0
- package/istmx-tech-docs/references/release-notes.md +424 -0
- package/istmx-tech-docs/references/structure-and-formatting.md +330 -0
- package/istmx-tech-docs/references/voice-and-words.md +296 -0
- package/package.json +127 -127
- package/RELEASE_v2.1.0.md +0 -68
- package/context/conversation_transcript.md +0 -786
- package/context/progress.md +0 -129
- package/istm/SKILL.md +0 -74
- package/istm-animate/SKILL.md +0 -65
- package/istm-animate/animations/animation_utils.md +0 -280
- package/istm-animate/animations/animations.md +0 -220
- package/istm-animate/animations/core_motion.md +0 -250
- package/istm-animate/animations/examples/README.md +0 -29
- package/istm-animate/animations/examples/nuxt/app/app.vue +0 -3
- package/istm-animate/animations/examples/nuxt/app/composables/useGSAP.ts +0 -91
- package/istm-animate/animations/examples/nuxt/app/pages/index.vue +0 -55
- package/istm-animate/animations/examples/nuxt/nuxt.config.ts +0 -4
- package/istm-animate/animations/examples/nuxt/package.json +0 -18
- package/istm-animate/animations/examples/react/App.jsx +0 -46
- package/istm-animate/animations/examples/react/index.html +0 -12
- package/istm-animate/animations/examples/react/main.jsx +0 -9
- package/istm-animate/animations/examples/react/package.json +0 -21
- package/istm-animate/animations/examples/react/vite.config.js +0 -7
- package/istm-animate/animations/examples/vanilla/index.html +0 -33
- package/istm-animate/animations/examples/vanilla/main.js +0 -36
- package/istm-animate/animations/examples/vue/app.vue +0 -47
- package/istm-animate/animations/examples/vue/index.html +0 -15
- package/istm-animate/animations/examples/vue/main.js +0 -9
- package/istm-animate/animations/examples/vue/package.json +0 -19
- package/istm-animate/animations/examples/vue/vite.config.js +0 -7
- package/istm-animate/animations/framework_motion.md +0 -262
- package/istm-animate/animations/motion.csv +0 -17
- package/istm-animate/animations/motion.md +0 -11
- package/istm-animate/animations/motion_catalog.json +0 -226
- package/istm-animate/animations/motion_performance.md +0 -75
- package/istm-animate/animations/motion_plugins.md +0 -429
- package/istm-animate/animations/react_animations.md +0 -132
- package/istm-animate/animations/scroll_trigger_effects.md +0 -291
- package/istm-animate/animations/timeline_sequencing.md +0 -103
- package/istm-animate/core/motion-principles/SKILL.md +0 -284
- package/istm-animate/core/motion-principles/references/designers.md +0 -127
- package/istm-animate/core/motion-principles/references/easing-guide.md +0 -231
- package/istm-animate/core/motion-principles/references/enter-exit-recipes.md +0 -466
- package/istm-animate/frameworks/canvas-generative/SKILL.md +0 -325
- package/istm-animate/frameworks/canvas-generative/references/algorithms.md +0 -925
- package/istm-animate/frameworks/css-native/SKILL.md +0 -319
- package/istm-animate/frameworks/css-native/references/modern-css.md +0 -465
- package/istm-animate/frameworks/framer-motion/SKILL.md +0 -187
- package/istm-animate/frameworks/framer-motion/references/api.md +0 -312
- package/istm-animate/frameworks/gsap/SKILL.md +0 -188
- package/istm-animate/frameworks/gsap/references/core.md +0 -218
- package/istm-animate/frameworks/gsap/references/plugins.md +0 -371
- package/istm-animate/frameworks/gsap/references/scrolltrigger.md +0 -325
- package/istm-animate/frameworks/gsap/references/timeline.md +0 -218
- package/istm-animate/frameworks/threejs-r3f/SKILL.md +0 -243
- package/istm-animate/frameworks/threejs-r3f/references/scene-setup.md +0 -392
- package/istm-animate/frameworks/threejs-r3f/references/shaders.md +0 -446
- package/istm-animate/mobile/android/compose-graphics/SKILL.md +0 -503
- package/istm-animate/mobile/android/compose-graphics/references/agsl-recipes.md +0 -356
- package/istm-animate/mobile/android/compose-graphics/references/canvas-generative.md +0 -282
- package/istm-animate/mobile/android/compose-graphics/references/m3-expressive-deep.md +0 -303
- package/istm-animate/mobile/android/compose-motion/SKILL.md +0 -359
- package/istm-animate/mobile/android/compose-motion/references/gestures-compose.md +0 -273
- package/istm-animate/mobile/android/compose-motion/references/recomposition-and-anim.md +0 -196
- package/istm-animate/mobile/android/compose-motion/references/shared-transitions.md +0 -281
- package/istm-animate/mobile/android/compose-multiplatform/SKILL.md +0 -311
- package/istm-animate/mobile/android/compose-multiplatform/references/cmp-interop.md +0 -288
- package/istm-animate/mobile/android/compose-multiplatform/references/cmp-platform-quirks.md +0 -156
- package/istm-animate/mobile/apple/swiftui-graphics/SKILL.md +0 -408
- package/istm-animate/mobile/apple/swiftui-graphics/references/canvas-swiftui.md +0 -239
- package/istm-animate/mobile/apple/swiftui-graphics/references/liquid-glass-deep.md +0 -252
- package/istm-animate/mobile/apple/swiftui-graphics/references/metal-recipes.md +0 -382
- package/istm-animate/mobile/apple/swiftui-motion/SKILL.md +0 -379
- package/istm-animate/mobile/apple/swiftui-motion/references/gestures-swiftui.md +0 -336
- package/istm-animate/mobile/apple/swiftui-motion/references/phase-keyframe-deep.md +0 -231
- package/istm-animate/mobile/apple/swiftui-motion/references/springs-cheatsheet.md +0 -129
- package/istm-animate/references/animate.md +0 -199
- package/istm-animate/references/audit.md +0 -115
- package/istm-animate/references/design-engineering.md +0 -674
- package/istm-animate/references/improve.md +0 -101
- package/istm-animate/references/opportunities.md +0 -132
- package/istm-animate/references/plan-template.md +0 -73
- package/istm-animate/references/recipes.md +0 -324
- package/istm-animate/references/review.md +0 -112
- package/istm-animate/references/standards.md +0 -187
- package/istm-animate/references/vocabulary.md +0 -173
- package/istm-architecture/SKILL.md +0 -174
- package/istm-architecture/frameworks/angular.csv +0 -51
- package/istm-architecture/frameworks/astro.csv +0 -54
- package/istm-architecture/frameworks/avalonia.csv +0 -57
- package/istm-architecture/frameworks/flutter.csv +0 -53
- package/istm-architecture/frameworks/javafx.csv +0 -76
- package/istm-architecture/frameworks/jetpack-compose.csv +0 -53
- package/istm-architecture/frameworks/laravel.csv +0 -51
- package/istm-architecture/frameworks/nextjs.csv +0 -53
- package/istm-architecture/frameworks/nuxtjs.csv +0 -59
- package/istm-architecture/frameworks/react-native.csv +0 -52
- package/istm-architecture/frameworks/react.csv +0 -54
- package/istm-architecture/frameworks/svelte.csv +0 -54
- package/istm-architecture/frameworks/swiftui.csv +0 -51
- package/istm-architecture/frameworks/uwp.csv +0 -56
- package/istm-architecture/frameworks/vue.csv +0 -50
- package/istm-architecture/frameworks/winui.csv +0 -60
- package/istm-architecture/frameworks/wpf.csv +0 -57
- package/istm-architecture/templates/design.md +0 -138
- package/istm-awwward-designer/SKILL.md +0 -75
- package/istm-awwward-designer/libraries/threejs.csv +0 -54
- package/istm-awwward-designer/references/accessibility.md +0 -774
- package/istm-awwward-designer/references/anim-anti-patterns.md +0 -576
- package/istm-awwward-designer/references/animation-map.md +0 -166
- package/istm-awwward-designer/references/animation-standards.md +0 -86
- package/istm-awwward-designer/references/anti-patterns.md +0 -191
- package/istm-awwward-designer/references/color-systems.md +0 -604
- package/istm-awwward-designer/references/css-performance.md +0 -477
- package/istm-awwward-designer/references/descender-safety.md +0 -490
- package/istm-awwward-designer/references/design-audit.md +0 -93
- package/istm-awwward-designer/references/font-loading.md +0 -378
- package/istm-awwward-designer/references/image-optimization.md +0 -440
- package/istm-awwward-designer/references/invention-gate.md +0 -356
- package/istm-awwward-designer/references/micro-interactions.md +0 -825
- package/istm-awwward-designer/references/page-transitions.md +0 -365
- package/istm-awwward-designer/references/performance-standards.md +0 -79
- package/istm-awwward-designer/references/quality-gate.md +0 -103
- package/istm-awwward-designer/references/responsive-design.md +0 -778
- package/istm-awwward-designer/references/scoring-guide.md +0 -201
- package/istm-awwward-designer/references/scroll-patterns.md +0 -668
- package/istm-awwward-designer/references/stitch-brief.md +0 -124
- package/istm-awwward-designer/references/tech-stack.md +0 -204
- package/istm-awwward-designer/references/technical-audit.md +0 -133
- package/istm-awwward-designer/references/technique-families.md +0 -293
- package/istm-awwward-designer/references/testing.md +0 -535
- package/istm-awwward-designer/references/text-animation.md +0 -585
- package/istm-awwward-designer/references/typography.md +0 -504
- package/istm-awwward-designer/references/usability-audit.md +0 -108
- package/istm-awwward-designer/references/visual-standards.md +0 -97
- package/istm-design/SKILL.md +0 -85
- package/istm-design/anti-laziness/architectural-patterns.md +0 -55
- package/istm-design/anti-laziness/parameter-tuning.md +0 -44
- package/istm-design/anti-laziness/prompt-engineering.md +0 -52
- package/istm-design/anti-laziness/reference-prompts.md +0 -79
- package/istm-design/archetypes/brandkit/SKILL.md +0 -798
- package/istm-design/archetypes/brutalist/SKILL.md +0 -92
- package/istm-design/archetypes/minimalist/SKILL.md +0 -85
- package/istm-design/archetypes/soft/SKILL.md +0 -98
- package/istm-design/colors/color_theory.md +0 -293
- package/istm-design/colors/colors.csv +0 -193
- package/istm-design/colors/colors_catalog.json +0 -4034
- package/istm-design/colors/palette.json +0 -21
- package/istm-design/core/design-audit/SKILL.md +0 -248
- package/istm-design/core/desktop-principles/SKILL.md +0 -363
- package/istm-design/core/desktop-principles/references/keyboard-patterns.md +0 -137
- package/istm-design/core/desktop-principles/references/multi-window.md +0 -105
- package/istm-design/core/mobile-principles/SKILL.md +0 -289
- package/istm-design/core/mobile-principles/references/accessibility-mobile.md +0 -175
- package/istm-design/core/mobile-principles/references/gestures-deep.md +0 -220
- package/istm-design/core/ui-ux-pro-max/SKILL.md +0 -392
- package/istm-design/core/ui-ux-pro-max/UPSTREAM.md +0 -23
- package/istm-design/core/ui-ux-pro-max/data/app-interface.csv +0 -31
- package/istm-design/core/ui-ux-pro-max/data/charts.csv +0 -26
- package/istm-design/core/ui-ux-pro-max/data/colors.csv +0 -193
- package/istm-design/core/ui-ux-pro-max/data/google-fonts.csv +0 -1924
- package/istm-design/core/ui-ux-pro-max/data/icons.csv +0 -106
- package/istm-design/core/ui-ux-pro-max/data/landing.csv +0 -35
- package/istm-design/core/ui-ux-pro-max/data/motion.csv +0 -17
- package/istm-design/core/ui-ux-pro-max/data/products.csv +0 -193
- package/istm-design/core/ui-ux-pro-max/data/react-performance.csv +0 -45
- package/istm-design/core/ui-ux-pro-max/data/stacks/angular.csv +0 -51
- package/istm-design/core/ui-ux-pro-max/data/stacks/astro.csv +0 -54
- package/istm-design/core/ui-ux-pro-max/data/stacks/avalonia.csv +0 -57
- package/istm-design/core/ui-ux-pro-max/data/stacks/flutter.csv +0 -53
- package/istm-design/core/ui-ux-pro-max/data/stacks/html-tailwind.csv +0 -56
- package/istm-design/core/ui-ux-pro-max/data/stacks/javafx.csv +0 -76
- package/istm-design/core/ui-ux-pro-max/data/stacks/jetpack-compose.csv +0 -53
- package/istm-design/core/ui-ux-pro-max/data/stacks/laravel.csv +0 -51
- package/istm-design/core/ui-ux-pro-max/data/stacks/nextjs.csv +0 -53
- package/istm-design/core/ui-ux-pro-max/data/stacks/nuxt-ui.csv +0 -71
- package/istm-design/core/ui-ux-pro-max/data/stacks/nuxtjs.csv +0 -59
- package/istm-design/core/ui-ux-pro-max/data/stacks/react-native.csv +0 -52
- package/istm-design/core/ui-ux-pro-max/data/stacks/react.csv +0 -54
- package/istm-design/core/ui-ux-pro-max/data/stacks/shadcn.csv +0 -61
- package/istm-design/core/ui-ux-pro-max/data/stacks/svelte.csv +0 -54
- package/istm-design/core/ui-ux-pro-max/data/stacks/swiftui.csv +0 -51
- package/istm-design/core/ui-ux-pro-max/data/stacks/threejs.csv +0 -54
- package/istm-design/core/ui-ux-pro-max/data/stacks/uno.csv +0 -60
- package/istm-design/core/ui-ux-pro-max/data/stacks/uwp.csv +0 -56
- package/istm-design/core/ui-ux-pro-max/data/stacks/vue.csv +0 -50
- package/istm-design/core/ui-ux-pro-max/data/stacks/winui.csv +0 -60
- package/istm-design/core/ui-ux-pro-max/data/stacks/wpf.csv +0 -57
- package/istm-design/core/ui-ux-pro-max/data/styles.csv +0 -85
- package/istm-design/core/ui-ux-pro-max/data/typography.csv +0 -75
- package/istm-design/core/ui-ux-pro-max/data/ui-reasoning.csv +0 -162
- package/istm-design/core/ui-ux-pro-max/data/ux-guidelines.csv +0 -100
- package/istm-design/core/ui-ux-pro-max/references/pro-rules.md +0 -109
- package/istm-design/core/ui-ux-pro-max/references/quick-reference.md +0 -240
- package/istm-design/core/ui-ux-pro-max/scripts/core.py +0 -464
- package/istm-design/core/ui-ux-pro-max/scripts/design_system.py +0 -1371
- package/istm-design/core/ui-ux-pro-max/scripts/search.py +0 -162
- package/istm-design/core/ui-ux-pro-max/scripts/tests/test_core.py +0 -134
- package/istm-design/core/ui-ux-pro-max/scripts/validate_data.py +0 -114
- package/istm-design/image-to-code/SKILL.md +0 -1228
- package/istm-design/imagegen/SKILL.md +0 -987
- package/istm-design/presets/airbnb/DESIGN.md +0 -545
- package/istm-design/presets/airbnb/README.md +0 -5
- package/istm-design/presets/airtable/DESIGN.md +0 -554
- package/istm-design/presets/airtable/README.md +0 -5
- package/istm-design/presets/apple/DESIGN.md +0 -562
- package/istm-design/presets/apple/README.md +0 -5
- package/istm-design/presets/binance/DESIGN.md +0 -634
- package/istm-design/presets/binance/README.md +0 -5
- package/istm-design/presets/bmw/DESIGN.md +0 -544
- package/istm-design/presets/bmw/README.md +0 -5
- package/istm-design/presets/bmw-m/DESIGN.md +0 -503
- package/istm-design/presets/bmw-m/README.md +0 -5
- package/istm-design/presets/bugatti/DESIGN.md +0 -454
- package/istm-design/presets/bugatti/README.md +0 -5
- package/istm-design/presets/cal/DESIGN.md +0 -542
- package/istm-design/presets/cal/README.md +0 -5
- package/istm-design/presets/catalog.md +0 -127
- package/istm-design/presets/claude/DESIGN.md +0 -589
- package/istm-design/presets/claude/README.md +0 -5
- package/istm-design/presets/clay/DESIGN.md +0 -541
- package/istm-design/presets/clay/README.md +0 -5
- package/istm-design/presets/clickhouse/DESIGN.md +0 -544
- package/istm-design/presets/clickhouse/README.md +0 -5
- package/istm-design/presets/cohere/DESIGN.md +0 -451
- package/istm-design/presets/cohere/README.md +0 -5
- package/istm-design/presets/coinbase/DESIGN.md +0 -570
- package/istm-design/presets/coinbase/README.md +0 -5
- package/istm-design/presets/composio/DESIGN.md +0 -506
- package/istm-design/presets/composio/README.md +0 -5
- package/istm-design/presets/cursor/DESIGN.md +0 -537
- package/istm-design/presets/cursor/README.md +0 -5
- package/istm-design/presets/dell-1996/DESIGN.md +0 -632
- package/istm-design/presets/dell-1996/README.md +0 -5
- package/istm-design/presets/elevenlabs/DESIGN.md +0 -504
- package/istm-design/presets/elevenlabs/README.md +0 -5
- package/istm-design/presets/expo/DESIGN.md +0 -526
- package/istm-design/presets/expo/README.md +0 -5
- package/istm-design/presets/ferrari/DESIGN.md +0 -531
- package/istm-design/presets/ferrari/README.md +0 -5
- package/istm-design/presets/figma/DESIGN.md +0 -578
- package/istm-design/presets/figma/README.md +0 -5
- package/istm-design/presets/framer/DESIGN.md +0 -544
- package/istm-design/presets/framer/README.md +0 -5
- package/istm-design/presets/hashicorp/DESIGN.md +0 -575
- package/istm-design/presets/hashicorp/README.md +0 -5
- package/istm-design/presets/hp/DESIGN.md +0 -670
- package/istm-design/presets/hp/README.md +0 -5
- package/istm-design/presets/ibm/DESIGN.md +0 -550
- package/istm-design/presets/ibm/README.md +0 -5
- package/istm-design/presets/intercom/DESIGN.md +0 -546
- package/istm-design/presets/intercom/README.md +0 -5
- package/istm-design/presets/kraken/DESIGN.md +0 -125
- package/istm-design/presets/kraken/README.md +0 -5
- package/istm-design/presets/lamborghini/DESIGN.md +0 -288
- package/istm-design/presets/lamborghini/README.md +0 -5
- package/istm-design/presets/linear/DESIGN.md +0 -548
- package/istm-design/presets/linear/README.md +0 -5
- package/istm-design/presets/lovable/DESIGN.md +0 -298
- package/istm-design/presets/lovable/README.md +0 -5
- package/istm-design/presets/mastercard/DESIGN.md +0 -365
- package/istm-design/presets/mastercard/README.md +0 -5
- package/istm-design/presets/meta/DESIGN.md +0 -683
- package/istm-design/presets/meta/README.md +0 -5
- package/istm-design/presets/minimax/DESIGN.md +0 -746
- package/istm-design/presets/minimax/README.md +0 -5
- package/istm-design/presets/mintlify/DESIGN.md +0 -852
- package/istm-design/presets/mintlify/README.md +0 -5
- package/istm-design/presets/miro/DESIGN.md +0 -825
- package/istm-design/presets/miro/README.md +0 -5
- package/istm-design/presets/mistral/DESIGN.md +0 -773
- package/istm-design/presets/mistral/README.md +0 -5
- package/istm-design/presets/mongodb/DESIGN.md +0 -767
- package/istm-design/presets/mongodb/README.md +0 -5
- package/istm-design/presets/nike/DESIGN.md +0 -575
- package/istm-design/presets/nike/README.md +0 -5
- package/istm-design/presets/nintendo-2001/DESIGN.md +0 -649
- package/istm-design/presets/nintendo-2001/README.md +0 -5
- package/istm-design/presets/notion/DESIGN.md +0 -821
- package/istm-design/presets/notion/README.md +0 -5
- package/istm-design/presets/nvidia/DESIGN.md +0 -640
- package/istm-design/presets/nvidia/README.md +0 -5
- package/istm-design/presets/ollama/DESIGN.md +0 -539
- package/istm-design/presets/ollama/README.md +0 -5
- package/istm-design/presets/opencode/DESIGN.md +0 -521
- package/istm-design/presets/opencode/README.md +0 -5
- package/istm-design/presets/pinterest/DESIGN.md +0 -597
- package/istm-design/presets/pinterest/README.md +0 -5
- package/istm-design/presets/playstation/DESIGN.md +0 -661
- package/istm-design/presets/playstation/README.md +0 -5
- package/istm-design/presets/posthog/DESIGN.md +0 -690
- package/istm-design/presets/posthog/README.md +0 -5
- package/istm-design/presets/raycast/DESIGN.md +0 -669
- package/istm-design/presets/raycast/README.md +0 -5
- package/istm-design/presets/renault/DESIGN.md +0 -589
- package/istm-design/presets/renault/README.md +0 -5
- package/istm-design/presets/replicate/DESIGN.md +0 -616
- package/istm-design/presets/replicate/README.md +0 -5
- package/istm-design/presets/resend/DESIGN.md +0 -585
- package/istm-design/presets/resend/README.md +0 -5
- package/istm-design/presets/revolut/DESIGN.md +0 -636
- package/istm-design/presets/revolut/README.md +0 -5
- package/istm-design/presets/runwayml/DESIGN.md +0 -244
- package/istm-design/presets/runwayml/README.md +0 -5
- package/istm-design/presets/sanity/DESIGN.md +0 -357
- package/istm-design/presets/sanity/README.md +0 -5
- package/istm-design/presets/sentry/DESIGN.md +0 -551
- package/istm-design/presets/sentry/README.md +0 -5
- package/istm-design/presets/shopify/DESIGN.md +0 -516
- package/istm-design/presets/shopify/README.md +0 -5
- package/istm-design/presets/slack/DESIGN.md +0 -482
- package/istm-design/presets/spacex/DESIGN.md +0 -363
- package/istm-design/presets/spacex/README.md +0 -5
- package/istm-design/presets/spotify/DESIGN.md +0 -246
- package/istm-design/presets/spotify/README.md +0 -5
- package/istm-design/presets/starbucks/DESIGN.md +0 -580
- package/istm-design/presets/starbucks/README.md +0 -5
- package/istm-design/presets/stripe/DESIGN.md +0 -487
- package/istm-design/presets/stripe/README.md +0 -5
- package/istm-design/presets/supabase/DESIGN.md +0 -462
- package/istm-design/presets/supabase/README.md +0 -5
- package/istm-design/presets/superhuman/DESIGN.md +0 -448
- package/istm-design/presets/superhuman/README.md +0 -5
- package/istm-design/presets/tesla/DESIGN.md +0 -286
- package/istm-design/presets/tesla/README.md +0 -5
- package/istm-design/presets/theverge/DESIGN.md +0 -339
- package/istm-design/presets/theverge/README.md +0 -5
- package/istm-design/presets/together/DESIGN.md +0 -633
- package/istm-design/presets/together/README.md +0 -5
- package/istm-design/presets/uber/DESIGN.md +0 -636
- package/istm-design/presets/uber/README.md +0 -5
- package/istm-design/presets/vercel/DESIGN.md +0 -736
- package/istm-design/presets/vercel/README.md +0 -5
- package/istm-design/presets/vodafone/DESIGN.md +0 -538
- package/istm-design/presets/vodafone/README.md +0 -5
- package/istm-design/presets/voltagent/DESIGN.md +0 -521
- package/istm-design/presets/voltagent/README.md +0 -5
- package/istm-design/presets/warp/DESIGN.md +0 -526
- package/istm-design/presets/warp/README.md +0 -5
- package/istm-design/presets/webflow/DESIGN.md +0 -588
- package/istm-design/presets/webflow/README.md +0 -5
- package/istm-design/presets/wired/DESIGN.md +0 -497
- package/istm-design/presets/wired/README.md +0 -5
- package/istm-design/presets/wise/DESIGN.md +0 -544
- package/istm-design/presets/wise/README.md +0 -5
- package/istm-design/presets/xai/DESIGN.md +0 -465
- package/istm-design/presets/xai/README.md +0 -5
- package/istm-design/presets/zapier/DESIGN.md +0 -537
- package/istm-design/presets/zapier/README.md +0 -5
- package/istm-design/references/apple-design.md +0 -282
- package/istm-design/references/generation-guide.md +0 -209
- package/istm-design/references/pick-ui-library.md +0 -77
- package/istm-design/references/picker.md +0 -197
- package/istm-design/references/prototype.md +0 -90
- package/istm-design/references/schema.md +0 -366
- package/istm-design/semantic-design/DESIGN.md +0 -121
- package/istm-design/semantic-design/SKILL.md +0 -184
- package/istm-design/styles/design_system.md +0 -288
- package/istm-design/styles/html-tailwind.csv +0 -56
- package/istm-design/styles/nuxt-ui.csv +0 -71
- package/istm-design/styles/product_design.md +0 -55
- package/istm-design/styles/shadcn.csv +0 -61
- package/istm-design/styles/style.md +0 -12
- package/istm-design/styles/styles.csv +0 -85
- package/istm-design/styles/styles_catalog.json +0 -2018
- package/istm-design/styles/ui-reasoning.csv +0 -162
- package/istm-design/styles/uno.csv +0 -60
- package/istm-design/typography/font_and_font.md +0 -10
- package/istm-design/typography/google-fonts.csv +0 -1924
- package/istm-design/typography/sans_serif_fonts.md +0 -112
- package/istm-design/typography/typography.csv +0 -75
- package/istm-design/typography/typography_catalog.json +0 -964
- package/istm-design/ux/app-interface.csv +0 -31
- package/istm-design/ux/charts.csv +0 -26
- package/istm-design/ux/icons.csv +0 -106
- package/istm-design/ux/landing.csv +0 -35
- package/istm-design/ux/products.csv +0 -193
- package/istm-design/ux/react-performance.csv +0 -45
- package/istm-design/ux/responsive_rules.md +0 -62
- package/istm-design/ux/storytelling.md +0 -47
- package/istm-design/ux/ux-guidelines.csv +0 -100
- package/istm-design/ux/ux_guidelines.json +0 -1190
- package/istm-system-design/SKILL.md +0 -95
- package/istm-system-design/principles/01-architecture-patterns.md +0 -24
- package/istm-system-design/principles/02-database-selection.md +0 -32
- package/istm-system-design/principles/03-api-design.md +0 -25
- package/istm-system-design/principles/04-authentication-security.md +0 -23
- package/istm-system-design/principles/05-caching-performance.md +0 -21
- package/istm-system-design/principles/06-asynchronous-processing.md +0 -17
- package/istm-system-design/principles/07-infrastructure-deployment.md +0 -22
- package/istm-system-design/principles/08-low-level-design.md +0 -35
- package/istm-system-design/principles/09-state-management.md +0 -14
- package/istm-system-design/principles/10-error-handling-and-logging.md +0 -26
- package/istm-system-design/principles/11-testing-strategy.md +0 -18
- package/istm-system-design/principles/12-seo-and-web-vitals.md +0 -18
- package/istm-system-design/stacks/SETUP.md +0 -82
- package/istm-system-design/stacks/STACK.md +0 -67
- package/istm-system-design/stacks/WORKFLOW.md +0 -84
- package/istm-system-design/templates/api-route.ts.template +0 -32
- package/istm-system-design/templates/migrations.md.template +0 -30
- package/istm-system-design/templates/schema.drizzle.ts.template +0 -17
- package/istm-system-design/templates/schema.prisma.template +0 -28
- package/istm-system-design/templates/trpc-router.ts.template +0 -22
- package/istm-system-design/templates/zod-validators.ts.template +0 -14
|
@@ -1,925 +0,0 @@
|
|
|
1
|
-
# Algorithms Reference
|
|
2
|
-
|
|
3
|
-
> Complete, commented implementations for generative art.
|
|
4
|
-
> Copy-paste ready. Each algorithm is self-contained.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Simplex Noise 2D/3D
|
|
9
|
-
|
|
10
|
-
Compact implementation based on Stefan Gustavson's work. No external dependencies.
|
|
11
|
-
|
|
12
|
-
```js
|
|
13
|
-
// ─── Simplex Noise ──────────────────────────────────────────────
|
|
14
|
-
// Attempt to produce smooth, isotropic noise without grid-aligned
|
|
15
|
-
// artifacts. Works in 2D and 3D. Returns values in [-1, 1].
|
|
16
|
-
|
|
17
|
-
const SimplexNoise = (() => {
|
|
18
|
-
// Gradient vectors for 2D (12 directions)
|
|
19
|
-
const grad2 = [
|
|
20
|
-
[1,1],[-1,1],[1,-1],[-1,-1],
|
|
21
|
-
[1,0],[-1,0],[0,1],[0,-1],
|
|
22
|
-
[1,1],[-1,1],[1,-1],[-1,-1]
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
// Gradient vectors for 3D
|
|
26
|
-
const grad3 = [
|
|
27
|
-
[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],
|
|
28
|
-
[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],
|
|
29
|
-
[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
// Permutation table (256 entries, doubled to avoid wrapping)
|
|
33
|
-
const perm = new Uint8Array(512);
|
|
34
|
-
const permMod12 = new Uint8Array(512);
|
|
35
|
-
|
|
36
|
-
// Seed the permutation table
|
|
37
|
-
// Pass any number to get reproducible results
|
|
38
|
-
function seed(s) {
|
|
39
|
-
const p = new Uint8Array(256);
|
|
40
|
-
for (let i = 0; i < 256; i++) p[i] = i;
|
|
41
|
-
|
|
42
|
-
// Fisher-Yates shuffle seeded with a simple LCG
|
|
43
|
-
let v = s * 1664525 + 1013904223;
|
|
44
|
-
for (let i = 255; i > 0; i--) {
|
|
45
|
-
v = (v * 1664525 + 1013904223) | 0;
|
|
46
|
-
const j = (v >>> 0) % (i + 1);
|
|
47
|
-
[p[i], p[j]] = [p[j], p[i]];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
for (let i = 0; i < 512; i++) {
|
|
51
|
-
perm[i] = p[i & 255];
|
|
52
|
-
permMod12[i] = perm[i] % 12;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Skewing factors for 2D simplex
|
|
57
|
-
const F2 = 0.5 * (Math.sqrt(3) - 1); // skew input space to grid
|
|
58
|
-
const G2 = (3 - Math.sqrt(3)) / 6; // unskew back
|
|
59
|
-
|
|
60
|
-
// Skewing factors for 3D
|
|
61
|
-
const F3 = 1 / 3;
|
|
62
|
-
const G3 = 1 / 6;
|
|
63
|
-
|
|
64
|
-
function dot2(g, x, y) { return g[0] * x + g[1] * y; }
|
|
65
|
-
function dot3(g, x, y, z) { return g[0] * x + g[1] * y + g[2] * z; }
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 2D Simplex Noise
|
|
69
|
-
* @param {number} xin - x coordinate
|
|
70
|
-
* @param {number} yin - y coordinate
|
|
71
|
-
* @returns {number} noise value in [-1, 1]
|
|
72
|
-
*/
|
|
73
|
-
function noise2D(xin, yin) {
|
|
74
|
-
let n0, n1, n2; // contributions from 3 corners
|
|
75
|
-
|
|
76
|
-
// Skew input to find which simplex cell we're in
|
|
77
|
-
const s = (xin + yin) * F2;
|
|
78
|
-
const i = Math.floor(xin + s);
|
|
79
|
-
const j = Math.floor(yin + s);
|
|
80
|
-
|
|
81
|
-
// Unskew back to get cell origin in (x,y) space
|
|
82
|
-
const t = (i + j) * G2;
|
|
83
|
-
const X0 = i - t;
|
|
84
|
-
const Y0 = j - t;
|
|
85
|
-
const x0 = xin - X0; // distance from cell origin
|
|
86
|
-
const y0 = yin - Y0;
|
|
87
|
-
|
|
88
|
-
// Determine which simplex we're in (upper or lower triangle)
|
|
89
|
-
let i1, j1;
|
|
90
|
-
if (x0 > y0) { i1 = 1; j1 = 0; } // lower triangle
|
|
91
|
-
else { i1 = 0; j1 = 1; } // upper triangle
|
|
92
|
-
|
|
93
|
-
// Offsets for middle and last corner
|
|
94
|
-
const x1 = x0 - i1 + G2;
|
|
95
|
-
const y1 = y0 - j1 + G2;
|
|
96
|
-
const x2 = x0 - 1 + 2 * G2;
|
|
97
|
-
const y2 = y0 - 1 + 2 * G2;
|
|
98
|
-
|
|
99
|
-
// Hash coordinates to gradient indices
|
|
100
|
-
const ii = i & 255;
|
|
101
|
-
const jj = j & 255;
|
|
102
|
-
const gi0 = permMod12[ii + perm[jj]];
|
|
103
|
-
const gi1 = permMod12[ii + i1 + perm[jj + j1]];
|
|
104
|
-
const gi2 = permMod12[ii + 1 + perm[jj + 1]];
|
|
105
|
-
|
|
106
|
-
// Calculate contribution from each corner
|
|
107
|
-
// Each corner has a radial falloff of r^2 = 0.5
|
|
108
|
-
let t0 = 0.5 - x0 * x0 - y0 * y0;
|
|
109
|
-
n0 = t0 < 0 ? 0 : (t0 *= t0, t0 * t0 * dot2(grad2[gi0], x0, y0));
|
|
110
|
-
|
|
111
|
-
let t1 = 0.5 - x1 * x1 - y1 * y1;
|
|
112
|
-
n1 = t1 < 0 ? 0 : (t1 *= t1, t1 * t1 * dot2(grad2[gi1], x1, y1));
|
|
113
|
-
|
|
114
|
-
let t2 = 0.5 - x2 * x2 - y2 * y2;
|
|
115
|
-
n2 = t2 < 0 ? 0 : (t2 *= t2, t2 * t2 * dot2(grad2[gi2], x2, y2));
|
|
116
|
-
|
|
117
|
-
// Scale to [-1, 1]
|
|
118
|
-
return 70 * (n0 + n1 + n2);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* 3D Simplex Noise
|
|
123
|
-
* @param {number} xin - x coordinate
|
|
124
|
-
* @param {number} yin - y coordinate
|
|
125
|
-
* @param {number} zin - z coordinate
|
|
126
|
-
* @returns {number} noise value in [-1, 1]
|
|
127
|
-
*/
|
|
128
|
-
function noise3D(xin, yin, zin) {
|
|
129
|
-
let n0, n1, n2, n3;
|
|
130
|
-
|
|
131
|
-
// Skew input space
|
|
132
|
-
const s = (xin + yin + zin) * F3;
|
|
133
|
-
const i = Math.floor(xin + s);
|
|
134
|
-
const j = Math.floor(yin + s);
|
|
135
|
-
const k = Math.floor(zin + s);
|
|
136
|
-
|
|
137
|
-
const t = (i + j + k) * G3;
|
|
138
|
-
const X0 = i - t;
|
|
139
|
-
const Y0 = j - t;
|
|
140
|
-
const Z0 = k - t;
|
|
141
|
-
const x0 = xin - X0;
|
|
142
|
-
const y0 = yin - Y0;
|
|
143
|
-
const z0 = zin - Z0;
|
|
144
|
-
|
|
145
|
-
// Determine which simplex we're in (6 possible tetrahedra)
|
|
146
|
-
let i1, j1, k1, i2, j2, k2;
|
|
147
|
-
if (x0 >= y0) {
|
|
148
|
-
if (y0 >= z0) { i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; }
|
|
149
|
-
else if (x0 >= z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; }
|
|
150
|
-
else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; }
|
|
151
|
-
} else {
|
|
152
|
-
if (y0 < z0) { i1=0; j1=0; k1=1; i2=0; j2=1; k2=1; }
|
|
153
|
-
else if (x0 < z0) { i1=0; j1=1; k1=0; i2=0; j2=1; k2=1; }
|
|
154
|
-
else { i1=0; j1=1; k1=0; i2=1; j2=1; k2=0; }
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const x1 = x0 - i1 + G3;
|
|
158
|
-
const y1 = y0 - j1 + G3;
|
|
159
|
-
const z1 = z0 - k1 + G3;
|
|
160
|
-
const x2 = x0 - i2 + 2 * G3;
|
|
161
|
-
const y2 = y0 - j2 + 2 * G3;
|
|
162
|
-
const z2 = z0 - k2 + 2 * G3;
|
|
163
|
-
const x3 = x0 - 1 + 3 * G3;
|
|
164
|
-
const y3 = y0 - 1 + 3 * G3;
|
|
165
|
-
const z3 = z0 - 1 + 3 * G3;
|
|
166
|
-
|
|
167
|
-
const ii = i & 255;
|
|
168
|
-
const jj = j & 255;
|
|
169
|
-
const kk = k & 255;
|
|
170
|
-
const gi0 = permMod12[ii + perm[jj + perm[kk]]];
|
|
171
|
-
const gi1 = permMod12[ii + i1 + perm[jj + j1 + perm[kk + k1]]];
|
|
172
|
-
const gi2 = permMod12[ii + i2 + perm[jj + j2 + perm[kk + k2]]];
|
|
173
|
-
const gi3 = permMod12[ii + 1 + perm[jj + 1 + perm[kk + 1]]];
|
|
174
|
-
|
|
175
|
-
let t0 = 0.6 - x0*x0 - y0*y0 - z0*z0;
|
|
176
|
-
n0 = t0 < 0 ? 0 : (t0 *= t0, t0 * t0 * dot3(grad3[gi0], x0, y0, z0));
|
|
177
|
-
|
|
178
|
-
let t1 = 0.6 - x1*x1 - y1*y1 - z1*z1;
|
|
179
|
-
n1 = t1 < 0 ? 0 : (t1 *= t1, t1 * t1 * dot3(grad3[gi1], x1, y1, z1));
|
|
180
|
-
|
|
181
|
-
let t2 = 0.6 - x2*x2 - y2*y2 - z2*z2;
|
|
182
|
-
n2 = t2 < 0 ? 0 : (t2 *= t2, t2 * t2 * dot3(grad3[gi2], x2, y2, z2));
|
|
183
|
-
|
|
184
|
-
let t3 = 0.6 - x3*x3 - y3*y3 - z3*z3;
|
|
185
|
-
n3 = t3 < 0 ? 0 : (t3 *= t3, t3 * t3 * dot3(grad3[gi3], x3, y3, z3));
|
|
186
|
-
|
|
187
|
-
return 32 * (n0 + n1 + n2 + n3);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// Auto-seed with a default
|
|
191
|
-
seed(0);
|
|
192
|
-
|
|
193
|
-
return { noise2D, noise3D, seed };
|
|
194
|
-
})();
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
**Usage:**
|
|
198
|
-
```js
|
|
199
|
-
SimplexNoise.seed(42); // reproducible
|
|
200
|
-
|
|
201
|
-
const val = SimplexNoise.noise2D(x * 0.01, y * 0.01); // scale coords down!
|
|
202
|
-
// val is in [-1, 1]
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## Particle System with Pool
|
|
208
|
-
|
|
209
|
-
Zero-allocation particle system. Pre-allocates everything. Swap-and-shrink for death.
|
|
210
|
-
|
|
211
|
-
```js
|
|
212
|
-
// ─── Particle Pool System ───────────────────────────────────────
|
|
213
|
-
// Fixed-size pool: no new/delete during runtime.
|
|
214
|
-
// Particles are stored contiguously. Dead particles are swapped
|
|
215
|
-
// to the end, keeping iteration tight.
|
|
216
|
-
|
|
217
|
-
class ParticleSystem {
|
|
218
|
-
constructor(maxParticles = 10000) {
|
|
219
|
-
this.max = maxParticles;
|
|
220
|
-
this.count = 0; // number of alive particles
|
|
221
|
-
|
|
222
|
-
// Struct-of-Arrays layout for cache friendliness
|
|
223
|
-
// Each property is a flat Float32Array
|
|
224
|
-
this.x = new Float32Array(maxParticles);
|
|
225
|
-
this.y = new Float32Array(maxParticles);
|
|
226
|
-
this.vx = new Float32Array(maxParticles);
|
|
227
|
-
this.vy = new Float32Array(maxParticles);
|
|
228
|
-
this.life = new Float32Array(maxParticles); // current age (frames)
|
|
229
|
-
this.maxLife = new Float32Array(maxParticles);
|
|
230
|
-
this.size = new Float32Array(maxParticles);
|
|
231
|
-
this.alpha = new Float32Array(maxParticles);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Spawn a particle at (x, y) with given velocity and lifespan.
|
|
236
|
-
* Returns false if pool is full.
|
|
237
|
-
*/
|
|
238
|
-
spawn(x, y, vx, vy, life, size = 2) {
|
|
239
|
-
if (this.count >= this.max) return false;
|
|
240
|
-
|
|
241
|
-
const i = this.count++;
|
|
242
|
-
this.x[i] = x;
|
|
243
|
-
this.y[i] = y;
|
|
244
|
-
this.vx[i] = vx;
|
|
245
|
-
this.vy[i] = vy;
|
|
246
|
-
this.life[i] = 0;
|
|
247
|
-
this.maxLife[i] = life;
|
|
248
|
-
this.size[i] = size;
|
|
249
|
-
this.alpha[i] = 1;
|
|
250
|
-
return true;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* Spawn N particles in a burst pattern (radial).
|
|
255
|
-
*/
|
|
256
|
-
burst(x, y, count, speed = 2, life = 60, size = 2) {
|
|
257
|
-
for (let i = 0; i < count; i++) {
|
|
258
|
-
const angle = (i / count) * Math.PI * 2;
|
|
259
|
-
const v = speed * (0.5 + Math.random() * 0.5); // slight randomness
|
|
260
|
-
this.spawn(
|
|
261
|
-
x, y,
|
|
262
|
-
Math.cos(angle) * v,
|
|
263
|
-
Math.sin(angle) * v,
|
|
264
|
-
life * (0.7 + Math.random() * 0.6),
|
|
265
|
-
size
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Update all alive particles.
|
|
272
|
-
* @param {number} dt - delta time in seconds
|
|
273
|
-
* @param {number} gravity - gravity acceleration (positive = downward)
|
|
274
|
-
* @param {number} friction - velocity multiplier per frame (0.99 = slight drag)
|
|
275
|
-
*/
|
|
276
|
-
update(dt = 1/60, gravity = 0, friction = 1) {
|
|
277
|
-
for (let i = this.count - 1; i >= 0; i--) {
|
|
278
|
-
// Apply forces
|
|
279
|
-
this.vy[i] += gravity * dt;
|
|
280
|
-
this.vx[i] *= friction;
|
|
281
|
-
this.vy[i] *= friction;
|
|
282
|
-
|
|
283
|
-
// Integrate position
|
|
284
|
-
this.x[i] += this.vx[i];
|
|
285
|
-
this.y[i] += this.vy[i];
|
|
286
|
-
|
|
287
|
-
// Age
|
|
288
|
-
this.life[i]++;
|
|
289
|
-
|
|
290
|
-
// Fade alpha based on remaining life
|
|
291
|
-
const lifeRatio = this.life[i] / this.maxLife[i];
|
|
292
|
-
this.alpha[i] = 1 - lifeRatio; // linear fade out
|
|
293
|
-
|
|
294
|
-
// Kill if expired: swap with last alive particle
|
|
295
|
-
if (this.life[i] >= this.maxLife[i]) {
|
|
296
|
-
this.count--;
|
|
297
|
-
if (i < this.count) {
|
|
298
|
-
// Swap all properties
|
|
299
|
-
this.x[i] = this.x[this.count];
|
|
300
|
-
this.y[i] = this.y[this.count];
|
|
301
|
-
this.vx[i] = this.vx[this.count];
|
|
302
|
-
this.vy[i] = this.vy[this.count];
|
|
303
|
-
this.life[i] = this.life[this.count];
|
|
304
|
-
this.maxLife[i] = this.maxLife[this.count];
|
|
305
|
-
this.size[i] = this.size[this.count];
|
|
306
|
-
this.alpha[i] = this.alpha[this.count];
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Render all alive particles to a Canvas 2D context.
|
|
314
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
315
|
-
* @param {string} color - base color (rgb format, alpha applied per-particle)
|
|
316
|
-
*/
|
|
317
|
-
render(ctx, color = '255, 255, 255') {
|
|
318
|
-
for (let i = 0; i < this.count; i++) {
|
|
319
|
-
ctx.beginPath();
|
|
320
|
-
ctx.arc(this.x[i], this.y[i], this.size[i], 0, Math.PI * 2);
|
|
321
|
-
ctx.fillStyle = `rgba(${color}, ${this.alpha[i].toFixed(3)})`;
|
|
322
|
-
ctx.fill();
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
**Usage:**
|
|
329
|
-
```js
|
|
330
|
-
const ps = new ParticleSystem(5000);
|
|
331
|
-
|
|
332
|
-
// Continuous emitter
|
|
333
|
-
function emit() {
|
|
334
|
-
ps.spawn(
|
|
335
|
-
canvas.width / 2, canvas.height / 2,
|
|
336
|
-
(Math.random() - 0.5) * 4,
|
|
337
|
-
(Math.random() - 0.5) * 4,
|
|
338
|
-
80 + Math.random() * 40
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
function loop() {
|
|
343
|
-
for (let i = 0; i < 5; i++) emit(); // 5 particles per frame
|
|
344
|
-
ps.update(1/60, 0.1, 0.99);
|
|
345
|
-
|
|
346
|
-
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)'; // trail
|
|
347
|
-
ctx.fillRect(0, 0, w, h);
|
|
348
|
-
ps.render(ctx);
|
|
349
|
-
|
|
350
|
-
requestAnimationFrame(loop);
|
|
351
|
-
}
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
---
|
|
355
|
-
|
|
356
|
-
## Complete Flow Field
|
|
357
|
-
|
|
358
|
-
Noise-driven vector field with particle followers. Full implementation with color and trail effects.
|
|
359
|
-
|
|
360
|
-
```js
|
|
361
|
-
// ─── Flow Field ─────────────────────────────────────────────────
|
|
362
|
-
// A grid of angle vectors derived from noise. Particles follow
|
|
363
|
-
// the field, creating organic line patterns.
|
|
364
|
-
|
|
365
|
-
class FlowField {
|
|
366
|
-
/**
|
|
367
|
-
* @param {number} width - canvas logical width
|
|
368
|
-
* @param {number} height - canvas logical height
|
|
369
|
-
* @param {number} cellSize - grid cell size in pixels
|
|
370
|
-
* @param {object} options
|
|
371
|
-
*/
|
|
372
|
-
constructor(width, height, cellSize = 20, options = {}) {
|
|
373
|
-
this.width = width;
|
|
374
|
-
this.height = height;
|
|
375
|
-
this.cellSize = cellSize;
|
|
376
|
-
|
|
377
|
-
this.cols = Math.ceil(width / cellSize);
|
|
378
|
-
this.rows = Math.ceil(height / cellSize);
|
|
379
|
-
|
|
380
|
-
// Flat array of angles (radians)
|
|
381
|
-
this.field = new Float32Array(this.cols * this.rows);
|
|
382
|
-
|
|
383
|
-
// Config
|
|
384
|
-
this.noiseScale = options.noiseScale || 0.003; // how zoomed-in the noise is
|
|
385
|
-
this.noiseZ = 0; // animate noise over time
|
|
386
|
-
this.noiseSpeed = options.noiseSpeed || 0.002; // z-axis speed
|
|
387
|
-
|
|
388
|
-
// Particles
|
|
389
|
-
this.particleCount = options.particles || 1000;
|
|
390
|
-
this.particles = [];
|
|
391
|
-
this.maxSpeed = options.maxSpeed || 2;
|
|
392
|
-
this.force = options.force || 0.3;
|
|
393
|
-
|
|
394
|
-
this._initParticles();
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
_initParticles() {
|
|
398
|
-
for (let i = 0; i < this.particleCount; i++) {
|
|
399
|
-
this.particles.push({
|
|
400
|
-
x: Math.random() * this.width,
|
|
401
|
-
y: Math.random() * this.height,
|
|
402
|
-
vx: 0,
|
|
403
|
-
vy: 0,
|
|
404
|
-
// Previous position for line drawing
|
|
405
|
-
px: 0,
|
|
406
|
-
py: 0,
|
|
407
|
-
age: Math.floor(Math.random() * 200), // stagger lifespans
|
|
408
|
-
maxAge: 200 + Math.floor(Math.random() * 100),
|
|
409
|
-
hue: 0, // set during update
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Rebuild the angle grid from noise.
|
|
416
|
-
* Call once per frame before updating particles.
|
|
417
|
-
*/
|
|
418
|
-
updateField() {
|
|
419
|
-
this.noiseZ += this.noiseSpeed;
|
|
420
|
-
|
|
421
|
-
for (let y = 0; y < this.rows; y++) {
|
|
422
|
-
for (let x = 0; x < this.cols; x++) {
|
|
423
|
-
// Noise value in [-1, 1], map to full rotation
|
|
424
|
-
const n = SimplexNoise.noise3D(
|
|
425
|
-
x * this.noiseScale * this.cellSize,
|
|
426
|
-
y * this.noiseScale * this.cellSize,
|
|
427
|
-
this.noiseZ
|
|
428
|
-
);
|
|
429
|
-
this.field[y * this.cols + x] = n * Math.PI * 2;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* Get the field angle at a given pixel position.
|
|
436
|
-
* Returns 0 if out of bounds.
|
|
437
|
-
*/
|
|
438
|
-
lookup(x, y) {
|
|
439
|
-
const col = Math.floor(x / this.cellSize);
|
|
440
|
-
const row = Math.floor(y / this.cellSize);
|
|
441
|
-
if (col < 0 || col >= this.cols || row < 0 || row >= this.rows) return 0;
|
|
442
|
-
return this.field[row * this.cols + col];
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* Update all particles: follow field, apply velocity, handle wrapping/respawn.
|
|
447
|
-
*/
|
|
448
|
-
updateParticles() {
|
|
449
|
-
for (const p of this.particles) {
|
|
450
|
-
// Store previous position (for line drawing)
|
|
451
|
-
p.px = p.x;
|
|
452
|
-
p.py = p.y;
|
|
453
|
-
|
|
454
|
-
// Get field angle at current position
|
|
455
|
-
const angle = this.lookup(p.x, p.y);
|
|
456
|
-
|
|
457
|
-
// Apply force in field direction
|
|
458
|
-
p.vx += Math.cos(angle) * this.force;
|
|
459
|
-
p.vy += Math.sin(angle) * this.force;
|
|
460
|
-
|
|
461
|
-
// Clamp speed
|
|
462
|
-
const speed = Math.sqrt(p.vx * p.vx + p.vy * p.vy);
|
|
463
|
-
if (speed > this.maxSpeed) {
|
|
464
|
-
p.vx = (p.vx / speed) * this.maxSpeed;
|
|
465
|
-
p.vy = (p.vy / speed) * this.maxSpeed;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
// Move
|
|
469
|
-
p.x += p.vx;
|
|
470
|
-
p.y += p.vy;
|
|
471
|
-
|
|
472
|
-
// Slight friction
|
|
473
|
-
p.vx *= 0.96;
|
|
474
|
-
p.vy *= 0.96;
|
|
475
|
-
|
|
476
|
-
// Color based on angle
|
|
477
|
-
p.hue = ((angle / (Math.PI * 2)) * 360 + 360) % 360;
|
|
478
|
-
|
|
479
|
-
// Age and respawn
|
|
480
|
-
p.age++;
|
|
481
|
-
if (p.age > p.maxAge || p.x < 0 || p.x > this.width || p.y < 0 || p.y > this.height) {
|
|
482
|
-
p.x = Math.random() * this.width;
|
|
483
|
-
p.y = Math.random() * this.height;
|
|
484
|
-
p.px = p.x;
|
|
485
|
-
p.py = p.y;
|
|
486
|
-
p.vx = 0;
|
|
487
|
-
p.vy = 0;
|
|
488
|
-
p.age = 0;
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* Render particle trails as lines.
|
|
495
|
-
*/
|
|
496
|
-
render(ctx) {
|
|
497
|
-
for (const p of this.particles) {
|
|
498
|
-
// Skip first frame (no previous position)
|
|
499
|
-
if (p.age === 0) continue;
|
|
500
|
-
|
|
501
|
-
const alpha = Math.min(1, (1 - p.age / p.maxAge) * 0.8);
|
|
502
|
-
ctx.beginPath();
|
|
503
|
-
ctx.moveTo(p.px, p.py);
|
|
504
|
-
ctx.lineTo(p.x, p.y);
|
|
505
|
-
ctx.strokeStyle = `hsla(${p.hue}, 70%, 60%, ${alpha})`;
|
|
506
|
-
ctx.lineWidth = 1;
|
|
507
|
-
ctx.stroke();
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
// ─── Usage ──────────────────────────────────────────────────────
|
|
513
|
-
//
|
|
514
|
-
// const canvas = document.getElementById('canvas');
|
|
515
|
-
// const ctx = setupCanvas(canvas, window.innerWidth, window.innerHeight);
|
|
516
|
-
// SimplexNoise.seed(42);
|
|
517
|
-
//
|
|
518
|
-
// const ff = new FlowField(canvas.clientWidth, canvas.clientHeight, 20, {
|
|
519
|
-
// particles: 2000,
|
|
520
|
-
// noiseScale: 0.004,
|
|
521
|
-
// noiseSpeed: 0.001,
|
|
522
|
-
// maxSpeed: 2,
|
|
523
|
-
// force: 0.2,
|
|
524
|
-
// });
|
|
525
|
-
//
|
|
526
|
-
// function loop() {
|
|
527
|
-
// // Trail fade (no clearRect!)
|
|
528
|
-
// ctx.fillStyle = 'rgba(10, 10, 15, 0.03)';
|
|
529
|
-
// ctx.fillRect(0, 0, canvas.clientWidth, canvas.clientHeight);
|
|
530
|
-
//
|
|
531
|
-
// ff.updateField();
|
|
532
|
-
// ff.updateParticles();
|
|
533
|
-
// ff.render(ctx);
|
|
534
|
-
//
|
|
535
|
-
// requestAnimationFrame(loop);
|
|
536
|
-
// }
|
|
537
|
-
// requestAnimationFrame(loop);
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
---
|
|
541
|
-
|
|
542
|
-
## L-System Renderer
|
|
543
|
-
|
|
544
|
-
Complete L-system with string expansion and turtle graphics rendering.
|
|
545
|
-
|
|
546
|
-
```js
|
|
547
|
-
// ─── L-System ───────────────────────────────────────────────────
|
|
548
|
-
// String-rewriting system + turtle graphics.
|
|
549
|
-
// Produces fractal plants, trees, curves.
|
|
550
|
-
|
|
551
|
-
class LSystem {
|
|
552
|
-
/**
|
|
553
|
-
* @param {string} axiom - starting string
|
|
554
|
-
* @param {Object<string, string>} rules - production rules { 'F': 'F[+F]F[-F]F' }
|
|
555
|
-
* @param {number} angle - turn angle in degrees
|
|
556
|
-
*/
|
|
557
|
-
constructor(axiom, rules, angle) {
|
|
558
|
-
this.axiom = axiom;
|
|
559
|
-
this.rules = rules;
|
|
560
|
-
this.angle = (angle * Math.PI) / 180; // convert to radians
|
|
561
|
-
this.commands = axiom;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* Expand the L-system string by N iterations.
|
|
566
|
-
* WARNING: string length grows exponentially. Keep iterations low (4-7).
|
|
567
|
-
*/
|
|
568
|
-
generate(iterations) {
|
|
569
|
-
this.commands = this.axiom;
|
|
570
|
-
for (let i = 0; i < iterations; i++) {
|
|
571
|
-
let next = '';
|
|
572
|
-
for (const char of this.commands) {
|
|
573
|
-
next += this.rules[char] || char;
|
|
574
|
-
}
|
|
575
|
-
this.commands = next;
|
|
576
|
-
}
|
|
577
|
-
return this.commands;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
/**
|
|
581
|
-
* Render the L-system commands to a canvas context.
|
|
582
|
-
* @param {CanvasRenderingContext2D} ctx
|
|
583
|
-
* @param {number} startX - turtle start x
|
|
584
|
-
* @param {number} startY - turtle start y
|
|
585
|
-
* @param {number} startAngle - initial heading in radians (default: up)
|
|
586
|
-
* @param {number} stepLength - length per 'F' step
|
|
587
|
-
* @param {object} style - { strokeStyle, lineWidth, depthFade }
|
|
588
|
-
*/
|
|
589
|
-
render(ctx, startX, startY, startAngle = -Math.PI / 2, stepLength = 5, style = {}) {
|
|
590
|
-
const {
|
|
591
|
-
strokeStyle = '#88cc88',
|
|
592
|
-
lineWidth = 1,
|
|
593
|
-
depthFade = true, // fade color with stack depth
|
|
594
|
-
} = style;
|
|
595
|
-
|
|
596
|
-
// Turtle state
|
|
597
|
-
let x = startX;
|
|
598
|
-
let y = startY;
|
|
599
|
-
let angle = startAngle;
|
|
600
|
-
let depth = 0;
|
|
601
|
-
const stack = []; // save/restore stack for [ ]
|
|
602
|
-
|
|
603
|
-
ctx.save();
|
|
604
|
-
ctx.lineCap = 'round';
|
|
605
|
-
|
|
606
|
-
for (const char of this.commands) {
|
|
607
|
-
switch (char) {
|
|
608
|
-
// F: move forward, drawing a line
|
|
609
|
-
case 'F': {
|
|
610
|
-
const nx = x + Math.cos(angle) * stepLength;
|
|
611
|
-
const ny = y + Math.sin(angle) * stepLength;
|
|
612
|
-
|
|
613
|
-
ctx.beginPath();
|
|
614
|
-
ctx.moveTo(x, y);
|
|
615
|
-
ctx.lineTo(nx, ny);
|
|
616
|
-
|
|
617
|
-
if (depthFade) {
|
|
618
|
-
const alpha = Math.max(0.1, 1 - depth * 0.15);
|
|
619
|
-
const width = Math.max(0.5, lineWidth - depth * 0.2);
|
|
620
|
-
ctx.strokeStyle = strokeStyle.includes('rgba')
|
|
621
|
-
? strokeStyle
|
|
622
|
-
: `rgba(136, 204, 136, ${alpha})`;
|
|
623
|
-
ctx.lineWidth = width;
|
|
624
|
-
} else {
|
|
625
|
-
ctx.strokeStyle = strokeStyle;
|
|
626
|
-
ctx.lineWidth = lineWidth;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
ctx.stroke();
|
|
630
|
-
x = nx;
|
|
631
|
-
y = ny;
|
|
632
|
-
break;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
// f: move forward without drawing (pen up)
|
|
636
|
-
case 'f': {
|
|
637
|
-
x += Math.cos(angle) * stepLength;
|
|
638
|
-
y += Math.sin(angle) * stepLength;
|
|
639
|
-
break;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
// +: turn right (clockwise)
|
|
643
|
-
case '+':
|
|
644
|
-
angle += this.angle;
|
|
645
|
-
break;
|
|
646
|
-
|
|
647
|
-
// -: turn left (counter-clockwise)
|
|
648
|
-
case '-':
|
|
649
|
-
angle -= this.angle;
|
|
650
|
-
break;
|
|
651
|
-
|
|
652
|
-
// [: push state (branch start)
|
|
653
|
-
case '[':
|
|
654
|
-
stack.push({ x, y, angle, depth });
|
|
655
|
-
depth++;
|
|
656
|
-
break;
|
|
657
|
-
|
|
658
|
-
// ]: pop state (branch end)
|
|
659
|
-
case ']': {
|
|
660
|
-
const state = stack.pop();
|
|
661
|
-
if (state) {
|
|
662
|
-
x = state.x;
|
|
663
|
-
y = state.y;
|
|
664
|
-
angle = state.angle;
|
|
665
|
-
depth = state.depth;
|
|
666
|
-
}
|
|
667
|
-
break;
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
ctx.restore();
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
// ─── Preset L-Systems ──────────────────────────────────────────
|
|
677
|
-
|
|
678
|
-
const LSYSTEM_PRESETS = {
|
|
679
|
-
// Fractal plant (bush-like)
|
|
680
|
-
plant: {
|
|
681
|
-
axiom: 'X',
|
|
682
|
-
rules: {
|
|
683
|
-
'X': 'F+[[X]-X]-F[-FX]+X',
|
|
684
|
-
'F': 'FF',
|
|
685
|
-
},
|
|
686
|
-
angle: 25,
|
|
687
|
-
iterations: 6,
|
|
688
|
-
stepLength: 3,
|
|
689
|
-
},
|
|
690
|
-
|
|
691
|
-
// Koch snowflake
|
|
692
|
-
koch: {
|
|
693
|
-
axiom: 'F--F--F',
|
|
694
|
-
rules: { 'F': 'F+F--F+F' },
|
|
695
|
-
angle: 60,
|
|
696
|
-
iterations: 4,
|
|
697
|
-
stepLength: 3,
|
|
698
|
-
},
|
|
699
|
-
|
|
700
|
-
// Sierpinski triangle
|
|
701
|
-
sierpinski: {
|
|
702
|
-
axiom: 'F-G-G',
|
|
703
|
-
rules: { 'F': 'F-G+F+G-F', 'G': 'GG' },
|
|
704
|
-
angle: 120,
|
|
705
|
-
iterations: 6,
|
|
706
|
-
stepLength: 4,
|
|
707
|
-
},
|
|
708
|
-
|
|
709
|
-
// Dragon curve
|
|
710
|
-
dragon: {
|
|
711
|
-
axiom: 'FX',
|
|
712
|
-
rules: { 'X': 'X+YF+', 'Y': '-FX-Y' },
|
|
713
|
-
angle: 90,
|
|
714
|
-
iterations: 12,
|
|
715
|
-
stepLength: 5,
|
|
716
|
-
},
|
|
717
|
-
|
|
718
|
-
// Binary tree
|
|
719
|
-
tree: {
|
|
720
|
-
axiom: 'F',
|
|
721
|
-
rules: { 'F': 'FF+[+F-F-F]-[-F+F+F]' },
|
|
722
|
-
angle: 22.5,
|
|
723
|
-
iterations: 4,
|
|
724
|
-
stepLength: 8,
|
|
725
|
-
},
|
|
726
|
-
};
|
|
727
|
-
|
|
728
|
-
// ─── Usage ──────────────────────────────────────────────────────
|
|
729
|
-
//
|
|
730
|
-
// const preset = LSYSTEM_PRESETS.plant;
|
|
731
|
-
// const ls = new LSystem(preset.axiom, preset.rules, preset.angle);
|
|
732
|
-
// ls.generate(preset.iterations);
|
|
733
|
-
//
|
|
734
|
-
// ctx.fillStyle = '#111';
|
|
735
|
-
// ctx.fillRect(0, 0, w, h);
|
|
736
|
-
// ls.render(ctx, w / 2, h, -Math.PI / 2, preset.stepLength, {
|
|
737
|
-
// strokeStyle: '#88cc88',
|
|
738
|
-
// lineWidth: 1.5,
|
|
739
|
-
// depthFade: true,
|
|
740
|
-
// });
|
|
741
|
-
```
|
|
742
|
-
|
|
743
|
-
---
|
|
744
|
-
|
|
745
|
-
## Lorenz Attractor
|
|
746
|
-
|
|
747
|
-
The classic strange attractor. 3D system projected to 2D canvas.
|
|
748
|
-
|
|
749
|
-
```js
|
|
750
|
-
// ─── Lorenz Attractor ───────────────────────────────────────────
|
|
751
|
-
// A chaotic system of 3 coupled ODEs. The trajectory never repeats
|
|
752
|
-
// and never intersects itself, creating the iconic butterfly shape.
|
|
753
|
-
//
|
|
754
|
-
// dx/dt = sigma * (y - x)
|
|
755
|
-
// dy/dt = x * (rho - z) - y
|
|
756
|
-
// dz/dt = x * y - beta * z
|
|
757
|
-
|
|
758
|
-
class LorenzAttractor {
|
|
759
|
-
/**
|
|
760
|
-
* @param {object} options
|
|
761
|
-
* @param {number} options.sigma - Prandtl number (default 10)
|
|
762
|
-
* @param {number} options.rho - Rayleigh number (default 28)
|
|
763
|
-
* @param {number} options.beta - geometric factor (default 8/3)
|
|
764
|
-
* @param {number} options.dt - integration timestep
|
|
765
|
-
* @param {number} options.trailLength - how many points to remember
|
|
766
|
-
*/
|
|
767
|
-
constructor(options = {}) {
|
|
768
|
-
this.sigma = options.sigma || 10;
|
|
769
|
-
this.rho = options.rho || 28;
|
|
770
|
-
this.beta = options.beta || 8 / 3;
|
|
771
|
-
this.dt = options.dt || 0.005;
|
|
772
|
-
|
|
773
|
-
this.trailLength = options.trailLength || 5000;
|
|
774
|
-
|
|
775
|
-
// Current position in 3D space
|
|
776
|
-
this.x = 0.01;
|
|
777
|
-
this.y = 0;
|
|
778
|
-
this.z = 0;
|
|
779
|
-
|
|
780
|
-
// Trail history (ring buffer)
|
|
781
|
-
this.trail = new Float32Array(this.trailLength * 3); // [x,y,z, x,y,z, ...]
|
|
782
|
-
this.trailHead = 0;
|
|
783
|
-
this.trailCount = 0;
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
/**
|
|
787
|
-
* Step the simulation forward by one timestep (Runge-Kutta 4th order).
|
|
788
|
-
* RK4 is crucial for chaotic systems -- Euler integration diverges fast.
|
|
789
|
-
*/
|
|
790
|
-
step() {
|
|
791
|
-
const { sigma, rho, beta, dt } = this;
|
|
792
|
-
let { x, y, z } = this;
|
|
793
|
-
|
|
794
|
-
// Derivatives function
|
|
795
|
-
const f = (x, y, z) => ({
|
|
796
|
-
dx: sigma * (y - x),
|
|
797
|
-
dy: x * (rho - z) - y,
|
|
798
|
-
dz: x * y - beta * z,
|
|
799
|
-
});
|
|
800
|
-
|
|
801
|
-
// RK4 integration
|
|
802
|
-
const k1 = f(x, y, z);
|
|
803
|
-
const k2 = f(
|
|
804
|
-
x + k1.dx * dt * 0.5,
|
|
805
|
-
y + k1.dy * dt * 0.5,
|
|
806
|
-
z + k1.dz * dt * 0.5
|
|
807
|
-
);
|
|
808
|
-
const k3 = f(
|
|
809
|
-
x + k2.dx * dt * 0.5,
|
|
810
|
-
y + k2.dy * dt * 0.5,
|
|
811
|
-
z + k2.dz * dt * 0.5
|
|
812
|
-
);
|
|
813
|
-
const k4 = f(
|
|
814
|
-
x + k3.dx * dt,
|
|
815
|
-
y + k3.dy * dt,
|
|
816
|
-
z + k3.dz * dt
|
|
817
|
-
);
|
|
818
|
-
|
|
819
|
-
this.x += (dt / 6) * (k1.dx + 2*k2.dx + 2*k3.dx + k4.dx);
|
|
820
|
-
this.y += (dt / 6) * (k1.dy + 2*k2.dy + 2*k3.dy + k4.dy);
|
|
821
|
-
this.z += (dt / 6) * (k1.dz + 2*k2.dz + 2*k3.dz + k4.dz);
|
|
822
|
-
|
|
823
|
-
// Store in trail ring buffer
|
|
824
|
-
const idx = this.trailHead * 3;
|
|
825
|
-
this.trail[idx] = this.x;
|
|
826
|
-
this.trail[idx + 1] = this.y;
|
|
827
|
-
this.trail[idx + 2] = this.z;
|
|
828
|
-
this.trailHead = (this.trailHead + 1) % this.trailLength;
|
|
829
|
-
if (this.trailCount < this.trailLength) this.trailCount++;
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
/**
|
|
833
|
-
* Step N times (useful for faster evolution per frame).
|
|
834
|
-
*/
|
|
835
|
-
stepN(n) {
|
|
836
|
-
for (let i = 0; i < n; i++) this.step();
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
/**
|
|
840
|
-
* Project 3D point to 2D using simple orthographic projection.
|
|
841
|
-
* The Lorenz attractor lives roughly in x:[-20,20], y:[-25,25], z:[0,50].
|
|
842
|
-
* We map x->screen.x and z->screen.y for the classic side view.
|
|
843
|
-
*
|
|
844
|
-
* @param {number} cx - canvas center x
|
|
845
|
-
* @param {number} cy - canvas center y
|
|
846
|
-
* @param {number} scale - zoom factor
|
|
847
|
-
* @returns {{ sx: number, sy: number }} screen coordinates
|
|
848
|
-
*/
|
|
849
|
-
project(px, py, pz, cx, cy, scale = 8) {
|
|
850
|
-
return {
|
|
851
|
-
sx: cx + px * scale,
|
|
852
|
-
sy: cy - (pz - 25) * scale, // center z around 25, flip y-axis
|
|
853
|
-
};
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
/**
|
|
857
|
-
* Render the attractor trail to a 2D canvas.
|
|
858
|
-
* Older points are more transparent, creating a fade-in effect.
|
|
859
|
-
*/
|
|
860
|
-
render(ctx, cx, cy, scale = 8) {
|
|
861
|
-
if (this.trailCount < 2) return;
|
|
862
|
-
|
|
863
|
-
// Walk the ring buffer from oldest to newest
|
|
864
|
-
const start = this.trailCount < this.trailLength
|
|
865
|
-
? 0
|
|
866
|
-
: this.trailHead;
|
|
867
|
-
|
|
868
|
-
let prevIdx = start * 3;
|
|
869
|
-
let prev = this.project(
|
|
870
|
-
this.trail[prevIdx], this.trail[prevIdx+1], this.trail[prevIdx+2],
|
|
871
|
-
cx, cy, scale
|
|
872
|
-
);
|
|
873
|
-
|
|
874
|
-
for (let i = 1; i < this.trailCount; i++) {
|
|
875
|
-
const bufIdx = ((start + i) % this.trailLength) * 3;
|
|
876
|
-
const cur = this.project(
|
|
877
|
-
this.trail[bufIdx], this.trail[bufIdx+1], this.trail[bufIdx+2],
|
|
878
|
-
cx, cy, scale
|
|
879
|
-
);
|
|
880
|
-
|
|
881
|
-
// Alpha: oldest = faint, newest = bright
|
|
882
|
-
const t = i / this.trailCount;
|
|
883
|
-
const alpha = t * 0.9 + 0.1;
|
|
884
|
-
|
|
885
|
-
// Color: hue shifts along the trail
|
|
886
|
-
const hue = (t * 240 + 200) % 360; // blue to purple
|
|
887
|
-
|
|
888
|
-
ctx.beginPath();
|
|
889
|
-
ctx.moveTo(prev.sx, prev.sy);
|
|
890
|
-
ctx.lineTo(cur.sx, cur.sy);
|
|
891
|
-
ctx.strokeStyle = `hsla(${hue}, 80%, 60%, ${alpha})`;
|
|
892
|
-
ctx.lineWidth = 0.8;
|
|
893
|
-
ctx.stroke();
|
|
894
|
-
|
|
895
|
-
prev = cur;
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
// ─── Usage ──────────────────────────────────────────────────────
|
|
901
|
-
//
|
|
902
|
-
// const canvas = document.getElementById('canvas');
|
|
903
|
-
// const ctx = setupCanvas(canvas, window.innerWidth, window.innerHeight);
|
|
904
|
-
// const lorenz = new LorenzAttractor({ trailLength: 8000, dt: 0.005 });
|
|
905
|
-
//
|
|
906
|
-
// function loop() {
|
|
907
|
-
// // Dark background with slight trail
|
|
908
|
-
// ctx.fillStyle = 'rgba(5, 5, 15, 0.02)';
|
|
909
|
-
// ctx.fillRect(0, 0, canvas.clientWidth, canvas.clientHeight);
|
|
910
|
-
//
|
|
911
|
-
// // Step multiple times per frame for faster evolution
|
|
912
|
-
// lorenz.stepN(10);
|
|
913
|
-
//
|
|
914
|
-
// // Render centered on canvas
|
|
915
|
-
// lorenz.render(ctx, canvas.clientWidth / 2, canvas.clientHeight / 2, 8);
|
|
916
|
-
//
|
|
917
|
-
// requestAnimationFrame(loop);
|
|
918
|
-
// }
|
|
919
|
-
// requestAnimationFrame(loop);
|
|
920
|
-
//
|
|
921
|
-
// ─── Classic Parameters ─────────────────────────────────────────
|
|
922
|
-
// sigma=10, rho=28, beta=8/3 → classic butterfly
|
|
923
|
-
// sigma=10, rho=99.96, beta=8/3 → tighter knots
|
|
924
|
-
// sigma=14, rho=28, beta=8/3 → wider wings
|
|
925
|
-
```
|