@cere/cere-design-system 0.0.11 → 0.0.15
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/.specify/memory/agent-factory.md +44 -0
- package/{.agent/rules/AGENTS.md → .specify/memory/architecture.md} +1 -3
- package/.specify/memory/component-architecture.md +73 -0
- package/{.agent/rules/COMPONENTS.md → .specify/memory/components-reference.md} +3 -1
- package/.specify/memory/constitution.md +295 -0
- package/.specify/memory/design-tokens.md +139 -0
- package/.specify/memory/package-usage-guide.md +99 -0
- package/.specify/memory/toolkits.md +57 -0
- package/.specify/memory/workflow.md +87 -0
- package/README.md +149 -4
- package/dist/index.d.mts +442 -1
- package/dist/index.d.ts +442 -1
- package/dist/index.js +1325 -497
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1261 -433
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/.agent/README.md +0 -154
- package/.agent/rules/guidelines.md +0 -111
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# AI Coding Agent Toolkits for Material UI Design Systems
|
|
2
|
+
|
|
3
|
+
## Supported Toolkits
|
|
4
|
+
|
|
5
|
+
### 1. Material UI Component Generator (Primary)
|
|
6
|
+
**Specialization:** MUI-based React component development
|
|
7
|
+
**Use Cases:** Creating new components, extending MUI components
|
|
8
|
+
**Configuration:**
|
|
9
|
+
- Base library: @mui/material
|
|
10
|
+
- Styling approach: styled-components + emotion
|
|
11
|
+
- Theme system: MUI theming
|
|
12
|
+
|
|
13
|
+
### 2. Storybook Documentation Toolkit
|
|
14
|
+
**Specialization:** Component documentation and interaction testing
|
|
15
|
+
**Use Cases:** Creating stories, play functions, a11y tests
|
|
16
|
+
**Configuration:**
|
|
17
|
+
- Framework: Storybook 7+
|
|
18
|
+
- Testing: @storybook/test, axe-playwright
|
|
19
|
+
|
|
20
|
+
### 3. Jest Testing Toolkit
|
|
21
|
+
**Specialization:** Unit and integration testing
|
|
22
|
+
**Use Cases:** Writing tests, achieving coverage targets
|
|
23
|
+
**Configuration:**
|
|
24
|
+
- Framework: Jest + React Testing Library
|
|
25
|
+
- Coverage target: 80%+
|
|
26
|
+
- Setup: src/setupTests.ts
|
|
27
|
+
|
|
28
|
+
### 4. TypeScript Type System Toolkit
|
|
29
|
+
**Specialization:** Type definitions and interfaces
|
|
30
|
+
**Use Cases:** Creating types, ensuring type safety
|
|
31
|
+
**Configuration:**
|
|
32
|
+
- Strict mode: enabled
|
|
33
|
+
- Export pattern: ComponentProps interfaces
|
|
34
|
+
|
|
35
|
+
## Toolkit Selection Strategy
|
|
36
|
+
Based on the feature type, select appropriate toolkit(s):
|
|
37
|
+
|
|
38
|
+
| Feature Type | Primary Toolkit | Secondary Toolkits |
|
|
39
|
+
|--------------|----------------|---------------------|
|
|
40
|
+
| New Component | MUI Component Generator | Storybook, Jest, TypeScript |
|
|
41
|
+
| Component Enhancement | MUI Component Generator | Jest, TypeScript |
|
|
42
|
+
| Documentation | Storybook | - |
|
|
43
|
+
| Testing | Jest | - |
|
|
44
|
+
| Type Updates | TypeScript | - |
|
|
45
|
+
| Integration | All | - |
|
|
46
|
+
|
|
47
|
+
## Dynamic Loading
|
|
48
|
+
Toolkits can be referenced in specs using:
|
|
49
|
+
```yaml
|
|
50
|
+
required_toolkits:
|
|
51
|
+
- mui-component-generator
|
|
52
|
+
- storybook-docs
|
|
53
|
+
- jest-testing
|
|
54
|
+
- typescript-types
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The AI agent should activate appropriate context and specialized knowledge for each toolkit.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Spec-Driven Development Workflow for Cere Design System
|
|
2
|
+
|
|
3
|
+
## Workflow Phases
|
|
4
|
+
|
|
5
|
+
### 1. Constitution (One-time Setup)
|
|
6
|
+
Run once when starting spec-driven development:
|
|
7
|
+
```bash
|
|
8
|
+
/speckit.constitution
|
|
9
|
+
```
|
|
10
|
+
Review and customize the constitution to match team principles.
|
|
11
|
+
|
|
12
|
+
### 2. Specify (Feature Definition)
|
|
13
|
+
For each new component or feature:
|
|
14
|
+
```bash
|
|
15
|
+
/speckit.specify Create a [ComponentName] component that...
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
This creates:
|
|
19
|
+
- New git branch: `001-component-name`
|
|
20
|
+
- Spec file: `specs/001-component-name/spec.md`
|
|
21
|
+
- Populates spec from template with feature details
|
|
22
|
+
|
|
23
|
+
**Review the spec:**
|
|
24
|
+
- Verify component category
|
|
25
|
+
- Confirm Material UI base component
|
|
26
|
+
- Review props interface
|
|
27
|
+
- Validate accessibility requirements
|
|
28
|
+
|
|
29
|
+
### 3. Plan (Technical Design)
|
|
30
|
+
After spec is approved:
|
|
31
|
+
```bash
|
|
32
|
+
/speckit.plan
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This creates:
|
|
36
|
+
- Plan file: `specs/001-component-name/plan.md`
|
|
37
|
+
- Technical implementation details
|
|
38
|
+
- Phase-by-phase breakdown
|
|
39
|
+
|
|
40
|
+
### 4. Tasks (Implementation Breakdown)
|
|
41
|
+
After plan is approved:
|
|
42
|
+
```bash
|
|
43
|
+
/speckit.tasks
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This creates:
|
|
47
|
+
- Tasks file: `specs/001-component-name/tasks.md`
|
|
48
|
+
- Granular checklist of implementation steps
|
|
49
|
+
|
|
50
|
+
### 5. Implement (Execution)
|
|
51
|
+
Work through tasks systematically:
|
|
52
|
+
|
|
53
|
+
**Setup Phase:**
|
|
54
|
+
- Create component file
|
|
55
|
+
- Create test file
|
|
56
|
+
- Create story file
|
|
57
|
+
|
|
58
|
+
**Implementation Phase:**
|
|
59
|
+
- Define TypeScript interfaces
|
|
60
|
+
- Implement component logic
|
|
61
|
+
- Add theme integration
|
|
62
|
+
|
|
63
|
+
**Testing Phase:**
|
|
64
|
+
- Write unit tests
|
|
65
|
+
- Create Storybook stories
|
|
66
|
+
- Run accessibility checks
|
|
67
|
+
|
|
68
|
+
**Validation Phase:**
|
|
69
|
+
```bash
|
|
70
|
+
npm run type-check && npm run lint && npm test && npm run build && npm run test:storybook
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 6. Review (Quality Assurance)
|
|
74
|
+
- Code review on PR
|
|
75
|
+
- Visual design review in Storybook
|
|
76
|
+
- Accessibility audit results
|
|
77
|
+
|
|
78
|
+
### 7. Merge & Document
|
|
79
|
+
- Merge feature branch to main
|
|
80
|
+
- Update package version if needed
|
|
81
|
+
- Update changelog
|
|
82
|
+
|
|
83
|
+
## Best Practices
|
|
84
|
+
1. Always start with a spec - don't code directly
|
|
85
|
+
2. One component per spec/branch
|
|
86
|
+
3. Keep specs focused and atomic
|
|
87
|
+
4. Update components-reference.md after merging
|
package/README.md
CHANGED
|
@@ -201,11 +201,156 @@ npm run lint
|
|
|
201
201
|
- **Warning**: Orange/Yellow (#F59E0B)
|
|
202
202
|
- **Tertiary**: Orange/Yellow (#F59E0B)
|
|
203
203
|
|
|
204
|
-
##
|
|
204
|
+
## Spec-Driven Development
|
|
205
205
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
This project uses [GitHub Spec Kit](https://github.com/github/spec-kit) (`specify-cli`) for spec-driven development - a methodology where every feature starts with a specification document before implementation.
|
|
207
|
+
|
|
208
|
+
### What is Spec-Driven Development?
|
|
209
|
+
|
|
210
|
+
Spec-Driven Development (SDD) is a structured approach to software development where:
|
|
211
|
+
1. **Specs define features** - Write clear specifications before coding
|
|
212
|
+
2. **Plans outline architecture** - Technical designs guide implementation
|
|
213
|
+
3. **Tasks break down work** - Granular checklists ensure completeness
|
|
214
|
+
4. **AI agents assist** - Specs provide context for AI-powered development
|
|
215
|
+
|
|
216
|
+
This ensures consistency, clarity, and maintainability across the entire design system.
|
|
217
|
+
|
|
218
|
+
### Using Specify CLI
|
|
219
|
+
|
|
220
|
+
Install `specify-cli` (recommended via `uv`):
|
|
221
|
+
```bash
|
|
222
|
+
uv tool install specify-cli
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Or with pipx/npm:
|
|
226
|
+
```bash
|
|
227
|
+
pipx install specify-cli
|
|
228
|
+
# or
|
|
229
|
+
npm install -g specify-cli
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Development Workflow
|
|
233
|
+
|
|
234
|
+
#### 1. **Create a Specification**
|
|
235
|
+
Use AI agents (Cursor, Warp, Claude, etc.) with the `/speckit.specify` command:
|
|
236
|
+
```bash
|
|
237
|
+
/speckit.specify Create a [ComponentName] component that [does something]
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
This creates:
|
|
241
|
+
- New git branch: `001-component-name`
|
|
242
|
+
- Spec file: `specs/001-component-name/spec.md`
|
|
243
|
+
- Populated template with requirements, APIs, and acceptance criteria
|
|
244
|
+
|
|
245
|
+
#### 2. **Generate Implementation Plan**
|
|
246
|
+
After spec approval:
|
|
247
|
+
```bash
|
|
248
|
+
/speckit.plan
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Creates `specs/001-component-name/plan.md` with:
|
|
252
|
+
- Technical architecture decisions
|
|
253
|
+
- Implementation phases
|
|
254
|
+
- Dependencies and considerations
|
|
255
|
+
|
|
256
|
+
#### 3. **Break Down into Tasks**
|
|
257
|
+
After plan approval:
|
|
258
|
+
```bash
|
|
259
|
+
/speckit.tasks
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Creates `specs/001-component-name/tasks.md` with:
|
|
263
|
+
- Granular implementation checklist
|
|
264
|
+
- Testing requirements
|
|
265
|
+
- Documentation updates
|
|
266
|
+
|
|
267
|
+
#### 4. **Implement & Validate**
|
|
268
|
+
Follow the tasks checklist and validate:
|
|
269
|
+
```bash
|
|
270
|
+
npm run type-check && npm run lint && npm test && npm run build
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Key Files
|
|
274
|
+
|
|
275
|
+
- `.specify/memory/constitution.md` - Project governing principles
|
|
276
|
+
- `.specify/memory/components-reference.md` - Complete component API reference
|
|
277
|
+
- `.specify/memory/workflow.md` - Step-by-step development workflow
|
|
278
|
+
- `.specify/memory/package-usage-guide.md` - How to use this package in other projects
|
|
279
|
+
- `.specify/templates/` - Spec, plan, and task templates
|
|
280
|
+
- `specs/` - Feature specifications and implementation plans
|
|
281
|
+
|
|
282
|
+
### Using This Package in Your Application's SpecKit
|
|
283
|
+
|
|
284
|
+
If you're building an application that uses this design system and also uses Spec Kit, you can reference the design system's component documentation in your specs and AI agent context.
|
|
285
|
+
|
|
286
|
+
#### Method 1: Reference in Your Constitution
|
|
287
|
+
|
|
288
|
+
Add to your application's `.specify/memory/constitution.md`:
|
|
289
|
+
|
|
290
|
+
```markdown
|
|
291
|
+
## Article: UI Component Standards
|
|
292
|
+
|
|
293
|
+
### Design System Requirement
|
|
294
|
+
All UI components MUST use the Cere Design System (@cere/cere-design-system).
|
|
295
|
+
|
|
296
|
+
### Component Reference
|
|
297
|
+
Available components and their APIs are documented at:
|
|
298
|
+
`node_modules/@cere/cere-design-system/.specify/memory/components-reference.md`
|
|
299
|
+
|
|
300
|
+
All developers and AI agents MUST consult this reference before implementing UI features.
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
#### Method 2: Create a Design System Memory File
|
|
304
|
+
|
|
305
|
+
Create `.specify/memory/design-system.md` in your application:
|
|
306
|
+
|
|
307
|
+
```markdown
|
|
308
|
+
# Cere Design System Reference
|
|
309
|
+
|
|
310
|
+
This application uses @cere/cere-design-system
|
|
311
|
+
|
|
312
|
+
## Quick Reference
|
|
313
|
+
See complete component reference:
|
|
314
|
+
`node_modules/@cere/cere-design-system/.specify/memory/components-reference.md`
|
|
315
|
+
|
|
316
|
+
Also see package usage guide:
|
|
317
|
+
`node_modules/@cere/cere-design-system/.specify/memory/package-usage-guide.md`
|
|
318
|
+
|
|
319
|
+
## Installation & Setup
|
|
320
|
+
```tsx
|
|
321
|
+
import { ThemeProvider, theme } from '@cere/cere-design-system';
|
|
322
|
+
import { Button, TextField, Card } from '@cere/cere-design-system';
|
|
323
|
+
|
|
324
|
+
<ThemeProvider theme={theme}>
|
|
325
|
+
<App />
|
|
326
|
+
</ThemeProvider>
|
|
327
|
+
```
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
#### AI Agent Instructions
|
|
331
|
+
|
|
332
|
+
When AI agents work on your application specs:
|
|
333
|
+
1. They can reference `components-reference.md` for complete component APIs
|
|
334
|
+
2. They should follow design system patterns and use existing components
|
|
335
|
+
3. They get TypeScript types and usage examples from the reference
|
|
336
|
+
|
|
337
|
+
See `.specify/memory/package-usage-guide.md` (included in the npm package) for detailed integration instructions.
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Paste the output into your AI conversation to give the agent complete knowledge of:
|
|
341
|
+
- All 70+ available components
|
|
342
|
+
- Props and TypeScript types
|
|
343
|
+
- Usage examples and patterns
|
|
344
|
+
- Theme configuration
|
|
345
|
+
- Best practices
|
|
346
|
+
|
|
347
|
+
**Setup Methods:**
|
|
348
|
+
|
|
349
|
+
1. **Direct reference** - Copy the file content into your AI conversation
|
|
350
|
+
2. **Project rules** - Add to `.cursorrules` or `.agent/rules/`
|
|
351
|
+
3. **Auto-inject** - Use a postinstall script to copy to your project
|
|
352
|
+
|
|
353
|
+
See [.agent/README.md](./.agent/README.md) for detailed setup instructions and examples.
|
|
209
354
|
|
|
210
355
|
## AI-Assisted Development
|
|
211
356
|
|