@kiva/kv-components 8.3.0 → 8.4.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.
@@ -0,0 +1,331 @@
1
+ # How to Use AI Prompts
2
+
3
+ This guide explains how to use the AI prompt files in this repository to generate component stories and documentation.
4
+
5
+ ## Available Prompts
6
+
7
+ - **[ai-stories-prompt.md](./ai-stories-prompt.md)** - Generate Storybook stories
8
+ - Scaffold minimal stories for new components
9
+ - Create comprehensive stories for stable components
10
+ - Add documentation stories to existing story files
11
+
12
+ - **[ai-documentation-prompt.md](./ai-documentation-prompt.md)** - Generate component documentation
13
+ - Create new MDX documentation
14
+ - Migrate existing documentation to current standards
15
+
16
+ ## How to Use Prompts with AI
17
+
18
+ You have several options for using these prompts. Choose the one that feels most natural to you.
19
+
20
+ ### Option 1: Reference the File (Recommended ⭐)
21
+
22
+ Attach the prompt file to your chat and reference it directly. The AI can read the file and apply the appropriate prompt.
23
+
24
+ **Example:**
25
+ ```
26
+ @ai-stories-prompt.md Use the "For Scaffolding a New Component" prompt
27
+ to create a stories file for KvButton.
28
+
29
+ Component: src/vue/KvButton.vue
30
+ ```
31
+
32
+ **Why this works well:**
33
+ - No need to copy/paste large blocks of text
34
+ - AI gets the full context and latest version
35
+ - Quick and easy
36
+ - You can reference specific sections
37
+
38
+ ### Option 2: Copy, Customize, and Paste
39
+
40
+ Copy the relevant prompt section from the file, replace the `{{placeholders}}` with your actual values, and paste into chat.
41
+
42
+ **Example:**
43
+ ```
44
+ I need to scaffold a basic Storybook stories file for a new Vue 3
45
+ component that I'm just starting to build.
46
+
47
+ Component Name: KvButton
48
+ Component File: @kiva/kv-components/src/vue/KvButton.vue
49
+
50
+ Task: Create a minimal stories file to get started with interactive development.
51
+
52
+ [Include rest of prompt from the file...]
53
+ ```
54
+
55
+ **When to use this:**
56
+ - You want to modify the prompt for specific needs
57
+ - Working in an environment without file attachments
58
+ - Sharing the prompt with others
59
+
60
+ ### Option 3: Natural Language Reference (Most Concise ⭐)
61
+
62
+ Just ask naturally and mention the guide. The AI will look up the appropriate prompt.
63
+
64
+ **Example:**
65
+ ```
66
+ Scaffold a stories file for KvButton using the scaffolding approach
67
+ from the ai-stories-prompt.md guide.
68
+ ```
69
+
70
+ or even simpler:
71
+
72
+ ```
73
+ Create stories for KvButton following the scaffolding guide.
74
+ ```
75
+
76
+ **Why this works well:**
77
+ - Fastest approach
78
+ - Most natural
79
+ - AI infers which prompt to use based on context
80
+ - Great for quick iterations
81
+
82
+ ## Practical Examples
83
+
84
+ ### Scaffolding Stories for a New Component
85
+
86
+ **Natural language approach:**
87
+ ```
88
+ I'm starting work on a new KvToggle component. Can you scaffold
89
+ a basic stories file with just the Default story so I can develop
90
+ it interactively?
91
+
92
+ Component: src/vue/KvToggle.vue
93
+ ```
94
+
95
+ **File reference approach:**
96
+ ```
97
+ @ai-stories-prompt.md Use the scaffolding prompt for KvToggle
98
+
99
+ Component file: src/vue/KvToggle.vue
100
+ ```
101
+
102
+ ### Creating Comprehensive Stories
103
+
104
+ **Natural language approach:**
105
+ ```
106
+ Following the comprehensive stories guide, create all stories for
107
+ KvModal including ComponentOverview, AllVariations, and behavior stories.
108
+
109
+ Component: src/vue/KvModal.vue
110
+ Documentation: src/vue/stories/KvModalDocs.mdx
111
+ ```
112
+
113
+ **File reference approach:**
114
+ ```
115
+ @ai-stories-prompt.md Use "For Comprehensive Stories" prompt for KvModal
116
+
117
+ Files:
118
+ - Component: src/vue/KvModal.vue
119
+ - Docs: src/vue/stories/KvModalDocs.mdx
120
+ ```
121
+
122
+ ### Creating Documentation
123
+
124
+ **Natural language approach:**
125
+ ```
126
+ Create MDX documentation for KvButton following the documentation
127
+ template. The stories already exist.
128
+
129
+ Component: src/vue/KvButton.vue
130
+ Stories: src/vue/stories/KvButton.stories.js
131
+ ```
132
+
133
+ **File reference approach:**
134
+ ```
135
+ @ai-documentation-prompt.md Generate new documentation for KvButton
136
+
137
+ Component: src/vue/KvButton.vue
138
+ Stories: src/vue/stories/KvButton.stories.js
139
+ ```
140
+
141
+ ### Adding Stories to Existing Story Files
142
+
143
+ **Natural language approach:**
144
+ ```
145
+ I have existing stories for KvCard but the MDX docs reference some
146
+ stories that don't exist yet. Add the missing stories without
147
+ modifying the existing ones.
148
+
149
+ Existing stories: src/vue/stories/KvCard.stories.js
150
+ Documentation: src/vue/stories/KvCardDocs.mdx
151
+ Component: src/vue/KvCard.vue
152
+ ```
153
+
154
+ **File reference approach:**
155
+ ```
156
+ @ai-stories-prompt.md Use "For Adding Documentation Stories" prompt for KvCard
157
+
158
+ Files:
159
+ - Existing stories: src/vue/stories/KvCard.stories.js
160
+ - Documentation: src/vue/stories/KvCardDocs.mdx
161
+ - Component: src/vue/KvCard.vue
162
+ ```
163
+
164
+ ### Migrating Documentation
165
+
166
+ **Natural language approach:**
167
+ ```
168
+ The KvButton docs are outdated. Can you migrate them to the current
169
+ template standards following the migration guide? Preserve existing
170
+ content and add missing sections.
171
+
172
+ Existing docs: src/vue/stories/KvButtonDocs.mdx
173
+ Stories: src/vue/stories/KvButton.stories.js
174
+ Component: src/vue/KvButton.vue
175
+ ```
176
+
177
+ **File reference approach:**
178
+ ```
179
+ @ai-documentation-prompt.md Use migration prompt for KvButton
180
+
181
+ Files:
182
+ - Existing docs: src/vue/stories/KvButtonDocs.mdx
183
+ - Stories: src/vue/stories/KvButton.stories.js
184
+ - Component: src/vue/KvButton.vue
185
+ ```
186
+
187
+ ## Tips for Best Results
188
+
189
+ ### Provide File Context
190
+ Always mention the relevant files:
191
+ - Component file (required)
192
+ - Existing stories or docs (if they exist)
193
+ - Reference examples (optional but helpful)
194
+
195
+ You can use `@` to attach files directly to your message.
196
+
197
+ ### Be Specific About the Task
198
+ Clear language helps:
199
+ - ✅ "Scaffold a minimal stories file for KvToggle"
200
+ - ✅ "Create comprehensive documentation for KvModal"
201
+ - ✅ "Enhance existing KvCard stories, preserving the Default story"
202
+ - ❌ "Help with KvButton"
203
+
204
+ ### Mention Constraints or Preferences
205
+ If you have specific requirements:
206
+ ```
207
+ Scaffold stories for KvAccordion. Note: This component will have
208
+ many variants, so use multiple focused stories instead of one
209
+ AllVariations story.
210
+ ```
211
+
212
+ ### Iterate in Stages
213
+ For complex components, break it down:
214
+ ```
215
+ Step 1: Scaffold basic stories for KvDataTable
216
+ [review output]
217
+
218
+ Step 2: Now add stories for sorting and filtering behaviors
219
+ [review output]
220
+
221
+ Step 3: Add pagination stories
222
+ ```
223
+
224
+ ## Common Workflows
225
+
226
+ ### Starting a New Component
227
+ 1. **Scaffold stories first** (enables interactive development)
228
+ ```
229
+ Scaffold stories for [ComponentName] using the scaffolding guide
230
+ ```
231
+ 2. Develop component interactively in Storybook
232
+ 3. Add more stories as features are built
233
+ 4. Create documentation when component is stable
234
+
235
+ ### Documenting an Existing Component
236
+ 1. **Create comprehensive stories** (if minimal stories exist)
237
+ ```
238
+ Create comprehensive stories for [ComponentName]
239
+ following the complete stories guide
240
+ ```
241
+ 2. **Create documentation**
242
+ ```
243
+ Create documentation for [ComponentName] referencing
244
+ the existing stories
245
+ ```
246
+ 3. Review and refine both
247
+
248
+ ### Updating Legacy Components
249
+ 1. **Assess what exists**
250
+ ```
251
+ Review the stories and docs for [ComponentName] and tell me
252
+ what stories are referenced in the MDX but missing from the stories file
253
+ ```
254
+ 2. **Add missing stories** (don't convert or modify existing ones)
255
+ ```
256
+ Add the missing documentation stories to [ComponentName].stories.js
257
+ without modifying any existing stories
258
+ ```
259
+ 3. **Migrate documentation**
260
+ ```
261
+ Migrate [ComponentName] documentation to current template,
262
+ preserving good content and adding missing sections
263
+ ```
264
+
265
+ ## Troubleshooting
266
+
267
+ ### "The AI didn't follow the prompt correctly"
268
+ - Be more explicit about which section of the prompt to use
269
+ - Attach the prompt file with `@` for direct reference
270
+ - Copy the exact prompt section and customize it
271
+
272
+ ### "The generated code has errors"
273
+ - Provide the component file for proper prop/event understanding
274
+ - Mention any special patterns (v-model, slots, complex state)
275
+ - Ask for fixes: "The KvModal stories have an error on line 23..."
276
+
277
+ ### "I want to modify the prompt for my specific case"
278
+ - Copy the relevant prompt section
279
+ - Modify the guidelines or requirements
280
+ - Paste the customized prompt in your message
281
+
282
+ ### "Which prompt should I use?"
283
+ - Starting new component? → Scaffolding prompt
284
+ - Component is stable, needs full stories? → Comprehensive stories prompt
285
+ - Stories exist but MDX references missing ones? → Add documentation stories prompt
286
+ - No documentation yet? → New documentation prompt
287
+ - Docs need updating? → Migration prompt
288
+
289
+ ## Quick Reference
290
+
291
+ | Task | Prompt File | Section | Quick Ask |
292
+ |------|-------------|---------|-----------|
293
+ | Scaffold stories for new component | ai-stories-prompt.md | For Scaffolding | "Scaffold stories for [Component]" |
294
+ | Create all stories | ai-stories-prompt.md | For Comprehensive Stories | "Create comprehensive stories for [Component]" |
295
+ | Add missing doc stories | ai-stories-prompt.md | For Adding Documentation Stories | "Add missing stories for [Component] docs" |
296
+ | Create new docs | ai-documentation-prompt.md | For New Documentation | "Create docs for [Component]" |
297
+ | Update existing docs | ai-documentation-prompt.md | For Migrating | "Migrate docs for [Component]" |
298
+
299
+ ## Getting Help
300
+
301
+ If you're unsure which approach to use or how to phrase your request:
302
+
303
+ 1. **Ask for guidance first:**
304
+ ```
305
+ I want to work on KvTabs component. It's partially built with
306
+ some stories but no docs. What's the best approach?
307
+ ```
308
+
309
+ 2. **Reference the guides:**
310
+ ```
311
+ Looking at ai-stories-prompt.md, which section should I use
312
+ for a component that has a Default story but needs more?
313
+ ```
314
+
315
+ 3. **Try the natural language approach:**
316
+ ```
317
+ Help me create better stories and docs for KvTabs
318
+ ```
319
+
320
+ The AI will ask clarifying questions and guide you through the process.
321
+
322
+ ## Additional Resources
323
+
324
+ - [Component Documentation Guide](./component-documentation-guide.md) - Standards for documentation
325
+ - [Component Stories Guide](./component-stories-guide.md) - Standards for stories
326
+ - [Component Documentation Checklist](./component-documentation-checklist.md) - Quality checklist
327
+ - [Component Stories Checklist](./component-stories-checklist.md) - Quality checklist
328
+
329
+ ---
330
+
331
+ **Remember:** These prompts are guides, not rigid requirements. Feel free to ask naturally and the AI will apply the appropriate guidance!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "8.3.0",
3
+ "version": "8.4.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -34,7 +34,7 @@
34
34
  "@babel/preset-env": "^7.24.8",
35
35
  "@babel/preset-react": "^7.24.7",
36
36
  "@babel/preset-typescript": "^7.24.7",
37
- "@kiva/kv-tokens": "^3.6.3",
37
+ "@kiva/kv-tokens": "^3.6.4",
38
38
  "@kiva/vite-plugin-vue-lib-css": "^2.0.0",
39
39
  "@laynezh/vite-plugin-lib-assets": "^0.6.1",
40
40
  "@mdi/js": "^7.4.47",
@@ -125,5 +125,5 @@
125
125
  "embla-carousel-fade",
126
126
  "popper.js"
127
127
  ],
128
- "gitHead": "59231e457a4057d240dacbf1caa563f8e14625fa"
128
+ "gitHead": "7dd5e99d1d7ce329c023c0fe3a6e681995b6341d"
129
129
  }