@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,87 +1,146 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sre-engineer
|
|
3
|
-
description:
|
|
4
|
-
license:
|
|
3
|
+
description: Apply site reliability engineering practices including SLOs, error budgets, capacity planning, chaos engineering, and incident management for production systems.
|
|
4
|
+
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
|
-
author:
|
|
7
|
-
version: "
|
|
8
|
-
|
|
9
|
-
triggers: SRE, site reliability, SLO, SLI, error budget, incident management, chaos engineering, toil reduction, on-call, MTTR
|
|
10
|
-
role: specialist
|
|
11
|
-
scope: implementation
|
|
12
|
-
output-format: code
|
|
13
|
-
related-skills: devops-engineer, cloud-architect, kubernetes-specialist
|
|
6
|
+
author: cubis-foundry
|
|
7
|
+
version: "3.0"
|
|
8
|
+
compatibility: Claude Code, Codex, GitHub Copilot, Gemini CLI
|
|
14
9
|
---
|
|
15
10
|
|
|
16
11
|
# SRE Engineer
|
|
17
12
|
|
|
18
|
-
|
|
13
|
+
## Purpose
|
|
19
14
|
|
|
20
|
-
|
|
15
|
+
Apply Site Reliability Engineering practices to build and maintain reliable production systems. Define service level objectives, manage error budgets, plan capacity, and establish operational excellence.
|
|
21
16
|
|
|
22
|
-
|
|
17
|
+
## When to Use
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
- Defining SLOs, SLIs, and SLAs for a new or existing service
|
|
20
|
+
- Managing error budgets and reliability trade-offs
|
|
21
|
+
- Capacity planning and scaling decisions
|
|
22
|
+
- Designing for graceful degradation and resilience
|
|
23
|
+
- Conducting chaos engineering experiments
|
|
24
|
+
- Building on-call procedures and runbooks
|
|
25
|
+
- Postmortem analysis and reliability improvements
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
- Implementing reliability monitoring and alerting
|
|
28
|
-
- Reducing operational toil through automation
|
|
29
|
-
- Designing chaos engineering experiments
|
|
30
|
-
- Managing incidents and postmortems
|
|
31
|
-
- Building capacity planning models
|
|
32
|
-
- Establishing on-call practices
|
|
27
|
+
## Instructions
|
|
33
28
|
|
|
34
|
-
|
|
29
|
+
### Step 1 — Define Service Level Indicators (SLIs)
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
2. **Define SLOs** - Identify meaningful SLIs and set appropriate targets
|
|
38
|
-
3. **Implement monitoring** - Build golden signal dashboards and alerting
|
|
39
|
-
4. **Automate toil** - Identify repetitive tasks and build automation
|
|
40
|
-
5. **Test resilience** - Design and execute chaos experiments
|
|
31
|
+
SLIs are the metrics that matter to users:
|
|
41
32
|
|
|
42
|
-
|
|
33
|
+
| SLI Category | Measures | Example |
|
|
34
|
+
| ------------ | ------------------------------- | ---------------------------------------- |
|
|
35
|
+
| Availability | System is accepting requests | Successful requests / total requests |
|
|
36
|
+
| Latency | Response time for good requests | p99 < 300ms |
|
|
37
|
+
| Throughput | System handles expected load | Requests/sec at peak without degradation |
|
|
38
|
+
| Correctness | Responses are accurate | Successful data validations / total |
|
|
39
|
+
| Freshness | Data is up to date | Time since last successful sync < 1 min |
|
|
43
40
|
|
|
44
|
-
|
|
41
|
+
**Choose 3–5 SLIs per service** — too many dilutes focus.
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|-------|-----------|-----------|
|
|
48
|
-
| SLO/SLI | `references/slo-sli-management.md` | Defining SLOs, calculating error budgets |
|
|
49
|
-
| Error Budgets | `references/error-budget-policy.md` | Managing budgets, burn rates, policies |
|
|
50
|
-
| Monitoring | `references/monitoring-alerting.md` | Golden signals, alert design, dashboards |
|
|
51
|
-
| Automation | `references/automation-toil.md` | Toil reduction, automation patterns |
|
|
52
|
-
| Incidents | `references/incident-chaos.md` | Incident response, chaos engineering |
|
|
43
|
+
### Step 2 — Set Service Level Objectives (SLOs)
|
|
53
44
|
|
|
54
|
-
|
|
45
|
+
SLOs are targets for SLIs:
|
|
55
46
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- Write blameless postmortems for all incidents
|
|
61
|
-
- Measure toil and track reduction progress
|
|
62
|
-
- Automate repetitive operational tasks
|
|
63
|
-
- Test failure scenarios with chaos engineering
|
|
64
|
-
- Balance reliability with feature velocity
|
|
47
|
+
```
|
|
48
|
+
Availability SLO: 99.9% of requests succeed (43.8 min downtime/month)
|
|
49
|
+
Latency SLO: 99% of requests complete in < 200ms
|
|
50
|
+
```
|
|
65
51
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- Ignore error budget exhaustion
|
|
74
|
-
- Build systems that can't degrade gracefully
|
|
52
|
+
**SLO calibration**:
|
|
53
|
+
| Target | Monthly Downtime | Error Budget |
|
|
54
|
+
|--------|-----------------|--------------|
|
|
55
|
+
| 99.0% | 7.3 hours | 1% of requests can fail |
|
|
56
|
+
| 99.9% | 43.8 minutes | 0.1% of requests can fail |
|
|
57
|
+
| 99.95% | 21.9 minutes | 0.05% of requests can fail |
|
|
58
|
+
| 99.99% | 4.3 minutes | 0.01% of requests can fail |
|
|
75
59
|
|
|
76
|
-
|
|
60
|
+
**Rules**:
|
|
77
61
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
4. Runbooks with clear remediation steps
|
|
83
|
-
5. Brief explanation of reliability impact
|
|
62
|
+
- SLO must be achievable with current architecture
|
|
63
|
+
- SLO must be measurable with existing instrumentation
|
|
64
|
+
- SLO should be tighter than the SLA (contract with users)
|
|
65
|
+
- Start conservative, tighten as reliability improves
|
|
84
66
|
|
|
85
|
-
|
|
67
|
+
### Step 3 — Manage Error Budgets
|
|
86
68
|
|
|
87
|
-
|
|
69
|
+
Error budget = 100% − SLO target
|
|
70
|
+
|
|
71
|
+
**When budget is healthy** (> 50% remaining):
|
|
72
|
+
|
|
73
|
+
- Ship features aggressively
|
|
74
|
+
- Run chaos experiments
|
|
75
|
+
- Take on technical debt reduction
|
|
76
|
+
|
|
77
|
+
**When budget is burning** (< 25% remaining):
|
|
78
|
+
|
|
79
|
+
- Slow down feature releases
|
|
80
|
+
- Prioritize reliability work
|
|
81
|
+
- Increase review rigor
|
|
82
|
+
|
|
83
|
+
**When budget is exhausted** (0%):
|
|
84
|
+
|
|
85
|
+
- Freeze non-critical changes
|
|
86
|
+
- All engineering effort on reliability
|
|
87
|
+
- Root cause analysis on budget-burning incidents
|
|
88
|
+
|
|
89
|
+
### Step 4 — Design for Resilience
|
|
90
|
+
|
|
91
|
+
**Failure modes and mitigations**:
|
|
92
|
+
|
|
93
|
+
| Failure | Mitigation |
|
|
94
|
+
| --------------------- | ------------------------------------------------------- |
|
|
95
|
+
| Single instance crash | Multiple replicas, health checks, auto-restart |
|
|
96
|
+
| Dependency timeout | Circuit breakers, timeouts, fallback responses |
|
|
97
|
+
| Traffic spike | Auto-scaling, rate limiting, load shedding |
|
|
98
|
+
| Data center outage | Multi-region deployment, DNS failover |
|
|
99
|
+
| Data corruption | Immutable audit logs, point-in-time recovery, checksums |
|
|
100
|
+
| Cascading failure | Bulkheads, retry budgets, backpressure |
|
|
101
|
+
|
|
102
|
+
**Graceful degradation**:
|
|
103
|
+
|
|
104
|
+
- Serve cached/stale data when the database is slow
|
|
105
|
+
- Disable non-critical features under load
|
|
106
|
+
- Return partial results instead of failing completely
|
|
107
|
+
- Queue work for later processing when at capacity
|
|
108
|
+
|
|
109
|
+
### Step 5 — Operational Readiness
|
|
110
|
+
|
|
111
|
+
**Production readiness checklist**:
|
|
112
|
+
|
|
113
|
+
- [ ] SLOs defined and dashboarded
|
|
114
|
+
- [ ] Alerting on SLO burn rate (not just raw metrics)
|
|
115
|
+
- [ ] Runbooks for every alert
|
|
116
|
+
- [ ] On-call rotation established
|
|
117
|
+
- [ ] Rollback procedure documented and tested
|
|
118
|
+
- [ ] Disaster recovery plan tested within last quarter
|
|
119
|
+
- [ ] Dependency failures handled (circuit breakers, timeouts)
|
|
120
|
+
- [ ] Load testing performed at 2x expected peak
|
|
121
|
+
|
|
122
|
+
## Output Format
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
## Reliability Assessment
|
|
126
|
+
[current state and risk level]
|
|
127
|
+
|
|
128
|
+
## SLO Definitions
|
|
129
|
+
[SLI → SLO mappings with error budgets]
|
|
130
|
+
|
|
131
|
+
## Recommendations
|
|
132
|
+
[priority-ordered reliability improvements]
|
|
133
|
+
|
|
134
|
+
## Operational Procedures
|
|
135
|
+
[runbooks, on-call procedures, escalation paths]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Examples
|
|
139
|
+
|
|
140
|
+
**User**: "Define SLOs for our payment processing API"
|
|
141
|
+
|
|
142
|
+
**Response approach**: High-reliability target (99.99% availability for financial operations). SLIs: availability, latency (p99 < 500ms), correctness (transaction accuracy). Error budget: 4.3 min/month. Alerting on 1-hour burn rate. Circuit breaker on downstream payment provider.
|
|
143
|
+
|
|
144
|
+
**User**: "Our service keeps going down during traffic spikes"
|
|
145
|
+
|
|
146
|
+
**Response approach**: Analyze the failure mode (OOM? connection pool exhaustion? cold starts?). Recommend auto-scaling with pre-warming, rate limiting per client, load shedding for non-critical endpoints. Define SLO for acceptable degradation under load.
|
|
@@ -2,115 +2,159 @@
|
|
|
2
2
|
---
|
|
3
3
|
inclusion: manual
|
|
4
4
|
name: static-analysis
|
|
5
|
-
description:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Grep
|
|
12
|
-
- AskUserQuestion
|
|
13
|
-
- Task
|
|
14
|
-
- TaskCreate
|
|
15
|
-
- TaskList
|
|
16
|
-
- TaskUpdate
|
|
5
|
+
description: Configure and use static analysis tools including linters, formatters, type checkers, and custom rules to enforce code quality and consistency.
|
|
6
|
+
license: Apache-2.0
|
|
7
|
+
metadata:
|
|
8
|
+
author: cubis-foundry
|
|
9
|
+
version: "3.0"
|
|
10
|
+
compatibility: Claude Code, Codex, GitHub Copilot, Gemini CLI
|
|
17
11
|
---
|
|
18
12
|
|
|
19
|
-
#
|
|
13
|
+
# Static Analysis
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
## Purpose
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
Guide the setup and use of static analysis tools — linters, formatters, type checkers, and custom rules — to catch bugs early, enforce conventions, and maintain code quality automatically.
|
|
24
18
|
|
|
25
|
-
##
|
|
19
|
+
## When to Use
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
- Setting up linting and formatting for a new project
|
|
22
|
+
- Configuring ESLint, Prettier, Biome, or equivalent tools
|
|
23
|
+
- Writing custom lint rules for team conventions
|
|
24
|
+
- Fixing lint errors or understanding why a rule exists
|
|
25
|
+
- Integrating static analysis into CI/CD
|
|
26
|
+
- Choosing between competing tools
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
# 1. Verify CodeQL is installed
|
|
31
|
-
command -v codeql >/dev/null 2>&1 && codeql --version || echo "NOT INSTALLED"
|
|
28
|
+
## Instructions
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
ls -dt codeql_*.db 2>/dev/null | head -1
|
|
35
|
-
```
|
|
30
|
+
### Step 1 — Choose the Right Tools
|
|
36
31
|
|
|
37
|
-
|
|
32
|
+
| Language | Linter | Formatter | Type Checker |
|
|
33
|
+
| ------------- | ------------- | --------------- | ------------------ |
|
|
34
|
+
| TypeScript/JS | ESLint, Biome | Prettier, Biome | TypeScript (`tsc`) |
|
|
35
|
+
| Python | Ruff, Flake8 | Black, Ruff | mypy, pyright |
|
|
36
|
+
| Go | golangci-lint | gofmt | Go compiler |
|
|
37
|
+
| Rust | Clippy | rustfmt | Rust compiler |
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
**Recommended approach**:
|
|
40
40
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
- Performing comprehensive security audits with multiple query packs
|
|
41
|
+
- Biome for TypeScript/JS projects (replaces ESLint + Prettier, faster)
|
|
42
|
+
- Ruff for Python (replaces Flake8 + Black + isort, faster)
|
|
43
|
+
- Use the language's official formatter when available
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
### Step 2 — Configure Incrementally
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
- **CI/CD integration** - Use GitHub Actions documentation directly
|
|
50
|
-
- **Quick pattern searches** - Use Semgrep or grep for speed
|
|
51
|
-
- **No build capability** for compiled languages - Consider Semgrep instead
|
|
52
|
-
- **Single-file or lightweight analysis** - Semgrep is faster for simple pattern matching
|
|
47
|
+
**Start strict, relax as needed**:
|
|
53
48
|
|
|
54
|
-
|
|
49
|
+
1. Start with recommended preset (`"extends": ["recommended"]`)
|
|
50
|
+
2. Enable formatting rules (consistent style, no debates)
|
|
51
|
+
3. Enable correctness rules (actual bugs: unused vars, unreachable code)
|
|
52
|
+
4. Enable performance rules (avoidable perf issues)
|
|
53
|
+
5. Add custom rules specific to your team after the baseline is stable
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
**Don't**:
|
|
57
56
|
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- **"build-mode=none is fine for compiled languages"** - It produces severely incomplete analysis. No interprocedural data flow through compiled code is traced. Only use as an absolute last resort and clearly flag the limitation.
|
|
62
|
-
- **"No findings means the code is secure"** - Zero findings can indicate poor database quality, missing models, or wrong query packs. Investigate before reporting clean results.
|
|
63
|
-
- **"I'll just run the default suite"** - The default suite varies by how CodeQL is invoked. Always explicitly specify the suite (e.g., `security-extended`) so results are reproducible.
|
|
57
|
+
- Enable everything at once on an existing codebase
|
|
58
|
+
- Disable rules because they're "annoying" without understanding them
|
|
59
|
+
- Use `// eslint-disable` without a comment explaining why
|
|
64
60
|
|
|
65
|
-
|
|
61
|
+
### Step 3 — Key Rules by Category
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
**Correctness** (catch bugs):
|
|
68
64
|
|
|
69
|
-
|
|
65
|
+
- No unused variables/imports
|
|
66
|
+
- No unreachable code
|
|
67
|
+
- No implicit type coercion in comparisons
|
|
68
|
+
- No floating promises (unhandled async)
|
|
69
|
+
- No shadowed variables in nested scopes
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|----------|---------|
|
|
73
|
-
| [build-database](workflows/build-database.md) | Create CodeQL database using 3 build methods in sequence |
|
|
74
|
-
| [create-data-extensions](workflows/create-data-extensions.md) | Detect or generate data extension models for project APIs |
|
|
75
|
-
| [run-analysis](workflows/run-analysis.md) | Select rulesets, execute queries, process results |
|
|
71
|
+
**Consistency** (enforce style):
|
|
76
72
|
|
|
73
|
+
- Consistent naming conventions (camelCase, PascalCase, SCREAMING_SNAKE)
|
|
74
|
+
- Consistent import ordering
|
|
75
|
+
- Consistent quote style and semicolons
|
|
76
|
+
- Consistent use of `const` vs `let`
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
**Security** (prevent vulnerabilities):
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
- No `eval()` or `Function()` constructor
|
|
81
|
+
- No `innerHTML` assignments (XSS risk)
|
|
82
|
+
- No hardcoded secrets or credentials
|
|
83
|
+
- No `any` type in TypeScript (use `unknown` for unknown types)
|
|
81
84
|
|
|
82
|
-
**
|
|
85
|
+
**Performance** (avoid waste):
|
|
83
86
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
- No unnecessary re-renders (React-specific)
|
|
88
|
+
- No synchronous file operations in async contexts
|
|
89
|
+
- No `console.log` in production code
|
|
90
|
+
|
|
91
|
+
### Step 4 — Integrate into Workflow
|
|
92
|
+
|
|
93
|
+
**Local development**:
|
|
94
|
+
|
|
95
|
+
- Editor integration (real-time feedback as you type)
|
|
96
|
+
- Format on save
|
|
97
|
+
- Pre-commit hook (lint-staged + husky or lefthook)
|
|
98
|
+
|
|
99
|
+
**CI/CD**:
|
|
100
|
+
|
|
101
|
+
- Run lint check on every PR
|
|
102
|
+
- Fail the build on lint errors (not warnings — fix or disable)
|
|
103
|
+
- Cache lint results between runs
|
|
93
104
|
|
|
94
|
-
|
|
95
|
-
|-----------|--------|
|
|
96
|
-
| No database exists | Execute build → extensions → analysis (full pipeline) |
|
|
97
|
-
| Database exists, no extensions | Execute extensions → analysis |
|
|
98
|
-
| Database exists, extensions exist | Ask user: run analysis on existing DB, or rebuild? |
|
|
99
|
-
| User says "just run analysis" or "skip extensions" | Run analysis only |
|
|
105
|
+
**Migration strategy** (existing codebase):
|
|
100
106
|
|
|
107
|
+
- Fix auto-fixable issues in one PR (formatting, import order)
|
|
108
|
+
- Enable new rules as warnings first, then promote to errors
|
|
109
|
+
- Fix rules incrementally by directory, not all at once
|
|
101
110
|
|
|
102
|
-
###
|
|
111
|
+
### Step 5 — Write Custom Rules
|
|
103
112
|
|
|
104
|
-
|
|
113
|
+
When team conventions aren't covered by existing rules:
|
|
105
114
|
|
|
115
|
+
**ESLint custom rule example** (no importing from internal paths):
|
|
116
|
+
|
|
117
|
+
```javascript
|
|
118
|
+
module.exports = {
|
|
119
|
+
meta: {
|
|
120
|
+
type: "problem",
|
|
121
|
+
messages: { noInternal: "Do not import from internal modules" },
|
|
122
|
+
},
|
|
123
|
+
create(context) {
|
|
124
|
+
return {
|
|
125
|
+
ImportDeclaration(node) {
|
|
126
|
+
if (node.source.value.includes("/internal/")) {
|
|
127
|
+
context.report({ node, messageId: "noInternal" });
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
};
|
|
106
133
|
```
|
|
107
|
-
I can help with CodeQL analysis. What would you like to do?
|
|
108
134
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
135
|
+
## Output Format
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
## Tool Configuration
|
|
139
|
+
[config files and settings]
|
|
140
|
+
|
|
141
|
+
## Rules Enabled
|
|
142
|
+
[categorized list of rules with rationale]
|
|
143
|
+
|
|
144
|
+
## CI Integration
|
|
145
|
+
[pipeline step definition]
|
|
113
146
|
|
|
114
|
-
|
|
147
|
+
## Migration Plan
|
|
148
|
+
[how to adopt incrementally on existing code]
|
|
115
149
|
```
|
|
150
|
+
|
|
151
|
+
## Examples
|
|
152
|
+
|
|
153
|
+
**User**: "Set up ESLint and Prettier for our TypeScript React project"
|
|
154
|
+
|
|
155
|
+
**Response approach**: Recommend Biome as modern alternative. If staying with ESLint: configure with typescript-eslint, eslint-plugin-react, prettier integration. Show config file, ignore patterns, and pre-commit hook setup.
|
|
156
|
+
|
|
157
|
+
**User**: "We have 5000 lint errors — how do we fix this?"
|
|
158
|
+
|
|
159
|
+
**Response approach**: Auto-fix formatting issues first (one big PR). Establish baseline with current errors suppressed. Enable rules as warnings. Fix incrementally by directory. Add CI check that blocks new violations.
|
|
116
160
|
````
|