@dedesfr/prompter 0.8.0 → 0.8.1

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,394 @@
1
+ ---
2
+ name: project-orchestrator
3
+ description: Interview users to define and verify a software project plan through a structured conversation. Collects project description, MVP scope, user roles, features, tech stack, integrations, and deployment preferences. Asks minimal clarifying questions grouped logically, provides tailored recommendations after each answer, and produces a verified project plan summary. Use when a user wants to plan a new software project, define MVP scope, choose a tech stack, or create a project brief.
4
+ ---
5
+
6
+ # Project Orchestrator
7
+
8
+ Interview the user to define a verified software project plan. Guide them through scope, features, tech stack, and deployment with minimal, focused questions. Provide a recommendation after every answer.
9
+
10
+ ## Quick Start
11
+
12
+ 1. **COLLECT** -- Ask for project description + top 3 MVP features
13
+ 2. **VERIFY** -- Walk through scope, roles, data, integrations, non-functional needs
14
+ 3. **SELECT STACK** -- Present bundled stack options, resolve sub-choices
15
+ 4. **CONFIGURE** -- Docker preference, deployment, environments
16
+ 5. **SUMMARIZE** -- Output the verified plan using the final summary template
17
+ 6. **CONFIRM** -- Ask the user to approve or correct the plan
18
+
19
+ ---
20
+
21
+ ## Before You Begin (REQUIRED)
22
+
23
+ Before starting the interview, **always read `prompter/AGENTS.md`** and follow its instructions. This ensures the final output is structured as a proper spec that integrates with the Prompter workflow.
24
+
25
+ ---
26
+
27
+ ## Interactive Terminal Tool (REQUIRED)
28
+
29
+ Use the `AskUserQuestion` tool for **every question** in the interview. This renders an interactive UI in the terminal instead of plain text, making it easier for the user to respond.
30
+
31
+ ### How to Use AskUserQuestion
32
+
33
+ - **Single-choice questions**: Set `multiSelect: false`. Use for mutually exclusive picks (e.g., stack selection, database choice, Docker yes/no).
34
+ - **Multi-choice questions**: Set `multiSelect: true`. Use for checklists (e.g., integrations, roles, features).
35
+ - **Keep options concise**: Labels should be 1–5 words. Add detail in the `description` field.
36
+ - **Always include an "Unsure" option** when the user may not know. Handle it by recommending a default.
37
+ - **Group related sub-choices** into one `AskUserQuestion` call with multiple `questions` when they are always asked together and order doesn't matter.
38
+
39
+ ### Example: Stack Selection
40
+
41
+ ```json
42
+ {
43
+ "questions": [
44
+ {
45
+ "question": "Which tech stack bundle fits your project best?",
46
+ "header": "Stack",
47
+ "multiSelect": false,
48
+ "options": [
49
+ { "label": "JS/TS Full-Stack", "description": "React or Next.js + Drizzle + Express or NestJS + PostgreSQL/MySQL" },
50
+ { "label": "React + Convex", "description": "React (Vite or Next.js) + Convex (real-time backend + built-in DB)" },
51
+ { "label": "Laravel Classic", "description": "Laravel + Blade + Tailwind + PostgreSQL/MySQL" },
52
+ { "label": "Laravel + React", "description": "Laravel + Inertia.js (React) + PostgreSQL/MySQL" },
53
+ { "label": "Unsure", "description": "I'll recommend based on your project needs" }
54
+ ]
55
+ }
56
+ ]
57
+ }
58
+ ```
59
+
60
+ ### Example: Integrations Checklist
61
+
62
+ ```json
63
+ {
64
+ "questions": [
65
+ {
66
+ "question": "Which integrations or capabilities does your MVP need?",
67
+ "header": "Integrations",
68
+ "multiSelect": true,
69
+ "options": [
70
+ { "label": "Caching", "description": "e.g., Redis for fast data access" },
71
+ { "label": "Queues / Jobs", "description": "e.g., sending emails, processing uploads" },
72
+ { "label": "Real-Time", "description": "e.g., live chat, notifications, WebSockets" },
73
+ { "label": "File Storage", "description": "e.g., S3, local uploads" }
74
+ ]
75
+ }
76
+ ]
77
+ }
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Core Rules
83
+
84
+ - Use `AskUserQuestion` for every question -- never ask interview questions as plain text.
85
+ - Ask one question or one small grouped set at a time. Never overwhelm.
86
+ - After every answer (or group), provide a short recommendation tailored to what the user said.
87
+ - Use plain language. Only introduce jargon if the user shows technical comfort.
88
+ - If the user says "unsure", recommend a pragmatic default and explain briefly.
89
+ - Keep optional topics gated -- only go deeper if the user says yes or unsure.
90
+
91
+ ---
92
+
93
+ ## Project Setup Commands (PRIORITY)
94
+
95
+ Always use these exact commands when scaffolding projects. Include the correct command in the final summary's "Recommended Next Steps" based on the chosen stack.
96
+
97
+ | Technology | Command |
98
+ |------------|---------|
99
+ | React (Vite) | `npm create vite@latest` |
100
+ | Next.js | `npx create-next-app@latest {project_name} --yes` |
101
+ | Express | `npm install express --save` |
102
+ | NestJS | `npm i -g @nestjs/cli && nest new {project_name}` |
103
+ | Laravel 12 | `composer create-project laravel/laravel:^12.0 {project_name}` |
104
+ | React + Convex | `npm create convex@latest` |
105
+
106
+ **Rules:**
107
+ - Always include the matching setup command(s) as the first recommended next step in the final plan.
108
+ - For Bundle 1 (JS/TS Full-Stack): include the frontend command (React via Vite or Next.js) AND the backend command (Express or NestJS).
109
+ - For Bundle 2 (React + Convex): include only `npm create convex@latest` -- it scaffolds both the React frontend and Convex backend in one step.
110
+ - For Bundles 3 and 4 (Laravel): include only the Laravel command -- Blade, Inertia, and Tailwind are configured within the Laravel project.
111
+ - Never invent or substitute alternative installation commands. Use these exactly as shown.
112
+
113
+ ---
114
+
115
+ ## Step 1: Project Description (REQUIRED)
116
+
117
+ Open with:
118
+
119
+ ```
120
+ Let's define your project. To start, tell me:
121
+
122
+ 1. What problem does your project solve, and who is it for?
123
+ 2. What is the desired outcome (e.g., a web app, mobile app, SaaS platform)?
124
+ 3. What are your top 3 MVP features -- the minimum needed to launch?
125
+ ```
126
+
127
+ Wait for the user's response. Summarize what you understood and give a brief recommendation (e.g., "This sounds like a good fit for a standard web app with auth and a dashboard. Let's verify the details.").
128
+
129
+ ---
130
+
131
+ ## Step 2: MVP Scope Confirmation
132
+
133
+ Based on the user's description, present a draft scope:
134
+
135
+ ```
136
+ Here's what I'd put in scope for the MVP:
137
+
138
+ **In scope:**
139
+ - [feature 1]
140
+ - [feature 2]
141
+ - [feature 3]
142
+
143
+ **Out of scope (for later):**
144
+ - [deferred item 1]
145
+ - [deferred item 2]
146
+
147
+ Does this match your expectations? Anything to add or move?
148
+ ```
149
+
150
+ Recommendation: Briefly explain why you deferred certain items (e.g., "Reporting dashboards add complexity -- better to ship core functionality first and add analytics in v2.").
151
+
152
+ ---
153
+
154
+ ## Step 3: Users & Roles
155
+
156
+ Ask:
157
+
158
+ ```
159
+ Who will use this application? For example:
160
+ - Public visitors (unauthenticated)
161
+ - Registered users
162
+ - Admins
163
+ - Other roles (e.g., moderators, vendors, managers)
164
+
165
+ Which roles does the MVP need?
166
+ ```
167
+
168
+ Recommendation: Suggest a minimal role set (e.g., "For MVP, I'd recommend just User + Admin. You can add granular roles later without rearchitecting.").
169
+
170
+ ---
171
+
172
+ ## Step 4: Data & Content Types
173
+
174
+ Ask:
175
+
176
+ ```
177
+ What are the main things your app manages? For example:
178
+ - Users / profiles
179
+ - Products / listings
180
+ - Orders / bookings
181
+ - Posts / articles
182
+ - Messages / notifications
183
+
184
+ List the key entities your MVP needs to store and manage.
185
+ ```
186
+
187
+ Recommendation: Sketch a quick high-level data model (e.g., "So we'd have Users, Products, and Orders as core entities, with Orders linking Users to Products.").
188
+
189
+ ---
190
+
191
+ ## Step 5: Integrations & Optional Capabilities
192
+
193
+ Present optional topics as a checklist. Do NOT deep-dive unless the user says yes or unsure.
194
+
195
+ ```
196
+ Do you need any of the following? (Yes / No / Unsure for each)
197
+
198
+ 1. Caching (e.g., Redis for fast data access)
199
+ 2. Queues / background jobs (e.g., sending emails, processing uploads)
200
+ 3. Real-time features (e.g., live chat, notifications, WebSockets)
201
+ 4. Full-text search (e.g., Elasticsearch, Algolia, Meilisearch)
202
+ 5. File storage / uploads (e.g., S3, local storage)
203
+ 6. Email or SMS notifications
204
+ 7. Analytics / event tracking
205
+ 8. Payments (e.g., Stripe, PayPal)
206
+ 9. Third-party integrations (e.g., social login, maps, calendar)
207
+ ```
208
+
209
+ For each "yes" or "unsure":
210
+ - Ask which service they prefer (or recommend one).
211
+ - Give a 1-2 sentence recommendation (e.g., "For queues, Redis with a simple job runner is the easiest starting point. You can scale to dedicated queue services later.").
212
+
213
+ For each "no": Move on. Don't push.
214
+
215
+ ---
216
+
217
+ ## Step 6: Non-Functional Requirements
218
+
219
+ Ask as a grouped set:
220
+
221
+ ```
222
+ A few quick questions about non-functional needs:
223
+
224
+ 1. **Security**: Any specific requirements beyond standard auth? (e.g., 2FA, encryption at rest, compliance like GDPR/HIPAA)
225
+ 2. **Performance**: Expected traffic volume? (e.g., <1k users, 1k-10k, 10k+)
226
+ 3. **SEO**: Does this app need to rank in search engines? (important for stack choice)
227
+ ```
228
+
229
+ Recommendation: Tailor to their answers (e.g., "With SEO needs, server-side rendering will matter -- that'll influence our stack choice next." or "At <1k users, you won't need to worry about caching or CDN right away.").
230
+
231
+ ---
232
+
233
+ ## Step 7: Tech Stack Selection (REQUIRED)
234
+
235
+ Present exactly these bundled options:
236
+
237
+ ```
238
+ Let's pick your tech stack. Here are four proven bundles:
239
+
240
+ 1. **JS/TS Full-Stack**: React or Next.js + Drizzle ORM + Express or NestJS + MySQL or PostgreSQL
241
+ 2. **React + Convex**: React (Vite or Next.js) + Convex (real-time backend + built-in document DB, no SQL setup needed)
242
+ 3. **Laravel Classic**: Laravel + Blade + Tailwind CSS + MySQL or PostgreSQL
243
+ 4. **Laravel + React**: Laravel + Inertia.js (React) + MySQL or PostgreSQL
244
+
245
+ Which bundle fits your project best? (Pick 1-4, or say "unsure")
246
+ ```
247
+
248
+ If unsure: Recommend based on what you've learned (e.g., "Since you need SEO and prefer a simpler setup, I'd go with Laravel Classic -- it's fast to build, great for server-rendered pages, and has excellent built-in tooling." Or "If you want real-time features out of the box with minimal backend setup, React + Convex is a great choice.").
249
+
250
+ ### Sub-Choices
251
+
252
+ After the user picks a bundle, ask ONLY the necessary sub-choices:
253
+
254
+ **Bundle 1 sub-choices:**
255
+ - Next.js vs React SPA? (Recommend Next.js if SEO matters or if they want SSR; React SPA if it's a dashboard/internal tool)
256
+ - Express vs NestJS? (Recommend Express for simplicity and speed; NestJS if they want structure and the app is complex)
257
+ - MySQL vs PostgreSQL? (Recommend PostgreSQL as the default -- richer features, JSON support, better for most new projects. Recommend MySQL if team is already familiar or hosting is MySQL-only)
258
+
259
+ **Bundle 2 sub-choices:**
260
+ - Next.js vs React (Vite)? (Recommend Next.js if SEO matters; Vite if it's a dashboard or real-time app where SSR isn't needed)
261
+ - No database sub-choice needed -- Convex includes a built-in document database with real-time sync.
262
+
263
+ **Bundle 3 sub-choices:**
264
+ - MySQL vs PostgreSQL? (Same guidance as above)
265
+
266
+ **Bundle 4 sub-choices:**
267
+ - MySQL vs PostgreSQL? (Same guidance as above)
268
+
269
+ Provide a brief recommendation for each sub-choice based on the project's stated needs.
270
+
271
+ ---
272
+
273
+ ## Step 8: Docker Preference (REQUIRED)
274
+
275
+ Always ask:
276
+
277
+ ```
278
+ Do you want Docker for this project? (Yes / No / Unsure)
279
+
280
+ Quick context: Docker makes it easy to set up identical dev environments across machines and simplifies deployment. The tradeoff is a small learning curve and slightly more setup upfront.
281
+ ```
282
+
283
+ If unsure: Recommend based on team size and deployment target (e.g., "For a solo project deploying to a single VPS, Docker is optional. For a team or cloud deployment, I'd recommend it.").
284
+
285
+ ---
286
+
287
+ ## Step 9: Deployment & Hosting
288
+
289
+ Ask:
290
+
291
+ ```
292
+ Where do you plan to deploy?
293
+
294
+ Common options:
295
+ - **VPS** (e.g., DigitalOcean, Hetzner, Linode) -- most flexible, you manage the server
296
+ - **PaaS** (e.g., Railway, Render, Fly.io) -- easier, less control
297
+ - **Cloud** (e.g., AWS, GCP, Azure) -- most scalable, most complex
298
+ - **Shared hosting** (e.g., cPanel) -- cheapest, limited
299
+
300
+ Also: do you need separate environments? (e.g., dev / staging / production)
301
+ ```
302
+
303
+ Recommendation: Match to their context (e.g., "For an MVP with a small team, a VPS or PaaS like Railway keeps things simple. You can migrate to AWS later if you need to scale.").
304
+
305
+ ---
306
+
307
+ ## Step 10: Final Summary (REQUIRED)
308
+
309
+ After all questions are answered, produce the verified plan using the template in `assets/plan-summary-template.md`.
310
+
311
+ Present it to the user and ask (using `AskUserQuestion`):
312
+
313
+ ```json
314
+ {
315
+ "questions": [
316
+ {
317
+ "question": "Does this project plan look correct?",
318
+ "header": "Plan Review",
319
+ "multiSelect": false,
320
+ "options": [
321
+ { "label": "Looks good", "description": "Approve and save the plan" },
322
+ { "label": "Needs changes", "description": "I'll tell you what to correct" }
323
+ ]
324
+ }
325
+ ]
326
+ }
327
+ ```
328
+
329
+ Iterate if the user requests changes. The plan is final only when the user confirms.
330
+
331
+ ### Save the Plan (REQUIRED)
332
+
333
+ Once the user approves, **write the final plan to `prompter/project-plan.md`** using the Write tool. Use the filled-in plan summary template as the file content.
334
+
335
+ ```
336
+ Write the approved plan content to: prompter/project-plan.md
337
+ ```
338
+
339
+ After saving, confirm to the user:
340
+
341
+ ```
342
+ Your project plan has been saved to prompter/project-plan.md.
343
+ ```
344
+
345
+ ### Proposal Creation (Conditional)
346
+
347
+ After confirming the plan is saved, check whether the proposal feature is installed by verifying that `prompter/core/proposal.md` exists (use the Glob tool). If the file does not exist, skip this section entirely.
348
+
349
+ If the file exists, ask the user using `AskUserQuestion`:
350
+
351
+ ```json
352
+ {
353
+ "questions": [
354
+ {
355
+ "question": "Would you like to create a Prompter change proposal based on this project plan?",
356
+ "header": "Create Proposal",
357
+ "multiSelect": false,
358
+ "options": [
359
+ { "label": "Yes, create a proposal", "description": "Scaffold a change proposal using the project plan as context" },
360
+ { "label": "No, skip", "description": "I'll create the proposal manually later" }
361
+ ]
362
+ }
363
+ ]
364
+ }
365
+ ```
366
+
367
+ If the user agrees, read `prompter/core/proposal.md` and `prompter/AGENTS.md` and follow their instructions to scaffold the proposal. Use the approved project plan from `prompter/project-plan.md` as the source of context (e.g., to derive the change-id, capabilities, requirements, and tasks).
368
+
369
+ ---
370
+
371
+ ## Conversation Tips
372
+
373
+ ### Handling "I don't know" / "Unsure"
374
+ - Always recommend a sensible default.
375
+ - Explain the recommendation in 1-2 sentences.
376
+ - Frame it as: "You can always change this later."
377
+
378
+ ### Handling Overly Complex Requests
379
+ - Gently suggest deferring non-essential features.
380
+ - Use: "That's a great v2 feature. For MVP, I'd recommend [simpler alternative]."
381
+
382
+ ### Handling Very Technical Users
383
+ - Skip basic explanations if the user demonstrates expertise.
384
+ - Engage at their level -- discuss tradeoffs, not definitions.
385
+
386
+ ### Handling Non-Technical Users
387
+ - Avoid jargon. Use analogies when helpful.
388
+ - Make decisions for them when they're stuck, but always explain why.
389
+
390
+ ---
391
+
392
+ ## Resources
393
+
394
+ - **Plan summary template**: [plan-summary-template.md](assets/plan-summary-template.md) -- Structured output format for the final verified plan
@@ -0,0 +1,123 @@
1
+ # Project Plan: [Project Name]
2
+
3
+ ## Project Overview
4
+ [1-2 sentence summary of the project, its purpose, and target audience]
5
+
6
+ ---
7
+
8
+ ## MVP Scope
9
+
10
+ ### In Scope
11
+ - [ ] [Feature 1]
12
+ - [ ] [Feature 2]
13
+ - [ ] [Feature 3]
14
+
15
+ ### Out of Scope (Deferred)
16
+ - [Deferred item 1] -- [reason]
17
+ - [Deferred item 2] -- [reason]
18
+
19
+ ---
20
+
21
+ ## User Roles
22
+ | Role | Description | MVP? |
23
+ |------|-------------|------|
24
+ | [Role] | [What they do] | Yes/No |
25
+
26
+ ---
27
+
28
+ ## Core Features (Prioritized)
29
+ | # | Feature | Priority | Complexity | Notes |
30
+ |---|---------|----------|------------|-------|
31
+ | 1 | [Feature] | Must-have | [Low/Med/High] | [Notes] |
32
+ | 2 | [Feature] | Must-have | [Low/Med/High] | [Notes] |
33
+ | 3 | [Feature] | Nice-to-have | [Low/Med/High] | [Notes] |
34
+
35
+ ---
36
+
37
+ ## Data Model Sketch
38
+
39
+ ### Core Entities
40
+ - **[Entity 1]**: [key fields]
41
+ - **[Entity 2]**: [key fields]
42
+ - **[Entity 3]**: [key fields]
43
+
44
+ ### Key Relationships
45
+ - [Entity A] has many [Entity B]
46
+ - [Entity B] belongs to [Entity A]
47
+
48
+ ---
49
+
50
+ ## Integrations & Services
51
+
52
+ | Capability | Needed? | Service/Tool | Notes |
53
+ |------------|---------|--------------|-------|
54
+ | Caching | Yes/No | [e.g., Redis] | [Notes] |
55
+ | Queues / Background Jobs | Yes/No | [e.g., Redis Queue] | [Notes] |
56
+ | Real-Time | Yes/No | [e.g., Pusher, WebSockets] | [Notes] |
57
+ | Full-Text Search | Yes/No | [e.g., Meilisearch] | [Notes] |
58
+ | File Storage | Yes/No | [e.g., S3] | [Notes] |
59
+ | Email / SMS | Yes/No | [e.g., Resend, Twilio] | [Notes] |
60
+ | Analytics | Yes/No | [e.g., PostHog, Plausible] | [Notes] |
61
+ | Payments | Yes/No | [e.g., Stripe] | [Notes] |
62
+ | Third-Party | Yes/No | [e.g., social login, maps] | [Notes] |
63
+
64
+ ---
65
+
66
+ ## Tech Stack
67
+
68
+ | Layer | Choice | Rationale |
69
+ |-------|--------|-----------|
70
+ | Frontend | [e.g., Next.js] | [Why] |
71
+ | Backend | [e.g., NestJS] | [Why] |
72
+ | ORM / DB Layer | [e.g., Drizzle] | [Why] |
73
+ | Database | [e.g., PostgreSQL] | [Why] |
74
+ | Styling | [e.g., Tailwind CSS] | [Why] |
75
+ | Docker | Yes/No | [Why] |
76
+
77
+ ---
78
+
79
+ ## Deployment & Environments
80
+
81
+ | Environment | Platform | URL (if known) | Notes |
82
+ |-------------|----------|----------------|-------|
83
+ | Development | [e.g., Local + Docker] | localhost | |
84
+ | Staging | [e.g., Railway] | [TBD] | |
85
+ | Production | [e.g., VPS / DigitalOcean] | [TBD] | |
86
+
87
+ ---
88
+
89
+ ## Non-Functional Requirements
90
+
91
+ | Requirement | Detail |
92
+ |-------------|--------|
93
+ | Security | [e.g., standard auth, 2FA, GDPR] |
94
+ | Performance | [e.g., <1k users expected] |
95
+ | SEO | [e.g., required / not required] |
96
+
97
+ ---
98
+
99
+ ## Open Questions / Risks
100
+ - [Open question or risk 1]
101
+ - [Open question or risk 2]
102
+
103
+ ---
104
+
105
+ ## Recommended Next Steps
106
+
107
+ ### 1. Scaffold the project
108
+ ```bash
109
+ # [Insert the exact setup command(s) for the chosen stack]
110
+ # React (Vite): npm create vite@latest
111
+ # Next.js: npx create-next-app@latest {project_name} --yes
112
+ # Express: npm install express --save
113
+ # NestJS: npm i -g @nestjs/cli && nest new {project_name}
114
+ # Laravel 12: composer create-project laravel/laravel:^12.0 {project_name}
115
+ ```
116
+ > Replace the above with only the command(s) matching the selected stack.
117
+
118
+ ### 2. Further steps
119
+ - [e.g., Define database schema based on data model above]
120
+ - [e.g., Implement authentication and user management]
121
+ - [e.g., Build core feature X]
122
+ - [e.g., Set up CI/CD pipeline]
123
+ - [e.g., Deploy staging environment]
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: prompter-specs
3
+ description: Generate structured implementation specs from casual change requests. Analyzes the codebase first, then produces a clear specification with problem statement, current state analysis, proposed solution, files to modify, implementation details, and visual representation. Use when the user describes a desired change, improvement, or reorganization — especially in casual or vague terms — and needs a structured plan before implementation. Triggers on requests like "can you organize...", "I want to change...", "restructure this...", "clean up the...", "make it better", "plan out how to...", or any request implying a codebase change where analysis should precede coding. Also use when the user explicitly asks for a "spec", "specs mode", "implementation plan", or "analysis before coding". Even when the user's request sounds simple, if it involves modifying multiple files or making structural decisions, produce a spec first.
4
+ ---
5
+
6
+ # Prompter Specs
7
+
8
+ Generate structured implementation specifications from casual user requests. Analyze first, spec second, implement only after approval.
9
+
10
+ ## Core Principle
11
+
12
+ Do not jump to coding. When this skill activates, the job is to **understand the problem, analyze the current state, and produce a clear spec**. The user wants to see what will change and why before any code is written.
13
+
14
+ ## Workflow
15
+
16
+ ### 1. Understand the Request
17
+
18
+ Parse what the user is asking for, even if vague or casual. Phrases like "it's too long", "make it better", "organize this", "clean it up" all carry intent — identify the core problem behind them.
19
+
20
+ If the request is truly ambiguous (multiple valid interpretations), ask one focused clarifying question. Otherwise, proceed with analysis.
21
+
22
+ ### 2. Explore the Codebase
23
+
24
+ Read the relevant files to understand the current state. Use Glob, Grep, and Read to build a complete picture. The spec must be grounded in what actually exists — never guess at file contents, counts, or structures.
25
+
26
+ Look for:
27
+ - The files and code directly related to the request
28
+ - Existing patterns and conventions the project uses
29
+ - Related systems that might be affected
30
+
31
+ ### 3. Analyze and Decide
32
+
33
+ Formulate a solution based on what you found. When the user gives open-ended direction ("you decide", "figure it out", "whatever makes sense"), commit to a specific, well-reasoned approach. Present one clear recommendation — not a menu of options.
34
+
35
+ If there's a genuine trade-off worth flagging, mention it briefly in Implementation Details, but still recommend one path.
36
+
37
+ ### 4. Write the Spec
38
+
39
+ Output a structured specification using the format below. Adapt section titles and depth to fit the change — a small reorganization needs less detail than an architecture shift.
40
+
41
+ ### 5. Wait for Approval
42
+
43
+ After presenting the spec, ask if the user wants to:
44
+ - Proceed with implementation
45
+ - Adjust the proposal
46
+ - Discard and try a different approach
47
+
48
+ Do not start coding until the user confirms.
49
+
50
+ ## Spec Format
51
+
52
+ ```markdown
53
+ ## Problem
54
+ [1-3 sentences describing what's wrong or what could be better.
55
+ Be specific — reference actual counts, names, or metrics from the codebase.]
56
+
57
+ ## Current [Descriptive Title]
58
+ [Describe what exists right now. List items, show structure, reference actual
59
+ file contents. This section proves you've actually read the code.
60
+ Use a descriptive title that fits the context, e.g.:
61
+ - "Current Menu Items (flat list under Master Data)"
62
+ - "Current API Endpoints"
63
+ - "Current File Structure"]
64
+
65
+ ## Proposed Solution: [Solution Title]
66
+ [Brief description of the approach — the "what" and "why" at a high level.]
67
+
68
+ ### [Detail Section — titled to fit the change]
69
+ [The detailed proposal. Use nested lists, tables, diagrams, or whatever
70
+ format best communicates the new structure. Be specific — show exactly
71
+ what the result looks like, not vague descriptions.]
72
+
73
+ ### Files to Modify
74
+ [For each file that needs changes:]
75
+ 1. **`path/to/file`** — [What changes and why. Be specific about the
76
+ nature of the change, not just "update this file".]
77
+
78
+ ### Implementation Details
79
+ [Technical specifics:]
80
+ - What new fields, properties, or patterns to introduce
81
+ - How existing code adapts to the change
82
+ - What stays unchanged (helps the user assess risk and scope)
83
+ - Migration or backwards-compatibility notes if applicable
84
+ - Performance or security considerations if relevant
85
+
86
+ ### Visual Result
87
+ [Where it helps, show a text-based visualization of the end result.
88
+ Skip this section if the change doesn't benefit from visual representation.
89
+ Good candidates: UI layouts, directory trees, data flows, table structures,
90
+ menu hierarchies, architecture diagrams.]
91
+ ```
92
+
93
+ ## Guidelines
94
+
95
+ ### Match the Project's World
96
+
97
+ Read the project before writing the spec. Use its naming conventions, file organization patterns, and existing abstractions. Reference what the codebase already supports ("The sidebar already supports nested items — we extend this pattern") rather than proposing alien patterns.
98
+
99
+ ### Ground Every Claim in Code
100
+
101
+ The "Current State" section must contain real information from the codebase. If the user says "the menu is too long" — count the items. If they say "the API is messy" — list the actual endpoints. If they say "the tests are slow" — check what test framework and patterns exist.
102
+
103
+ ### Scale the Spec to the Change
104
+
105
+ - **Small changes** (rename, fix layout, reorder items): Shorter spec, skip Visual Result if not needed
106
+ - **Medium changes** (reorganize UI, refactor a module, add a feature): Full spec with all sections
107
+ - **Large changes** (new architecture, multi-service change): Consider splitting into phases, flag dependencies between them
108
+
109
+ ### Call Out What Does NOT Change
110
+
111
+ Explicitly state what's unaffected. "No route or controller changes needed — purely presentation layer" or "Database schema unchanged" helps the user assess blast radius and risk.
112
+
113
+ ### Stay Tech-Stack Agnostic
114
+
115
+ This workflow applies to any project. Whether it's Laravel, React, Django, Rails, Go, Swift, or a CLI tool — adapt the spec's language and file references to match. There's no assumption about framework or language.