@cubis/foundry 0.3.71 → 0.3.72
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/CHANGELOG.md +15 -0
- package/dist/cli/core.js +4 -18
- package/dist/cli/core.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/core.ts +4 -18
- package/workflows/powers/accessibility/POWER.md +83 -94
- package/workflows/powers/accessibility/SKILL.md +82 -94
- package/workflows/powers/agent-design/POWER.md +201 -0
- package/workflows/powers/agent-design/SKILL.md +198 -0
- package/workflows/powers/agent-design/references/clarification-patterns.md +153 -0
- package/workflows/powers/agent-design/references/skill-testing.md +164 -0
- package/workflows/powers/agent-design/references/workflow-patterns.md +226 -0
- package/workflows/powers/agentic-eval/POWER.md +62 -0
- package/workflows/powers/agentic-eval/SKILL.md +59 -0
- package/workflows/powers/agentic-eval/references/rubric-and-regression-checklist.md +11 -0
- package/workflows/powers/api-designer/POWER.md +43 -71
- package/workflows/powers/api-designer/SKILL.md +43 -71
- package/workflows/powers/api-patterns/POWER.md +42 -56
- package/workflows/powers/api-patterns/SKILL.md +42 -57
- package/workflows/powers/architecture-designer/POWER.md +43 -60
- package/workflows/powers/architecture-designer/SKILL.md +43 -60
- package/workflows/powers/ask-questions-if-underspecified/POWER.md +51 -3
- package/workflows/powers/auth-architect/POWER.md +69 -0
- package/workflows/powers/auth-architect/SKILL.md +66 -0
- package/workflows/powers/auth-architect/references/session-token-policy-checklist.md +45 -0
- package/workflows/powers/behavioral-modes/POWER.md +100 -9
- package/workflows/powers/c-pro/POWER.md +105 -0
- package/workflows/powers/c-pro/SKILL.md +102 -0
- package/workflows/powers/c-pro/references/build-systems-and-toolchains.md +148 -0
- package/workflows/powers/c-pro/references/common-ub-and-portability.md +166 -0
- package/workflows/powers/c-pro/references/debugging-with-sanitizers.md +205 -0
- package/workflows/powers/c-pro/references/memory-safety-and-build-checklist.md +60 -0
- package/workflows/powers/c-pro/references/posix-and-platform-apis.md +244 -0
- package/workflows/powers/changelog-generator/POWER.md +127 -63
- package/workflows/powers/changelog-generator/SKILL.md +126 -63
- package/workflows/powers/ci-cd-pipelines/POWER.md +156 -0
- package/workflows/powers/ci-cd-pipelines/SKILL.md +153 -0
- package/workflows/powers/ci-cd-pipelines/references/github-actions-patterns.md +160 -0
- package/workflows/powers/ci-cd-pipelines/references/pipeline-security-checklist.md +57 -0
- package/workflows/powers/cli-developer/POWER.md +152 -95
- package/workflows/powers/cli-developer/SKILL.md +152 -95
- package/workflows/powers/cpp-pro/POWER.md +111 -0
- package/workflows/powers/cpp-pro/SKILL.md +108 -0
- package/workflows/powers/cpp-pro/references/concurrency-primitives.md +266 -0
- package/workflows/powers/cpp-pro/references/move-semantics-and-value-types.md +149 -0
- package/workflows/powers/cpp-pro/references/performance-and-profiling.md +191 -0
- package/workflows/powers/cpp-pro/references/raii-and-modern-cpp-checklist.md +87 -0
- package/workflows/powers/cpp-pro/references/template-and-concepts-patterns.md +205 -0
- package/workflows/powers/csharp-pro/POWER.md +47 -22
- package/workflows/powers/csharp-pro/SKILL.md +47 -22
- package/workflows/powers/dart-pro/POWER.md +68 -0
- package/workflows/powers/dart-pro/SKILL.md +65 -0
- package/workflows/powers/dart-pro/references/isolate-and-concurrency.md +180 -0
- package/workflows/powers/dart-pro/references/null-safety-and-async-patterns.md +133 -0
- package/workflows/powers/dart-pro/references/package-structure-and-linting.md +193 -0
- package/workflows/powers/dart-pro/references/sealed-records-patterns.md +173 -0
- package/workflows/powers/dart-pro/references/testing-and-mocking.md +235 -0
- package/workflows/powers/database-design/POWER.md +47 -33
- package/workflows/powers/database-design/SKILL.md +47 -33
- package/workflows/powers/database-optimizer/POWER.md +43 -64
- package/workflows/powers/database-optimizer/SKILL.md +43 -64
- package/workflows/powers/database-skills/POWER.md +59 -93
- package/workflows/powers/database-skills/SKILL.md +59 -93
- package/workflows/powers/debugging-strategies/POWER.md +69 -0
- package/workflows/powers/debugging-strategies/SKILL.md +66 -0
- package/workflows/powers/debugging-strategies/references/reproduce-isolate-verify-checklist.md +42 -0
- package/workflows/powers/deep-research/POWER.md +67 -0
- package/workflows/powers/deep-research/SKILL.md +64 -0
- package/workflows/powers/deep-research/references/multi-round-research-loop.md +80 -0
- package/workflows/powers/design-system-builder/POWER.md +130 -116
- package/workflows/powers/design-system-builder/SKILL.md +130 -116
- package/workflows/powers/devops-engineer/POWER.md +120 -57
- package/workflows/powers/devops-engineer/SKILL.md +120 -57
- package/workflows/powers/docker-kubernetes/POWER.md +94 -0
- package/workflows/powers/docker-kubernetes/SKILL.md +91 -0
- package/workflows/powers/docker-kubernetes/references/dockerfile-optimization-checklist.md +35 -0
- package/workflows/powers/docker-kubernetes/references/kubernetes-deployment-patterns.md +59 -0
- package/workflows/powers/documentation-templates/POWER.md +158 -127
- package/workflows/powers/documentation-templates/SKILL.md +158 -127
- package/workflows/powers/drizzle-expert/POWER.md +66 -0
- package/workflows/powers/drizzle-expert/SKILL.md +63 -0
- package/workflows/powers/drizzle-expert/references/runtime-pairing-matrix.md +16 -0
- package/workflows/powers/drizzle-expert/references/schema-and-migration-playbook.md +18 -0
- package/workflows/powers/error-ux-observability/POWER.md +144 -131
- package/workflows/powers/error-ux-observability/SKILL.md +143 -131
- package/workflows/powers/fastapi-expert/POWER.md +46 -60
- package/workflows/powers/fastapi-expert/SKILL.md +46 -60
- package/workflows/powers/firebase/POWER.md +65 -0
- package/workflows/powers/firebase/SKILL.md +62 -0
- package/workflows/powers/firebase/references/platform-routing.md +16 -0
- package/workflows/powers/firebase/references/rules-and-indexes-checklist.md +11 -0
- package/workflows/powers/flutter-design-system/POWER.md +63 -0
- package/workflows/powers/flutter-design-system/SKILL.md +60 -0
- package/workflows/powers/flutter-design-system/references/shared-widgets.md +29 -0
- package/workflows/powers/flutter-design-system/references/tokens-and-theme.md +34 -0
- package/workflows/powers/flutter-drift/POWER.md +65 -0
- package/workflows/powers/flutter-drift/SKILL.md +62 -0
- package/workflows/powers/flutter-drift/references/migrations.md +22 -0
- package/workflows/powers/flutter-drift/references/query-patterns.md +26 -0
- package/workflows/powers/flutter-feature/POWER.md +65 -0
- package/workflows/powers/flutter-feature/SKILL.md +62 -0
- package/workflows/powers/flutter-feature/references/architecture-rules.md +85 -0
- package/workflows/powers/flutter-feature/references/composite-provider.md +58 -0
- package/workflows/powers/flutter-feature/references/outbox-pattern.md +87 -0
- package/workflows/powers/flutter-feature/references/testing-patterns.md +218 -0
- package/workflows/powers/flutter-go-router/POWER.md +64 -0
- package/workflows/powers/flutter-go-router/SKILL.md +61 -0
- package/workflows/powers/flutter-go-router/references/guards-and-deeplinks.md +20 -0
- package/workflows/powers/flutter-go-router/references/typed-routes.md +27 -0
- package/workflows/powers/flutter-offline-sync/POWER.md +62 -0
- package/workflows/powers/flutter-offline-sync/SKILL.md +59 -0
- package/workflows/powers/flutter-offline-sync/references/outbox-full.md +44 -0
- package/workflows/powers/flutter-repository/POWER.md +64 -0
- package/workflows/powers/flutter-repository/SKILL.md +61 -0
- package/workflows/powers/flutter-repository/references/drift-patterns.md +21 -0
- package/workflows/powers/flutter-repository/references/retrofit-patterns.md +20 -0
- package/workflows/powers/flutter-riverpod/POWER.md +70 -0
- package/workflows/powers/flutter-riverpod/SKILL.md +67 -0
- package/workflows/powers/flutter-riverpod/references/async-and-mutations.md +19 -0
- package/workflows/powers/flutter-riverpod/references/async-lifecycle.md +19 -0
- package/workflows/powers/flutter-riverpod/references/provider-selection.md +20 -0
- package/workflows/powers/flutter-riverpod/references/testing.md +21 -0
- package/workflows/powers/flutter-riverpod/references/version-matrix.md +24 -0
- package/workflows/powers/flutter-state-machine/POWER.md +62 -0
- package/workflows/powers/flutter-state-machine/SKILL.md +59 -0
- package/workflows/powers/flutter-state-machine/references/app-state-contract.md +23 -0
- package/workflows/powers/flutter-state-machine/references/ui-rendering.md +14 -0
- package/workflows/powers/flutter-testing/POWER.md +64 -0
- package/workflows/powers/flutter-testing/SKILL.md +61 -0
- package/workflows/powers/flutter-testing/references/offline-sync-tests.md +16 -0
- package/workflows/powers/flutter-testing/references/test-layers.md +33 -0
- package/workflows/powers/frontend-code-review/POWER.md +137 -0
- package/workflows/powers/frontend-code-review/SKILL.md +134 -0
- package/workflows/powers/frontend-code-review/references/common-antipatterns.md +86 -0
- package/workflows/powers/frontend-code-review/references/performance-budgets.md +56 -0
- package/workflows/powers/frontend-code-review/references/review-checklists.md +47 -0
- package/workflows/powers/frontend-design/POWER.md +163 -362
- package/workflows/powers/frontend-design/SKILL.md +163 -362
- package/workflows/powers/game-development/POWER.md +57 -140
- package/workflows/powers/game-development/SKILL.md +57 -140
- package/workflows/powers/geo-fundamentals/POWER.md +64 -126
- package/workflows/powers/geo-fundamentals/SKILL.md +64 -127
- package/workflows/powers/git-workflow/POWER.md +135 -0
- package/workflows/powers/git-workflow/SKILL.md +132 -0
- package/workflows/powers/git-workflow/references/pr-review-checklist.md +63 -0
- package/workflows/powers/golang-pro/POWER.md +46 -35
- package/workflows/powers/golang-pro/SKILL.md +46 -35
- package/workflows/powers/graphql-architect/POWER.md +44 -62
- package/workflows/powers/graphql-architect/SKILL.md +44 -62
- package/workflows/powers/i18n-localization/POWER.md +118 -103
- package/workflows/powers/i18n-localization/SKILL.md +118 -103
- package/workflows/powers/java-pro/POWER.md +47 -22
- package/workflows/powers/java-pro/SKILL.md +47 -22
- package/workflows/powers/javascript-pro/POWER.md +47 -34
- package/workflows/powers/javascript-pro/SKILL.md +47 -34
- package/workflows/powers/kotlin-pro/POWER.md +46 -23
- package/workflows/powers/kotlin-pro/SKILL.md +46 -23
- package/workflows/powers/legacy-modernizer/POWER.md +43 -60
- package/workflows/powers/legacy-modernizer/SKILL.md +43 -60
- package/workflows/powers/mcp-builder/POWER.md +65 -0
- package/workflows/powers/mcp-builder/SKILL.md +62 -0
- package/workflows/powers/mcp-builder/references/testing-and-evals.md +17 -0
- package/workflows/powers/mcp-builder/references/transport-and-tool-design.md +17 -0
- package/workflows/powers/microservices-architect/POWER.md +43 -70
- package/workflows/powers/microservices-architect/SKILL.md +43 -70
- package/workflows/powers/mobile-design/POWER.md +110 -345
- package/workflows/powers/mobile-design/SKILL.md +110 -345
- package/workflows/powers/mongodb/POWER.md +67 -0
- package/workflows/powers/mongodb/SKILL.md +64 -0
- package/workflows/powers/mongodb/references/mongodb-checklist.md +20 -0
- package/workflows/powers/mysql/POWER.md +67 -0
- package/workflows/powers/mysql/SKILL.md +64 -0
- package/workflows/powers/mysql/references/mysql-checklist.md +20 -0
- package/workflows/powers/neki/POWER.md +67 -0
- package/workflows/powers/neki/SKILL.md +64 -0
- package/workflows/powers/neki/references/neki-checklist.md +18 -0
- package/workflows/powers/nestjs-expert/POWER.md +45 -91
- package/workflows/powers/nestjs-expert/SKILL.md +45 -91
- package/workflows/powers/nextjs-developer/POWER.md +51 -44
- package/workflows/powers/nextjs-developer/SKILL.md +51 -44
- package/workflows/powers/nodejs-best-practices/POWER.md +48 -29
- package/workflows/powers/nodejs-best-practices/SKILL.md +48 -29
- package/workflows/powers/observability/POWER.md +109 -0
- package/workflows/powers/observability/SKILL.md +106 -0
- package/workflows/powers/observability/references/alerting-and-slo-checklist.md +87 -0
- package/workflows/powers/observability/references/opentelemetry-setup-guide.md +121 -0
- package/workflows/powers/openai-docs/POWER.md +61 -0
- package/workflows/powers/openai-docs/SKILL.md +58 -0
- package/workflows/powers/openai-docs/references/official-source-playbook.md +10 -0
- package/workflows/powers/performance-profiling/POWER.md +61 -114
- package/workflows/powers/performance-profiling/SKILL.md +61 -114
- package/workflows/powers/php-pro/POWER.md +116 -0
- package/workflows/powers/php-pro/SKILL.md +113 -0
- package/workflows/powers/php-pro/references/architecture-and-di.md +239 -0
- package/workflows/powers/php-pro/references/modern-php-features.md +189 -0
- package/workflows/powers/php-pro/references/performance-and-deployment.md +197 -0
- package/workflows/powers/php-pro/references/php84-strict-typing-checklist.md +161 -0
- package/workflows/powers/php-pro/references/testing-and-static-analysis.md +235 -0
- package/workflows/powers/playwright-e2e/POWER.md +85 -0
- package/workflows/powers/playwright-e2e/SKILL.md +82 -0
- package/workflows/powers/playwright-e2e/references/locator-trace-flake-checklist.md +80 -0
- package/workflows/powers/postgres/POWER.md +67 -0
- package/workflows/powers/postgres/SKILL.md +64 -0
- package/workflows/powers/postgres/references/postgres-checklist.md +20 -0
- package/workflows/powers/prompt-engineer/POWER.md +47 -30
- package/workflows/powers/prompt-engineer/SKILL.md +47 -30
- package/workflows/powers/python-pro/POWER.md +47 -36
- package/workflows/powers/python-pro/SKILL.md +47 -36
- package/workflows/powers/react-best-practices/POWER.md +56 -33
- package/workflows/powers/react-best-practices/SKILL.md +56 -33
- package/workflows/powers/react-expert/POWER.md +47 -37
- package/workflows/powers/react-expert/SKILL.md +47 -37
- package/workflows/powers/redis/POWER.md +67 -0
- package/workflows/powers/redis/SKILL.md +64 -0
- package/workflows/powers/redis/references/redis-checklist.md +19 -0
- package/workflows/powers/ruby-pro/POWER.md +118 -0
- package/workflows/powers/ruby-pro/SKILL.md +115 -0
- package/workflows/powers/ruby-pro/references/modern-ruby-features.md +189 -0
- package/workflows/powers/ruby-pro/references/object-design-patterns.md +220 -0
- package/workflows/powers/ruby-pro/references/performance-and-profiling.md +224 -0
- package/workflows/powers/ruby-pro/references/ruby-concurrency-and-testing.md +190 -0
- package/workflows/powers/ruby-pro/references/testing-and-rspec.md +236 -0
- package/workflows/powers/rust-pro/POWER.md +45 -31
- package/workflows/powers/rust-pro/SKILL.md +45 -31
- package/workflows/powers/security-engineer/POWER.md +129 -0
- package/workflows/powers/security-engineer/SKILL.md +126 -0
- package/workflows/powers/seo-fundamentals/POWER.md +59 -102
- package/workflows/powers/seo-fundamentals/SKILL.md +59 -102
- package/workflows/powers/serverless-patterns/POWER.md +171 -0
- package/workflows/powers/serverless-patterns/SKILL.md +168 -0
- package/workflows/powers/skill-creator/POWER.md +90 -0
- package/workflows/powers/skill-creator/SKILL.md +87 -0
- package/workflows/powers/skill-creator/references/platform-formats.md +181 -0
- package/workflows/powers/skill-creator/references/schemas.md +430 -0
- package/workflows/powers/spec-miner/POWER.md +49 -57
- package/workflows/powers/spec-miner/SKILL.md +49 -57
- package/workflows/powers/sqlite/POWER.md +67 -0
- package/workflows/powers/sqlite/SKILL.md +64 -0
- package/workflows/powers/sqlite/references/sqlite-checklist.md +19 -0
- package/workflows/powers/sre-engineer/POWER.md +123 -64
- package/workflows/powers/sre-engineer/SKILL.md +123 -64
- package/workflows/powers/static-analysis/POWER.md +121 -77
- package/workflows/powers/static-analysis/SKILL.md +121 -77
- package/workflows/powers/stripe-best-practices/POWER.md +140 -17
- package/workflows/powers/stripe-best-practices/SKILL.md +139 -17
- package/workflows/powers/supabase/POWER.md +67 -0
- package/workflows/powers/supabase/SKILL.md +64 -0
- package/workflows/powers/supabase/references/supabase-checklist.md +19 -0
- package/workflows/powers/swift-pro/POWER.md +118 -0
- package/workflows/powers/swift-pro/SKILL.md +115 -0
- package/workflows/powers/swift-pro/references/concurrency-patterns.md +165 -0
- package/workflows/powers/swift-pro/references/protocol-and-generics.md +172 -0
- package/workflows/powers/swift-pro/references/sendable-and-isolation.md +116 -0
- package/workflows/powers/swift-pro/references/swift-concurrency-and-protocols.md +260 -0
- package/workflows/powers/swift-pro/references/testing-and-packages.md +192 -0
- package/workflows/powers/tailwind-patterns/POWER.md +71 -240
- package/workflows/powers/tailwind-patterns/SKILL.md +71 -240
- package/workflows/powers/testing-patterns/POWER.md +155 -10
- package/workflows/powers/testing-patterns/SKILL.md +155 -10
- package/workflows/powers/typescript-pro/POWER.md +47 -38
- package/workflows/powers/typescript-pro/SKILL.md +47 -38
- package/workflows/powers/vitess/POWER.md +67 -0
- package/workflows/powers/vitess/SKILL.md +64 -0
- package/workflows/powers/vitess/references/vitess-checklist.md +19 -0
- package/workflows/powers/vulnerability-scanner/POWER.md +146 -10
- package/workflows/powers/vulnerability-scanner/SKILL.md +146 -10
- package/workflows/powers/web-perf/POWER.md +43 -170
- package/workflows/powers/web-perf/SKILL.md +43 -170
- package/workflows/powers/webapp-testing/POWER.md +43 -164
- package/workflows/powers/webapp-testing/SKILL.md +43 -164
|
@@ -1,21 +1,166 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: testing-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: Design test strategies with unit, integration, and e2e testing. Apply TDD, mocking, fixtures, coverage analysis, and test architecture best practices.
|
|
4
|
+
license: Apache-2.0
|
|
4
5
|
metadata:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
author: cubis-foundry
|
|
7
|
+
version: "3.0"
|
|
8
|
+
compatibility: Claude Code, Codex, GitHub Copilot, Gemini CLI
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
# Testing Patterns
|
|
11
12
|
|
|
12
|
-
##
|
|
13
|
+
## Purpose
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
Guide test strategy, structure, and implementation across all testing levels. Covers unit, integration, and e2e testing patterns, TDD methodology, mocking strategies, and test architecture.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
## When to Use
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
- Writing tests for new features or bug fixes
|
|
20
|
+
- Designing a test strategy for a new project or module
|
|
21
|
+
- Debugging flaky or slow tests
|
|
22
|
+
- Reviewing test quality and coverage gaps
|
|
23
|
+
- Setting up test infrastructure (runners, fixtures, mocks)
|
|
24
|
+
- Deciding what level of testing is appropriate
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
## Instructions
|
|
27
|
+
|
|
28
|
+
### Step 1 — Choose the Right Test Level
|
|
29
|
+
|
|
30
|
+
| Level | Tests | Speed | Confidence | When to Use |
|
|
31
|
+
| ----------- | ---------------------------- | -------- | ---------------------------- | -------------------------------------------------- |
|
|
32
|
+
| Unit | Individual functions/classes | ms | Logic correctness | Pure logic, calculations, transformers |
|
|
33
|
+
| Integration | Module boundaries | 100ms–1s | Components work together | API routes, database queries, service interactions |
|
|
34
|
+
| E2E | Full user flows | 5–30s | System works as user expects | Critical paths (signup, checkout, deploy) |
|
|
35
|
+
|
|
36
|
+
**Testing Trophy** (preferred distribution):
|
|
37
|
+
|
|
38
|
+
- Many integration tests (highest ROI)
|
|
39
|
+
- Some unit tests (fast logic verification)
|
|
40
|
+
- Few e2e tests (critical paths only)
|
|
41
|
+
- Static analysis as the foundation (TypeScript, linting)
|
|
42
|
+
|
|
43
|
+
### Step 2 — Write Effective Tests
|
|
44
|
+
|
|
45
|
+
**Structure every test as Arrange → Act → Assert**:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
test("calculates total with tax", () => {
|
|
49
|
+
// Arrange
|
|
50
|
+
const items = [{ price: 100 }, { price: 200 }];
|
|
51
|
+
const taxRate = 0.1;
|
|
52
|
+
|
|
53
|
+
// Act
|
|
54
|
+
const total = calculateTotal(items, taxRate);
|
|
55
|
+
|
|
56
|
+
// Assert
|
|
57
|
+
expect(total).toBe(330);
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Naming**: Use natural language that describes the behavior:
|
|
62
|
+
|
|
63
|
+
- DO: `"returns empty array when no items match filter"`
|
|
64
|
+
- DON'T: `"test filter"` or `"test1"`
|
|
65
|
+
|
|
66
|
+
**One assertion per behavior** (not per test):
|
|
67
|
+
|
|
68
|
+
- One test can have multiple `expect()` calls if they verify the same behavior
|
|
69
|
+
- Split separate behaviors into separate tests
|
|
70
|
+
|
|
71
|
+
### Step 3 — Mock Strategically
|
|
72
|
+
|
|
73
|
+
**Mock at boundaries, not everywhere**:
|
|
74
|
+
|
|
75
|
+
- Mock: external APIs, databases, file system, time, randomness
|
|
76
|
+
- Don't mock: your own code, simple utilities, data transformations
|
|
77
|
+
|
|
78
|
+
**Mock patterns**:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
// Dependency injection (preferred)
|
|
82
|
+
function createUserService(db: Database) {
|
|
83
|
+
return { getUser: (id) => db.query("SELECT...", [id]) };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Module mocking (when DI not available)
|
|
87
|
+
vi.mock("./database", () => ({
|
|
88
|
+
query: vi.fn().mockResolvedValue([{ id: 1, name: "Alice" }]),
|
|
89
|
+
}));
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Avoid**:
|
|
93
|
+
|
|
94
|
+
- Mocking implementation details (private methods, internal state)
|
|
95
|
+
- Over-mocking (if you mock everything, you're testing nothing)
|
|
96
|
+
- Snapshot tests for behavior (only for serialized output like HTML)
|
|
97
|
+
|
|
98
|
+
### Step 4 — Handle Test Data
|
|
99
|
+
|
|
100
|
+
**Factories over fixtures**:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
function createUser(overrides = {}) {
|
|
104
|
+
return {
|
|
105
|
+
id: crypto.randomUUID(),
|
|
106
|
+
name: "Test User",
|
|
107
|
+
email: "test@example.com",
|
|
108
|
+
role: "user",
|
|
109
|
+
...overrides,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Usage
|
|
114
|
+
const admin = createUser({ role: "admin" });
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Test isolation**:
|
|
118
|
+
|
|
119
|
+
- Each test creates its own data (no shared mutable state)
|
|
120
|
+
- Clean up after integration tests (database, files)
|
|
121
|
+
- Use transactions for database tests (rollback after each test)
|
|
122
|
+
|
|
123
|
+
### Step 5 — Fix Common Test Problems
|
|
124
|
+
|
|
125
|
+
**Flaky tests**:
|
|
126
|
+
|
|
127
|
+
- Remove timing dependencies (`setTimeout`, `sleep`)
|
|
128
|
+
- Use deterministic data (no `Math.random()` without seeding)
|
|
129
|
+
- Await all async operations properly
|
|
130
|
+
- Isolate external dependencies (mock network, use test databases)
|
|
131
|
+
|
|
132
|
+
**Slow tests**:
|
|
133
|
+
|
|
134
|
+
- Run in parallel when tests are isolated
|
|
135
|
+
- Use in-memory databases for integration tests
|
|
136
|
+
- Minimize e2e tests — push logic down to unit/integration
|
|
137
|
+
- Profile and fix the slowest 10% first
|
|
138
|
+
|
|
139
|
+
**Brittle tests**:
|
|
140
|
+
|
|
141
|
+
- Test behavior, not implementation
|
|
142
|
+
- Use accessible queries in UI tests (role, label — not CSS selectors)
|
|
143
|
+
- Avoid testing framework internals
|
|
144
|
+
|
|
145
|
+
## Output Format
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
## Test Strategy
|
|
149
|
+
[approach and reasoning for test level choices]
|
|
150
|
+
|
|
151
|
+
## Tests
|
|
152
|
+
[test code organized by describe blocks]
|
|
153
|
+
|
|
154
|
+
## Coverage Notes
|
|
155
|
+
[what's tested, what's intentionally not tested, and why]
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Examples
|
|
159
|
+
|
|
160
|
+
**User**: "Write tests for this user registration function"
|
|
161
|
+
|
|
162
|
+
**Response approach**: Unit tests for validation logic (email format, password strength). Integration test for the full registration flow (validate → hash password → insert DB → send email). Mock the email service and database. Test edge cases (duplicate email, weak password, missing fields).
|
|
163
|
+
|
|
164
|
+
**User**: "Our test suite takes 20 minutes, help us speed it up"
|
|
165
|
+
|
|
166
|
+
**Response approach**: Profile the slowest tests. Look for unnecessary e2e tests that could be integration. Check for missing parallelization. Identify shared state causing serial execution. Suggest in-memory database for integration tests.
|
|
@@ -1,63 +1,72 @@
|
|
|
1
1
|
````markdown
|
|
2
2
|
---
|
|
3
3
|
inclusion: manual
|
|
4
|
-
name:
|
|
5
|
-
description: "Use for TypeScript architecture and implementation with TS 5.9+ production baselines and TS 6/7 transition readiness."
|
|
4
|
+
name: typescript-pro
|
|
5
|
+
description: "Use for TypeScript architecture and implementation with TS 5.9+ production baselines and TS 6/7 transition readiness. Use when designing type-safe APIs, refactoring to strict TypeScript, reducing type regressions in monorepos, or preparing for TS 6/7 behavior shifts."
|
|
6
6
|
license: MIT
|
|
7
7
|
metadata:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
stack: "typescript"
|
|
12
|
-
baseline: "TypeScript 5.9 stable"
|
|
13
|
-
transition: "TypeScript 6 compatibility prep"
|
|
8
|
+
author: cubis-foundry
|
|
9
|
+
version: "3.0"
|
|
10
|
+
compatibility: Claude Code, Codex, GitHub Copilot
|
|
14
11
|
---
|
|
15
12
|
|
|
16
13
|
# TypeScript Pro
|
|
17
14
|
|
|
18
|
-
##
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Language-layer specialist for TypeScript architecture, type design, and production implementation. Provides the type-system foundation before loading framework skills like `nextjs-developer` or `nestjs-expert`. Covers strict compiler configuration, domain modeling with discriminated unions, generic patterns, module structure, and tooling selection for TS 5.9+ codebases with awareness of TS 6/7 transitions.
|
|
18
|
+
|
|
19
|
+
## When to Use
|
|
19
20
|
|
|
20
21
|
- Designing type-safe APIs and shared contracts.
|
|
21
22
|
- Refactoring codebases to strict TypeScript.
|
|
22
23
|
- Reducing type regressions in monorepos.
|
|
23
24
|
- Preparing for upcoming TS 6/7 behavior shifts.
|
|
25
|
+
- Acting as the language-layer foundation before loading framework skills.
|
|
24
26
|
|
|
25
|
-
##
|
|
27
|
+
## Instructions
|
|
26
28
|
|
|
27
|
-
1. Confirm runtime and module target (Node, browser, edge).
|
|
28
|
-
2. Lock strict compiler baseline before feature work
|
|
29
|
-
3. Model domain types first
|
|
30
|
-
4.
|
|
31
|
-
5.
|
|
29
|
+
1. Confirm runtime and module target (Node, browser, edge) because compiler settings and polyfill requirements differ.
|
|
30
|
+
2. Lock strict compiler baseline (`strict: true`) before feature work because weak defaults hide implicit `any`.
|
|
31
|
+
3. Model domain types first with discriminated unions and `satisfies`/`as const`, then implement behavior — type design is the primary design feedback loop.
|
|
32
|
+
4. Use `unknown` over `any` at boundaries because `any` silently defeats type checking.
|
|
33
|
+
5. Narrow with type guards (`x is T`) instead of `as` assertions because guards provide runtime safety while assertions only silence the compiler.
|
|
34
|
+
6. Encode state machines with discriminated unions and exhaustive `switch`/`assertNever` checks because unhandled variants become compile errors.
|
|
35
|
+
7. Use schema validation (Zod/Valibot) for external input because runtime validation must match declared types at system boundaries.
|
|
36
|
+
8. Keep public API types stable and explicit — do not rely on inferred return types for exported functions.
|
|
37
|
+
9. Use project references (`composite: true` + `references`) for large repos because they enable incremental builds and cross-package type awareness.
|
|
38
|
+
10. Keep barrel exports (`index.ts`) thin — re-export only the public API because deep barrels cause circular dependency pain and slow IDE resolution.
|
|
39
|
+
11. Use `import type` for type-only imports because it prevents runtime import of type-only modules and improves tree-shaking.
|
|
40
|
+
12. Use constrained generics to express input/output relationships — do not exceed 3 type parameters without splitting the abstraction.
|
|
41
|
+
13. Prefer mapped types and template literal types for systematic type transformations — extract complex conditional types into named types for readability.
|
|
42
|
+
14. Run `tsc --noEmit` in CI separately from bundling because type errors should fail CI even when the bundler succeeds.
|
|
43
|
+
15. Use Biome or ESLint + `typescript-eslint` for linting; `tsup` for library builds; Vitest for tests with native TS support.
|
|
44
|
+
16. Do not use library-facing `any` — it poisons downstream callers.
|
|
45
|
+
17. Do not use broad `as` casts to silence errors — treat type errors as design feedback, not noise.
|
|
46
|
+
18. Do not mix runtime and type-only imports carelessly — use `import type` consistently.
|
|
32
47
|
|
|
33
|
-
##
|
|
48
|
+
## Output Format
|
|
34
49
|
|
|
35
|
-
|
|
36
|
-
- Prefer `unknown` over `any` at boundaries.
|
|
37
|
-
- Use `satisfies` and `as const` for safer inference.
|
|
38
|
-
- Keep public API types stable and explicit.
|
|
39
|
-
- Use project references for large repos.
|
|
50
|
+
Provide type definitions, implementation code, and compiler configuration as fenced TypeScript code blocks. Include `tsconfig.json` excerpts when configuration changes are part of the solution. Explain type-level design decisions inline with brief comments.
|
|
40
51
|
|
|
41
|
-
##
|
|
52
|
+
## References
|
|
42
53
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
54
|
+
| File | Load when |
|
|
55
|
+
| ------------------------------ | ---------------------------------------------------------------------------- |
|
|
56
|
+
| `references/configuration.md` | `tsconfig`, strictness, module targets, or project references need detail. |
|
|
57
|
+
| `references/advanced-types.md` | Generics, conditional types, mapped types, or template literals are central. |
|
|
58
|
+
| `references/type-guards.md` | Narrowing and runtime-safe type refinement need detail. |
|
|
59
|
+
| `references/utility-types.md` | Utility-type composition or shared helper types are in scope. |
|
|
60
|
+
| `references/patterns.md` | Type-safe architecture patterns or public API design needs detail. |
|
|
48
61
|
|
|
49
|
-
##
|
|
62
|
+
## Scripts
|
|
50
63
|
|
|
51
|
-
|
|
52
|
-
- Broad `as` casts to silence errors.
|
|
53
|
-
- Hidden implicit `any` from weak tsconfig defaults.
|
|
54
|
-
- Mixing runtime and type-only imports carelessly.
|
|
64
|
+
No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
|
|
55
65
|
|
|
56
|
-
##
|
|
66
|
+
## Examples
|
|
57
67
|
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- `
|
|
62
|
-
- `references/patterns.md`
|
|
68
|
+
- "Refactor this module to use strict TypeScript with discriminated unions for state"
|
|
69
|
+
- "Design a type-safe event system with template literal types"
|
|
70
|
+
- "Set up tsconfig project references for our monorepo"
|
|
71
|
+
- "Replace these `any` casts with proper type narrowing"
|
|
63
72
|
````
|
|
@@ -1,60 +1,69 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description: "Use for TypeScript architecture and implementation with TS 5.9+ production baselines and TS 6/7 transition readiness."
|
|
2
|
+
name: typescript-pro
|
|
3
|
+
description: "Use for TypeScript architecture and implementation with TS 5.9+ production baselines and TS 6/7 transition readiness. Use when designing type-safe APIs, refactoring to strict TypeScript, reducing type regressions in monorepos, or preparing for TS 6/7 behavior shifts."
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
stack: "typescript"
|
|
10
|
-
baseline: "TypeScript 5.9 stable"
|
|
11
|
-
transition: "TypeScript 6 compatibility prep"
|
|
6
|
+
author: cubis-foundry
|
|
7
|
+
version: "3.0"
|
|
8
|
+
compatibility: Claude Code, Codex, GitHub Copilot
|
|
12
9
|
---
|
|
13
10
|
|
|
14
11
|
# TypeScript Pro
|
|
15
12
|
|
|
16
|
-
##
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
Language-layer specialist for TypeScript architecture, type design, and production implementation. Provides the type-system foundation before loading framework skills like `nextjs-developer` or `nestjs-expert`. Covers strict compiler configuration, domain modeling with discriminated unions, generic patterns, module structure, and tooling selection for TS 5.9+ codebases with awareness of TS 6/7 transitions.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
17
18
|
|
|
18
19
|
- Designing type-safe APIs and shared contracts.
|
|
19
20
|
- Refactoring codebases to strict TypeScript.
|
|
20
21
|
- Reducing type regressions in monorepos.
|
|
21
22
|
- Preparing for upcoming TS 6/7 behavior shifts.
|
|
23
|
+
- Acting as the language-layer foundation before loading framework skills.
|
|
22
24
|
|
|
23
|
-
##
|
|
25
|
+
## Instructions
|
|
24
26
|
|
|
25
|
-
1. Confirm runtime and module target (Node, browser, edge).
|
|
26
|
-
2. Lock strict compiler baseline before feature work
|
|
27
|
-
3. Model domain types first
|
|
28
|
-
4.
|
|
29
|
-
5.
|
|
27
|
+
1. Confirm runtime and module target (Node, browser, edge) because compiler settings and polyfill requirements differ.
|
|
28
|
+
2. Lock strict compiler baseline (`strict: true`) before feature work because weak defaults hide implicit `any`.
|
|
29
|
+
3. Model domain types first with discriminated unions and `satisfies`/`as const`, then implement behavior — type design is the primary design feedback loop.
|
|
30
|
+
4. Use `unknown` over `any` at boundaries because `any` silently defeats type checking.
|
|
31
|
+
5. Narrow with type guards (`x is T`) instead of `as` assertions because guards provide runtime safety while assertions only silence the compiler.
|
|
32
|
+
6. Encode state machines with discriminated unions and exhaustive `switch`/`assertNever` checks because unhandled variants become compile errors.
|
|
33
|
+
7. Use schema validation (Zod/Valibot) for external input because runtime validation must match declared types at system boundaries.
|
|
34
|
+
8. Keep public API types stable and explicit — do not rely on inferred return types for exported functions.
|
|
35
|
+
9. Use project references (`composite: true` + `references`) for large repos because they enable incremental builds and cross-package type awareness.
|
|
36
|
+
10. Keep barrel exports (`index.ts`) thin — re-export only the public API because deep barrels cause circular dependency pain and slow IDE resolution.
|
|
37
|
+
11. Use `import type` for type-only imports because it prevents runtime import of type-only modules and improves tree-shaking.
|
|
38
|
+
12. Use constrained generics to express input/output relationships — do not exceed 3 type parameters without splitting the abstraction.
|
|
39
|
+
13. Prefer mapped types and template literal types for systematic type transformations — extract complex conditional types into named types for readability.
|
|
40
|
+
14. Run `tsc --noEmit` in CI separately from bundling because type errors should fail CI even when the bundler succeeds.
|
|
41
|
+
15. Use Biome or ESLint + `typescript-eslint` for linting; `tsup` for library builds; Vitest for tests with native TS support.
|
|
42
|
+
16. Do not use library-facing `any` — it poisons downstream callers.
|
|
43
|
+
17. Do not use broad `as` casts to silence errors — treat type errors as design feedback, not noise.
|
|
44
|
+
18. Do not mix runtime and type-only imports carelessly — use `import type` consistently.
|
|
30
45
|
|
|
31
|
-
##
|
|
46
|
+
## Output Format
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
- Prefer `unknown` over `any` at boundaries.
|
|
35
|
-
- Use `satisfies` and `as const` for safer inference.
|
|
36
|
-
- Keep public API types stable and explicit.
|
|
37
|
-
- Use project references for large repos.
|
|
48
|
+
Provide type definitions, implementation code, and compiler configuration as fenced TypeScript code blocks. Include `tsconfig.json` excerpts when configuration changes are part of the solution. Explain type-level design decisions inline with brief comments.
|
|
38
49
|
|
|
39
|
-
##
|
|
50
|
+
## References
|
|
40
51
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
52
|
+
| File | Load when |
|
|
53
|
+
| ------------------------------ | ---------------------------------------------------------------------------- |
|
|
54
|
+
| `references/configuration.md` | `tsconfig`, strictness, module targets, or project references need detail. |
|
|
55
|
+
| `references/advanced-types.md` | Generics, conditional types, mapped types, or template literals are central. |
|
|
56
|
+
| `references/type-guards.md` | Narrowing and runtime-safe type refinement need detail. |
|
|
57
|
+
| `references/utility-types.md` | Utility-type composition or shared helper types are in scope. |
|
|
58
|
+
| `references/patterns.md` | Type-safe architecture patterns or public API design needs detail. |
|
|
46
59
|
|
|
47
|
-
##
|
|
60
|
+
## Scripts
|
|
48
61
|
|
|
49
|
-
|
|
50
|
-
- Broad `as` casts to silence errors.
|
|
51
|
-
- Hidden implicit `any` from weak tsconfig defaults.
|
|
52
|
-
- Mixing runtime and type-only imports carelessly.
|
|
62
|
+
No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
|
|
53
63
|
|
|
54
|
-
##
|
|
64
|
+
## Examples
|
|
55
65
|
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
- `
|
|
60
|
-
- `references/patterns.md`
|
|
66
|
+
- "Refactor this module to use strict TypeScript with discriminated unions for state"
|
|
67
|
+
- "Design a type-safe event system with template literal types"
|
|
68
|
+
- "Set up tsconfig project references for our monorepo"
|
|
69
|
+
- "Replace these `any` casts with proper type narrowing"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
````markdown
|
|
2
|
+
---
|
|
3
|
+
inclusion: manual
|
|
4
|
+
name: vitess
|
|
5
|
+
description: "Use when the task is specifically Vitess or Vitess-backed MySQL platforms: shard-key design, vindexes, resharding, query-routing constraints, Online DDL, and operational tradeoffs for horizontally scaled MySQL."
|
|
6
|
+
license: MIT
|
|
7
|
+
metadata:
|
|
8
|
+
author: cubis-foundry
|
|
9
|
+
version: "3.0"
|
|
10
|
+
compatibility: Claude Code, Codex, GitHub Copilot
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Vitess
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Use when the task is specifically Vitess or Vitess-backed MySQL platforms: shard-key design, vindexes, resharding, query-routing constraints, Online DDL, and operational tradeoffs for horizontally scaled MySQL.
|
|
18
|
+
|
|
19
|
+
## When to Use
|
|
20
|
+
|
|
21
|
+
- The engine is Vitess or a Vitess-backed managed MySQL platform.
|
|
22
|
+
- The problem depends on shard keys, vindexes, resharding, query routing, or Online DDL behavior.
|
|
23
|
+
- You need guidance for scaling MySQL horizontally rather than treating it like a single-node database.
|
|
24
|
+
|
|
25
|
+
## Instructions
|
|
26
|
+
|
|
27
|
+
1. Confirm whether the task is schema design, query shape, shard-key choice, or operational scaling.
|
|
28
|
+
2. Make entity ownership and routing key choice explicit before optimizing anything else.
|
|
29
|
+
3. Check whether queries respect shard boundaries and Vitess execution constraints.
|
|
30
|
+
4. Plan Online DDL, resharding, and rollback with operational evidence.
|
|
31
|
+
5. Report the coupling, fan-out, and migration risks that remain after the change.
|
|
32
|
+
|
|
33
|
+
### Baseline standards
|
|
34
|
+
|
|
35
|
+
- Choose shard keys from access patterns and ownership, not convenience.
|
|
36
|
+
- Minimize cross-shard fan-out and hidden coordination costs.
|
|
37
|
+
- Treat Online DDL and resharding as operational programs, not single commands.
|
|
38
|
+
- Keep query routing constraints visible to application teams.
|
|
39
|
+
|
|
40
|
+
### Constraints
|
|
41
|
+
|
|
42
|
+
- Avoid designing as if the database were a single-node MySQL instance.
|
|
43
|
+
- Avoid late shard-key decisions after application coupling hardens.
|
|
44
|
+
- Avoid cross-shard joins or transactions without explicit justification.
|
|
45
|
+
- Avoid treating Vitess complexity as free scale.
|
|
46
|
+
|
|
47
|
+
## Output Format
|
|
48
|
+
|
|
49
|
+
Provide implementation guidance, code examples, and configuration as appropriate to the task.
|
|
50
|
+
|
|
51
|
+
## References
|
|
52
|
+
|
|
53
|
+
Load on demand. Do not preload all reference files.
|
|
54
|
+
|
|
55
|
+
| File | Load when |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `references/vitess-checklist.md` | You need deeper Vitess guidance for shard keys, vindexes, query routing, resharding, and Online DDL tradeoffs. |
|
|
58
|
+
|
|
59
|
+
## Scripts
|
|
60
|
+
|
|
61
|
+
No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
|
|
62
|
+
|
|
63
|
+
## Examples
|
|
64
|
+
|
|
65
|
+
- "Help me with vitess best practices in this project"
|
|
66
|
+
- "Review my vitess implementation for issues"
|
|
67
|
+
````
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vitess
|
|
3
|
+
description: "Use when the task is specifically Vitess or Vitess-backed MySQL platforms: shard-key design, vindexes, resharding, query-routing constraints, Online DDL, and operational tradeoffs for horizontally scaled MySQL."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: cubis-foundry
|
|
7
|
+
version: "3.0"
|
|
8
|
+
compatibility: Claude Code, Codex, GitHub Copilot
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Vitess
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
Use when the task is specifically Vitess or Vitess-backed MySQL platforms: shard-key design, vindexes, resharding, query-routing constraints, Online DDL, and operational tradeoffs for horizontally scaled MySQL.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- The engine is Vitess or a Vitess-backed managed MySQL platform.
|
|
20
|
+
- The problem depends on shard keys, vindexes, resharding, query routing, or Online DDL behavior.
|
|
21
|
+
- You need guidance for scaling MySQL horizontally rather than treating it like a single-node database.
|
|
22
|
+
|
|
23
|
+
## Instructions
|
|
24
|
+
|
|
25
|
+
1. Confirm whether the task is schema design, query shape, shard-key choice, or operational scaling.
|
|
26
|
+
2. Make entity ownership and routing key choice explicit before optimizing anything else.
|
|
27
|
+
3. Check whether queries respect shard boundaries and Vitess execution constraints.
|
|
28
|
+
4. Plan Online DDL, resharding, and rollback with operational evidence.
|
|
29
|
+
5. Report the coupling, fan-out, and migration risks that remain after the change.
|
|
30
|
+
|
|
31
|
+
### Baseline standards
|
|
32
|
+
|
|
33
|
+
- Choose shard keys from access patterns and ownership, not convenience.
|
|
34
|
+
- Minimize cross-shard fan-out and hidden coordination costs.
|
|
35
|
+
- Treat Online DDL and resharding as operational programs, not single commands.
|
|
36
|
+
- Keep query routing constraints visible to application teams.
|
|
37
|
+
|
|
38
|
+
### Constraints
|
|
39
|
+
|
|
40
|
+
- Avoid designing as if the database were a single-node MySQL instance.
|
|
41
|
+
- Avoid late shard-key decisions after application coupling hardens.
|
|
42
|
+
- Avoid cross-shard joins or transactions without explicit justification.
|
|
43
|
+
- Avoid treating Vitess complexity as free scale.
|
|
44
|
+
|
|
45
|
+
## Output Format
|
|
46
|
+
|
|
47
|
+
Provide implementation guidance, code examples, and configuration as appropriate to the task.
|
|
48
|
+
|
|
49
|
+
## References
|
|
50
|
+
|
|
51
|
+
Load on demand. Do not preload all reference files.
|
|
52
|
+
|
|
53
|
+
| File | Load when |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `references/vitess-checklist.md` | You need deeper Vitess guidance for shard keys, vindexes, query routing, resharding, and Online DDL tradeoffs. |
|
|
56
|
+
|
|
57
|
+
## Scripts
|
|
58
|
+
|
|
59
|
+
No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
|
|
60
|
+
|
|
61
|
+
## Examples
|
|
62
|
+
|
|
63
|
+
- "Help me with vitess best practices in this project"
|
|
64
|
+
- "Review my vitess implementation for issues"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Vitess Checklist
|
|
2
|
+
|
|
3
|
+
Load this when sharded MySQL behavior is the real problem.
|
|
4
|
+
|
|
5
|
+
## Routing and ownership
|
|
6
|
+
|
|
7
|
+
- Choose shard keys from access patterns and ownership boundaries.
|
|
8
|
+
- Keep cross-shard fan-out visible and minimized.
|
|
9
|
+
- Treat vindexes as application-shaping decisions, not low-level detail.
|
|
10
|
+
|
|
11
|
+
## Query behavior
|
|
12
|
+
|
|
13
|
+
- Check whether queries respect shard routing constraints.
|
|
14
|
+
- Avoid assuming single-node MySQL semantics when the topology is distributed.
|
|
15
|
+
|
|
16
|
+
## Operations
|
|
17
|
+
|
|
18
|
+
- Make Online DDL, resharding, and rollback operationally explicit.
|
|
19
|
+
- Keep coupling and migration risk visible to application teams.
|