cfsa-antigravity 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.mjs +324 -0
- package/package.json +34 -0
- package/template/.agent/instructions/commands.md +48 -0
- package/template/.agent/instructions/patterns.md +61 -0
- package/template/.agent/instructions/structure.md +29 -0
- package/template/.agent/instructions/tech-stack.md +43 -0
- package/template/.agent/instructions/workflow.md +41 -0
- package/template/.agent/kit-sync.md +15 -0
- package/template/.agent/rules/boundary-not-placeholder.md +146 -0
- package/template/.agent/rules/completion-checklist.md +48 -0
- package/template/.agent/rules/decision-classification.md +103 -0
- package/template/.agent/rules/extensibility.md +47 -0
- package/template/.agent/rules/question-vs-command.md +81 -0
- package/template/.agent/rules/security-first.md +43 -0
- package/template/.agent/rules/specificity-standards.md +54 -0
- package/template/.agent/rules/tdd-contract-first.md +57 -0
- package/template/.agent/rules/vertical-slices.md +42 -0
- package/template/.agent/skill-library/MANIFEST.md +480 -0
- package/template/.agent/skill-library/README.md +38 -0
- package/template/.agent/skill-library/meta/brand-guidelines/SKILL.md +73 -0
- package/template/.agent/skill-library/meta/claude-code/README.md +9 -0
- package/template/.agent/skill-library/meta/claude-code/agent-development/SKILL.md +415 -0
- package/template/.agent/skill-library/meta/claude-code/hook-development/SKILL.md +712 -0
- package/template/.agent/skill-library/meta/claude-code/plugin-structure/SKILL.md +476 -0
- package/template/.agent/skill-library/meta/git-advanced/SKILL.md +972 -0
- package/template/.agent/skill-library/meta/mcp-builder/SKILL.md +236 -0
- package/template/.agent/skill-library/meta/product-marketing-context/SKILL.md +241 -0
- package/template/.agent/skill-library/meta/regex-patterns/SKILL.md +751 -0
- package/template/.agent/skill-library/meta/tmux-processes/SKILL.md +210 -0
- package/template/.agent/skill-library/meta/using-tmux-for-interactive-commands/SKILL.md +178 -0
- package/template/.agent/skill-library/stack/3d/threejs-pro/SKILL.md +300 -0
- package/template/.agent/skill-library/stack/ai/ai-sdk/SKILL.md +77 -0
- package/template/.agent/skill-library/stack/ai/langchain/SKILL.md +530 -0
- package/template/.agent/skill-library/stack/ai/ollama/SKILL.md +321 -0
- package/template/.agent/skill-library/stack/ai/openai-sdk/SKILL.md +549 -0
- package/template/.agent/skill-library/stack/analytics/google-analytics/SKILL.md +153 -0
- package/template/.agent/skill-library/stack/api/graphql/SKILL.md +1061 -0
- package/template/.agent/skill-library/stack/api/trpc/SKILL.md +576 -0
- package/template/.agent/skill-library/stack/auth/authjs/SKILL.md +569 -0
- package/template/.agent/skill-library/stack/auth/clerk/SKILL.md +590 -0
- package/template/.agent/skill-library/stack/auth/firebase-auth/SKILL.md +734 -0
- package/template/.agent/skill-library/stack/cms/payload-cms/SKILL.md +573 -0
- package/template/.agent/skill-library/stack/cms/shopify/SKILL.md +1193 -0
- package/template/.agent/skill-library/stack/cms/wordpress/SKILL.md +1104 -0
- package/template/.agent/skill-library/stack/css/sass-scss/SKILL.md +1121 -0
- package/template/.agent/skill-library/stack/css/tailwind-css-patterns/SKILL.md +863 -0
- package/template/.agent/skill-library/stack/css/tailwind-design-system/SKILL.md +490 -0
- package/template/.agent/skill-library/stack/css/vanilla-css/SKILL.md +1078 -0
- package/template/.agent/skill-library/stack/databases/clickhouse/SKILL.md +311 -0
- package/template/.agent/skill-library/stack/databases/influxdb/SKILL.md +280 -0
- package/template/.agent/skill-library/stack/databases/lancedb/SKILL.md +415 -0
- package/template/.agent/skill-library/stack/databases/mongodb/SKILL.md +1169 -0
- package/template/.agent/skill-library/stack/databases/neo4j/SKILL.md +839 -0
- package/template/.agent/skill-library/stack/databases/pgvector/SKILL.md +241 -0
- package/template/.agent/skill-library/stack/databases/pinecone/SKILL.md +212 -0
- package/template/.agent/skill-library/stack/databases/postgresql/SKILL.md +658 -0
- package/template/.agent/skill-library/stack/databases/qdrant/SKILL.md +312 -0
- package/template/.agent/skill-library/stack/databases/redis/SKILL.md +1079 -0
- package/template/.agent/skill-library/stack/databases/spacetimedb/SKILL.md +532 -0
- package/template/.agent/skill-library/stack/databases/sqlite/SKILL.md +1132 -0
- package/template/.agent/skill-library/stack/databases/supabase/SKILL.md +640 -0
- package/template/.agent/skill-library/stack/databases/surrealdb-expert/SKILL.md +945 -0
- package/template/.agent/skill-library/stack/databases/timescaledb/SKILL.md +745 -0
- package/template/.agent/skill-library/stack/databases/weaviate/SKILL.md +218 -0
- package/template/.agent/skill-library/stack/devops/github-actions/SKILL.md +554 -0
- package/template/.agent/skill-library/stack/devops/kubernetes/SKILL.md +950 -0
- package/template/.agent/skill-library/stack/devops/nginx/SKILL.md +841 -0
- package/template/.agent/skill-library/stack/devops/terraform/SKILL.md +860 -0
- package/template/.agent/skill-library/stack/email/resend/SKILL.md +391 -0
- package/template/.agent/skill-library/stack/engines/godot/SKILL.md +488 -0
- package/template/.agent/skill-library/stack/extensions/chrome-extension/SKILL.md +375 -0
- package/template/.agent/skill-library/stack/extensions/vscode-extension/SKILL.md +453 -0
- package/template/.agent/skill-library/stack/frameworks/astro-framework/SKILL.md +162 -0
- package/template/.agent/skill-library/stack/frameworks/electron/SKILL.md +1286 -0
- package/template/.agent/skill-library/stack/frameworks/fastapi/SKILL.md +650 -0
- package/template/.agent/skill-library/stack/frameworks/hono/SKILL.md +90 -0
- package/template/.agent/skill-library/stack/frameworks/nestjs/SKILL.md +878 -0
- package/template/.agent/skill-library/stack/frameworks/nextjs/SKILL.md +635 -0
- package/template/.agent/skill-library/stack/frameworks/nuxt/SKILL.md +564 -0
- package/template/.agent/skill-library/stack/frameworks/sveltekit/SKILL.md +614 -0
- package/template/.agent/skill-library/stack/frameworks/tauri/SKILL.md +920 -0
- package/template/.agent/skill-library/stack/gamedev/godot/SKILL.md +1032 -0
- package/template/.agent/skill-library/stack/gamedev/unity/SKILL.md +1175 -0
- package/template/.agent/skill-library/stack/hosting/aws/SKILL.md +467 -0
- package/template/.agent/skill-library/stack/hosting/cloudflare/SKILL.md +201 -0
- package/template/.agent/skill-library/stack/hosting/docker-expert/SKILL.md +409 -0
- package/template/.agent/skill-library/stack/hosting/vercel/SKILL.md +484 -0
- package/template/.agent/skill-library/stack/languages/bash-scripting/SKILL.md +773 -0
- package/template/.agent/skill-library/stack/languages/c-cpp/SKILL.md +712 -0
- package/template/.agent/skill-library/stack/languages/gdscript/SKILL.md +789 -0
- package/template/.agent/skill-library/stack/languages/go/SKILL.md +664 -0
- package/template/.agent/skill-library/stack/languages/java/SKILL.md +778 -0
- package/template/.agent/skill-library/stack/languages/kotlin/SKILL.md +665 -0
- package/template/.agent/skill-library/stack/languages/python/SKILL.md +678 -0
- package/template/.agent/skill-library/stack/languages/rust/SKILL.md +673 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/SKILL.md +141 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/advanced-generics.md +90 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/branded-types.md +57 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/builder-pattern.md +71 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/common-pitfalls.md +135 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/conditional-types.md +27 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/decorators.md +98 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/discriminated-unions.md +62 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/mapped-types.md +53 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/performance-best-practices.md +104 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/template-literal-types.md +49 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/testing-types.md +112 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/type-guards.md +70 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/type-inference.md +101 -0
- package/template/.agent/skill-library/stack/languages/typescript-advanced-patterns/references/utility-types.md +98 -0
- package/template/.agent/skill-library/stack/languages/vanilla-javascript/SKILL.md +803 -0
- package/template/.agent/skill-library/stack/messaging/kafka/SKILL.md +235 -0
- package/template/.agent/skill-library/stack/mobile/expo-react-native/SKILL.md +665 -0
- package/template/.agent/skill-library/stack/mobile/flutter/SKILL.md +316 -0
- package/template/.agent/skill-library/stack/mobile/react-native/SKILL.md +337 -0
- package/template/.agent/skill-library/stack/monitoring/posthog/SKILL.md +396 -0
- package/template/.agent/skill-library/stack/monitoring/sentry/SKILL.md +509 -0
- package/template/.agent/skill-library/stack/observability/datadog/SKILL.md +179 -0
- package/template/.agent/skill-library/stack/observability/distributed-tracing/SKILL.md +140 -0
- package/template/.agent/skill-library/stack/observability/logging-best-practices/SKILL.md +168 -0
- package/template/.agent/skill-library/stack/observability/opentelemetry/SKILL.md +164 -0
- package/template/.agent/skill-library/stack/observability/prometheus-grafana/SKILL.md +246 -0
- package/template/.agent/skill-library/stack/observability/python-observability/SKILL.md +158 -0
- package/template/.agent/skill-library/stack/orm/drizzle-orm/SKILL.md +613 -0
- package/template/.agent/skill-library/stack/orm/prisma/SKILL.md +744 -0
- package/template/.agent/skill-library/stack/payments/lemonsqueezy/SKILL.md +393 -0
- package/template/.agent/skill-library/stack/payments/stripe-integration/SKILL.md +457 -0
- package/template/.agent/skill-library/stack/queue/bullmq/SKILL.md +385 -0
- package/template/.agent/skill-library/stack/queue/inngest/SKILL.md +438 -0
- package/template/.agent/skill-library/stack/realtime/socketio/SKILL.md +595 -0
- package/template/.agent/skill-library/stack/search/elasticsearch/SKILL.md +248 -0
- package/template/.agent/skill-library/stack/search/meilisearch/SKILL.md +385 -0
- package/template/.agent/skill-library/stack/security/crypto-patterns/SKILL.md +437 -0
- package/template/.agent/skill-library/stack/security/csp-cors-headers/SKILL.md +588 -0
- package/template/.agent/skill-library/stack/security/dependency-auditing/SKILL.md +560 -0
- package/template/.agent/skill-library/stack/security/input-sanitization/SKILL.md +430 -0
- package/template/.agent/skill-library/stack/security/owasp-web-security/SKILL.md +421 -0
- package/template/.agent/skill-library/stack/state/tanstack-query/SKILL.md +637 -0
- package/template/.agent/skill-library/stack/state/zustand/SKILL.md +483 -0
- package/template/.agent/skill-library/stack/storage/aws-s3/SKILL.md +415 -0
- package/template/.agent/skill-library/stack/testing/playwright/SKILL.md +641 -0
- package/template/.agent/skill-library/stack/testing/storybook/SKILL.md +923 -0
- package/template/.agent/skill-library/stack/testing/testing-library/SKILL.md +872 -0
- package/template/.agent/skill-library/stack/testing/vitest/SKILL.md +714 -0
- package/template/.agent/skill-library/stack/ui/react-best-practices/SKILL.md +877 -0
- package/template/.agent/skill-library/stack/ui/react-composition-patterns/SKILL.md +1107 -0
- package/template/.agent/skill-library/stack/ui/react-flow/SKILL.md +425 -0
- package/template/.agent/skill-library/stack/ui/shadcn-ui/SKILL.md +703 -0
- package/template/.agent/skill-library/surface/api/api-caching/SKILL.md +458 -0
- package/template/.agent/skill-library/surface/api/api-documentation-openapi/SKILL.md +697 -0
- package/template/.agent/skill-library/surface/api/api-error-handling/SKILL.md +478 -0
- package/template/.agent/skill-library/surface/api/api-security-checklist/SKILL.md +147 -0
- package/template/.agent/skill-library/surface/api/api-versioning/SKILL.md +420 -0
- package/template/.agent/skill-library/surface/api/email-best-practices/SKILL.md +59 -0
- package/template/.agent/skill-library/surface/api/rate-limiting-abuse-protection/SKILL.md +147 -0
- package/template/.agent/skill-library/surface/api/rest-api-design/SKILL.md +478 -0
- package/template/.agent/skill-library/surface/api/webhook-design/SKILL.md +752 -0
- package/template/.agent/skill-library/surface/cli/cli-configuration-management/SKILL.md +445 -0
- package/template/.agent/skill-library/surface/cli/cli-error-diagnostics/SKILL.md +515 -0
- package/template/.agent/skill-library/surface/cli/cli-shell-integration/SKILL.md +479 -0
- package/template/.agent/skill-library/surface/cli/cli-ux-design/SKILL.md +477 -0
- package/template/.agent/skill-library/surface/desktop/desktop-app-distribution/SKILL.md +416 -0
- package/template/.agent/skill-library/surface/desktop/desktop-security-sandboxing/SKILL.md +407 -0
- package/template/.agent/skill-library/surface/desktop/desktop-ux-conventions/SKILL.md +361 -0
- package/template/.agent/skill-library/surface/desktop/native-os-integration/SKILL.md +563 -0
- package/template/.agent/skill-library/surface/extension/browser-extension-patterns/SKILL.md +482 -0
- package/template/.agent/skill-library/surface/extension/plugin-architecture-design/SKILL.md +632 -0
- package/template/.agent/skill-library/surface/extension/vscode-extension-development/SKILL.md +728 -0
- package/template/.agent/skill-library/surface/mobile/app-store-submission/SKILL.md +304 -0
- package/template/.agent/skill-library/surface/mobile/mobile-offline-sync/SKILL.md +443 -0
- package/template/.agent/skill-library/surface/mobile/mobile-responsive-patterns/SKILL.md +432 -0
- package/template/.agent/skill-library/surface/mobile/push-notifications/SKILL.md +495 -0
- package/template/.agent/skill-library/surface/web/accessibility-compliance/SKILL.md +827 -0
- package/template/.agent/skill-library/surface/web/ai-seo/SKILL.md +398 -0
- package/template/.agent/skill-library/surface/web/ai-seo/references/content-patterns.md +285 -0
- package/template/.agent/skill-library/surface/web/ai-seo/references/platform-ranking-factors.md +152 -0
- package/template/.agent/skill-library/surface/web/analytics-tracking/SKILL.md +309 -0
- package/template/.agent/skill-library/surface/web/analytics-tracking/references/event-library.md +260 -0
- package/template/.agent/skill-library/surface/web/analytics-tracking/references/ga4-implementation.md +300 -0
- package/template/.agent/skill-library/surface/web/analytics-tracking/references/gtm-implementation.md +390 -0
- package/template/.agent/skill-library/surface/web/authentication-ui-flows/SKILL.md +530 -0
- package/template/.agent/skill-library/surface/web/dark-mode-theming/SKILL.md +516 -0
- package/template/.agent/skill-library/surface/web/design-reference-data/SKILL.md +105 -0
- package/template/.agent/skill-library/surface/web/design-reference-data/data/charts.csv +26 -0
- package/template/.agent/skill-library/surface/web/design-reference-data/data/colors.csv +97 -0
- package/template/.agent/skill-library/surface/web/design-reference-data/data/landing.csv +31 -0
- package/template/.agent/skill-library/surface/web/design-reference-data/data/styles.csv +59 -0
- package/template/.agent/skill-library/surface/web/design-reference-data/data/typography.csv +58 -0
- package/template/.agent/skill-library/surface/web/design-reference-data/data/ux-guidelines.csv +100 -0
- package/template/.agent/skill-library/surface/web/design-reference-data/scripts/core.py +258 -0
- package/template/.agent/skill-library/surface/web/design-reference-data/scripts/design_system.py +1067 -0
- package/template/.agent/skill-library/surface/web/design-reference-data/scripts/search.py +106 -0
- package/template/.agent/skill-library/surface/web/form-handling-validation/SKILL.md +675 -0
- package/template/.agent/skill-library/surface/web/frontend-design/SKILL.md +1393 -0
- package/template/.agent/skill-library/surface/web/frontend-design/templates/cppn-hero.tsx +299 -0
- package/template/.agent/skill-library/surface/web/frontend-design/templates/wave-hero.tsx +875 -0
- package/template/.agent/skill-library/surface/web/frontend-verification/SKILL.md +111 -0
- package/template/.agent/skill-library/surface/web/frontend-verification/scripts/ux_audit.py +739 -0
- package/template/.agent/skill-library/surface/web/i18n-localization/SKILL.md +154 -0
- package/template/.agent/skill-library/surface/web/offline-first-pwa/SKILL.md +657 -0
- package/template/.agent/skill-library/surface/web/page-cro/SKILL.md +182 -0
- package/template/.agent/skill-library/surface/web/page-cro/references/experiments.md +248 -0
- package/template/.agent/skill-library/surface/web/programmatic-seo/SKILL.md +238 -0
- package/template/.agent/skill-library/surface/web/programmatic-seo/references/playbooks.md +308 -0
- package/template/.agent/skill-library/surface/web/schema-markup/SKILL.md +179 -0
- package/template/.agent/skill-library/surface/web/schema-markup/references/schema-examples.md +398 -0
- package/template/.agent/skill-library/surface/web/seo-audit/SKILL.md +394 -0
- package/template/.agent/skill-library/surface/web/seo-audit/references/ai-writing-detection.md +200 -0
- package/template/.agent/skill-library/surface/web/web-performance-optimization/SKILL.md +646 -0
- package/template/.agent/skill-library/surface/web/web-scraping/SKILL.md +58 -0
- package/template/.agent/skills/accessibility/SKILL.md +522 -0
- package/template/.agent/skills/accessibility/references/WCAG.md +162 -0
- package/template/.agent/skills/adversarial-review/SKILL.md +90 -0
- package/template/.agent/skills/antigravity-workflows/SKILL.md +81 -0
- package/template/.agent/skills/antigravity-workflows/resources/implementation-playbook.md +36 -0
- package/template/.agent/skills/api-design-principles/SKILL.md +37 -0
- package/template/.agent/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/template/.agent/skills/api-design-principles/assets/rest-api-template.py +182 -0
- package/template/.agent/skills/api-design-principles/references/graphql-schema-design.md +583 -0
- package/template/.agent/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/template/.agent/skills/api-design-principles/resources/implementation-playbook.md +513 -0
- package/template/.agent/skills/api-versioning/SKILL.md +420 -0
- package/template/.agent/skills/architecture-mapping/SKILL.md +219 -0
- package/template/.agent/skills/bootstrap-agents/SKILL.md +259 -0
- package/template/.agent/skills/brainstorming/SKILL.md +236 -0
- package/template/.agent/skills/brand-guidelines/SKILL.md +44 -0
- package/template/.agent/skills/clean-code/SKILL.md +94 -0
- package/template/.agent/skills/code-review-pro/SKILL.md +152 -0
- package/template/.agent/skills/concise-planning/SKILL.md +68 -0
- package/template/.agent/skills/cross-layer-consistency/SKILL.md +117 -0
- package/template/.agent/skills/database-schema-design/SKILL.md +429 -0
- package/template/.agent/skills/deployment-procedures/SKILL.md +241 -0
- package/template/.agent/skills/design-anti-cliche/SKILL.md +159 -0
- package/template/.agent/skills/design-direction/SKILL.md +45 -0
- package/template/.agent/skills/error-handling-patterns/SKILL.md +721 -0
- package/template/.agent/skills/find-skills/SKILL.md +145 -0
- package/template/.agent/skills/git-advanced/SKILL.md +972 -0
- package/template/.agent/skills/git-workflow/SKILL.md +420 -0
- package/template/.agent/skills/idea-extraction/SKILL.md +271 -0
- package/template/.agent/skills/logging-best-practices/SKILL.md +851 -0
- package/template/.agent/skills/migration-management/SKILL.md +384 -0
- package/template/.agent/skills/minimalist-surgical-development/SKILL.md +69 -0
- package/template/.agent/skills/parallel-agents/SKILL.md +165 -0
- package/template/.agent/skills/parallel-debugging/SKILL.md +135 -0
- package/template/.agent/skills/parallel-feature-development/SKILL.md +166 -0
- package/template/.agent/skills/performance-budgeting/SKILL.md +144 -0
- package/template/.agent/skills/pipeline-rubrics/SKILL.md +51 -0
- package/template/.agent/skills/pipeline-rubrics/references/architecture-rubric.md +19 -0
- package/template/.agent/skills/pipeline-rubrics/references/be-rubric.md +21 -0
- package/template/.agent/skills/pipeline-rubrics/references/fe-rubric.md +20 -0
- package/template/.agent/skills/pipeline-rubrics/references/ia-rubric.md +19 -0
- package/template/.agent/skills/pipeline-rubrics/references/scoring.md +28 -0
- package/template/.agent/skills/pipeline-rubrics/references/vision-rubric.md +11 -0
- package/template/.agent/skills/prd-templates/SKILL.md +88 -0
- package/template/.agent/skills/prd-templates/references/architecture-design-template.md +88 -0
- package/template/.agent/skills/prd-templates/references/be-spec-template.md +101 -0
- package/template/.agent/skills/prd-templates/references/data-placement-template.md +74 -0
- package/template/.agent/skills/prd-templates/references/decomposition-templates.md +211 -0
- package/template/.agent/skills/prd-templates/references/design-system-decisions.md +198 -0
- package/template/.agent/skills/prd-templates/references/engineering-standards-template.md +124 -0
- package/template/.agent/skills/prd-templates/references/fe-classification-procedures.md +47 -0
- package/template/.agent/skills/prd-templates/references/fe-spec-template.md +84 -0
- package/template/.agent/skills/prd-templates/references/infrastructure-report-template.md +71 -0
- package/template/.agent/skills/prd-templates/references/operational-templates.md +116 -0
- package/template/.agent/skills/prd-templates/references/placeholder-guard-template.md +21 -0
- package/template/.agent/skills/prd-templates/references/surface-model.md +61 -0
- package/template/.agent/skills/prd-templates/references/vision-template.md +66 -0
- package/template/.agent/skills/prompt-engineer/README.md +659 -0
- package/template/.agent/skills/prompt-engineer/SKILL.md +249 -0
- package/template/.agent/skills/regex-patterns/SKILL.md +751 -0
- package/template/.agent/skills/resolve-ambiguity/SKILL.md +278 -0
- package/template/.agent/skills/rest-api-design/SKILL.md +478 -0
- package/template/.agent/skills/security-scanning-security-hardening/SKILL.md +231 -0
- package/template/.agent/skills/session-continuity/SKILL.md +730 -0
- package/template/.agent/skills/session-continuity/protocols/01-session-resumption.md +38 -0
- package/template/.agent/skills/session-continuity/protocols/02-progress-generation.md +85 -0
- package/template/.agent/skills/session-continuity/protocols/03-progress-update.md +70 -0
- package/template/.agent/skills/session-continuity/protocols/04-pattern-extraction.md +60 -0
- package/template/.agent/skills/session-continuity/protocols/05-session-close.md +37 -0
- package/template/.agent/skills/session-continuity/protocols/06-decision-analysis.md +84 -0
- package/template/.agent/skills/session-continuity/protocols/07-spec-pipeline-generation.md +48 -0
- package/template/.agent/skills/session-continuity/protocols/08-spec-pipeline-update.md +43 -0
- package/template/.agent/skills/session-continuity/protocols/09-parallel-claim.md +122 -0
- package/template/.agent/skills/session-continuity/protocols/10-placeholder-verification-gate.md +104 -0
- package/template/.agent/skills/session-continuity/protocols/ambiguity-gates.md +48 -0
- package/template/.agent/skills/skill-creator/LICENSE.txt +202 -0
- package/template/.agent/skills/skill-creator/README.md +270 -0
- package/template/.agent/skills/skill-creator/SKILL.md +590 -0
- package/template/.agent/skills/skill-creator/references/output-patterns.md +82 -0
- package/template/.agent/skills/skill-creator/references/workflows.md +28 -0
- package/template/.agent/skills/skill-creator/scripts/init_skill.py +303 -0
- package/template/.agent/skills/skill-creator/scripts/package_skill.py +110 -0
- package/template/.agent/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/template/.agent/skills/spec-writing/SKILL.md +110 -0
- package/template/.agent/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/template/.agent/skills/systematic-debugging/SKILL.md +297 -0
- package/template/.agent/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/template/.agent/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/template/.agent/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/template/.agent/skills/systematic-debugging/find-polluter.sh +63 -0
- package/template/.agent/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/template/.agent/skills/systematic-debugging/test-academic.md +14 -0
- package/template/.agent/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/template/.agent/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/template/.agent/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/template/.agent/skills/tdd-workflow/SKILL.md +409 -0
- package/template/.agent/skills/tech-stack-catalog/SKILL.md +49 -0
- package/template/.agent/skills/tech-stack-catalog/references/constraint-questions.md +21 -0
- package/template/.agent/skills/tech-stack-catalog/references/dev-tooling-decisions.md +37 -0
- package/template/.agent/skills/tech-stack-catalog/references/surface-decision-tables.md +69 -0
- package/template/.agent/skills/technical-writer/SKILL.md +242 -0
- package/template/.agent/skills/testing-strategist/SKILL.md +932 -0
- package/template/.agent/skills/verification-before-completion/SKILL.md +145 -0
- package/template/.agent/skills/workflow-automation/SKILL.md +73 -0
- package/template/.agent/workflows/audit-ambiguity-execute.md +165 -0
- package/template/.agent/workflows/audit-ambiguity-rubrics.md +83 -0
- package/template/.agent/workflows/audit-ambiguity.md +64 -0
- package/template/.agent/workflows/bootstrap-agents-fill.md +201 -0
- package/template/.agent/workflows/bootstrap-agents-provision.md +197 -0
- package/template/.agent/workflows/bootstrap-agents.md +66 -0
- package/template/.agent/workflows/create-prd-architecture.md +119 -0
- package/template/.agent/workflows/create-prd-compile.md +138 -0
- package/template/.agent/workflows/create-prd-design-system.md +135 -0
- package/template/.agent/workflows/create-prd-security.md +113 -0
- package/template/.agent/workflows/create-prd-stack.md +91 -0
- package/template/.agent/workflows/create-prd.md +168 -0
- package/template/.agent/workflows/decompose-architecture-structure.md +82 -0
- package/template/.agent/workflows/decompose-architecture-validate.md +119 -0
- package/template/.agent/workflows/decompose-architecture.md +111 -0
- package/template/.agent/workflows/evolve-contract.md +98 -0
- package/template/.agent/workflows/evolve-feature-cascade.md +140 -0
- package/template/.agent/workflows/evolve-feature-classify.md +116 -0
- package/template/.agent/workflows/evolve-feature.md +56 -0
- package/template/.agent/workflows/ideate-discover.md +144 -0
- package/template/.agent/workflows/ideate-extract.md +129 -0
- package/template/.agent/workflows/ideate-validate.md +117 -0
- package/template/.agent/workflows/ideate.md +113 -0
- package/template/.agent/workflows/implement-slice-setup.md +113 -0
- package/template/.agent/workflows/implement-slice-tdd.md +198 -0
- package/template/.agent/workflows/implement-slice.md +50 -0
- package/template/.agent/workflows/plan-phase.md +202 -0
- package/template/.agent/workflows/propagate-decision-apply.md +135 -0
- package/template/.agent/workflows/propagate-decision-scan.md +147 -0
- package/template/.agent/workflows/propagate-decision.md +56 -0
- package/template/.agent/workflows/remediate-pipeline-assess.md +138 -0
- package/template/.agent/workflows/remediate-pipeline-execute.md +135 -0
- package/template/.agent/workflows/remediate-pipeline.md +55 -0
- package/template/.agent/workflows/resolve-ambiguity.md +82 -0
- package/template/.agent/workflows/sync-kit.md +209 -0
- package/template/.agent/workflows/update-architecture-map.md +74 -0
- package/template/.agent/workflows/validate-phase.md +219 -0
- package/template/.agent/workflows/verify-infrastructure.md +207 -0
- package/template/.agent/workflows/write-architecture-spec-deepen.md +139 -0
- package/template/.agent/workflows/write-architecture-spec-design.md +202 -0
- package/template/.agent/workflows/write-architecture-spec.md +63 -0
- package/template/.agent/workflows/write-be-spec-classify.md +165 -0
- package/template/.agent/workflows/write-be-spec-write.md +98 -0
- package/template/.agent/workflows/write-be-spec.md +76 -0
- package/template/.agent/workflows/write-fe-spec-classify.md +170 -0
- package/template/.agent/workflows/write-fe-spec-write.md +94 -0
- package/template/.agent/workflows/write-fe-spec.md +71 -0
- package/template/AGENTS.md +176 -0
- package/template/GEMINI.md +177 -0
- package/template/docs/README.md +187 -0
- package/template/docs/audits/.gitkeep +0 -0
- package/template/docs/audits/README.md +10 -0
- package/template/docs/plans/.gitkeep +0 -0
- package/template/docs/plans/README.md +21 -0
- package/template/docs/plans/be/.gitkeep +0 -0
- package/template/docs/plans/be/README.md +11 -0
- package/template/docs/plans/fe/.gitkeep +0 -0
- package/template/docs/plans/fe/README.md +11 -0
- package/template/docs/plans/ia/.gitkeep +0 -0
- package/template/docs/plans/ia/README.md +17 -0
- package/template/docs/plans/ia/deep-dives/.gitkeep +0 -0
- package/template/docs/plans/ia/deep-dives/README.md +5 -0
- package/template/docs/plans/phases/.gitkeep +0 -0
- package/template/docs/plans/phases/README.md +11 -0
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: database-schema-design
|
|
3
|
+
description: Design database schemas with normalization, relationships, and constraints. Use when creating new database schemas, designing tables, or planning data models for PostgreSQL and MySQL.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Database Schema Design
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Design scalable, normalized database schemas with proper relationships, constraints, and data types. Includes normalization techniques, relationship patterns, and constraint strategies.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- New database schema design
|
|
15
|
+
- Data model planning
|
|
16
|
+
- Table structure definition
|
|
17
|
+
- Relationship design (1:1, 1:N, N:N)
|
|
18
|
+
- Normalization analysis
|
|
19
|
+
- Constraint and trigger planning
|
|
20
|
+
- Performance optimization at schema level
|
|
21
|
+
|
|
22
|
+
## Normalization Strategy
|
|
23
|
+
|
|
24
|
+
### First Normal Form (1NF)
|
|
25
|
+
|
|
26
|
+
**PostgreSQL - Eliminate Repeating Groups:**
|
|
27
|
+
|
|
28
|
+
```sql
|
|
29
|
+
-- NOT 1NF: repeating group in single column
|
|
30
|
+
CREATE TABLE orders_bad (
|
|
31
|
+
id UUID PRIMARY KEY,
|
|
32
|
+
customer_name VARCHAR(255),
|
|
33
|
+
product_ids VARCHAR(255) -- "1,2,3" - repeating group
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
-- 1NF: separate table for repeating data
|
|
37
|
+
CREATE TABLE orders (
|
|
38
|
+
id UUID PRIMARY KEY,
|
|
39
|
+
customer_name VARCHAR(255),
|
|
40
|
+
created_at TIMESTAMP DEFAULT NOW()
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
CREATE TABLE order_items (
|
|
44
|
+
id UUID PRIMARY KEY,
|
|
45
|
+
order_id UUID NOT NULL,
|
|
46
|
+
product_id UUID NOT NULL,
|
|
47
|
+
quantity INTEGER NOT NULL,
|
|
48
|
+
FOREIGN KEY (order_id) REFERENCES orders(id) ON DELETE CASCADE
|
|
49
|
+
);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Second Normal Form (2NF)
|
|
53
|
+
|
|
54
|
+
**PostgreSQL - Remove Partial Dependencies:**
|
|
55
|
+
|
|
56
|
+
```sql
|
|
57
|
+
-- NOT 2NF: non-key attribute depends on part of composite key
|
|
58
|
+
CREATE TABLE enrollment_bad (
|
|
59
|
+
student_id UUID,
|
|
60
|
+
course_id UUID,
|
|
61
|
+
professor_name VARCHAR(255), -- depends on course_id only
|
|
62
|
+
PRIMARY KEY (student_id, course_id)
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
-- 2NF: separate tables
|
|
66
|
+
CREATE TABLE enrollments (
|
|
67
|
+
id UUID PRIMARY KEY,
|
|
68
|
+
student_id UUID NOT NULL,
|
|
69
|
+
course_id UUID NOT NULL,
|
|
70
|
+
FOREIGN KEY (student_id) REFERENCES students(id),
|
|
71
|
+
FOREIGN KEY (course_id) REFERENCES courses(id),
|
|
72
|
+
UNIQUE(student_id, course_id)
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
CREATE TABLE courses (
|
|
76
|
+
id UUID PRIMARY KEY,
|
|
77
|
+
name VARCHAR(255),
|
|
78
|
+
professor_id UUID NOT NULL,
|
|
79
|
+
FOREIGN KEY (professor_id) REFERENCES professors(id)
|
|
80
|
+
);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Third Normal Form (3NF)
|
|
84
|
+
|
|
85
|
+
**PostgreSQL - Remove Transitive Dependencies:**
|
|
86
|
+
|
|
87
|
+
```sql
|
|
88
|
+
-- NOT 3NF: transitive dependency (customer_city depends on customer_state)
|
|
89
|
+
CREATE TABLE orders_bad (
|
|
90
|
+
id UUID PRIMARY KEY,
|
|
91
|
+
customer_city VARCHAR(100),
|
|
92
|
+
customer_state VARCHAR(50),
|
|
93
|
+
state_tax_rate DECIMAL(5,3) -- depends on customer_state
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
-- 3NF: separate tables
|
|
97
|
+
CREATE TABLE states (
|
|
98
|
+
id UUID PRIMARY KEY,
|
|
99
|
+
code VARCHAR(2) UNIQUE,
|
|
100
|
+
name VARCHAR(100),
|
|
101
|
+
tax_rate DECIMAL(5,3)
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
CREATE TABLE orders (
|
|
105
|
+
id UUID PRIMARY KEY,
|
|
106
|
+
customer_city VARCHAR(100),
|
|
107
|
+
state_id UUID NOT NULL,
|
|
108
|
+
FOREIGN KEY (state_id) REFERENCES states(id)
|
|
109
|
+
);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Table Design Patterns
|
|
113
|
+
|
|
114
|
+
### Entity-Relationship Patterns
|
|
115
|
+
|
|
116
|
+
**PostgreSQL - One-to-Many:**
|
|
117
|
+
|
|
118
|
+
```sql
|
|
119
|
+
-- One user has many orders
|
|
120
|
+
CREATE TABLE users (
|
|
121
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
122
|
+
email VARCHAR(255) UNIQUE NOT NULL,
|
|
123
|
+
name VARCHAR(255) NOT NULL,
|
|
124
|
+
created_at TIMESTAMP DEFAULT NOW()
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
CREATE TABLE orders (
|
|
128
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
129
|
+
user_id UUID NOT NULL,
|
|
130
|
+
order_date TIMESTAMP DEFAULT NOW(),
|
|
131
|
+
total DECIMAL(10,2),
|
|
132
|
+
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
|
|
133
|
+
INDEX idx_user_id (user_id)
|
|
134
|
+
);
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**PostgreSQL - One-to-One:**
|
|
138
|
+
|
|
139
|
+
```sql
|
|
140
|
+
-- One user has one profile
|
|
141
|
+
CREATE TABLE user_profiles (
|
|
142
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
143
|
+
user_id UUID UNIQUE NOT NULL,
|
|
144
|
+
bio TEXT,
|
|
145
|
+
avatar_url VARCHAR(500),
|
|
146
|
+
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
|
147
|
+
);
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**PostgreSQL - Many-to-Many:**
|
|
151
|
+
|
|
152
|
+
```sql
|
|
153
|
+
-- Students and courses (many-to-many)
|
|
154
|
+
CREATE TABLE students (
|
|
155
|
+
id UUID PRIMARY KEY,
|
|
156
|
+
name VARCHAR(255)
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
CREATE TABLE courses (
|
|
160
|
+
id UUID PRIMARY KEY,
|
|
161
|
+
title VARCHAR(255)
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
-- Junction table
|
|
165
|
+
CREATE TABLE course_enrollments (
|
|
166
|
+
id UUID PRIMARY KEY,
|
|
167
|
+
student_id UUID NOT NULL,
|
|
168
|
+
course_id UUID NOT NULL,
|
|
169
|
+
enrolled_at TIMESTAMP DEFAULT NOW(),
|
|
170
|
+
FOREIGN KEY (student_id) REFERENCES students(id) ON DELETE CASCADE,
|
|
171
|
+
FOREIGN KEY (course_id) REFERENCES courses(id) ON DELETE CASCADE,
|
|
172
|
+
UNIQUE(student_id, course_id)
|
|
173
|
+
);
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Constraint Strategy
|
|
177
|
+
|
|
178
|
+
**PostgreSQL - Data Integrity:**
|
|
179
|
+
|
|
180
|
+
```sql
|
|
181
|
+
-- NOT NULL constraints
|
|
182
|
+
CREATE TABLE products (
|
|
183
|
+
id UUID PRIMARY KEY,
|
|
184
|
+
name VARCHAR(255) NOT NULL,
|
|
185
|
+
sku VARCHAR(100) NOT NULL,
|
|
186
|
+
price DECIMAL(10,2) NOT NULL
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
-- UNIQUE constraints
|
|
190
|
+
ALTER TABLE products
|
|
191
|
+
ADD CONSTRAINT unique_sku UNIQUE(sku);
|
|
192
|
+
|
|
193
|
+
-- CHECK constraints
|
|
194
|
+
ALTER TABLE products
|
|
195
|
+
ADD CONSTRAINT price_positive CHECK (price > 0);
|
|
196
|
+
|
|
197
|
+
ALTER TABLE orders
|
|
198
|
+
ADD CONSTRAINT valid_status
|
|
199
|
+
CHECK (status IN ('pending', 'processing', 'completed', 'cancelled'));
|
|
200
|
+
|
|
201
|
+
-- DEFAULT values
|
|
202
|
+
CREATE TABLE audit_logs (
|
|
203
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
204
|
+
table_name VARCHAR(100) NOT NULL,
|
|
205
|
+
operation VARCHAR(10) NOT NULL,
|
|
206
|
+
user_id UUID,
|
|
207
|
+
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
208
|
+
);
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Data Type Selection
|
|
212
|
+
|
|
213
|
+
**PostgreSQL - Optimal Data Types:**
|
|
214
|
+
|
|
215
|
+
```sql
|
|
216
|
+
CREATE TABLE users (
|
|
217
|
+
-- Identifiers
|
|
218
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
219
|
+
|
|
220
|
+
-- Text fields
|
|
221
|
+
email VARCHAR(255), -- Fixed length for emails
|
|
222
|
+
name TEXT, -- Unbounded text
|
|
223
|
+
bio TEXT,
|
|
224
|
+
|
|
225
|
+
-- Numeric data
|
|
226
|
+
age SMALLINT, -- 0-32767
|
|
227
|
+
balance DECIMAL(15,2), -- Financial data (precise)
|
|
228
|
+
rating NUMERIC(3,1), -- Range 0.0-9.9
|
|
229
|
+
|
|
230
|
+
-- Boolean
|
|
231
|
+
is_active BOOLEAN DEFAULT true,
|
|
232
|
+
email_verified BOOLEAN,
|
|
233
|
+
|
|
234
|
+
-- Dates and Times
|
|
235
|
+
birth_date DATE,
|
|
236
|
+
last_login TIMESTAMP WITH TIME ZONE,
|
|
237
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
238
|
+
|
|
239
|
+
-- JSON/Binary
|
|
240
|
+
metadata JSONB,
|
|
241
|
+
profile_image BYTEA,
|
|
242
|
+
|
|
243
|
+
-- Arrays (PostgreSQL specific)
|
|
244
|
+
tags TEXT[] DEFAULT ARRAY[]::TEXT[]
|
|
245
|
+
);
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**MySQL - Compatible Data Types:**
|
|
249
|
+
|
|
250
|
+
```sql
|
|
251
|
+
CREATE TABLE users (
|
|
252
|
+
id CHAR(36) PRIMARY KEY, -- UUID as CHAR
|
|
253
|
+
|
|
254
|
+
email VARCHAR(255),
|
|
255
|
+
name VARCHAR(255),
|
|
256
|
+
|
|
257
|
+
age TINYINT UNSIGNED,
|
|
258
|
+
balance DECIMAL(15,2),
|
|
259
|
+
|
|
260
|
+
is_active BOOLEAN DEFAULT true,
|
|
261
|
+
|
|
262
|
+
birth_date DATE,
|
|
263
|
+
last_login TIMESTAMP,
|
|
264
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
265
|
+
|
|
266
|
+
metadata JSON,
|
|
267
|
+
|
|
268
|
+
KEY idx_email (email)
|
|
269
|
+
);
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Schema Evolution
|
|
273
|
+
|
|
274
|
+
**PostgreSQL - Backward Compatible Changes:**
|
|
275
|
+
|
|
276
|
+
```sql
|
|
277
|
+
-- Add column with default
|
|
278
|
+
ALTER TABLE users ADD COLUMN phone VARCHAR(20);
|
|
279
|
+
|
|
280
|
+
-- Add column for new feature
|
|
281
|
+
ALTER TABLE orders
|
|
282
|
+
ADD COLUMN notes TEXT DEFAULT '';
|
|
283
|
+
|
|
284
|
+
-- Add constraint on new column
|
|
285
|
+
ALTER TABLE orders
|
|
286
|
+
ADD CONSTRAINT check_notes CHECK (LENGTH(notes) <= 500);
|
|
287
|
+
|
|
288
|
+
-- Deprecate column safely
|
|
289
|
+
ALTER TABLE users RENAME COLUMN old_field TO old_field_deprecated;
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**MySQL - Schema Changes:**
|
|
293
|
+
|
|
294
|
+
```sql
|
|
295
|
+
-- Add column with default
|
|
296
|
+
ALTER TABLE users ADD COLUMN phone VARCHAR(20) DEFAULT '';
|
|
297
|
+
|
|
298
|
+
-- Add multiple columns
|
|
299
|
+
ALTER TABLE orders
|
|
300
|
+
ADD COLUMN notes TEXT DEFAULT '',
|
|
301
|
+
ADD COLUMN internal_status VARCHAR(50);
|
|
302
|
+
|
|
303
|
+
-- Modify column
|
|
304
|
+
ALTER TABLE users MODIFY COLUMN bio TEXT;
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Performance Considerations
|
|
308
|
+
|
|
309
|
+
**PostgreSQL - Partitioning Large Tables:**
|
|
310
|
+
|
|
311
|
+
```sql
|
|
312
|
+
-- Partition by date range for time-series data
|
|
313
|
+
CREATE TABLE events (
|
|
314
|
+
id UUID PRIMARY KEY,
|
|
315
|
+
user_id UUID NOT NULL,
|
|
316
|
+
event_type VARCHAR(100),
|
|
317
|
+
created_at TIMESTAMP NOT NULL
|
|
318
|
+
) PARTITION BY RANGE (DATE_TRUNC('month', created_at));
|
|
319
|
+
|
|
320
|
+
CREATE TABLE events_2024_01 PARTITION OF events
|
|
321
|
+
FOR VALUES FROM ('2024-01-01') TO ('2024-02-01');
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
## Schema Design Checklist
|
|
325
|
+
|
|
326
|
+
- Identify entities and relationships
|
|
327
|
+
- Apply normalization rules (1NF, 2NF, 3NF)
|
|
328
|
+
- Define primary keys for all tables
|
|
329
|
+
- Create foreign keys for relationships
|
|
330
|
+
- Add constraints for data integrity
|
|
331
|
+
- Select appropriate data types
|
|
332
|
+
- Plan indexes for common queries
|
|
333
|
+
- Design for scalability (denormalization if needed)
|
|
334
|
+
- Document table purposes and relationships
|
|
335
|
+
- Plan for schema evolution
|
|
336
|
+
|
|
337
|
+
## Common Pitfalls
|
|
338
|
+
|
|
339
|
+
❌ Don't skip normalization for convenience
|
|
340
|
+
❌ Don't use VARCHAR(MAX) for all text fields
|
|
341
|
+
❌ Don't forget to add foreign key constraints
|
|
342
|
+
❌ Don't use natural keys as primary keys
|
|
343
|
+
❌ Don't store calculated values in base tables
|
|
344
|
+
|
|
345
|
+
✅ DO use UUIDs or sequences for primary keys
|
|
346
|
+
✅ DO normalize data appropriately
|
|
347
|
+
✅ DO add CHECK constraints for data validity
|
|
348
|
+
✅ DO create indexes on foreign keys
|
|
349
|
+
✅ DO use TIMESTAMP for audit trails
|
|
350
|
+
|
|
351
|
+
## Resources
|
|
352
|
+
|
|
353
|
+
- [PostgreSQL Data Types](https://www.postgresql.org/docs/current/datatype.html)
|
|
354
|
+
- [MySQL Data Types](https://dev.mysql.com/doc/refman/8.0/en/data-types.html)
|
|
355
|
+
- [Database Normalization Guide](https://en.wikipedia.org/wiki/Database_normalization)
|
|
356
|
+
- [Draw.io](https://draw.io/) - Schema diagram tool
|
|
357
|
+
|
|
358
|
+
## Persistence Map Interview
|
|
359
|
+
|
|
360
|
+
This interview runs during `/create-prd-stack` Sub-steps A–E. It maps every feature to its query types, then selects the right store for each query type.
|
|
361
|
+
|
|
362
|
+
### Sub-step A — Feature-to-Query Table
|
|
363
|
+
|
|
364
|
+
Walk through every major feature in `vision.md` and ask: "What does this feature need to find, store, relate, and rank/search?"
|
|
365
|
+
|
|
366
|
+
Build the following table:
|
|
367
|
+
|
|
368
|
+
| Feature | Find | Store | Relate | Rank/Search |
|
|
369
|
+
|---------|------|-------|--------|-------------|
|
|
370
|
+
| (from vision.md) | … | … | … | … |
|
|
371
|
+
|
|
372
|
+
Present and confirm the table with the user before proceeding to Sub-step B.
|
|
373
|
+
|
|
374
|
+
### Sub-step B — Registry-First Skill Search
|
|
375
|
+
|
|
376
|
+
Before presenting any store options, read `.agent/skills/find-skills/SKILL.md` and run `npx skills find [query type or store name]` for each query type that appeared in the table.
|
|
377
|
+
|
|
378
|
+
If the registry returns a skill, install it first. The bundled skill library is a fallback only.
|
|
379
|
+
|
|
380
|
+
### Sub-step C — Store Selection Per Query Type
|
|
381
|
+
|
|
382
|
+
Present store options only for query types that appeared in the table:
|
|
383
|
+
|
|
384
|
+
- Skip `DATABASE_VECTOR` if no Rank/Search requirement appeared.
|
|
385
|
+
- Skip `DATABASE_GRAPH` if no Relate requirement appeared.
|
|
386
|
+
|
|
387
|
+
Use constraint-first per-axis flow: constraint questions → filter → present → confirm.
|
|
388
|
+
|
|
389
|
+
### Sub-step D — Bootstrap Per Confirmed Store
|
|
390
|
+
|
|
391
|
+
For each confirmed store, fire bootstrap with its specific sub-key:
|
|
392
|
+
|
|
393
|
+
- e.g., `DATABASE_PRIMARY=PostgreSQL`, `DATABASE_VECTOR=Qdrant`
|
|
394
|
+
- One bootstrap call per sub-key.
|
|
395
|
+
- Each confirmation appends to `{{DATABASE_SKILLS}}`.
|
|
396
|
+
|
|
397
|
+
### Sub-step E — Write Persistence Map
|
|
398
|
+
|
|
399
|
+
After all stores are confirmed, write to `docs/plans/architecture-draft.md` as a locked section titled `## Persistence Map`.
|
|
400
|
+
|
|
401
|
+
Must include:
|
|
402
|
+
- The feature-to-query table from Sub-step A
|
|
403
|
+
- A mapping of each query type to its canonical store with rationale
|
|
404
|
+
|
|
405
|
+
## Cross-Store Entity Consistency Protocol
|
|
406
|
+
|
|
407
|
+
### Triggering Rule
|
|
408
|
+
|
|
409
|
+
This protocol runs for every entity that spans more than one store.
|
|
410
|
+
|
|
411
|
+
### The 4 Questions
|
|
412
|
+
|
|
413
|
+
For each cross-store entity, answer the following in order:
|
|
414
|
+
|
|
415
|
+
1. **Canonical ID** — Single identifier tying representations together. Must be the primary store's UUID stored as a property in every other store — never the graph store's or vector store's internal ID.
|
|
416
|
+
|
|
417
|
+
2. **Creation sequence** — Which store is written first. Recovery mechanism for partial write failures (Saga pattern, compensating transaction, or async retry queue — name which).
|
|
418
|
+
|
|
419
|
+
3. **Deletion cascade** — Cleanup order, mechanism (application-layer sequential deletes, DB-level triggers, or background job — name which).
|
|
420
|
+
|
|
421
|
+
4. **Read strategy** — Whether a read requires data from multiple stores. Name the application-layer join pattern explicitly.
|
|
422
|
+
|
|
423
|
+
### Skill Instruction
|
|
424
|
+
|
|
425
|
+
Read all skills in `{{DATABASE_SKILLS}}` for advice on each store's transaction semantics and consistency guarantees before completing this step.
|
|
426
|
+
|
|
427
|
+
### Output
|
|
428
|
+
|
|
429
|
+
Write the completed cross-store consistency table to `architecture-draft.md` as part of the `## Data Strategy` section.
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deployment-procedures
|
|
3
|
+
description: Production deployment principles and decision-making. Safe deployment workflows, rollback strategies, and verification. Teaches thinking, not scripts.
|
|
4
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Deployment Procedures
|
|
8
|
+
|
|
9
|
+
> Deployment principles and decision-making for safe production releases.
|
|
10
|
+
> **Learn to THINK, not memorize scripts.**
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## ⚠️ How to Use This Skill
|
|
15
|
+
|
|
16
|
+
This skill teaches **deployment principles**, not bash scripts to copy.
|
|
17
|
+
|
|
18
|
+
- Every deployment is unique
|
|
19
|
+
- Understand the WHY behind each step
|
|
20
|
+
- Adapt procedures to your platform
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 1. Platform Selection
|
|
25
|
+
|
|
26
|
+
### Decision Tree
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
What are you deploying?
|
|
30
|
+
│
|
|
31
|
+
├── Static site / JAMstack
|
|
32
|
+
│ └── Vercel, Netlify, Cloudflare Pages
|
|
33
|
+
│
|
|
34
|
+
├── Simple web app
|
|
35
|
+
│ ├── Managed → Railway, Render, Fly.io
|
|
36
|
+
│ └── Control → VPS + PM2/Docker
|
|
37
|
+
│
|
|
38
|
+
├── Microservices
|
|
39
|
+
│ └── Container orchestration
|
|
40
|
+
│
|
|
41
|
+
└── Serverless
|
|
42
|
+
└── Edge functions, Lambda
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Each Platform Has Different Procedures
|
|
46
|
+
|
|
47
|
+
| Platform | Deployment Method |
|
|
48
|
+
|----------|------------------|
|
|
49
|
+
| **Vercel/Netlify** | Git push, auto-deploy |
|
|
50
|
+
| **Railway/Render** | Git push or CLI |
|
|
51
|
+
| **VPS + PM2** | SSH + manual steps |
|
|
52
|
+
| **Docker** | Image push + orchestration |
|
|
53
|
+
| **Kubernetes** | kubectl apply |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 2. Pre-Deployment Principles
|
|
58
|
+
|
|
59
|
+
### The 4 Verification Categories
|
|
60
|
+
|
|
61
|
+
| Category | What to Check |
|
|
62
|
+
|----------|--------------|
|
|
63
|
+
| **Code Quality** | Tests passing, linting clean, reviewed |
|
|
64
|
+
| **Build** | Production build works, no warnings |
|
|
65
|
+
| **Environment** | Env vars set, secrets current |
|
|
66
|
+
| **Safety** | Backup done, rollback plan ready |
|
|
67
|
+
|
|
68
|
+
### Pre-Deployment Checklist
|
|
69
|
+
|
|
70
|
+
- [ ] All tests passing
|
|
71
|
+
- [ ] Code reviewed and approved
|
|
72
|
+
- [ ] Production build successful
|
|
73
|
+
- [ ] Environment variables verified
|
|
74
|
+
- [ ] Database migrations ready (if any)
|
|
75
|
+
- [ ] Rollback plan documented
|
|
76
|
+
- [ ] Team notified
|
|
77
|
+
- [ ] Monitoring ready
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 3. Deployment Workflow Principles
|
|
82
|
+
|
|
83
|
+
### The 5-Phase Process
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
1. PREPARE
|
|
87
|
+
└── Verify code, build, env vars
|
|
88
|
+
|
|
89
|
+
2. BACKUP
|
|
90
|
+
└── Save current state before changing
|
|
91
|
+
|
|
92
|
+
3. DEPLOY
|
|
93
|
+
└── Execute with monitoring open
|
|
94
|
+
|
|
95
|
+
4. VERIFY
|
|
96
|
+
└── Health check, logs, key flows
|
|
97
|
+
|
|
98
|
+
5. CONFIRM or ROLLBACK
|
|
99
|
+
└── All good? Confirm. Issues? Rollback.
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Phase Principles
|
|
103
|
+
|
|
104
|
+
| Phase | Principle |
|
|
105
|
+
|-------|-----------|
|
|
106
|
+
| **Prepare** | Never deploy untested code |
|
|
107
|
+
| **Backup** | Can't rollback without backup |
|
|
108
|
+
| **Deploy** | Watch it happen, don't walk away |
|
|
109
|
+
| **Verify** | Trust but verify |
|
|
110
|
+
| **Confirm** | Have rollback trigger ready |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 4. Post-Deployment Verification
|
|
115
|
+
|
|
116
|
+
### What to Verify
|
|
117
|
+
|
|
118
|
+
| Check | Why |
|
|
119
|
+
|-------|-----|
|
|
120
|
+
| **Health endpoint** | Service is running |
|
|
121
|
+
| **Error logs** | No new errors |
|
|
122
|
+
| **Key user flows** | Critical features work |
|
|
123
|
+
| **Performance** | Response times acceptable |
|
|
124
|
+
|
|
125
|
+
### Verification Window
|
|
126
|
+
|
|
127
|
+
- **First 5 minutes**: Active monitoring
|
|
128
|
+
- **15 minutes**: Confirm stable
|
|
129
|
+
- **1 hour**: Final verification
|
|
130
|
+
- **Next day**: Review metrics
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 5. Rollback Principles
|
|
135
|
+
|
|
136
|
+
### When to Rollback
|
|
137
|
+
|
|
138
|
+
| Symptom | Action |
|
|
139
|
+
|---------|--------|
|
|
140
|
+
| Service down | Rollback immediately |
|
|
141
|
+
| Critical errors | Rollback |
|
|
142
|
+
| Performance >50% degraded | Consider rollback |
|
|
143
|
+
| Minor issues | Fix forward if quick |
|
|
144
|
+
|
|
145
|
+
### Rollback Strategy by Platform
|
|
146
|
+
|
|
147
|
+
| Platform | Rollback Method |
|
|
148
|
+
|----------|----------------|
|
|
149
|
+
| **Vercel/Netlify** | Redeploy previous commit |
|
|
150
|
+
| **Railway/Render** | Rollback in dashboard |
|
|
151
|
+
| **VPS + PM2** | Restore backup, restart |
|
|
152
|
+
| **Docker** | Previous image tag |
|
|
153
|
+
| **K8s** | kubectl rollout undo |
|
|
154
|
+
|
|
155
|
+
### Rollback Principles
|
|
156
|
+
|
|
157
|
+
1. **Speed over perfection**: Rollback first, debug later
|
|
158
|
+
2. **Don't compound errors**: One rollback, not multiple changes
|
|
159
|
+
3. **Communicate**: Tell team what happened
|
|
160
|
+
4. **Post-mortem**: Understand why after stable
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 6. Zero-Downtime Deployment
|
|
165
|
+
|
|
166
|
+
### Strategies
|
|
167
|
+
|
|
168
|
+
| Strategy | How It Works |
|
|
169
|
+
|----------|--------------|
|
|
170
|
+
| **Rolling** | Replace instances one by one |
|
|
171
|
+
| **Blue-Green** | Switch traffic between environments |
|
|
172
|
+
| **Canary** | Gradual traffic shift |
|
|
173
|
+
|
|
174
|
+
### Selection Principles
|
|
175
|
+
|
|
176
|
+
| Scenario | Strategy |
|
|
177
|
+
|----------|----------|
|
|
178
|
+
| Standard release | Rolling |
|
|
179
|
+
| High-risk change | Blue-green (easy rollback) |
|
|
180
|
+
| Need validation | Canary (test with real traffic) |
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## 7. Emergency Procedures
|
|
185
|
+
|
|
186
|
+
### Service Down Priority
|
|
187
|
+
|
|
188
|
+
1. **Assess**: What's the symptom?
|
|
189
|
+
2. **Quick fix**: Restart if unclear
|
|
190
|
+
3. **Rollback**: If restart doesn't help
|
|
191
|
+
4. **Investigate**: After stable
|
|
192
|
+
|
|
193
|
+
### Investigation Order
|
|
194
|
+
|
|
195
|
+
| Check | Common Issues |
|
|
196
|
+
|-------|--------------|
|
|
197
|
+
| **Logs** | Errors, exceptions |
|
|
198
|
+
| **Resources** | Disk full, memory |
|
|
199
|
+
| **Network** | DNS, firewall |
|
|
200
|
+
| **Dependencies** | Database, APIs |
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 8. Anti-Patterns
|
|
205
|
+
|
|
206
|
+
| ❌ Don't | ✅ Do |
|
|
207
|
+
|----------|-------|
|
|
208
|
+
| Deploy on Friday | Deploy early in week |
|
|
209
|
+
| Rush deployment | Follow the process |
|
|
210
|
+
| Skip staging | Always test first |
|
|
211
|
+
| Deploy without backup | Backup before deploy |
|
|
212
|
+
| Walk away after deploy | Monitor for 15+ min |
|
|
213
|
+
| Multiple changes at once | One change at a time |
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## 9. Decision Checklist
|
|
218
|
+
|
|
219
|
+
Before deploying:
|
|
220
|
+
|
|
221
|
+
- [ ] **Platform-appropriate procedure?**
|
|
222
|
+
- [ ] **Backup strategy ready?**
|
|
223
|
+
- [ ] **Rollback plan documented?**
|
|
224
|
+
- [ ] **Monitoring configured?**
|
|
225
|
+
- [ ] **Team notified?**
|
|
226
|
+
- [ ] **Time to monitor after?**
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## 10. Best Practices
|
|
231
|
+
|
|
232
|
+
1. **Small, frequent deploys** over big releases
|
|
233
|
+
2. **Feature flags** for risky changes
|
|
234
|
+
3. **Automate** repetitive steps
|
|
235
|
+
4. **Document** every deployment
|
|
236
|
+
5. **Review** what went wrong after issues
|
|
237
|
+
6. **Test rollback** before you need it
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
> **Remember:** Every deployment is a risk. Minimize risk through preparation, not speed.
|