@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,274 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debugging-and-error-recovery
|
|
3
|
+
description: Guides root-cause debugging and safe recovery from failures. Use when tests fail, builds break, behavior is unexpected, or multiple fix attempts have not worked.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Debugging & Error Recovery
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Random fixes create new bugs. Debugging must move from symptom to root cause to guarded fix.
|
|
11
|
+
|
|
12
|
+
Systematic debugging uses structured triage. When something breaks, stop adding features, preserve evidence, and follow a repeatable process to find and fix the root cause. Guessing wastes time.
|
|
13
|
+
|
|
14
|
+
Core principle: reproduce, localize, reduce, fix, and guard before claiming resolution.
|
|
15
|
+
|
|
16
|
+
## When to Use
|
|
17
|
+
|
|
18
|
+
- Test, lint, typecheck, build, or runtime failure.
|
|
19
|
+
- User reports a bug or unexpected behavior.
|
|
20
|
+
- A previous fix failed.
|
|
21
|
+
- Error crosses multiple layers or components.
|
|
22
|
+
- Multiple fix attempts have not worked.
|
|
23
|
+
- System behavior differs from the stated contract or recent baseline.
|
|
24
|
+
- A subagent reports that a verification step is blocked.
|
|
25
|
+
|
|
26
|
+
## When NOT to Use
|
|
27
|
+
|
|
28
|
+
- Feature work with no failure signal; use `incremental-implementation`.
|
|
29
|
+
- Pure research; use `source-driven-development`.
|
|
30
|
+
- Code review feedback without a failing signal; use `code-review-and-quality`.
|
|
31
|
+
|
|
32
|
+
## Stop-the-Line Rule
|
|
33
|
+
|
|
34
|
+
When a failure is observed, stop normal work immediately:
|
|
35
|
+
|
|
36
|
+
1. **STOP** adding features or making unrelated changes.
|
|
37
|
+
2. **PRESERVE** evidence (error output, logs, repro steps, commit hash, environment).
|
|
38
|
+
3. **DIAGNOSE** using the triage checklist.
|
|
39
|
+
4. **FIX** the root cause, not the symptom.
|
|
40
|
+
5. **GUARD** against recurrence with a regression test or monitor.
|
|
41
|
+
6. **RESUME** only after verification passes.
|
|
42
|
+
|
|
43
|
+
Do not resume feature work while a verified failure is unaddressed. The longer a bug sits, the more assumptions build on top of it.
|
|
44
|
+
|
|
45
|
+
## The Triage Checklist
|
|
46
|
+
|
|
47
|
+
### Step 1: Reproduce — Make the failure happen reliably
|
|
48
|
+
|
|
49
|
+
- Read the full error message and stack trace before acting.
|
|
50
|
+
- Capture relevant logs, request payloads, environment variables, and commit hashes.
|
|
51
|
+
- Run the failing command or scenario until it fails consistently.
|
|
52
|
+
- If the failure is intermittent, record frequency, timing, and environment differences.
|
|
53
|
+
- Document exact reproduction steps so another agent can replay them.
|
|
54
|
+
- If reproduction is impossible, document the evidence and move to the Non-reproducible bugs pattern.
|
|
55
|
+
- If the failure only happens in CI, reproduce in a matching container or environment before assuming it is environmental noise.
|
|
56
|
+
- Check whether the failure depends on a specific seed, order, or race condition.
|
|
57
|
+
|
|
58
|
+
### Step 2: Localize — Narrow down WHERE the bug lives
|
|
59
|
+
|
|
60
|
+
- Identify the failing layer: input validation, boundary, business logic, integration, environment.
|
|
61
|
+
- Use `git bisect` when the failure started recently and history is clean.
|
|
62
|
+
- For test failures: confirm whether the code under test changed or the test became stale.
|
|
63
|
+
- For build failures: identify whether it is a type error, import error, config error, dependency error, or environment error.
|
|
64
|
+
- For runtime errors: trace the call path from entry point to the thrown error.
|
|
65
|
+
- For unexpected behavior: compare actual output against expected behavior in the smallest observable scope.
|
|
66
|
+
- Ask: what is the last point where the state was still correct?
|
|
67
|
+
- Use available tools to gather evidence: read source near the error line, inspect callers and callees, search for related symbols, and check recent diffs.
|
|
68
|
+
|
|
69
|
+
### Step 3: Reduce — Create the minimal failing case
|
|
70
|
+
|
|
71
|
+
- Remove unrelated code, data, and configuration until the failure still occurs.
|
|
72
|
+
- Replace large inputs with the smallest input that triggers the bug.
|
|
73
|
+
- Run the reduced case in isolation to confirm it reproduces the original failure.
|
|
74
|
+
- A minimal case clarifies the root cause and becomes the basis of a regression test.
|
|
75
|
+
- If reduction is hard, bisect the inputs or the commit history to isolate the trigger.
|
|
76
|
+
- Keep a record of each reduction step so the investigation remains reversible.
|
|
77
|
+
|
|
78
|
+
### Step 4: Fix the Root Cause — Fix the underlying issue, not the symptom
|
|
79
|
+
|
|
80
|
+
- Ask "Why does this happen?" repeatedly until you reach the actual cause.
|
|
81
|
+
- Form one hypothesis and test it with one change or one diagnostic.
|
|
82
|
+
- Change one causal layer at a time.
|
|
83
|
+
- Avoid defensive patches that hide symptoms without fixing cause.
|
|
84
|
+
- Prefer the smallest fix that removes the failure and matches the intended design.
|
|
85
|
+
- If the fix requires touching multiple layers, verify each layer independently.
|
|
86
|
+
- Do not combine unrelated changes in the same commit as the bug fix.
|
|
87
|
+
|
|
88
|
+
### Step 5: Guard Against Recurrence — Write a test that catches this specific failure
|
|
89
|
+
|
|
90
|
+
- Add a regression test that fails without the fix and passes with it.
|
|
91
|
+
- If the bug cannot be tested directly, add an assertion, monitor, or lint rule that would have caught it.
|
|
92
|
+
- Update documentation or runbooks when the fix involves operational behavior.
|
|
93
|
+
- Make the guard visible: a passing test named after the bug is better than a comment.
|
|
94
|
+
- Ensure the guard runs in CI, not only locally.
|
|
95
|
+
|
|
96
|
+
### Step 6: Verify End-to-End — Confirm the failure is gone and nothing else broke
|
|
97
|
+
|
|
98
|
+
- Run the original reproduction scenario and confirm it passes.
|
|
99
|
+
- Run the new regression test.
|
|
100
|
+
- Run the relevant test suite, typecheck, lint, and build.
|
|
101
|
+
- Perform a manual spot check when the failure has UI or workflow behavior.
|
|
102
|
+
- If verification fails, return to Step 2 with fresh evidence.
|
|
103
|
+
- If three fix attempts fail, stop and escalate architecture or assumption risk.
|
|
104
|
+
- Document the verification commands used and their output.
|
|
105
|
+
|
|
106
|
+
## Error-Specific Patterns
|
|
107
|
+
|
|
108
|
+
### Test Failure
|
|
109
|
+
|
|
110
|
+
- Did you change code the test covers? The test may be outdated, or the code may have a bug.
|
|
111
|
+
- Check whether the test makes a brittle assumption about ordering, timing, or internal state.
|
|
112
|
+
- Do not skip or delete the test until you prove it is wrong.
|
|
113
|
+
- If the test is outdated, update it to match the new contract and verify the contract is intentional.
|
|
114
|
+
- If the test is flaky, isolate the source of flakiness rather than increasing retries.
|
|
115
|
+
|
|
116
|
+
### Build Failure
|
|
117
|
+
|
|
118
|
+
- **Type error**: check changed signatures, generics, and strict null checks.
|
|
119
|
+
- **Import error**: check moved files, missing exports, circular imports, and dependency versions.
|
|
120
|
+
- **Config error**: check changed config files, environment variables, and CI images.
|
|
121
|
+
- **Dependency error**: check lockfile drift, peer dependency ranges, and installed versions.
|
|
122
|
+
- **Environment error**: check Node/runtime version, OS differences, and CI vs local divergence.
|
|
123
|
+
- Treat build errors as runtime errors that happen earlier: the root cause is usually a recent change, not the build tool.
|
|
124
|
+
|
|
125
|
+
### Runtime Error
|
|
126
|
+
|
|
127
|
+
- **TypeError / null / undefined**: trace the value back to its source; add null checks only after understanding why it is missing.
|
|
128
|
+
- **Network / CORS**: verify endpoint, headers, credentials, and allowed origins.
|
|
129
|
+
- **Render error**: check component props, state lifecycle, and framework-specific boundaries.
|
|
130
|
+
- **Unexpected behavior**: compare actual vs expected outputs and reduce to a minimal assertion.
|
|
131
|
+
- **Performance regression**: measure before and after; do not optimize from intuition.
|
|
132
|
+
- **Memory leak**: look for unbounded caches, unremoved listeners, and retained closures.
|
|
133
|
+
|
|
134
|
+
### Non-reproducible bugs
|
|
135
|
+
|
|
136
|
+
- **Timing-dependent**: add logging, reduce concurrency, or introduce deterministic sequencing.
|
|
137
|
+
- **Environment-dependent**: compare CI, local, staging, and production configs and dependencies.
|
|
138
|
+
- **State-dependent**: capture full application state at failure time and replay against it.
|
|
139
|
+
- When a bug cannot be reproduced, document everything and add a monitor so the next occurrence is captured.
|
|
140
|
+
- Increase observability before the next attempt; guessing without data usually fails.
|
|
141
|
+
- Set a timebox for chasing a non-reproducible bug before switching to defensive guards.
|
|
142
|
+
|
|
143
|
+
## Safe Fallback Patterns
|
|
144
|
+
|
|
145
|
+
When a fix cannot be applied immediately or the root cause is still uncertain:
|
|
146
|
+
|
|
147
|
+
- Use safe defaults with warnings rather than broken features.
|
|
148
|
+
- Apply graceful degradation that preserves core functionality.
|
|
149
|
+
- Make the fallback observable so users and operators know something is wrong.
|
|
150
|
+
- Do not treat a fallback as a permanent substitute for a root-cause fix.
|
|
151
|
+
- Prefer returning an explicit error over silently returning corrupted or partial data.
|
|
152
|
+
- Log the fallback path and the conditions that triggered it.
|
|
153
|
+
|
|
154
|
+
## Evidence Log
|
|
155
|
+
|
|
156
|
+
For complex bugs, maintain a short log in the response or a debug artifact:
|
|
157
|
+
|
|
158
|
+
```markdown
|
|
159
|
+
## Symptoms
|
|
160
|
+
- ...
|
|
161
|
+
## Reproduction
|
|
162
|
+
- ...
|
|
163
|
+
## Hypotheses Eliminated
|
|
164
|
+
- ...
|
|
165
|
+
## Root Cause
|
|
166
|
+
- ...
|
|
167
|
+
## Fix and Guard
|
|
168
|
+
- ...
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Use the log to keep the investigation honest. Each entry should contain a fact, not a guess. Share the log when escalating so the next agent can continue without starting over.
|
|
172
|
+
|
|
173
|
+
## Common Rationalizations
|
|
174
|
+
|
|
175
|
+
| Rationalization | Reality |
|
|
176
|
+
| --- | --- |
|
|
177
|
+
| "This is probably the issue" | Probably is a hypothesis, not evidence. Test it minimally. |
|
|
178
|
+
| "I'll patch the symptom now" | Symptom patches hide root causes and regress later. |
|
|
179
|
+
| "Multiple fixes will save time" | You will not know which change mattered. |
|
|
180
|
+
| "The test failure is unrelated" | Prove it with isolation before ignoring it. |
|
|
181
|
+
| "One more attempt" | After three failed fixes, the model is wrong. Stop and rethink. |
|
|
182
|
+
| "I know what the bug is, I'll just fix it" | You might be right 70% of the time. The other 30% costs hours. Reproduce first. |
|
|
183
|
+
| "The failing test is probably wrong" | Verify that assumption. Don't just skip it. |
|
|
184
|
+
| "It works on my machine" | Environments differ. Check CI, config, dependencies. |
|
|
185
|
+
| "I'll fix it in the next commit" | Fix it now. Next commit introduces new bugs on top. |
|
|
186
|
+
| "This is a flaky test, ignore it" | Flaky tests mask real bugs. Fix the flakiness. |
|
|
187
|
+
|
|
188
|
+
## Red Flags
|
|
189
|
+
|
|
190
|
+
- Code changes before reproduction.
|
|
191
|
+
- Fix proposed before reading the full error.
|
|
192
|
+
- Same failure persists after two attempts.
|
|
193
|
+
- New failures appear in different layers.
|
|
194
|
+
- Regression test is skipped for a reproducible bug.
|
|
195
|
+
- Success claimed without re-running the original failing scenario.
|
|
196
|
+
- Skipping a failing test to work on new features.
|
|
197
|
+
- Guessing at fixes without reproducing the bug.
|
|
198
|
+
- Fixing symptoms instead of root causes.
|
|
199
|
+
- No regression test added after a bug fix.
|
|
200
|
+
- Continuing feature work while a failure is unverified.
|
|
201
|
+
- Treating environment differences as unimportant.
|
|
202
|
+
|
|
203
|
+
## Verification Checklist
|
|
204
|
+
|
|
205
|
+
- [ ] Original failure is reproduced or documented as non-reproducible.
|
|
206
|
+
- [ ] Root cause is identified and documented with evidence.
|
|
207
|
+
- [ ] Fix addresses the root cause, not just symptoms.
|
|
208
|
+
- [ ] A regression test exists that fails without the fix.
|
|
209
|
+
- [ ] All existing tests pass.
|
|
210
|
+
- [ ] Build / lint / typecheck succeeds.
|
|
211
|
+
- [ ] The original bug scenario is verified end-to-end.
|
|
212
|
+
- [ ] Related tests and checks pass.
|
|
213
|
+
- [ ] No new failures appear in adjacent layers.
|
|
214
|
+
- [ ] Evidence log or debug notes are updated.
|
|
215
|
+
|
|
216
|
+
## Skill Result Contract
|
|
217
|
+
|
|
218
|
+
```xml
|
|
219
|
+
<skill_result>
|
|
220
|
+
<skill>debugging-and-error-recovery</skill>
|
|
221
|
+
<status>success|partial|blocked|failure</status>
|
|
222
|
+
<evidence>Reproduction, root cause, fix, and verification commands</evidence>
|
|
223
|
+
<artifacts>Changed files, tests, debug notes</artifacts>
|
|
224
|
+
<risks>Non-reproducible behavior, missing regression test, or none</risks>
|
|
225
|
+
</skill_result>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Consolidated Debugging Workflow
|
|
229
|
+
|
|
230
|
+
This is the canonical active debugging skill. It absorbs `systematic-debugging` while preserving root-cause discipline. Use `root-cause-tracing` as an advanced companion when the failure is deep in execution.
|
|
231
|
+
|
|
232
|
+
Required posture:
|
|
233
|
+
|
|
234
|
+
- reproduce or observe the failure before fixing;
|
|
235
|
+
- state the hypothesis and evidence;
|
|
236
|
+
- change one causal layer at a time;
|
|
237
|
+
- verify the failure mode is gone;
|
|
238
|
+
- record recovery actions and residual risk.
|
|
239
|
+
|
|
240
|
+
## How to Use Tools During Debugging
|
|
241
|
+
|
|
242
|
+
Use tool calls deliberately, not randomly:
|
|
243
|
+
|
|
244
|
+
- Read the error location and a few lines of surrounding code before hypothesizing.
|
|
245
|
+
- Search for the error message or symbol across the codebase to find related call sites.
|
|
246
|
+
- Inspect callers and callees of the failing function to understand data flow.
|
|
247
|
+
- Check recent commits and diffs when the failure is new.
|
|
248
|
+
- Run the exact failing command and capture full output.
|
|
249
|
+
- Use memory search to see if this failure or a similar one was recorded before.
|
|
250
|
+
|
|
251
|
+
Avoid changing code until the evidence points to a specific cause.
|
|
252
|
+
|
|
253
|
+
## Escalation Guidance
|
|
254
|
+
|
|
255
|
+
Escalate when any of the following are true:
|
|
256
|
+
|
|
257
|
+
- Three fix attempts have failed.
|
|
258
|
+
- The failure spans multiple services, repositories, or teams.
|
|
259
|
+
- The root cause points to an architectural assumption that needs a decision.
|
|
260
|
+
- The fix would require a breaking change or new dependency.
|
|
261
|
+
- The bug is security-sensitive or affects production data integrity.
|
|
262
|
+
|
|
263
|
+
When escalating, include the Evidence Log, the current hypothesis, and the commands that reproduce the failure.
|
|
264
|
+
|
|
265
|
+
## Short Example
|
|
266
|
+
|
|
267
|
+
A failing test reports `TypeError: Cannot read property 'name' of undefined`.
|
|
268
|
+
|
|
269
|
+
1. Reproduce: run the single test; it fails every time.
|
|
270
|
+
2. Localize: the undefined value comes from a mapper function that receives `user.profile`.
|
|
271
|
+
3. Reduce: pass the smallest payload that still triggers the undefined read.
|
|
272
|
+
4. Fix root cause: the upstream API now omits `profile` for guests; update the mapper to handle missing `profile`.
|
|
273
|
+
5. Guard: add a regression test with a guest payload.
|
|
274
|
+
6. Verify: run the new test without the fix to confirm it fails, then with the fix, then run the full suite.
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deep-module-design
|
|
3
|
+
description: Applies Ousterhout's deep module principles to code design — small interfaces, information hiding, pull complexity downward. Use when designing modules, refactoring shallow structures, or reviewing AI-generated code for structural quality.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deep Module Design
|
|
7
|
+
|
|
8
|
+
> Based on John Ousterhout's *A Philosophy of Software Design*
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
A deep module has a **small interface relative to its implementation**. It provides significant functionality through a compact abstraction, hiding complexity from its callers. A shallow module has an **interface as complex as its implementation** — it wraps one small thing with ceremony, adding overhead without hiding anything.
|
|
13
|
+
|
|
14
|
+
**Why this matters for AI agents:** AI coding tools generate code faster than humans can review. Shallow modules compound this problem — every AI pass can produce more tiny, shallow abstractions that increase cognitive load without reducing complexity. Deep modules constrain the AI: a small, stable interface limits the blast radius of AI-generated changes and makes verification tractable.
|
|
15
|
+
|
|
16
|
+
> *"The most important technique for achieving deep modules is information hiding."* — Ousterhout
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
- Designing a new module, class, or API boundary
|
|
21
|
+
- Reviewing code for structural quality (beyond just correctness)
|
|
22
|
+
- Refactoring a codebase where changes are too expensive because interfaces are too complex
|
|
23
|
+
- Working with AI agents that need tight, stable interfaces to produce reliable code
|
|
24
|
+
- Any time you find yourself writing a class/method that just calls another class/method
|
|
25
|
+
|
|
26
|
+
## When NOT to Use
|
|
27
|
+
|
|
28
|
+
- Prototyping where the abstraction will change completely (use after stabilization)
|
|
29
|
+
- Tiny utility functions that are inherently single-purpose and shallow by nature
|
|
30
|
+
- Code that will be replaced within the sprint
|
|
31
|
+
|
|
32
|
+
## Core Concept: Deep vs Shallow
|
|
33
|
+
|
|
34
|
+
### Deep Module
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
┌─────────────────────────────────────┐
|
|
38
|
+
│ COMPLEX IMPLEMENTATION │
|
|
39
|
+
│ (caching, retries, batching, │
|
|
40
|
+
│ connection pooling, fallbacks) │
|
|
41
|
+
│ │
|
|
42
|
+
│ ┌─────────────────────────────┐ │
|
|
43
|
+
│ │ SMALL INTERFACE │ │
|
|
44
|
+
│ │ get(key), set(key, val) │ │
|
|
45
|
+
│ └─────────────────────────────┘ │
|
|
46
|
+
└─────────────────────────────────────┘
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Example: Unix I/O (`open`, `read`, `write`, `close`). Five system calls hide filesystems, device drivers, disk scheduling, buffering, permissions, and network mounts. The interface has not changed in decades.
|
|
50
|
+
|
|
51
|
+
### Shallow Module
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
┌─────────────────────┐
|
|
55
|
+
│ SMALL IMPLEMENT. │
|
|
56
|
+
│ (just wraps one │
|
|
57
|
+
│ function call) │
|
|
58
|
+
│ │
|
|
59
|
+
│ ┌───────────────┐ │
|
|
60
|
+
│ │ COMPLEX IFACE │ │
|
|
61
|
+
│ │ many methods, │ │
|
|
62
|
+
│ │ many config │ │
|
|
63
|
+
│ │ options │ │
|
|
64
|
+
│ └───────────────┘ │
|
|
65
|
+
└─────────────────────┘
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Example: A "ParserFactory" that has one method `createParser(type)` which does a switch statement. The factory adds a class, an interface, and a registration mechanism — more surface area than the problem requires. Better to just call the parser directly or use a simple config object.
|
|
69
|
+
|
|
70
|
+
### Self-Test
|
|
71
|
+
|
|
72
|
+
Ask about ANY module you design or review:
|
|
73
|
+
|
|
74
|
+
> "Can I understand this module's interface in 30 seconds?"
|
|
75
|
+
> "Does the caller need to know implementation details to use it?"
|
|
76
|
+
> "Is this module's API surface area proportional to the complexity it hides?"
|
|
77
|
+
|
|
78
|
+
If the interface takes longer to learn than the implementation, the module is shallow — either deepen it or eliminate it.
|
|
79
|
+
|
|
80
|
+
## Design Principles
|
|
81
|
+
|
|
82
|
+
### 1. Information Hiding
|
|
83
|
+
|
|
84
|
+
The most important technique for achieving deep modules. Every implementation detail that callers don't need to know about should be private, internal, or abstracted away.
|
|
85
|
+
|
|
86
|
+
**Signs of information leakage:**
|
|
87
|
+
- Configuration that callers must set but relates to internal behavior (buffer sizes, retry counts, thread pool sizes)
|
|
88
|
+
- Methods that expose internal types (returning database rows, internal DTOs)
|
|
89
|
+
- Callers constructing complex intermediate objects before calling your API
|
|
90
|
+
|
|
91
|
+
**Fix:** Move the complexity inside. Default everything. Accept simple inputs.
|
|
92
|
+
|
|
93
|
+
### 2. Pull Complexity Downward
|
|
94
|
+
|
|
95
|
+
If a feature introduces complexity, handle it inside the module rather than pushing it to callers.
|
|
96
|
+
|
|
97
|
+
| [ ] Pushed to caller | [x] Pulled downward |
|
|
98
|
+
|---|---|
|
|
99
|
+
| Caller must handle retries, timeouts, and fallbacks | Module handles them internally |
|
|
100
|
+
| Caller must format data correctly before passing | Module accepts raw data and transforms it |
|
|
101
|
+
| Caller must manage connection lifecycle | Module manages pools transparently |
|
|
102
|
+
|
|
103
|
+
> *"It is more important for a module to have a simple interface than a simple implementation."* — Ousterhout
|
|
104
|
+
|
|
105
|
+
### 3. General-Purpose vs Special-Purpose
|
|
106
|
+
|
|
107
|
+
General-purpose modules tend to be **deeper** because they solve a class of problems, not just one specific case. Special-purpose modules tend to be **shallower** because they're closely coupled to one use case.
|
|
108
|
+
|
|
109
|
+
**Rule of thumb:** Design modules to solve general problems. A "UserRepository" is deep (CRUD + queries for any user need). A "GetUserForLoginHandler" is shallow (only handles one specific query) — better to have a general `getUser` method and let callers filter as needed.
|
|
110
|
+
|
|
111
|
+
**Exception:** If the general-purpose interface would be significantly harder to understand, keep it special-purpose. Depth wins over generality.
|
|
112
|
+
|
|
113
|
+
### 4. Different Layer, Different Abstraction
|
|
114
|
+
|
|
115
|
+
Each layer of a system should provide a **different abstraction**. If two layers provide the same abstraction, one of them is redundant.
|
|
116
|
+
|
|
117
|
+
**Red flag — pass-through methods:**
|
|
118
|
+
```typescript
|
|
119
|
+
// Layer 2: Service layer
|
|
120
|
+
class UserService {
|
|
121
|
+
constructor(private repo: UserRepository) {}
|
|
122
|
+
|
|
123
|
+
// This is a pass-through — it adds nothing
|
|
124
|
+
getUser(id: string) {
|
|
125
|
+
return this.repo.findById(id);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
If a method does nothing except delegate with the exact same signature, it's a **pass-through method** — a sign the layer boundary is wrong. Either make the layer do something meaningful, or remove it.
|
|
131
|
+
|
|
132
|
+
**Red flag — pass-through variables:**
|
|
133
|
+
```typescript
|
|
134
|
+
// Top-level handler
|
|
135
|
+
function handleRequest(req, config) {
|
|
136
|
+
return processRequest(req, config);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Middle layer
|
|
140
|
+
function processRequest(req, config) {
|
|
141
|
+
return executeQuery(req, config);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Bottom layer
|
|
145
|
+
function executeQuery(req, config) {
|
|
146
|
+
return db.query(req, config);
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
When the same variable (`config`) passes through multiple layers without being used by the middle layers, it's a **pass-through variable**. This couples all layers to the config shape. Fix: put config in a global context, or restructure so the middle layers don't need it.
|
|
151
|
+
|
|
152
|
+
## Red Flag Catalog
|
|
153
|
+
|
|
154
|
+
| Red Flag | What it looks like | Fix |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| **Shallow module** | Interface as complex as its implementation | Eliminate or merge into caller |
|
|
157
|
+
| **Information leakage** | One module exposes types another module depends on | Move the types to a shared neutral location or hide them |
|
|
158
|
+
| **Pass-through method** | Method just delegates with same signature | Remove the middle layer or make it add value |
|
|
159
|
+
| **Pass-through variable** | Same data flows through many layers unused | Use a context object or restructure |
|
|
160
|
+
| **Replicated code smell** | Same pattern appears across modules instead of once | Extract a deeper module that encapsulates the pattern |
|
|
161
|
+
| **Configuration pollution** | Callers must configure internal behavior (buffer sizes, timeouts) | Auto-detect or default everything |
|
|
162
|
+
| **Returning internal state** | API exposes DB rows, internal DTOs, or raw storage types | Map to public types at the boundary |
|
|
163
|
+
| **Temporal coupling** | Methods must be called in a specific order not enforced by types | Design so invalid states are unrepresentable |
|
|
164
|
+
|
|
165
|
+
## AI-Specific Applications
|
|
166
|
+
|
|
167
|
+
Deep modules are especially valuable for AI-generated code:
|
|
168
|
+
|
|
169
|
+
| Problem | Deep module solution |
|
|
170
|
+
|---|---|
|
|
171
|
+
| AI creates shallow wrappers every time it refactors | Eliminate or merge them — keep the abstraction layer count minimal |
|
|
172
|
+
| AI introduces pass-through methods when adding layers | Spot them in review and remove — they add surface area without depth |
|
|
173
|
+
| AI makes cascading changes because interfaces are too wide | Narrow interfaces — a small, stable surface limits blast radius |
|
|
174
|
+
| AI generates inconsistent implementations across similar operations | Create one deep general-purpose module the AI can reuse instead of reimplementing |
|
|
175
|
+
| AI hallucinates configuration options the module doesn't need | Remove configurability — deep modules default aggressively |
|
|
176
|
+
|
|
177
|
+
## Verification
|
|
178
|
+
|
|
179
|
+
- [ ] Every module's interface is easier to understand than its implementation
|
|
180
|
+
- [ ] No pass-through methods (methods that just delegate with same signature)
|
|
181
|
+
- [ ] No information leakage (callers don't depend on internal types)
|
|
182
|
+
- [ ] No configuration that should be internalized
|
|
183
|
+
- [ ] Different layers provide different abstractions
|
|
184
|
+
- [ ] AI agents could safely use this module without reading its implementation
|
|
185
|
+
|
|
186
|
+
## See Also
|
|
187
|
+
|
|
188
|
+
- **code-review-and-quality** — Assess for shallow modules and information leakage during review
|
|
189
|
+
- **api-and-interface-design** — Deep module principles applied to REST/API design
|
|
190
|
+
- **code-cleanup** — Consolidate shallow modules during cleanup passes
|
|
191
|
+
|
|
192
|
+
## Skill Result Contract
|
|
193
|
+
|
|
194
|
+
```xml
|
|
195
|
+
<skill_result>
|
|
196
|
+
<skill>deep-module-design</skill>
|
|
197
|
+
<status>success|partial|blocked|failure</status>
|
|
198
|
+
<evidence>Modules assessed, red flags found or cleared, depth ratio evaluated</evidence>
|
|
199
|
+
<artifacts>Files or modules reviewed/designed</artifacts>
|
|
200
|
+
<risks>Known shallow modules deferred, or none</risks>
|
|
201
|
+
</skill_result>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Common Rationalizations
|
|
205
|
+
|
|
206
|
+
| Rationalization | Reality |
|
|
207
|
+
|---|---|
|
|
208
|
+
| "The interface is simple enough" | Shallow modules (complex interface, simple implementation) leak complexity to callers. Go deep. |
|
|
209
|
+
| "I'll add this convenience method to the interface" | Every interface addition is a future compatibility constraint. Be minimal. |
|
|
210
|
+
| "Abstraction is always good" | Bad abstraction is worse than no abstraction. Generalize on the third use, not the first. |
|
|
211
|
+
|
|
212
|
+
## Red Flags
|
|
213
|
+
|
|
214
|
+
- Interface method count exceeding implementation method count (shallow module)
|
|
215
|
+
- Information leakage between modules through shared mutable state
|
|
216
|
+
- "General" or "utils" modules with no clear responsibility
|
|
217
|
+
- Abstraction layer that adds indirection without hiding complexity
|
|
218
|
+
- Module boundary crossed for data that should be encapsulated
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: defense-in-depth
|
|
3
|
+
description: Use when invalid data causes failures deep in execution, requiring validation at multiple system layers - validates at every layer data passes through to make bugs structurally impossible
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Defense-in-Depth Validation
|
|
7
|
+
|
|
8
|
+
> **Replaces** single-layer validation where bad data propagates silently until it causes cryptic failures deep in execution
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- A bug is caused by invalid data flowing through multiple layers
|
|
13
|
+
- One validation check is insufficient because data crosses boundaries
|
|
14
|
+
|
|
15
|
+
## When NOT to Use
|
|
16
|
+
|
|
17
|
+
- Simple, single-layer validation at an obvious entry point is enough
|
|
18
|
+
- The issue is unrelated to invalid data or boundary checks
|
|
19
|
+
|
|
20
|
+
## Common Rationalizations
|
|
21
|
+
|
|
22
|
+
| Rationalization | Rebuttal |
|
|
23
|
+
| ------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
|
|
24
|
+
| "One validation at the entry point is enough" | Different code paths, refactors, and mocks all bypass a single gate — each layer catches what others miss |
|
|
25
|
+
| "This adds too much boilerplate" | Each validation is 2-3 lines. The bug it prevents costs hours of debugging |
|
|
26
|
+
| "The caller already validates this" | You don't control the caller. New callers won't know your assumptions |
|
|
27
|
+
| "Tests will catch it" | Tests run after the fact. Validation prevents the bug from existing |
|
|
28
|
+
| "This is an internal function, input is trusted" | Internal functions get called from new paths during refactors. Trust no input |
|
|
29
|
+
|
|
30
|
+
## Anti-Patterns
|
|
31
|
+
|
|
32
|
+
| Anti-Pattern | Why It Fails | Instead |
|
|
33
|
+
| -------------------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------ |
|
|
34
|
+
| Validating only at the entry point (trusting downstream) | Alternate paths and refactors bypass one gate | Add independent checks at each boundary |
|
|
35
|
+
| Duplicating identical validation at every layer | Creates noise without improving safety | Tailor each layer to boundary-specific invariants |
|
|
36
|
+
| Catching and swallowing errors silently | Hides failures and delays detection | Raise explicit errors with actionable context |
|
|
37
|
+
| Mixing validation with business logic | Makes behavior hard to reason about and test | Keep validation checks explicit and separate from core logic |
|
|
38
|
+
|
|
39
|
+
## Overview
|
|
40
|
+
|
|
41
|
+
When you fix a bug caused by invalid data, adding validation at one place feels sufficient. But that single check can be bypassed by different code paths, refactoring, or mocks.
|
|
42
|
+
|
|
43
|
+
**Core principle:** Validate at EVERY layer data passes through. Make the bug structurally impossible.
|
|
44
|
+
|
|
45
|
+
## Why Multiple Layers
|
|
46
|
+
|
|
47
|
+
Single validation: "We fixed the bug"
|
|
48
|
+
Multiple layers: "We made the bug impossible"
|
|
49
|
+
|
|
50
|
+
Different layers catch different cases:
|
|
51
|
+
|
|
52
|
+
- Entry validation catches most bugs
|
|
53
|
+
- Business logic catches edge cases
|
|
54
|
+
- Environment guards prevent context-specific dangers
|
|
55
|
+
- Debug logging helps when other layers fail
|
|
56
|
+
|
|
57
|
+
## The Four Layers
|
|
58
|
+
|
|
59
|
+
### Layer 1: Entry Point Validation
|
|
60
|
+
|
|
61
|
+
**Purpose:** Reject obviously invalid input at API boundary
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
function createProject(name: string, workingDirectory: string) {
|
|
65
|
+
if (!workingDirectory || workingDirectory.trim() === "") {
|
|
66
|
+
throw new Error("workingDirectory cannot be empty");
|
|
67
|
+
}
|
|
68
|
+
if (!existsSync(workingDirectory)) {
|
|
69
|
+
throw new Error(`workingDirectory does not exist: ${workingDirectory}`);
|
|
70
|
+
}
|
|
71
|
+
if (!statSync(workingDirectory).isDirectory()) {
|
|
72
|
+
throw new Error(`workingDirectory is not a directory: ${workingDirectory}`);
|
|
73
|
+
}
|
|
74
|
+
// ... proceed
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Layer 2: Business Logic Validation
|
|
79
|
+
|
|
80
|
+
**Purpose:** Ensure data makes sense for this operation
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
function initializeWorkspace(projectDir: string, sessionId: string) {
|
|
84
|
+
if (!projectDir) {
|
|
85
|
+
throw new Error("projectDir required for workspace initialization");
|
|
86
|
+
}
|
|
87
|
+
// ... proceed
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Layer 3: Environment Guards
|
|
92
|
+
|
|
93
|
+
**Purpose:** Prevent dangerous operations in specific contexts
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
async function gitInit(directory: string) {
|
|
97
|
+
// In tests, refuse git init outside temp directories
|
|
98
|
+
if (process.env.NODE_ENV === "test") {
|
|
99
|
+
const normalized = normalize(resolve(directory));
|
|
100
|
+
const tmpDir = normalize(resolve(tmpdir()));
|
|
101
|
+
|
|
102
|
+
if (!normalized.startsWith(tmpDir)) {
|
|
103
|
+
throw new Error(`Refusing git init outside temp dir during tests: ${directory}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// ... proceed
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Layer 4: Debug Instrumentation
|
|
111
|
+
|
|
112
|
+
**Purpose:** Capture context for forensics
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
async function gitInit(directory: string) {
|
|
116
|
+
const stack = new Error().stack;
|
|
117
|
+
logger.debug("About to git init", {
|
|
118
|
+
directory,
|
|
119
|
+
cwd: process.cwd(),
|
|
120
|
+
stack,
|
|
121
|
+
});
|
|
122
|
+
// ... proceed
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Applying the Pattern
|
|
127
|
+
|
|
128
|
+
When you find a bug:
|
|
129
|
+
|
|
130
|
+
1. **Trace the data flow** - Where does bad value originate? Where used?
|
|
131
|
+
2. **Map all checkpoints** - List every point data passes through
|
|
132
|
+
3. **Add validation at each layer** - Entry, business, environment, debug
|
|
133
|
+
4. **Test each layer** - Try to bypass layer 1, verify layer 2 catches it
|
|
134
|
+
|
|
135
|
+
## Verification
|
|
136
|
+
|
|
137
|
+
- Test with invalid input at each layer boundary — each should reject independently.
|
|
138
|
+
- Remove one validation layer — the next layer should still catch the error.
|
|
139
|
+
|
|
140
|
+
## See Also
|
|
141
|
+
|
|
142
|
+
- `verification-before-completion` skill
|
|
143
|
+
- `behavioral-kernel` skill
|
|
144
|
+
|
|
145
|
+
## Red Flags
|
|
146
|
+
|
|
147
|
+
- Validation only at the outermost layer
|
|
148
|
+
- Trusting upstream data without verification
|
|
149
|
+
- Error handling that assumes valid input
|
|
150
|
+
- "This can never be null" comments without null checks
|
|
151
|
+
- Single-point validation in a multi-hop data flow
|
|
152
|
+
|
|
153
|
+
## Verification
|
|
154
|
+
|
|
155
|
+
After applying defense-in-depth:
|
|
156
|
+
|
|
157
|
+
- [ ] Validation exists at every system boundary data crosses
|
|
158
|
+
- [ ] Each layer validates independently, not relying on upstream guarantees
|
|
159
|
+
- [ ] Invalid data cannot reach the persistence or business logic layer
|
|
160
|
+
- [ ] Error handling at each layer is appropriate (not swallowing, not crashing)
|
|
161
|
+
- [ ] New validation rules have corresponding tests
|