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,384 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: database-migration-management
|
|
3
|
+
description: Manage database migrations and schema versioning. Use when planning migrations, version control, rollback strategies, or data transformations in PostgreSQL and MySQL.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Database Migration Management
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Implement robust database migration systems with version control, rollback capabilities, and data transformation strategies. Includes migration frameworks and production deployment patterns.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Schema versioning and evolution
|
|
15
|
+
- Data transformations and cleanup
|
|
16
|
+
- Adding/removing tables and columns
|
|
17
|
+
- Index creation and optimization
|
|
18
|
+
- Migration testing and validation
|
|
19
|
+
- Rollback planning and execution
|
|
20
|
+
- Multi-environment deployments
|
|
21
|
+
|
|
22
|
+
## Migration Framework Setup
|
|
23
|
+
|
|
24
|
+
### PostgreSQL - Schema Versioning
|
|
25
|
+
|
|
26
|
+
```sql
|
|
27
|
+
-- Create migrations tracking table
|
|
28
|
+
CREATE TABLE schema_migrations (
|
|
29
|
+
version BIGINT PRIMARY KEY,
|
|
30
|
+
name VARCHAR(255) NOT NULL,
|
|
31
|
+
executed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
32
|
+
duration_ms INTEGER,
|
|
33
|
+
checksum VARCHAR(64)
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
-- Create migration log table
|
|
37
|
+
CREATE TABLE migration_logs (
|
|
38
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
39
|
+
version BIGINT NOT NULL,
|
|
40
|
+
status VARCHAR(20) NOT NULL,
|
|
41
|
+
error_message TEXT,
|
|
42
|
+
rolled_back_at TIMESTAMP,
|
|
43
|
+
executed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
-- Function to record migration
|
|
47
|
+
CREATE OR REPLACE FUNCTION record_migration(
|
|
48
|
+
p_version BIGINT,
|
|
49
|
+
p_name VARCHAR,
|
|
50
|
+
p_duration_ms INTEGER
|
|
51
|
+
) RETURNS void AS $$
|
|
52
|
+
BEGIN
|
|
53
|
+
INSERT INTO schema_migrations (version, name, duration_ms)
|
|
54
|
+
VALUES (p_version, p_name, p_duration_ms)
|
|
55
|
+
ON CONFLICT (version) DO UPDATE
|
|
56
|
+
SET executed_at = CURRENT_TIMESTAMP;
|
|
57
|
+
END;
|
|
58
|
+
$$ LANGUAGE plpgsql;
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### MySQL - Migration Tracking
|
|
62
|
+
|
|
63
|
+
```sql
|
|
64
|
+
-- Create migrations table for MySQL
|
|
65
|
+
CREATE TABLE schema_migrations (
|
|
66
|
+
version BIGINT PRIMARY KEY,
|
|
67
|
+
name VARCHAR(255) NOT NULL,
|
|
68
|
+
executed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
69
|
+
duration_ms INT,
|
|
70
|
+
checksum VARCHAR(64)
|
|
71
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
72
|
+
|
|
73
|
+
-- Migration status table
|
|
74
|
+
CREATE TABLE migration_status (
|
|
75
|
+
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
76
|
+
version BIGINT NOT NULL,
|
|
77
|
+
status ENUM('pending', 'completed', 'failed', 'rolled_back'),
|
|
78
|
+
error_message TEXT,
|
|
79
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
80
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Common Migration Patterns
|
|
84
|
+
|
|
85
|
+
### Adding Columns
|
|
86
|
+
|
|
87
|
+
**PostgreSQL - Safe Column Addition:**
|
|
88
|
+
|
|
89
|
+
```sql
|
|
90
|
+
-- Migration: 20240115_001_add_phone_to_users.sql
|
|
91
|
+
|
|
92
|
+
-- Add column with default (non-blocking)
|
|
93
|
+
ALTER TABLE users
|
|
94
|
+
ADD COLUMN phone VARCHAR(20) DEFAULT '';
|
|
95
|
+
|
|
96
|
+
-- Add constraint after population
|
|
97
|
+
ALTER TABLE users
|
|
98
|
+
ADD CONSTRAINT phone_format
|
|
99
|
+
CHECK (phone = '' OR phone ~ '^\+?[0-9\-\(\)]{10,}$');
|
|
100
|
+
|
|
101
|
+
-- Create index
|
|
102
|
+
CREATE INDEX CONCURRENTLY idx_users_phone ON users(phone);
|
|
103
|
+
|
|
104
|
+
-- Rollback:
|
|
105
|
+
-- DROP INDEX CONCURRENTLY idx_users_phone;
|
|
106
|
+
-- ALTER TABLE users DROP COLUMN phone;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**MySQL - Column Addition:**
|
|
110
|
+
|
|
111
|
+
```sql
|
|
112
|
+
-- Migration: 20240115_001_add_phone_to_users.sql
|
|
113
|
+
|
|
114
|
+
-- Add column with ALTER
|
|
115
|
+
ALTER TABLE users
|
|
116
|
+
ADD COLUMN phone VARCHAR(20) DEFAULT '',
|
|
117
|
+
ADD INDEX idx_phone (phone);
|
|
118
|
+
|
|
119
|
+
-- Rollback:
|
|
120
|
+
-- ALTER TABLE users DROP COLUMN phone;
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Renaming Columns
|
|
124
|
+
|
|
125
|
+
**PostgreSQL - Column Rename:**
|
|
126
|
+
|
|
127
|
+
```sql
|
|
128
|
+
-- Migration: 20240115_002_rename_user_name_columns.sql
|
|
129
|
+
|
|
130
|
+
-- Rename columns
|
|
131
|
+
ALTER TABLE users RENAME COLUMN user_name TO full_name;
|
|
132
|
+
ALTER TABLE users RENAME COLUMN user_email TO email_address;
|
|
133
|
+
|
|
134
|
+
-- Update indexes
|
|
135
|
+
REINDEX TABLE users;
|
|
136
|
+
|
|
137
|
+
-- Rollback:
|
|
138
|
+
-- ALTER TABLE users RENAME COLUMN email_address TO user_email;
|
|
139
|
+
-- ALTER TABLE users RENAME COLUMN full_name TO user_name;
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Creating Indexes Non-blocking
|
|
143
|
+
|
|
144
|
+
**PostgreSQL - Concurrent Index Creation:**
|
|
145
|
+
|
|
146
|
+
```sql
|
|
147
|
+
-- Migration: 20240115_003_add_performance_indexes.sql
|
|
148
|
+
|
|
149
|
+
-- Create indexes without blocking writes
|
|
150
|
+
CREATE INDEX CONCURRENTLY idx_orders_user_created
|
|
151
|
+
ON orders(user_id, created_at DESC);
|
|
152
|
+
|
|
153
|
+
CREATE INDEX CONCURRENTLY idx_products_category_active
|
|
154
|
+
ON products(category_id)
|
|
155
|
+
WHERE active = true;
|
|
156
|
+
|
|
157
|
+
-- Verify index creation
|
|
158
|
+
SELECT schemaname, tablename, indexname, idx_scan
|
|
159
|
+
FROM pg_stat_user_indexes
|
|
160
|
+
WHERE indexname LIKE 'idx_%';
|
|
161
|
+
|
|
162
|
+
-- Rollback:
|
|
163
|
+
-- DROP INDEX CONCURRENTLY idx_orders_user_created;
|
|
164
|
+
-- DROP INDEX CONCURRENTLY idx_products_category_active;
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**MySQL - Online Index Creation:**
|
|
168
|
+
|
|
169
|
+
```sql
|
|
170
|
+
-- Migration: 20240115_003_add_performance_indexes.sql
|
|
171
|
+
|
|
172
|
+
-- Create indexes with ALGORITHM=INPLACE and LOCK=NONE
|
|
173
|
+
ALTER TABLE orders
|
|
174
|
+
ADD INDEX idx_user_created (user_id, created_at),
|
|
175
|
+
ALGORITHM=INPLACE, LOCK=NONE;
|
|
176
|
+
|
|
177
|
+
-- Monitor progress
|
|
178
|
+
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
|
|
179
|
+
WHERE INFO LIKE 'ALTER TABLE%';
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Data Transformations
|
|
183
|
+
|
|
184
|
+
**PostgreSQL - Data Cleanup Migration:**
|
|
185
|
+
|
|
186
|
+
```sql
|
|
187
|
+
-- Migration: 20240115_004_normalize_email_addresses.sql
|
|
188
|
+
|
|
189
|
+
-- Normalize existing email addresses
|
|
190
|
+
UPDATE users
|
|
191
|
+
SET email = LOWER(TRIM(email))
|
|
192
|
+
WHERE email != LOWER(TRIM(email));
|
|
193
|
+
|
|
194
|
+
-- Remove duplicates by keeping latest
|
|
195
|
+
DELETE FROM users
|
|
196
|
+
WHERE id NOT IN (
|
|
197
|
+
SELECT DISTINCT ON (LOWER(email)) id
|
|
198
|
+
FROM users
|
|
199
|
+
ORDER BY LOWER(email), created_at DESC
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
-- Rollback: Restore from backup (no safe rollback for data changes)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**MySQL - Bulk Data Update:**
|
|
206
|
+
|
|
207
|
+
```sql
|
|
208
|
+
-- Migration: 20240115_004_update_product_categories.sql
|
|
209
|
+
|
|
210
|
+
-- Update multiple rows with JOIN
|
|
211
|
+
UPDATE products p
|
|
212
|
+
JOIN category_mapping cm ON p.old_category = cm.old_name
|
|
213
|
+
SET p.category_id = cm.new_category_id
|
|
214
|
+
WHERE p.old_category IS NOT NULL;
|
|
215
|
+
|
|
216
|
+
-- Verify update
|
|
217
|
+
SELECT COUNT(*) as updated_count
|
|
218
|
+
FROM products
|
|
219
|
+
WHERE category_id IS NOT NULL;
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Table Structure Changes
|
|
223
|
+
|
|
224
|
+
**PostgreSQL - Alter Table Migration:**
|
|
225
|
+
|
|
226
|
+
```sql
|
|
227
|
+
-- Migration: 20240115_005_modify_order_columns.sql
|
|
228
|
+
|
|
229
|
+
-- Add new column
|
|
230
|
+
ALTER TABLE orders
|
|
231
|
+
ADD COLUMN status_updated_at TIMESTAMP;
|
|
232
|
+
|
|
233
|
+
-- Add constraint
|
|
234
|
+
ALTER TABLE orders
|
|
235
|
+
ADD CONSTRAINT valid_status
|
|
236
|
+
CHECK (status IN ('pending', 'processing', 'completed', 'cancelled'));
|
|
237
|
+
|
|
238
|
+
-- Set default for existing records
|
|
239
|
+
UPDATE orders
|
|
240
|
+
SET status_updated_at = updated_at
|
|
241
|
+
WHERE status_updated_at IS NULL;
|
|
242
|
+
|
|
243
|
+
-- Make column NOT NULL
|
|
244
|
+
ALTER TABLE orders
|
|
245
|
+
ALTER COLUMN status_updated_at SET NOT NULL;
|
|
246
|
+
|
|
247
|
+
-- Rollback:
|
|
248
|
+
-- ALTER TABLE orders DROP COLUMN status_updated_at;
|
|
249
|
+
-- ALTER TABLE orders DROP CONSTRAINT valid_status;
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Testing Migrations
|
|
253
|
+
|
|
254
|
+
**PostgreSQL - Test in Transaction:**
|
|
255
|
+
|
|
256
|
+
```sql
|
|
257
|
+
-- Test migration in transaction (will be rolled back)
|
|
258
|
+
BEGIN;
|
|
259
|
+
|
|
260
|
+
-- Run migration statements
|
|
261
|
+
ALTER TABLE users ADD COLUMN test_column VARCHAR(255);
|
|
262
|
+
|
|
263
|
+
-- Validate data
|
|
264
|
+
SELECT COUNT(*) FROM users;
|
|
265
|
+
SELECT COUNT(DISTINCT email) FROM users;
|
|
266
|
+
|
|
267
|
+
-- Rollback if issues found
|
|
268
|
+
ROLLBACK;
|
|
269
|
+
|
|
270
|
+
-- Or commit if all good
|
|
271
|
+
COMMIT;
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**Validate Migration:**
|
|
275
|
+
|
|
276
|
+
```sql
|
|
277
|
+
-- Check migration was applied
|
|
278
|
+
SELECT version, name, executed_at FROM schema_migrations
|
|
279
|
+
WHERE version = 20240115005;
|
|
280
|
+
|
|
281
|
+
-- Verify table structure
|
|
282
|
+
SELECT column_name, data_type, is_nullable
|
|
283
|
+
FROM information_schema.columns
|
|
284
|
+
WHERE table_name = 'users'
|
|
285
|
+
ORDER BY ordinal_position;
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Rollback Strategies
|
|
289
|
+
|
|
290
|
+
**PostgreSQL - Bidirectional Migrations:**
|
|
291
|
+
|
|
292
|
+
```sql
|
|
293
|
+
-- Migration file: 20240115_006_add_user_status.sql
|
|
294
|
+
|
|
295
|
+
-- ===== UP =====
|
|
296
|
+
CREATE TYPE user_status AS ENUM ('active', 'suspended', 'deleted');
|
|
297
|
+
ALTER TABLE users ADD COLUMN status user_status DEFAULT 'active';
|
|
298
|
+
|
|
299
|
+
-- ===== DOWN =====
|
|
300
|
+
-- ALTER TABLE users DROP COLUMN status;
|
|
301
|
+
-- DROP TYPE user_status;
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Rollback Execution:**
|
|
305
|
+
|
|
306
|
+
```sql
|
|
307
|
+
-- Function to rollback to specific version
|
|
308
|
+
CREATE OR REPLACE FUNCTION rollback_to_version(p_target_version BIGINT)
|
|
309
|
+
RETURNS TABLE (version BIGINT, name VARCHAR, status VARCHAR) AS $$
|
|
310
|
+
BEGIN
|
|
311
|
+
-- Execute down migrations in reverse order
|
|
312
|
+
RETURN QUERY
|
|
313
|
+
SELECT m.version, m.name, 'rolled_back'::VARCHAR
|
|
314
|
+
FROM schema_migrations m
|
|
315
|
+
WHERE m.version > p_target_version
|
|
316
|
+
ORDER BY m.version DESC;
|
|
317
|
+
END;
|
|
318
|
+
$$ LANGUAGE plpgsql;
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Production Deployment
|
|
322
|
+
|
|
323
|
+
**Safe Migration Checklist:**
|
|
324
|
+
|
|
325
|
+
- Test migration on production-like database
|
|
326
|
+
- Verify backup exists before migration
|
|
327
|
+
- Schedule during low-traffic window
|
|
328
|
+
- Monitor table locks and long-running queries
|
|
329
|
+
- Have rollback plan ready
|
|
330
|
+
- Test rollback procedure
|
|
331
|
+
- Document all changes
|
|
332
|
+
- Run in transaction when possible
|
|
333
|
+
- Verify data integrity after migration
|
|
334
|
+
- Update application code coordinated with migration
|
|
335
|
+
|
|
336
|
+
**PostgreSQL - Long Transaction Safety:**
|
|
337
|
+
|
|
338
|
+
```sql
|
|
339
|
+
-- Use statement timeout to prevent hanging migrations
|
|
340
|
+
SET statement_timeout = '30min';
|
|
341
|
+
|
|
342
|
+
-- Use lock timeout to prevent deadlocks
|
|
343
|
+
SET lock_timeout = '5min';
|
|
344
|
+
|
|
345
|
+
-- Run migration with timeouts
|
|
346
|
+
ALTER TABLE large_table
|
|
347
|
+
ADD COLUMN new_column VARCHAR(255),
|
|
348
|
+
ALGORITHM='INPLACE';
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
## Migration Examples
|
|
352
|
+
|
|
353
|
+
**Combined Migration - Multiple Changes:**
|
|
354
|
+
|
|
355
|
+
```sql
|
|
356
|
+
-- Migration: 20240115_007_refactor_user_tables.sql
|
|
357
|
+
|
|
358
|
+
BEGIN;
|
|
359
|
+
|
|
360
|
+
-- 1. Create new column with data from old column
|
|
361
|
+
ALTER TABLE users ADD COLUMN full_name VARCHAR(255);
|
|
362
|
+
UPDATE users SET full_name = first_name || ' ' || last_name;
|
|
363
|
+
|
|
364
|
+
-- 2. Add indexes
|
|
365
|
+
CREATE INDEX idx_users_full_name ON users(full_name);
|
|
366
|
+
|
|
367
|
+
-- 3. Add new constraint
|
|
368
|
+
ALTER TABLE users
|
|
369
|
+
ADD CONSTRAINT email_unique UNIQUE(email);
|
|
370
|
+
|
|
371
|
+
-- 4. Drop old columns (after verification)
|
|
372
|
+
-- ALTER TABLE users DROP COLUMN first_name;
|
|
373
|
+
-- ALTER TABLE users DROP COLUMN last_name;
|
|
374
|
+
|
|
375
|
+
COMMIT;
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
## Resources
|
|
379
|
+
|
|
380
|
+
- [Flyway - Java Migration Tool](https://flywaydb.org/)
|
|
381
|
+
- [Liquibase - Database Changelog](https://www.liquibase.org/)
|
|
382
|
+
- [Alembic - Python Migration](https://alembic.sqlalchemy.org/)
|
|
383
|
+
- [PostgreSQL ALTER TABLE](https://www.postgresql.org/docs/current/sql-altertable.html)
|
|
384
|
+
- [MySQL ALTER TABLE](https://dev.mysql.com/doc/refman/8.0/en/alter-table.html)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: minimalist-surgical-development
|
|
3
|
+
description: Use when editing an existing codebase and the goal is minimal, standard, and non-invasive changes - prioritizes simplest solution, standard libraries first, and surgical modification without unsolicited refactors
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Minimalist & Surgical Development
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
**Code like Kent Beck.** This skill keeps changes small and conventional: solve the stated problem with the least code and the least disruption to existing structure.
|
|
11
|
+
|
|
12
|
+
## Use when...
|
|
13
|
+
|
|
14
|
+
- The request emphasizes “minimal changes”, “surgical fix”, “preserve structure”, “don’t refactor”
|
|
15
|
+
- The task is to modify existing code rather than build from scratch
|
|
16
|
+
- There is temptation to introduce new abstractions, frameworks, or large rewrites
|
|
17
|
+
|
|
18
|
+
## Symptoms / keywords
|
|
19
|
+
|
|
20
|
+
- “minimal”, “surgical”, “small diff”, “don’t touch unrelated”, “keep style”, “no refactor”, “standard library first”, “YAGNI”, “KISS”
|
|
21
|
+
|
|
22
|
+
## Minimalist & Standard Code Generation
|
|
23
|
+
|
|
24
|
+
- **Principle of Simplicity**: Always provide the most straightforward and minimalist solution possible. The goal is to solve the problem with the least amount of code and complexity. Avoid premature optimization or over-engineering.
|
|
25
|
+
- **Standard First**: Heavily favor standard library functions and widely accepted, common programming patterns. Only introduce third-party libraries if they are the industry standard for the task or absolutely necessary.
|
|
26
|
+
- **Avoid Elaborate Solutions**: Do not propose complex, "clever", or obscure solutions. Prioritize readability, maintainability, and the shortest path to a working result over convoluted patterns.
|
|
27
|
+
- **Focus on the Core Request**: Generate code that directly addresses the user's request, without adding extra features or handling edge cases that were not mentioned.
|
|
28
|
+
|
|
29
|
+
## Surgical Code Modification
|
|
30
|
+
|
|
31
|
+
- **Preserve Existing Code**: The current codebase is the source of truth and must be respected. Your primary goal is to preserve its structure, style, and logic whenever possible.
|
|
32
|
+
- **Minimal Necessary Changes**: When adding a new feature or making a modification, alter the absolute minimum amount of existing code required to implement the change successfully.
|
|
33
|
+
- **Explicit Instructions Only**: Only modify, refactor, or delete code that has been explicitly targeted by the user's request. Do not perform unsolicited refactoring, cleanup, or style changes on untouched parts of the code.
|
|
34
|
+
- **Integrate, Don't Replace**: Whenever feasible, integrate new logic into the existing structure rather than replacing entire functions or blocks of code.
|
|
35
|
+
|
|
36
|
+
## Symbol-First Navigation (Serena MCP)
|
|
37
|
+
|
|
38
|
+
When exploring code structure before making changes, prefer Serena MCP symbol tools over full-file reads:
|
|
39
|
+
|
|
40
|
+
- **`get_symbols_overview`** - Fast summary of a file's structure (classes, functions, methods)
|
|
41
|
+
- **`find_symbol`** - Locate specific code by name without reading entire files
|
|
42
|
+
- **`find_referencing_symbols`** - Understand impact of changes by finding all call sites
|
|
43
|
+
|
|
44
|
+
**Why symbol-first is minimalist:**
|
|
45
|
+
- Reduces context pollution: see only the code you need
|
|
46
|
+
- Identifies exact targets before editing: no guessing what to modify
|
|
47
|
+
- Discovers existing patterns: find similar code to maintain consistency
|
|
48
|
+
- Fast refactoring checks: verify changes won't break usages
|
|
49
|
+
|
|
50
|
+
**When making edits, prefer symbol editing tools over file-based replacement:**
|
|
51
|
+
- Use `insert_before_symbol` / `insert_after_symbol` for adding code
|
|
52
|
+
- Use `replace_symbol_body` for rewriting function implementations
|
|
53
|
+
- Use `replace_content` (file-based) only when editing small sections within a function
|
|
54
|
+
|
|
55
|
+
See `serena-mcp-integration-guide.md` for detailed scenarios and examples.
|
|
56
|
+
|
|
57
|
+
## Intelligent Tool Usage
|
|
58
|
+
|
|
59
|
+
- **Use Tools When Necessary (via subagents)**: When a request requires external information or direct interaction with the environment, dispatch an appropriate subagent to use the necessary tools and return a cited Context Package. The orchestrator must not perform investigation/data-fetching I/O directly.
|
|
60
|
+
- **Directly Edit Code When Requested (via subagents)**: If explicitly asked to modify/refactor/add code, dispatch an implementation subagent to apply the changes directly in the codebase. Avoid copy/paste snippets unless requested; default to a small, surgical diff implemented by the subagent.
|
|
61
|
+
- **Purposeful and Focused Action**: Tool usage must be directly tied to the user's request. Do not perform unrelated searches or modifications. Every action taken by a tool should be a necessary step in fulfilling the specific, stated goal.
|
|
62
|
+
- **Declare Intent Before Tool Use**: Before executing any tool, you must first state the action you are about to take and its direct purpose. This statement must be concise and immediately precede the tool call.
|
|
63
|
+
|
|
64
|
+
## Quick checklist
|
|
65
|
+
|
|
66
|
+
- Ensure a research subagent has read the relevant files (with citations) before any changes
|
|
67
|
+
- Make the smallest diff that satisfies the requirement
|
|
68
|
+
- Prefer existing utilities/abstractions over adding new ones
|
|
69
|
+
- Avoid new dependencies unless clearly justified
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: parallel-agents
|
|
3
|
+
description: Orchestrate concurrent analysis or implementation across independent domains. Use when a task can be decomposed into independent workstreams (e.g., via simultaneous tool calls or background processes) — spec writing, code review, security audit, feature implementation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Parallel Agents & Concurrent Tool Execution
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Some tasks are naturally parallelizable — they have independent domains that don't share state. As a highly-capable agent, you can drastically cut wall-clock time by leveraging **concurrent tool execution** (e.g., running multiple `view_file` calls, `grep_search` calls, or background terminal commands simultaneously) instead of investigating sequentially.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Parallelism is a scheduling optimization, not a quality shortcut. Every concurrent workstream follows the same quality standards as a sequential task.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- **Multi-surface implementation** — A slice has independent surfaces (DB, API, UI, admin) that don't share implementation logic
|
|
17
|
+
- **Multi-domain analysis** — Security audit + performance review + accessibility audit on the same codebase
|
|
18
|
+
- **Spec writing** — Multiple IA shards need specs written from the same architecture doc
|
|
19
|
+
- **Code review** — Large PR touches independent subsystems
|
|
20
|
+
- **Debugging** — Multiple independent failures (see `parallel-debugging` skill for the full protocol)
|
|
21
|
+
|
|
22
|
+
## When NOT to Use
|
|
23
|
+
|
|
24
|
+
- Tasks share mutable state or edit the same files
|
|
25
|
+
- Later tasks depend on output of earlier tasks (use sequential pipeline instead)
|
|
26
|
+
- You don't fully understand the task decomposition yet (investigate first)
|
|
27
|
+
- Simple task that one agent handles in < 5 minutes
|
|
28
|
+
|
|
29
|
+
## The Protocol
|
|
30
|
+
|
|
31
|
+
### 1. Decompose
|
|
32
|
+
|
|
33
|
+
Break the task into independent domains. Each domain must satisfy ALL of:
|
|
34
|
+
|
|
35
|
+
| Requirement | Why |
|
|
36
|
+
|-------------|-----|
|
|
37
|
+
| **Independent files** — workstreams do not mutate the same file | Prevents race conditions and tool call hash mismatches |
|
|
38
|
+
| **Independent state** — no shared mutable resources (DB tables, caches) | Prevents race conditions |
|
|
39
|
+
| **Self-contained context** — stream can run without waiting on another's output | Prevents blocking |
|
|
40
|
+
| **Clear deliverable** — you can verify the stream's work in isolation | Prevents integration surprises |
|
|
41
|
+
|
|
42
|
+
If any requirement fails → that domain can't be parallelized. Run it sequentially.
|
|
43
|
+
|
|
44
|
+
### 2. Define Workstream Profiles
|
|
45
|
+
|
|
46
|
+
Instead of giving yourself a single massive objective, explicitly define the scope for each concurrent stream conceptually:
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
## Workstream: [Domain Name]
|
|
50
|
+
### Scope
|
|
51
|
+
[Exactly what this stream owns — files, features, concerns]
|
|
52
|
+
|
|
53
|
+
### Context
|
|
54
|
+
[Everything needed — paste relevant code, specs, error messages]
|
|
55
|
+
|
|
56
|
+
### Constraints
|
|
57
|
+
- Do NOT mutate files outside the defined scope
|
|
58
|
+
- Follow rule: boundary-not-placeholder for cross-stream dependencies
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Scope quality rules:**
|
|
62
|
+
- ✅ **Focused** — one clear problem domain
|
|
63
|
+
- ✅ **Constrained** — explicit file/scope boundaries
|
|
64
|
+
- ❌ **Shared Mutable State** — running `replace_file_content` on the same file concurrently will fail or corrupt data.
|
|
65
|
+
|
|
66
|
+
### 3. Concurrent Execution
|
|
67
|
+
|
|
68
|
+
Launch the workstreams simultaneously using your concurrent tool execution capabilities.
|
|
69
|
+
For example, if testing and formatting code, you might run `npm run test` in one background terminal and `npx prettier --write` in another, checking the statuses of both instead of waiting for one to finish before starting the other.
|
|
70
|
+
When making file edits, batch disjoint `replace_file_content` tool calls in the same turn.
|
|
71
|
+
|
|
72
|
+
### 4. Synthesize
|
|
73
|
+
|
|
74
|
+
After ALL concurrent streams yield results, synthesize them into a single coherent picture before proceeding:
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
## Concurrent Synthesis
|
|
78
|
+
|
|
79
|
+
### Task Summary
|
|
80
|
+
[What was accomplished across all workstreams]
|
|
81
|
+
|
|
82
|
+
### Findings by Domain
|
|
83
|
+
| Domain | Finding/Result |
|
|
84
|
+
|--------|----------------|
|
|
85
|
+
| Stream 1 | [what was found] |
|
|
86
|
+
| Stream 2 | [what was found] |
|
|
87
|
+
|
|
88
|
+
### Consolidated Actions
|
|
89
|
+
1. **Critical**: [From Stream X]
|
|
90
|
+
2. **Important**: [From Stream Y]
|
|
91
|
+
|
|
92
|
+
### Integration Verification
|
|
93
|
+
- [ ] No file conflicts during concurrent editing
|
|
94
|
+
- [ ] Full test suite passes
|
|
95
|
+
- [ ] Changes reviewed for consistency
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 5. Verify Integration
|
|
99
|
+
|
|
100
|
+
**Non-negotiable:** After merging all agent outputs:
|
|
101
|
+
1. Run the full validation suite (not just individual agent tests)
|
|
102
|
+
2. Check for contradictions between agent recommendations
|
|
103
|
+
3. Verify no files were modified by multiple agents
|
|
104
|
+
4. Spot-check agent work — agents can make systematic errors
|
|
105
|
+
|
|
106
|
+
## Task Decomposition Archetypes
|
|
107
|
+
|
|
108
|
+
These are suggested ways to slice concurrent workstreams:
|
|
109
|
+
|
|
110
|
+
| Archetype | Domain Focus | Typical Sub-Skills |
|
|
111
|
+
|-----------|--------------|-------------------|
|
|
112
|
+
| **Security Review** | Vulnerabilities, RBAC, input validation | security-scanning, code-review |
|
|
113
|
+
| **Test Quality** | Test coverage, edge cases | tdd-workflow |
|
|
114
|
+
| **Backend Implementation** | API design, data layer | rest-api-design, surrealdb-expert |
|
|
115
|
+
| **Frontend Implementation** | UI components, accessibility | frontend-design, accessibility |
|
|
116
|
+
| **Performance Audit** | Bottlenecks, bundle size | web-performance-optimization |
|
|
117
|
+
| **Documentation** | API docs, architecture docs | — |
|
|
118
|
+
| **ACH Debugging** | Root cause investigation | systematic-debugging, parallel-debugging |
|
|
119
|
+
|
|
120
|
+
## Integration with Kit
|
|
121
|
+
|
|
122
|
+
- **With `parallel-feature-development`:** When making concurrent file edits, use the strict file ownership protocol to prevent tool call conflicts (e.g. failing `replace_file_content` because the file hash changed).
|
|
123
|
+
- **With `session-continuity` Protocol 9:** When you claim both a `BE` and `FE` task concurrently, the `files:` blocks are your guarantee that you can execute edits simultaneously safely.
|
|
124
|
+
- **With `boundary-not-placeholder`:** If a concurrent stream hits a missing dependency, use `// BOUNDARY:` stubs. Don't block the stream indefinitely.
|
|
125
|
+
|
|
126
|
+
## Common Mistakes
|
|
127
|
+
|
|
128
|
+
| Mistake | Consequence | Fix |
|
|
129
|
+
|---------|-------------|-----|
|
|
130
|
+
| Concurrent edits to same file | Overwrites, hash mismatches | One stream per file strictly |
|
|
131
|
+
| No synthesis step | Contradictory logic | Always synthesize before committing changes |
|
|
132
|
+
| Shared dependencies not frozen | Build breaks unexpectedly | Use interface contracts first |
|
|
133
|
+
|
|
134
|
+
## TDD-Order Dispatch (Slice Implementation)
|
|
135
|
+
|
|
136
|
+
### Triggering Condition
|
|
137
|
+
|
|
138
|
+
Enter parallel mode when the slice's tasks contain surface tags (`BE`, `FE`, `QA`). Proceed sequentially when no tags are found.
|
|
139
|
+
|
|
140
|
+
### Core Principle
|
|
141
|
+
|
|
142
|
+
> **Tests are the rock. Code is malleable.** Tests encode the acceptance criteria and must be comprehensive. Code adapts to pass tests, never the reverse.
|
|
143
|
+
|
|
144
|
+
### 5-Phase Dispatch Table
|
|
145
|
+
|
|
146
|
+
| Phase | Agent | Responsibility | Depends On |
|
|
147
|
+
|-------|-------|----------------|------------|
|
|
148
|
+
| 0 | Orchestrator | Contracts/schemas (untagged tasks) | — |
|
|
149
|
+
| 1 | QA (RED) | Write comprehensive failing tests | Phase 0 |
|
|
150
|
+
| 2 | BE + FE (parallel) | Write code to make tests pass | Phase 1 |
|
|
151
|
+
| 3 | QA (GREEN) | Verify all tests pass, anti-cheat audit | Phase 2 |
|
|
152
|
+
| 4 | Orchestrator | Iterative correction loop if needed | Phase 3 |
|
|
153
|
+
|
|
154
|
+
### Dispatch Instructions
|
|
155
|
+
|
|
156
|
+
1. **Untagged tasks first** — Contract/schema work runs sequentially by orchestrator (Phase 0) before any tagged dispatch.
|
|
157
|
+
2. **QA-RED** — QA agent writes comprehensive failing tests for ALL acceptance criteria. Tests MUST fail. Read `.agent/skills/session-continuity/protocols/09-parallel-claim.md`. Every contract field and error type covered.
|
|
158
|
+
3. **BE + FE parallel** — Code against tests and contracts simultaneously. Annotate spec-gap decisions with `// DECISION: [what and why]`.
|
|
159
|
+
4. **QA-GREEN** — Re-verify all tests pass, anti-cheat check, add integration tests.
|
|
160
|
+
5. **Iterative loop rule** — If QA-GREEN fails → re-dispatch BE/FE → QA-GREEN again → repeat until all pass.
|
|
161
|
+
6. **File independence check** — Verify no two tagged tasks touch the same files before dispatching (prevents tool call hash mismatches).
|
|
162
|
+
|
|
163
|
+
### Progress Logging
|
|
164
|
+
|
|
165
|
+
Log each dispatch phase to `.agent/progress/slices/phase-NN-slice-NN.md` under `## Dispatch Log`.
|