@champpaba/claude-agent-kit 1.0.0

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 (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +561 -0
  3. package/bin/cli.js +61 -0
  4. package/lib/init.js +52 -0
  5. package/lib/update.js +73 -0
  6. package/package.json +47 -0
  7. package/template/.claude/CHANGELOG-v1.1.1.md +259 -0
  8. package/template/.claude/CLAUDE.md +329 -0
  9. package/template/.claude/agents/01-integration.md +797 -0
  10. package/template/.claude/agents/02-uxui-frontend.md +899 -0
  11. package/template/.claude/agents/03-test-debug.md +759 -0
  12. package/template/.claude/agents/04-frontend.md +1099 -0
  13. package/template/.claude/agents/05-backend.md +1217 -0
  14. package/template/.claude/agents/06-database.md +969 -0
  15. package/template/.claude/commands/agentsetup.md +1464 -0
  16. package/template/.claude/commands/cdev.md +327 -0
  17. package/template/.claude/commands/csetup.md +447 -0
  18. package/template/.claude/commands/cstatus.md +60 -0
  19. package/template/.claude/commands/cview.md +364 -0
  20. package/template/.claude/commands/psetup.md +101 -0
  21. package/template/.claude/contexts/design/accessibility.md +611 -0
  22. package/template/.claude/contexts/design/box-thinking.md +553 -0
  23. package/template/.claude/contexts/design/color-theory.md +498 -0
  24. package/template/.claude/contexts/design/index.md +247 -0
  25. package/template/.claude/contexts/design/layout.md +400 -0
  26. package/template/.claude/contexts/design/responsive.md +551 -0
  27. package/template/.claude/contexts/design/shadows.md +522 -0
  28. package/template/.claude/contexts/design/spacing.md +428 -0
  29. package/template/.claude/contexts/design/typography.md +465 -0
  30. package/template/.claude/contexts/domain/README.md +164 -0
  31. package/template/.claude/contexts/patterns/agent-coordination.md +388 -0
  32. package/template/.claude/contexts/patterns/agent-discovery.md +182 -0
  33. package/template/.claude/contexts/patterns/change-workflow.md +538 -0
  34. package/template/.claude/contexts/patterns/code-standards.md +515 -0
  35. package/template/.claude/contexts/patterns/development-principles.md +513 -0
  36. package/template/.claude/contexts/patterns/error-handling.md +478 -0
  37. package/template/.claude/contexts/patterns/error-recovery.md +365 -0
  38. package/template/.claude/contexts/patterns/frontend-component-strategy.md +365 -0
  39. package/template/.claude/contexts/patterns/git-workflow.md +207 -0
  40. package/template/.claude/contexts/patterns/logging.md +424 -0
  41. package/template/.claude/contexts/patterns/task-breakdown.md +452 -0
  42. package/template/.claude/contexts/patterns/task-classification.md +523 -0
  43. package/template/.claude/contexts/patterns/tdd-classification.md +516 -0
  44. package/template/.claude/contexts/patterns/testing.md +413 -0
  45. package/template/.claude/contexts/patterns/ui-component-consistency.md +304 -0
  46. package/template/.claude/contexts/patterns/validation-framework.md +776 -0
  47. package/template/.claude/lib/README.md +39 -0
  48. package/template/.claude/lib/agent-executor.md +258 -0
  49. package/template/.claude/lib/agent-router.md +572 -0
  50. package/template/.claude/lib/flags-updater.md +469 -0
  51. package/template/.claude/lib/tdd-classifier.md +345 -0
  52. package/template/.claude/lib/validation-gates.md +484 -0
  53. package/template/.claude/settings.local.json +42 -0
  54. package/template/.claude/templates/context-template.md +45 -0
  55. package/template/.claude/templates/flags-template.json +42 -0
  56. package/template/.claude/templates/phase-templates.json +124 -0
  57. package/template/.claude/templates/phases-sections/accessibility-test.md +17 -0
  58. package/template/.claude/templates/phases-sections/api-design.md +37 -0
  59. package/template/.claude/templates/phases-sections/backend-tests.md +16 -0
  60. package/template/.claude/templates/phases-sections/backend.md +37 -0
  61. package/template/.claude/templates/phases-sections/business-logic-validation.md +16 -0
  62. package/template/.claude/templates/phases-sections/component-tests.md +17 -0
  63. package/template/.claude/templates/phases-sections/contract-backend.md +16 -0
  64. package/template/.claude/templates/phases-sections/contract-frontend.md +16 -0
  65. package/template/.claude/templates/phases-sections/database.md +35 -0
  66. package/template/.claude/templates/phases-sections/documentation.md +17 -0
  67. package/template/.claude/templates/phases-sections/e2e-tests.md +16 -0
  68. package/template/.claude/templates/phases-sections/fix-implementation.md +17 -0
  69. package/template/.claude/templates/phases-sections/frontend-integration.md +18 -0
  70. package/template/.claude/templates/phases-sections/frontend-mockup.md +123 -0
  71. package/template/.claude/templates/phases-sections/manual-flow-test.md +15 -0
  72. package/template/.claude/templates/phases-sections/manual-ux-test.md +16 -0
  73. package/template/.claude/templates/phases-sections/refactor-implementation.md +17 -0
  74. package/template/.claude/templates/phases-sections/refactor.md +16 -0
  75. package/template/.claude/templates/phases-sections/regression-tests.md +15 -0
  76. package/template/.claude/templates/phases-sections/report.md +16 -0
  77. package/template/.claude/templates/phases-sections/responsive-test.md +16 -0
  78. package/template/.claude/templates/phases-sections/script-implementation.md +43 -0
  79. package/template/.claude/templates/phases-sections/test-coverage.md +16 -0
  80. package/template/.claude/templates/phases-sections/user-approval.md +14 -0
@@ -0,0 +1,428 @@
1
+ # Spacing System
2
+
3
+ > **Purpose:** Consistent spacing scale for layouts, components, and rhythm
4
+
5
+ ---
6
+
7
+ ## Base Unit Approach
8
+
9
+ **Core Principle:** All spacing should be multiples of a base unit for consistency
10
+
11
+ ```css
12
+ --spacing: 0.25rem; /* 4px - Base spacing unit (at default 16px root font size) */
13
+ ```
14
+
15
+ **Why 0.25rem (4px)?**
16
+ - ✅ Divisible by 2, 4, 8 (common design ratios)
17
+ - ✅ Works with 8px grid systems (common in Figma, Sketch)
18
+ - ✅ Small enough for fine-tuning
19
+ - ✅ Large enough to be visually meaningful
20
+
21
+ ---
22
+
23
+ ## Spacing Scale
24
+
25
+ ### Standard Scale (Multiples of Base)
26
+
27
+ | Token | Value | Pixels | Common Use Case |
28
+ |-------|-------|--------|-----------------|
29
+ | `spacing-1` | 0.25rem | 4px | Tiny gaps (icon padding, tight spacing) |
30
+ | `spacing-2` | 0.5rem | 8px | Small gaps (button padding, input padding) |
31
+ | `spacing-3` | 0.75rem | 12px | Medium gaps (card padding, list items) |
32
+ | `spacing-4` | 1rem | 16px | Default gaps (section spacing, form fields) |
33
+ | `spacing-5` | 1.25rem | 20px | Between default and large |
34
+ | `spacing-6` | 1.5rem | 24px | Large gaps (component spacing, cards) |
35
+ | `spacing-8` | 2rem | 32px | XL gaps (section margins, page headers) |
36
+ | `spacing-10` | 2.5rem | 40px | XXL gaps (major sections) |
37
+ | `spacing-12` | 3rem | 48px | XXXL gaps (page margins, hero sections) |
38
+ | `spacing-16` | 4rem | 64px | Huge gaps (full section spacing) |
39
+ | `spacing-20` | 5rem | 80px | Extra huge (landing page sections) |
40
+ | `spacing-24` | 6rem | 96px | Maximum (hero padding, page dividers) |
41
+
42
+ ### Implementation
43
+
44
+ ```css
45
+ :root {
46
+ /* Base unit */
47
+ --spacing-base: 0.25rem;
48
+
49
+ /* Scale */
50
+ --spacing-1: calc(var(--spacing-base) * 1); /* 0.25rem / 4px */
51
+ --spacing-2: calc(var(--spacing-base) * 2); /* 0.5rem / 8px */
52
+ --spacing-3: calc(var(--spacing-base) * 3); /* 0.75rem / 12px */
53
+ --spacing-4: calc(var(--spacing-base) * 4); /* 1rem / 16px */
54
+ --spacing-5: calc(var(--spacing-base) * 5); /* 1.25rem / 20px */
55
+ --spacing-6: calc(var(--spacing-base) * 6); /* 1.5rem / 24px */
56
+ --spacing-8: calc(var(--spacing-base) * 8); /* 2rem / 32px */
57
+ --spacing-10: calc(var(--spacing-base) * 10); /* 2.5rem / 40px */
58
+ --spacing-12: calc(var(--spacing-base) * 12); /* 3rem / 48px */
59
+ --spacing-16: calc(var(--spacing-base) * 16); /* 4rem / 64px */
60
+ --spacing-20: calc(var(--spacing-base) * 20); /* 5rem / 80px */
61
+ --spacing-24: calc(var(--spacing-base) * 24); /* 6rem / 96px */
62
+ }
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Usage Patterns
68
+
69
+ ### Component Padding
70
+
71
+ **Buttons:**
72
+ ```css
73
+ /* Small button */
74
+ .btn-sm {
75
+ padding: var(--spacing-1) var(--spacing-3); /* 4px 12px */
76
+ }
77
+
78
+ /* Default button */
79
+ .btn {
80
+ padding: var(--spacing-2) var(--spacing-4); /* 8px 16px */
81
+ }
82
+
83
+ /* Large button */
84
+ .btn-lg {
85
+ padding: var(--spacing-3) var(--spacing-6); /* 12px 24px */
86
+ }
87
+ ```
88
+
89
+ **Cards:**
90
+ ```css
91
+ .card {
92
+ padding: var(--spacing-6); /* 24px */
93
+ }
94
+
95
+ .card-compact {
96
+ padding: var(--spacing-4); /* 16px */
97
+ }
98
+
99
+ .card-spacious {
100
+ padding: var(--spacing-8); /* 32px */
101
+ }
102
+ ```
103
+
104
+ **Inputs:**
105
+ ```css
106
+ .input {
107
+ padding: var(--spacing-2) var(--spacing-3); /* 8px 12px */
108
+ }
109
+
110
+ .input-large {
111
+ padding: var(--spacing-3) var(--spacing-4); /* 12px 16px */
112
+ }
113
+ ```
114
+
115
+ ---
116
+
117
+ ### Component Gaps (Spacing Between Elements)
118
+
119
+ **Stack (Vertical Spacing):**
120
+ ```css
121
+ /* Tight stack (list items) */
122
+ .stack-tight > * + * {
123
+ margin-top: var(--spacing-2); /* 8px */
124
+ }
125
+
126
+ /* Default stack (form fields) */
127
+ .stack > * + * {
128
+ margin-top: var(--spacing-4); /* 16px */
129
+ }
130
+
131
+ /* Loose stack (sections) */
132
+ .stack-loose > * + * {
133
+ margin-top: var(--spacing-8); /* 32px */
134
+ }
135
+ ```
136
+
137
+ **Inline (Horizontal Spacing):**
138
+ ```css
139
+ /* Tight inline (breadcrumbs) */
140
+ .inline-tight > * + * {
141
+ margin-left: var(--spacing-2); /* 8px */
142
+ }
143
+
144
+ /* Default inline (button groups) */
145
+ .inline > * + * {
146
+ margin-left: var(--spacing-4); /* 16px */
147
+ }
148
+
149
+ /* Loose inline (navigation items) */
150
+ .inline-loose > * + * {
151
+ margin-left: var(--spacing-6); /* 24px */
152
+ }
153
+ ```
154
+
155
+ **Grid Gaps:**
156
+ ```css
157
+ /* Tight grid (image galleries) */
158
+ .grid-tight {
159
+ gap: var(--spacing-2); /* 8px */
160
+ }
161
+
162
+ /* Default grid (product listings) */
163
+ .grid {
164
+ gap: var(--spacing-4); /* 16px */
165
+ }
166
+
167
+ /* Loose grid (feature cards) */
168
+ .grid-loose {
169
+ gap: var(--spacing-8); /* 32px */
170
+ }
171
+ ```
172
+
173
+ ---
174
+
175
+ ### Layout Spacing
176
+
177
+ **Page Margins:**
178
+ ```css
179
+ /* Mobile (small screens) */
180
+ .page-container {
181
+ padding: var(--spacing-4); /* 16px */
182
+ }
183
+
184
+ /* Tablet */
185
+ @media (min-width: 640px) {
186
+ .page-container {
187
+ padding: var(--spacing-6); /* 24px */
188
+ }
189
+ }
190
+
191
+ /* Desktop */
192
+ @media (min-width: 1024px) {
193
+ .page-container {
194
+ padding: var(--spacing-8); /* 32px */
195
+ }
196
+ }
197
+ ```
198
+
199
+ **Section Spacing:**
200
+ ```css
201
+ /* Between page sections */
202
+ .section {
203
+ margin-bottom: var(--spacing-12); /* 48px */
204
+ }
205
+
206
+ @media (min-width: 1024px) {
207
+ .section {
208
+ margin-bottom: var(--spacing-16); /* 64px */
209
+ }
210
+ }
211
+ ```
212
+
213
+ **Component Spacing:**
214
+ ```css
215
+ /* Between components in a section */
216
+ .component {
217
+ margin-bottom: var(--spacing-6); /* 24px */
218
+ }
219
+ ```
220
+
221
+ ---
222
+
223
+ ## Vertical Rhythm
224
+
225
+ **Definition:** Consistent vertical spacing creates visual harmony
226
+
227
+ ### Line Height + Margin System
228
+
229
+ ```css
230
+ /* Typography with rhythm */
231
+ p {
232
+ margin-bottom: var(--spacing-4); /* 16px */
233
+ line-height: 1.5; /* 24px at 16px font size */
234
+ }
235
+
236
+ h1 {
237
+ margin-bottom: var(--spacing-6); /* 24px */
238
+ line-height: 1.2; /* 48px at 40px font size */
239
+ }
240
+
241
+ h2 {
242
+ margin-bottom: var(--spacing-4); /* 16px */
243
+ line-height: 1.3; /* 41.6px at 32px font size */
244
+ }
245
+ ```
246
+
247
+ **Rule:** Margin-bottom should be a multiple of base unit (4px)
248
+
249
+ ---
250
+
251
+ ## White Space
252
+
253
+ **Principle:** White space (negative space) is as important as content
254
+
255
+ ### Content Density Levels
256
+
257
+ **Tight (Compact):**
258
+ ```css
259
+ /* Use for: Data tables, dashboards, dense information */
260
+ .container-tight {
261
+ padding: var(--spacing-2); /* 8px */
262
+ gap: var(--spacing-2); /* 8px */
263
+ }
264
+ ```
265
+
266
+ **Default (Balanced):**
267
+ ```css
268
+ /* Use for: Standard pages, forms, articles */
269
+ .container {
270
+ padding: var(--spacing-4); /* 16px */
271
+ gap: var(--spacing-4); /* 16px */
272
+ }
273
+ ```
274
+
275
+ **Loose (Spacious):**
276
+ ```css
277
+ /* Use for: Landing pages, marketing content, hero sections */
278
+ .container-loose {
279
+ padding: var(--spacing-8); /* 32px */
280
+ gap: var(--spacing-8); /* 32px */
281
+ }
282
+ ```
283
+
284
+ ---
285
+
286
+ ## Responsive Spacing
287
+
288
+ ### Mobile-First Scaling
289
+
290
+ ```css
291
+ /* Mobile (default) */
292
+ .section {
293
+ padding: var(--spacing-4); /* 16px */
294
+ margin-bottom: var(--spacing-8); /* 32px */
295
+ }
296
+
297
+ /* Tablet (640px+) */
298
+ @media (min-width: 640px) {
299
+ .section {
300
+ padding: var(--spacing-6); /* 24px */
301
+ margin-bottom: var(--spacing-12); /* 48px */
302
+ }
303
+ }
304
+
305
+ /* Desktop (1024px+) */
306
+ @media (min-width: 1024px) {
307
+ .section {
308
+ padding: var(--spacing-8); /* 32px */
309
+ margin-bottom: var(--spacing-16); /* 64px */
310
+ }
311
+ }
312
+ ```
313
+
314
+ **Pattern:** Increase spacing ~1.5-2x per breakpoint
315
+
316
+ ---
317
+
318
+ ## Common Spacing Patterns
319
+
320
+ ### Navigation
321
+
322
+ ```css
323
+ /* Header padding */
324
+ .header {
325
+ padding: var(--spacing-4) var(--spacing-6); /* 16px 24px */
326
+ }
327
+
328
+ /* Navigation item spacing */
329
+ .nav-item + .nav-item {
330
+ margin-left: var(--spacing-6); /* 24px */
331
+ }
332
+ ```
333
+
334
+ ### Forms
335
+
336
+ ```css
337
+ /* Label to input */
338
+ .form-field label {
339
+ margin-bottom: var(--spacing-2); /* 8px */
340
+ }
341
+
342
+ /* Between form fields */
343
+ .form-field + .form-field {
344
+ margin-top: var(--spacing-4); /* 16px */
345
+ }
346
+
347
+ /* Form groups */
348
+ .form-group + .form-group {
349
+ margin-top: var(--spacing-8); /* 32px */
350
+ }
351
+ ```
352
+
353
+ ### Cards
354
+
355
+ ```css
356
+ .card {
357
+ padding: var(--spacing-6); /* 24px */
358
+ border-radius: var(--spacing-2); /* 8px */
359
+ }
360
+
361
+ .card-header {
362
+ margin-bottom: var(--spacing-4); /* 16px */
363
+ padding-bottom: var(--spacing-4); /* 16px */
364
+ border-bottom: 1px solid var(--color-border);
365
+ }
366
+
367
+ .card-body {
368
+ padding: var(--spacing-4) 0; /* 16px 0 */
369
+ }
370
+
371
+ .card-footer {
372
+ margin-top: var(--spacing-4); /* 16px */
373
+ padding-top: var(--spacing-4); /* 16px */
374
+ border-top: 1px solid var(--color-border);
375
+ }
376
+ ```
377
+
378
+ ---
379
+
380
+ ## Best Practices
381
+
382
+ ### DO:
383
+ - ✅ Use spacing scale values only (no arbitrary values)
384
+ - ✅ Maintain consistent gaps in similar contexts
385
+ - ✅ Scale spacing up for larger screens
386
+ - ✅ Use generous white space for readability
387
+ - ✅ Align spacing with vertical rhythm
388
+ - ✅ Test spacing on all screen sizes
389
+
390
+ ### DON'T:
391
+ - ❌ Use arbitrary spacing values (e.g., `padding: 13px`)
392
+ - ❌ Mix different spacing systems
393
+ - ❌ Overcrowd content (too little spacing)
394
+ - ❌ Use excessive spacing (too much empty space)
395
+ - ❌ Forget to scale spacing responsively
396
+ - ❌ Inconsistent spacing for similar elements
397
+
398
+ ---
399
+
400
+ ## Quick Reference
401
+
402
+ **Component Padding:**
403
+ | Component | Padding |
404
+ |-----------|---------|
405
+ | Button (small) | `spacing-1` `spacing-3` (4px 12px) |
406
+ | Button (default) | `spacing-2` `spacing-4` (8px 16px) |
407
+ | Button (large) | `spacing-3` `spacing-6` (12px 24px) |
408
+ | Input | `spacing-2` `spacing-3` (8px 12px) |
409
+ | Card | `spacing-6` (24px) |
410
+
411
+ **Component Gaps:**
412
+ | Context | Gap |
413
+ |---------|-----|
414
+ | List items | `spacing-2` (8px) |
415
+ | Form fields | `spacing-4` (16px) |
416
+ | Cards in grid | `spacing-4` to `spacing-6` (16-24px) |
417
+ | Page sections | `spacing-12` to `spacing-16` (48-64px) |
418
+
419
+ **Responsive Scale:**
420
+ | Breakpoint | Multiplier |
421
+ |------------|------------|
422
+ | Mobile (< 640px) | 1x (base) |
423
+ | Tablet (640-1024px) | 1.5x |
424
+ | Desktop (> 1024px) | 2x |
425
+
426
+ ---
427
+
428
+ **💡 Remember:** Consistent spacing creates visual rhythm and improves readability!