@girardmedia/bootspring 1.2.0 → 2.0.3

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.
Files changed (253) hide show
  1. package/README.md +107 -14
  2. package/bin/bootspring.js +166 -27
  3. package/cli/agent.js +189 -17
  4. package/cli/analyze.js +499 -0
  5. package/cli/audit.js +557 -0
  6. package/cli/auth.js +495 -38
  7. package/cli/billing.js +302 -0
  8. package/cli/build.js +695 -0
  9. package/cli/business.js +109 -26
  10. package/cli/checkpoint-utils.js +168 -0
  11. package/cli/checkpoint.js +639 -0
  12. package/cli/cloud-sync.js +447 -0
  13. package/cli/content.js +198 -0
  14. package/cli/context.js +1 -1
  15. package/cli/deploy.js +543 -0
  16. package/cli/fundraise.js +112 -50
  17. package/cli/github-cmd.js +435 -0
  18. package/cli/health.js +477 -0
  19. package/cli/init.js +84 -13
  20. package/cli/legal.js +107 -95
  21. package/cli/log.js +2 -2
  22. package/cli/loop.js +976 -73
  23. package/cli/manager.js +711 -0
  24. package/cli/metrics.js +480 -0
  25. package/cli/monitor.js +812 -0
  26. package/cli/onboard.js +521 -0
  27. package/cli/orchestrator.js +12 -24
  28. package/cli/prd.js +594 -0
  29. package/cli/preseed-start.js +1483 -0
  30. package/cli/preseed.js +2302 -0
  31. package/cli/project.js +436 -0
  32. package/cli/quality.js +233 -0
  33. package/cli/security.js +913 -0
  34. package/cli/seed.js +1441 -5
  35. package/cli/skill.js +273 -211
  36. package/cli/suggest.js +989 -0
  37. package/cli/switch.js +453 -0
  38. package/cli/visualize.js +527 -0
  39. package/cli/watch.js +769 -0
  40. package/cli/workspace.js +607 -0
  41. package/core/analyze-workflow.js +1134 -0
  42. package/core/api-client.js +535 -22
  43. package/core/audit-workflow.js +1350 -0
  44. package/core/build-orchestrator.js +480 -0
  45. package/core/build-state.js +577 -0
  46. package/core/checkpoint-engine.js +408 -0
  47. package/core/config.js +1109 -26
  48. package/core/context-loader.js +21 -1
  49. package/core/deploy-workflow.js +836 -0
  50. package/core/entitlements.js +93 -22
  51. package/core/github-sync.js +610 -0
  52. package/core/index.js +8 -1
  53. package/core/ingest.js +1111 -0
  54. package/core/metrics-engine.js +768 -0
  55. package/core/onboard-workflow.js +1007 -0
  56. package/core/preseed-workflow.js +934 -0
  57. package/core/preseed.js +1617 -0
  58. package/core/project-context.js +325 -0
  59. package/core/project-state.js +694 -0
  60. package/core/r2-sync.js +583 -0
  61. package/core/scaffold.js +525 -7
  62. package/core/session.js +258 -0
  63. package/core/task-extractor.js +758 -0
  64. package/core/telemetry.js +28 -6
  65. package/core/tier-enforcement.js +737 -0
  66. package/core/utils.js +38 -14
  67. package/generators/questionnaire.js +15 -12
  68. package/generators/sections/ai.js +7 -7
  69. package/generators/sections/content.js +300 -0
  70. package/generators/sections/index.js +3 -0
  71. package/generators/sections/plugins.js +7 -6
  72. package/generators/templates/build-planning.template.js +596 -0
  73. package/generators/templates/content.template.js +819 -0
  74. package/generators/templates/index.js +2 -1
  75. package/hooks/git-autopilot.js +1250 -0
  76. package/hooks/index.js +9 -0
  77. package/intelligence/agent-collab.js +2057 -0
  78. package/intelligence/auto-suggest.js +634 -0
  79. package/intelligence/content-gen.js +1589 -0
  80. package/intelligence/cross-project.js +1647 -0
  81. package/intelligence/index.js +184 -0
  82. package/intelligence/learning/insights.json +517 -7
  83. package/intelligence/learning/pattern-learner.js +1008 -14
  84. package/intelligence/memory/decision-tracker.js +1431 -31
  85. package/intelligence/memory/decisions.jsonl +0 -0
  86. package/intelligence/orchestrator.js +2896 -1
  87. package/intelligence/prd.js +92 -1
  88. package/intelligence/recommendation-weights.json +14 -2
  89. package/intelligence/recommendations.js +463 -9
  90. package/intelligence/workflow-composer.js +1451 -0
  91. package/marketplace/index.d.ts +324 -0
  92. package/marketplace/index.js +1921 -0
  93. package/mcp/contracts/mcp-contract.v1.json +342 -4
  94. package/mcp/registry.js +680 -3
  95. package/mcp/response-formatter.js +23 -0
  96. package/mcp/tools/assist-tool.js +78 -4
  97. package/mcp/tools/autopilot-tool.js +408 -0
  98. package/mcp/tools/content-tool.js +571 -0
  99. package/mcp/tools/dashboard-tool.js +251 -5
  100. package/mcp/tools/mvp-tool.js +344 -0
  101. package/mcp/tools/plugin-tool.js +23 -1
  102. package/mcp/tools/prd-tool.js +579 -0
  103. package/mcp/tools/seed-tool.js +447 -0
  104. package/mcp/tools/skill-tool.js +43 -14
  105. package/mcp/tools/suggest-tool.js +147 -0
  106. package/package.json +15 -6
  107. package/agents/README.md +0 -93
  108. package/agents/ai-integration-expert/context.md +0 -386
  109. package/agents/api-expert/context.md +0 -416
  110. package/agents/architecture-expert/context.md +0 -454
  111. package/agents/auth-expert/context.md +0 -399
  112. package/agents/backend-expert/context.md +0 -483
  113. package/agents/business-strategy-expert/context.md +0 -180
  114. package/agents/code-review-expert/context.md +0 -365
  115. package/agents/competitive-analysis-expert/context.md +0 -239
  116. package/agents/data-modeling-expert/context.md +0 -352
  117. package/agents/database-expert/context.md +0 -250
  118. package/agents/devops-expert/context.md +0 -446
  119. package/agents/email-expert/context.md +0 -379
  120. package/agents/financial-expert/context.md +0 -213
  121. package/agents/frontend-expert/context.md +0 -364
  122. package/agents/fundraising-expert/context.md +0 -257
  123. package/agents/growth-expert/context.md +0 -249
  124. package/agents/index.js +0 -140
  125. package/agents/investor-relations-expert/context.md +0 -266
  126. package/agents/legal-expert/context.md +0 -284
  127. package/agents/marketing-expert/context.md +0 -236
  128. package/agents/monitoring-expert/context.md +0 -362
  129. package/agents/operations-expert/context.md +0 -279
  130. package/agents/partnerships-expert/context.md +0 -286
  131. package/agents/payment-expert/context.md +0 -340
  132. package/agents/performance-expert/context.md +0 -377
  133. package/agents/private-equity-expert/context.md +0 -246
  134. package/agents/railway-expert/context.md +0 -284
  135. package/agents/research-expert/context.md +0 -245
  136. package/agents/sales-expert/context.md +0 -241
  137. package/agents/security-expert/context.md +0 -343
  138. package/agents/testing-expert/context.md +0 -414
  139. package/agents/ui-ux-expert/context.md +0 -448
  140. package/agents/vercel-expert/context.md +0 -426
  141. package/skills/index.js +0 -787
  142. package/skills/patterns/README.md +0 -163
  143. package/skills/patterns/ai/agents.md +0 -281
  144. package/skills/patterns/ai/claude.md +0 -138
  145. package/skills/patterns/ai/embeddings.md +0 -150
  146. package/skills/patterns/ai/rag.md +0 -266
  147. package/skills/patterns/ai/streaming.md +0 -170
  148. package/skills/patterns/ai/structured-output.md +0 -162
  149. package/skills/patterns/ai/tools.md +0 -154
  150. package/skills/patterns/analytics/tracking.md +0 -220
  151. package/skills/patterns/api/errors.md +0 -296
  152. package/skills/patterns/api/graphql.md +0 -440
  153. package/skills/patterns/api/middleware.md +0 -279
  154. package/skills/patterns/api/openapi.md +0 -285
  155. package/skills/patterns/api/rate-limiting.md +0 -231
  156. package/skills/patterns/api/route-handler.md +0 -217
  157. package/skills/patterns/api/server-action.md +0 -249
  158. package/skills/patterns/api/versioning.md +0 -443
  159. package/skills/patterns/api/webhooks.md +0 -247
  160. package/skills/patterns/auth/clerk.md +0 -132
  161. package/skills/patterns/auth/mfa.md +0 -313
  162. package/skills/patterns/auth/nextauth.md +0 -140
  163. package/skills/patterns/auth/oauth.md +0 -237
  164. package/skills/patterns/auth/rbac.md +0 -152
  165. package/skills/patterns/auth/session-management.md +0 -367
  166. package/skills/patterns/auth/session.md +0 -120
  167. package/skills/patterns/database/audit.md +0 -177
  168. package/skills/patterns/database/migrations.md +0 -177
  169. package/skills/patterns/database/pagination.md +0 -230
  170. package/skills/patterns/database/pooling.md +0 -357
  171. package/skills/patterns/database/prisma.md +0 -180
  172. package/skills/patterns/database/relations.md +0 -187
  173. package/skills/patterns/database/seeding.md +0 -246
  174. package/skills/patterns/database/soft-delete.md +0 -153
  175. package/skills/patterns/database/transactions.md +0 -162
  176. package/skills/patterns/deployment/ci-cd.md +0 -231
  177. package/skills/patterns/deployment/docker.md +0 -188
  178. package/skills/patterns/deployment/monitoring.md +0 -387
  179. package/skills/patterns/deployment/vercel.md +0 -160
  180. package/skills/patterns/email/resend.md +0 -143
  181. package/skills/patterns/email/templates.md +0 -245
  182. package/skills/patterns/email/transactional.md +0 -503
  183. package/skills/patterns/email/verification.md +0 -176
  184. package/skills/patterns/files/download.md +0 -243
  185. package/skills/patterns/files/upload.md +0 -239
  186. package/skills/patterns/i18n/nextintl.md +0 -188
  187. package/skills/patterns/logging/structured.md +0 -292
  188. package/skills/patterns/notifications/email-queue.md +0 -248
  189. package/skills/patterns/notifications/push.md +0 -279
  190. package/skills/patterns/payments/checkout.md +0 -303
  191. package/skills/patterns/payments/invoices.md +0 -287
  192. package/skills/patterns/payments/portal.md +0 -245
  193. package/skills/patterns/payments/stripe.md +0 -272
  194. package/skills/patterns/payments/subscriptions.md +0 -300
  195. package/skills/patterns/payments/usage.md +0 -279
  196. package/skills/patterns/performance/caching.md +0 -276
  197. package/skills/patterns/performance/code-splitting.md +0 -233
  198. package/skills/patterns/performance/edge.md +0 -254
  199. package/skills/patterns/performance/isr.md +0 -266
  200. package/skills/patterns/performance/lazy-loading.md +0 -281
  201. package/skills/patterns/realtime/sse.md +0 -327
  202. package/skills/patterns/realtime/websockets.md +0 -336
  203. package/skills/patterns/search/filtering.md +0 -329
  204. package/skills/patterns/search/fulltext.md +0 -260
  205. package/skills/patterns/security/audit-logging.md +0 -444
  206. package/skills/patterns/security/csrf.md +0 -234
  207. package/skills/patterns/security/headers.md +0 -252
  208. package/skills/patterns/security/sanitization.md +0 -258
  209. package/skills/patterns/security/secrets.md +0 -261
  210. package/skills/patterns/security/validation.md +0 -268
  211. package/skills/patterns/security/xss.md +0 -229
  212. package/skills/patterns/seo/metadata.md +0 -252
  213. package/skills/patterns/state/context.md +0 -349
  214. package/skills/patterns/state/react-query.md +0 -313
  215. package/skills/patterns/state/url-state.md +0 -482
  216. package/skills/patterns/state/zustand.md +0 -262
  217. package/skills/patterns/testing/api.md +0 -259
  218. package/skills/patterns/testing/component.md +0 -233
  219. package/skills/patterns/testing/coverage.md +0 -207
  220. package/skills/patterns/testing/fixtures.md +0 -225
  221. package/skills/patterns/testing/integration.md +0 -436
  222. package/skills/patterns/testing/mocking.md +0 -177
  223. package/skills/patterns/testing/playwright.md +0 -162
  224. package/skills/patterns/testing/snapshot.md +0 -175
  225. package/skills/patterns/testing/vitest.md +0 -307
  226. package/skills/patterns/ui/accordions.md +0 -395
  227. package/skills/patterns/ui/cards.md +0 -299
  228. package/skills/patterns/ui/dropdowns.md +0 -476
  229. package/skills/patterns/ui/empty-states.md +0 -320
  230. package/skills/patterns/ui/forms.md +0 -405
  231. package/skills/patterns/ui/inputs.md +0 -319
  232. package/skills/patterns/ui/layouts.md +0 -282
  233. package/skills/patterns/ui/loading.md +0 -291
  234. package/skills/patterns/ui/modals.md +0 -338
  235. package/skills/patterns/ui/navigation.md +0 -374
  236. package/skills/patterns/ui/tables.md +0 -407
  237. package/skills/patterns/ui/toasts.md +0 -300
  238. package/skills/patterns/ui/tooltips.md +0 -396
  239. package/skills/patterns/utils/dates.md +0 -435
  240. package/skills/patterns/utils/errors.md +0 -451
  241. package/skills/patterns/utils/formatting.md +0 -345
  242. package/skills/patterns/utils/validation.md +0 -434
  243. package/templates/bootspring.config.js +0 -83
  244. package/templates/business/business-model-canvas.md +0 -246
  245. package/templates/business/business-plan.md +0 -266
  246. package/templates/business/competitive-analysis.md +0 -312
  247. package/templates/fundraising/data-room-checklist.md +0 -300
  248. package/templates/fundraising/investor-research.md +0 -243
  249. package/templates/fundraising/pitch-deck-outline.md +0 -253
  250. package/templates/legal/gdpr-checklist.md +0 -339
  251. package/templates/legal/privacy-policy.md +0 -285
  252. package/templates/legal/terms-of-service.md +0 -222
  253. package/templates/mcp.json +0 -9
@@ -0,0 +1,819 @@
1
+ /**
2
+ * Content Template Generator
3
+ *
4
+ * Generates content files for blogs, documentation, release notes, etc.
5
+ * Supports multiple content types and output formats.
6
+ *
7
+ * @package bootspring
8
+ * @module generators/templates/content
9
+ */
10
+
11
+ const CONTENT_TYPES = {
12
+ 'blog-post': {
13
+ name: 'Blog Post',
14
+ extension: '.md',
15
+ directory: 'content/blog'
16
+ },
17
+ 'release-notes': {
18
+ name: 'Release Notes',
19
+ extension: '.md',
20
+ directory: 'content/releases'
21
+ },
22
+ 'documentation': {
23
+ name: 'Documentation Page',
24
+ extension: '.mdx',
25
+ directory: 'content/docs'
26
+ },
27
+ 'changelog': {
28
+ name: 'Changelog Entry',
29
+ extension: '.md',
30
+ directory: '.'
31
+ },
32
+ 'readme': {
33
+ name: 'README',
34
+ extension: '.md',
35
+ directory: '.'
36
+ },
37
+ 'landing-page': {
38
+ name: 'Landing Page Copy',
39
+ extension: '.md',
40
+ directory: 'content/marketing'
41
+ },
42
+ 'email-template': {
43
+ name: 'Email Template',
44
+ extension: '.html',
45
+ directory: 'templates/email'
46
+ },
47
+ 'social-post': {
48
+ name: 'Social Media Post',
49
+ extension: '.md',
50
+ directory: 'content/social'
51
+ },
52
+ 'api-doc': {
53
+ name: 'API Documentation',
54
+ extension: '.mdx',
55
+ directory: 'content/docs/api'
56
+ },
57
+ 'tutorial': {
58
+ name: 'Tutorial',
59
+ extension: '.mdx',
60
+ directory: 'content/docs/tutorials'
61
+ }
62
+ };
63
+
64
+ /**
65
+ * Generate blog post template
66
+ */
67
+ function generateBlogPost(options = {}) {
68
+ const {
69
+ title = 'Untitled Post',
70
+ description = '',
71
+ author = 'Team',
72
+ tags = [],
73
+ date = new Date().toISOString().split('T')[0]
74
+ } = options;
75
+
76
+ return `---
77
+ title: "${title}"
78
+ description: "${description}"
79
+ date: "${date}"
80
+ author: "${author}"
81
+ tags: [${tags.map(t => `"${t}"`).join(', ')}]
82
+ image: "/images/blog/${title.toLowerCase().replace(/[^a-z0-9]+/g, '-')}.png"
83
+ ---
84
+
85
+ ## Introduction
86
+
87
+ [Hook - Why should the reader care about this topic?]
88
+
89
+ [Problem statement - What pain point are we addressing?]
90
+
91
+ ## What You'll Learn
92
+
93
+ - Point 1
94
+ - Point 2
95
+ - Point 3
96
+
97
+ ## Main Content
98
+
99
+ ### Section 1
100
+
101
+ [Content]
102
+
103
+ \`\`\`typescript
104
+ // Code example
105
+ \`\`\`
106
+
107
+ ### Section 2
108
+
109
+ [Content]
110
+
111
+ ### Section 3
112
+
113
+ [Content]
114
+
115
+ ## Key Takeaways
116
+
117
+ 1. **Takeaway 1** - Brief explanation
118
+ 2. **Takeaway 2** - Brief explanation
119
+ 3. **Takeaway 3** - Brief explanation
120
+
121
+ ## Next Steps
122
+
123
+ [Call to action - What should the reader do next?]
124
+
125
+ ---
126
+
127
+ *Have questions? Join our [Discord community](https://discord.gg/bootspring) or reach out on [Twitter](https://twitter.com/bootspring).*
128
+ `;
129
+ }
130
+
131
+ /**
132
+ * Generate release notes template
133
+ */
134
+ function generateReleaseNotes(options = {}) {
135
+ const {
136
+ version = '1.0.0',
137
+ date = new Date().toISOString().split('T')[0],
138
+ codename = ''
139
+ } = options;
140
+
141
+ const codenameSection = codename ? ` "${codename}"` : '';
142
+
143
+ return `---
144
+ title: "v${version} Release Notes"
145
+ version: "${version}"
146
+ date: "${date}"
147
+ ---
148
+
149
+ # v${version}${codenameSection}
150
+
151
+ > Released on ${date}
152
+
153
+ ## Highlights
154
+
155
+ Brief summary of the most important changes in this release.
156
+
157
+ - **Feature 1** - What it does and why it matters
158
+ - **Feature 2** - What it does and why it matters
159
+ - **Feature 3** - What it does and why it matters
160
+
161
+ ## What's New
162
+
163
+ ### Feature Name
164
+
165
+ Description of the feature and the value it provides to users.
166
+
167
+ **How to use it:**
168
+
169
+ \`\`\`bash
170
+ # Example command or code
171
+ bootspring new-command
172
+ \`\`\`
173
+
174
+ ### Another Feature
175
+
176
+ Description of another feature.
177
+
178
+ ## Improvements
179
+
180
+ - Improved X by doing Y
181
+ - Enhanced performance of Z
182
+ - Better error messages for W
183
+
184
+ ## Bug Fixes
185
+
186
+ - Fixed issue where X caused Y (#123)
187
+ - Resolved crash when Z happened (#124)
188
+ - Corrected display of W in certain conditions
189
+
190
+ ## Breaking Changes
191
+
192
+ > **Important:** Please review these changes before upgrading.
193
+
194
+ ### Change Name
195
+
196
+ **What changed:** Description of the breaking change.
197
+
198
+ **Migration steps:**
199
+ 1. Step 1
200
+ 2. Step 2
201
+ 3. Step 3
202
+
203
+ **Before:**
204
+ \`\`\`javascript
205
+ // Old code
206
+ \`\`\`
207
+
208
+ **After:**
209
+ \`\`\`javascript
210
+ // New code
211
+ \`\`\`
212
+
213
+ ## Deprecations
214
+
215
+ | Deprecated | Use Instead | Removal Version |
216
+ |------------|-------------|-----------------|
217
+ | \`oldMethod()\` | \`newMethod()\` | v${parseInt(version) + 1}.0.0 |
218
+
219
+ ## Upgrade Guide
220
+
221
+ ### From v${(parseFloat(version) - 0.1).toFixed(1)}.x
222
+
223
+ \`\`\`bash
224
+ # Upgrade command
225
+ npm update @bootspring/cli
226
+ \`\`\`
227
+
228
+ ### Compatibility
229
+
230
+ | Dependency | Minimum Version |
231
+ |------------|-----------------|
232
+ | Node.js | 18.0.0 |
233
+ | npm | 9.0.0 |
234
+
235
+ ## Contributors
236
+
237
+ Thanks to all contributors who made this release possible!
238
+
239
+ ---
240
+
241
+ [Full Changelog](https://github.com/bootspring/bootspring/compare/v${(parseFloat(version) - 0.1).toFixed(1)}...v${version})
242
+ `;
243
+ }
244
+
245
+ /**
246
+ * Generate documentation page template
247
+ */
248
+ function generateDocumentation(options = {}) {
249
+ const {
250
+ title = 'Documentation',
251
+ description = '',
252
+ category = 'guides',
253
+ order = 1
254
+ } = options;
255
+
256
+ return `---
257
+ title: "${title}"
258
+ description: "${description}"
259
+ category: "${category}"
260
+ order: ${order}
261
+ ---
262
+
263
+ # ${title}
264
+
265
+ ${description || 'Introduction to this topic.'}
266
+
267
+ ## Prerequisites
268
+
269
+ Before you begin, make sure you have:
270
+
271
+ - [ ] Requirement 1
272
+ - [ ] Requirement 2
273
+ - [ ] Requirement 3
274
+
275
+ ## Overview
276
+
277
+ [Brief overview of what this guide covers]
278
+
279
+ ## Quick Start
280
+
281
+ \`\`\`bash
282
+ # Get started quickly
283
+ npx bootspring command
284
+ \`\`\`
285
+
286
+ ## Step-by-Step Guide
287
+
288
+ ### Step 1: Setup
289
+
290
+ [Instructions]
291
+
292
+ \`\`\`typescript
293
+ // Code example
294
+ \`\`\`
295
+
296
+ ### Step 2: Configuration
297
+
298
+ [Instructions]
299
+
300
+ ### Step 3: Implementation
301
+
302
+ [Instructions]
303
+
304
+ ## Examples
305
+
306
+ ### Basic Example
307
+
308
+ \`\`\`typescript
309
+ // Basic usage
310
+ \`\`\`
311
+
312
+ ### Advanced Example
313
+
314
+ \`\`\`typescript
315
+ // Advanced usage
316
+ \`\`\`
317
+
318
+ ## Configuration Options
319
+
320
+ | Option | Type | Default | Description |
321
+ |--------|------|---------|-------------|
322
+ | \`option1\` | string | \`"default"\` | Description |
323
+ | \`option2\` | boolean | \`false\` | Description |
324
+
325
+ ## Troubleshooting
326
+
327
+ ### Common Issue 1
328
+
329
+ **Problem:** Description of the problem.
330
+
331
+ **Solution:** How to fix it.
332
+
333
+ ### Common Issue 2
334
+
335
+ **Problem:** Description of the problem.
336
+
337
+ **Solution:** How to fix it.
338
+
339
+ ## Related Resources
340
+
341
+ - [Related Guide 1](/docs/related-1)
342
+ - [Related Guide 2](/docs/related-2)
343
+ - [API Reference](/docs/api)
344
+
345
+ ## Next Steps
346
+
347
+ - [ ] Action item 1
348
+ - [ ] Action item 2
349
+
350
+ ---
351
+
352
+ <Callout type="info">
353
+ Need help? Join our [Discord community](https://discord.gg/bootspring) for support.
354
+ </Callout>
355
+ `;
356
+ }
357
+
358
+ /**
359
+ * Generate README template
360
+ */
361
+ function generateReadme(options = {}) {
362
+ const {
363
+ name = 'Project',
364
+ description = 'A project built with Bootspring',
365
+ author = '',
366
+ license = 'MIT',
367
+ features = [],
368
+ tech = []
369
+ } = options;
370
+
371
+ const featuresSection = features.length > 0
372
+ ? features.map(f => `- **${f.name}** - ${f.description}`).join('\n')
373
+ : '- Feature 1\n- Feature 2\n- Feature 3';
374
+
375
+ const techSection = tech.length > 0
376
+ ? tech.map(t => `- ${t}`).join('\n')
377
+ : '- Next.js 14\n- TypeScript\n- Tailwind CSS\n- Prisma';
378
+
379
+ return `# ${name}
380
+
381
+ > ${description}
382
+
383
+ [![npm version](https://img.shields.io/npm/v/${name.toLowerCase()}.svg)](https://www.npmjs.com/package/${name.toLowerCase()})
384
+ [![License: ${license}](https://img.shields.io/badge/License-${license}-blue.svg)](LICENSE)
385
+
386
+ ## Features
387
+
388
+ ${featuresSection}
389
+
390
+ ## Tech Stack
391
+
392
+ ${techSection}
393
+
394
+ ## Quick Start
395
+
396
+ \`\`\`bash
397
+ # Clone the repository
398
+ git clone https://github.com/${author || 'username'}/${name.toLowerCase()}.git
399
+
400
+ # Install dependencies
401
+ npm install
402
+
403
+ # Start development server
404
+ npm run dev
405
+ \`\`\`
406
+
407
+ ## Installation
408
+
409
+ \`\`\`bash
410
+ npm install ${name.toLowerCase()}
411
+ \`\`\`
412
+
413
+ ## Usage
414
+
415
+ \`\`\`typescript
416
+ import { feature } from '${name.toLowerCase()}';
417
+
418
+ // Basic usage example
419
+ feature.doSomething();
420
+ \`\`\`
421
+
422
+ ## Configuration
423
+
424
+ Create a \`config.js\` file in your project root:
425
+
426
+ \`\`\`javascript
427
+ module.exports = {
428
+ // Configuration options
429
+ };
430
+ \`\`\`
431
+
432
+ ## Documentation
433
+
434
+ [Full documentation](https://docs.example.com)
435
+
436
+ ## Contributing
437
+
438
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) before submitting a PR.
439
+
440
+ ## License
441
+
442
+ ${license} - see the [LICENSE](LICENSE) file for details.
443
+
444
+ ---
445
+
446
+ Built with [Bootspring](https://bootspring.com)
447
+ `;
448
+ }
449
+
450
+ /**
451
+ * Generate changelog entry template
452
+ */
453
+ function generateChangelog(options = {}) {
454
+ const {
455
+ version = '1.0.0',
456
+ date = new Date().toISOString().split('T')[0],
457
+ added = [],
458
+ changed = [],
459
+ deprecated = [],
460
+ removed = [],
461
+ fixed = [],
462
+ security = []
463
+ } = options;
464
+
465
+ const sections = [];
466
+
467
+ sections.push(`## [${version}] - ${date}`);
468
+ sections.push('');
469
+
470
+ if (added.length > 0) {
471
+ sections.push('### Added');
472
+ added.forEach(item => sections.push(`- ${item}`));
473
+ sections.push('');
474
+ }
475
+
476
+ if (changed.length > 0) {
477
+ sections.push('### Changed');
478
+ changed.forEach(item => sections.push(`- ${item}`));
479
+ sections.push('');
480
+ }
481
+
482
+ if (deprecated.length > 0) {
483
+ sections.push('### Deprecated');
484
+ deprecated.forEach(item => sections.push(`- ${item}`));
485
+ sections.push('');
486
+ }
487
+
488
+ if (removed.length > 0) {
489
+ sections.push('### Removed');
490
+ removed.forEach(item => sections.push(`- ${item}`));
491
+ sections.push('');
492
+ }
493
+
494
+ if (fixed.length > 0) {
495
+ sections.push('### Fixed');
496
+ fixed.forEach(item => sections.push(`- ${item}`));
497
+ sections.push('');
498
+ }
499
+
500
+ if (security.length > 0) {
501
+ sections.push('### Security');
502
+ security.forEach(item => sections.push(`- ${item}`));
503
+ sections.push('');
504
+ }
505
+
506
+ return sections.join('\n');
507
+ }
508
+
509
+ /**
510
+ * Generate API documentation template
511
+ */
512
+ function generateApiDoc(options = {}) {
513
+ const {
514
+ endpoint = '/api/v1/resource',
515
+ method = 'GET',
516
+ title = 'Endpoint',
517
+ description = ''
518
+ } = options;
519
+
520
+ return `---
521
+ title: "${title}"
522
+ method: "${method}"
523
+ endpoint: "${endpoint}"
524
+ ---
525
+
526
+ # ${title}
527
+
528
+ ${description || 'Description of what this endpoint does.'}
529
+
530
+ ## Endpoint
531
+
532
+ \`\`\`
533
+ ${method} ${endpoint}
534
+ \`\`\`
535
+
536
+ ## Authentication
537
+
538
+ This endpoint requires authentication via Bearer token.
539
+
540
+ | Header | Required | Description |
541
+ |--------|----------|-------------|
542
+ | \`Authorization\` | Yes | Bearer {token} |
543
+ | \`Content-Type\` | Yes | application/json |
544
+
545
+ ## Request
546
+
547
+ ### Parameters
548
+
549
+ | Parameter | Type | Required | Description |
550
+ |-----------|------|----------|-------------|
551
+ | \`param1\` | string | Yes | Description |
552
+ | \`param2\` | number | No | Description |
553
+
554
+ ### Request Body
555
+
556
+ \`\`\`json
557
+ {
558
+ "field1": "value",
559
+ "field2": 123,
560
+ "nested": {
561
+ "property": "value"
562
+ }
563
+ }
564
+ \`\`\`
565
+
566
+ ## Response
567
+
568
+ ### Success Response
569
+
570
+ **Code:** 200 OK
571
+
572
+ \`\`\`json
573
+ {
574
+ "success": true,
575
+ "data": {
576
+ "id": "abc123",
577
+ "createdAt": "2024-01-01T00:00:00Z"
578
+ }
579
+ }
580
+ \`\`\`
581
+
582
+ ### Error Responses
583
+
584
+ | Status | Code | Description |
585
+ |--------|------|-------------|
586
+ | 400 | \`INVALID_INPUT\` | Request validation failed |
587
+ | 401 | \`UNAUTHORIZED\` | Missing or invalid token |
588
+ | 403 | \`FORBIDDEN\` | Insufficient permissions |
589
+ | 404 | \`NOT_FOUND\` | Resource not found |
590
+ | 500 | \`INTERNAL_ERROR\` | Server error |
591
+
592
+ ## Examples
593
+
594
+ ### cURL
595
+
596
+ \`\`\`bash
597
+ curl -X ${method} "${endpoint}" \\
598
+ -H "Authorization: Bearer $TOKEN" \\
599
+ -H "Content-Type: application/json" \\
600
+ -d '{"field1": "value"}'
601
+ \`\`\`
602
+
603
+ ### JavaScript
604
+
605
+ \`\`\`typescript
606
+ const response = await fetch('${endpoint}', {
607
+ method: '${method}',
608
+ headers: {
609
+ 'Authorization': \`Bearer \${token}\`,
610
+ 'Content-Type': 'application/json'
611
+ },
612
+ body: JSON.stringify({
613
+ field1: 'value'
614
+ })
615
+ });
616
+
617
+ const data = await response.json();
618
+ \`\`\`
619
+
620
+ ## Rate Limiting
621
+
622
+ | Limit | Window | Scope |
623
+ |-------|--------|-------|
624
+ | 100 | 1 minute | Per API key |
625
+ | 1000 | 1 hour | Per API key |
626
+
627
+ ## Changelog
628
+
629
+ | Version | Date | Changes |
630
+ |---------|------|---------|
631
+ | v1 | 2024-01-01 | Initial release |
632
+ `;
633
+ }
634
+
635
+ /**
636
+ * Generate tutorial template
637
+ */
638
+ function generateTutorial(options = {}) {
639
+ const {
640
+ title = 'Tutorial',
641
+ description = '',
642
+ difficulty = 'beginner',
643
+ duration = '15 minutes'
644
+ } = options;
645
+
646
+ return `---
647
+ title: "${title}"
648
+ description: "${description}"
649
+ difficulty: "${difficulty}"
650
+ duration: "${duration}"
651
+ ---
652
+
653
+ # ${title}
654
+
655
+ ${description || 'Learn how to accomplish a specific task.'}
656
+
657
+ <Callout type="info">
658
+ **Difficulty:** ${difficulty.charAt(0).toUpperCase() + difficulty.slice(1)} | **Duration:** ${duration}
659
+ </Callout>
660
+
661
+ ## What You'll Build
662
+
663
+ [Screenshot or diagram of the end result]
664
+
665
+ ## Prerequisites
666
+
667
+ Before starting this tutorial, you should have:
668
+
669
+ - [ ] Node.js 18+ installed
670
+ - [ ] Basic understanding of X
671
+ - [ ] Y configured
672
+
673
+ ## Step 1: Project Setup
674
+
675
+ First, let's set up the project.
676
+
677
+ \`\`\`bash
678
+ # Create a new project
679
+ npx create-next-app@latest my-project
680
+ cd my-project
681
+ \`\`\`
682
+
683
+ ## Step 2: Install Dependencies
684
+
685
+ \`\`\`bash
686
+ npm install package-name
687
+ \`\`\`
688
+
689
+ ## Step 3: Configuration
690
+
691
+ Create a configuration file:
692
+
693
+ \`\`\`typescript
694
+ // config.ts
695
+ export const config = {
696
+ // Configuration here
697
+ };
698
+ \`\`\`
699
+
700
+ ## Step 4: Implementation
701
+
702
+ Now let's implement the main functionality:
703
+
704
+ \`\`\`typescript
705
+ // Main implementation
706
+ export function feature() {
707
+ // Code here
708
+ }
709
+ \`\`\`
710
+
711
+ ## Step 5: Testing
712
+
713
+ Verify everything works:
714
+
715
+ \`\`\`bash
716
+ npm run dev
717
+ \`\`\`
718
+
719
+ Then open http://localhost:3000 and you should see:
720
+
721
+ [Expected result]
722
+
723
+ ## Troubleshooting
724
+
725
+ ### Issue 1
726
+
727
+ **Problem:** Description of common issue.
728
+
729
+ **Solution:** How to fix it.
730
+
731
+ ### Issue 2
732
+
733
+ **Problem:** Another common issue.
734
+
735
+ **Solution:** The fix.
736
+
737
+ ## Next Steps
738
+
739
+ Now that you've completed this tutorial:
740
+
741
+ 1. Try modifying the code to X
742
+ 2. Explore the Y feature
743
+ 3. Check out the [advanced tutorial](/docs/tutorials/advanced)
744
+
745
+ ## Summary
746
+
747
+ In this tutorial, you learned how to:
748
+
749
+ - Set up the project
750
+ - Configure the dependencies
751
+ - Implement the feature
752
+ - Test your work
753
+
754
+ ## Resources
755
+
756
+ - [Official Documentation](/docs)
757
+ - [API Reference](/docs/api)
758
+ - [GitHub Repository](https://github.com/bootspring/bootspring)
759
+
760
+ ---
761
+
762
+ <Callout type="success">
763
+ Completed this tutorial? Share your results on [Twitter](https://twitter.com/bootspring)!
764
+ </Callout>
765
+ `;
766
+ }
767
+
768
+ /**
769
+ * Generate content based on type
770
+ */
771
+ function generate(type, options = {}) {
772
+ switch (type) {
773
+ case 'blog-post':
774
+ return generateBlogPost(options);
775
+ case 'release-notes':
776
+ return generateReleaseNotes(options);
777
+ case 'documentation':
778
+ return generateDocumentation(options);
779
+ case 'readme':
780
+ return generateReadme(options);
781
+ case 'changelog':
782
+ return generateChangelog(options);
783
+ case 'api-doc':
784
+ return generateApiDoc(options);
785
+ case 'tutorial':
786
+ return generateTutorial(options);
787
+ default:
788
+ throw new Error(`Unknown content type: ${type}`);
789
+ }
790
+ }
791
+
792
+ /**
793
+ * Get content type metadata
794
+ */
795
+ function getContentType(type) {
796
+ return CONTENT_TYPES[type] || null;
797
+ }
798
+
799
+ /**
800
+ * List all content types
801
+ */
802
+ function listContentTypes() {
803
+ return CONTENT_TYPES;
804
+ }
805
+
806
+ module.exports = {
807
+ generate,
808
+ getContentType,
809
+ listContentTypes,
810
+ CONTENT_TYPES,
811
+ // Individual generators for direct use
812
+ generateBlogPost,
813
+ generateReleaseNotes,
814
+ generateDocumentation,
815
+ generateReadme,
816
+ generateChangelog,
817
+ generateApiDoc,
818
+ generateTutorial
819
+ };