@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
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
````markdown
|
|
2
|
+
---
|
|
3
|
+
inclusion: manual
|
|
4
|
+
name: auth-architect
|
|
5
|
+
description: "Use when designing or reviewing authentication and authorization for backend systems, including sessions, tokens, OAuth or OIDC, RBAC or ABAC, passkeys, service-to-service auth, and policy enforcement boundaries."
|
|
6
|
+
license: MIT
|
|
7
|
+
metadata:
|
|
8
|
+
author: cubis-foundry
|
|
9
|
+
version: "3.0"
|
|
10
|
+
compatibility: Claude Code, Codex, GitHub Copilot, Gemini CLI
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Auth Architect
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Use when designing or reviewing authentication and authorization for backend systems, including sessions, tokens, OAuth or OIDC, RBAC or ABAC, passkeys, service-to-service auth, and policy enforcement boundaries.
|
|
18
|
+
|
|
19
|
+
## When to Use
|
|
20
|
+
|
|
21
|
+
- Designing or reviewing login, session, token, and policy architecture.
|
|
22
|
+
- Choosing between session-based auth, JWTs, OAuth or OIDC, passkeys, or service credentials.
|
|
23
|
+
- Defining RBAC, ABAC, tenant isolation, or field-level authorization boundaries.
|
|
24
|
+
- Hardening auth flows in REST, GraphQL, NestJS, FastAPI, Node, or managed-platform backends.
|
|
25
|
+
|
|
26
|
+
## Instructions
|
|
27
|
+
|
|
28
|
+
1. Clarify actors, trust boundaries, clients, and the assets each flow protects.
|
|
29
|
+
2. Choose the credential and session model that fits the product and operational constraints.
|
|
30
|
+
3. Separate authentication, authorization, and audit responsibilities instead of blending them together.
|
|
31
|
+
4. Make token, session, policy, and recovery behavior explicit at service boundaries.
|
|
32
|
+
5. Verify revocation, rotation, least privilege, and failure behavior before shipping.
|
|
33
|
+
|
|
34
|
+
### Baseline standards
|
|
35
|
+
|
|
36
|
+
- Prefer server-owned sessions when revocation simplicity matters more than statelessness.
|
|
37
|
+
- Treat OAuth or OIDC as delegated identity plumbing, not a substitute for local authorization rules.
|
|
38
|
+
- Keep authorization policy close to the resource or resolver that owns the decision.
|
|
39
|
+
- Design service-to-service identity and secret rotation as first-class operational concerns.
|
|
40
|
+
- Make account recovery, MFA, and passkey fallback behavior explicit.
|
|
41
|
+
|
|
42
|
+
### Constraints
|
|
43
|
+
|
|
44
|
+
- Avoid mixing authentication and authorization into one vague middleware concept.
|
|
45
|
+
- Avoid issuing long-lived bearer tokens with no rotation or revocation story.
|
|
46
|
+
- Avoid duplicating policy rules across clients, gateways, and services with no clear owner.
|
|
47
|
+
- Avoid treating passkeys, sessions, or JWTs as universal defaults independent of product constraints.
|
|
48
|
+
|
|
49
|
+
## Output Format
|
|
50
|
+
|
|
51
|
+
Provide implementation guidance, code examples, and configuration as appropriate to the task.
|
|
52
|
+
|
|
53
|
+
## References
|
|
54
|
+
|
|
55
|
+
Load on demand. Do not preload all reference files.
|
|
56
|
+
|
|
57
|
+
| File | Load when |
|
|
58
|
+
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `references/session-token-policy-checklist.md` | You need a deeper checklist for session vs token choice, OAuth or OIDC, passkeys, tenant isolation, service auth, and policy enforcement boundaries. |
|
|
60
|
+
|
|
61
|
+
## Scripts
|
|
62
|
+
|
|
63
|
+
No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
|
|
64
|
+
|
|
65
|
+
## Examples
|
|
66
|
+
|
|
67
|
+
- "Help me with auth architect best practices in this project"
|
|
68
|
+
- "Review my auth architect implementation for issues"
|
|
69
|
+
````
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: auth-architect
|
|
3
|
+
description: "Use when designing or reviewing authentication and authorization for backend systems, including sessions, tokens, OAuth or OIDC, RBAC or ABAC, passkeys, service-to-service auth, and policy enforcement boundaries."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: cubis-foundry
|
|
7
|
+
version: "3.0"
|
|
8
|
+
compatibility: Claude Code, Codex, GitHub Copilot, Gemini CLI
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Auth Architect
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
Use when designing or reviewing authentication and authorization for backend systems, including sessions, tokens, OAuth or OIDC, RBAC or ABAC, passkeys, service-to-service auth, and policy enforcement boundaries.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- Designing or reviewing login, session, token, and policy architecture.
|
|
20
|
+
- Choosing between session-based auth, JWTs, OAuth or OIDC, passkeys, or service credentials.
|
|
21
|
+
- Defining RBAC, ABAC, tenant isolation, or field-level authorization boundaries.
|
|
22
|
+
- Hardening auth flows in REST, GraphQL, NestJS, FastAPI, Node, or managed-platform backends.
|
|
23
|
+
|
|
24
|
+
## Instructions
|
|
25
|
+
|
|
26
|
+
1. Clarify actors, trust boundaries, clients, and the assets each flow protects.
|
|
27
|
+
2. Choose the credential and session model that fits the product and operational constraints.
|
|
28
|
+
3. Separate authentication, authorization, and audit responsibilities instead of blending them together.
|
|
29
|
+
4. Make token, session, policy, and recovery behavior explicit at service boundaries.
|
|
30
|
+
5. Verify revocation, rotation, least privilege, and failure behavior before shipping.
|
|
31
|
+
|
|
32
|
+
### Baseline standards
|
|
33
|
+
|
|
34
|
+
- Prefer server-owned sessions when revocation simplicity matters more than statelessness.
|
|
35
|
+
- Treat OAuth or OIDC as delegated identity plumbing, not a substitute for local authorization rules.
|
|
36
|
+
- Keep authorization policy close to the resource or resolver that owns the decision.
|
|
37
|
+
- Design service-to-service identity and secret rotation as first-class operational concerns.
|
|
38
|
+
- Make account recovery, MFA, and passkey fallback behavior explicit.
|
|
39
|
+
|
|
40
|
+
### Constraints
|
|
41
|
+
|
|
42
|
+
- Avoid mixing authentication and authorization into one vague middleware concept.
|
|
43
|
+
- Avoid issuing long-lived bearer tokens with no rotation or revocation story.
|
|
44
|
+
- Avoid duplicating policy rules across clients, gateways, and services with no clear owner.
|
|
45
|
+
- Avoid treating passkeys, sessions, or JWTs as universal defaults independent of product constraints.
|
|
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/session-token-policy-checklist.md` | You need a deeper checklist for session vs token choice, OAuth or OIDC, passkeys, tenant isolation, service auth, and policy enforcement boundaries. |
|
|
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 auth architect best practices in this project"
|
|
66
|
+
- "Review my auth architect implementation for issues"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Session, Token, And Policy Checklist
|
|
2
|
+
|
|
3
|
+
Load this when auth work needs more depth than the root skill.
|
|
4
|
+
|
|
5
|
+
## Boundary and threat framing
|
|
6
|
+
|
|
7
|
+
- List actors, clients, trust boundaries, and the assets each flow protects.
|
|
8
|
+
- Decide where authentication ends and authorization begins.
|
|
9
|
+
- Make audit and incident-response requirements explicit for privileged flows.
|
|
10
|
+
|
|
11
|
+
## Session vs token choice
|
|
12
|
+
|
|
13
|
+
- Prefer server-owned sessions when revocation, rotation simplicity, or browser ergonomics matter most.
|
|
14
|
+
- Prefer short-lived access tokens plus refresh controls only when stateless distribution or delegated clients justify the complexity.
|
|
15
|
+
- Avoid bearer-token sprawl across browser, mobile, and service clients without separate threat assumptions.
|
|
16
|
+
|
|
17
|
+
## OAuth, OIDC, and delegated identity
|
|
18
|
+
|
|
19
|
+
- Use OAuth for delegated access and OIDC for identity; do not collapse them conceptually.
|
|
20
|
+
- Scope tokens narrowly and document token audience, issuer, and rotation behavior.
|
|
21
|
+
- Keep provider callbacks, consent, and account-linking behavior explicit.
|
|
22
|
+
|
|
23
|
+
## Authorization and policy
|
|
24
|
+
|
|
25
|
+
- Keep RBAC, ABAC, tenant boundaries, and field-level policy checks close to the owning service or resolver.
|
|
26
|
+
- Avoid duplicating policy logic in frontend code as the only enforcement layer.
|
|
27
|
+
- Make authorization failure semantics predictable and observable.
|
|
28
|
+
|
|
29
|
+
## Passkeys, MFA, and recovery
|
|
30
|
+
|
|
31
|
+
- Treat passkeys as a primary sign-in option where product fit exists, not just a marketing add-on.
|
|
32
|
+
- Make MFA enrollment, recovery, device loss, and fallback channels explicit.
|
|
33
|
+
- Keep recovery flows at least as hardened as the primary sign-in flow.
|
|
34
|
+
|
|
35
|
+
## Service-to-service auth
|
|
36
|
+
|
|
37
|
+
- Use dedicated service identities, narrow scopes, and explicit secret or key rotation.
|
|
38
|
+
- Keep human auth, machine auth, and webhook verification separate.
|
|
39
|
+
- Make internal trust assumptions visible instead of implied by network location.
|
|
40
|
+
|
|
41
|
+
## Operational safety
|
|
42
|
+
|
|
43
|
+
- Log auth decisions without leaking secrets or raw tokens.
|
|
44
|
+
- Verify revocation, logout, secret rotation, and key rollover behavior.
|
|
45
|
+
- Recheck caching, GraphQL field policy, and background-job privilege boundaries before finishing.
|
|
@@ -9,6 +9,7 @@ allowed-tools: Read, Glob, Grep
|
|
|
9
9
|
# Behavioral Modes - Adaptive AI Operating Modes
|
|
10
10
|
|
|
11
11
|
## Purpose
|
|
12
|
+
|
|
12
13
|
This skill defines distinct behavioral modes that optimize AI performance for specific tasks. Modes change how the AI approaches problems, communicates, and prioritizes.
|
|
13
14
|
|
|
14
15
|
---
|
|
@@ -20,6 +21,7 @@ This skill defines distinct behavioral modes that optimize AI performance for sp
|
|
|
20
21
|
**When to use:** Early project planning, feature ideation, architecture decisions
|
|
21
22
|
|
|
22
23
|
**Behavior:**
|
|
24
|
+
|
|
23
25
|
- Ask clarifying questions before assumptions
|
|
24
26
|
- Offer multiple alternatives (at least 3)
|
|
25
27
|
- Think divergently - explore unconventional solutions
|
|
@@ -27,6 +29,7 @@ This skill defines distinct behavioral modes that optimize AI performance for sp
|
|
|
27
29
|
- Use visual diagrams (mermaid) to explain concepts
|
|
28
30
|
|
|
29
31
|
**Output style:**
|
|
32
|
+
|
|
30
33
|
```
|
|
31
34
|
"Let's explore this together. Here are some approaches:
|
|
32
35
|
|
|
@@ -48,6 +51,7 @@ What resonates with you? Or should we explore a different direction?"
|
|
|
48
51
|
**When to use:** Writing code, building features, executing plans
|
|
49
52
|
|
|
50
53
|
**Behavior:**
|
|
54
|
+
|
|
51
55
|
- **CRITICAL: Use `clean-code` skill standards** - concise, direct, no verbose explanations
|
|
52
56
|
- Fast execution - minimize questions
|
|
53
57
|
- Use established patterns and best practices
|
|
@@ -59,6 +63,7 @@ What resonates with you? Or should we explore a different direction?"
|
|
|
59
63
|
- **NO RUSHING** - Quality > Speed. Read ALL references before coding.
|
|
60
64
|
|
|
61
65
|
**Output style:**
|
|
66
|
+
|
|
62
67
|
```
|
|
63
68
|
[Code block]
|
|
64
69
|
|
|
@@ -66,6 +71,7 @@ What resonates with you? Or should we explore a different direction?"
|
|
|
66
71
|
```
|
|
67
72
|
|
|
68
73
|
**NOT:**
|
|
74
|
+
|
|
69
75
|
```
|
|
70
76
|
"Building [feature]...
|
|
71
77
|
|
|
@@ -85,6 +91,7 @@ Run `npm run dev` to test."
|
|
|
85
91
|
**When to use:** Fixing bugs, troubleshooting errors, investigating issues
|
|
86
92
|
|
|
87
93
|
**Behavior:**
|
|
94
|
+
|
|
88
95
|
- Ask for error messages and reproduction steps
|
|
89
96
|
- Think systematically - check logs, trace data flow
|
|
90
97
|
- Form hypothesis → test → verify
|
|
@@ -92,6 +99,7 @@ Run `npm run dev` to test."
|
|
|
92
99
|
- Prevent future occurrences
|
|
93
100
|
|
|
94
101
|
**Output style:**
|
|
102
|
+
|
|
95
103
|
```
|
|
96
104
|
"Investigating...
|
|
97
105
|
|
|
@@ -108,6 +116,7 @@ Run `npm run dev` to test."
|
|
|
108
116
|
**When to use:** Code review, architecture review, security audit
|
|
109
117
|
|
|
110
118
|
**Behavior:**
|
|
119
|
+
|
|
111
120
|
- Be thorough but constructive
|
|
112
121
|
- Categorize by severity (Critical/High/Medium/Low)
|
|
113
122
|
- Explain the "why" behind suggestions
|
|
@@ -115,6 +124,7 @@ Run `npm run dev` to test."
|
|
|
115
124
|
- Acknowledge what's done well
|
|
116
125
|
|
|
117
126
|
**Output style:**
|
|
127
|
+
|
|
118
128
|
```
|
|
119
129
|
## Code Review: [file/feature]
|
|
120
130
|
|
|
@@ -135,6 +145,7 @@ Run `npm run dev` to test."
|
|
|
135
145
|
**When to use:** Explaining concepts, documentation, onboarding
|
|
136
146
|
|
|
137
147
|
**Behavior:**
|
|
148
|
+
|
|
138
149
|
- Explain from fundamentals
|
|
139
150
|
- Use analogies and examples
|
|
140
151
|
- Progress from simple to complex
|
|
@@ -142,6 +153,7 @@ Run `npm run dev` to test."
|
|
|
142
153
|
- Check understanding
|
|
143
154
|
|
|
144
155
|
**Output style:**
|
|
156
|
+
|
|
145
157
|
```
|
|
146
158
|
## Understanding [Concept]
|
|
147
159
|
|
|
@@ -165,6 +177,7 @@ Run `npm run dev` to test."
|
|
|
165
177
|
**When to use:** Production deployment, final polish, release preparation
|
|
166
178
|
|
|
167
179
|
**Behavior:**
|
|
180
|
+
|
|
168
181
|
- Focus on stability over features
|
|
169
182
|
- Check for missing error handling
|
|
170
183
|
- Verify environment configs
|
|
@@ -172,6 +185,7 @@ Run `npm run dev` to test."
|
|
|
172
185
|
- Create deployment checklist
|
|
173
186
|
|
|
174
187
|
**Output style:**
|
|
188
|
+
|
|
175
189
|
```
|
|
176
190
|
## Pre-Ship Checklist
|
|
177
191
|
|
|
@@ -197,35 +211,111 @@ Run `npm run dev` to test."
|
|
|
197
211
|
|
|
198
212
|
The AI should automatically detect the appropriate mode based on:
|
|
199
213
|
|
|
200
|
-
| Trigger
|
|
201
|
-
|
|
202
|
-
| "what if", "ideas", "options"
|
|
203
|
-
| "build", "create", "add"
|
|
204
|
-
| "not working", "error", "bug"
|
|
205
|
-
| "review", "check", "audit"
|
|
206
|
-
| "explain", "how does", "learn"
|
|
207
|
-
| "deploy", "release", "production"
|
|
214
|
+
| Trigger | Mode |
|
|
215
|
+
| ---------------------------------------------- | ------------------- |
|
|
216
|
+
| "what if", "ideas", "options" | BRAINSTORM |
|
|
217
|
+
| "build", "create", "add" | IMPLEMENT |
|
|
218
|
+
| "not working", "error", "bug" | DEBUG |
|
|
219
|
+
| "review", "check", "audit" | REVIEW |
|
|
220
|
+
| "explain", "how does", "learn" | TEACH |
|
|
221
|
+
| "deploy", "release", "production" | SHIP |
|
|
222
|
+
| "iterate", "refine quality", "not good enough" | EVALUATOR-OPTIMIZER |
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Workflow Patterns
|
|
227
|
+
|
|
228
|
+
Three patterns govern how modes combine across multiple agents or steps. Use the simplest pattern that solves the problem — add complexity only when it measurably improves results.
|
|
229
|
+
|
|
230
|
+
### 1. Sequential (default)
|
|
231
|
+
|
|
232
|
+
Use when tasks have dependencies — each step needs the previous step's output.
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
[BRAINSTORM] → [IMPLEMENT] → [REVIEW] → [SHIP]
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Best for: multi-stage features, draft-review-polish cycles, data pipelines.
|
|
239
|
+
|
|
240
|
+
### 2. Parallel
|
|
241
|
+
|
|
242
|
+
Use when tasks are independent and doing them one at a time is too slow.
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
[security REVIEW + performance REVIEW + quality REVIEW] → synthesize
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Best for: code review across multiple dimensions, parallel analysis. Requires a clear aggregation strategy before starting.
|
|
249
|
+
|
|
250
|
+
### 3. Evaluator-Optimizer (new)
|
|
251
|
+
|
|
252
|
+
Use when first-draft quality consistently falls short and quality is measurable.
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
[IMPLEMENT] → [REVIEW with criteria] → pass? → done
|
|
256
|
+
↓ fail
|
|
257
|
+
feedback → [IMPLEMENT again]
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**When to use:**
|
|
261
|
+
|
|
262
|
+
- Technical docs, customer communications, SQL queries against specific standards
|
|
263
|
+
- Any output where the gap between first attempt and required quality is significant
|
|
264
|
+
- When you have clear, checkable criteria (not just "make it better")
|
|
265
|
+
|
|
266
|
+
**When NOT to use:**
|
|
267
|
+
|
|
268
|
+
- First-attempt quality is already acceptable
|
|
269
|
+
- Criteria are too subjective for consistent AI evaluation
|
|
270
|
+
- Real-time use cases needing immediate responses
|
|
271
|
+
- Deterministic validators exist (linters, schema validators) — use those instead
|
|
272
|
+
|
|
273
|
+
**Implementation:**
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
## Generator
|
|
277
|
+
Task: [what to create]
|
|
278
|
+
Constraints: [specific, measurable requirements — these become eval criteria]
|
|
279
|
+
|
|
280
|
+
## Evaluator
|
|
281
|
+
Criteria:
|
|
282
|
+
1. [Criterion A] — Pass/Fail + specific failure note
|
|
283
|
+
2. [Criterion B] — Pass/Fail + specific failure note
|
|
284
|
+
|
|
285
|
+
Output JSON: { "pass": bool, "failures": ["..."], "revision_note": "..." }
|
|
286
|
+
|
|
287
|
+
Max iterations: 3 ← always set a ceiling
|
|
288
|
+
Stop when: all criteria pass OR max iterations reached
|
|
289
|
+
```
|
|
208
290
|
|
|
209
291
|
---
|
|
210
292
|
|
|
211
|
-
## Multi-Agent Collaboration Patterns
|
|
293
|
+
## Multi-Agent Collaboration Patterns
|
|
212
294
|
|
|
213
295
|
Modern architectures optimized for agent-to-agent collaboration:
|
|
214
296
|
|
|
215
297
|
### 1. 🔭 EXPLORE Mode
|
|
298
|
+
|
|
216
299
|
**Role:** Discovery and Analysis (Explorer Agent)
|
|
217
300
|
**Behavior:** Socratic questioning, deep-dive code reading, dependency mapping.
|
|
218
301
|
**Output:** `discovery-report.json`, architectural visualization.
|
|
219
302
|
|
|
220
303
|
### 2. 🗺️ PLAN-EXECUTE-CRITIC (PEC)
|
|
304
|
+
|
|
221
305
|
Cyclic mode transitions for high-complexity tasks:
|
|
306
|
+
|
|
222
307
|
1. **Planner:** Decomposes the task into atomic steps (`task.md`).
|
|
223
308
|
2. **Executor:** Performs the actual coding (`IMPLEMENT`).
|
|
224
309
|
3. **Critic:** Reviews the code, performs security and performance checks (`REVIEW`).
|
|
225
310
|
|
|
226
311
|
### 3. 🧠 MENTAL MODEL SYNC
|
|
312
|
+
|
|
227
313
|
Behavior for creating and loading "Mental Model" summaries to preserve context between sessions.
|
|
228
314
|
|
|
315
|
+
### 4. 🔄 EVALUATOR-OPTIMIZER
|
|
316
|
+
|
|
317
|
+
Paired agents in an iterative quality loop: Generator produces, Evaluator scores against criteria, Generator refines. Set max iteration ceiling before starting.
|
|
318
|
+
|
|
229
319
|
---
|
|
230
320
|
|
|
231
321
|
## Combining Modes
|
|
@@ -241,5 +331,6 @@ Users can explicitly request a mode:
|
|
|
241
331
|
/implement the user profile page
|
|
242
332
|
/debug why login fails
|
|
243
333
|
/review this pull request
|
|
334
|
+
/iterate [target quality bar] ← triggers evaluator-optimizer
|
|
244
335
|
```
|
|
245
336
|
````
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
````markdown
|
|
2
|
+
---
|
|
3
|
+
inclusion: manual
|
|
4
|
+
name: c-pro
|
|
5
|
+
description: "Use for modern C23-era systems and embedded engineering with memory safety discipline, build reproducibility, and low-level debugging awareness."
|
|
6
|
+
license: MIT
|
|
7
|
+
metadata:
|
|
8
|
+
author: cubis-foundry
|
|
9
|
+
version: "2.0"
|
|
10
|
+
compatibility: Claude Code, Codex, GitHub Copilot
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# C Pro
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Use for modern C23-era systems and embedded engineering with memory safety discipline, build reproducibility, and low-level debugging awareness.
|
|
18
|
+
|
|
19
|
+
## When to Use
|
|
20
|
+
|
|
21
|
+
- Writing or refactoring C systems, embedded, or low-level runtime code.
|
|
22
|
+
- Tightening memory ownership, ABI boundaries, and build hygiene.
|
|
23
|
+
- Debugging undefined behavior, portability, or toolchain-sensitive code.
|
|
24
|
+
|
|
25
|
+
## Instructions
|
|
26
|
+
|
|
27
|
+
1. Confirm platform, compiler, and ABI constraints before writing code.
|
|
28
|
+
2. Make ownership, lifetime, and error handling explicit at every interface.
|
|
29
|
+
3. Prefer simple control flow over macro-heavy indirection.
|
|
30
|
+
4. Validate assumptions with warnings, sanitizers, or focused repros.
|
|
31
|
+
5. Keep portability and deterministic builds in view throughout the change.
|
|
32
|
+
|
|
33
|
+
### Baseline standards
|
|
34
|
+
|
|
35
|
+
- Compile with `-Wall -Wextra -Werror` (or equivalent) in CI. Treat warnings as defects.
|
|
36
|
+
- Enable sanitizers (`-fsanitize=address,undefined`) in debug and test builds.
|
|
37
|
+
- Use `static` for file-scoped functions and variables. Minimize public symbols.
|
|
38
|
+
- Declare `const` by default. Mutable state must be justified.
|
|
39
|
+
- Keep headers self-contained: every `.h` must compile on its own.
|
|
40
|
+
- Prefer fixed-width integers (`uint32_t`, `int64_t`) over bare `int` for data structures and protocols.
|
|
41
|
+
|
|
42
|
+
### Memory safety discipline
|
|
43
|
+
|
|
44
|
+
- Every allocation must have a single, clear owner and a documented free path.
|
|
45
|
+
- Prefer stack allocation and arena allocators over scattered `malloc`/`free`.
|
|
46
|
+
- Initialize all variables at declaration. Never rely on implicit zero-initialization.
|
|
47
|
+
- Bounds-check array and buffer access at trust boundaries (user input, file I/O, network).
|
|
48
|
+
- Use `memset`/`memcpy` with explicit size — never assume buffer sizes from context.
|
|
49
|
+
- After `free`, set pointer to `NULL` to catch use-after-free during debugging.
|
|
50
|
+
|
|
51
|
+
### Build reproducibility
|
|
52
|
+
|
|
53
|
+
- Pin compiler version and flags in the build system. Builds must produce identical output across machines.
|
|
54
|
+
- Prefer CMake, Meson, or a Makefile with explicit dependency tracking over ad-hoc scripts.
|
|
55
|
+
- Declare all external dependencies with exact versions. Avoid system-installed headers for portable projects.
|
|
56
|
+
- Run CI on at least two compilers (GCC + Clang) and two platforms where applicable.
|
|
57
|
+
- Enable Link-Time Optimization (LTO) for release builds but verify correctness with sanitizers first.
|
|
58
|
+
|
|
59
|
+
### Debugging and diagnostics
|
|
60
|
+
|
|
61
|
+
- Compile debug builds with `-g -O0` for accurate stack traces and variable inspection.
|
|
62
|
+
- Use AddressSanitizer for memory errors, UndefinedBehaviorSanitizer for UB, and ThreadSanitizer for data races.
|
|
63
|
+
- Add `assert()` for invariants that must never be violated — strip in release builds.
|
|
64
|
+
- Prefer structured error codes with context over errno alone. Return error structs from functions that can fail.
|
|
65
|
+
- When debugging crashes: reproduce with sanitizers first, then gdb/lldb with watchpoints.
|
|
66
|
+
|
|
67
|
+
### Performance
|
|
68
|
+
|
|
69
|
+
- Profile with `perf`, `Instruments`, or `gprof` before micro-optimizing. Measure, don't guess.
|
|
70
|
+
- Prefer cache-friendly data layouts (arrays of structs vs. structs of arrays depending on access pattern).
|
|
71
|
+
- Minimize heap allocations in hot paths. Pre-allocate where the upper bound is known.
|
|
72
|
+
- Avoid premature inline — let the compiler decide, then verify with benchmarks.
|
|
73
|
+
|
|
74
|
+
### Constraints
|
|
75
|
+
|
|
76
|
+
- Avoid `void*` casts without size tracking — type-unsafe and bug-prone.
|
|
77
|
+
- Avoid variable-length arrays (VLAs) in production code — stack overflow risk.
|
|
78
|
+
- Avoid macro-heavy logic that hides control flow (`goto` cleanup patterns are acceptable when simple).
|
|
79
|
+
- Avoid ignoring compiler warnings — every warning is a potential bug.
|
|
80
|
+
- Avoid global mutable state without synchronization.
|
|
81
|
+
- Avoid relying on implementation-defined or undefined behavior for correctness.
|
|
82
|
+
|
|
83
|
+
## Output Format
|
|
84
|
+
|
|
85
|
+
Provide implementation guidance, code examples, and configuration as appropriate to the task.
|
|
86
|
+
|
|
87
|
+
## References
|
|
88
|
+
|
|
89
|
+
| File | Load when |
|
|
90
|
+
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
91
|
+
| `references/memory-safety-and-build-checklist.md` | Memory ownership patterns, sanitizer configuration, build system hygiene, or ABI boundary review is needed. |
|
|
92
|
+
| `references/common-ub-and-portability.md` | Undefined behavior patterns, implementation-defined traps, or cross-platform portability decisions are needed. |
|
|
93
|
+
| `references/build-systems-and-toolchains.md` | CMake/Meson setup, cross-compilation, CI matrix configuration, or toolchain pinning is needed. |
|
|
94
|
+
| `references/posix-and-platform-apis.md` | POSIX system calls, file I/O, signal handling, or platform abstraction layer design is needed. |
|
|
95
|
+
| `references/debugging-with-sanitizers.md` | AddressSanitizer, UBSan, ThreadSanitizer configuration, or crash diagnosis workflow is needed. |
|
|
96
|
+
|
|
97
|
+
## Scripts
|
|
98
|
+
|
|
99
|
+
No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
|
|
100
|
+
|
|
101
|
+
## Examples
|
|
102
|
+
|
|
103
|
+
- "Help me with c pro best practices in this project"
|
|
104
|
+
- "Review my c pro implementation for issues"
|
|
105
|
+
````
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: c-pro
|
|
3
|
+
description: "Use for modern C23-era systems and embedded engineering with memory safety discipline, build reproducibility, and low-level debugging awareness."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: cubis-foundry
|
|
7
|
+
version: "2.0"
|
|
8
|
+
compatibility: Claude Code, Codex, GitHub Copilot
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# C Pro
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
Use for modern C23-era systems and embedded engineering with memory safety discipline, build reproducibility, and low-level debugging awareness.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- Writing or refactoring C systems, embedded, or low-level runtime code.
|
|
20
|
+
- Tightening memory ownership, ABI boundaries, and build hygiene.
|
|
21
|
+
- Debugging undefined behavior, portability, or toolchain-sensitive code.
|
|
22
|
+
|
|
23
|
+
## Instructions
|
|
24
|
+
|
|
25
|
+
1. Confirm platform, compiler, and ABI constraints before writing code.
|
|
26
|
+
2. Make ownership, lifetime, and error handling explicit at every interface.
|
|
27
|
+
3. Prefer simple control flow over macro-heavy indirection.
|
|
28
|
+
4. Validate assumptions with warnings, sanitizers, or focused repros.
|
|
29
|
+
5. Keep portability and deterministic builds in view throughout the change.
|
|
30
|
+
|
|
31
|
+
### Baseline standards
|
|
32
|
+
|
|
33
|
+
- Compile with `-Wall -Wextra -Werror` (or equivalent) in CI. Treat warnings as defects.
|
|
34
|
+
- Enable sanitizers (`-fsanitize=address,undefined`) in debug and test builds.
|
|
35
|
+
- Use `static` for file-scoped functions and variables. Minimize public symbols.
|
|
36
|
+
- Declare `const` by default. Mutable state must be justified.
|
|
37
|
+
- Keep headers self-contained: every `.h` must compile on its own.
|
|
38
|
+
- Prefer fixed-width integers (`uint32_t`, `int64_t`) over bare `int` for data structures and protocols.
|
|
39
|
+
|
|
40
|
+
### Memory safety discipline
|
|
41
|
+
|
|
42
|
+
- Every allocation must have a single, clear owner and a documented free path.
|
|
43
|
+
- Prefer stack allocation and arena allocators over scattered `malloc`/`free`.
|
|
44
|
+
- Initialize all variables at declaration. Never rely on implicit zero-initialization.
|
|
45
|
+
- Bounds-check array and buffer access at trust boundaries (user input, file I/O, network).
|
|
46
|
+
- Use `memset`/`memcpy` with explicit size — never assume buffer sizes from context.
|
|
47
|
+
- After `free`, set pointer to `NULL` to catch use-after-free during debugging.
|
|
48
|
+
|
|
49
|
+
### Build reproducibility
|
|
50
|
+
|
|
51
|
+
- Pin compiler version and flags in the build system. Builds must produce identical output across machines.
|
|
52
|
+
- Prefer CMake, Meson, or a Makefile with explicit dependency tracking over ad-hoc scripts.
|
|
53
|
+
- Declare all external dependencies with exact versions. Avoid system-installed headers for portable projects.
|
|
54
|
+
- Run CI on at least two compilers (GCC + Clang) and two platforms where applicable.
|
|
55
|
+
- Enable Link-Time Optimization (LTO) for release builds but verify correctness with sanitizers first.
|
|
56
|
+
|
|
57
|
+
### Debugging and diagnostics
|
|
58
|
+
|
|
59
|
+
- Compile debug builds with `-g -O0` for accurate stack traces and variable inspection.
|
|
60
|
+
- Use AddressSanitizer for memory errors, UndefinedBehaviorSanitizer for UB, and ThreadSanitizer for data races.
|
|
61
|
+
- Add `assert()` for invariants that must never be violated — strip in release builds.
|
|
62
|
+
- Prefer structured error codes with context over errno alone. Return error structs from functions that can fail.
|
|
63
|
+
- When debugging crashes: reproduce with sanitizers first, then gdb/lldb with watchpoints.
|
|
64
|
+
|
|
65
|
+
### Performance
|
|
66
|
+
|
|
67
|
+
- Profile with `perf`, `Instruments`, or `gprof` before micro-optimizing. Measure, don't guess.
|
|
68
|
+
- Prefer cache-friendly data layouts (arrays of structs vs. structs of arrays depending on access pattern).
|
|
69
|
+
- Minimize heap allocations in hot paths. Pre-allocate where the upper bound is known.
|
|
70
|
+
- Avoid premature inline — let the compiler decide, then verify with benchmarks.
|
|
71
|
+
|
|
72
|
+
### Constraints
|
|
73
|
+
|
|
74
|
+
- Avoid `void*` casts without size tracking — type-unsafe and bug-prone.
|
|
75
|
+
- Avoid variable-length arrays (VLAs) in production code — stack overflow risk.
|
|
76
|
+
- Avoid macro-heavy logic that hides control flow (`goto` cleanup patterns are acceptable when simple).
|
|
77
|
+
- Avoid ignoring compiler warnings — every warning is a potential bug.
|
|
78
|
+
- Avoid global mutable state without synchronization.
|
|
79
|
+
- Avoid relying on implementation-defined or undefined behavior for correctness.
|
|
80
|
+
|
|
81
|
+
## Output Format
|
|
82
|
+
|
|
83
|
+
Provide implementation guidance, code examples, and configuration as appropriate to the task.
|
|
84
|
+
|
|
85
|
+
## References
|
|
86
|
+
|
|
87
|
+
| File | Load when |
|
|
88
|
+
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
89
|
+
| `references/memory-safety-and-build-checklist.md` | Memory ownership patterns, sanitizer configuration, build system hygiene, or ABI boundary review is needed. |
|
|
90
|
+
| `references/common-ub-and-portability.md` | Undefined behavior patterns, implementation-defined traps, or cross-platform portability decisions are needed. |
|
|
91
|
+
| `references/build-systems-and-toolchains.md` | CMake/Meson setup, cross-compilation, CI matrix configuration, or toolchain pinning is needed. |
|
|
92
|
+
| `references/posix-and-platform-apis.md` | POSIX system calls, file I/O, signal handling, or platform abstraction layer design is needed. |
|
|
93
|
+
| `references/debugging-with-sanitizers.md` | AddressSanitizer, UBSan, ThreadSanitizer configuration, or crash diagnosis workflow is needed. |
|
|
94
|
+
|
|
95
|
+
## Scripts
|
|
96
|
+
|
|
97
|
+
No helper scripts are required for this skill right now. Keep execution in `SKILL.md` and `references/` unless repeated automation becomes necessary.
|
|
98
|
+
|
|
99
|
+
## Examples
|
|
100
|
+
|
|
101
|
+
- "Help me with c pro best practices in this project"
|
|
102
|
+
- "Review my c pro implementation for issues"
|