prizmkit 1.1.54 → 1.1.55
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/bundled/VERSION.json +3 -3
- package/bundled/rules/_rules-metadata.json +6 -1
- package/bundled/rules/general/cohesive-modeling.md +27 -0
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +114 -4
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +609 -0
- package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +285 -0
- package/bundled/skills/app-planner/references/rules/backend/question-bank.md +249 -0
- package/bundled/skills/app-planner/references/rules/backend/template.md +173 -0
- package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +373 -0
- package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +211 -0
- package/bundled/skills/app-planner/references/rules/database/question-bank.md +184 -0
- package/bundled/skills/app-planner/references/rules/database/template.md +158 -0
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +810 -0
- package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +188 -0
- package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +302 -0
- package/bundled/skills/app-planner/references/rules/frontend/template.md +320 -0
- package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +639 -0
- package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +290 -0
- package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +232 -0
- package/bundled/skills/app-planner/references/rules/mobile/template.md +175 -0
- package/bundled/skills/prizm-kit/SKILL.md +1 -1
- package/bundled/skills/prizmkit-init/SKILL.md +47 -6
- package/bundled/skills/prizmkit-init/references/config-schema.md +7 -3
- package/bundled/skills/prizmkit-init/references/rules/layer-detection.md +41 -0
- package/package.json +1 -1
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# Frontend Rules — {{ project_name }}
|
|
2
|
+
|
|
3
|
+
> This document was generated by the `frontend-rules` skill on {{ generated_at }}
|
|
4
|
+
> Scope: {{ project_scope }}
|
|
5
|
+
> Design/mockup source: {{ design_source }}
|
|
6
|
+
> Audience: All human developers + all AI coding assistants on this project
|
|
7
|
+
>
|
|
8
|
+
> **Usage**:
|
|
9
|
+
> 1. All AI coding assistants must read this file before generating or modifying any frontend code
|
|
10
|
+
> 2. This document takes precedence over "general best practices" in AI training data
|
|
11
|
+
> 3. Code conflicting with this document must not be committed
|
|
12
|
+
> 4. Modifying this document requires team review
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 0. TL;DR — Key Decisions at a Glance
|
|
17
|
+
|
|
18
|
+
| Dimension | Decision |
|
|
19
|
+
|-----------|----------|
|
|
20
|
+
| Framework | {{ framework }} |
|
|
21
|
+
| Meta-Framework | {{ meta_framework }} |
|
|
22
|
+
| Package Manager | {{ package_manager }} |
|
|
23
|
+
| Styling Solution | {{ style_solution }} |
|
|
24
|
+
| Font Strategy | {{ font_strategy }} |
|
|
25
|
+
| Global State | {{ state_lib }} |
|
|
26
|
+
| Server State | {{ server_state_lib }} |
|
|
27
|
+
| API Type Source | {{ api_type_source }} |
|
|
28
|
+
| Design Token Layers | {{ token_layering }} |
|
|
29
|
+
| Dark Mode | {{ dark_mode }} |
|
|
30
|
+
| Responsive Strategy | {{ responsive_strategy }} |
|
|
31
|
+
| Breakpoints | {{ breakpoint_scheme }} |
|
|
32
|
+
| Internationalization | {{ i18n }} |
|
|
33
|
+
| Accessibility Target | {{ a11y_level }} |
|
|
34
|
+
| Test Coverage | {{ test_coverage }} |
|
|
35
|
+
| Unit Test Framework | {{ unit_test_framework }} |
|
|
36
|
+
| E2E Framework | {{ e2e_framework }} |
|
|
37
|
+
| AI Single File Limit | {{ ai_max_lines }} lines |
|
|
38
|
+
| First Screen LCP Target | {{ lcp_target }} |
|
|
39
|
+
| Single Chunk Limit | {{ bundle_size }} |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 1. Design System
|
|
44
|
+
|
|
45
|
+
### 1.1 Design Token Layers
|
|
46
|
+
|
|
47
|
+
{{ token_layering_rules }}
|
|
48
|
+
|
|
49
|
+
### 1.2 Naming Conventions
|
|
50
|
+
|
|
51
|
+
- Colors: `color.{role}.{variant}` (e.g., `color.brand.primary`, `color.text.muted`)
|
|
52
|
+
- Spacing: `space.{step}` (e.g., `space.4` = 16px)
|
|
53
|
+
- Font sizes: `font.size.{role}` (e.g., `font.size.body`)
|
|
54
|
+
- Border radius: `radius.{step}` (e.g., `radius.md`)
|
|
55
|
+
- Shadows: `shadow.{level}` (e.g., `shadow.elevated`)
|
|
56
|
+
|
|
57
|
+
### 1.3 Dark Mode
|
|
58
|
+
|
|
59
|
+
{{ dark_mode_rules }}
|
|
60
|
+
|
|
61
|
+
### 1.4 Responsive Breakpoints
|
|
62
|
+
|
|
63
|
+
{{ breakpoint_rules }}
|
|
64
|
+
|
|
65
|
+
### 1.5 Style Deny List
|
|
66
|
+
|
|
67
|
+
{{ FIXED_RULES_DENY_LIST }}
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 2. Engineering Architecture
|
|
72
|
+
|
|
73
|
+
### 2.1 Directory Structure (Mandatory)
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
src/
|
|
77
|
+
├── app/ # Routes/page entry points
|
|
78
|
+
├── components/ # Shared components (must export to components/index.ts)
|
|
79
|
+
│ └── index.ts # Component index (AI must read this before deciding to create a new component)
|
|
80
|
+
├── features/ # Business modules (organized by domain)
|
|
81
|
+
│ └── <domain>/
|
|
82
|
+
│ ├── api/
|
|
83
|
+
│ ├── components/
|
|
84
|
+
│ ├── hooks/
|
|
85
|
+
│ └── index.ts
|
|
86
|
+
├── hooks/ # Shared hooks
|
|
87
|
+
├── lib/ # Third-party wrappers, utilities
|
|
88
|
+
├── stores/ # Global state
|
|
89
|
+
├── styles/ # Global styles + tokens
|
|
90
|
+
├── types/ # Global types
|
|
91
|
+
└── utils/ # Pure function utilities
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### Component Contract
|
|
95
|
+
|
|
96
|
+
{{ FIXED_RULES_COMPONENT_CONTRACT }}
|
|
97
|
+
|
|
98
|
+
### 2.2 Tech Stack Lock-in
|
|
99
|
+
|
|
100
|
+
{{ tech_stack_rules }}
|
|
101
|
+
|
|
102
|
+
**New dependencies must undergo team review** — AI must not modify `package.json` to introduce new packages on its own.
|
|
103
|
+
|
|
104
|
+
### 2.3 Styling Solution Specific Rules
|
|
105
|
+
|
|
106
|
+
{{ style_specific_rules }}
|
|
107
|
+
|
|
108
|
+
### 2.4 Routing Conventions
|
|
109
|
+
|
|
110
|
+
> Routing rules come from the official conventions of `{{ meta_framework }}`, already incorporated in §2.2 Tech Stack Lock-in.
|
|
111
|
+
> Additional project rules: Route file naming follows meta-framework default conventions. Forbid custom route matchers unless there is an explicit architectural decision.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 3. Code Quality (Non-Negotiable)
|
|
116
|
+
|
|
117
|
+
### 3.1 Type Safety
|
|
118
|
+
|
|
119
|
+
{{ FIXED_RULES_TYPESCRIPT }}
|
|
120
|
+
|
|
121
|
+
### 3.2 Naming Conventions
|
|
122
|
+
|
|
123
|
+
{{ FIXED_RULES_NAMING }}
|
|
124
|
+
|
|
125
|
+
### 3.3 File & Component Size
|
|
126
|
+
|
|
127
|
+
- Single file ≤ {{ ai_max_lines }} lines (including blank lines and comments)
|
|
128
|
+
- Single function ≤ 50 lines
|
|
129
|
+
- Single component props ≤ 8 (beyond this, consider splitting or using object aggregation)
|
|
130
|
+
- Nesting depth ≤ 4 levels
|
|
131
|
+
|
|
132
|
+
### 3.4 ESLint / Prettier
|
|
133
|
+
|
|
134
|
+
- Config files must be committed to the repository
|
|
135
|
+
- Pre-commit hooks enforce lint and format
|
|
136
|
+
- Forbid file-level `eslint-disable`. Exceptions require documented reasons and review
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 4. State & Data
|
|
141
|
+
|
|
142
|
+
### 4.1 Global State ({{ state_lib }})
|
|
143
|
+
|
|
144
|
+
{{ state_rules }}
|
|
145
|
+
|
|
146
|
+
### 4.2 Server State ({{ server_state_lib }})
|
|
147
|
+
|
|
148
|
+
{{ server_state_rules }}
|
|
149
|
+
|
|
150
|
+
### 4.3 API Types
|
|
151
|
+
|
|
152
|
+
- API type source: {{ api_type_source }}
|
|
153
|
+
- Forbid hand-writing types related to backend contracts (unless API type source is "hand-written .d.ts")
|
|
154
|
+
- All request functions must return fully-typed Promises. Forbid `Promise<any>`
|
|
155
|
+
|
|
156
|
+
### 4.4 Forms
|
|
157
|
+
|
|
158
|
+
- Form state management follows the best practices of the chosen state library ({{ state_lib }})
|
|
159
|
+
- Client-side + server-side validation dual protection. Forbid relying solely on client-side validation
|
|
160
|
+
- Error messages must be displayed inline near the corresponding field and support keyboard focus
|
|
161
|
+
- Submit buttons must have a loading state to prevent duplicate submissions
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 5. User Experience
|
|
166
|
+
|
|
167
|
+
### 5.1 Four-State UI (Mandatory)
|
|
168
|
+
|
|
169
|
+
Any view containing async operations must explicitly handle:
|
|
170
|
+
|
|
171
|
+
- **loading**: skeleton screen / spinner. Forbid white screen.
|
|
172
|
+
- **error**: error message + retry button. Forbid just `console.error`.
|
|
173
|
+
- **empty**: empty state illustration + guided action.
|
|
174
|
+
- **success**: normal rendering.
|
|
175
|
+
|
|
176
|
+
### 5.2 Error Handling Rules
|
|
177
|
+
|
|
178
|
+
{{ FIXED_RULES_ERROR_HANDLING }}
|
|
179
|
+
|
|
180
|
+
### 5.3 Accessibility (Target: {{ a11y_level }})
|
|
181
|
+
|
|
182
|
+
{{ FIXED_RULES_A11Y }}
|
|
183
|
+
|
|
184
|
+
{{ a11y_extra_rules }}
|
|
185
|
+
|
|
186
|
+
### 5.4 Internationalization
|
|
187
|
+
|
|
188
|
+
{{ FIXED_RULES_I18N_BASELINE }}
|
|
189
|
+
|
|
190
|
+
{{ i18n_rules }}
|
|
191
|
+
|
|
192
|
+
### 5.5 Performance Baseline
|
|
193
|
+
|
|
194
|
+
{{ FIXED_RULES_PERFORMANCE }}
|
|
195
|
+
|
|
196
|
+
{{ performance_rules }}
|
|
197
|
+
|
|
198
|
+
### 5.6 Animation
|
|
199
|
+
|
|
200
|
+
- All animations must be ≤ 300ms (page transitions excepted)
|
|
201
|
+
- Must respect `prefers-reduced-motion`
|
|
202
|
+
- Forbid using animation properties that block the main thread (like `top` / `left` — use `transform` instead)
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 6. Testing & Quality Assurance
|
|
207
|
+
|
|
208
|
+
### 6.1 Testing Strategy
|
|
209
|
+
|
|
210
|
+
{{ test_rules }}
|
|
211
|
+
|
|
212
|
+
### 6.2 Coverage Thresholds
|
|
213
|
+
|
|
214
|
+
- Shared components: ≥ 80%
|
|
215
|
+
- Business modules: ≥ 60%
|
|
216
|
+
- Critical flows (login, payment, checkout, etc.): E2E coverage mandatory
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 7. AI Vibecoding Behavior Constraints
|
|
221
|
+
|
|
222
|
+
### 7.1 Baseline Constraints (project-agnostic, always active)
|
|
223
|
+
|
|
224
|
+
{{ FIXED_RULES_AI_BASE }}
|
|
225
|
+
|
|
226
|
+
### 7.2 Mandatory Pre-Actions (before every code generation)
|
|
227
|
+
|
|
228
|
+
AI must complete the following in order before generating or modifying any frontend code:
|
|
229
|
+
|
|
230
|
+
1. Read this file (`frontend-rules.md`)
|
|
231
|
+
2. Read `src/components/index.ts` to confirm whether a reusable component already exists
|
|
232
|
+
3. Read the target module's `README.md` or `index.ts` (if present)
|
|
233
|
+
4. If modifying a shared component, search all callers and list the impact
|
|
234
|
+
|
|
235
|
+
### 7.3 Project-Specific Hard Constraints
|
|
236
|
+
|
|
237
|
+
- **Single file line limit**: {{ ai_max_lines }} lines
|
|
238
|
+
- **Adding dependencies**: {{ ai_dependency_rule }}
|
|
239
|
+
- **Modifying shared components**: {{ ai_breaking_change_rule }}
|
|
240
|
+
- **New component registration trifecta**: ① Register in `components/index.ts` ② Add example in preview page ③ Export props types
|
|
241
|
+
- **Config file modification**: {{ ai_config_rule }}
|
|
242
|
+
- **New component index sync**: {{ ai_index_rule }}
|
|
243
|
+
|
|
244
|
+
### 7.4 Forbidden Behaviors
|
|
245
|
+
|
|
246
|
+
- ❌ Self-initiated `npm install` to introduce new dependencies
|
|
247
|
+
- ❌ Modifying `package.json`, `tsconfig.json`, `vite.config.*`, `next.config.*`, ESLint/Prettier config (unless explicitly requested by user)
|
|
248
|
+
- ❌ Deleting or renaming exported APIs (unless explicitly requested by user with caller impact assessed)
|
|
249
|
+
- ❌ Skipping type definitions (writing `any` / `as any` / `// @ts-ignore`)
|
|
250
|
+
- ❌ Introducing hardcoded colors/font sizes/spacing that bypass design tokens
|
|
251
|
+
- ❌ "Incidental changes" spanning more than 5 files in a single commit
|
|
252
|
+
- ❌ Creating a new component without reading `components/index.ts` first
|
|
253
|
+
|
|
254
|
+
### 7.5 Output Format Convention
|
|
255
|
+
|
|
256
|
+
After completing code generation, AI must output:
|
|
257
|
+
|
|
258
|
+
1. **Change list**: files added / modified / deleted
|
|
259
|
+
2. **Impact**: modified exported APIs and their callers
|
|
260
|
+
3. **Not done**: items mentioned in the user's original request but not addressed this time
|
|
261
|
+
4. **Next steps**: up to 3 suggestions
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## 8. Collaboration Process
|
|
266
|
+
|
|
267
|
+
### 8.1 Branching & Commits
|
|
268
|
+
|
|
269
|
+
{{ FIXED_RULES_GIT }}
|
|
270
|
+
|
|
271
|
+
### 8.2 Code Review Checklist
|
|
272
|
+
|
|
273
|
+
PR submitter must self-check the following:
|
|
274
|
+
|
|
275
|
+
- [ ] Follows this spec (no `any`, no `!important`, no hardcoded values)
|
|
276
|
+
- [ ] Reuses existing components from `components/index.ts`
|
|
277
|
+
- [ ] Has loading / error / empty states
|
|
278
|
+
- [ ] Has accessibility handling (label, aria, keyboard)
|
|
279
|
+
- [ ] Has i18n (no hardcoded user-visible text)
|
|
280
|
+
- [ ] Has unit tests (shared components) / E2E (critical flows)
|
|
281
|
+
- [ ] Single file ≤ {{ ai_max_lines }} lines
|
|
282
|
+
- [ ] New dependencies added? If so, has it been submitted for review?
|
|
283
|
+
- [ ] Shared components modified? If so, has the impact been listed?
|
|
284
|
+
|
|
285
|
+
### 8.3 Best Practices for AI Collaboration
|
|
286
|
+
|
|
287
|
+
- Task granularity: let AI do one thing at a time. Avoid "while you're at it, also add xxx"
|
|
288
|
+
- Verification granularity: run locally once after every AI output before merging
|
|
289
|
+
- Dispute handling: when AI output conflicts with this spec, **this spec takes precedence**
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## 9. Security Baseline
|
|
294
|
+
|
|
295
|
+
{{ FIXED_RULES_SECURITY }}
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Appendix A: Deny List (Quick Reference)
|
|
300
|
+
|
|
301
|
+
> This appendix is auto-generated by AI in Phase 4 by extracting key forbidden entries from §1.5 (Style Deny List), §3 (Code Quality), §7.4 (AI Forbidden Behaviors), and §9 (Security Baseline) to provide a one-glance review.
|
|
302
|
+
|
|
303
|
+
{{ deny_list_summary }}
|
|
304
|
+
|
|
305
|
+
## Appendix B: Recommended Libraries & Tools
|
|
306
|
+
|
|
307
|
+
> This appendix is auto-generated by AI in Phase 4 based on the chosen tech stack ({{ framework }} / {{ style_solution }} / {{ state_lib }} etc.) to recommend the supporting ecosystem.
|
|
308
|
+
|
|
309
|
+
{{ recommended_libs }}
|
|
310
|
+
|
|
311
|
+
## Appendix C: References
|
|
312
|
+
|
|
313
|
+
- This document was generated by the `frontend-rules` skill
|
|
314
|
+
- To modify this document, invoke the `frontend-rules` skill and choose "Incremental update" mode
|
|
315
|
+
- Original rule library: `.claude/skills/frontend-rules/references/`
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
**Version**: v1.0 — Generated on {{ generated_at }}
|
|
320
|
+
**Next review recommended**: at project milestones or tech stack changes
|