@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,344 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review-and-quality
|
|
3
|
+
description: Reviews code for correctness, regressions, security, maintainability, and goal completion. Use before merge, after subagent work, or when asked for a review.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review & Quality
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Review is a bug-finding activity, not a compliment sandwich. Verify the goal is achieved and no unacceptable risk is introduced.
|
|
11
|
+
|
|
12
|
+
Core principle: findings first, with `file:line` evidence and impact.
|
|
13
|
+
|
|
14
|
+
**Complexity is a correctness issue.** Working code that adds structural complexity makes future changes harder, slower, and more error-prone. Reviewers must weigh structural quality alongside behavior.
|
|
15
|
+
|
|
16
|
+
Use the **three complexity symptoms** (Ousterhout) as review lenses:
|
|
17
|
+
- **Change amplification**: a small future change requires touching many places.
|
|
18
|
+
- **Cognitive load**: the reviewer must understand too much of the system to assess one change.
|
|
19
|
+
- **Unknown unknowns**: hidden dependencies hide what must change for a new requirement.
|
|
20
|
+
|
|
21
|
+
Approve when the change clearly improves overall code health, even if imperfect. Do not block solely because you would have written it differently.
|
|
22
|
+
|
|
23
|
+
## When to Use
|
|
24
|
+
|
|
25
|
+
- User asks for review.
|
|
26
|
+
- Before merge/ship or after a worker/subagent reports completion.
|
|
27
|
+
- Refactors, security-sensitive changes, API changes, migrations, concurrency, or auth.
|
|
28
|
+
- Any change where complexity may have been introduced (always suspect).
|
|
29
|
+
|
|
30
|
+
## When NOT to Use
|
|
31
|
+
|
|
32
|
+
- Planning decisions before code exists; use `planning-and-task-breakdown`.
|
|
33
|
+
- Implementation; reviewer must stay read-only.
|
|
34
|
+
- Style-only commentary unless it hides a real bug.
|
|
35
|
+
|
|
36
|
+
## The Five-Axis Review
|
|
37
|
+
|
|
38
|
+
Evaluate every change across:
|
|
39
|
+
|
|
40
|
+
### 1. Correctness
|
|
41
|
+
- Matches the spec or task requirements.
|
|
42
|
+
- Edge cases handled (null, empty, boundary values).
|
|
43
|
+
- Error paths handled, not only happy path.
|
|
44
|
+
- Tests pass and test the right things; no off-by-one or race conditions.
|
|
45
|
+
|
|
46
|
+
### 2. Readability & Simplicity
|
|
47
|
+
- Names are descriptive and consistent (no `temp`, `data`, `result` without context).
|
|
48
|
+
- Control flow is straightforward; related code is grouped.
|
|
49
|
+
- No "clever" tricks; abstractions earn their complexity.
|
|
50
|
+
- Comments clarify non-obvious intent, not obvious code.
|
|
51
|
+
|
|
52
|
+
### 3. Architecture
|
|
53
|
+
- Follows existing patterns or justifies a new one.
|
|
54
|
+
- Clean module boundaries; dependencies flow the right way.
|
|
55
|
+
- Duplication extracted when appropriate; abstraction level is right.
|
|
56
|
+
|
|
57
|
+
### 4. Security
|
|
58
|
+
Load `security-and-hardening` for detailed guidance. Check input validation at boundaries, secrets out of code/logs, auth/authz, parameterized queries, XSS encoding, trusted dependencies, and untrusted external data.
|
|
59
|
+
|
|
60
|
+
### 5. Performance
|
|
61
|
+
Load `performance-optimization` for detailed guidance. Check N+1 queries, unbounded loops, sync-in-async, unnecessary re-renders, missing pagination, and hot-path allocations.
|
|
62
|
+
|
|
63
|
+
## Review Process
|
|
64
|
+
|
|
65
|
+
### Step 1: Understand the Context
|
|
66
|
+
- What is this change trying to accomplish?
|
|
67
|
+
- What spec or task does it implement?
|
|
68
|
+
- What is the expected behavior change?
|
|
69
|
+
|
|
70
|
+
### Step 2: Review the Tests First
|
|
71
|
+
- Do tests exist and test behavior (not implementation details)?
|
|
72
|
+
- Are edge cases covered?
|
|
73
|
+
- Do tests have descriptive names?
|
|
74
|
+
- Would they catch a regression if the code changed?
|
|
75
|
+
|
|
76
|
+
### Step 3: Review the Implementation
|
|
77
|
+
Walk through changed files with the five axes in mind: correctness, readability, architecture, security, performance.
|
|
78
|
+
|
|
79
|
+
### Step 4: Categorize Findings
|
|
80
|
+
Label every comment so the author knows what is required versus optional.
|
|
81
|
+
|
|
82
|
+
| Prefix | Meaning | Author Action |
|
|
83
|
+
| --- | --- | --- |
|
|
84
|
+
| *(no prefix)* | Required change | Must address before merge |
|
|
85
|
+
| **Critical:** | Blocks merge | Security vulnerability, data loss, broken functionality |
|
|
86
|
+
| **Nit:** | Minor, optional | Author may ignore — formatting, style preferences |
|
|
87
|
+
| **Optional:** / **Consider:** | Suggestion | Worth considering but not required |
|
|
88
|
+
| **FYI** | Informational only | No action needed — context for future reference |
|
|
89
|
+
|
|
90
|
+
### Step 5: Verify the Verification
|
|
91
|
+
- What tests were run?
|
|
92
|
+
- Did the build pass?
|
|
93
|
+
- Was the change tested manually?
|
|
94
|
+
- Are there screenshots for UI changes?
|
|
95
|
+
- Is there a before/after comparison?
|
|
96
|
+
|
|
97
|
+
## Change Sizing
|
|
98
|
+
|
|
99
|
+
Small, focused changes are easier to review, faster to merge, and safer to deploy.
|
|
100
|
+
|
|
101
|
+
| Size | Verdict |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| ~100 lines changed | Good. Reviewable in one sitting. |
|
|
104
|
+
| ~300 lines changed | Acceptable if it is a single logical change. |
|
|
105
|
+
| ~1000 lines changed | Too large. Split it. |
|
|
106
|
+
|
|
107
|
+
**What counts as "one change":** a single self-contained modification that addresses one thing, includes related tests, and keeps the system functional after submission.
|
|
108
|
+
|
|
109
|
+
**Splitting strategies:**
|
|
110
|
+
|
|
111
|
+
| Strategy | How | When |
|
|
112
|
+
| --- | --- | --- |
|
|
113
|
+
| **Stack** | Submit a small change, then start the next one based on it | Sequential dependencies |
|
|
114
|
+
| **By file group** | Separate changes for groups needing different reviewers | Cross-cutting concerns |
|
|
115
|
+
| **Horizontal** | Create shared code/stubs first, then consumers | Layered architecture |
|
|
116
|
+
| **Vertical** | Break into smaller full-stack slices of the feature | Feature work |
|
|
117
|
+
|
|
118
|
+
**When large changes are acceptable:** complete file deletions and automated refactoring where the reviewer only verifies intent, not every line.
|
|
119
|
+
|
|
120
|
+
**Separate refactoring from feature work.** A change that refactors existing code and adds new behavior is two changes. Small cleanups can be included at reviewer discretion.
|
|
121
|
+
|
|
122
|
+
## Severity
|
|
123
|
+
|
|
124
|
+
Internal priority scale:
|
|
125
|
+
|
|
126
|
+
| Priority | Meaning |
|
|
127
|
+
| --- | --- |
|
|
128
|
+
| P0 | Critical: data loss, security break, crash on common path, release blocker. |
|
|
129
|
+
| P1 | High: likely user-visible bug or serious regression. |
|
|
130
|
+
| P2 | Medium: edge-case bug, maintainability hazard with concrete impact. |
|
|
131
|
+
| P3 | Low: minor issue worth fixing but not blocking. |
|
|
132
|
+
|
|
133
|
+
Map review labels to priorities:
|
|
134
|
+
- **Critical:** → P0/P1
|
|
135
|
+
- *(no prefix)* → P1/P2
|
|
136
|
+
- **Optional:** / **Consider:** → P2/P3
|
|
137
|
+
- **Nit:** / **FYI** → P3 or informational
|
|
138
|
+
|
|
139
|
+
## Finding Template
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
[P1] Title — path/to/file.ts:42
|
|
143
|
+
Impact: What breaks and when.
|
|
144
|
+
Evidence: Concrete code behavior.
|
|
145
|
+
Confidence: 0.0-1.0
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Broken Windows Scan
|
|
149
|
+
|
|
150
|
+
A change should not normalize decay. Scan changed files for:
|
|
151
|
+
- Messy or unused imports, inconsistent formatting.
|
|
152
|
+
- Inconsistent naming or patterns within the same file.
|
|
153
|
+
- TODO comments without ticket references.
|
|
154
|
+
- Dead code, no-op handlers, static placeholder responses.
|
|
155
|
+
- Created files that are not imported or invoked anywhere.
|
|
156
|
+
- README/AGENTS.md drift caused by the change.
|
|
157
|
+
|
|
158
|
+
Fix broken windows in changed files; flag adjacent decay without widening scope unnecessarily.
|
|
159
|
+
|
|
160
|
+
## Dead Code Hygiene
|
|
161
|
+
|
|
162
|
+
After any refactoring or implementation change, check for orphaned code:
|
|
163
|
+
1. Identify code that is now unreachable or unused.
|
|
164
|
+
2. List it explicitly.
|
|
165
|
+
3. **Ask before deleting:** "Should I remove these now-unused elements: [list]?"
|
|
166
|
+
|
|
167
|
+
Do not leave dead code lying around, but do not silently delete things you are not sure about.
|
|
168
|
+
|
|
169
|
+
```text
|
|
170
|
+
DEAD CODE IDENTIFIED:
|
|
171
|
+
- formatLegacyDate() in src/utils/date.ts — replaced by formatDate()
|
|
172
|
+
- OldTaskCard in src/components/ — replaced by TaskCard
|
|
173
|
+
- LEGACY_API_URL in src/config.ts — no remaining references
|
|
174
|
+
→ Safe to remove these?
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Multi-Model Review Pattern
|
|
178
|
+
|
|
179
|
+
Use different models or agent runs for different review perspectives:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
Model A writes the code
|
|
183
|
+
│
|
|
184
|
+
▼
|
|
185
|
+
Model B reviews for correctness and architecture
|
|
186
|
+
│
|
|
187
|
+
▼
|
|
188
|
+
Model A addresses the feedback
|
|
189
|
+
│
|
|
190
|
+
▼
|
|
191
|
+
Human or lead agent makes the final call
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
This catches issues a single model might miss. Example prompt:
|
|
195
|
+
|
|
196
|
+
```text
|
|
197
|
+
Review this code change for correctness, security, and adherence to
|
|
198
|
+
project conventions. The spec says [X]. The change should [Y].
|
|
199
|
+
Flag any issues as Critical, Important, or Suggestion.
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Review Speed
|
|
203
|
+
|
|
204
|
+
Slow reviews block teams. The cost of context-switching to review is less than the waiting cost imposed on others.
|
|
205
|
+
- **Respond within one business day** — maximum, not target.
|
|
206
|
+
- **Ideal cadence:** respond shortly after a review request arrives, unless deep in focused coding. A typical change should complete multiple review rounds in a single day.
|
|
207
|
+
- **Prioritize fast individual responses** over quick final approval. Quick feedback reduces frustration even if multiple rounds are needed.
|
|
208
|
+
- **Large changes:** ask the author to split them rather than reviewing one massive changeset.
|
|
209
|
+
|
|
210
|
+
## Handling Disagreements
|
|
211
|
+
|
|
212
|
+
When resolving review disputes, apply this hierarchy:
|
|
213
|
+
1. **Technical facts and data** override opinions and preferences.
|
|
214
|
+
2. **Style guides** are the absolute authority on style matters.
|
|
215
|
+
3. **Software design** must be evaluated on engineering principles, not personal preference.
|
|
216
|
+
4. **Codebase consistency** is acceptable if it does not degrade overall health.
|
|
217
|
+
|
|
218
|
+
Do not accept "I'll clean it up later." Experience shows deferred cleanup rarely happens. Require cleanup before submission unless it is a genuine emergency. If surrounding issues cannot be addressed in this change, require filing a follow-up with self-assignment.
|
|
219
|
+
|
|
220
|
+
## Honesty in Review
|
|
221
|
+
|
|
222
|
+
When reviewing code — whether written by you, another agent, or a human:
|
|
223
|
+
- **Do not rubber-stamp.** "LGTM" without evidence of review helps no one.
|
|
224
|
+
- **Do not soften real issues.** "This might be a minor concern" when it is a production bug is dishonest.
|
|
225
|
+
- **Quantify problems when possible.** "This N+1 query will add ~50ms per item" is better than "this could be slow."
|
|
226
|
+
- **Push back on approaches with clear problems.** Sycophancy is a failure mode in reviews. If the implementation has issues, say so directly and propose alternatives.
|
|
227
|
+
- **Accept override gracefully.** If the author has full context and disagrees, defer to their judgment. Comment on code, not people — reframe personal critiques to focus on the code itself.
|
|
228
|
+
|
|
229
|
+
## Dependency Discipline
|
|
230
|
+
|
|
231
|
+
Part of code review is dependency review.
|
|
232
|
+
|
|
233
|
+
**Before adding any dependency:**
|
|
234
|
+
1. Does the existing stack solve this? (Often it does.)
|
|
235
|
+
2. How large is the dependency? (Check bundle impact.)
|
|
236
|
+
3. Is it actively maintained? (Check last commit, open issues.)
|
|
237
|
+
4. Does it have known vulnerabilities? (`npm audit` or equivalent.)
|
|
238
|
+
5. What is the license? (Must be compatible with the project.)
|
|
239
|
+
|
|
240
|
+
**Rule:** prefer standard library and existing utilities over new dependencies. Every dependency is a liability.
|
|
241
|
+
|
|
242
|
+
## Full Review Checklist
|
|
243
|
+
|
|
244
|
+
```markdown
|
|
245
|
+
## Review: [PR/Change title]
|
|
246
|
+
|
|
247
|
+
### Context
|
|
248
|
+
- [ ] I understand what this change does and why
|
|
249
|
+
|
|
250
|
+
### Correctness
|
|
251
|
+
- [ ] Matches spec; edge cases and error paths handled; tests adequate
|
|
252
|
+
|
|
253
|
+
### Readability
|
|
254
|
+
- [ ] Names clear and consistent; logic straightforward; no unnecessary complexity
|
|
255
|
+
|
|
256
|
+
### Architecture
|
|
257
|
+
- [ ] Follows existing patterns; no unnecessary coupling; abstraction level appropriate
|
|
258
|
+
|
|
259
|
+
### Security
|
|
260
|
+
- [ ] No secrets; input validated; no injection; auth checks; external data untrusted
|
|
261
|
+
|
|
262
|
+
### Performance
|
|
263
|
+
- [ ] No N+1 or unbounded ops; pagination on list endpoints
|
|
264
|
+
|
|
265
|
+
### Verification
|
|
266
|
+
- [ ] Tests pass; build succeeds; manual verification done if applicable
|
|
267
|
+
|
|
268
|
+
### Verdict
|
|
269
|
+
- [ ] **Approve** — Ready to merge
|
|
270
|
+
- [ ] **Request changes** — Issues must be addressed
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Common Rationalizations
|
|
274
|
+
|
|
275
|
+
| Rationalization | Rebuttal |
|
|
276
|
+
| --- | --- |
|
|
277
|
+
| "The implementation looks reasonable" | Review behavior and wiring, not aesthetics. |
|
|
278
|
+
| "The worker said tests pass" | Verify independently or mark as unverified. |
|
|
279
|
+
| "This is probably pre-existing" | Only skip if evidence shows it was not introduced or worsened. |
|
|
280
|
+
| "I should mention style too" | Style-only noise hides real findings. |
|
|
281
|
+
| "It works, that's good enough" | Working code that is unreadable, insecure, or architecturally wrong creates compounding debt. |
|
|
282
|
+
| "I wrote it, so I know it's correct" | Authors are blind to their own assumptions. Every change benefits from another set of eyes. |
|
|
283
|
+
| "We'll clean it up later" | Later never comes. Require cleanup before merge. |
|
|
284
|
+
| "AI-generated code is probably fine" | AI code needs more scrutiny, not less. |
|
|
285
|
+
| "The tests pass, so it's good" | Tests are necessary but not sufficient. They do not catch architecture, security, or readability problems. |
|
|
286
|
+
|
|
287
|
+
## Red Flags
|
|
288
|
+
|
|
289
|
+
- No `file:line` evidence for a finding.
|
|
290
|
+
- Findings describe preferences rather than bugs/risks.
|
|
291
|
+
- Review ignores acceptance criteria.
|
|
292
|
+
- Created files are not imported or invoked anywhere.
|
|
293
|
+
- Static placeholder responses or no-op handlers satisfy superficial tests.
|
|
294
|
+
- Reviewer modifies files.
|
|
295
|
+
- PRs merged without any review.
|
|
296
|
+
- Review that only checks if tests pass (ignoring other axes).
|
|
297
|
+
- "LGTM" without evidence of actual review.
|
|
298
|
+
- Security-sensitive changes without security-focused review.
|
|
299
|
+
- Large PRs that are "too big to review properly" (split them).
|
|
300
|
+
- No regression tests with bug fix PRs.
|
|
301
|
+
- Review comments without severity labels.
|
|
302
|
+
- Accepting "I'll fix it later" — it rarely happens.
|
|
303
|
+
|
|
304
|
+
## Complexity Red Flags
|
|
305
|
+
|
|
306
|
+
- **New module with shallow interface**: lots of public methods/props for small implementation — it is not hiding complexity, it is exposing it.
|
|
307
|
+
- **Information leakage**: one module exposes internal implementation details another module depends on.
|
|
308
|
+
- **Change amplification signal**: a simple conceptual change would touch many files — the structure is fighting the domain.
|
|
309
|
+
- **Cognitive load spike**: the diff requires understanding 5+ unrelated files to verify one change.
|
|
310
|
+
- **Pass-through methods**: methods that do nothing but delegate with the same signature — a sign the abstraction boundary is wrong.
|
|
311
|
+
- **Broken windows introduced**: messy formatting, dead imports, TODOs without tickets, inconsistent conventions within the same file.
|
|
312
|
+
|
|
313
|
+
## Verification
|
|
314
|
+
|
|
315
|
+
After review is complete:
|
|
316
|
+
- [ ] All Critical/P0 issues are resolved.
|
|
317
|
+
- [ ] P1/P2 issues are resolved or explicitly deferred with justification.
|
|
318
|
+
- [ ] Tests pass and build succeeds.
|
|
319
|
+
- [ ] The verification story is documented.
|
|
320
|
+
- [ ] Changed artifacts exist, are substantive, and key links are wired.
|
|
321
|
+
- [ ] Findings are ordered by severity; verdict is explicit: correct or incorrect.
|
|
322
|
+
|
|
323
|
+
## Skill Result Contract
|
|
324
|
+
|
|
325
|
+
```xml
|
|
326
|
+
<skill_result>
|
|
327
|
+
<skill>code-review-and-quality</skill>
|
|
328
|
+
<status>success|partial|blocked|failure</status>
|
|
329
|
+
<evidence>Files reviewed, commands/checks run, findings with file:line evidence</evidence>
|
|
330
|
+
<artifacts>Reviewed files or diff range</artifacts>
|
|
331
|
+
<risks>Untested areas, unavailable base, or none</risks>
|
|
332
|
+
</skill_result>
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Consolidated Review Workflow
|
|
336
|
+
|
|
337
|
+
This is the canonical active review skill. It absorbs requesting-code-review, receiving-code-review, sprint-review, and reconcile responsibilities.
|
|
338
|
+
|
|
339
|
+
Use it for:
|
|
340
|
+
- self-review before claiming completion;
|
|
341
|
+
- subagent or peer review routing;
|
|
342
|
+
- skeptical treatment of received review comments;
|
|
343
|
+
- severity-ranked findings with file/line evidence;
|
|
344
|
+
- reconciliation between user intent, implementation, tests, and remaining risk.
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-simplification
|
|
3
|
+
description: "Simplifies code for clarity without changing behavior. Auto-load when editing *.ts,*.tsx,*.py,*.js with complexity issues. Use when: code works but is hard to read/maintain/extend, refactoring for clarity, reviewing accumulated complexity, or user says 'simplify this' / 'too complex' / 'clean up'. Risk: Low (reads code, proposes changes, does NOT execute without user review)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Simplification
|
|
7
|
+
|
|
8
|
+
> Inspired by the [Claude Code Simplifier plugin](https://github.com/anthropics/claude-plugins-official/blob/main/plugins/code-simplifier/agents/code-simplifier.md). Adapted here as a model-agnostic, process-driven skill for any AI coding agent.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines — it's code that is easier to read, understand, modify, and debug. Every simplification must pass a simple test: "Would a new team member understand this faster than the original?"
|
|
13
|
+
|
|
14
|
+
> **Risk Level: Low** — This skill reads and proposes changes but should NOT auto-execute. All simplifications must be reviewed before committing. Use `/skill:code-simplification` explicitly or load alongside `code-review-and-quality` for gated review.
|
|
15
|
+
|
|
16
|
+
## When to Use
|
|
17
|
+
|
|
18
|
+
- After a feature is working and tests pass, but the implementation feels heavier than it needs to be
|
|
19
|
+
- During code review when readability or complexity issues are flagged
|
|
20
|
+
- When you encounter deeply nested logic, long functions, or unclear names
|
|
21
|
+
- When refactoring code written under time pressure
|
|
22
|
+
- When consolidating related logic scattered across files
|
|
23
|
+
- After merging changes that introduced duplication or inconsistency
|
|
24
|
+
|
|
25
|
+
## When NOT to Use
|
|
26
|
+
|
|
27
|
+
- Code is already clean and readable — don't simplify for the sake of it
|
|
28
|
+
- You don't understand what the code does yet — comprehend before you simplify
|
|
29
|
+
- The code is performance-critical and the "simpler" version would be measurably slower
|
|
30
|
+
- You're about to rewrite the module entirely — simplifying throwaway code wastes effort
|
|
31
|
+
|
|
32
|
+
## The Five Principles
|
|
33
|
+
|
|
34
|
+
### 1. Preserve Behavior Exactly
|
|
35
|
+
|
|
36
|
+
Don't change what the code does — only how it expresses it. All inputs, outputs, side effects, error behavior, and edge cases must remain identical. If you're not sure a simplification preserves behavior, don't make it.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
ASK BEFORE EVERY CHANGE:
|
|
40
|
+
→ Does this produce the same output for every input?
|
|
41
|
+
→ Does this maintain the same error behavior?
|
|
42
|
+
→ Does this preserve the same side effects and ordering?
|
|
43
|
+
→ Do all existing tests still pass without modification?
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 2. Follow Project Conventions
|
|
47
|
+
|
|
48
|
+
Simplification means making code more consistent with the codebase, not imposing external preferences. Before simplifying:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
1. Read project conventions (AGENTS.md, CLAUDE.md, etc.)
|
|
52
|
+
2. Study how neighboring code handles similar patterns
|
|
53
|
+
3. Match the project's style for:
|
|
54
|
+
- Import ordering and module system
|
|
55
|
+
- Function declaration style
|
|
56
|
+
- Naming conventions
|
|
57
|
+
- Error handling patterns
|
|
58
|
+
- Type annotation depth
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Simplification that breaks project consistency is not simplification — it's churn.
|
|
62
|
+
|
|
63
|
+
### 3. Prefer Clarity Over Cleverness
|
|
64
|
+
|
|
65
|
+
Explicit code is better than compact code when the compact version requires a mental pause to parse.
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
// UNCLEAR: Dense ternary chain
|
|
69
|
+
const label = isNew ? 'New' : isUpdated ? 'Updated' : isArchived ? 'Archived' : 'Active';
|
|
70
|
+
|
|
71
|
+
// CLEAR: Readable mapping
|
|
72
|
+
function getStatusLabel(item: Item): string {
|
|
73
|
+
if (item.isNew) return 'New';
|
|
74
|
+
if (item.isUpdated) return 'Updated';
|
|
75
|
+
if (item.isArchived) return 'Archived';
|
|
76
|
+
return 'Active';
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
// UNCLEAR: Chained reduces with inline logic
|
|
82
|
+
const result = items.reduce((acc, item) => ({
|
|
83
|
+
...acc,
|
|
84
|
+
[item.id]: { ...acc[item.id], count: (acc[item.id]?.count ?? 0) + 1 }
|
|
85
|
+
}), {});
|
|
86
|
+
|
|
87
|
+
// CLEAR: Named intermediate step
|
|
88
|
+
const countById = new Map<string, number>();
|
|
89
|
+
for (const item of items) {
|
|
90
|
+
countById.set(item.id, (countById.get(item.id) ?? 0) + 1);
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 4. Maintain Balance
|
|
95
|
+
|
|
96
|
+
Simplification has a failure mode: over-simplification. Watch for these traps:
|
|
97
|
+
|
|
98
|
+
- **Inlining too aggressively** — removing a helper that gave a concept a name makes the call site harder to read
|
|
99
|
+
- **Combining unrelated logic** — two simple functions merged into one complex function is not simpler
|
|
100
|
+
- **Removing "unnecessary" abstraction** — some abstractions exist for extensibility or testability, not complexity
|
|
101
|
+
- **Optimizing for line count** — fewer lines is not the goal; easier comprehension is
|
|
102
|
+
|
|
103
|
+
### 5. Scope to What Changed
|
|
104
|
+
|
|
105
|
+
Default to simplifying recently modified code. Avoid drive-by refactors of unrelated code unless explicitly asked to broaden scope. Unscoped simplification creates noise in diffs and risks unintended regressions.
|
|
106
|
+
|
|
107
|
+
## The Simplification Process
|
|
108
|
+
|
|
109
|
+
### Step 1: Understand Before Touching (Chesterton's Fence)
|
|
110
|
+
|
|
111
|
+
Before changing or removing anything, understand why it exists. This is Chesterton's Fence: if you see a fence across a road and don't understand why it's there, don't tear it down. First understand the reason, then decide if the reason still applies.
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
BEFORE SIMPLIFYING, ANSWER:
|
|
115
|
+
- What is this code's responsibility?
|
|
116
|
+
- What calls it? What does it call?
|
|
117
|
+
- What are the edge cases and error paths?
|
|
118
|
+
- Are there tests that define the expected behavior?
|
|
119
|
+
- Why might it have been written this way? (Performance? Platform constraint? Historical reason?)
|
|
120
|
+
- Check git blame: what was the original context for this code?
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
If you can't answer these, you're not ready to simplify. Read more context first.
|
|
124
|
+
|
|
125
|
+
### Step 2: Identify Simplification Opportunities
|
|
126
|
+
|
|
127
|
+
Scan for these patterns — each one is a concrete signal, not a vague smell:
|
|
128
|
+
|
|
129
|
+
**Structural complexity:**
|
|
130
|
+
|
|
131
|
+
| Pattern | Signal | Simplification |
|
|
132
|
+
|---------|--------|----------------|
|
|
133
|
+
| Deep nesting (3+ levels) | Hard to follow control flow | Extract conditions into guard clauses or helper functions |
|
|
134
|
+
| Long functions (50+ lines) | Multiple responsibilities | Split into focused functions with descriptive names |
|
|
135
|
+
| Nested ternaries | Requires mental stack to parse | Replace with if/else chains, switch, or lookup objects |
|
|
136
|
+
| Boolean parameter flags | `doThing(true, false, true)` | Replace with options objects or separate functions |
|
|
137
|
+
| Repeated conditionals | Same `if` check in multiple places | Extract to a well-named predicate function |
|
|
138
|
+
|
|
139
|
+
**Naming and readability:**
|
|
140
|
+
|
|
141
|
+
| Pattern | Signal | Simplification |
|
|
142
|
+
|---------|--------|----------------|
|
|
143
|
+
| Generic names | `data`, `result`, `temp`, `val`, `item` | Rename to describe the content: `userProfile`, `validationErrors` |
|
|
144
|
+
| Abbreviated names | `usr`, `cfg`, `btn`, `evt` | Use full words unless the abbreviation is universal (`id`, `url`, `api`) |
|
|
145
|
+
| Misleading names | Function named `get` that also mutates state | Rename to reflect actual behavior |
|
|
146
|
+
| Comments explaining "what" | `// increment counter` above `count++` | Delete the comment — the code is clear enough |
|
|
147
|
+
| Comments explaining "why" | `// Retry because the API is flaky under load` | Keep these — they carry intent the code can't express |
|
|
148
|
+
|
|
149
|
+
**Redundancy:**
|
|
150
|
+
|
|
151
|
+
| Pattern | Signal | Simplification |
|
|
152
|
+
|---------|--------|----------------|
|
|
153
|
+
| Duplicated logic | Same 5+ lines in multiple places | Extract to a shared function |
|
|
154
|
+
| Dead code | Unreachable branches, unused variables, commented-out blocks | Remove (after confirming it's truly dead) |
|
|
155
|
+
| Unnecessary abstractions | Wrapper that adds no value | Inline the wrapper, call the underlying function directly |
|
|
156
|
+
| Over-engineered patterns | Factory-for-a-factory, strategy-with-one-strategy | Replace with the simple direct approach |
|
|
157
|
+
| Redundant type assertions | Casting to a type that's already inferred | Remove the assertion |
|
|
158
|
+
|
|
159
|
+
### Step 3: Apply Changes Incrementally
|
|
160
|
+
|
|
161
|
+
Make one simplification at a time. Run tests after each change. **Submit refactoring changes separately from feature or bug fix changes.** A PR that refactors and adds a feature is two PRs — split them.
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
FOR EACH SIMPLIFICATION:
|
|
165
|
+
1. Make the change
|
|
166
|
+
2. Run the test suite
|
|
167
|
+
3. If tests pass → commit (or continue to next simplification)
|
|
168
|
+
4. If tests fail → revert and reconsider
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Avoid batching multiple simplifications into a single untested change. If something breaks, you need to know which simplification caused it.
|
|
172
|
+
|
|
173
|
+
**The Rule of 500:** If a refactoring would touch more than 500 lines, invest in automation (codemods, sed scripts, AST transforms) rather than making the changes by hand. Manual edits at that scale are error-prone and exhausting to review.
|
|
174
|
+
|
|
175
|
+
### Step 4: Verify the Result
|
|
176
|
+
|
|
177
|
+
After all simplifications, step back and evaluate the whole:
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
COMPARE BEFORE AND AFTER:
|
|
181
|
+
- Is the simplified version genuinely easier to understand?
|
|
182
|
+
- Did you introduce any new patterns inconsistent with the codebase?
|
|
183
|
+
- Is the diff clean and reviewable?
|
|
184
|
+
- Would a teammate approve this change?
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
If the "simplified" version is harder to understand or review, revert. Not every simplification attempt succeeds.
|
|
188
|
+
|
|
189
|
+
## Language-Specific Guidance
|
|
190
|
+
|
|
191
|
+
### TypeScript / JavaScript
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
// SIMPLIFY: Unnecessary async wrapper
|
|
195
|
+
// Before
|
|
196
|
+
async function getUser(id: string): Promise<User> {
|
|
197
|
+
return await userService.findById(id);
|
|
198
|
+
}
|
|
199
|
+
// After
|
|
200
|
+
function getUser(id: string): Promise<User> {
|
|
201
|
+
return userService.findById(id);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// SIMPLIFY: Verbose conditional assignment
|
|
205
|
+
// Before
|
|
206
|
+
let displayName: string;
|
|
207
|
+
if (user.nickname) {
|
|
208
|
+
displayName = user.nickname;
|
|
209
|
+
} else {
|
|
210
|
+
displayName = user.fullName;
|
|
211
|
+
}
|
|
212
|
+
// After
|
|
213
|
+
const displayName = user.nickname || user.fullName;
|
|
214
|
+
|
|
215
|
+
// SIMPLIFY: Manual array building
|
|
216
|
+
// Before
|
|
217
|
+
const activeUsers: User[] = [];
|
|
218
|
+
for (const user of users) {
|
|
219
|
+
if (user.isActive) {
|
|
220
|
+
activeUsers.push(user);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
// After
|
|
224
|
+
const activeUsers = users.filter((user) => user.isActive);
|
|
225
|
+
|
|
226
|
+
// SIMPLIFY: Redundant boolean return
|
|
227
|
+
// Before
|
|
228
|
+
function isValid(input: string): boolean {
|
|
229
|
+
if (input.length > 0 && input.length < 100) {
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
// After
|
|
235
|
+
function isValid(input: string): boolean {
|
|
236
|
+
return input.length > 0 && input.length < 100;
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Python
|
|
241
|
+
|
|
242
|
+
```python
|
|
243
|
+
# SIMPLIFY: Verbose dictionary building
|
|
244
|
+
# Before
|
|
245
|
+
result = {}
|
|
246
|
+
for item in items:
|
|
247
|
+
result[item.id] = item.name
|
|
248
|
+
# After
|
|
249
|
+
result = {item.id: item.name for item in items}
|
|
250
|
+
|
|
251
|
+
# SIMPLIFY: Nested conditionals with early return
|
|
252
|
+
# Before
|
|
253
|
+
def process(data):
|
|
254
|
+
if data is not None:
|
|
255
|
+
if data.is_valid():
|
|
256
|
+
if data.has_permission():
|
|
257
|
+
return do_work(data)
|
|
258
|
+
else:
|
|
259
|
+
raise PermissionError("No permission")
|
|
260
|
+
else:
|
|
261
|
+
raise ValueError("Invalid data")
|
|
262
|
+
else:
|
|
263
|
+
raise TypeError("Data is None")
|
|
264
|
+
# After
|
|
265
|
+
def process(data):
|
|
266
|
+
if data is None:
|
|
267
|
+
raise TypeError("Data is None")
|
|
268
|
+
if not data.is_valid():
|
|
269
|
+
raise ValueError("Invalid data")
|
|
270
|
+
if not data.has_permission():
|
|
271
|
+
raise PermissionError("No permission")
|
|
272
|
+
return do_work(data)
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### React / JSX
|
|
276
|
+
|
|
277
|
+
```tsx
|
|
278
|
+
// SIMPLIFY: Verbose conditional rendering
|
|
279
|
+
// Before
|
|
280
|
+
function UserBadge({ user }: Props) {
|
|
281
|
+
if (user.isAdmin) {
|
|
282
|
+
return <Badge variant="admin">Admin</Badge>;
|
|
283
|
+
} else {
|
|
284
|
+
return <Badge variant="default">User</Badge>;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
// After
|
|
288
|
+
function UserBadge({ user }: Props) {
|
|
289
|
+
const variant = user.isAdmin ? 'admin' : 'default';
|
|
290
|
+
const label = user.isAdmin ? 'Admin' : 'User';
|
|
291
|
+
return <Badge variant={variant}>{label}</Badge>;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// SIMPLIFY: Prop drilling through intermediate components
|
|
295
|
+
// Before — consider whether context or composition solves this better.
|
|
296
|
+
// This is a judgment call — flag it, don't auto-refactor.
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Common Rationalizations
|
|
300
|
+
|
|
301
|
+
| Rationalization | Reality |
|
|
302
|
+
|---|---|
|
|
303
|
+
| "It's working, no need to touch it" | Working code that's hard to read will be hard to fix when it breaks. Simplifying now saves time on every future change. |
|
|
304
|
+
| "Fewer lines is always simpler" | A 1-line nested ternary is not simpler than a 5-line if/else. Simplicity is about comprehension speed, not line count. |
|
|
305
|
+
| "I'll just quickly simplify this unrelated code too" | Unscoped simplification creates noisy diffs and risks regressions in code you didn't intend to change. Stay focused. |
|
|
306
|
+
| "The types make it self-documenting" | Types document structure, not intent. A well-named function explains *why* better than a type signature explains *what*. |
|
|
307
|
+
| "This abstraction might be useful later" | Don't preserve speculative abstractions. If it's not used now, it's complexity without value. Remove it and re-add when needed. |
|
|
308
|
+
| "The original author must have had a reason" | Maybe. Check git blame — apply Chesterton's Fence. But accumulated complexity often has no reason; it's just the residue of iteration under pressure. |
|
|
309
|
+
| "I'll refactor while adding this feature" | Separate refactoring from feature work. Mixed changes are harder to review, revert, and understand in history. |
|
|
310
|
+
|
|
311
|
+
## Red Flags
|
|
312
|
+
|
|
313
|
+
- Simplification that requires modifying tests to pass (you likely changed behavior)
|
|
314
|
+
- "Simplified" code that is longer and harder to follow than the original
|
|
315
|
+
- Renaming things to match your preferences rather than project conventions
|
|
316
|
+
- Removing error handling because "it makes the code cleaner"
|
|
317
|
+
- Simplifying code you don't fully understand
|
|
318
|
+
- Batching many simplifications into one large, hard-to-review commit
|
|
319
|
+
- Refactoring code outside the scope of the current task without being asked
|
|
320
|
+
|
|
321
|
+
## Related Skills
|
|
322
|
+
|
|
323
|
+
This skill composes with others for a complete quality pipeline. Load these together when appropriate:
|
|
324
|
+
|
|
325
|
+
| Skill | Relationship | When to combine |
|
|
326
|
+
|-------|-------------|-----------------|
|
|
327
|
+
| `code-cleanup` | Sibling | `code-cleanup` is for noisy/repetitive diffs after behavior works. `code-simplification` is for structural complexity reduction. Use both when code is both messy AND complex. |
|
|
328
|
+
| `code-review-and-quality` | Gate | Run `code-simplification` first, then `code-review-and-quality` to verify simplifications are correct and safe. |
|
|
329
|
+
| `deep-module-design` | Upstream | Apply `deep-module-design` principles BEFORE simplifying — good module boundaries make simplification easier. |
|
|
330
|
+
| `incremental-implementation` | Process | `code-simplification` works best one change at a time. `incremental-implementation` enforces this discipline. |
|
|
331
|
+
| `defense-in-depth` | Complement | When simplifying validation logic or error handling, `defense-in-depth` ensures you don't weaken safety layers. |
|
|
332
|
+
| `behavioral-kernel` | Guardrail | If simplification starts drifting into over-engineering or scope creep, `behavioral-kernel` re-centers. |
|
|
333
|
+
|
|
334
|
+
**Pipeline**: `deep-module-design` → `code-simplification` → `code-review-and-quality` → `verification-before-completion`
|
|
335
|
+
|
|
336
|
+
## Verification
|
|
337
|
+
|
|
338
|
+
After completing a simplification pass:
|
|
339
|
+
|
|
340
|
+
- [ ] All existing tests pass without modification
|
|
341
|
+
- [ ] Build succeeds with no new warnings
|
|
342
|
+
- [ ] Linter/formatter passes (no style regressions)
|
|
343
|
+
- [ ] Each simplification is a reviewable, incremental change
|
|
344
|
+
- [ ] The diff is clean — no unrelated changes mixed in
|
|
345
|
+
- [ ] Simplified code follows project conventions (checked against AGENTS.md or equivalent)
|
|
346
|
+
- [ ] No error handling was removed or weakened
|
|
347
|
+
- [ ] No dead code was left behind (unused imports, unreachable branches)
|
|
348
|
+
- [ ] A teammate or review agent would approve the change as a net improvement
|