claude-code-kit 0.7.0__py3-none-any.whl

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 (209) hide show
  1. claude_code_kit-0.7.0.dist-info/METADATA +384 -0
  2. claude_code_kit-0.7.0.dist-info/RECORD +209 -0
  3. claude_code_kit-0.7.0.dist-info/WHEEL +4 -0
  4. claude_code_kit-0.7.0.dist-info/entry_points.txt +4 -0
  5. claude_code_kit-0.7.0.dist-info/licenses/LICENSE +21 -0
  6. claude_kit/__init__.py +10 -0
  7. claude_kit/__main__.py +8 -0
  8. claude_kit/_payload/agents/acceptance-reviewer.md +60 -0
  9. claude_kit/_payload/agents/auditor.md +76 -0
  10. claude_kit/_payload/agents/dependency-scanner.md +84 -0
  11. claude_kit/_payload/agents/developer.md +187 -0
  12. claude_kit/_payload/agents/devils-advocate.md +62 -0
  13. claude_kit/_payload/agents/devops-engineer.md +134 -0
  14. claude_kit/_payload/agents/e2e-tester.md +152 -0
  15. claude_kit/_payload/agents/em-reviewer.md +105 -0
  16. claude_kit/_payload/agents/incident-responder.md +64 -0
  17. claude_kit/_payload/agents/merge-reviewer.md +194 -0
  18. claude_kit/_payload/agents/observability-engineer.md +94 -0
  19. claude_kit/_payload/agents/orchestrator.md +551 -0
  20. claude_kit/_payload/agents/owasp-reviewer.md +76 -0
  21. claude_kit/_payload/agents/policy-validator.md +63 -0
  22. claude_kit/_payload/agents/pr-raiser.md +138 -0
  23. claude_kit/_payload/agents/risk-classifier.md +50 -0
  24. claude_kit/_payload/agents/sdlc-code-reviewer.md +196 -0
  25. claude_kit/_payload/agents/secret-scanner.md +70 -0
  26. claude_kit/_payload/agents/security-reviewer.md +80 -0
  27. claude_kit/_payload/agents/senior-backend-dev.md +199 -0
  28. claude_kit/_payload/agents/senior-frontend-dev.md +181 -0
  29. claude_kit/_payload/agents/senior-tester.md +206 -0
  30. claude_kit/_payload/agents/spec-doc-writer.md +331 -0
  31. claude_kit/_payload/agents/story-planner.md +56 -0
  32. claude_kit/_payload/agents/technical-architect.md +139 -0
  33. claude_kit/_payload/agents/tester.md +193 -0
  34. claude_kit/_payload/agents/ui-designer.md +73 -0
  35. claude_kit/_payload/agents/unit-tester.md +119 -0
  36. claude_kit/_payload/catalog/mcp.yaml +54 -0
  37. claude_kit/_payload/catalog/org.yaml +145 -0
  38. claude_kit/_payload/catalog/profiles.yaml +96 -0
  39. claude_kit/_payload/catalog/stacks.yaml +96 -0
  40. claude_kit/_payload/commands/init.md +36 -0
  41. claude_kit/_payload/commands/sdlc.md +18 -0
  42. claude_kit/_payload/commands/status.md +20 -0
  43. claude_kit/_payload/hooks/hooks.json +58 -0
  44. claude_kit/_payload/hooks/scripts/audit-log.sh +18 -0
  45. claude_kit/_payload/hooks/scripts/guard-secrets.sh +26 -0
  46. claude_kit/_payload/hooks/scripts/lint-fix.sh +38 -0
  47. claude_kit/_payload/hooks/scripts/load-continuity.sh +32 -0
  48. claude_kit/_payload/hooks/scripts/load-learnings.sh +40 -0
  49. claude_kit/_payload/hooks/scripts/type-check.sh +23 -0
  50. claude_kit/_payload/hooks/scripts/validate-frontmatter.sh +34 -0
  51. claude_kit/_payload/hooks/scripts/validate-settings.sh +21 -0
  52. claude_kit/_payload/hooks/scripts/warn-large-edits.sh +24 -0
  53. claude_kit/_payload/hooks/scripts/warn-missing-tests.sh +24 -0
  54. claude_kit/_payload/hooks/scripts/warn-sensitive-files.sh +30 -0
  55. claude_kit/_payload/hooks/scripts/warn-shared-modules.sh +33 -0
  56. claude_kit/_payload/rules/agent-guardrails.md +83 -0
  57. claude_kit/_payload/rules/agent-memory.md +106 -0
  58. claude_kit/_payload/rules/agent-resilience.md +61 -0
  59. claude_kit/_payload/rules/autonomy-levels.md +30 -0
  60. claude_kit/_payload/rules/code-organization.md +312 -0
  61. claude_kit/_payload/rules/continuity.md +84 -0
  62. claude_kit/_payload/rules/design-patterns.md +422 -0
  63. claude_kit/_payload/rules/devops-observability.md +57 -0
  64. claude_kit/_payload/rules/documentation.md +326 -0
  65. claude_kit/_payload/rules/evals.md +62 -0
  66. claude_kit/_payload/rules/frontend-best-practices.md +157 -0
  67. claude_kit/_payload/rules/goal-setting-and-monitoring.md +72 -0
  68. claude_kit/_payload/rules/human-in-the-loop.md +64 -0
  69. claude_kit/_payload/rules/linting-and-formatting.md +220 -0
  70. claude_kit/_payload/rules/mandatory-workflow.md +309 -0
  71. claude_kit/_payload/rules/model-tiers.md +34 -0
  72. claude_kit/_payload/rules/quality-gates.md +107 -0
  73. claude_kit/_payload/rules/rarv-cycle.md +31 -0
  74. claude_kit/_payload/rules/reasoning-techniques.md +62 -0
  75. claude_kit/_payload/rules/responsive-and-accessibility.md +353 -0
  76. claude_kit/_payload/rules/risk-classification.md +36 -0
  77. claude_kit/_payload/rules/testing.md +417 -0
  78. claude_kit/_payload/rules/tool-design.md +66 -0
  79. claude_kit/_payload/skills/_references/accessibility-checklist.md +160 -0
  80. claude_kit/_payload/skills/_references/orchestration-patterns.md +405 -0
  81. claude_kit/_payload/skills/_references/performance-checklist.md +153 -0
  82. claude_kit/_payload/skills/_references/security-checklist.md +134 -0
  83. claude_kit/_payload/skills/_references/testing-patterns.md +236 -0
  84. claude_kit/_payload/skills/accessibility-review/SKILL.md +56 -0
  85. claude_kit/_payload/skills/api-and-interface-design/SKILL.md +294 -0
  86. claude_kit/_payload/skills/api-integration/SKILL.md +348 -0
  87. claude_kit/_payload/skills/archive-sprint/SKILL.md +31 -0
  88. claude_kit/_payload/skills/backlog/SKILL.md +41 -0
  89. claude_kit/_payload/skills/backlog/item-template.md +20 -0
  90. claude_kit/_payload/skills/browser-testing-with-devtools/SKILL.md +302 -0
  91. claude_kit/_payload/skills/ci-cd-and-automation/SKILL.md +402 -0
  92. claude_kit/_payload/skills/code-review-and-quality/SKILL.md +347 -0
  93. claude_kit/_payload/skills/code-simplification/SKILL.md +331 -0
  94. claude_kit/_payload/skills/component-design/SKILL.md +171 -0
  95. claude_kit/_payload/skills/consolidate-learnings/SKILL.md +55 -0
  96. claude_kit/_payload/skills/context-engineering/SKILL.md +321 -0
  97. claude_kit/_payload/skills/debugging-and-error-recovery/SKILL.md +300 -0
  98. claude_kit/_payload/skills/decision/SKILL.md +46 -0
  99. claude_kit/_payload/skills/decision/adr-template.md +36 -0
  100. claude_kit/_payload/skills/deprecation-and-migration/SKILL.md +207 -0
  101. claude_kit/_payload/skills/documentation-and-adrs/SKILL.md +299 -0
  102. claude_kit/_payload/skills/doubt-driven-development/SKILL.md +243 -0
  103. claude_kit/_payload/skills/execute/SKILL.md +27 -0
  104. claude_kit/_payload/skills/frontend-ui-engineering/SKILL.md +328 -0
  105. claude_kit/_payload/skills/git-workflow-and-versioning/SKILL.md +300 -0
  106. claude_kit/_payload/skills/idea-refine/SKILL.md +178 -0
  107. claude_kit/_payload/skills/idea-refine/examples.md +238 -0
  108. claude_kit/_payload/skills/idea-refine/frameworks.md +99 -0
  109. claude_kit/_payload/skills/idea-refine/refinement-criteria.md +113 -0
  110. claude_kit/_payload/skills/idea-refine/scripts/idea-refine.sh +15 -0
  111. claude_kit/_payload/skills/incident-postmortem/SKILL.md +74 -0
  112. claude_kit/_payload/skills/incremental-implementation/SKILL.md +245 -0
  113. claude_kit/_payload/skills/interview-me/SKILL.md +221 -0
  114. claude_kit/_payload/skills/load-testing/SKILL.md +83 -0
  115. claude_kit/_payload/skills/manual-test/SKILL.md +516 -0
  116. claude_kit/_payload/skills/performance-optimization/SKILL.md +277 -0
  117. claude_kit/_payload/skills/planning-and-task-breakdown/SKILL.md +223 -0
  118. claude_kit/_payload/skills/playwright-verification/SKILL.md +205 -0
  119. claude_kit/_payload/skills/refresh-docs/SKILL.md +63 -0
  120. claude_kit/_payload/skills/remember/SKILL.md +96 -0
  121. claude_kit/_payload/skills/scope/SKILL.md +52 -0
  122. claude_kit/_payload/skills/scope/scope-template.md +82 -0
  123. claude_kit/_payload/skills/sdlc/SKILL.md +83 -0
  124. claude_kit/_payload/skills/security-and-hardening/SKILL.md +368 -0
  125. claude_kit/_payload/skills/security-verification/SKILL.md +209 -0
  126. claude_kit/_payload/skills/shipping-and-launch/SKILL.md +309 -0
  127. claude_kit/_payload/skills/smoke-test/SKILL.md +78 -0
  128. claude_kit/_payload/skills/source-driven-development/SKILL.md +195 -0
  129. claude_kit/_payload/skills/spec-driven-development/SKILL.md +200 -0
  130. claude_kit/_payload/skills/sprint/SKILL.md +67 -0
  131. claude_kit/_payload/skills/sprint/sprint-template.md +90 -0
  132. claude_kit/_payload/skills/test-driven-development/SKILL.md +383 -0
  133. claude_kit/_payload/skills/threat-model/SKILL.md +60 -0
  134. claude_kit/_payload/skills/triage/SKILL.md +87 -0
  135. claude_kit/_payload/skills/ui-ux-design/SKILL.md +71 -0
  136. claude_kit/_payload/skills/unit-test/SKILL.md +237 -0
  137. claude_kit/_payload/skills/using-agent-skills/SKILL.md +180 -0
  138. claude_kit/_payload/templates/CLAUDE.md +238 -0
  139. claude_kit/_payload/templates/CLAUDE.stack.md.tmpl +53 -0
  140. claude_kit/_payload/templates/CONTINUITY.template.md +35 -0
  141. claude_kit/_payload/templates/README.claude-sdlc.md.tmpl +219 -0
  142. claude_kit/_payload/templates/agent-memory/MEMORY.md +30 -0
  143. claude_kit/_payload/templates/agent-memory/api/.gitkeep +0 -0
  144. claude_kit/_payload/templates/agent-memory/architecture/.gitkeep +0 -0
  145. claude_kit/_payload/templates/agent-memory/debugging/.gitkeep +0 -0
  146. claude_kit/_payload/templates/agent-memory/gotchas/.gitkeep +0 -0
  147. claude_kit/_payload/templates/agent-memory/patterns/.gitkeep +0 -0
  148. claude_kit/_payload/templates/agent-memory/performance/.gitkeep +0 -0
  149. claude_kit/_payload/templates/artifacts/adr.md +18 -0
  150. claude_kit/_payload/templates/artifacts/feature-spec.md +29 -0
  151. claude_kit/_payload/templates/artifacts/release-plan.md +23 -0
  152. claude_kit/_payload/templates/artifacts/runbook.md +24 -0
  153. claude_kit/_payload/templates/artifacts/security-review.md +23 -0
  154. claude_kit/_payload/templates/artifacts/test-plan.md +22 -0
  155. claude_kit/_payload/templates/org/README.md +53 -0
  156. claude_kit/_payload/templates/org/agents/data-workflow-agent.md +59 -0
  157. claude_kit/_payload/templates/org/agents/founder-prototype-agent.md +61 -0
  158. claude_kit/_payload/templates/org/agents/internal-tools-builder.md +63 -0
  159. claude_kit/_payload/templates/org/agents/pm-copilot.md +60 -0
  160. claude_kit/_payload/templates/org/agents/support-ticket-engineer.md +63 -0
  161. claude_kit/_payload/templates/org/packs/devops-and-release/README.md +46 -0
  162. claude_kit/_payload/templates/org/packs/devops-and-release/pack.yaml +32 -0
  163. claude_kit/_payload/templates/org/packs/engineering-core/README.md +46 -0
  164. claude_kit/_payload/templates/org/packs/engineering-core/pack.yaml +44 -0
  165. claude_kit/_payload/templates/org/packs/non-engineer-builder/README.md +53 -0
  166. claude_kit/_payload/templates/org/packs/non-engineer-builder/pack.yaml +39 -0
  167. claude_kit/_payload/templates/org/packs/onboarding-and-docs/README.md +49 -0
  168. claude_kit/_payload/templates/org/packs/onboarding-and-docs/pack.yaml +26 -0
  169. claude_kit/_payload/templates/org/packs/product-to-code/README.md +50 -0
  170. claude_kit/_payload/templates/org/packs/product-to-code/pack.yaml +34 -0
  171. claude_kit/_payload/templates/org/packs/quality-and-review/README.md +53 -0
  172. claude_kit/_payload/templates/org/packs/quality-and-review/pack.yaml +40 -0
  173. claude_kit/_payload/templates/org/packs/security-and-compliance/README.md +50 -0
  174. claude_kit/_payload/templates/org/packs/security-and-compliance/pack.yaml +36 -0
  175. claude_kit/_payload/templates/org/rules/ai-working-agreement.md +45 -0
  176. claude_kit/_payload/templates/org/rules/ambiguity-resolution.md +36 -0
  177. claude_kit/_payload/templates/org/rules/branch-and-pr-policy.md +41 -0
  178. claude_kit/_payload/templates/org/rules/compliance-policy.md +50 -0
  179. claude_kit/_payload/templates/org/rules/non-engineer-safe-coding.md +37 -0
  180. claude_kit/_payload/templates/org/rules/pii-policy.md +46 -0
  181. claude_kit/_payload/templates/org/rules/production-data-policy.md +35 -0
  182. claude_kit/_payload/templates/org/rules/prompt-to-task-conversion.md +30 -0
  183. claude_kit/_payload/templates/org/rules/prototype-boundaries.md +40 -0
  184. claude_kit/_payload/templates/org/rules/secrets-policy.md +34 -0
  185. claude_kit/_payload/templates/org/skills/customer-issue-to-fix/SKILL.md +61 -0
  186. claude_kit/_payload/templates/org/skills/feature-from-idea/SKILL.md +56 -0
  187. claude_kit/_payload/templates/org/skills/prompt-to-safe-task/SKILL.md +59 -0
  188. claude_kit/_payload/templates/org/skills/prototype-to-production/SKILL.md +61 -0
  189. claude_kit/_payload/templates/org/skills/repo-onboarding/SKILL.md +60 -0
  190. claude_kit/_payload/templates/settings.json +53 -0
  191. claude_kit/_payload/templates/stacks/backend/python/fastapi/rules/fastapi-patterns.md +64 -0
  192. claude_kit/_payload/templates/stacks/db/mongodb/agents/migration-specialist.md +61 -0
  193. claude_kit/_payload/templates/stacks/db/mongodb/agents/mongodb-specialist.md +59 -0
  194. claude_kit/_payload/templates/stacks/db/mongodb/rules/mongodb-patterns.md +39 -0
  195. claude_kit/_payload/templates/stacks/db/postgres/agents/db-performance-reviewer.md +66 -0
  196. claude_kit/_payload/templates/stacks/db/postgres/agents/migration-specialist.md +56 -0
  197. claude_kit/_payload/templates/stacks/db/postgres/agents/postgres-specialist.md +58 -0
  198. claude_kit/_payload/templates/stacks/db/postgres/rules/database-performance.md +64 -0
  199. claude_kit/_payload/templates/stacks/db/postgres/rules/postgres-patterns.md +43 -0
  200. claude_kit/_payload/templates/stacks/frontend/react/rules/react-patterns.md +63 -0
  201. claude_kit/catalog.py +476 -0
  202. claude_kit/cli.py +327 -0
  203. claude_kit/hooks.py +246 -0
  204. claude_kit/models.py +205 -0
  205. claude_kit/prompts.py +209 -0
  206. claude_kit/render.py +146 -0
  207. claude_kit/scaffold.py +492 -0
  208. claude_kit/upgrader.py +294 -0
  209. claude_kit/validator.py +197 -0
@@ -0,0 +1,328 @@
1
+ ---
2
+ name: frontend-ui-engineering
3
+ description: Builds production-quality UIs. Use when building or modifying user-facing interfaces. Use when creating components, implementing layouts, managing state, or when the output needs to look and feel production-quality rather than AI-generated.
4
+ ---
5
+
6
+ # Frontend UI Engineering
7
+
8
+ ## Overview
9
+
10
+ Build production-quality user interfaces that are accessible, performant, and visually polished. The goal is UI that looks like it was built by a design-aware engineer at a top company — not like it was generated by an AI. This means real design system adherence, proper accessibility, thoughtful interaction patterns, and no generic "AI aesthetic."
11
+
12
+ ## When to Use
13
+
14
+ - Building new UI components or pages
15
+ - Modifying existing user-facing interfaces
16
+ - Implementing responsive layouts
17
+ - Adding interactivity or state management
18
+ - Fixing visual or UX issues
19
+
20
+ ## Component Architecture
21
+
22
+ ### File Structure
23
+
24
+ Colocate everything related to a component:
25
+
26
+ ```
27
+ src/components/
28
+ TaskList/
29
+ TaskList.tsx # Component implementation
30
+ TaskList.test.tsx # Tests
31
+ TaskList.stories.tsx # Storybook stories (if using)
32
+ use-task-list.ts # Custom hook (if complex state)
33
+ types.ts # Component-specific types (if needed)
34
+ ```
35
+
36
+ ### Component Patterns
37
+
38
+ **Prefer composition over configuration:**
39
+
40
+ ```tsx
41
+ // Good: Composable
42
+ <Card>
43
+ <CardHeader>
44
+ <CardTitle>Tasks</CardTitle>
45
+ </CardHeader>
46
+ <CardBody>
47
+ <TaskList tasks={tasks} />
48
+ </CardBody>
49
+ </Card>
50
+
51
+ // Avoid: Over-configured
52
+ <Card
53
+ title="Tasks"
54
+ headerVariant="large"
55
+ bodyPadding="md"
56
+ content={<TaskList tasks={tasks} />}
57
+ />
58
+ ```
59
+
60
+ **Keep components focused:**
61
+
62
+ ```tsx
63
+ // Good: Does one thing
64
+ export function TaskItem({ task, onToggle, onDelete }: TaskItemProps) {
65
+ return (
66
+ <li className="flex items-center gap-3 p-3">
67
+ <Checkbox checked={task.done} onChange={() => onToggle(task.id)} />
68
+ <span className={task.done ? 'line-through text-muted' : ''}>{task.title}</span>
69
+ <Button variant="ghost" size="sm" onClick={() => onDelete(task.id)}>
70
+ <TrashIcon />
71
+ </Button>
72
+ </li>
73
+ );
74
+ }
75
+ ```
76
+
77
+ **Separate data fetching from presentation:**
78
+
79
+ ```tsx
80
+ // Container: handles data
81
+ export function TaskListContainer() {
82
+ const { tasks, isLoading, error } = useTasks();
83
+
84
+ if (isLoading) return <TaskListSkeleton />;
85
+ if (error) return <ErrorState message="Failed to load tasks" retry={refetch} />;
86
+ if (tasks.length === 0) return <EmptyState message="No tasks yet" />;
87
+
88
+ return <TaskList tasks={tasks} />;
89
+ }
90
+
91
+ // Presentation: handles rendering
92
+ export function TaskList({ tasks }: { tasks: Task[] }) {
93
+ return (
94
+ <ul role="list" className="divide-y">
95
+ {tasks.map(task => <TaskItem key={task.id} task={task} />)}
96
+ </ul>
97
+ );
98
+ }
99
+ ```
100
+
101
+ ## State Management
102
+
103
+ **Choose the simplest approach that works:**
104
+
105
+ ```
106
+ Local state (useState, etc.) → Component-specific UI state
107
+ Lifted state → Shared between 2-3 sibling components
108
+ Context → Theme, auth, locale (read-heavy, write-rare)
109
+ URL state (searchParams) → Filters, pagination, shareable UI state
110
+ Server state (data fetching lib) → Remote data with caching
111
+ Global store → Complex client state shared app-wide
112
+ ```
113
+
114
+ **Avoid prop drilling deeper than 3 levels.** If you're passing props through components that don't use them, introduce context or restructure the component tree.
115
+
116
+ ## Design System Adherence
117
+
118
+ ### Avoid the AI Aesthetic
119
+
120
+ AI-generated UI has recognizable patterns. Avoid all of them:
121
+
122
+ | AI Default | Why It Is a Problem | Production Quality |
123
+ |---|---|---|
124
+ | Purple/indigo everything | Models default to visually "safe" palettes, making every app look identical | Use the project's actual color palette |
125
+ | Excessive gradients | Gradients add visual noise and clash with most design systems | Flat or subtle gradients matching the design system |
126
+ | Rounded everything (rounded-2xl) | Maximum rounding signals "friendly" but ignores the hierarchy of corner radii in real designs | Consistent border-radius from the design system |
127
+ | Generic hero sections | Template-driven layout with no connection to the actual content or user need | Content-first layouts |
128
+ | Lorem ipsum-style copy | Placeholder text hides layout problems that real content reveals (length, wrapping, overflow) | Realistic placeholder content |
129
+ | Oversized padding everywhere | Equal generous padding destroys visual hierarchy and wastes screen space | Consistent spacing scale |
130
+ | Stock card grids | Uniform grids are a layout shortcut that ignores information priority and scanning patterns | Purpose-driven layouts |
131
+ | Shadow-heavy design | Layered shadows add depth that competes with content and slows rendering on low-end devices | Subtle or no shadows unless the design system specifies |
132
+
133
+ ### Spacing and Layout
134
+
135
+ Use a consistent spacing scale. Don't invent values:
136
+
137
+ ```css
138
+ /* Use the scale: 0.25rem increments (or whatever the project uses) */
139
+ /* Good */ padding: 1rem; /* 16px */
140
+ /* Good */ gap: 0.75rem; /* 12px */
141
+ /* Bad */ padding: 13px; /* Not on any scale */
142
+ /* Bad */ margin-top: 2.3rem; /* Not on any scale */
143
+ ```
144
+
145
+ ### Typography
146
+
147
+ Respect the type hierarchy:
148
+
149
+ ```
150
+ h1 → Page title (one per page)
151
+ h2 → Section title
152
+ h3 → Subsection title
153
+ body → Default text
154
+ small → Secondary/helper text
155
+ ```
156
+
157
+ Don't skip heading levels. Don't use heading styles for non-heading content.
158
+
159
+ ### Color
160
+
161
+ - Use semantic color tokens: `text-primary`, `bg-surface`, `border-default` — not raw hex values
162
+ - Ensure sufficient contrast (4.5:1 for normal text, 3:1 for large text)
163
+ - Don't rely solely on color to convey information (use icons, text, or patterns too)
164
+
165
+ ## Accessibility (WCAG 2.1 AA)
166
+
167
+ Every component must meet these standards:
168
+
169
+ ### Keyboard Navigation
170
+
171
+ ```tsx
172
+ // Every interactive element must be keyboard accessible
173
+ <button onClick={handleClick}>Click me</button> // ✓ Focusable by default
174
+ <div onClick={handleClick}>Click me</div> // ✗ Not focusable
175
+ <div role="button" tabIndex={0} onClick={handleClick} // ✓ But prefer <button>
176
+ onKeyDown={e => {
177
+ if (e.key === 'Enter') handleClick();
178
+ if (e.key === ' ') e.preventDefault();
179
+ }}
180
+ onKeyUp={e => {
181
+ if (e.key === ' ') handleClick();
182
+ }}>
183
+ Click me
184
+ </div>
185
+ ```
186
+
187
+ ### ARIA Labels
188
+
189
+ ```tsx
190
+ // Label interactive elements that lack visible text
191
+ <button aria-label="Close dialog"><XIcon /></button>
192
+
193
+ // Label form inputs
194
+ <label htmlFor="email">Email</label>
195
+ <input id="email" type="email" />
196
+
197
+ // Or use aria-label when no visible label exists
198
+ <input aria-label="Search tasks" type="search" />
199
+ ```
200
+
201
+ ### Focus Management
202
+
203
+ ```tsx
204
+ // Move focus when content changes
205
+ function Dialog({ isOpen, onClose }: DialogProps) {
206
+ const closeRef = useRef<HTMLButtonElement>(null);
207
+
208
+ useEffect(() => {
209
+ if (isOpen) closeRef.current?.focus();
210
+ }, [isOpen]);
211
+
212
+ // Trap focus inside dialog when open
213
+ return (
214
+ <dialog open={isOpen}>
215
+ <button ref={closeRef} onClick={onClose}>Close</button>
216
+ {/* dialog content */}
217
+ </dialog>
218
+ );
219
+ }
220
+ ```
221
+
222
+ ### Meaningful Empty and Error States
223
+
224
+ ```tsx
225
+ // Don't show blank screens
226
+ function TaskList({ tasks }: { tasks: Task[] }) {
227
+ if (tasks.length === 0) {
228
+ return (
229
+ <div role="status" className="text-center py-12">
230
+ <TasksEmptyIcon className="mx-auto h-12 w-12 text-muted" />
231
+ <h3 className="mt-2 text-sm font-medium">No tasks</h3>
232
+ <p className="mt-1 text-sm text-muted">Get started by creating a new task.</p>
233
+ <Button className="mt-4" onClick={onCreateTask}>Create Task</Button>
234
+ </div>
235
+ );
236
+ }
237
+
238
+ return <ul role="list">...</ul>;
239
+ }
240
+ ```
241
+
242
+ ## Responsive Design
243
+
244
+ Design for mobile first, then expand:
245
+
246
+ ```tsx
247
+ // Example: mobile-first responsive classes
248
+ <div className="
249
+ grid grid-cols-1 /* Mobile: single column */
250
+ sm:grid-cols-2 /* Small: 2 columns */
251
+ lg:grid-cols-3 /* Large: 3 columns */
252
+ gap-4
253
+ ">
254
+ ```
255
+
256
+ Test at these breakpoints: 320px, 768px, 1024px, 1440px.
257
+
258
+ ## Loading and Transitions
259
+
260
+ ```tsx
261
+ // Skeleton loading (not spinners for content)
262
+ function TaskListSkeleton() {
263
+ return (
264
+ <div className="space-y-3" aria-busy="true" aria-label="Loading tasks">
265
+ {Array.from({ length: 3 }).map((_, i) => (
266
+ <div key={i} className="h-12 bg-muted animate-pulse rounded" />
267
+ ))}
268
+ </div>
269
+ );
270
+ }
271
+
272
+ // Optimistic updates for perceived speed (example with a data fetching library)
273
+ function useToggleTask() {
274
+ const queryClient = useQueryClient();
275
+
276
+ return useMutation({
277
+ mutationFn: toggleTask,
278
+ onMutate: async (taskId) => {
279
+ await queryClient.cancelQueries({ queryKey: ['tasks'] });
280
+ const previous = queryClient.getQueryData(['tasks']);
281
+
282
+ queryClient.setQueryData(['tasks'], (old: Task[]) =>
283
+ old.map(t => t.id === taskId ? { ...t, done: !t.done } : t)
284
+ );
285
+
286
+ return { previous };
287
+ },
288
+ onError: (_err, _taskId, context) => {
289
+ queryClient.setQueryData(['tasks'], context?.previous);
290
+ },
291
+ });
292
+ }
293
+ ```
294
+
295
+ ## See Also
296
+
297
+ For detailed accessibility requirements and testing tools, see `.claude/skills/_references/accessibility-checklist.md`.
298
+
299
+ ## Common Rationalizations
300
+
301
+ | Rationalization | Reality |
302
+ |---|---|
303
+ | "Accessibility is a nice-to-have" | It's a legal requirement in many jurisdictions and an engineering quality standard. |
304
+ | "We'll make it responsive later" | Retrofitting responsive design is 3x harder than building it from the start. |
305
+ | "The design isn't final, so I'll skip styling" | Use the design system defaults. Unstyled UI creates a broken first impression for reviewers. |
306
+ | "This is just a prototype" | Prototypes become production code. Build the foundation right. |
307
+ | "The AI aesthetic is fine for now" | It signals low quality. Use the project's actual design system from the start. |
308
+
309
+ ## Red Flags
310
+
311
+ - Components with more than 200 lines (split them)
312
+ - Inline styles or arbitrary pixel values
313
+ - Missing error states, loading states, or empty states
314
+ - No keyboard navigation testing
315
+ - Color as the sole indicator of state (red/green without text or icons)
316
+ - Generic "AI look" (purple gradients, oversized cards, stock layouts)
317
+
318
+ ## Verification
319
+
320
+ After building UI:
321
+
322
+ - [ ] Component renders without console errors
323
+ - [ ] All interactive elements are keyboard accessible (Tab through the page)
324
+ - [ ] Screen reader can convey the page's content and structure
325
+ - [ ] Responsive: works at 320px, 768px, 1024px, 1440px
326
+ - [ ] Loading, error, and empty states all handled
327
+ - [ ] Follows the project's design system (spacing, colors, typography)
328
+ - [ ] No accessibility warnings in dev tools or axe-core
@@ -0,0 +1,300 @@
1
+ ---
2
+ name: git-workflow-and-versioning
3
+ description: Structures git workflow practices for any codebase. Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.
4
+ ---
5
+
6
+ # Git Workflow and Versioning
7
+
8
+ ## Overview
9
+
10
+ Git is your safety net. Treat commits as save points, branches as sandboxes, and history as documentation. With AI agents generating code at high speed, disciplined version control is the mechanism that keeps changes manageable, reviewable, and reversible.
11
+
12
+ ## When to Use
13
+
14
+ Always. Every code change flows through git.
15
+
16
+ ## Core Principles
17
+
18
+ ### Trunk-Based Development (Recommended)
19
+
20
+ Keep `main` always deployable. Work in short-lived feature branches that merge back within 1-3 days. Long-lived development branches are hidden costs — they diverge, create merge conflicts, and delay integration. DORA research consistently shows trunk-based development correlates with high-performing engineering teams.
21
+
22
+ ```
23
+ main ──●──●──●──●──●──●──●──●──●── (always deployable)
24
+ ╲ ╱ ╲ ╱
25
+ ●──●─╱ ●──╱ ← short-lived feature branches (1-3 days)
26
+ ```
27
+
28
+ This is the recommended default. Teams using gitflow or long-lived branches can adapt the principles (atomic commits, small changes, descriptive messages) to their branching model — the commit discipline matters more than the specific branching strategy.
29
+
30
+ - **Dev branches are costs.** Every day a branch lives, it accumulates merge risk.
31
+ - **Release branches are acceptable.** When you need to stabilize a release while main moves forward.
32
+ - **Feature flags > long branches.** Prefer deploying incomplete work behind flags rather than keeping it on a branch for weeks.
33
+
34
+ ### 1. Commit Early, Commit Often
35
+
36
+ Each successful increment gets its own commit. Don't accumulate large uncommitted changes.
37
+
38
+ ```
39
+ Work pattern:
40
+ Implement slice → Test → Verify → Commit → Next slice
41
+
42
+ Not this:
43
+ Implement everything → Hope it works → Giant commit
44
+ ```
45
+
46
+ Commits are save points. If the next change breaks something, you can revert to the last known-good state instantly.
47
+
48
+ ### 2. Atomic Commits
49
+
50
+ Each commit does one logical thing:
51
+
52
+ ```
53
+ # Good: Each commit is self-contained
54
+ git log --oneline
55
+ a1b2c3d Add task creation endpoint with validation
56
+ d4e5f6g Add task creation form component
57
+ h7i8j9k Connect form to API and add loading state
58
+ m1n2o3p Add task creation tests (unit + integration)
59
+
60
+ # Bad: Everything mixed together
61
+ git log --oneline
62
+ x1y2z3a Add task feature, fix sidebar, update deps, refactor utils
63
+ ```
64
+
65
+ ### 3. Descriptive Messages
66
+
67
+ Commit messages explain the *why*, not just the *what*:
68
+
69
+ ```
70
+ # Good: Explains intent
71
+ feat: add email validation to registration endpoint
72
+
73
+ Prevents invalid email formats from reaching the database.
74
+ Uses schema validation at the route handler level,
75
+ consistent with existing validation patterns in the auth module.
76
+
77
+ # Bad: Describes what's obvious from the diff
78
+ update auth module
79
+ ```
80
+
81
+ **Format:**
82
+ ```
83
+ <type>: <short description>
84
+
85
+ <optional body explaining why, not what>
86
+ ```
87
+
88
+ **Types:**
89
+ - `feat` — New feature
90
+ - `fix` — Bug fix
91
+ - `refactor` — Code change that neither fixes a bug nor adds a feature
92
+ - `test` — Adding or updating tests
93
+ - `docs` — Documentation only
94
+ - `chore` — Tooling, dependencies, config
95
+
96
+ ### 4. Keep Concerns Separate
97
+
98
+ Don't combine formatting changes with behavior changes. Don't combine refactors with features. Each type of change should be a separate commit — and ideally a separate PR:
99
+
100
+ ```
101
+ # Good: Separate concerns
102
+ git commit -m "refactor: extract validation logic to shared utility"
103
+ git commit -m "feat: add phone number validation to registration"
104
+
105
+ # Bad: Mixed concerns
106
+ git commit -m "refactor validation and add phone number field"
107
+ ```
108
+
109
+ **Separate refactoring from feature work.** A refactoring change and a feature change are two different changes — submit them separately. This makes each change easier to review, revert, and understand in history. Small cleanups (renaming a variable) can be included in a feature commit at reviewer discretion.
110
+
111
+ ### 5. Size Your Changes
112
+
113
+ Target ~100 lines per commit/PR. Changes over ~1000 lines should be split. See the splitting strategies in `code-review-and-quality` for how to break down large changes.
114
+
115
+ ```
116
+ ~100 lines → Easy to review, easy to revert
117
+ ~300 lines → Acceptable for a single logical change
118
+ ~1000 lines → Split into smaller changes
119
+ ```
120
+
121
+ ## Branching Strategy
122
+
123
+ ### Feature Branches
124
+
125
+ ```
126
+ main (always deployable)
127
+
128
+ ├── feature/task-creation ← One feature per branch
129
+ ├── feature/user-settings ← Parallel work
130
+ └── fix/duplicate-tasks ← Bug fixes
131
+ ```
132
+
133
+ - Branch from `main` (or the team's default branch)
134
+ - Keep branches short-lived (merge within 1-3 days) — long-lived branches are hidden costs
135
+ - Delete branches after merge
136
+ - Prefer feature flags over long-lived branches for incomplete features
137
+
138
+ ### Branch Naming
139
+
140
+ ```
141
+ feature/<short-description> → feature/task-creation
142
+ fix/<short-description> → fix/duplicate-tasks
143
+ chore/<short-description> → chore/update-deps
144
+ refactor/<short-description> → refactor/auth-module
145
+ ```
146
+
147
+ ## Working with Worktrees
148
+
149
+ For parallel AI agent work, use git worktrees to run multiple branches simultaneously:
150
+
151
+ ```bash
152
+ # Create a worktree for a feature branch
153
+ git worktree add ../project-feature-a feature/task-creation
154
+ git worktree add ../project-feature-b feature/user-settings
155
+
156
+ # Each worktree is a separate directory with its own branch
157
+ # Agents can work in parallel without interfering
158
+ ls ../
159
+ project/ ← main branch
160
+ project-feature-a/ ← task-creation branch
161
+ project-feature-b/ ← user-settings branch
162
+
163
+ # When done, merge and clean up
164
+ git worktree remove ../project-feature-a
165
+ ```
166
+
167
+ Benefits:
168
+ - Multiple agents can work on different features simultaneously
169
+ - No branch switching needed (each directory has its own branch)
170
+ - If one experiment fails, delete the worktree — nothing is lost
171
+ - Changes are isolated until explicitly merged
172
+
173
+ ## The Save Point Pattern
174
+
175
+ ```
176
+ Agent starts work
177
+
178
+ ├── Makes a change
179
+ │ ├── Test passes? → Commit → Continue
180
+ │ └── Test fails? → Revert to last commit → Investigate
181
+
182
+ ├── Makes another change
183
+ │ ├── Test passes? → Commit → Continue
184
+ │ └── Test fails? → Revert to last commit → Investigate
185
+
186
+ └── Feature complete → All commits form a clean history
187
+ ```
188
+
189
+ This pattern means you never lose more than one increment of work. If an agent goes off the rails, `git reset --hard HEAD` takes you back to the last successful state.
190
+
191
+ ## Change Summaries
192
+
193
+ After any modification, provide a structured summary. This makes review easier, documents scope discipline, and surfaces unintended changes:
194
+
195
+ ```
196
+ CHANGES MADE:
197
+ - src/routes/tasks.js: Added validation middleware to POST endpoint
198
+ - src/lib/validation.js: Added task creation schema validation
199
+
200
+ THINGS I DIDN'T TOUCH (intentionally):
201
+ - src/routes/auth.js: Has similar validation gap but out of scope
202
+ - src/middleware/error.js: Error format could be improved (separate task)
203
+
204
+ POTENTIAL CONCERNS:
205
+ - The validation schema is strict — rejects extra fields. Confirm this is desired.
206
+ - Added validation library as a dependency — already in project dependencies
207
+ ```
208
+
209
+ This pattern catches wrong assumptions early and gives reviewers a clear map of the change. The "DIDN'T TOUCH" section is especially important — it shows you exercised scope discipline and didn't go on an unsolicited renovation.
210
+
211
+ ## Pre-Commit Hygiene
212
+
213
+ Before every commit:
214
+
215
+ ```bash
216
+ # 1. Check what you're about to commit
217
+ git diff --staged
218
+
219
+ # 2. Ensure no secrets
220
+ git diff --staged | grep -i "password\|secret\|api_key\|token"
221
+
222
+ # 3. Run tests
223
+ <run the project's test runner>
224
+
225
+ # 4. Run linting
226
+ <run the project's linter>
227
+
228
+ # 5. Run type checking (if applicable)
229
+ <run the project's type checker>
230
+ ```
231
+
232
+ Automate this with git hooks (e.g., using husky, pre-commit, or similar):
233
+
234
+ ```json
235
+ // Example: package.json (Node projects using lint-staged + husky)
236
+ {
237
+ "lint-staged": {
238
+ "*.{js,ts}": ["<linter> --fix", "<formatter>"],
239
+ "*.{json,md}": ["<formatter>"]
240
+ }
241
+ }
242
+ ```
243
+
244
+ ## Handling Generated Files
245
+
246
+ - **Commit generated files** only if the project expects them (e.g., lock files, migration files generated by the migration tool)
247
+ - **Don't commit** build output (dist/, build/, .next/), environment files (.env), or IDE config unless shared
248
+ - **Have a `.gitignore`** that covers: dependencies directories, build output, environment files, IDE configs, credentials
249
+
250
+ ## Using Git for Debugging
251
+
252
+ ```bash
253
+ # Find which commit introduced a bug
254
+ git bisect start
255
+ git bisect bad HEAD
256
+ git bisect good <known-good-commit>
257
+ # Git checkouts midpoints; run your test at each to narrow down
258
+
259
+ # View what changed recently
260
+ git log --oneline -20
261
+ git diff HEAD~5..HEAD -- src/
262
+
263
+ # Find who last changed a specific line
264
+ git blame src/services/task.js
265
+
266
+ # Search commit messages for a keyword
267
+ git log --grep="validation" --oneline
268
+ ```
269
+
270
+ ## Common Rationalizations
271
+
272
+ | Rationalization | Reality |
273
+ |---|---|
274
+ | "I'll commit when the feature is done" | One giant commit is impossible to review, debug, or revert. Commit each slice. |
275
+ | "The message doesn't matter" | Messages are documentation. Future you (and future agents) will need to understand what changed and why. |
276
+ | "I'll squash it all later" | Squashing destroys the development narrative. Prefer clean incremental commits from the start. |
277
+ | "Branches add overhead" | Short-lived branches are free and prevent conflicting work from colliding. Long-lived branches are the problem — merge within 1-3 days. |
278
+ | "I'll split this change later" | Large changes are harder to review, riskier to deploy, and harder to revert. Split before submitting, not after. |
279
+ | "I don't need a .gitignore" | Until .env with production secrets gets committed. Set it up immediately. |
280
+
281
+ ## Red Flags
282
+
283
+ - Large uncommitted changes accumulating
284
+ - Commit messages like "fix", "update", "misc"
285
+ - Formatting changes mixed with behavior changes
286
+ - No `.gitignore` in the project
287
+ - Committing dependency directories, environment files, or build artifacts
288
+ - Long-lived branches that diverge significantly from main
289
+ - Force-pushing to shared branches
290
+
291
+ ## Verification
292
+
293
+ For every commit:
294
+
295
+ - [ ] Commit does one logical thing
296
+ - [ ] Message explains the why, follows type conventions
297
+ - [ ] Tests pass before committing
298
+ - [ ] No secrets in the diff
299
+ - [ ] No formatting-only changes mixed with behavior changes
300
+ - [ ] `.gitignore` covers standard exclusions