cfsa-antigravity 2.19.0 → 2.19.2

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.
Files changed (200) hide show
  1. package/package.json +1 -1
  2. package/template/.agent/kit-sync.md +3 -3
  3. package/template/.claude/commands/audit-ambiguity-execute.md +6 -0
  4. package/template/.claude/commands/audit-ambiguity-rubrics.md +6 -0
  5. package/template/.claude/commands/audit-ambiguity.md +6 -0
  6. package/template/.claude/commands/bootstrap-agents-fill.md +6 -0
  7. package/template/.claude/commands/bootstrap-agents-provision.md +6 -0
  8. package/template/.claude/commands/bootstrap-agents.md +6 -0
  9. package/template/.claude/commands/create-prd-architecture.md +6 -0
  10. package/template/.claude/commands/create-prd-compile.md +6 -0
  11. package/template/.claude/commands/create-prd-design-system.md +6 -0
  12. package/template/.claude/commands/create-prd-security.md +6 -0
  13. package/template/.claude/commands/create-prd-stack.md +6 -0
  14. package/template/.claude/commands/decompose-architecture-structure.md +6 -0
  15. package/template/.claude/commands/decompose-architecture-validate.md +6 -0
  16. package/template/.claude/commands/evolve-contract.md +6 -0
  17. package/template/.claude/commands/evolve-feature-cascade.md +6 -0
  18. package/template/.claude/commands/evolve-feature-classify.md +6 -0
  19. package/template/.claude/commands/evolve-feature.md +6 -0
  20. package/template/.claude/commands/ideate-discover.md +6 -0
  21. package/template/.claude/commands/ideate-extract.md +6 -0
  22. package/template/.claude/commands/ideate-validate.md +6 -0
  23. package/template/.claude/commands/implement-slice-setup.md +6 -0
  24. package/template/.claude/commands/implement-slice-tdd.md +6 -0
  25. package/template/.claude/commands/plan-phase-preflight.md +6 -0
  26. package/template/.claude/commands/plan-phase-write.md +6 -0
  27. package/template/.claude/commands/propagate-decision-apply.md +6 -0
  28. package/template/.claude/commands/propagate-decision-scan.md +6 -0
  29. package/template/.claude/commands/propagate-decision.md +6 -0
  30. package/template/.claude/commands/remediate-pipeline-assess.md +6 -0
  31. package/template/.claude/commands/remediate-pipeline-execute.md +6 -0
  32. package/template/.claude/commands/remediate-pipeline.md +6 -0
  33. package/template/.claude/commands/remediate-shard-split.md +6 -0
  34. package/template/.claude/commands/resolve-ambiguity.md +6 -0
  35. package/template/.claude/commands/setup-workspace-cicd.md +6 -0
  36. package/template/.claude/commands/setup-workspace-data.md +6 -0
  37. package/template/.claude/commands/setup-workspace-hosting.md +6 -0
  38. package/template/.claude/commands/setup-workspace-scaffold.md +6 -0
  39. package/template/.claude/commands/sync-kit.md +6 -0
  40. package/template/.claude/commands/update-architecture-map.md +6 -0
  41. package/template/.claude/commands/validate-phase-quality.md +6 -0
  42. package/template/.claude/commands/validate-phase-readiness.md +6 -0
  43. package/template/.claude/commands/verify-infrastructure.md +6 -0
  44. package/template/.claude/commands/write-architecture-spec-deepen.md +6 -0
  45. package/template/.claude/commands/write-architecture-spec-design.md +6 -0
  46. package/template/.claude/commands/write-be-spec-classify.md +6 -0
  47. package/template/.claude/commands/write-be-spec-write.md +6 -0
  48. package/template/.claude/commands/write-fe-spec-classify.md +6 -0
  49. package/template/.claude/commands/write-fe-spec-write.md +6 -0
  50. package/template/.claude/skills/accessibility/SKILL.md +522 -0
  51. package/template/.claude/skills/accessibility/references/WCAG.md +162 -0
  52. package/template/.claude/skills/accessibility/references/ia-spec-checklist.md +35 -0
  53. package/template/.claude/skills/adversarial-review/SKILL.md +90 -0
  54. package/template/.claude/skills/antigravity-workflows/SKILL.md +81 -0
  55. package/template/.claude/skills/antigravity-workflows/resources/implementation-playbook.md +36 -0
  56. package/template/.claude/skills/api-design-principles/SKILL.md +169 -0
  57. package/template/.claude/skills/api-design-principles/assets/api-design-checklist.md +155 -0
  58. package/template/.claude/skills/api-design-principles/assets/rest-api-template.py +182 -0
  59. package/template/.claude/skills/api-design-principles/references/graphql-schema-design.md +583 -0
  60. package/template/.claude/skills/api-design-principles/references/rest-best-practices.md +408 -0
  61. package/template/.claude/skills/api-design-principles/resources/implementation-playbook.md +513 -0
  62. package/template/.claude/skills/api-versioning/SKILL.md +166 -0
  63. package/template/.claude/skills/api-versioning/references/typescript.md +157 -0
  64. package/template/.claude/skills/architecture-mapping/SKILL.md +219 -0
  65. package/template/.claude/skills/bootstrap-agents/SKILL.md +258 -0
  66. package/template/.claude/skills/brainstorming/SKILL.md +177 -0
  67. package/template/.claude/skills/brand-guidelines/SKILL.md +44 -0
  68. package/template/.claude/skills/clean-code/SKILL.md +196 -0
  69. package/template/.claude/skills/clean-code/references/typescript.md +126 -0
  70. package/template/.claude/skills/code-review-pro/SKILL.md +152 -0
  71. package/template/.claude/skills/concise-planning/SKILL.md +107 -0
  72. package/template/.claude/skills/cross-layer-consistency/SKILL.md +117 -0
  73. package/template/.claude/skills/database-schema-design/SKILL.md +205 -0
  74. package/template/.claude/skills/database-schema-design/references/relational.md +228 -0
  75. package/template/.claude/skills/deployment-procedures/SKILL.md +241 -0
  76. package/template/.claude/skills/design-anti-cliche/SKILL.md +159 -0
  77. package/template/.claude/skills/design-direction/SKILL.md +45 -0
  78. package/template/.claude/skills/error-handling-patterns/SKILL.md +226 -0
  79. package/template/.claude/skills/error-handling-patterns/references/go.md +162 -0
  80. package/template/.claude/skills/error-handling-patterns/references/python.md +262 -0
  81. package/template/.claude/skills/error-handling-patterns/references/rust.md +112 -0
  82. package/template/.claude/skills/error-handling-patterns/references/typescript.md +178 -0
  83. package/template/.claude/skills/find-skills/SKILL.md +145 -0
  84. package/template/.claude/skills/git-advanced/SKILL.md +972 -0
  85. package/template/.claude/skills/git-workflow/SKILL.md +420 -0
  86. package/template/.claude/skills/idea-extraction/SKILL.md +644 -0
  87. package/template/.claude/skills/logging-best-practices/SKILL.md +192 -0
  88. package/template/.claude/skills/logging-best-practices/references/go.md +49 -0
  89. package/template/.claude/skills/logging-best-practices/references/python.md +52 -0
  90. package/template/.claude/skills/logging-best-practices/references/typescript.md +215 -0
  91. package/template/.claude/skills/migration-management/SKILL.md +200 -0
  92. package/template/.claude/skills/migration-management/references/relational.md +214 -0
  93. package/template/.claude/skills/minimalist-surgical-development/SKILL.md +135 -0
  94. package/template/.claude/skills/parallel-agents/SKILL.md +165 -0
  95. package/template/.claude/skills/parallel-debugging/SKILL.md +135 -0
  96. package/template/.claude/skills/parallel-feature-development/SKILL.md +157 -0
  97. package/template/.claude/skills/performance-budgeting/SKILL.md +144 -0
  98. package/template/.claude/skills/pipeline-rubrics/SKILL.md +51 -0
  99. package/template/.claude/skills/pipeline-rubrics/references/architecture-rubric.md +19 -0
  100. package/template/.claude/skills/pipeline-rubrics/references/be-rubric.md +21 -0
  101. package/template/.claude/skills/pipeline-rubrics/references/fe-rubric.md +20 -0
  102. package/template/.claude/skills/pipeline-rubrics/references/ia-rubric.md +19 -0
  103. package/template/.claude/skills/pipeline-rubrics/references/scoring.md +32 -0
  104. package/template/.claude/skills/pipeline-rubrics/references/vision-rubric.md +12 -0
  105. package/template/.claude/skills/prd-templates/SKILL.md +107 -0
  106. package/template/.claude/skills/prd-templates/references/architecture-completeness-checklist.md +28 -0
  107. package/template/.claude/skills/prd-templates/references/architecture-design-template.md +88 -0
  108. package/template/.claude/skills/prd-templates/references/be-spec-classification.md +41 -0
  109. package/template/.claude/skills/prd-templates/references/be-spec-template.md +107 -0
  110. package/template/.claude/skills/prd-templates/references/bootstrap-verification-protocol.md +50 -0
  111. package/template/.claude/skills/prd-templates/references/constraint-exploration.md +41 -0
  112. package/template/.claude/skills/prd-templates/references/data-placement-template.md +74 -0
  113. package/template/.claude/skills/prd-templates/references/decision-confirmation-protocol.md +68 -0
  114. package/template/.claude/skills/prd-templates/references/decision-propagation.md +121 -0
  115. package/template/.claude/skills/prd-templates/references/decomposition-templates.md +226 -0
  116. package/template/.claude/skills/prd-templates/references/deep-ideation-loading-protocol.md +114 -0
  117. package/template/.claude/skills/prd-templates/references/design-system-decisions.md +198 -0
  118. package/template/.claude/skills/prd-templates/references/design-system-prerequisite-check.md +18 -0
  119. package/template/.claude/skills/prd-templates/references/domain-exhaustion-criteria.md +37 -0
  120. package/template/.claude/skills/prd-templates/references/engagement-tier-protocol.md +58 -0
  121. package/template/.claude/skills/prd-templates/references/engineering-standards-template.md +126 -0
  122. package/template/.claude/skills/prd-templates/references/evolution-layer-guidance.md +91 -0
  123. package/template/.claude/skills/prd-templates/references/expansion-modes.md +27 -0
  124. package/template/.claude/skills/prd-templates/references/fe-classification-procedures.md +47 -0
  125. package/template/.claude/skills/prd-templates/references/fe-spec-template.md +90 -0
  126. package/template/.claude/skills/prd-templates/references/feature-ledger-protocol.md +149 -0
  127. package/template/.claude/skills/prd-templates/references/folder-seeding-protocol.md +77 -0
  128. package/template/.claude/skills/prd-templates/references/fractal-cx-template.md +58 -0
  129. package/template/.claude/skills/prd-templates/references/fractal-feature-template.md +93 -0
  130. package/template/.claude/skills/prd-templates/references/fractal-node-index-template.md +55 -0
  131. package/template/.claude/skills/prd-templates/references/gate-applicability.md +92 -0
  132. package/template/.claude/skills/prd-templates/references/ideation-crosscut-template.md +36 -0
  133. package/template/.claude/skills/prd-templates/references/ideation-index-template.md +111 -0
  134. package/template/.claude/skills/prd-templates/references/ideation-meta-template.md +126 -0
  135. package/template/.claude/skills/prd-templates/references/infrastructure-report-template.md +71 -0
  136. package/template/.claude/skills/prd-templates/references/input-classification.md +23 -0
  137. package/template/.claude/skills/prd-templates/references/map-guard-protocol.md +65 -0
  138. package/template/.claude/skills/prd-templates/references/operational-templates.md +116 -0
  139. package/template/.claude/skills/prd-templates/references/persona-completeness-gate.md +20 -0
  140. package/template/.claude/skills/prd-templates/references/placeholder-guard-template.md +21 -0
  141. package/template/.claude/skills/prd-templates/references/placeholder-workflow-mapping.md +50 -0
  142. package/template/.claude/skills/prd-templates/references/shard-boundary-analysis.md +103 -0
  143. package/template/.claude/skills/prd-templates/references/shard-split-remediation.md +157 -0
  144. package/template/.claude/skills/prd-templates/references/skill-loading-protocol.md +36 -0
  145. package/template/.claude/skills/prd-templates/references/slice-completion-gates.md +29 -0
  146. package/template/.claude/skills/prd-templates/references/spec-coverage-sweep.md +44 -0
  147. package/template/.claude/skills/prd-templates/references/surface-model.md +61 -0
  148. package/template/.claude/skills/prd-templates/references/tdd-testing-policy.md +39 -0
  149. package/template/.claude/skills/prd-templates/references/vision-template.md +57 -0
  150. package/template/.claude/skills/prd-templates/references/workflow-checkpoint-protocol.md +112 -0
  151. package/template/.claude/skills/prd-templates/references/write-verification-protocol.md +57 -0
  152. package/template/.claude/skills/prompt-engineer/SKILL.md +203 -0
  153. package/template/.claude/skills/regex-patterns/SKILL.md +333 -0
  154. package/template/.claude/skills/regex-patterns/references/go.md +44 -0
  155. package/template/.claude/skills/regex-patterns/references/javascript.md +63 -0
  156. package/template/.claude/skills/regex-patterns/references/python.md +77 -0
  157. package/template/.claude/skills/regex-patterns/references/rust.md +43 -0
  158. package/template/.claude/skills/resolve-ambiguity/SKILL.md +278 -0
  159. package/template/.claude/skills/security-scanning-security-hardening/SKILL.md +231 -0
  160. package/template/.claude/skills/session-continuity/SKILL.md +732 -0
  161. package/template/.claude/skills/session-continuity/protocols/01-session-resumption.md +38 -0
  162. package/template/.claude/skills/session-continuity/protocols/02-progress-generation.md +85 -0
  163. package/template/.claude/skills/session-continuity/protocols/03-progress-update.md +70 -0
  164. package/template/.claude/skills/session-continuity/protocols/04-pattern-extraction.md +60 -0
  165. package/template/.claude/skills/session-continuity/protocols/05-session-close.md +37 -0
  166. package/template/.claude/skills/session-continuity/protocols/06-decision-analysis.md +84 -0
  167. package/template/.claude/skills/session-continuity/protocols/07-spec-pipeline-generation.md +48 -0
  168. package/template/.claude/skills/session-continuity/protocols/08-spec-pipeline-update.md +55 -0
  169. package/template/.claude/skills/session-continuity/protocols/09-parallel-claim.md +122 -0
  170. package/template/.claude/skills/session-continuity/protocols/10-placeholder-verification-gate.md +83 -0
  171. package/template/.claude/skills/session-continuity/protocols/11-parallel-synthesis.md +21 -0
  172. package/template/.claude/skills/session-continuity/protocols/ambiguity-gates.md +48 -0
  173. package/template/.claude/skills/skill-creator/SKILL.md +203 -0
  174. package/template/.claude/skills/skill-creator/references/.gitkeep +0 -0
  175. package/template/.claude/skills/skill-creator/scripts/.gitkeep +0 -0
  176. package/template/.claude/skills/spec-writing/SKILL.md +110 -0
  177. package/template/.claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
  178. package/template/.claude/skills/systematic-debugging/SKILL.md +297 -0
  179. package/template/.claude/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  180. package/template/.claude/skills/systematic-debugging/condition-based-waiting.md +115 -0
  181. package/template/.claude/skills/systematic-debugging/defense-in-depth.md +122 -0
  182. package/template/.claude/skills/systematic-debugging/find-polluter.sh +63 -0
  183. package/template/.claude/skills/systematic-debugging/root-cause-tracing.md +169 -0
  184. package/template/.claude/skills/systematic-debugging/test-academic.md +14 -0
  185. package/template/.claude/skills/systematic-debugging/test-pressure-1.md +58 -0
  186. package/template/.claude/skills/systematic-debugging/test-pressure-2.md +68 -0
  187. package/template/.claude/skills/systematic-debugging/test-pressure-3.md +69 -0
  188. package/template/.claude/skills/tdd-workflow/SKILL.md +186 -0
  189. package/template/.claude/skills/tdd-workflow/references/typescript.md +231 -0
  190. package/template/.claude/skills/tech-stack-catalog/SKILL.md +49 -0
  191. package/template/.claude/skills/tech-stack-catalog/references/constraint-questions.md +237 -0
  192. package/template/.claude/skills/tech-stack-catalog/references/dev-tooling-decisions.md +37 -0
  193. package/template/.claude/skills/tech-stack-catalog/references/surface-decision-tables.md +69 -0
  194. package/template/.claude/skills/technical-writer/SKILL.md +242 -0
  195. package/template/.claude/skills/testing-strategist/SKILL.md +319 -0
  196. package/template/.claude/skills/testing-strategist/references/typescript.md +328 -0
  197. package/template/.claude/skills/verification-before-completion/SKILL.md +97 -0
  198. package/template/.claude/skills/workflow-automation/SKILL.md +166 -0
  199. package/template/.claude/skills/workflow-automation/references/inngest.md +88 -0
  200. package/template/.claude/skills/workflow-automation/references/temporal.md +64 -0
@@ -0,0 +1,177 @@
1
+ ---
2
+ name: brainstorming
3
+ description: "Use before any creative work — creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements, and design before implementation."
4
+ version: 2.0.0
5
+ source: self
6
+ date_added: "2026-02-27"
7
+ date_rewritten: "2026-03-14"
8
+ ---
9
+
10
+ # Brainstorming Ideas Into Designs
11
+
12
+ Turn raw ideas into **clear, validated designs** through structured dialogue **before any implementation begins**.
13
+
14
+ ## When to Use
15
+
16
+ - User describes a new feature, component, or behavior change
17
+ - Task involves creative decisions (not just execution of a clear spec)
18
+ - Requirements are ambiguous or incomplete
19
+ - Work could go in multiple valid directions
20
+
21
+ ## When NOT to Use
22
+
23
+ - Task has a clear spec with acceptance criteria (just implement it)
24
+ - Fixing a bug with obvious cause (just fix it)
25
+ - During `/plan-phase` or `/implement-slice` (those have their own structure)
26
+ - Trivial changes (rename a variable, fix a typo)
27
+
28
+ ## Operating Mode
29
+
30
+ You are a **design facilitator**, not a builder. While this skill is active:
31
+
32
+ - No coding, no file modifications
33
+ - No speculative features — only design what's been discussed
34
+ - No silent assumptions — every assumption gets stated explicitly
35
+ - No skipping ahead — each gate must be passed before proceeding
36
+
37
+ ---
38
+
39
+ ## The Process
40
+
41
+ ### 1. Scan Context (Before Asking Anything)
42
+
43
+ Read the relevant project state:
44
+ - Existing code in the affected area
45
+ - Related specs, plans, or prior decisions
46
+ - Recent changes that might affect the design
47
+
48
+ Note what already exists vs. what's proposed. Identify implicit constraints.
49
+
50
+ **Do not design yet.**
51
+
52
+ ### 2. Understand the Idea
53
+
54
+ **One question at a time.** Do not dump a list of 10 questions.
55
+
56
+ Prefer multiple-choice when possible:
57
+ > "Should this component handle errors inline or delegate to a parent error boundary?
58
+ > A) Inline (self-contained)
59
+ > B) Delegate (parent handles)
60
+ > C) Hybrid (catch critical, delegate non-critical)"
61
+
62
+ Focus on understanding:
63
+ - **Purpose** — what problem does this solve?
64
+ - **Users** — who uses it and how?
65
+ - **Constraints** — performance, security, compatibility limits
66
+ - **Success criteria** — how do we know it's working?
67
+ - **Non-goals** — what is explicitly out of scope?
68
+
69
+ ### 3. Non-Functional Requirements
70
+
71
+ Before any design, clarify or propose defaults for:
72
+
73
+ | Requirement | If User Is Unsure |
74
+ |-------------|-------------------|
75
+ | Performance | Propose: "P95 < 200ms for API, <3s for page load" |
76
+ | Scale | Propose: "Support 1K concurrent users initially" |
77
+ | Security | Default: input validation, auth required, no PII in logs |
78
+ | Reliability | Propose: "99.5% uptime, graceful degradation" |
79
+ | Maintenance | "Maintained by your team, or handed off?" |
80
+
81
+ Mark all proposals as **assumptions** that the user can override.
82
+
83
+ ### 4. Understanding Lock (Hard Gate)
84
+
85
+ **Before proposing any design**, present:
86
+
87
+ ```markdown
88
+ ## Understanding Summary
89
+ - **Building**: [what]
90
+ - **Purpose**: [why]
91
+ - **Users**: [who]
92
+ - **Key constraints**: [limits]
93
+ - **Non-goals**: [explicitly excluded]
94
+
95
+ ## Assumptions
96
+ - [Each assumption stated clearly]
97
+
98
+ ## Open Questions
99
+ - [Any unresolved items]
100
+ ```
101
+
102
+ Then ask: *"Does this accurately reflect your intent? Please confirm or correct before we move to design."*
103
+
104
+ **Do NOT proceed until confirmed.**
105
+
106
+ ### 5. Explore Design Approaches
107
+
108
+ Present **2-3 viable approaches**:
109
+
110
+ 1. **Recommended** — lead with this, explain why
111
+ 2. **Alternative** — different tradeoff (simpler but less extensible, etc.)
112
+ 3. **Alternative** — if genuinely different from #2
113
+
114
+ For each approach, cover:
115
+ - Complexity estimate (low/medium/high)
116
+ - Extensibility (how easy to evolve later)
117
+ - Risk (what could go wrong)
118
+ - Implementation effort (rough scope)
119
+
120
+ Apply **YAGNI ruthlessly** — remove unnecessary features from all approaches.
121
+
122
+ ### 6. Present Design (Incrementally)
123
+
124
+ Break the design into sections of **200-300 words max**. After each section:
125
+
126
+ > "Does this look right so far?"
127
+
128
+ Cover as relevant:
129
+ - Architecture / component structure
130
+ - Data flow and state management
131
+ - Error handling and edge cases
132
+ - Testing strategy
133
+ - Integration points
134
+
135
+ ### 7. Decision Log
136
+
137
+ Maintain a running log:
138
+
139
+ ```markdown
140
+ | Decision | Alternatives | Rationale |
141
+ |----------|-------------|-----------|
142
+ | Use event-driven sync | Polling, webhooks | Lower latency, less server load |
143
+ | SQLite over PostgreSQL | PostgreSQL | Single-user app, simpler deployment |
144
+ ```
145
+
146
+ This log survives into the final design document.
147
+
148
+ ---
149
+
150
+ ## Exit Criteria
151
+
152
+ You may exit brainstorming **only when ALL are true**:
153
+
154
+ - [ ] Understanding Lock confirmed by user
155
+ - [ ] At least one design approach explicitly accepted
156
+ - [ ] Assumptions documented and acknowledged
157
+ - [ ] Key risks identified
158
+ - [ ] Decision Log complete
159
+
160
+ If any criterion is unmet → continue refinement. Do NOT proceed to implementation.
161
+
162
+ ## After Brainstorming
163
+
164
+ 1. Write the design to `docs/plans/YYYY-MM-DD-<topic>-design.md`
165
+ 2. Include: understanding summary, assumptions, decision log, final design
166
+ 3. Ask: "Ready to set up for implementation?"
167
+ 4. If yes, hand off to the appropriate pipeline command (`/plan-phase`, `/implement-slice`, etc.)
168
+
169
+ ## Key Principles
170
+
171
+ 1. **One question at a time** — never overwhelm
172
+ 2. **Multiple choice preferred** — easier to answer
173
+ 3. **Assumptions must be explicit** — never silently assume
174
+ 4. **YAGNI ruthlessly** — remove unnecessary features
175
+ 5. **Explore alternatives** — always 2-3 approaches
176
+ 6. **Incremental validation** — present in sections, validate each
177
+ 7. **Clarity over cleverness** — simple > smart
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: brand-guidelines
3
+ description: "Apply the confirmed design direction to all visual surfaces. If `{{DESIGN_DIRECTION}}` still appears as a literal placeholder, the design direction has not been confirmed — run `/create-prd` first."
4
+ ---
5
+
6
+ # {{PROJECT_NAME}} Brand Guidelines
7
+
8
+ > **Status**: {{#if DESIGN_DIRECTION}}Active{{else}}⚠️ UNFILLED — Run /create-prd to confirm design direction before using this skill{{/if}}
9
+
10
+ ## Design Direction
11
+
12
+ - **Confirmed direction**: {{DESIGN_DIRECTION}}
13
+ - **Rationale**: {{DESIGN_DIRECTION_RATIONALE}}
14
+ - **Primary audience**: {{DESIGN_AUDIENCE}}
15
+
16
+ ## Color Palette
17
+
18
+ | Role | Value | Usage |
19
+ |------|-------|-------|
20
+ | Primary | {{PRIMARY_COLOR}} | Main brand color — buttons, links, key UI elements |
21
+ | Secondary | {{SECONDARY_COLOR}} | Supporting color — secondary actions, accents |
22
+ | Accent | {{ACCENT_COLOR}} | Highlight color — notifications, badges, emphasis |
23
+ | Background | {{BACKGROUND_COLOR}} | Page/app background |
24
+ | Text | {{TEXT_COLOR}} | Primary text color |
25
+
26
+ ## Typography
27
+
28
+ | Role | Font | Usage |
29
+ |------|------|-------|
30
+ | Heading | {{HEADING_FONT}} | Page titles, section headers, display text |
31
+ | Body | {{BODY_FONT}} | Paragraphs, descriptions, UI labels |
32
+ | Mono | {{MONO_FONT}} | Code blocks, terminal output, technical values |
33
+
34
+ ## Motion Philosophy
35
+
36
+ {{MOTION_PHILOSOPHY}}
37
+
38
+ ## Existing Brand Assets
39
+
40
+ {{EXISTING_BRAND_ASSETS}}
41
+
42
+ ## What to Avoid
43
+
44
+ {{DESIGN_AVOID}}
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: clean-code
3
+ description: "Applies battle-tested clean code principles to writing, reviewing, and refactoring code. Covers naming, functions, comments, error handling, class design, and the critical difference between clever code and clear code."
4
+ version: 2.0.0
5
+ ---
6
+
7
+ # Clean Code
8
+
9
+ Code is read 10x more than it's written. Every naming choice, every function boundary, every abstraction layer either helps or hurts the next person who reads it — including future you.
10
+
11
+ ## When to Use
12
+
13
+ - Writing any new code
14
+ - Reviewing pull requests
15
+ - Refactoring existing code
16
+ - When code "works but feels wrong"
17
+
18
+ ## Stack-Specific References
19
+
20
+ The principles below are language-agnostic. For idiomatic patterns and syntax, read the reference matching your surface's Languages column:
21
+
22
+ | Language | Reference |
23
+ |----------|-----------|
24
+ | TypeScript / JavaScript | `references/typescript.md` |
25
+ | Python | `references/python.md` |
26
+ | Go | `references/go.md` |
27
+ | Rust | `references/rust.md` |
28
+
29
+ ## Core Principles
30
+
31
+ ### 1. Names Are Documentation
32
+
33
+ Names should reveal intent. If a name requires a comment to explain it, the name is wrong.
34
+
35
+ | Bad | Good | Why |
36
+ |-----|------|-----|
37
+ | `d` | `elapsedDays` | What is `d`? |
38
+ | `list` | `activeUsers` | What kind of list? |
39
+ | `processData()` | `validateAndSaveOrder()` | What processing? |
40
+ | `temp` | `filteredResults` | Temporary what? |
41
+ | `flag` | `isEligibleForDiscount` | What flag? |
42
+ | `doStuff()` | `sendWelcomeEmail()` | What stuff? |
43
+ | `Manager` | `OrderProcessor` | Manager of what? |
44
+ | `Utils` | `StringFormatter` | Util for what? |
45
+
46
+ **Rules:**
47
+ - Classes/types → nouns (`UserRepository`, `PaymentGateway`)
48
+ - Functions → verbs (`calculateTotal`, `sendNotification`)
49
+ - Booleans → questions (`isActive`, `hasPermission`, `canEdit`)
50
+ - Constants → screaming snake with context (`MAX_RETRY_ATTEMPTS`, not `MAX`)
51
+ - No abbreviations unless universally understood (`id`, `url`, `api` are fine; `usr`, `mgr`, `proc` are not)
52
+
53
+ ### 2. Functions Should Do One Thing
54
+
55
+ A function that does one thing well is easy to name, test, and reuse. A function that does three things is hard to name, impossible to test independently, and couples three responsibilities.
56
+
57
+ **The test:** Can you describe the function without using "and"? If not, split it.
58
+
59
+ ```
60
+ ❌ processOrder(order)
61
+ — validates order
62
+ — calculates total with tax
63
+ — saves to database
64
+ — sends confirmation email
65
+
66
+ ✅ validateOrder(order) → throws if invalid
67
+ calculateOrderTotal(items) → returns numeric total
68
+ submitOrder(order) → orchestrates the above
69
+ ```
70
+
71
+ **Function size limits:**
72
+ - **Ideal**: 5-15 lines
73
+ - **Acceptable**: up to 30 lines
74
+ - **Needs splitting**: 30+ lines
75
+ - **Unacceptable**: 50+ lines (split immediately)
76
+
77
+ ### 3. Parameters
78
+
79
+ - **0-2 parameters**: ideal
80
+ - **3 parameters**: acceptable with named/destructured args
81
+ - **4+ parameters**: use an options object/struct/dataclass
82
+ - **Boolean parameters**: almost always a code smell — split into two functions
83
+
84
+ ```
85
+ ❌ createUser(name, isAdmin)
86
+ ✅ createUser(name) / createAdmin(name)
87
+
88
+ ❌ sendEmail(to, from, subject, body, cc)
89
+ ✅ sendEmail(options) ← options is a structured type
90
+ ```
91
+
92
+ ### 4. Comments: Why, Not What
93
+
94
+ Good code doesn't need comments to explain WHAT it does. Comments should explain WHY — the non-obvious reasoning, business rules, or constraints.
95
+
96
+ ```
97
+ ❌ // Increment counter by one
98
+ counter += 1
99
+
100
+ ❌ // Check if user is admin
101
+ if user.role == "admin"
102
+
103
+ ✅ // Stripe requires amount in cents, not dollars
104
+ amountInCents = round(price * 100)
105
+
106
+ ✅ // FDA regulation 21 CFR Part 11 requires audit trail
107
+ auditLog.record(changeEvent)
108
+
109
+ ✅ // WARNING: This query locks the orders table — avoid during peak hours
110
+ db.execute(batchUpdateQuery)
111
+ ```
112
+
113
+ **Delete these comments immediately:**
114
+ - `// TODO: fix this later` — fix it now or create a tracked issue
115
+ - `// This is a hack` — then don't commit the hack
116
+ - `// I don't know why this works` — figure it out before shipping
117
+ - Commented-out code — delete it; version control has your history
118
+
119
+ ### 5. Error Handling
120
+
121
+ Errors are not edge cases — they're expected behavior. Handle them explicitly.
122
+
123
+ ```
124
+ ❌ try { save(order) } catch { log("error") }
125
+ → What error? What happens to the order?
126
+
127
+ ❌ try { processPayment(order) } catch { throw Error("Something went wrong") }
128
+ → Useless to the caller
129
+
130
+ ✅ try {
131
+ processPayment(order)
132
+ } catch InsufficientFundsError:
133
+ return { success: false, code: "INSUFFICIENT_FUNDS", retry: false }
134
+ catch PaymentGatewayError:
135
+ logger.error("Payment gateway failure", { orderId: order.id })
136
+ return { success: false, code: "GATEWAY_ERROR", retry: true }
137
+ catch unknown:
138
+ rethrow → Unknown errors bubble up
139
+ ```
140
+
141
+ ### 6. Don't Repeat Yourself (DRY) — But Don't Over-Abstract
142
+
143
+ **DRY violation** — same logic copy-pasted in 3+ places:
144
+ ```
145
+ tax1 = price1 * 0.08
146
+ tax2 = price2 * 0.08
147
+ tax3 = price3 * 0.08
148
+ → Extract: calculateTax(price)
149
+ ```
150
+
151
+ **Over-abstraction** — premature DRY that couples unrelated things:
152
+ ```
153
+ ❌ handleEntity(type, action, data) → "universal" handler for everything
154
+ ```
155
+
156
+ **Rule of Three**: Duplicate once is acceptable. Duplicate twice means extract.
157
+
158
+ ### 7. Code Organization
159
+
160
+ ```
161
+ High-level policy (business logic)
162
+
163
+
164
+ ┌─────────────────────┐
165
+ │ Domain Layer │ Pure logic, no I/O
166
+ │ (models, rules) │
167
+ └─────────────────────┘
168
+
169
+ ┌─────────────────────┐
170
+ │ Application Layer │ Orchestrates domain objects
171
+ │ (use cases) │
172
+ └─────────────────────┘
173
+
174
+ ┌─────────────────────┐
175
+ │ Infrastructure │ I/O, databases, APIs
176
+ │ (adapters) │
177
+ └─────────────────────┘
178
+
179
+ Low-level detail (frameworks, drivers)
180
+ ```
181
+
182
+ - Dependencies point inward (infrastructure depends on domain, not reverse)
183
+ - Business logic never imports from infrastructure
184
+ - Test domain logic without databases, APIs, or frameworks
185
+
186
+ ## Quick Refactoring Checklist
187
+
188
+ Before committing code, check:
189
+
190
+ - [ ] Can I understand every function in <10 seconds?
191
+ - [ ] Are there any functions >30 lines?
192
+ - [ ] Are there any files >200 lines (components) or >300 lines (utilities)?
193
+ - [ ] Do all names reveal intent without needing comments?
194
+ - [ ] Is there any copy-pasted logic (3+ occurrences)?
195
+ - [ ] Are errors handled specifically, not swallowed or genericized?
196
+ - [ ] Would a new team member understand this without asking me?
@@ -0,0 +1,126 @@
1
+ # TypeScript Clean Code Patterns
2
+
3
+ Language-specific patterns for the `clean-code` skill. Read `SKILL.md` first for universal principles.
4
+
5
+ ---
6
+
7
+ ## Single Responsibility
8
+
9
+ ```typescript
10
+ // ❌ Does three things
11
+ function processOrder(order: Order): void {
12
+ if (!order.items.length) throw new Error("Empty order");
13
+ if (!order.customer) throw new Error("No customer");
14
+
15
+ let total = 0;
16
+ for (const item of order.items) {
17
+ total += item.price * item.quantity;
18
+ if (item.taxable) total += item.price * 0.08;
19
+ }
20
+
21
+ db.orders.insert({ ...order, total, status: "pending" });
22
+ emailService.send(order.customer.email, "Order confirmed");
23
+ }
24
+
25
+ // ✅ Each function does one thing
26
+ function validateOrder(order: Order): void {
27
+ if (!order.items.length) throw new InvalidOrderError("Empty order");
28
+ if (!order.customer) throw new InvalidOrderError("No customer");
29
+ }
30
+
31
+ function calculateOrderTotal(items: OrderItem[]): number {
32
+ return items.reduce((total, item) => {
33
+ const subtotal = item.price * item.quantity;
34
+ const tax = item.taxable ? item.price * TAX_RATE : 0;
35
+ return total + subtotal + tax;
36
+ }, 0);
37
+ }
38
+
39
+ function submitOrder(order: Order): OrderConfirmation {
40
+ validateOrder(order);
41
+ const total = calculateOrderTotal(order.items);
42
+ const saved = db.orders.insert({ ...order, total, status: "pending" });
43
+ emailService.send(order.customer.email, "Order confirmed");
44
+ return { orderId: saved.id, total };
45
+ }
46
+ ```
47
+
48
+ ## Options Objects Over Positional Args
49
+
50
+ ```typescript
51
+ // ❌ Boolean flag parameter
52
+ function createUser(name: string, isAdmin: boolean): User { ... }
53
+
54
+ // ✅ Two clear functions
55
+ function createUser(name: string): User { ... }
56
+ function createAdmin(name: string): User { ... }
57
+
58
+ // ❌ Too many positional args
59
+ function sendEmail(to: string, from: string, subject: string, body: string, cc?: string): void { ... }
60
+
61
+ // ✅ Options object
62
+ interface SendEmailOptions {
63
+ to: string;
64
+ from: string;
65
+ subject: string;
66
+ body: string;
67
+ cc?: string;
68
+ }
69
+ function sendEmail(options: SendEmailOptions): void { ... }
70
+ ```
71
+
72
+ ## Error Handling
73
+
74
+ ```typescript
75
+ // ❌ Swallowing errors
76
+ try {
77
+ await saveOrder(order);
78
+ } catch (e) {
79
+ console.log("error");
80
+ }
81
+
82
+ // ❌ Generic catch-all
83
+ try {
84
+ await processPayment(order);
85
+ } catch (e) {
86
+ throw new Error("Something went wrong");
87
+ }
88
+
89
+ // ✅ Specific, actionable error handling
90
+ try {
91
+ await processPayment(order);
92
+ } catch (error) {
93
+ if (error instanceof InsufficientFundsError) {
94
+ return { success: false, code: "INSUFFICIENT_FUNDS", retry: false };
95
+ }
96
+ if (error instanceof PaymentGatewayError) {
97
+ logger.error("Payment gateway failure", { orderId: order.id, error });
98
+ return { success: false, code: "GATEWAY_ERROR", retry: true };
99
+ }
100
+ throw error; // Unknown errors bubble up
101
+ }
102
+ ```
103
+
104
+ ## Comments
105
+
106
+ ```typescript
107
+ // ❌ Redundant
108
+ // Increment counter by one
109
+ counter += 1;
110
+
111
+ // ❌ Obvious
112
+ // Check if user is admin
113
+ if (user.role === "admin") { ... }
114
+
115
+ // ✅ Explains WHY
116
+ // Stripe requires amount in cents, not dollars
117
+ const amountInCents = Math.round(price * 100);
118
+
119
+ // ✅ Business rule
120
+ // FDA regulation 21 CFR Part 11 requires audit trail for all changes
121
+ await auditLog.record(changeEvent);
122
+
123
+ // ✅ Non-obvious consequence
124
+ // WARNING: This query locks the orders table — avoid running during peak hours
125
+ await db.execute(batchUpdateQuery);
126
+ ```
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: Code Review Pro
3
+ description: Deep code analysis covering security, performance, maintainability, and best practices
4
+ ---
5
+
6
+ # Code Review Pro
7
+
8
+ Deep code analysis covering security, performance, maintainability, and best practices.
9
+
10
+ ## When to Use This Skill
11
+ Activate when the user:
12
+ - Asks for a code review
13
+ - Wants security vulnerability scanning
14
+ - Needs performance analysis
15
+ - Asks to "review this code" or "audit this code"
16
+ - Mentions finding bugs or improvements
17
+ - Wants refactoring suggestions
18
+ - Requests best practice validation
19
+
20
+ ## Instructions
21
+ 1. **Security Analysis (Critical Priority)**
22
+ - SQL injection vulnerabilities
23
+ - XSS (cross-site scripting) risks
24
+ - Authentication/authorization issues
25
+ - Secrets or credentials in code
26
+ - Unsafe deserialization
27
+ - Path traversal vulnerabilities
28
+ - CSRF protection
29
+ - Input validation gaps
30
+ - Insecure cryptography
31
+ - Dependency vulnerabilities
32
+
33
+ 2. **Performance Analysis**
34
+ - N+1 query problems
35
+ - Inefficient algorithms (check Big O complexity)
36
+ - Memory leaks
37
+ - Unnecessary re-renders (React/Vue)
38
+ - Missing indexes (database queries)
39
+ - Blocking operations
40
+ - Resource cleanup (file handles, connections)
41
+ - Caching opportunities
42
+ - Excessive network calls
43
+ - Large bundle sizes
44
+
45
+ 3. **Code Quality & Maintainability**
46
+ - Code duplication (DRY violations)
47
+ - Function/method length (should be <50 lines)
48
+ - Cyclomatic complexity
49
+ - Unclear naming
50
+ - Missing error handling
51
+ - Inconsistent style
52
+ - Missing documentation
53
+ - Hard-coded values that should be constants
54
+ - God classes/functions
55
+ - Tight coupling
56
+
57
+ 4. **Best Practices**
58
+ - Language-specific idioms
59
+ - Framework conventions
60
+ - SOLID principles
61
+ - Design patterns usage
62
+ - Testing approach
63
+ - Logging and monitoring
64
+ - Accessibility (for UI code)
65
+ - Type safety
66
+ - Null/undefined handling
67
+
68
+ 5. **Bugs and Edge Cases**
69
+ - Logic errors
70
+ - Off-by-one errors
71
+ - Race conditions
72
+ - Null pointer exceptions
73
+ - Unhandled edge cases
74
+ - Timezone issues
75
+ - Encoding problems
76
+ - Floating point precision
77
+
78
+ 6. **Provide Actionable Fixes**
79
+ - Show specific code changes
80
+ - Explain why change is needed
81
+ - Include before/after examples
82
+ - Prioritize by severity
83
+
84
+ ## Output Format
85
+ ```markdown
86
+ # Code Review Report
87
+
88
+ ## 🚨 Critical Issues (Fix Immediately)
89
+ ### 1. [Issue Title] (line X)
90
+ **Severity**: Critical
91
+ **Issue**: [Description]
92
+ **Impact**: [What could happen]
93
+
94
+ **Current Code:**
95
+ ```
96
+ [problematic code]
97
+ ```
98
+
99
+ **Fixed Code:**
100
+ ```
101
+ [corrected code]
102
+ ```
103
+
104
+ **Explanation**: [Why this matters]
105
+
106
+ ## ⚠️ High Priority Issues
107
+ ### 2. [Issue] (line Y)
108
+ [Details...]
109
+
110
+ ## 💡 Medium Priority Issues
111
+ ### 3. [Issue] (line Z)
112
+ [Details...]
113
+
114
+ ## ✅ Low Priority / Nice to Have
115
+ ### 4. [Issue]
116
+ [Details...]
117
+
118
+ ## 📊 Summary
119
+ - **Total Issues**: N
120
+ - Critical: X
121
+ - High: Y
122
+ - Medium: Z
123
+ - Low: W
124
+
125
+ ## 🎯 Quick Wins
126
+ Changes with high impact and low effort:
127
+ 1. [Fix 1]
128
+ 2. [Fix 2]
129
+
130
+ ## 🏆 Strengths
131
+ - [Positive observation 1]
132
+ - [Positive observation 2]
133
+
134
+ ## 🔄 Refactoring Opportunities
135
+ 1. **Extract Method**: Lines X-Y could be extracted into `functionName()`
136
+ 2. **Remove Duplication**: [specific code blocks]
137
+ ```
138
+
139
+ ## Best Practices
140
+ - Always prioritize security issues first
141
+ - Provide specific line numbers for issues
142
+ - Include before/after code examples
143
+ - Explain *why* something is a problem
144
+ - Consider the language/framework context
145
+ - Don't just criticize—acknowledge good code too
146
+ - Suggest gradual improvements for large refactors
147
+ - Link to documentation for recommendations
148
+ - Consider project constraints (legacy code, deadlines)
149
+ - Balance perfectionism with pragmatism
150
+ - Focus on impactful changes
151
+ - Group similar issues together
152
+ - Make recommendations actionable