@hustle-together/api-dev-tools 3.12.3 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/adr-requests/.gitkeep +10 -0
- package/.claude/agents/adr-researcher.md +109 -0
- package/.claude/agents/visual-analyzer.md +183 -0
- package/.claude/api-dev-state.json +7 -463
- package/.claude/documentation-audit.json +114 -0
- package/.claude/registry.json +289 -0
- package/.claude/settings.json +45 -1
- package/.claude/workflow-logs/None.json +49 -0
- package/.claude/workflow-logs/session-20251230-143727.json +106 -0
- package/.skills/adr-deep-research/SKILL.md +351 -0
- package/.skills/api-create/SKILL.md +116 -17
- package/.skills/api-research/SKILL.md +130 -0
- package/.skills/docs-sync/SKILL.md +260 -0
- package/.skills/docs-update/SKILL.md +205 -0
- package/.skills/hustle-brand/SKILL.md +368 -0
- package/.skills/hustle-build/SKILL.md +786 -0
- package/.skills/hustle-build-review/SKILL.md +518 -0
- package/.skills/parallel-spawn/SKILL.md +212 -0
- package/.skills/ralph-continue/SKILL.md +151 -0
- package/.skills/ralph-loop/SKILL.md +341 -0
- package/.skills/ralph-status/SKILL.md +87 -0
- package/.skills/refactor/SKILL.md +59 -0
- package/.skills/shadcn/SKILL.md +522 -0
- package/.skills/test-all/SKILL.md +210 -0
- package/.skills/test-builds/SKILL.md +208 -0
- package/.skills/test-debug/SKILL.md +212 -0
- package/.skills/test-e2e/SKILL.md +168 -0
- package/.skills/test-review/SKILL.md +707 -0
- package/.skills/test-unit/SKILL.md +143 -0
- package/.skills/test-visual/SKILL.md +301 -0
- package/.skills/token-report/SKILL.md +132 -0
- package/CHANGELOG.md +575 -0
- package/README.md +426 -56
- package/bin/cli.js +1538 -88
- package/commands/hustle-api-create.md +22 -0
- package/commands/hustle-build.md +259 -0
- package/commands/hustle-combine.md +81 -2
- package/commands/hustle-ui-create-page.md +84 -2
- package/commands/hustle-ui-create.md +82 -2
- package/hooks/__pycache__/api-workflow-check.cpython-314.pyc +0 -0
- package/hooks/__pycache__/auto-answer.cpython-314.pyc +0 -0
- package/hooks/__pycache__/cache-research.cpython-314.pyc +0 -0
- package/hooks/__pycache__/check-api-routes.cpython-314.pyc +0 -0
- package/hooks/__pycache__/check-playwright-setup.cpython-314.pyc +0 -0
- package/hooks/__pycache__/check-storybook-setup.cpython-314.pyc +0 -0
- package/hooks/__pycache__/check-update.cpython-314.pyc +0 -0
- package/hooks/__pycache__/completion-promise-detector.cpython-314.pyc +0 -0
- package/hooks/__pycache__/context-capacity-warning.cpython-314.pyc +0 -0
- package/hooks/__pycache__/detect-interruption.cpython-314.pyc +0 -0
- package/hooks/__pycache__/docs-update-check.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-a11y-audit.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-brand-guide.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-component-type-confirm.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-deep-research.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-disambiguation.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-documentation.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-dry-run.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-environment.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-external-research.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-freshness.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-interview.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-page-components.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-page-data-schema.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-questions-sourced.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-refactor.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-research.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-schema-from-interview.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-schema.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-scope.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-tdd-red.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-ui-disambiguation.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-ui-interview.cpython-314.pyc +0 -0
- package/hooks/__pycache__/enforce-verify.cpython-314.pyc +0 -0
- package/hooks/__pycache__/generate-adr-options.cpython-314.pyc +0 -0
- package/hooks/__pycache__/generate-manifest-entry.cpython-314.pyc +0 -0
- package/hooks/__pycache__/hook_utils.cpython-314.pyc +0 -0
- package/hooks/__pycache__/notify-input-needed.cpython-314.pyc +0 -0
- package/hooks/__pycache__/notify-phase-complete.cpython-314.pyc +0 -0
- package/hooks/__pycache__/ntfy-on-question.cpython-314.pyc +0 -0
- package/hooks/__pycache__/orchestrator-completion.cpython-314.pyc +0 -0
- package/hooks/__pycache__/orchestrator-handoff.cpython-314.pyc +0 -0
- package/hooks/__pycache__/orchestrator-session-startup.cpython-314.pyc +0 -0
- package/hooks/__pycache__/parallel-orchestrator.cpython-314.pyc +0 -0
- package/hooks/__pycache__/periodic-reground.cpython-314.pyc +0 -0
- package/hooks/__pycache__/project-document-prompt.cpython-314.pyc +0 -0
- package/hooks/__pycache__/remote-question-proxy.cpython-314.pyc +0 -0
- package/hooks/__pycache__/remote-question-server.cpython-314.pyc +0 -0
- package/hooks/__pycache__/run-code-review.cpython-314.pyc +0 -0
- package/hooks/__pycache__/run-visual-qa.cpython-314.pyc +0 -0
- package/hooks/__pycache__/session-logger.cpython-314.pyc +0 -0
- package/hooks/__pycache__/session-startup.cpython-314.pyc +0 -0
- package/hooks/__pycache__/track-scope-coverage.cpython-314.pyc +0 -0
- package/hooks/__pycache__/track-token-usage.cpython-314.pyc +0 -0
- package/hooks/__pycache__/track-tool-use.cpython-314.pyc +0 -0
- package/hooks/__pycache__/update-adr-decision.cpython-314.pyc +0 -0
- package/hooks/__pycache__/update-api-showcase.cpython-314.pyc +0 -0
- package/hooks/__pycache__/update-registry.cpython-314.pyc +0 -0
- package/hooks/__pycache__/update-ui-showcase.cpython-314.pyc +0 -0
- package/hooks/__pycache__/verify-after-green.cpython-314.pyc +0 -0
- package/hooks/__pycache__/verify-implementation.cpython-314.pyc +0 -0
- package/hooks/api-workflow-check.py +34 -0
- package/hooks/auto-answer.py +305 -0
- package/hooks/check-update.py +132 -0
- package/hooks/completion-promise-detector.py +293 -0
- package/hooks/context-capacity-warning.py +171 -0
- package/hooks/docs-update-check.py +120 -0
- package/hooks/enforce-dry-run.py +134 -0
- package/hooks/enforce-external-research.py +25 -0
- package/hooks/enforce-interview.py +20 -0
- package/hooks/generate-adr-options.py +282 -0
- package/hooks/hook_utils.py +609 -0
- package/hooks/lib/__pycache__/__init__.cpython-314.pyc +0 -0
- package/hooks/lib/__pycache__/greptile.cpython-314.pyc +0 -0
- package/hooks/lib/__pycache__/ntfy.cpython-314.pyc +0 -0
- package/hooks/ntfy-on-question.py +240 -0
- package/hooks/orchestrator-completion.py +313 -0
- package/hooks/orchestrator-handoff.py +267 -0
- package/hooks/orchestrator-session-startup.py +146 -0
- package/hooks/parallel-orchestrator.py +451 -0
- package/hooks/periodic-reground.py +270 -67
- package/hooks/project-document-prompt.py +302 -0
- package/hooks/remote-question-proxy.py +284 -0
- package/hooks/remote-question-server.py +1224 -0
- package/hooks/run-code-review.py +176 -29
- package/hooks/run-visual-qa.py +338 -0
- package/hooks/session-logger.py +27 -1
- package/hooks/session-startup.py +113 -0
- package/hooks/update-adr-decision.py +236 -0
- package/hooks/update-api-showcase.py +13 -1
- package/hooks/update-testing-checklist.py +195 -0
- package/hooks/update-ui-showcase.py +13 -1
- package/package.json +7 -3
- package/scripts/extract-schema-docs.cjs +322 -0
- package/templates/.skills/hustle-interview/SKILL.md +174 -0
- package/templates/CLAUDE-SECTION.md +89 -64
- package/templates/adr-viewer/_components/ADRViewer.tsx +326 -0
- package/templates/api-dev-state.json +33 -1
- package/templates/api-showcase/_components/APIModal.tsx +100 -8
- package/templates/api-showcase/_components/APIShowcase.tsx +36 -4
- package/templates/api-showcase/_components/APITester.tsx +367 -58
- package/templates/brand-page/page.tsx +645 -0
- package/templates/component/Component.visual.spec.ts +30 -24
- package/templates/docs/page.tsx +230 -0
- package/templates/eslint-plugin-zod-schema/index.js +446 -0
- package/templates/eslint-plugin-zod-schema/package.json +26 -0
- package/templates/github-workflows/security.yml +274 -0
- package/templates/hustle-build-defaults.json +136 -0
- package/templates/hustle-dev-dashboard/page.tsx +365 -0
- package/templates/page/page.e2e.test.ts +30 -26
- package/templates/performance-budgets.json +63 -5
- package/templates/playwright-report/page.tsx +258 -0
- package/templates/registry.json +279 -3
- package/templates/review-dashboard/page.tsx +510 -0
- package/templates/settings.json +155 -7
- package/templates/test-results/page.tsx +237 -0
- package/templates/typedoc.json +19 -0
- package/templates/ui-showcase/_components/UIShowcase.tsx +48 -1
- package/templates/ui-showcase/_components/VisualTestingDashboard.tsx +579 -0
- package/templates/ui-showcase/page.tsx +1 -1
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shadcn
|
|
3
|
+
description: ShadCN UI documentation and component installation with auto-updating docs
|
|
4
|
+
tools: Bash, Read, Write, Glob, WebFetch, mcp__context7__resolve-library-id, mcp__context7__get-library-docs
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# ShadCN Skill
|
|
9
|
+
|
|
10
|
+
Access latest ShadCN UI documentation, install components, and ensure docs stay fresh.
|
|
11
|
+
|
|
12
|
+
## Documentation Freshness
|
|
13
|
+
|
|
14
|
+
**Auto-Update Policy:** Every 15 days, this skill checks for documentation updates.
|
|
15
|
+
|
|
16
|
+
### Freshness Check
|
|
17
|
+
|
|
18
|
+
On every invocation, check `.claude/research/shadcn/index.json`:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"library": "shadcn",
|
|
23
|
+
"last_fetched": "2025-12-29T10:00:00Z",
|
|
24
|
+
"freshness_days": 15,
|
|
25
|
+
"version": "2.1.0",
|
|
26
|
+
"sources": [
|
|
27
|
+
"https://ui.shadcn.com/docs",
|
|
28
|
+
"context7:/vercel/ui"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**If stale (>15 days):**
|
|
34
|
+
```
|
|
35
|
+
⚠️ ShadCN docs are 18 days old. Fetching latest...
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Then auto-fetch fresh documentation via Context7.
|
|
39
|
+
|
|
40
|
+
## Commands
|
|
41
|
+
|
|
42
|
+
### Get Documentation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# General ShadCN docs
|
|
46
|
+
/shadcn docs
|
|
47
|
+
|
|
48
|
+
# Specific component docs
|
|
49
|
+
/shadcn docs button
|
|
50
|
+
/shadcn docs form
|
|
51
|
+
/shadcn docs data-table
|
|
52
|
+
|
|
53
|
+
# Installation guide
|
|
54
|
+
/shadcn docs installation
|
|
55
|
+
|
|
56
|
+
# Theming docs
|
|
57
|
+
/shadcn docs theming
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Install Components
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Install single component
|
|
64
|
+
/shadcn add button
|
|
65
|
+
|
|
66
|
+
# Install multiple
|
|
67
|
+
/shadcn add button card input
|
|
68
|
+
|
|
69
|
+
# Install all form components
|
|
70
|
+
/shadcn add form input select checkbox radio textarea
|
|
71
|
+
|
|
72
|
+
# Install with dependencies
|
|
73
|
+
/shadcn add dialog --with-deps
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Check Status
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Show installed components
|
|
80
|
+
/shadcn status
|
|
81
|
+
|
|
82
|
+
# Show available components
|
|
83
|
+
/shadcn list
|
|
84
|
+
|
|
85
|
+
# Check for updates
|
|
86
|
+
/shadcn check-updates
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Execution Flow
|
|
90
|
+
|
|
91
|
+
### Step 1: Freshness Check
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
# Check if docs need refresh
|
|
95
|
+
index_file = Path(".claude/research/shadcn/index.json")
|
|
96
|
+
if index_file.exists():
|
|
97
|
+
data = json.load(index_file)
|
|
98
|
+
last_fetched = datetime.fromisoformat(data["last_fetched"])
|
|
99
|
+
days_old = (datetime.now() - last_fetched).days
|
|
100
|
+
|
|
101
|
+
if days_old > 15:
|
|
102
|
+
print(f"⚠️ ShadCN docs are {days_old} days old. Refreshing...")
|
|
103
|
+
fetch_fresh_docs()
|
|
104
|
+
else:
|
|
105
|
+
print("📚 First time setup. Fetching ShadCN documentation...")
|
|
106
|
+
fetch_fresh_docs()
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Step 2: Fetch Documentation
|
|
110
|
+
|
|
111
|
+
Use Context7 for latest docs:
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
// Resolve library ID
|
|
115
|
+
mcp__context7__resolve-library-id({
|
|
116
|
+
libraryName: "shadcn",
|
|
117
|
+
query: "ShadCN UI component library for React"
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
// Get docs
|
|
121
|
+
mcp__context7__get-library-docs({
|
|
122
|
+
libraryId: "/shadcn/ui",
|
|
123
|
+
query: "button component usage and variants"
|
|
124
|
+
})
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Step 3: Cache Locally
|
|
128
|
+
|
|
129
|
+
Save to `.claude/research/shadcn/`:
|
|
130
|
+
- `index.json` - Metadata and freshness
|
|
131
|
+
- `CURRENT.md` - Full documentation summary
|
|
132
|
+
- `components/` - Per-component docs
|
|
133
|
+
|
|
134
|
+
### Step 4: Respond
|
|
135
|
+
|
|
136
|
+
Return documentation with usage examples and brand guide integration.
|
|
137
|
+
|
|
138
|
+
## Component Installation
|
|
139
|
+
|
|
140
|
+
### With Brand Guide Integration
|
|
141
|
+
|
|
142
|
+
When installing components, auto-configure with brand:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
/shadcn add button
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Output:
|
|
149
|
+
```
|
|
150
|
+
Installing Button component...
|
|
151
|
+
|
|
152
|
+
✅ src/components/ui/button.tsx created
|
|
153
|
+
|
|
154
|
+
Auto-configured with your brand:
|
|
155
|
+
• Primary color: #6366F1 (from BRAND_GUIDE.md)
|
|
156
|
+
• Border radius: 0.5rem (from theme)
|
|
157
|
+
• Font: Inter (from brand)
|
|
158
|
+
|
|
159
|
+
Usage:
|
|
160
|
+
import { Button } from "@/components/ui/button"
|
|
161
|
+
|
|
162
|
+
<Button>Default</Button>
|
|
163
|
+
<Button variant="secondary">Secondary</Button>
|
|
164
|
+
<Button variant="destructive">Destructive</Button>
|
|
165
|
+
|
|
166
|
+
Storybook story also created:
|
|
167
|
+
src/components/ui/button.stories.tsx
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Documentation Structure
|
|
171
|
+
|
|
172
|
+
### Available Topics
|
|
173
|
+
|
|
174
|
+
| Topic | Command | Description |
|
|
175
|
+
|-------|---------|-------------|
|
|
176
|
+
| Installation | `/shadcn docs installation` | Setup guide |
|
|
177
|
+
| Theming | `/shadcn docs theming` | CSS variables, dark mode |
|
|
178
|
+
| Typography | `/shadcn docs typography` | Font configuration |
|
|
179
|
+
| Components | `/shadcn docs [component]` | Component-specific |
|
|
180
|
+
| CLI | `/shadcn docs cli` | CLI commands |
|
|
181
|
+
| Changelog | `/shadcn docs changelog` | Latest changes |
|
|
182
|
+
|
|
183
|
+
### Component Categories
|
|
184
|
+
|
|
185
|
+
| Category | Components |
|
|
186
|
+
|----------|------------|
|
|
187
|
+
| **Forms** | button, input, textarea, select, checkbox, radio, switch, slider, form |
|
|
188
|
+
| **Layout** | card, separator, scroll-area, resizable |
|
|
189
|
+
| **Feedback** | alert, toast, sonner, progress, skeleton |
|
|
190
|
+
| **Overlay** | dialog, sheet, drawer, popover, tooltip, hover-card |
|
|
191
|
+
| **Navigation** | tabs, navigation-menu, menubar, breadcrumb |
|
|
192
|
+
| **Data** | table, data-table, calendar, date-picker |
|
|
193
|
+
|
|
194
|
+
## Freshness Report
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
/shadcn status
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Output:
|
|
201
|
+
```
|
|
202
|
+
═══════════════════════════════════════════════════════════════════
|
|
203
|
+
SHADCN STATUS
|
|
204
|
+
═══════════════════════════════════════════════════════════════════
|
|
205
|
+
|
|
206
|
+
Documentation:
|
|
207
|
+
Last Updated: 2025-12-29 (0 days ago) ✅
|
|
208
|
+
Version: 2.1.0
|
|
209
|
+
Source: Context7 + ui.shadcn.com
|
|
210
|
+
|
|
211
|
+
Installed Components (12):
|
|
212
|
+
✅ button ✅ card ✅ input
|
|
213
|
+
✅ dialog ✅ toast ✅ tabs
|
|
214
|
+
✅ form ✅ select ✅ checkbox
|
|
215
|
+
✅ table ✅ skeleton ✅ separator
|
|
216
|
+
|
|
217
|
+
Available Updates:
|
|
218
|
+
• data-table: v1.2.0 → v1.3.0 (new sorting)
|
|
219
|
+
• form: v1.0.0 → v1.1.0 (zod v4 support)
|
|
220
|
+
|
|
221
|
+
Brand Integration:
|
|
222
|
+
✅ Theme configured from BRAND_GUIDE.md
|
|
223
|
+
✅ CSS variables set in globals.css
|
|
224
|
+
✅ Tailwind config extended
|
|
225
|
+
|
|
226
|
+
═══════════════════════════════════════════════════════════════════
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Auto-Update Trigger
|
|
230
|
+
|
|
231
|
+
The skill automatically refreshes docs when:
|
|
232
|
+
|
|
233
|
+
1. **Time-based:** >15 days since last fetch
|
|
234
|
+
2. **Version mismatch:** Detected newer version available
|
|
235
|
+
3. **Manual:** User runs `/shadcn docs --refresh`
|
|
236
|
+
4. **Error:** Context7 returns updated content hash
|
|
237
|
+
|
|
238
|
+
## Design System Architecture
|
|
239
|
+
|
|
240
|
+
### Brand Guide → ShadCN Flow
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
244
|
+
│ DESIGN SYSTEM FLOW │
|
|
245
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
246
|
+
│ │
|
|
247
|
+
│ .claude/BRAND_GUIDE.md │
|
|
248
|
+
│ ├─ colors.primary: "#ba0c2f" │
|
|
249
|
+
│ ├─ colors.secondary: "#1a1a1a" │
|
|
250
|
+
│ ├─ typography.font_sans: "system-ui" │
|
|
251
|
+
│ ├─ motion.duration_normal: "300ms" │
|
|
252
|
+
│ └─ spacing.radius: "0.5rem" │
|
|
253
|
+
│ │ │
|
|
254
|
+
│ ▼ │
|
|
255
|
+
│ src/styles/globals.css │
|
|
256
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
257
|
+
│ │ @layer base { │ │
|
|
258
|
+
│ │ :root { │ │
|
|
259
|
+
│ │ --primary: 350 87% 39%; /* #ba0c2f → HSL */ │ │
|
|
260
|
+
│ │ --primary-foreground: 0 0% 100%; │ │
|
|
261
|
+
│ │ --secondary: 0 0% 10%; /* #1a1a1a → HSL */ │ │
|
|
262
|
+
│ │ --radius: 0.5rem; │ │
|
|
263
|
+
│ │ --font-sans: system-ui, sans-serif; │ │
|
|
264
|
+
│ │ } │ │
|
|
265
|
+
│ │ } │ │
|
|
266
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
267
|
+
│ │ │
|
|
268
|
+
│ ▼ │
|
|
269
|
+
│ tailwind.config.ts │
|
|
270
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
271
|
+
│ │ theme: { │ │
|
|
272
|
+
│ │ extend: { │ │
|
|
273
|
+
│ │ colors: { │ │
|
|
274
|
+
│ │ primary: "hsl(var(--primary))", │ │
|
|
275
|
+
│ │ secondary: "hsl(var(--secondary))", │ │
|
|
276
|
+
│ │ }, │ │
|
|
277
|
+
│ │ borderRadius: { │ │
|
|
278
|
+
│ │ lg: "var(--radius)", │ │
|
|
279
|
+
│ │ }, │ │
|
|
280
|
+
│ │ } │ │
|
|
281
|
+
│ │ } │ │
|
|
282
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
283
|
+
│ │ │
|
|
284
|
+
│ ▼ │
|
|
285
|
+
│ ShadCN Components (auto-styled) │
|
|
286
|
+
│ ├─ <Button> uses primary color │
|
|
287
|
+
│ ├─ <Card> uses radius and background │
|
|
288
|
+
│ └─ All components inherit brand values │
|
|
289
|
+
│ │
|
|
290
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### CSS Variable Mapping
|
|
294
|
+
|
|
295
|
+
When brand guide changes, these CSS variables are auto-updated:
|
|
296
|
+
|
|
297
|
+
| Brand Guide | CSS Variable | ShadCN Usage |
|
|
298
|
+
|-------------|--------------|--------------|
|
|
299
|
+
| `colors.primary` | `--primary` | Button, badges, links |
|
|
300
|
+
| `colors.secondary` | `--secondary` | Secondary buttons |
|
|
301
|
+
| `colors.accent` | `--accent` | Highlights, focus rings |
|
|
302
|
+
| `colors.background` | `--background` | Page backgrounds |
|
|
303
|
+
| `colors.foreground` | `--foreground` | Text color |
|
|
304
|
+
| `colors.muted` | `--muted` | Disabled states |
|
|
305
|
+
| `colors.destructive` | `--destructive` | Error states, delete |
|
|
306
|
+
| `typography.font_sans` | `--font-sans` | Body text |
|
|
307
|
+
| `typography.font_mono` | `--font-mono` | Code blocks |
|
|
308
|
+
| `spacing.radius` | `--radius` | Border radius |
|
|
309
|
+
|
|
310
|
+
### Globals.css Complete Template
|
|
311
|
+
|
|
312
|
+
```css
|
|
313
|
+
@tailwind base;
|
|
314
|
+
@tailwind components;
|
|
315
|
+
@tailwind utilities;
|
|
316
|
+
|
|
317
|
+
@layer base {
|
|
318
|
+
:root {
|
|
319
|
+
/* Colors - From BRAND_GUIDE.md */
|
|
320
|
+
--background: 0 0% 100%;
|
|
321
|
+
--foreground: 0 0% 3.9%;
|
|
322
|
+
--card: 0 0% 100%;
|
|
323
|
+
--card-foreground: 0 0% 3.9%;
|
|
324
|
+
--popover: 0 0% 100%;
|
|
325
|
+
--popover-foreground: 0 0% 3.9%;
|
|
326
|
+
--primary: 350 87% 39%; /* Hustle Red #ba0c2f */
|
|
327
|
+
--primary-foreground: 0 0% 100%;
|
|
328
|
+
--secondary: 0 0% 96.1%;
|
|
329
|
+
--secondary-foreground: 0 0% 9%;
|
|
330
|
+
--muted: 0 0% 96.1%;
|
|
331
|
+
--muted-foreground: 0 0% 45.1%;
|
|
332
|
+
--accent: 0 0% 96.1%;
|
|
333
|
+
--accent-foreground: 0 0% 9%;
|
|
334
|
+
--destructive: 0 84.2% 60.2%;
|
|
335
|
+
--destructive-foreground: 0 0% 98%;
|
|
336
|
+
--border: 0 0% 89.8%;
|
|
337
|
+
--input: 0 0% 89.8%;
|
|
338
|
+
--ring: 350 87% 39%; /* Match primary */
|
|
339
|
+
|
|
340
|
+
/* Spacing */
|
|
341
|
+
--radius: 0.5rem;
|
|
342
|
+
|
|
343
|
+
/* Typography */
|
|
344
|
+
--font-sans: system-ui, -apple-system, sans-serif;
|
|
345
|
+
--font-mono: ui-monospace, monospace;
|
|
346
|
+
|
|
347
|
+
/* Motion - From BRAND_GUIDE.md */
|
|
348
|
+
--animation-duration-fast: 150ms;
|
|
349
|
+
--animation-duration-normal: 300ms;
|
|
350
|
+
--animation-duration-slow: 500ms;
|
|
351
|
+
--animation-easing: ease-out;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.dark {
|
|
355
|
+
--background: 0 0% 3.9%;
|
|
356
|
+
--foreground: 0 0% 98%;
|
|
357
|
+
--card: 0 0% 3.9%;
|
|
358
|
+
--card-foreground: 0 0% 98%;
|
|
359
|
+
--popover: 0 0% 3.9%;
|
|
360
|
+
--popover-foreground: 0 0% 98%;
|
|
361
|
+
--primary: 350 87% 45%; /* Slightly lighter for dark */
|
|
362
|
+
--primary-foreground: 0 0% 100%;
|
|
363
|
+
--secondary: 0 0% 14.9%;
|
|
364
|
+
--secondary-foreground: 0 0% 98%;
|
|
365
|
+
--muted: 0 0% 14.9%;
|
|
366
|
+
--muted-foreground: 0 0% 63.9%;
|
|
367
|
+
--accent: 0 0% 14.9%;
|
|
368
|
+
--accent-foreground: 0 0% 98%;
|
|
369
|
+
--destructive: 0 62.8% 30.6%;
|
|
370
|
+
--destructive-foreground: 0 0% 98%;
|
|
371
|
+
--border: 0 0% 14.9%;
|
|
372
|
+
--input: 0 0% 14.9%;
|
|
373
|
+
--ring: 350 87% 45%;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
@layer base {
|
|
378
|
+
* {
|
|
379
|
+
@apply border-border;
|
|
380
|
+
}
|
|
381
|
+
body {
|
|
382
|
+
@apply bg-background text-foreground;
|
|
383
|
+
font-family: var(--font-sans);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Registry Integration
|
|
389
|
+
|
|
390
|
+
Brand guide elements tracked in `registry.json`:
|
|
391
|
+
|
|
392
|
+
```json
|
|
393
|
+
{
|
|
394
|
+
"brand_guide": {
|
|
395
|
+
"file": ".claude/BRAND_GUIDE.md",
|
|
396
|
+
"globals_css": "src/styles/globals.css",
|
|
397
|
+
"tailwind_config": "tailwind.config.ts",
|
|
398
|
+
"theme_file": "src/lib/theme.ts",
|
|
399
|
+
"css_variables": {
|
|
400
|
+
"--primary": "350 87% 39%",
|
|
401
|
+
"--secondary": "0 0% 96.1%",
|
|
402
|
+
"--radius": "0.5rem",
|
|
403
|
+
"--font-sans": "system-ui"
|
|
404
|
+
},
|
|
405
|
+
"shadcn": {
|
|
406
|
+
"initialized": true,
|
|
407
|
+
"components_installed": ["button", "card", "input"],
|
|
408
|
+
"theme_configured": true,
|
|
409
|
+
"last_sync": "2025-12-29T10:00:00Z"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
## Brand Guide Sync
|
|
416
|
+
|
|
417
|
+
When brand guide is edited, components auto-update:
|
|
418
|
+
|
|
419
|
+
### Sync Command
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
/shadcn sync
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
This command:
|
|
426
|
+
1. Reads `.claude/BRAND_GUIDE.md`
|
|
427
|
+
2. Converts colors to HSL for CSS variables
|
|
428
|
+
3. Updates `globals.css`
|
|
429
|
+
4. Updates `tailwind.config.ts`
|
|
430
|
+
5. Updates registry with new values
|
|
431
|
+
|
|
432
|
+
### Auto-Sync on Brand Edit
|
|
433
|
+
|
|
434
|
+
The `brand-sync.py` hook triggers sync when:
|
|
435
|
+
- `BRAND_GUIDE.md` is edited
|
|
436
|
+
- `/hustle-brand --edit` is run
|
|
437
|
+
- New brand guide is created
|
|
438
|
+
|
|
439
|
+
### Sync Output
|
|
440
|
+
|
|
441
|
+
```
|
|
442
|
+
═══════════════════════════════════════════════════════════════
|
|
443
|
+
BRAND → SHADCN SYNC
|
|
444
|
+
═══════════════════════════════════════════════════════════════
|
|
445
|
+
|
|
446
|
+
Reading Brand Guide...
|
|
447
|
+
Primary: #ba0c2f → hsl(350, 87%, 39%)
|
|
448
|
+
Secondary: #1a1a1a → hsl(0, 0%, 10%)
|
|
449
|
+
Font: system-ui
|
|
450
|
+
|
|
451
|
+
Updating globals.css...
|
|
452
|
+
✅ --primary updated
|
|
453
|
+
✅ --secondary updated
|
|
454
|
+
✅ --font-sans updated
|
|
455
|
+
✅ --radius updated
|
|
456
|
+
|
|
457
|
+
Updating tailwind.config.ts...
|
|
458
|
+
✅ Colors extended
|
|
459
|
+
✅ Font family set
|
|
460
|
+
|
|
461
|
+
Updating registry.json...
|
|
462
|
+
✅ CSS variables recorded
|
|
463
|
+
✅ Sync timestamp updated
|
|
464
|
+
|
|
465
|
+
All 12 installed components will now use updated brand values.
|
|
466
|
+
|
|
467
|
+
═══════════════════════════════════════════════════════════════
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
## Integration with Brand Guide
|
|
471
|
+
|
|
472
|
+
ShadCN components automatically use brand values:
|
|
473
|
+
|
|
474
|
+
```tsx
|
|
475
|
+
// Button uses brand primary color
|
|
476
|
+
<Button>Primary Action</Button>
|
|
477
|
+
|
|
478
|
+
// Card uses brand radius and background
|
|
479
|
+
<Card>
|
|
480
|
+
<CardHeader>
|
|
481
|
+
<CardTitle>Brand-Styled Card</CardTitle>
|
|
482
|
+
</CardHeader>
|
|
483
|
+
</Card>
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
Theme variables in `globals.css`:
|
|
487
|
+
```css
|
|
488
|
+
@layer base {
|
|
489
|
+
:root {
|
|
490
|
+
/* From BRAND_GUIDE.md */
|
|
491
|
+
--primary: 350 87% 39%;
|
|
492
|
+
--primary-foreground: 0 0% 100%;
|
|
493
|
+
--radius: 0.5rem;
|
|
494
|
+
/* ... */
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
## Examples
|
|
500
|
+
|
|
501
|
+
```bash
|
|
502
|
+
# Get button documentation
|
|
503
|
+
/shadcn docs button
|
|
504
|
+
|
|
505
|
+
# Install form components for a signup page
|
|
506
|
+
/shadcn add form input button checkbox
|
|
507
|
+
|
|
508
|
+
# Check what's installed
|
|
509
|
+
/shadcn status
|
|
510
|
+
|
|
511
|
+
# Force refresh documentation
|
|
512
|
+
/shadcn docs --refresh
|
|
513
|
+
|
|
514
|
+
# Get theming help
|
|
515
|
+
/shadcn docs theming
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
## See Also
|
|
519
|
+
|
|
520
|
+
- `/hustle-brand` - Create brand guide (configures ShadCN theme)
|
|
521
|
+
- `/hustle-ui-create` - Create components using ShadCN
|
|
522
|
+
- Context7 MCP - Documentation source
|