@minhduydev/mdpi 0.3.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/README.md +31 -0
- package/dist/index.js +1187 -0
- package/dist/template/.pi/.env.example +28 -0
- package/dist/template/.pi/AGENTS.md +226 -0
- package/dist/template/.pi/QUALITY.md +13 -0
- package/dist/template/.pi/README.md +452 -0
- package/dist/template/.pi/VERSION +1 -0
- package/dist/template/.pi/agents/INDEX.md +54 -0
- package/dist/template/.pi/agents/build.md +194 -0
- package/dist/template/.pi/agents/explore.md +85 -0
- package/dist/template/.pi/agents/general.md +189 -0
- package/dist/template/.pi/agents/plan.md +407 -0
- package/dist/template/.pi/agents/review.md +198 -0
- package/dist/template/.pi/agents/scout.md +142 -0
- package/dist/template/.pi/agents/vision.md +157 -0
- package/dist/template/.pi/artifacts/example/plan.md +12 -0
- package/dist/template/.pi/artifacts/example/progress.md +4 -0
- package/dist/template/.pi/artifacts/example/research.md +4 -0
- package/dist/template/.pi/artifacts/example/spec.md +16 -0
- package/dist/template/.pi/context/architecture.md +141 -0
- package/dist/template/.pi/context/fallow.md +137 -0
- package/dist/template/.pi/extensions/templates-injector.ts +76 -0
- package/dist/template/.pi/extensions/workflows-runner.ts +301 -0
- package/dist/template/.pi/guard.example.json +75 -0
- package/dist/template/.pi/prompts/INDEX.md +78 -0
- package/dist/template/.pi/prompts/audit.md +109 -0
- package/dist/template/.pi/prompts/close.md +88 -0
- package/dist/template/.pi/prompts/create.md +197 -0
- package/dist/template/.pi/prompts/fix.md +117 -0
- package/dist/template/.pi/prompts/gc.md +112 -0
- package/dist/template/.pi/prompts/init.md +206 -0
- package/dist/template/.pi/prompts/loop-check.md +87 -0
- package/dist/template/.pi/prompts/loop-init.md +157 -0
- package/dist/template/.pi/prompts/loop-review.md +90 -0
- package/dist/template/.pi/prompts/plan.md +254 -0
- package/dist/template/.pi/prompts/research.md +136 -0
- package/dist/template/.pi/prompts/ship.md +219 -0
- package/dist/template/.pi/prompts/status.md +92 -0
- package/dist/template/.pi/prompts/verify.md +154 -0
- package/dist/template/.pi/scripts/gc-check.sh +86 -0
- package/dist/template/.pi/settings.json +15 -0
- package/dist/template/.pi/skills/INDEX.md +331 -0
- package/dist/template/.pi/skills/accessibility-audit/SKILL.md +205 -0
- package/dist/template/.pi/skills/accessibility-audit/references/accessibility-checklist.md +109 -0
- package/dist/template/.pi/skills/agent-code-quality-gate/SKILL.md +131 -0
- package/dist/template/.pi/skills/api-and-interface-design/SKILL.md +159 -0
- package/dist/template/.pi/skills/behavioral-kernel/SKILL.md +92 -0
- package/dist/template/.pi/skills/brainstorming/SKILL.md +138 -0
- package/dist/template/.pi/skills/browser-testing-with-devtools/SKILL.md +90 -0
- package/dist/template/.pi/skills/chrome-devtools/SKILL.md +129 -0
- package/dist/template/.pi/skills/ci-cd-and-automation/SKILL.md +199 -0
- package/dist/template/.pi/skills/cloudflare/SKILL.md +271 -0
- package/dist/template/.pi/skills/cloudflare/references/agents-sdk/README.md +35 -0
- package/dist/template/.pi/skills/cloudflare/references/agents-sdk/api.md +100 -0
- package/dist/template/.pi/skills/cloudflare/references/agents-sdk/configuration.md +99 -0
- package/dist/template/.pi/skills/cloudflare/references/agents-sdk/gotchas.md +59 -0
- package/dist/template/.pi/skills/cloudflare/references/agents-sdk/patterns.md +89 -0
- package/dist/template/.pi/skills/cloudflare/references/ai-gateway/README.md +695 -0
- package/dist/template/.pi/skills/cloudflare/references/ai-search/README.md +14 -0
- package/dist/template/.pi/skills/cloudflare/references/ai-search/api.md +38 -0
- package/dist/template/.pi/skills/cloudflare/references/ai-search/configuration.md +52 -0
- package/dist/template/.pi/skills/cloudflare/references/ai-search/gotchas.md +41 -0
- package/dist/template/.pi/skills/cloudflare/references/ai-search/patterns.md +45 -0
- package/dist/template/.pi/skills/cloudflare/references/analytics-engine/README.md +14 -0
- package/dist/template/.pi/skills/cloudflare/references/analytics-engine/api.md +27 -0
- package/dist/template/.pi/skills/cloudflare/references/analytics-engine/configuration.md +45 -0
- package/dist/template/.pi/skills/cloudflare/references/analytics-engine/gotchas.md +3 -0
- package/dist/template/.pi/skills/cloudflare/references/analytics-engine/patterns.md +36 -0
- package/dist/template/.pi/skills/cloudflare/references/api/README.md +21 -0
- package/dist/template/.pi/skills/cloudflare/references/api/api.md +31 -0
- package/dist/template/.pi/skills/cloudflare/references/api/configuration.md +20 -0
- package/dist/template/.pi/skills/cloudflare/references/api/gotchas.md +28 -0
- package/dist/template/.pi/skills/cloudflare/references/api/patterns.md +47 -0
- package/dist/template/.pi/skills/cloudflare/references/api-shield/README.md +20 -0
- package/dist/template/.pi/skills/cloudflare/references/api-shield/api.md +78 -0
- package/dist/template/.pi/skills/cloudflare/references/api-shield/configuration.md +128 -0
- package/dist/template/.pi/skills/cloudflare/references/api-shield/gotchas.md +51 -0
- package/dist/template/.pi/skills/cloudflare/references/api-shield/patterns.md +145 -0
- package/dist/template/.pi/skills/cloudflare/references/argo-smart-routing/README.md +16 -0
- package/dist/template/.pi/skills/cloudflare/references/argo-smart-routing/api.md +50 -0
- package/dist/template/.pi/skills/cloudflare/references/argo-smart-routing/configuration.md +53 -0
- package/dist/template/.pi/skills/cloudflare/references/argo-smart-routing/gotchas.md +16 -0
- package/dist/template/.pi/skills/cloudflare/references/argo-smart-routing/patterns.md +45 -0
- package/dist/template/.pi/skills/cloudflare/references/bindings/README.md +14 -0
- package/dist/template/.pi/skills/cloudflare/references/bindings/api.md +3 -0
- package/dist/template/.pi/skills/cloudflare/references/bindings/configuration.md +58 -0
- package/dist/template/.pi/skills/cloudflare/references/bindings/gotchas.md +35 -0
- package/dist/template/.pi/skills/cloudflare/references/bindings/patterns.md +37 -0
- package/dist/template/.pi/skills/cloudflare/references/bot-management/README.md +71 -0
- package/dist/template/.pi/skills/cloudflare/references/bot-management/api.md +168 -0
- package/dist/template/.pi/skills/cloudflare/references/bot-management/configuration.md +114 -0
- package/dist/template/.pi/skills/cloudflare/references/bot-management/gotchas.md +99 -0
- package/dist/template/.pi/skills/cloudflare/references/bot-management/patterns.md +125 -0
- package/dist/template/.pi/skills/cloudflare/references/browser-rendering/README.md +16 -0
- package/dist/template/.pi/skills/cloudflare/references/browser-rendering/api.md +54 -0
- package/dist/template/.pi/skills/cloudflare/references/browser-rendering/configuration.md +47 -0
- package/dist/template/.pi/skills/cloudflare/references/browser-rendering/gotchas.md +29 -0
- package/dist/template/.pi/skills/cloudflare/references/browser-rendering/patterns.md +29 -0
- package/dist/template/.pi/skills/cloudflare/references/c3/README.md +264 -0
- package/dist/template/.pi/skills/cloudflare/references/cache-reserve/README.md +93 -0
- package/dist/template/.pi/skills/cloudflare/references/cache-reserve/api.md +176 -0
- package/dist/template/.pi/skills/cloudflare/references/cache-reserve/configuration.md +164 -0
- package/dist/template/.pi/skills/cloudflare/references/cache-reserve/gotchas.md +203 -0
- package/dist/template/.pi/skills/cloudflare/references/cache-reserve/patterns.md +180 -0
- package/dist/template/.pi/skills/cloudflare/references/containers/README.md +16 -0
- package/dist/template/.pi/skills/cloudflare/references/containers/api.md +43 -0
- package/dist/template/.pi/skills/cloudflare/references/containers/configuration.md +56 -0
- package/dist/template/.pi/skills/cloudflare/references/containers/gotchas.md +21 -0
- package/dist/template/.pi/skills/cloudflare/references/containers/patterns.md +40 -0
- package/dist/template/.pi/skills/cloudflare/references/cron-triggers/README.md +85 -0
- package/dist/template/.pi/skills/cloudflare/references/cron-triggers/api.md +198 -0
- package/dist/template/.pi/skills/cloudflare/references/cron-triggers/configuration.md +151 -0
- package/dist/template/.pi/skills/cloudflare/references/cron-triggers/gotchas.md +129 -0
- package/dist/template/.pi/skills/cloudflare/references/cron-triggers/patterns.md +122 -0
- package/dist/template/.pi/skills/cloudflare/references/d1/README.md +92 -0
- package/dist/template/.pi/skills/cloudflare/references/d1/api.md +141 -0
- package/dist/template/.pi/skills/cloudflare/references/d1/configuration.md +127 -0
- package/dist/template/.pi/skills/cloudflare/references/d1/gotchas.md +70 -0
- package/dist/template/.pi/skills/cloudflare/references/d1/patterns.md +144 -0
- package/dist/template/.pi/skills/cloudflare/references/ddos/README.md +34 -0
- package/dist/template/.pi/skills/cloudflare/references/ddos/api.md +136 -0
- package/dist/template/.pi/skills/cloudflare/references/ddos/configuration.md +67 -0
- package/dist/template/.pi/skills/cloudflare/references/ddos/gotchas.md +114 -0
- package/dist/template/.pi/skills/cloudflare/references/ddos/patterns.md +158 -0
- package/dist/template/.pi/skills/cloudflare/references/do-storage/README.md +62 -0
- package/dist/template/.pi/skills/cloudflare/references/do-storage/api.md +89 -0
- package/dist/template/.pi/skills/cloudflare/references/do-storage/configuration.md +116 -0
- package/dist/template/.pi/skills/cloudflare/references/do-storage/gotchas.md +93 -0
- package/dist/template/.pi/skills/cloudflare/references/do-storage/patterns.md +112 -0
- package/dist/template/.pi/skills/cloudflare/references/durable-objects/README.md +125 -0
- package/dist/template/.pi/skills/cloudflare/references/durable-objects/api.md +152 -0
- package/dist/template/.pi/skills/cloudflare/references/durable-objects/configuration.md +148 -0
- package/dist/template/.pi/skills/cloudflare/references/durable-objects/gotchas.md +158 -0
- package/dist/template/.pi/skills/cloudflare/references/durable-objects/patterns.md +255 -0
- package/dist/template/.pi/skills/cloudflare/references/email-routing/README.md +18 -0
- package/dist/template/.pi/skills/cloudflare/references/email-routing/api.md +46 -0
- package/dist/template/.pi/skills/cloudflare/references/email-routing/configuration.md +63 -0
- package/dist/template/.pi/skills/cloudflare/references/email-routing/gotchas.md +16 -0
- package/dist/template/.pi/skills/cloudflare/references/email-routing/patterns.md +46 -0
- package/dist/template/.pi/skills/cloudflare/references/email-workers/README.md +598 -0
- package/dist/template/.pi/skills/cloudflare/references/hyperdrive/README.md +62 -0
- package/dist/template/.pi/skills/cloudflare/references/hyperdrive/api.md +137 -0
- package/dist/template/.pi/skills/cloudflare/references/hyperdrive/configuration.md +133 -0
- package/dist/template/.pi/skills/cloudflare/references/hyperdrive/gotchas.md +184 -0
- package/dist/template/.pi/skills/cloudflare/references/hyperdrive/patterns.md +176 -0
- package/dist/template/.pi/skills/cloudflare/references/images/README.md +14 -0
- package/dist/template/.pi/skills/cloudflare/references/images/api.md +3 -0
- package/dist/template/.pi/skills/cloudflare/references/images/configuration.md +45 -0
- package/dist/template/.pi/skills/cloudflare/references/images/gotchas.md +23 -0
- package/dist/template/.pi/skills/cloudflare/references/images/patterns.md +31 -0
- package/dist/template/.pi/skills/cloudflare/references/kv/README.md +60 -0
- package/dist/template/.pi/skills/cloudflare/references/kv/api.md +114 -0
- package/dist/template/.pi/skills/cloudflare/references/kv/configuration.md +92 -0
- package/dist/template/.pi/skills/cloudflare/references/kv/gotchas.md +117 -0
- package/dist/template/.pi/skills/cloudflare/references/kv/patterns.md +139 -0
- package/dist/template/.pi/skills/cloudflare/references/miniflare/README.md +64 -0
- package/dist/template/.pi/skills/cloudflare/references/miniflare/api.md +144 -0
- package/dist/template/.pi/skills/cloudflare/references/miniflare/configuration.md +203 -0
- package/dist/template/.pi/skills/cloudflare/references/miniflare/gotchas.md +187 -0
- package/dist/template/.pi/skills/cloudflare/references/miniflare/patterns.md +211 -0
- package/dist/template/.pi/skills/cloudflare/references/network-interconnect/README.md +60 -0
- package/dist/template/.pi/skills/cloudflare/references/network-interconnect/api.md +240 -0
- package/dist/template/.pi/skills/cloudflare/references/network-interconnect/configuration.md +127 -0
- package/dist/template/.pi/skills/cloudflare/references/network-interconnect/gotchas.md +171 -0
- package/dist/template/.pi/skills/cloudflare/references/network-interconnect/patterns.md +171 -0
- package/dist/template/.pi/skills/cloudflare/references/observability/README.md +18 -0
- package/dist/template/.pi/skills/cloudflare/references/observability/api.md +51 -0
- package/dist/template/.pi/skills/cloudflare/references/observability/configuration.md +60 -0
- package/dist/template/.pi/skills/cloudflare/references/observability/gotchas.md +36 -0
- package/dist/template/.pi/skills/cloudflare/references/observability/patterns.md +42 -0
- package/dist/template/.pi/skills/cloudflare/references/pages/README.md +76 -0
- package/dist/template/.pi/skills/cloudflare/references/pages/api.md +200 -0
- package/dist/template/.pi/skills/cloudflare/references/pages/configuration.md +228 -0
- package/dist/template/.pi/skills/cloudflare/references/pages/gotchas.md +161 -0
- package/dist/template/.pi/skills/cloudflare/references/pages/patterns.md +145 -0
- package/dist/template/.pi/skills/cloudflare/references/pages-functions/README.md +57 -0
- package/dist/template/.pi/skills/cloudflare/references/pages-functions/api.md +201 -0
- package/dist/template/.pi/skills/cloudflare/references/pages-functions/configuration.md +159 -0
- package/dist/template/.pi/skills/cloudflare/references/pages-functions/gotchas.md +151 -0
- package/dist/template/.pi/skills/cloudflare/references/pages-functions/patterns.md +190 -0
- package/dist/template/.pi/skills/cloudflare/references/pipelines/README.md +664 -0
- package/dist/template/.pi/skills/cloudflare/references/pulumi/README.md +107 -0
- package/dist/template/.pi/skills/cloudflare/references/pulumi/api.md +194 -0
- package/dist/template/.pi/skills/cloudflare/references/pulumi/configuration.md +216 -0
- package/dist/template/.pi/skills/cloudflare/references/pulumi/gotchas.md +223 -0
- package/dist/template/.pi/skills/cloudflare/references/pulumi/patterns.md +139 -0
- package/dist/template/.pi/skills/cloudflare/references/queues/README.md +69 -0
- package/dist/template/.pi/skills/cloudflare/references/queues/api.md +138 -0
- package/dist/template/.pi/skills/cloudflare/references/queues/configuration.md +125 -0
- package/dist/template/.pi/skills/cloudflare/references/queues/gotchas.md +112 -0
- package/dist/template/.pi/skills/cloudflare/references/queues/patterns.md +155 -0
- package/dist/template/.pi/skills/cloudflare/references/r2/README.md +61 -0
- package/dist/template/.pi/skills/cloudflare/references/r2/api.md +127 -0
- package/dist/template/.pi/skills/cloudflare/references/r2/configuration.md +76 -0
- package/dist/template/.pi/skills/cloudflare/references/r2/gotchas.md +94 -0
- package/dist/template/.pi/skills/cloudflare/references/r2/patterns.md +127 -0
- package/dist/template/.pi/skills/cloudflare/references/r2-data-catalog/README.md +18 -0
- package/dist/template/.pi/skills/cloudflare/references/r2-data-catalog/api.md +29 -0
- package/dist/template/.pi/skills/cloudflare/references/r2-data-catalog/configuration.md +39 -0
- package/dist/template/.pi/skills/cloudflare/references/r2-data-catalog/gotchas.md +20 -0
- package/dist/template/.pi/skills/cloudflare/references/r2-data-catalog/patterns.md +46 -0
- package/dist/template/.pi/skills/cloudflare/references/r2-sql/README.md +512 -0
- package/dist/template/.pi/skills/cloudflare/references/realtime-sfu/README.md +21 -0
- package/dist/template/.pi/skills/cloudflare/references/realtime-sfu/api.md +135 -0
- package/dist/template/.pi/skills/cloudflare/references/realtime-sfu/configuration.md +63 -0
- package/dist/template/.pi/skills/cloudflare/references/realtime-sfu/gotchas.md +75 -0
- package/dist/template/.pi/skills/cloudflare/references/realtime-sfu/patterns.md +102 -0
- package/dist/template/.pi/skills/cloudflare/references/realtimekit/README.md +81 -0
- package/dist/template/.pi/skills/cloudflare/references/realtimekit/api.md +164 -0
- package/dist/template/.pi/skills/cloudflare/references/realtimekit/configuration.md +147 -0
- package/dist/template/.pi/skills/cloudflare/references/realtimekit/gotchas.md +172 -0
- package/dist/template/.pi/skills/cloudflare/references/realtimekit/patterns.md +155 -0
- package/dist/template/.pi/skills/cloudflare/references/sandbox/README.md +90 -0
- package/dist/template/.pi/skills/cloudflare/references/sandbox/api.md +178 -0
- package/dist/template/.pi/skills/cloudflare/references/sandbox/configuration.md +131 -0
- package/dist/template/.pi/skills/cloudflare/references/sandbox/gotchas.md +156 -0
- package/dist/template/.pi/skills/cloudflare/references/sandbox/patterns.md +203 -0
- package/dist/template/.pi/skills/cloudflare/references/secrets-store/README.md +58 -0
- package/dist/template/.pi/skills/cloudflare/references/secrets-store/api.md +182 -0
- package/dist/template/.pi/skills/cloudflare/references/secrets-store/configuration.md +140 -0
- package/dist/template/.pi/skills/cloudflare/references/secrets-store/gotchas.md +129 -0
- package/dist/template/.pi/skills/cloudflare/references/secrets-store/patterns.md +218 -0
- package/dist/template/.pi/skills/cloudflare/references/smart-placement/README.md +91 -0
- package/dist/template/.pi/skills/cloudflare/references/smart-placement/api.md +139 -0
- package/dist/template/.pi/skills/cloudflare/references/smart-placement/configuration.md +129 -0
- package/dist/template/.pi/skills/cloudflare/references/smart-placement/gotchas.md +87 -0
- package/dist/template/.pi/skills/cloudflare/references/smart-placement/patterns.md +135 -0
- package/dist/template/.pi/skills/cloudflare/references/snippets/README.md +15 -0
- package/dist/template/.pi/skills/cloudflare/references/snippets/api.md +47 -0
- package/dist/template/.pi/skills/cloudflare/references/snippets/configuration.md +33 -0
- package/dist/template/.pi/skills/cloudflare/references/snippets/gotchas.md +21 -0
- package/dist/template/.pi/skills/cloudflare/references/snippets/patterns.md +34 -0
- package/dist/template/.pi/skills/cloudflare/references/spectrum/README.md +16 -0
- package/dist/template/.pi/skills/cloudflare/references/spectrum/api.md +24 -0
- package/dist/template/.pi/skills/cloudflare/references/spectrum/configuration.md +43 -0
- package/dist/template/.pi/skills/cloudflare/references/spectrum/gotchas.md +42 -0
- package/dist/template/.pi/skills/cloudflare/references/spectrum/patterns.md +40 -0
- package/dist/template/.pi/skills/cloudflare/references/static-assets/README.md +14 -0
- package/dist/template/.pi/skills/cloudflare/references/static-assets/api.md +3 -0
- package/dist/template/.pi/skills/cloudflare/references/static-assets/configuration.md +47 -0
- package/dist/template/.pi/skills/cloudflare/references/static-assets/gotchas.md +44 -0
- package/dist/template/.pi/skills/cloudflare/references/static-assets/patterns.md +42 -0
- package/dist/template/.pi/skills/cloudflare/references/stream/README.md +103 -0
- package/dist/template/.pi/skills/cloudflare/references/stream/api.md +204 -0
- package/dist/template/.pi/skills/cloudflare/references/stream/configuration.md +127 -0
- package/dist/template/.pi/skills/cloudflare/references/stream/gotchas.md +131 -0
- package/dist/template/.pi/skills/cloudflare/references/stream/patterns.md +152 -0
- package/dist/template/.pi/skills/cloudflare/references/tail-workers/README.md +640 -0
- package/dist/template/.pi/skills/cloudflare/references/terraform/README.md +76 -0
- package/dist/template/.pi/skills/cloudflare/references/terraform/api.md +159 -0
- package/dist/template/.pi/skills/cloudflare/references/terraform/configuration.md +156 -0
- package/dist/template/.pi/skills/cloudflare/references/terraform/gotchas.md +207 -0
- package/dist/template/.pi/skills/cloudflare/references/terraform/patterns.md +135 -0
- package/dist/template/.pi/skills/cloudflare/references/tunnel/README.md +82 -0
- package/dist/template/.pi/skills/cloudflare/references/tunnel/api.md +105 -0
- package/dist/template/.pi/skills/cloudflare/references/tunnel/configuration.md +113 -0
- package/dist/template/.pi/skills/cloudflare/references/tunnel/gotchas.md +115 -0
- package/dist/template/.pi/skills/cloudflare/references/tunnel/patterns.md +157 -0
- package/dist/template/.pi/skills/cloudflare/references/turn/README.md +699 -0
- package/dist/template/.pi/skills/cloudflare/references/turnstile/README.md +14 -0
- package/dist/template/.pi/skills/cloudflare/references/turnstile/api.md +3 -0
- package/dist/template/.pi/skills/cloudflare/references/turnstile/configuration.md +19 -0
- package/dist/template/.pi/skills/cloudflare/references/turnstile/gotchas.md +27 -0
- package/dist/template/.pi/skills/cloudflare/references/turnstile/patterns.md +41 -0
- package/dist/template/.pi/skills/cloudflare/references/vectorize/README.md +682 -0
- package/dist/template/.pi/skills/cloudflare/references/waf/README.md +14 -0
- package/dist/template/.pi/skills/cloudflare/references/waf/api.md +3 -0
- package/dist/template/.pi/skills/cloudflare/references/waf/configuration.md +44 -0
- package/dist/template/.pi/skills/cloudflare/references/waf/gotchas.md +24 -0
- package/dist/template/.pi/skills/cloudflare/references/waf/patterns.md +29 -0
- package/dist/template/.pi/skills/cloudflare/references/web-analytics/README.md +19 -0
- package/dist/template/.pi/skills/cloudflare/references/web-analytics/api.md +52 -0
- package/dist/template/.pi/skills/cloudflare/references/web-analytics/configuration.md +31 -0
- package/dist/template/.pi/skills/cloudflare/references/web-analytics/gotchas.md +28 -0
- package/dist/template/.pi/skills/cloudflare/references/web-analytics/patterns.md +52 -0
- package/dist/template/.pi/skills/cloudflare/references/workerd/README.md +47 -0
- package/dist/template/.pi/skills/cloudflare/references/workerd/api.md +199 -0
- package/dist/template/.pi/skills/cloudflare/references/workerd/configuration.md +185 -0
- package/dist/template/.pi/skills/cloudflare/references/workerd/gotchas.md +203 -0
- package/dist/template/.pi/skills/cloudflare/references/workerd/patterns.md +216 -0
- package/dist/template/.pi/skills/cloudflare/references/workers/README.md +96 -0
- package/dist/template/.pi/skills/cloudflare/references/workers/api.md +137 -0
- package/dist/template/.pi/skills/cloudflare/references/workers/configuration.md +147 -0
- package/dist/template/.pi/skills/cloudflare/references/workers/gotchas.md +99 -0
- package/dist/template/.pi/skills/cloudflare/references/workers/patterns.md +149 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-ai/README.md +116 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-for-platforms/README.md +48 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-for-platforms/api.md +169 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-for-platforms/configuration.md +136 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-for-platforms/gotchas.md +130 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-for-platforms/patterns.md +170 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-playground/README.md +16 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-playground/api.md +20 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-playground/configuration.md +3 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-playground/gotchas.md +35 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-playground/patterns.md +42 -0
- package/dist/template/.pi/skills/cloudflare/references/workers-vpc/README.md +579 -0
- package/dist/template/.pi/skills/cloudflare/references/workflows/README.md +62 -0
- package/dist/template/.pi/skills/cloudflare/references/workflows/api.md +125 -0
- package/dist/template/.pi/skills/cloudflare/references/workflows/configuration.md +177 -0
- package/dist/template/.pi/skills/cloudflare/references/workflows/gotchas.md +136 -0
- package/dist/template/.pi/skills/cloudflare/references/workflows/patterns.md +132 -0
- package/dist/template/.pi/skills/cloudflare/references/wrangler/README.md +90 -0
- package/dist/template/.pi/skills/cloudflare/references/wrangler/api.md +140 -0
- package/dist/template/.pi/skills/cloudflare/references/wrangler/configuration.md +128 -0
- package/dist/template/.pi/skills/cloudflare/references/wrangler/gotchas.md +93 -0
- package/dist/template/.pi/skills/cloudflare/references/wrangler/patterns.md +150 -0
- package/dist/template/.pi/skills/cloudflare/references/zaraz/README.md +360 -0
- package/dist/template/.pi/skills/code-cleanup/SKILL.md +232 -0
- package/dist/template/.pi/skills/code-review-and-quality/SKILL.md +344 -0
- package/dist/template/.pi/skills/code-simplification/SKILL.md +348 -0
- package/dist/template/.pi/skills/context-engineering/SKILL.md +296 -0
- package/dist/template/.pi/skills/core-data-expert/SKILL.md +117 -0
- package/dist/template/.pi/skills/core-data-expert/references/batch-operations.md +543 -0
- package/dist/template/.pi/skills/core-data-expert/references/cloudkit-integration.md +259 -0
- package/dist/template/.pi/skills/core-data-expert/references/concurrency.md +522 -0
- package/dist/template/.pi/skills/core-data-expert/references/fetch-requests.md +643 -0
- package/dist/template/.pi/skills/core-data-expert/references/glossary.md +233 -0
- package/dist/template/.pi/skills/core-data-expert/references/migration.md +393 -0
- package/dist/template/.pi/skills/core-data-expert/references/model-configuration.md +597 -0
- package/dist/template/.pi/skills/core-data-expert/references/performance.md +300 -0
- package/dist/template/.pi/skills/core-data-expert/references/persistent-history.md +553 -0
- package/dist/template/.pi/skills/core-data-expert/references/project-audit.md +60 -0
- package/dist/template/.pi/skills/core-data-expert/references/saving.md +574 -0
- package/dist/template/.pi/skills/core-data-expert/references/stack-setup.md +625 -0
- package/dist/template/.pi/skills/core-data-expert/references/testing.md +300 -0
- package/dist/template/.pi/skills/core-data-expert/references/threading.md +589 -0
- package/dist/template/.pi/skills/debugging-and-error-recovery/SKILL.md +274 -0
- package/dist/template/.pi/skills/deep-module-design/SKILL.md +218 -0
- package/dist/template/.pi/skills/defense-in-depth/SKILL.md +161 -0
- package/dist/template/.pi/skills/deprecation-and-migration/SKILL.md +186 -0
- package/dist/template/.pi/skills/design-system-audit/SKILL.md +176 -0
- package/dist/template/.pi/skills/design-taste-frontend/SKILL.md +255 -0
- package/dist/template/.pi/skills/development-lifecycle/SKILL.md +285 -0
- package/dist/template/.pi/skills/documentation-and-adrs/SKILL.md +217 -0
- package/dist/template/.pi/skills/doubt-driven-development/SKILL.md +207 -0
- package/dist/template/.pi/skills/fallow/SKILL.md +457 -0
- package/dist/template/.pi/skills/fallow/references/cli-reference.md +1905 -0
- package/dist/template/.pi/skills/fallow/references/gotchas.md +644 -0
- package/dist/template/.pi/skills/fallow/references/patterns.md +791 -0
- package/dist/template/.pi/skills/figma/SKILL.md +241 -0
- package/dist/template/.pi/skills/frontend-design/SKILL.md +262 -0
- package/dist/template/.pi/skills/frontend-design/references/animation/motion-advanced.md +224 -0
- package/dist/template/.pi/skills/frontend-design/references/animation/motion-core.md +181 -0
- package/dist/template/.pi/skills/frontend-design/references/canvas/execution.md +90 -0
- package/dist/template/.pi/skills/frontend-design/references/canvas/philosophy.md +94 -0
- package/dist/template/.pi/skills/frontend-design/references/design/color-system.md +111 -0
- package/dist/template/.pi/skills/frontend-design/references/design/interaction.md +149 -0
- package/dist/template/.pi/skills/frontend-design/references/design/typography-rules.md +106 -0
- package/dist/template/.pi/skills/frontend-design/references/design/ux-writing.md +99 -0
- package/dist/template/.pi/skills/frontend-design/references/shadcn/accessibility.md +132 -0
- package/dist/template/.pi/skills/frontend-design/references/shadcn/core-components.md +153 -0
- package/dist/template/.pi/skills/frontend-design/references/shadcn/form-components.md +158 -0
- package/dist/template/.pi/skills/frontend-design/references/shadcn/setup.md +69 -0
- package/dist/template/.pi/skills/frontend-design/references/shadcn/theming.md +152 -0
- package/dist/template/.pi/skills/frontend-design/references/tailwind/responsive.md +112 -0
- package/dist/template/.pi/skills/frontend-design/references/tailwind/utilities-layout.md +134 -0
- package/dist/template/.pi/skills/frontend-design/references/tailwind/utilities-styling.md +165 -0
- package/dist/template/.pi/skills/frontend-design/references/tailwind/v4-config.md +147 -0
- package/dist/template/.pi/skills/frontend-design/references/tailwind/v4-features.md +128 -0
- package/dist/template/.pi/skills/frontend-ui-engineering/SKILL.md +217 -0
- package/dist/template/.pi/skills/gemini-large-context/SKILL.md +238 -0
- package/dist/template/.pi/skills/git-workflow-and-versioning/SKILL.md +217 -0
- package/dist/template/.pi/skills/grill-me/SKILL.md +162 -0
- package/dist/template/.pi/skills/high-end-visual-design/SKILL.md +128 -0
- package/dist/template/.pi/skills/idea-refine/SKILL.md +195 -0
- package/dist/template/.pi/skills/idea-refine/examples.md +62 -0
- package/dist/template/.pi/skills/idea-refine/frameworks.md +63 -0
- package/dist/template/.pi/skills/idea-refine/refinement-criteria.md +56 -0
- package/dist/template/.pi/skills/incremental-implementation/SKILL.md +190 -0
- package/dist/template/.pi/skills/industrial-brutalist-ui/SKILL.md +131 -0
- package/dist/template/.pi/skills/interview-me/SKILL.md +227 -0
- package/dist/template/.pi/skills/jira/SKILL.md +306 -0
- package/dist/template/.pi/skills/loop-audit/SKILL.md +141 -0
- package/dist/template/.pi/skills/loop-cost/SKILL.md +130 -0
- package/dist/template/.pi/skills/loop-engineering/SKILL.md +175 -0
- package/dist/template/.pi/skills/minimalist-ui/SKILL.md +124 -0
- package/dist/template/.pi/skills/mockup-to-code/SKILL.md +197 -0
- package/dist/template/.pi/skills/observability-and-instrumentation/SKILL.md +202 -0
- package/dist/template/.pi/skills/opensrc/SKILL.md +297 -0
- package/dist/template/.pi/skills/opensrc/references/architecture.md +176 -0
- package/dist/template/.pi/skills/opensrc/references/cli-usage.md +176 -0
- package/dist/template/.pi/skills/opensrc/references/registry-support.md +137 -0
- package/dist/template/.pi/skills/pdf-extract/SKILL.md +461 -0
- package/dist/template/.pi/skills/performance-optimization/SKILL.md +233 -0
- package/dist/template/.pi/skills/performance-optimization/references/performance-checklist.md +85 -0
- package/dist/template/.pi/skills/planning-and-task-breakdown/SKILL.md +204 -0
- package/dist/template/.pi/skills/playwright/SKILL.md +404 -0
- package/dist/template/.pi/skills/playwright/references/agent-browser-cli.md +405 -0
- package/dist/template/.pi/skills/polar/SKILL.md +125 -0
- package/dist/template/.pi/skills/react-best-practices/SKILL.md +156 -0
- package/dist/template/.pi/skills/react-best-practices/rules/_sections.md +46 -0
- package/dist/template/.pi/skills/react-best-practices/rules/_template.md +28 -0
- package/dist/template/.pi/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/dist/template/.pi/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
- package/dist/template/.pi/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/dist/template/.pi/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/dist/template/.pi/skills/react-best-practices/rules/async-dependencies.md +36 -0
- package/dist/template/.pi/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/dist/template/.pi/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/dist/template/.pi/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/dist/template/.pi/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/dist/template/.pi/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/dist/template/.pi/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/dist/template/.pi/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/dist/template/.pi/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/dist/template/.pi/skills/react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/dist/template/.pi/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/dist/template/.pi/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/dist/template/.pi/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/dist/template/.pi/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/dist/template/.pi/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/dist/template/.pi/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/dist/template/.pi/skills/react-best-practices/rules/server-cache-react.md +76 -0
- package/dist/template/.pi/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/dist/template/.pi/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/dist/template/.pi/skills/redesign-existing-projects/SKILL.md +217 -0
- package/dist/template/.pi/skills/resend/SKILL.md +196 -0
- package/dist/template/.pi/skills/resend/references/react-email.md +287 -0
- package/dist/template/.pi/skills/resend/references/receive-email.md +248 -0
- package/dist/template/.pi/skills/resend/references/send-email.md +318 -0
- package/dist/template/.pi/skills/root-cause-tracing/SKILL.md +216 -0
- package/dist/template/.pi/skills/security-and-hardening/SKILL.md +293 -0
- package/dist/template/.pi/skills/security-and-hardening/references/security-checklist.md +105 -0
- package/dist/template/.pi/skills/shipping-and-launch/SKILL.md +101 -0
- package/dist/template/.pi/skills/source-driven-development/SKILL.md +108 -0
- package/dist/template/.pi/skills/spec-driven-development/SKILL.md +177 -0
- package/dist/template/.pi/skills/srcwalk/SKILL.md +182 -0
- package/dist/template/.pi/skills/subagent-driven-development/SKILL.md +253 -0
- package/dist/template/.pi/skills/supabase/SKILL.md +153 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/SKILL.md +88 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/advanced-full-text-search.md +55 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/advanced-jsonb-indexing.md +49 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/conn-idle-timeout.md +46 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/conn-limits.md +44 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/conn-pooling.md +41 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/conn-prepared-statements.md +46 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/data-batch-inserts.md +54 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/data-n-plus-one.md +53 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/data-pagination.md +50 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/data-upsert.md +50 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/lock-advisory.md +56 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/lock-deadlock-prevention.md +68 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/lock-short-transactions.md +50 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/lock-skip-locked.md +54 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/monitor-explain-analyze.md +45 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/monitor-pg-stat-statements.md +55 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/monitor-vacuum-analyze.md +55 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/query-composite-indexes.md +44 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/query-covering-indexes.md +40 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/query-index-types.md +45 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/query-missing-indexes.md +43 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/query-partial-indexes.md +45 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/schema-data-types.md +46 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/schema-foreign-key-indexes.md +59 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/schema-lowercase-identifiers.md +55 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/schema-partitioning.md +55 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/schema-primary-keys.md +61 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/security-privileges.md +54 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/security-rls-basics.md +50 -0
- package/dist/template/.pi/skills/supabase-postgres-best-practices/rules/security-rls-performance.md +57 -0
- package/dist/template/.pi/skills/swift-concurrency/SKILL.md +290 -0
- package/dist/template/.pi/skills/swift-concurrency/references/actors.md +640 -0
- package/dist/template/.pi/skills/swift-concurrency/references/async-algorithms.md +822 -0
- package/dist/template/.pi/skills/swift-concurrency/references/async-await-basics.md +249 -0
- package/dist/template/.pi/skills/swift-concurrency/references/async-sequences.md +670 -0
- package/dist/template/.pi/skills/swift-concurrency/references/core-data.md +533 -0
- package/dist/template/.pi/skills/swift-concurrency/references/glossary.md +128 -0
- package/dist/template/.pi/skills/swift-concurrency/references/linting.md +142 -0
- package/dist/template/.pi/skills/swift-concurrency/references/memory-management.md +542 -0
- package/dist/template/.pi/skills/swift-concurrency/references/migration.md +1076 -0
- package/dist/template/.pi/skills/swift-concurrency/references/performance.md +574 -0
- package/dist/template/.pi/skills/swift-concurrency/references/sendable.md +578 -0
- package/dist/template/.pi/skills/swift-concurrency/references/tasks.md +604 -0
- package/dist/template/.pi/skills/swift-concurrency/references/testing.md +565 -0
- package/dist/template/.pi/skills/swift-concurrency/references/threading.md +452 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/SKILL.md +343 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/animation-advanced.md +351 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/animation-basics.md +284 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/animation-transitions.md +326 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/image-optimization.md +286 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/layout-best-practices.md +312 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/liquid-glass.md +377 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/list-patterns.md +153 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/modern-apis.md +400 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/performance-patterns.md +377 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/scroll-patterns.md +305 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/sheet-navigation-patterns.md +292 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/state-management.md +447 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/text-formatting.md +285 -0
- package/dist/template/.pi/skills/swiftui-expert-skill/references/view-structure.md +276 -0
- package/dist/template/.pi/skills/test-driven-development/SKILL.md +400 -0
- package/dist/template/.pi/skills/test-driven-development/references/testing-patterns.md +155 -0
- package/dist/template/.pi/skills/testing-anti-patterns/SKILL.md +339 -0
- package/dist/template/.pi/skills/using-agent-skills/SKILL.md +371 -0
- package/dist/template/.pi/skills/using-git-worktrees/SKILL.md +275 -0
- package/dist/template/.pi/skills/vercel-deploy-claimable/SKILL.md +144 -0
- package/dist/template/.pi/skills/vercel-deploy-claimable/scripts/deploy.sh +249 -0
- package/dist/template/.pi/skills/verification-before-completion/SKILL.md +348 -0
- package/dist/template/.pi/skills/webclaw/SKILL.md +188 -0
- package/dist/template/.pi/skills/writing-skills/SKILL.md +329 -0
- package/dist/template/.pi/skills/writing-skills/references/anti-patterns.md +25 -0
- package/dist/template/.pi/skills/writing-skills/references/claude-search-optimization.md +140 -0
- package/dist/template/.pi/skills/writing-skills/references/discovery-workflow.md +11 -0
- package/dist/template/.pi/skills/writing-skills/references/file-organization.md +32 -0
- package/dist/template/.pi/skills/writing-skills/references/flowcharts-and-examples.md +57 -0
- package/dist/template/.pi/skills/writing-skills/references/rationalization-hardening.md +75 -0
- package/dist/template/.pi/skills/writing-skills/references/testing-methodology.md +397 -0
- package/dist/template/.pi/skills/writing-skills/references/testing-skill-types.md +52 -0
- package/dist/template/.pi/subagents.json +10 -0
- package/dist/template/.pi/templates/adr.md +47 -0
- package/dist/template/.pi/templates/design.md +61 -0
- package/dist/template/.pi/templates/loop-github-action.yml +162 -0
- package/dist/template/.pi/templates/loop-orchestrator.sh +514 -0
- package/dist/template/.pi/templates/loop-orchestrator.test.ts +332 -0
- package/dist/template/.pi/templates/loop-orchestrator.ts +936 -0
- package/dist/template/.pi/templates/loop-state.json +24 -0
- package/dist/template/.pi/templates/loop-state.md +98 -0
- package/dist/template/.pi/templates/loop-vision.md +110 -0
- package/dist/template/.pi/templates/prd.md +204 -0
- package/dist/template/.pi/templates/progress.md +55 -0
- package/dist/template/.pi/templates/project.md +58 -0
- package/dist/template/.pi/templates/proposal.md +40 -0
- package/dist/template/.pi/templates/review-state.json +20 -0
- package/dist/template/.pi/templates/roadmap.md +93 -0
- package/dist/template/.pi/templates/state.md +97 -0
- package/dist/template/.pi/templates/tasks.md +202 -0
- package/dist/template/.pi/templates/tech-stack.md +85 -0
- package/dist/template/.pi/templates/user.md +26 -0
- package/dist/template/.pi/workflows/INDEX.md +63 -0
- package/dist/template/.pi/workflows/audit-pattern.md +84 -0
- package/dist/template/.pi/workflows/batch-implement.md +121 -0
- package/dist/template/.pi/workflows/deep-research.md +89 -0
- package/dist/template/.pi/workflows/development-lifecycle-workflow.md +175 -0
- package/dist/template/.pi/workflows/garbage-collection.md +144 -0
- package/dist/template/.pi/workflows/quality-loop.md +211 -0
- package/package.json +57 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# SwiftUI Image Optimization Reference
|
|
2
|
+
|
|
3
|
+
## AsyncImage Best Practices
|
|
4
|
+
|
|
5
|
+
### Basic AsyncImage with Phase Handling
|
|
6
|
+
|
|
7
|
+
```swift
|
|
8
|
+
// Good - handles loading and error states
|
|
9
|
+
AsyncImage(url: imageURL) { phase in
|
|
10
|
+
switch phase {
|
|
11
|
+
case .empty:
|
|
12
|
+
ProgressView()
|
|
13
|
+
case .success(let image):
|
|
14
|
+
image
|
|
15
|
+
.resizable()
|
|
16
|
+
.aspectRatio(contentMode: .fit)
|
|
17
|
+
case .failure:
|
|
18
|
+
Image(systemName: "photo")
|
|
19
|
+
.foregroundStyle(.secondary)
|
|
20
|
+
@unknown default:
|
|
21
|
+
EmptyView()
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
.frame(width: 200, height: 200)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### AsyncImage with Custom Placeholder
|
|
28
|
+
|
|
29
|
+
```swift
|
|
30
|
+
struct ImageView: View {
|
|
31
|
+
let url: URL?
|
|
32
|
+
|
|
33
|
+
var body: some View {
|
|
34
|
+
AsyncImage(url: url) { phase in
|
|
35
|
+
switch phase {
|
|
36
|
+
case .empty:
|
|
37
|
+
ZStack {
|
|
38
|
+
Color.gray.opacity(0.2)
|
|
39
|
+
ProgressView()
|
|
40
|
+
}
|
|
41
|
+
case .success(let image):
|
|
42
|
+
image
|
|
43
|
+
.resizable()
|
|
44
|
+
.aspectRatio(contentMode: .fill)
|
|
45
|
+
case .failure:
|
|
46
|
+
ZStack {
|
|
47
|
+
Color.gray.opacity(0.2)
|
|
48
|
+
Image(systemName: "exclamationmark.triangle")
|
|
49
|
+
.foregroundStyle(.secondary)
|
|
50
|
+
}
|
|
51
|
+
@unknown default:
|
|
52
|
+
EmptyView()
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.clipShape(.rect(cornerRadius: 12))
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### AsyncImage with Transition
|
|
61
|
+
|
|
62
|
+
```swift
|
|
63
|
+
AsyncImage(url: imageURL) { phase in
|
|
64
|
+
switch phase {
|
|
65
|
+
case .empty:
|
|
66
|
+
ProgressView()
|
|
67
|
+
case .success(let image):
|
|
68
|
+
image
|
|
69
|
+
.resizable()
|
|
70
|
+
.aspectRatio(contentMode: .fit)
|
|
71
|
+
.transition(.opacity)
|
|
72
|
+
case .failure:
|
|
73
|
+
Image(systemName: "photo")
|
|
74
|
+
@unknown default:
|
|
75
|
+
EmptyView()
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
.animation(.easeInOut, value: imageURL)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Image Decoding and Downsampling (Optional Optimization)
|
|
82
|
+
|
|
83
|
+
**When you encounter `UIImage(data:)` usage, consider suggesting image downsampling as a potential performance improvement**, especially for large images in lists or grids.
|
|
84
|
+
|
|
85
|
+
### Current Pattern That Could Be Optimized
|
|
86
|
+
|
|
87
|
+
```swift
|
|
88
|
+
// Current pattern - decodes full image on main thread
|
|
89
|
+
// Unsafe - force unwrap can crash if imageData is invalid
|
|
90
|
+
Image(uiImage: UIImage(data: imageData)!)
|
|
91
|
+
.resizable()
|
|
92
|
+
.aspectRatio(contentMode: .fit)
|
|
93
|
+
.frame(width: 200, height: 200)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Suggested Optimization Pattern
|
|
97
|
+
|
|
98
|
+
```swift
|
|
99
|
+
// Suggested optimization - decode and downsample off main thread
|
|
100
|
+
struct OptimizedImageView: View {
|
|
101
|
+
let imageData: Data
|
|
102
|
+
let targetSize: CGSize
|
|
103
|
+
@State private var processedImage: UIImage?
|
|
104
|
+
|
|
105
|
+
var body: some View {
|
|
106
|
+
Group {
|
|
107
|
+
if let processedImage {
|
|
108
|
+
Image(uiImage: processedImage)
|
|
109
|
+
.resizable()
|
|
110
|
+
.aspectRatio(contentMode: .fit)
|
|
111
|
+
} else {
|
|
112
|
+
ProgressView()
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
.task {
|
|
116
|
+
processedImage = await decodeAndDownsample(imageData, targetSize: targetSize)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
private func decodeAndDownsample(_ data: Data, targetSize: CGSize) async -> UIImage? {
|
|
121
|
+
await Task.detached {
|
|
122
|
+
guard let source = CGImageSourceCreateWithData(data as CFData, nil) else {
|
|
123
|
+
return nil
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
let options: [CFString: Any] = [
|
|
127
|
+
kCGImageSourceThumbnailMaxPixelSize: max(targetSize.width, targetSize.height),
|
|
128
|
+
kCGImageSourceCreateThumbnailFromImageAlways: true,
|
|
129
|
+
kCGImageSourceCreateThumbnailWithTransform: true
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
guard let cgImage = CGImageSourceCreateThumbnailAtIndex(source, 0, options as CFDictionary) else {
|
|
133
|
+
return nil
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return UIImage(cgImage: cgImage)
|
|
137
|
+
}.value
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Usage
|
|
142
|
+
OptimizedImageView(
|
|
143
|
+
imageData: imageData,
|
|
144
|
+
targetSize: CGSize(width: 200, height: 200)
|
|
145
|
+
)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Reusable Image Downsampling Helper
|
|
149
|
+
|
|
150
|
+
```swift
|
|
151
|
+
actor ImageProcessor {
|
|
152
|
+
func downsample(data: Data, to targetSize: CGSize) -> UIImage? {
|
|
153
|
+
guard let source = CGImageSourceCreateWithData(data as CFData, nil) else {
|
|
154
|
+
return nil
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
let maxDimension = max(targetSize.width, targetSize.height) * UIScreen.main.scale
|
|
158
|
+
|
|
159
|
+
let options: [CFString: Any] = [
|
|
160
|
+
kCGImageSourceThumbnailMaxPixelSize: maxDimension,
|
|
161
|
+
kCGImageSourceCreateThumbnailFromImageAlways: true,
|
|
162
|
+
kCGImageSourceCreateThumbnailWithTransform: true,
|
|
163
|
+
kCGImageSourceShouldCache: false
|
|
164
|
+
]
|
|
165
|
+
|
|
166
|
+
guard let cgImage = CGImageSourceCreateThumbnailAtIndex(source, 0, options as CFDictionary) else {
|
|
167
|
+
return nil
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return UIImage(cgImage: cgImage)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Usage in view
|
|
175
|
+
struct ImageView: View {
|
|
176
|
+
let imageData: Data
|
|
177
|
+
let targetSize: CGSize
|
|
178
|
+
@State private var image: UIImage?
|
|
179
|
+
|
|
180
|
+
private let processor = ImageProcessor()
|
|
181
|
+
|
|
182
|
+
var body: some View {
|
|
183
|
+
Group {
|
|
184
|
+
if let image {
|
|
185
|
+
Image(uiImage: image)
|
|
186
|
+
.resizable()
|
|
187
|
+
.aspectRatio(contentMode: .fit)
|
|
188
|
+
} else {
|
|
189
|
+
ProgressView()
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
.task {
|
|
193
|
+
image = await processor.downsample(data: imageData, to: targetSize)
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### When to Suggest This Optimization
|
|
200
|
+
|
|
201
|
+
Mention this optimization when you see `UIImage(data:)` usage, particularly in:
|
|
202
|
+
- Scrollable content (List, ScrollView with LazyVStack/LazyHStack)
|
|
203
|
+
- Grid layouts with many images
|
|
204
|
+
- Image galleries or carousels
|
|
205
|
+
- Any scenario where large images are displayed at smaller sizes
|
|
206
|
+
|
|
207
|
+
**Don't automatically apply it**—present it as an optional improvement for performance-sensitive scenarios.
|
|
208
|
+
|
|
209
|
+
## SF Symbols
|
|
210
|
+
|
|
211
|
+
### Using SF Symbols
|
|
212
|
+
|
|
213
|
+
```swift
|
|
214
|
+
// Basic symbol
|
|
215
|
+
Image(systemName: "star.fill")
|
|
216
|
+
.foregroundStyle(.yellow)
|
|
217
|
+
|
|
218
|
+
// With rendering mode
|
|
219
|
+
Image(systemName: "heart.fill")
|
|
220
|
+
.symbolRenderingMode(.multicolor)
|
|
221
|
+
|
|
222
|
+
// With variable color
|
|
223
|
+
Image(systemName: "speaker.wave.3.fill")
|
|
224
|
+
.symbolRenderingMode(.hierarchical)
|
|
225
|
+
.foregroundStyle(.blue)
|
|
226
|
+
|
|
227
|
+
// Animated symbols (iOS 17+)
|
|
228
|
+
Image(systemName: "antenna.radiowaves.left.and.right")
|
|
229
|
+
.symbolEffect(.variableColor)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### SF Symbol Variants
|
|
233
|
+
|
|
234
|
+
```swift
|
|
235
|
+
// Circle variant
|
|
236
|
+
Image(systemName: "star.circle.fill")
|
|
237
|
+
|
|
238
|
+
// Square variant
|
|
239
|
+
Image(systemName: "star.square.fill")
|
|
240
|
+
|
|
241
|
+
// With badge
|
|
242
|
+
Image(systemName: "folder.badge.plus")
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Image Rendering
|
|
246
|
+
|
|
247
|
+
### ImageRenderer for Snapshots
|
|
248
|
+
|
|
249
|
+
```swift
|
|
250
|
+
// Render SwiftUI view to UIImage
|
|
251
|
+
let renderer = ImageRenderer(content: myView)
|
|
252
|
+
renderer.scale = UIScreen.main.scale
|
|
253
|
+
|
|
254
|
+
if let uiImage = renderer.uiImage {
|
|
255
|
+
// Use the image (save, share, etc.)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Render to CGImage
|
|
259
|
+
if let cgImage = renderer.cgImage {
|
|
260
|
+
// Use CGImage
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Rendering with Custom Size
|
|
265
|
+
|
|
266
|
+
```swift
|
|
267
|
+
let renderer = ImageRenderer(content: myView)
|
|
268
|
+
renderer.proposedSize = ProposedViewSize(width: 400, height: 300)
|
|
269
|
+
|
|
270
|
+
if let uiImage = renderer.uiImage {
|
|
271
|
+
// Image rendered at 400x300 points
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Summary Checklist
|
|
276
|
+
|
|
277
|
+
- [ ] Use `AsyncImage` with proper phase handling
|
|
278
|
+
- [ ] Handle empty, success, and failure states
|
|
279
|
+
- [ ] Consider downsampling for `UIImage(data:)` in performance-sensitive scenarios
|
|
280
|
+
- [ ] Decode and downsample images off the main thread
|
|
281
|
+
- [ ] Use appropriate target sizes for downsampling
|
|
282
|
+
- [ ] Consider image caching for frequently accessed images
|
|
283
|
+
- [ ] Use SF Symbols with appropriate rendering modes
|
|
284
|
+
- [ ] Use `ImageRenderer` for rendering SwiftUI views to images
|
|
285
|
+
|
|
286
|
+
**Performance Note**: Image downsampling is an optional optimization. Only suggest it when you encounter `UIImage(data:)` usage in performance-sensitive contexts like scrollable lists or grids.
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# SwiftUI Layout Best Practices Reference
|
|
2
|
+
|
|
3
|
+
## Relative Layout Over Constants
|
|
4
|
+
|
|
5
|
+
**Use dynamic layout calculations instead of hard-coded values.**
|
|
6
|
+
|
|
7
|
+
```swift
|
|
8
|
+
// Good - relative to actual layout
|
|
9
|
+
GeometryReader { geometry in
|
|
10
|
+
VStack {
|
|
11
|
+
HeaderView()
|
|
12
|
+
.frame(height: geometry.size.height * 0.2)
|
|
13
|
+
ContentView()
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Avoid - magic numbers that don't adapt
|
|
18
|
+
VStack {
|
|
19
|
+
HeaderView()
|
|
20
|
+
.frame(height: 150) // Doesn't adapt to different screens
|
|
21
|
+
ContentView()
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Why**: Hard-coded values don't account for different screen sizes, orientations, or dynamic content (like status bars during phone calls).
|
|
26
|
+
|
|
27
|
+
## Context-Agnostic Views
|
|
28
|
+
|
|
29
|
+
**Views should work in any context.** Never assume presentation style or screen size.
|
|
30
|
+
|
|
31
|
+
```swift
|
|
32
|
+
// Good - adapts to given space
|
|
33
|
+
struct ProfileCard: View {
|
|
34
|
+
let user: User
|
|
35
|
+
|
|
36
|
+
var body: some View {
|
|
37
|
+
VStack {
|
|
38
|
+
Image(user.avatar)
|
|
39
|
+
.resizable()
|
|
40
|
+
.aspectRatio(contentMode: .fit)
|
|
41
|
+
Text(user.name)
|
|
42
|
+
Spacer()
|
|
43
|
+
}
|
|
44
|
+
.padding()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Avoid - assumes full screen
|
|
49
|
+
struct ProfileCard: View {
|
|
50
|
+
let user: User
|
|
51
|
+
|
|
52
|
+
var body: some View {
|
|
53
|
+
VStack {
|
|
54
|
+
Image(user.avatar)
|
|
55
|
+
.frame(width: UIScreen.main.bounds.width) // Wrong!
|
|
56
|
+
Text(user.name)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Why**: Views should work as full screens, modals, sheets, popovers, or embedded content.
|
|
63
|
+
|
|
64
|
+
## Own Your Container
|
|
65
|
+
|
|
66
|
+
**Custom views should own static containers but not lazy/repeatable ones.**
|
|
67
|
+
|
|
68
|
+
```swift
|
|
69
|
+
// Good - owns static container
|
|
70
|
+
struct HeaderView: View {
|
|
71
|
+
var body: some View {
|
|
72
|
+
HStack {
|
|
73
|
+
Image(systemName: "star")
|
|
74
|
+
Text("Title")
|
|
75
|
+
Spacer()
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Avoid - missing container
|
|
81
|
+
struct HeaderView: View {
|
|
82
|
+
var body: some View {
|
|
83
|
+
Image(systemName: "star")
|
|
84
|
+
Text("Title")
|
|
85
|
+
// Caller must wrap in HStack
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Good - caller owns lazy container
|
|
90
|
+
struct FeedView: View {
|
|
91
|
+
let items: [Item]
|
|
92
|
+
|
|
93
|
+
var body: some View {
|
|
94
|
+
LazyVStack {
|
|
95
|
+
ForEach(items) { item in
|
|
96
|
+
ItemRow(item: item)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Layout Performance
|
|
104
|
+
|
|
105
|
+
### Avoid Layout Thrash
|
|
106
|
+
|
|
107
|
+
**Minimize deep view hierarchies and excessive layout dependencies.**
|
|
108
|
+
|
|
109
|
+
```swift
|
|
110
|
+
// Bad - deep nesting, excessive layout passes
|
|
111
|
+
VStack {
|
|
112
|
+
HStack {
|
|
113
|
+
VStack {
|
|
114
|
+
HStack {
|
|
115
|
+
VStack {
|
|
116
|
+
Text("Deep")
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Good - flatter hierarchy
|
|
124
|
+
VStack {
|
|
125
|
+
Text("Shallow")
|
|
126
|
+
Text("Structure")
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Avoid excessive `GeometryReader` and preference chains:**
|
|
131
|
+
|
|
132
|
+
```swift
|
|
133
|
+
// Bad - multiple geometry readers cause layout thrash
|
|
134
|
+
GeometryReader { outerGeometry in
|
|
135
|
+
VStack {
|
|
136
|
+
GeometryReader { innerGeometry in
|
|
137
|
+
// Layout recalculates multiple times
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Good - single geometry reader or use alternatives (iOS 17+)
|
|
143
|
+
containerRelativeFrame(.horizontal) { width, _ in
|
|
144
|
+
width * 0.8
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Gate frequent geometry updates:**
|
|
149
|
+
|
|
150
|
+
```swift
|
|
151
|
+
// Bad - updates on every pixel change
|
|
152
|
+
.onPreferenceChange(ViewSizeKey.self) { size in
|
|
153
|
+
currentSize = size
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Good - gate by threshold
|
|
157
|
+
.onPreferenceChange(ViewSizeKey.self) { size in
|
|
158
|
+
let difference = abs(size.width - currentSize.width)
|
|
159
|
+
if difference > 10 { // Only update if significant change
|
|
160
|
+
currentSize = size
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## View Logic and Testability
|
|
166
|
+
|
|
167
|
+
### Separate View Logic from Views
|
|
168
|
+
|
|
169
|
+
**Place view logic into view models or similar, so it can be tested.**
|
|
170
|
+
|
|
171
|
+
> **iOS 17+**: Use `@Observable` macro with `@State` for view models.
|
|
172
|
+
|
|
173
|
+
```swift
|
|
174
|
+
// Good - logic in testable model (iOS 17+)
|
|
175
|
+
@Observable
|
|
176
|
+
@MainActor
|
|
177
|
+
final class LoginViewModel {
|
|
178
|
+
var email = ""
|
|
179
|
+
var password = ""
|
|
180
|
+
var isValid: Bool {
|
|
181
|
+
!email.isEmpty && password.count >= 8
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
func login() async throws {
|
|
185
|
+
// Business logic here
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
struct LoginView: View {
|
|
190
|
+
@State private var viewModel = LoginViewModel()
|
|
191
|
+
|
|
192
|
+
var body: some View {
|
|
193
|
+
Form {
|
|
194
|
+
TextField("Email", text: $viewModel.email)
|
|
195
|
+
SecureField("Password", text: $viewModel.password)
|
|
196
|
+
Button("Login") {
|
|
197
|
+
Task {
|
|
198
|
+
try? await viewModel.login()
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
.disabled(!viewModel.isValid)
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
> **iOS 16 and earlier**: Use `ObservableObject` protocol with `@StateObject`.
|
|
208
|
+
|
|
209
|
+
```swift
|
|
210
|
+
// Good - logic in testable model (iOS 16 and earlier)
|
|
211
|
+
@MainActor
|
|
212
|
+
final class LoginViewModel: ObservableObject {
|
|
213
|
+
@Published var email = ""
|
|
214
|
+
@Published var password = ""
|
|
215
|
+
var isValid: Bool {
|
|
216
|
+
!email.isEmpty && password.count >= 8
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
func login() async throws {
|
|
220
|
+
// Business logic here
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
struct LoginView: View {
|
|
225
|
+
@StateObject private var viewModel = LoginViewModel()
|
|
226
|
+
|
|
227
|
+
var body: some View {
|
|
228
|
+
Form {
|
|
229
|
+
TextField("Email", text: $viewModel.email)
|
|
230
|
+
SecureField("Password", text: $viewModel.password)
|
|
231
|
+
Button("Login") {
|
|
232
|
+
Task {
|
|
233
|
+
try? await viewModel.login()
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
.disabled(!viewModel.isValid)
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
```swift
|
|
243
|
+
// Bad - logic embedded in view
|
|
244
|
+
struct LoginView: View {
|
|
245
|
+
@State private var email = ""
|
|
246
|
+
@State private var password = ""
|
|
247
|
+
|
|
248
|
+
var body: some View {
|
|
249
|
+
Form {
|
|
250
|
+
TextField("Email", text: $email)
|
|
251
|
+
SecureField("Password", text: $password)
|
|
252
|
+
Button("Login") {
|
|
253
|
+
// Business logic directly in view - hard to test
|
|
254
|
+
Task {
|
|
255
|
+
if !email.isEmpty && password.count >= 8 {
|
|
256
|
+
// Login logic...
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Note**: This is about separating business logic for testability, not about enforcing specific architectures like MVVM. The goal is to make logic testable while keeping views simple.
|
|
266
|
+
|
|
267
|
+
## Action Handlers
|
|
268
|
+
|
|
269
|
+
**Separate layout from logic.** View body should reference action methods, not contain logic.
|
|
270
|
+
|
|
271
|
+
```swift
|
|
272
|
+
// Good - action references method
|
|
273
|
+
struct PublishView: View {
|
|
274
|
+
@State private var viewModel = PublishViewModel()
|
|
275
|
+
|
|
276
|
+
var body: some View {
|
|
277
|
+
Button("Publish Project", action: viewModel.handlePublish)
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Avoid - logic in closure
|
|
282
|
+
struct PublishView: View {
|
|
283
|
+
@State private var isLoading = false
|
|
284
|
+
@State private var showError = false
|
|
285
|
+
|
|
286
|
+
var body: some View {
|
|
287
|
+
Button("Publish Project") {
|
|
288
|
+
isLoading = true
|
|
289
|
+
apiService.publish(project) { result in
|
|
290
|
+
if case .error = result {
|
|
291
|
+
showError = true
|
|
292
|
+
}
|
|
293
|
+
isLoading = false
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Why**: Separating logic from layout improves readability, testability, and maintainability.
|
|
301
|
+
|
|
302
|
+
## Summary Checklist
|
|
303
|
+
|
|
304
|
+
- [ ] Use relative layout over hard-coded constants
|
|
305
|
+
- [ ] Views work in any context (don't assume screen size)
|
|
306
|
+
- [ ] Custom views own static containers
|
|
307
|
+
- [ ] Avoid deep view hierarchies (layout thrash)
|
|
308
|
+
- [ ] Gate frequent geometry updates by thresholds
|
|
309
|
+
- [ ] View logic separated into testable models/classes
|
|
310
|
+
- [ ] Action handlers reference methods, not inline logic
|
|
311
|
+
- [ ] Avoid excessive `GeometryReader` usage
|
|
312
|
+
- [ ] Use `containerRelativeFrame()` when appropriate
|