@fpkit/acss 1.0.0-beta.1 → 2.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.
- package/README.md +92 -0
- package/docs/README.md +325 -0
- package/docs/guides/accessibility.md +764 -0
- package/docs/guides/architecture.md +705 -0
- package/docs/guides/composition.md +688 -0
- package/docs/guides/css-variables.md +522 -0
- package/docs/guides/storybook.md +828 -0
- package/docs/guides/testing.md +817 -0
- package/docs/testing/focus-indicator-testing.md +437 -0
- package/libs/{chunk-7XPFW7CB.js → chunk-43TK2ICH.js} +2 -2
- package/libs/chunk-5PJYLVFY.cjs +17 -0
- package/libs/chunk-5PJYLVFY.cjs.map +1 -0
- package/libs/chunk-E4OSROCA.cjs +17 -0
- package/libs/chunk-E4OSROCA.cjs.map +1 -0
- package/libs/chunk-KVKQLRJG.js +10 -0
- package/libs/chunk-KVKQLRJG.js.map +1 -0
- package/libs/{chunk-QVW6W76L.cjs → chunk-MGPWZRBX.cjs} +3 -3
- package/libs/chunk-NNTBIHSD.js +8 -0
- package/libs/chunk-NNTBIHSD.js.map +1 -0
- package/libs/{chunk-X3JCTEPD.js → chunk-QKHPHMG2.js} +2 -2
- package/libs/{chunk-T4T6GWYQ.cjs → chunk-R7NLLZU2.cjs} +3 -3
- package/libs/{chunk-X5LGFCWG.js → chunk-UJAQVHWC.js} +3 -3
- package/libs/{chunk-DKTHCQ5P.cjs → chunk-X5RKCLDC.cjs} +3 -3
- package/libs/components/breadcrumbs/breadcrumb.cjs +5 -5
- package/libs/components/breadcrumbs/breadcrumb.d.cts +1 -1
- package/libs/components/breadcrumbs/breadcrumb.d.ts +1 -1
- package/libs/components/breadcrumbs/breadcrumb.js +2 -2
- package/libs/components/button.cjs +3 -3
- package/libs/components/button.d.cts +1 -1
- package/libs/components/button.d.ts +1 -1
- package/libs/components/button.js +1 -1
- package/libs/components/buttons/button.css +1 -1
- package/libs/components/buttons/button.css.map +1 -1
- package/libs/components/buttons/button.min.css +2 -2
- package/libs/components/dialog/dialog.cjs +4 -4
- package/libs/components/dialog/dialog.js +2 -2
- package/libs/components/icons/icon.d.cts +32 -32
- package/libs/components/icons/icon.d.ts +32 -32
- package/libs/components/link/link.cjs +11 -3
- package/libs/components/link/link.d.cts +131 -3
- package/libs/components/link/link.d.ts +131 -3
- package/libs/components/link/link.js +1 -1
- package/libs/components/list/list.css +1 -1
- package/libs/components/list/list.min.css +1 -1
- package/libs/components/modal.cjs +3 -3
- package/libs/components/modal.js +2 -2
- package/libs/hooks.cjs +3 -3
- package/libs/hooks.d.cts +1 -1
- package/libs/hooks.d.ts +1 -1
- package/libs/hooks.js +2 -2
- package/libs/index.cjs +12 -12
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +237 -2
- package/libs/index.d.ts +237 -2
- package/libs/index.js +5 -5
- package/package.json +4 -3
- package/src/components/README.mdx +1 -1
- package/src/components/breadcrumbs/breadcrumb.test.tsx +1 -2
- package/src/components/buttons/README.mdx +19 -9
- package/src/components/buttons/button.scss +5 -0
- package/src/components/buttons/button.stories.tsx +8 -5
- package/src/components/buttons/button.tsx +19 -15
- package/src/components/cards/card.stories.tsx +1 -1
- package/src/components/details/details.stories.tsx +1 -1
- package/src/components/form/form.stories.tsx +1 -1
- package/src/components/form/input.stories.tsx +1 -1
- package/src/components/form/select.stories.tsx +1 -1
- package/src/components/heading/README.mdx +292 -0
- package/src/components/icons/icon.stories.tsx +1 -1
- package/src/components/link/link.stories.tsx +205 -8
- package/src/components/link/link.test.tsx +1 -1
- package/src/components/link/link.tsx +22 -0
- package/src/components/link/link.types.ts +11 -3
- package/src/components/list/list.scss +1 -1
- package/src/components/nav/nav.stories.tsx +1 -1
- package/src/components/ui.stories.tsx +53 -19
- package/src/docs/accessibility.mdx +484 -0
- package/src/docs/composition.mdx +549 -0
- package/src/docs/css-variables.mdx +380 -0
- package/src/docs/fpkit-developer.mdx +623 -0
- package/src/introduction.mdx +356 -0
- package/src/styles/buttons/button.css +4 -0
- package/src/styles/buttons/button.css.map +1 -1
- package/src/styles/index.css +9 -3
- package/src/styles/index.css.map +1 -1
- package/src/styles/list/list.css +1 -1
- package/src/styles/utilities/_disabled.scss +5 -4
- package/libs/chunk-33PNJ4LO.cjs +0 -15
- package/libs/chunk-33PNJ4LO.cjs.map +0 -1
- package/libs/chunk-GT77BX4L.cjs +0 -17
- package/libs/chunk-GT77BX4L.cjs.map +0 -1
- package/libs/chunk-OVWLQYMK.js +0 -10
- package/libs/chunk-OVWLQYMK.js.map +0 -1
- package/libs/chunk-UEPAWMDF.js +0 -8
- package/libs/chunk-UEPAWMDF.js.map +0 -1
- package/libs/link-5192f411.d.ts +0 -323
- /package/libs/{chunk-7XPFW7CB.js.map → chunk-43TK2ICH.js.map} +0 -0
- /package/libs/{chunk-QVW6W76L.cjs.map → chunk-MGPWZRBX.cjs.map} +0 -0
- /package/libs/{chunk-X3JCTEPD.js.map → chunk-QKHPHMG2.js.map} +0 -0
- /package/libs/{chunk-T4T6GWYQ.cjs.map → chunk-R7NLLZU2.cjs.map} +0 -0
- /package/libs/{chunk-X5LGFCWG.js.map → chunk-UJAQVHWC.js.map} +0 -0
- /package/libs/{chunk-DKTHCQ5P.cjs.map → chunk-X5RKCLDC.cjs.map} +0 -0
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
import { Meta } from "@storybook/addon-docs/blocks";
|
|
2
|
+
|
|
3
|
+
<Meta title="Guides/FPKit Developer" />
|
|
4
|
+
|
|
5
|
+
# FPKit Developer
|
|
6
|
+
|
|
7
|
+
**Build applications with @fpkit/acss using Claude Code assistance**
|
|
8
|
+
|
|
9
|
+
A portable Claude Code skill for developers using the @fpkit/acss component
|
|
10
|
+
library in their applications.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## What This Skill Does
|
|
15
|
+
|
|
16
|
+
This skill helps you:
|
|
17
|
+
|
|
18
|
+
✅ **Compose custom components** from fpkit primitives ✅ **Validate CSS
|
|
19
|
+
variables** against fpkit conventions ✅ **Maintain accessibility** (WCAG 2.1
|
|
20
|
+
Level AA) ✅ **Follow best practices** for component composition ✅ **TypeScript
|
|
21
|
+
support** for type-safe compositions
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
### Option 1: Manual Installation (Recommended)
|
|
28
|
+
|
|
29
|
+
1. **Copy this skill directory** to your Claude Code skills folder:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Copy to global skills (available in all projects)
|
|
33
|
+
cp -r /path/to/fpkit-developer ~/.claude/skills/
|
|
34
|
+
|
|
35
|
+
# Or copy to project-specific skills
|
|
36
|
+
cp -r /path/to/fpkit-developer ./.claude/skills/
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. **Verify installation**:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
ls ~/.claude/skills/fpkit-developer/
|
|
43
|
+
# Should show: README.md SKILL.md references/ scripts/
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Option 3: Install via gitpick (Recommended)
|
|
47
|
+
|
|
48
|
+
The fastest and easiest way to install directly from GitHub:
|
|
49
|
+
|
|
50
|
+
### User-level installation (available in all projects)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx gitpick shawn-sandy/acss/tree/main/.claude/skills/fpkit-developer ~/.claude/skills/fpkit-developer
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Project-specific installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cd /path/to/your/project
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx gitpick shawn-sandy/acss/tree/main/.claude/skills/fpkit-developer ./.claude/skills/fpkit-developer
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Why gitpick?**
|
|
67
|
+
|
|
68
|
+
- ✅ Single command - no ZIP download or extraction
|
|
69
|
+
- ✅ Selective cloning - only downloads the skill folder
|
|
70
|
+
- ✅ Zero dependencies - lightweight and fast (`<35kb`)
|
|
71
|
+
- ✅ Always up-to-date - pulls latest version from GitHub
|
|
72
|
+
|
|
73
|
+
**Learn more:**
|
|
74
|
+
[github.com/nrjdalal/gitpick](https://github.com/nrjdalal/gitpick)
|
|
75
|
+
|
|
76
|
+
3. **Restart Claude Code** to load the skill.
|
|
77
|
+
|
|
78
|
+
### Option 2: Clone from GitHub (Future)
|
|
79
|
+
|
|
80
|
+
When this skill is published to GitHub:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Global installation
|
|
84
|
+
cd ~/.claude/skills/
|
|
85
|
+
git clone https://github.com/shawn-sandy/fpkit-consumer-skill.git fpkit-consumer
|
|
86
|
+
|
|
87
|
+
# Project-specific installation
|
|
88
|
+
cd ./.claude/skills/
|
|
89
|
+
git clone https://github.com/shawn-sandy/fpkit-consumer-skill.git fpkit-consumer
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Prerequisites
|
|
95
|
+
|
|
96
|
+
Your project must have **@fpkit/acss** installed:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npm install @fpkit/acss
|
|
100
|
+
# or
|
|
101
|
+
yarn add @fpkit/acss
|
|
102
|
+
# or
|
|
103
|
+
pnpm add @fpkit/acss
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Usage
|
|
109
|
+
|
|
110
|
+
### Activating the Skill
|
|
111
|
+
|
|
112
|
+
The skill activates automatically when you're working in a project using
|
|
113
|
+
@fpkit/acss.
|
|
114
|
+
|
|
115
|
+
**Trigger phrases:**
|
|
116
|
+
|
|
117
|
+
- "Build a custom component using fpkit"
|
|
118
|
+
- "Create a [component name] with @fpkit/acss"
|
|
119
|
+
- "Compose a [feature] from fpkit components"
|
|
120
|
+
- "Help me use fpkit components"
|
|
121
|
+
|
|
122
|
+
### Example Interactions
|
|
123
|
+
|
|
124
|
+
#### Example 1: Composing a StatusButton
|
|
125
|
+
|
|
126
|
+
**You:**
|
|
127
|
+
|
|
128
|
+
> Create a StatusButton component that combines Button and Badge from fpkit
|
|
129
|
+
|
|
130
|
+
**Claude Code:**
|
|
131
|
+
|
|
132
|
+
> I'll help you create a StatusButton by composing fpkit components.
|
|
133
|
+
>
|
|
134
|
+
> ```tsx
|
|
135
|
+
> import { Button, Badge } from "@fpkit/acss";
|
|
136
|
+
>
|
|
137
|
+
> export interface StatusButtonProps
|
|
138
|
+
> extends React.ComponentProps<typeof Button> {
|
|
139
|
+
> status: "active" | "inactive" | "pending";
|
|
140
|
+
> }
|
|
141
|
+
>
|
|
142
|
+
> export const StatusButton = ({
|
|
143
|
+
> status,
|
|
144
|
+
> children,
|
|
145
|
+
> ...props
|
|
146
|
+
> }: StatusButtonProps) => {
|
|
147
|
+
> return (
|
|
148
|
+
> <Button {...props}>
|
|
149
|
+
> {children}
|
|
150
|
+
> <Badge variant={status}>{status}</Badge>
|
|
151
|
+
> </Button>
|
|
152
|
+
> );
|
|
153
|
+
> };
|
|
154
|
+
> ```
|
|
155
|
+
>
|
|
156
|
+
> This composition:
|
|
157
|
+
>
|
|
158
|
+
> - ✅ Extends Button props with TypeScript
|
|
159
|
+
> - ✅ Preserves all fpkit Button functionality
|
|
160
|
+
> - ✅ Maintains accessibility (ARIA, keyboard support)
|
|
161
|
+
> - ✅ Keeps styling customizable via CSS variables
|
|
162
|
+
|
|
163
|
+
#### Example 2: Custom Styling
|
|
164
|
+
|
|
165
|
+
**You:**
|
|
166
|
+
|
|
167
|
+
> How do I customize the button padding in my StatusButton?
|
|
168
|
+
|
|
169
|
+
**Claude Code:**
|
|
170
|
+
|
|
171
|
+
> You can customize fpkit components using CSS variables:
|
|
172
|
+
>
|
|
173
|
+
> ```tsx
|
|
174
|
+
> <StatusButton
|
|
175
|
+
> status="active"
|
|
176
|
+
> style={{
|
|
177
|
+
> "--btn-padding-inline": "2rem",
|
|
178
|
+
> "--btn-padding-block": "1rem",
|
|
179
|
+
> }}
|
|
180
|
+
> >
|
|
181
|
+
> Server Status
|
|
182
|
+
> </StatusButton>
|
|
183
|
+
> ```
|
|
184
|
+
>
|
|
185
|
+
> Or create a CSS class:
|
|
186
|
+
>
|
|
187
|
+
> ```css
|
|
188
|
+
> .hero-status-button {
|
|
189
|
+
> --btn-padding-inline: 2rem;
|
|
190
|
+
> --btn-padding-block: 1rem;
|
|
191
|
+
> --btn-fs: 1.25rem;
|
|
192
|
+
> }
|
|
193
|
+
> ```
|
|
194
|
+
>
|
|
195
|
+
> See `references/css-variables.md` for all available variables.
|
|
196
|
+
|
|
197
|
+
#### Example 3: Accessibility Check
|
|
198
|
+
|
|
199
|
+
**You:**
|
|
200
|
+
|
|
201
|
+
> Is this component accessible?
|
|
202
|
+
|
|
203
|
+
**Claude Code:**
|
|
204
|
+
|
|
205
|
+
> Let me check accessibility:
|
|
206
|
+
>
|
|
207
|
+
> ✅ Uses semantic Button element ✅ Inherits keyboard navigation ✅ Maintains
|
|
208
|
+
> focus indicators ⚠️ Add `aria-label` if using icon-only button
|
|
209
|
+
>
|
|
210
|
+
> Example with accessibility:
|
|
211
|
+
>
|
|
212
|
+
> ```tsx
|
|
213
|
+
> <StatusButton status="active" aria-label="Server status: active">
|
|
214
|
+
> <ServerIcon aria-hidden="true" />
|
|
215
|
+
> </StatusButton>
|
|
216
|
+
> ```
|
|
217
|
+
>
|
|
218
|
+
> Run automated testing:
|
|
219
|
+
>
|
|
220
|
+
> ```tsx
|
|
221
|
+
> import { axe, toHaveNoViolations } from "jest-axe";
|
|
222
|
+
>
|
|
223
|
+
> expect.extend(toHaveNoViolations);
|
|
224
|
+
>
|
|
225
|
+
> it("should not have accessibility violations", async () => {
|
|
226
|
+
> const { container } = render(
|
|
227
|
+
> <StatusButton status="active">Server</StatusButton>
|
|
228
|
+
> );
|
|
229
|
+
> const results = await axe(container);
|
|
230
|
+
> expect(results).toHaveNoViolations();
|
|
231
|
+
> });
|
|
232
|
+
> ```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Features
|
|
237
|
+
|
|
238
|
+
### 1. Component Composition Guidance
|
|
239
|
+
|
|
240
|
+
The skill uses a **decision tree** to determine the best approach:
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
Does fpkit have the component?
|
|
244
|
+
→ Use it directly
|
|
245
|
+
|
|
246
|
+
Can you compose 2+ fpkit components?
|
|
247
|
+
→ Composition (Pattern 1-5)
|
|
248
|
+
|
|
249
|
+
Can you extend an fpkit component?
|
|
250
|
+
→ Enhanced wrapper
|
|
251
|
+
|
|
252
|
+
Need something completely custom?
|
|
253
|
+
→ Custom implementation (with fpkit patterns)
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### 2. CSS Variable Validation
|
|
257
|
+
|
|
258
|
+
Run the validation script on your custom styles:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Validate a file
|
|
262
|
+
python ~/.claude/skills/fpkit-developer/scripts/validate_css_vars.py styles/button.scss
|
|
263
|
+
|
|
264
|
+
# Validate a directory
|
|
265
|
+
python ~/.claude/skills/fpkit-developer/scripts/validate_css_vars.py styles/
|
|
266
|
+
|
|
267
|
+
# From your project root
|
|
268
|
+
python ~/.claude/skills/fpkit-developer/scripts/validate_css_vars.py .
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**What it checks:**
|
|
272
|
+
|
|
273
|
+
- ✅ Naming pattern: `--{component}-{property}`
|
|
274
|
+
- ✅ rem units (not px)
|
|
275
|
+
- ✅ Approved abbreviations: `bg`, `fs`, `fw`, `radius`, `gap`
|
|
276
|
+
- ✅ Full words for: `padding`, `margin`, `color`, `border`, `display`, `width`,
|
|
277
|
+
`height`
|
|
278
|
+
|
|
279
|
+
### 3. Reference Documentation
|
|
280
|
+
|
|
281
|
+
Access comprehensive guides without leaving your terminal:
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
# View composition patterns
|
|
285
|
+
cat ~/.claude/skills/fpkit-developer/references/composition.md
|
|
286
|
+
|
|
287
|
+
# View CSS variable guide
|
|
288
|
+
cat ~/.claude/skills/fpkit-developer/references/css-variables.md
|
|
289
|
+
|
|
290
|
+
# View accessibility guide
|
|
291
|
+
cat ~/.claude/skills/fpkit-developer/references/accessibility.md
|
|
292
|
+
|
|
293
|
+
# View architecture guide
|
|
294
|
+
cat ~/.claude/skills/fpkit-developer/references/architecture.md
|
|
295
|
+
|
|
296
|
+
# View testing guide
|
|
297
|
+
cat ~/.claude/skills/fpkit-developer/references/testing.md
|
|
298
|
+
|
|
299
|
+
# View Storybook guide
|
|
300
|
+
cat ~/.claude/skills/fpkit-developer/references/storybook.md
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Or ask Claude Code to reference them:
|
|
304
|
+
|
|
305
|
+
> "Show me composition patterns from the fpkit skill"
|
|
306
|
+
|
|
307
|
+
### 4. Documentation Sync
|
|
308
|
+
|
|
309
|
+
Keep documentation up-to-date with the latest fpkit guides:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Sync all documentation from fpkit package
|
|
313
|
+
~/.claude/skills/fpkit-developer/scripts/sync-docs.sh
|
|
314
|
+
|
|
315
|
+
# Check which docs need updating
|
|
316
|
+
~/.claude/skills/fpkit-developer/scripts/sync-docs.sh --check
|
|
317
|
+
|
|
318
|
+
# Sync a specific guide
|
|
319
|
+
~/.claude/skills/fpkit-developer/scripts/sync-docs.sh --guide testing.md
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**When to sync:**
|
|
323
|
+
|
|
324
|
+
- After updating @fpkit/acss to a new version
|
|
325
|
+
- When fpkit documentation is updated
|
|
326
|
+
- Periodically to ensure you have the latest patterns and examples
|
|
327
|
+
|
|
328
|
+
**Configuration:** Edit `config.json` to customize documentation source:
|
|
329
|
+
|
|
330
|
+
- `docsSource`: "local" (default) or "online"
|
|
331
|
+
- `onlineDocsUrl`: GitHub raw URL for online fallback
|
|
332
|
+
- `fpkitDocsPath`: Relative path to fpkit docs in monorepo
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Skill Structure
|
|
337
|
+
|
|
338
|
+
```
|
|
339
|
+
fpkit-developer/
|
|
340
|
+
├── README.md # This file
|
|
341
|
+
├── SKILL.md # Claude Code skill workflow
|
|
342
|
+
├── config.json # Configuration (docs source, paths)
|
|
343
|
+
├── references/
|
|
344
|
+
│ ├── composition.md # Composition patterns and examples
|
|
345
|
+
│ ├── css-variables.md # CSS variable naming and customization
|
|
346
|
+
│ ├── accessibility.md # WCAG 2.1 AA compliance patterns
|
|
347
|
+
│ ├── architecture.md # fpkit architecture and patterns
|
|
348
|
+
│ ├── testing.md # Testing strategies and examples
|
|
349
|
+
│ └── storybook.md # Storybook documentation patterns
|
|
350
|
+
└── scripts/
|
|
351
|
+
├── validate_css_vars.py # Portable CSS validation script
|
|
352
|
+
└── sync-docs.sh # Sync docs from fpkit package
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## Compatibility
|
|
358
|
+
|
|
359
|
+
- **@fpkit/acss:** v1.0.0+
|
|
360
|
+
- **Claude Code:** Latest version
|
|
361
|
+
- **Python:** 3.7+ (for validation script)
|
|
362
|
+
- **Node.js:** 22.12.0+ (for npm package)
|
|
363
|
+
- **Storybook:** 10.x (if using in monorepo)
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Available fpkit Components
|
|
368
|
+
|
|
369
|
+
The skill knows about these fpkit components:
|
|
370
|
+
|
|
371
|
+
**Layout:**
|
|
372
|
+
|
|
373
|
+
- Header, Main, Footer, Aside, Nav
|
|
374
|
+
|
|
375
|
+
**Content:**
|
|
376
|
+
|
|
377
|
+
- Heading, Text, Badge, Tag
|
|
378
|
+
|
|
379
|
+
**Forms:**
|
|
380
|
+
|
|
381
|
+
- Input, Field, FieldLabel, FieldInput, FieldTextarea
|
|
382
|
+
|
|
383
|
+
**Buttons & Actions:**
|
|
384
|
+
|
|
385
|
+
- Button
|
|
386
|
+
|
|
387
|
+
**Cards:**
|
|
388
|
+
|
|
389
|
+
- Card, CardHeader, CardTitle, CardContent, CardFooter
|
|
390
|
+
|
|
391
|
+
**Dialogs:**
|
|
392
|
+
|
|
393
|
+
- Dialog, Modal
|
|
394
|
+
|
|
395
|
+
**Feedback:**
|
|
396
|
+
|
|
397
|
+
- Alert
|
|
398
|
+
|
|
399
|
+
**Data Display:**
|
|
400
|
+
|
|
401
|
+
- Table, List
|
|
402
|
+
|
|
403
|
+
**Interactive:**
|
|
404
|
+
|
|
405
|
+
- Details, Popover
|
|
406
|
+
|
|
407
|
+
**Icons:**
|
|
408
|
+
|
|
409
|
+
- Icon library
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## Common Workflows
|
|
414
|
+
|
|
415
|
+
### Workflow 1: Build a Custom Component
|
|
416
|
+
|
|
417
|
+
1. **Describe what you want:**
|
|
418
|
+
|
|
419
|
+
> "Create a ConfirmButton that shows a confirmation dialog before executing
|
|
420
|
+
> an action"
|
|
421
|
+
|
|
422
|
+
2. **Claude Code identifies fpkit components:**
|
|
423
|
+
|
|
424
|
+
- Button (for the trigger)
|
|
425
|
+
- Dialog (for the confirmation modal)
|
|
426
|
+
|
|
427
|
+
3. **Composes solution:**
|
|
428
|
+
|
|
429
|
+
```tsx
|
|
430
|
+
import { Button, Dialog } from "@fpkit/acss";
|
|
431
|
+
import { useState } from "react";
|
|
432
|
+
|
|
433
|
+
export const ConfirmButton = ({ onConfirm, children, ...props }) => {
|
|
434
|
+
const [showConfirm, setShowConfirm] = useState(false);
|
|
435
|
+
// ... implementation
|
|
436
|
+
};
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
4. **Validates accessibility:**
|
|
440
|
+
|
|
441
|
+
- Keyboard navigation ✅
|
|
442
|
+
- ARIA attributes ✅
|
|
443
|
+
- Focus management ✅
|
|
444
|
+
|
|
445
|
+
5. **Provides usage example:**
|
|
446
|
+
```tsx
|
|
447
|
+
<ConfirmButton variant="danger" onConfirm={handleDelete}>
|
|
448
|
+
Delete Account
|
|
449
|
+
</ConfirmButton>
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Workflow 2: Customize Styling
|
|
453
|
+
|
|
454
|
+
1. **Ask about customization:**
|
|
455
|
+
|
|
456
|
+
> "How do I make the buttons larger and change the primary color?"
|
|
457
|
+
|
|
458
|
+
2. **Claude Code provides CSS variable solution:**
|
|
459
|
+
|
|
460
|
+
```css
|
|
461
|
+
:root {
|
|
462
|
+
--btn-padding-inline: 2rem;
|
|
463
|
+
--btn-padding-block: 1rem;
|
|
464
|
+
--btn-fs: 1.125rem;
|
|
465
|
+
--btn-primary-bg: #0066cc;
|
|
466
|
+
}
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
3. **Validates your custom CSS** (if needed):
|
|
470
|
+
```bash
|
|
471
|
+
python scripts/validate_css_vars.py styles/
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### Workflow 3: Ensure Accessibility
|
|
475
|
+
|
|
476
|
+
1. **Request accessibility review:**
|
|
477
|
+
|
|
478
|
+
> "Check if my component is accessible"
|
|
479
|
+
|
|
480
|
+
2. **Claude Code reviews:**
|
|
481
|
+
|
|
482
|
+
- Semantic HTML ✅
|
|
483
|
+
- Keyboard navigation ✅
|
|
484
|
+
- ARIA attributes ⚠️ (suggests improvements)
|
|
485
|
+
- Color contrast ✅
|
|
486
|
+
|
|
487
|
+
3. **Suggests automated testing:**
|
|
488
|
+
```tsx
|
|
489
|
+
import { axe, toHaveNoViolations } from "jest-axe";
|
|
490
|
+
// ... test code
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
---
|
|
494
|
+
|
|
495
|
+
## Best Practices Enforced
|
|
496
|
+
|
|
497
|
+
The skill helps you follow these best practices:
|
|
498
|
+
|
|
499
|
+
### ✅ Composition Over Duplication
|
|
500
|
+
|
|
501
|
+
- Reuse fpkit components instead of creating from scratch
|
|
502
|
+
- Compose 2-3 fpkit components to build complex UIs
|
|
503
|
+
|
|
504
|
+
### ✅ Type Safety
|
|
505
|
+
|
|
506
|
+
- Extend fpkit prop types with TypeScript
|
|
507
|
+
- Preserve all fpkit functionality with `...props` spreading
|
|
508
|
+
|
|
509
|
+
### ✅ Accessibility
|
|
510
|
+
|
|
511
|
+
- Maintain ARIA attributes from fpkit
|
|
512
|
+
- Support keyboard navigation
|
|
513
|
+
- Ensure color contrast meets WCAG AA
|
|
514
|
+
|
|
515
|
+
### ✅ Styling Conventions
|
|
516
|
+
|
|
517
|
+
- Use CSS variables for customization
|
|
518
|
+
- Use rem units (not px)
|
|
519
|
+
- Follow naming pattern: `--{component}-{property}`
|
|
520
|
+
|
|
521
|
+
### ✅ Testing
|
|
522
|
+
|
|
523
|
+
- Focus on testing your composition logic
|
|
524
|
+
- Trust fpkit's internal testing
|
|
525
|
+
- Use jest-axe for accessibility testing
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
529
|
+
## Troubleshooting
|
|
530
|
+
|
|
531
|
+
### Skill Not Activating
|
|
532
|
+
|
|
533
|
+
1. **Check installation path:**
|
|
534
|
+
|
|
535
|
+
```bash
|
|
536
|
+
ls ~/.claude/skills/fpkit-developer/SKILL.md
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
2. **Restart Claude Code** after installation
|
|
540
|
+
|
|
541
|
+
3. **Verify @fpkit/acss is installed:**
|
|
542
|
+
```bash
|
|
543
|
+
npm list @fpkit/acss
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### Validation Script Not Working
|
|
547
|
+
|
|
548
|
+
1. **Check Python version:**
|
|
549
|
+
|
|
550
|
+
```bash
|
|
551
|
+
python --version # Should be 3.7+
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
2. **Make script executable:**
|
|
555
|
+
|
|
556
|
+
```bash
|
|
557
|
+
chmod +x ~/.claude/skills/fpkit-developer/scripts/validate_css_vars.py
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
3. **Run with python3 explicitly:**
|
|
561
|
+
```bash
|
|
562
|
+
python3 ~/.claude/skills/fpkit-developer/scripts/validate_css_vars.py styles/
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### Documentation Not Found
|
|
566
|
+
|
|
567
|
+
Reference docs are copied to the skill directory:
|
|
568
|
+
|
|
569
|
+
```bash
|
|
570
|
+
# List references
|
|
571
|
+
ls ~/.claude/skills/fpkit-developer/references/
|
|
572
|
+
|
|
573
|
+
# View a guide
|
|
574
|
+
cat ~/.claude/skills/fpkit-developer/references/composition.md
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
## Contributing
|
|
580
|
+
|
|
581
|
+
This skill is part of the @fpkit/acss project. To suggest improvements:
|
|
582
|
+
|
|
583
|
+
1. **Report issues:**
|
|
584
|
+
[GitHub Issues](https://github.com/shawn-sandy/acss/issues)
|
|
585
|
+
2. **Suggest features:** Open a discussion on GitHub
|
|
586
|
+
3. **Contribute code:** Submit a pull request
|
|
587
|
+
|
|
588
|
+
---
|
|
589
|
+
|
|
590
|
+
## Resources
|
|
591
|
+
|
|
592
|
+
### Official Documentation
|
|
593
|
+
|
|
594
|
+
- **[fpkit Docs](https://github.com/shawn-sandy/acss/tree/main/packages/fpkit/docs)** -
|
|
595
|
+
Complete documentation
|
|
596
|
+
- **[Storybook](https://fpkit.netlify.app/)** - Interactive component examples
|
|
597
|
+
- **[npm Package](https://www.npmjs.com/package/@fpkit/acss)** - Installation
|
|
598
|
+
and API reference
|
|
599
|
+
|
|
600
|
+
### Learning Resources
|
|
601
|
+
|
|
602
|
+
- **[WCAG 2.1 Guidelines](https://www.w3.org/WAI/WCAG21/quickref/)** -
|
|
603
|
+
Accessibility standards
|
|
604
|
+
- **[React TypeScript Cheatsheet](https://react-typescript-cheatsheet.netlify.app/)** -
|
|
605
|
+
TypeScript patterns
|
|
606
|
+
- **[Testing Library](https://testing-library.com/)** - Testing best practices
|
|
607
|
+
|
|
608
|
+
---
|
|
609
|
+
|
|
610
|
+
## License
|
|
611
|
+
|
|
612
|
+
MIT License - Same as @fpkit/acss
|
|
613
|
+
|
|
614
|
+
---
|
|
615
|
+
|
|
616
|
+
## Version
|
|
617
|
+
|
|
618
|
+
**Skill Version:** 1.0.0 **Compatible with:** @fpkit/acss v1.0.0+ **Last
|
|
619
|
+
Updated:** 2025-11-15
|
|
620
|
+
|
|
621
|
+
---
|
|
622
|
+
|
|
623
|
+
**Happy building with @fpkit/acss and Claude Code!** 🚀
|