@dedesfr/prompter 0.8.5 → 0.8.8

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 (35) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/convex-setup.md +403 -0
  3. package/dist/cli/index.js +1 -1
  4. package/package.json +1 -1
  5. package/skills/design-md/README.md +34 -0
  6. package/skills/design-md/SKILL.md +172 -0
  7. package/skills/design-md/examples/DESIGN.md +154 -0
  8. package/skills/enhance-prompt/README.md +34 -0
  9. package/skills/enhance-prompt/SKILL.md +204 -0
  10. package/skills/enhance-prompt/references/KEYWORDS.md +114 -0
  11. package/skills/feature-planner/SKILL.md +305 -0
  12. package/skills/feature-planner/assets/implementation-plan-template.md +85 -0
  13. package/skills/project-orchestrator/SKILL.md +34 -0
  14. package/skills/project-orchestrator/assets/plan-summary-template.md +38 -4
  15. package/skills/prompter-workflow/SKILL.md +166 -0
  16. package/skills/prompter-workflow/evals/evals.json +89 -0
  17. package/src/cli/index.ts +1 -1
  18. package/skills/skill-creator/LICENSE.txt +0 -202
  19. package/skills/skill-creator/SKILL.md +0 -485
  20. package/skills/skill-creator/agents/analyzer.md +0 -274
  21. package/skills/skill-creator/agents/comparator.md +0 -202
  22. package/skills/skill-creator/agents/grader.md +0 -223
  23. package/skills/skill-creator/assets/eval_review.html +0 -146
  24. package/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  25. package/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  26. package/skills/skill-creator/references/schemas.md +0 -430
  27. package/skills/skill-creator/scripts/__init__.py +0 -0
  28. package/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  29. package/skills/skill-creator/scripts/generate_report.py +0 -326
  30. package/skills/skill-creator/scripts/improve_description.py +0 -247
  31. package/skills/skill-creator/scripts/package_skill.py +0 -136
  32. package/skills/skill-creator/scripts/quick_validate.py +0 -103
  33. package/skills/skill-creator/scripts/run_eval.py +0 -310
  34. package/skills/skill-creator/scripts/run_loop.py +0 -328
  35. package/skills/skill-creator/scripts/utils.py +0 -47
@@ -0,0 +1,305 @@
1
+ ---
2
+ name: feature-planner
3
+ description: Plan feature development on existing projects. Interview users about what they want to build, analyze the codebase to understand tech stack, patterns, and affected areas, then produce a structured implementation plan with phased tasks. Optionally scaffolds a Prompter change proposal. Use when a user wants to add a feature, make a change, or plan development work on a project that already exists.
4
+ ---
5
+
6
+ # Feature Developer
7
+
8
+ Interview the user about what they want to build, analyze the existing codebase, then produce a phased implementation plan with concrete tasks and file references.
9
+
10
+ ## Quick Start
11
+
12
+ 1. **DESCRIBE** -- Ask what the user wants to build and why
13
+ 2. **ANALYZE** -- Scan the codebase: structure, tech stack, patterns, existing specs
14
+ 3. **SCOPE** -- Present what's in/out of scope, identify affected files
15
+ 4. **PLAN** -- Break down into phased implementation tasks
16
+ 5. **REVIEW** -- Present the plan and iterate until approved
17
+ 6. **PROPOSAL** -- Optionally create a Prompter change proposal
18
+
19
+ ---
20
+
21
+ ## Before You Begin (REQUIRED)
22
+
23
+ Before starting the interview:
24
+
25
+ 1. **Read `AGENTS.md`** at the project root (if it exists) to understand the tech stack, conventions, and architecture.
26
+ 2. **Read `prompter/project.md`** (if it exists) to understand project conventions.
27
+ 3. **Scan the project structure** using Glob to understand the directory layout and key files.
28
+
29
+ Store what you learn -- you'll reference it when identifying affected files and patterns.
30
+
31
+ ---
32
+
33
+ ## Interactive Terminal Tool (REQUIRED)
34
+
35
+ Use the `AskUserQuestion` tool for **every question** in the interview. This renders an interactive UI in the terminal.
36
+
37
+ ### How to Use AskUserQuestion
38
+
39
+ - **Single-choice questions**: Set `multiSelect: false`. Use for yes/no, pick-one decisions.
40
+ - **Multi-choice questions**: Set `multiSelect: true`. Use for checklists.
41
+ - **Free-text input**: When you need the user to describe something open-ended (like the feature itself), ask as a plain message and wait for their response. Only use `AskUserQuestion` for structured choices.
42
+ - **Keep options concise**: Labels should be 1-5 words. Add detail in the `description` field.
43
+
44
+ ---
45
+
46
+ ## Core Rules
47
+
48
+ - Use `AskUserQuestion` for every structured question -- never ask choice questions as plain text.
49
+ - Ask one question or one small grouped set at a time. Never overwhelm.
50
+ - After every answer, acknowledge what you understood before moving on.
51
+ - Ground every suggestion in what you observed in the codebase -- don't guess patterns.
52
+ - If unsure about something, look at the code before asking the user.
53
+ - Keep the interview short -- 3 to 5 questions max before producing the plan.
54
+
55
+ ---
56
+
57
+ ## Step 1: Feature Description (REQUIRED)
58
+
59
+ Open with:
60
+
61
+ ```
62
+ What feature or change do you want to build? Tell me:
63
+
64
+ 1. What it does (the user-visible behavior or system change)
65
+ 2. Why you need it (the problem it solves or value it adds)
66
+ 3. Any constraints or preferences (e.g., "must use existing auth system", "keep it simple")
67
+ ```
68
+
69
+ Wait for the user's response. Summarize what you understood in 2-3 sentences.
70
+
71
+ ---
72
+
73
+ ## Step 2: Codebase Analysis (REQUIRED)
74
+
75
+ After understanding the feature, **silently analyze the codebase**. Do NOT ask the user about the tech stack -- discover it yourself.
76
+
77
+ ### What to Analyze
78
+
79
+ 1. **Project structure** -- Use Glob to map the directory layout (e.g., `src/**`, `app/**`, `resources/**`)
80
+ 2. **Tech stack** -- Identify framework, language, database, styling from config files:
81
+ - `package.json`, `composer.json`, `Cargo.toml`, `go.mod`, `requirements.txt`
82
+ - Framework configs: `next.config.*`, `vite.config.*`, `artisan`, `convex/`
83
+ - Database: migrations folder, schema files, ORM config
84
+ 3. **Existing patterns** -- Read 2-3 files similar to what you'll need to create/modify:
85
+ - If adding an API endpoint, read an existing endpoint
86
+ - If adding a UI component, read an existing component
87
+ - If adding a model, read an existing model
88
+ 4. **Related code** -- Use Grep to find code related to the feature (e.g., if adding notifications, search for existing notification code)
89
+ 5. **Existing specs** -- Check `prompter/specs/` for relevant capability specs
90
+
91
+ ### Present Findings
92
+
93
+ After analysis, present a brief summary:
94
+
95
+ ```
96
+ Here's what I found in your codebase:
97
+
98
+ **Stack**: [e.g., Laravel 12 + Filament + PostgreSQL + Docker]
99
+ **Structure**: [e.g., Standard Laravel with domain-driven modules under app/Domains/]
100
+ **Relevant patterns**:
101
+ - [e.g., Controllers follow single-action pattern (app/Http/Controllers/)]
102
+ - [e.g., All models use UUIDs as primary keys]
103
+ - [e.g., Tests use Pest with factories]
104
+
105
+ **Related existing code**:
106
+ - [e.g., Similar notification system exists at app/Notifications/]
107
+ - [e.g., No existing code for webhooks -- this is net new]
108
+ ```
109
+
110
+ Then ask using `AskUserQuestion`:
111
+
112
+ ```json
113
+ {
114
+ "questions": [
115
+ {
116
+ "question": "Does this look right? Anything I missed about how your project works?",
117
+ "header": "Codebase Analysis",
118
+ "multiSelect": false,
119
+ "options": [
120
+ { "label": "Looks correct", "description": "Move on to scoping" },
121
+ { "label": "Need to correct something", "description": "I'll clarify what's different" }
122
+ ]
123
+ }
124
+ ]
125
+ }
126
+ ```
127
+
128
+ If the user corrects something, update your understanding and move on.
129
+
130
+ ---
131
+
132
+ ## Step 3: Scope & Affected Areas
133
+
134
+ Based on the feature description and codebase analysis, present the scope:
135
+
136
+ ```
137
+ Here's what I'd include for this feature:
138
+
139
+ **In scope:**
140
+ - [change 1]
141
+ - [change 2]
142
+ - [change 3]
143
+
144
+ **Out of scope (can do later):**
145
+ - [deferred item 1] -- [reason]
146
+
147
+ **Files that will be affected:**
148
+ - `path/to/file.ext` -- [what changes: new / modify / delete]
149
+ - `path/to/file.ext` -- [what changes]
150
+ ```
151
+
152
+ Then ask:
153
+
154
+ ```json
155
+ {
156
+ "questions": [
157
+ {
158
+ "question": "Does this scope match what you had in mind?",
159
+ "header": "Feature Scope",
160
+ "multiSelect": false,
161
+ "options": [
162
+ { "label": "Looks good", "description": "Proceed to implementation plan" },
163
+ { "label": "Too much", "description": "I want to trim the scope" },
164
+ { "label": "Missing something", "description": "I'll tell you what to add" }
165
+ ]
166
+ }
167
+ ]
168
+ }
169
+ ```
170
+
171
+ Iterate until the user confirms the scope.
172
+
173
+ ---
174
+
175
+ ## Step 4: Implementation Plan (REQUIRED)
176
+
177
+ Produce the implementation plan using the template in `assets/implementation-plan-template.md`.
178
+
179
+ ### Planning Rules
180
+
181
+ - **Phase tasks logically**: database/schema first, then backend logic, then frontend, then tests.
182
+ - **Reference specific files**: Every task should mention the file path where the work happens. Use existing file paths for modifications; propose paths that follow existing conventions for new files.
183
+ - **Follow existing patterns**: If the project uses a specific pattern (e.g., repository pattern, single-action controllers), your plan must follow it.
184
+ - **Be concrete**: "Create UserNotification model with `user_id`, `type`, `message`, `read_at` columns" is better than "Create notification model".
185
+ - **Include test tasks**: Always include at least one testing phase.
186
+ - **Keep it achievable**: Aim for a plan that can be completed in a single session. If the feature is large, suggest splitting it and plan only the first part.
187
+
188
+ ### Present the Plan
189
+
190
+ Output the filled-in implementation plan template, then ask:
191
+
192
+ ```json
193
+ {
194
+ "questions": [
195
+ {
196
+ "question": "Does this implementation plan look correct?",
197
+ "header": "Plan Review",
198
+ "multiSelect": false,
199
+ "options": [
200
+ { "label": "Approved", "description": "Save the plan and optionally create a proposal" },
201
+ { "label": "Needs changes", "description": "I'll tell you what to adjust" }
202
+ ]
203
+ }
204
+ ]
205
+ }
206
+ ```
207
+
208
+ Iterate if the user requests changes.
209
+
210
+ ---
211
+
212
+ ## Step 5: Save & Next Steps (REQUIRED)
213
+
214
+ Once approved, save the plan based on what's available in the project.
215
+
216
+ ### If Prompter is installed
217
+
218
+ Check whether `prompter/core/proposal.md` exists using Glob.
219
+
220
+ If it exists, ask:
221
+
222
+ ```json
223
+ {
224
+ "questions": [
225
+ {
226
+ "question": "How would you like to proceed?",
227
+ "header": "Next Steps",
228
+ "multiSelect": false,
229
+ "options": [
230
+ { "label": "Create proposal", "description": "Scaffold a Prompter change proposal from this plan" },
231
+ { "label": "Start building", "description": "Jump straight into implementation using this plan" },
232
+ { "label": "Save plan only", "description": "Save the plan to a file for later" }
233
+ ]
234
+ }
235
+ ]
236
+ }
237
+ ```
238
+
239
+ **If "Create proposal"**: Read `prompter/core/proposal.md` and `prompter/AGENTS.md`, then follow their instructions to scaffold a full change proposal. Use the implementation plan as context to derive:
240
+ - `change-id` (verb-led, kebab-case)
241
+ - `proposal.md` (why, what changes, impact)
242
+ - `tasks.md` (from the implementation phases)
243
+ - `design.md` (only if needed per Prompter criteria)
244
+ - Spec deltas under `specs/[capability]/spec.md`
245
+
246
+ After scaffolding, run `prompter validate <change-id> --strict --no-interactive` and fix any issues.
247
+
248
+ **If "Start building"**: Begin implementing the tasks from the plan sequentially. Read the plan as your checklist and complete each task in order.
249
+
250
+ **If "Save plan only"**: Write the plan to `implementation-plan.md` in the project root.
251
+
252
+ ### If Prompter is NOT installed
253
+
254
+ Ask:
255
+
256
+ ```json
257
+ {
258
+ "questions": [
259
+ {
260
+ "question": "What would you like to do next?",
261
+ "header": "Next Steps",
262
+ "multiSelect": false,
263
+ "options": [
264
+ { "label": "Start building", "description": "Begin implementing the tasks now" },
265
+ { "label": "Save plan only", "description": "Save the plan to a file for later" }
266
+ ]
267
+ }
268
+ ]
269
+ }
270
+ ```
271
+
272
+ **If "Start building"**: Begin implementing tasks sequentially.
273
+
274
+ **If "Save plan only"**: Write the plan to `implementation-plan.md` in the project root.
275
+
276
+ ---
277
+
278
+ ## Conversation Tips
279
+
280
+ ### Handling Large Features
281
+ - Suggest splitting into multiple increments.
282
+ - Plan only the first increment in detail.
283
+ - Note follow-up work in the "Out of scope" section.
284
+ - Use: "This is a big feature. I'd suggest we tackle [core part] first and add [extras] after."
285
+
286
+ ### Handling Vague Requests
287
+ - Look at the codebase first to infer what the user might mean.
288
+ - If still unclear after codebase analysis, ask ONE focused clarifying question.
289
+ - Never ask more than 2 clarifying questions before producing a draft plan -- it's easier to iterate on a concrete plan than to keep asking questions.
290
+
291
+ ### Handling Technical Users
292
+ - Skip obvious explanations.
293
+ - Focus on file paths, patterns, and concrete decisions.
294
+ - Be direct about tradeoffs.
295
+
296
+ ### Handling Unfamiliar Codebases
297
+ - Spend more time in Step 2 (analysis).
298
+ - Read more example files to understand patterns.
299
+ - Be explicit about assumptions: "I'm assuming X based on what I see in Y -- correct me if wrong."
300
+
301
+ ---
302
+
303
+ ## Resources
304
+
305
+ - **Implementation plan template**: [implementation-plan-template.md](assets/implementation-plan-template.md) -- Structured output format for the plan
@@ -0,0 +1,85 @@
1
+ # Implementation Plan: [Feature Name]
2
+
3
+ ## Feature Overview
4
+ [1-2 sentence summary of what is being built and why]
5
+
6
+ ---
7
+
8
+ ## Scope
9
+
10
+ ### In Scope
11
+ - [ ] [Change 1]
12
+ - [ ] [Change 2]
13
+ - [ ] [Change 3]
14
+
15
+ ### Out of Scope
16
+ - [Deferred item 1] -- [reason]
17
+ - [Deferred item 2] -- [reason]
18
+
19
+ ---
20
+
21
+ ## Codebase Analysis
22
+
23
+ ### Tech Stack Detected
24
+ | Layer | Technology |
25
+ |-------|-----------|
26
+ | Frontend | [e.g., Next.js, React] |
27
+ | Backend | [e.g., Laravel, Express] |
28
+ | Database | [e.g., PostgreSQL, MySQL] |
29
+ | Other | [e.g., Redis, Docker] |
30
+
31
+ ### Affected Files & Modules
32
+ | File / Module | Change Type | Description |
33
+ |---------------|-------------|-------------|
34
+ | [path/to/file] | New / Modify / Delete | [What changes] |
35
+
36
+ ### Existing Patterns to Follow
37
+ - [Pattern 1 observed in codebase -- e.g., "Controllers use single-action pattern"]
38
+ - [Pattern 2 -- e.g., "All API responses use ApiResource wrapper"]
39
+ - [Pattern 3 -- e.g., "Tests use factories with specific naming convention"]
40
+
41
+ ---
42
+
43
+ ## Data Model Changes
44
+ > Skip this section if no database changes are needed.
45
+
46
+ ### New Tables / Collections
47
+ - **[table_name]**: [key columns/fields]
48
+
49
+ ### Modified Tables / Collections
50
+ - **[table_name]**: Add [column] ([type]) -- [reason]
51
+
52
+ ### New Relationships
53
+ - [Entity A] has many [Entity B]
54
+
55
+ ---
56
+
57
+ ## Implementation Tasks
58
+
59
+ ### Phase 1: [Foundation / Database / Setup]
60
+ - [ ] 1.1 [Task description] -- `path/to/file`
61
+ - [ ] 1.2 [Task description] -- `path/to/file`
62
+
63
+ ### Phase 2: [Core Logic / Backend]
64
+ - [ ] 2.1 [Task description] -- `path/to/file`
65
+ - [ ] 2.2 [Task description] -- `path/to/file`
66
+
67
+ ### Phase 3: [Frontend / UI]
68
+ - [ ] 3.1 [Task description] -- `path/to/file`
69
+ - [ ] 3.2 [Task description] -- `path/to/file`
70
+
71
+ ### Phase 4: [Tests / Validation]
72
+ - [ ] 4.1 [Task description] -- `path/to/file`
73
+ - [ ] 4.2 [Task description] -- `path/to/file`
74
+
75
+ ---
76
+
77
+ ## Dependencies & Risks
78
+ | Risk | Impact | Mitigation |
79
+ |------|--------|------------|
80
+ | [Risk 1] | [High/Med/Low] | [How to handle] |
81
+
82
+ ---
83
+
84
+ ## Notes
85
+ - [Any additional context, edge cases, or decisions made during planning]
@@ -263,6 +263,7 @@ After the user picks a bundle, ask ONLY the necessary sub-choices:
263
263
  **Bundle 2 sub-choices:**
264
264
  - 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)
265
265
  - No database sub-choice needed -- Convex includes a built-in document database with real-time sync.
266
+ - **Convex hosting**: Convex Cloud (managed, easiest) vs Self-Hosted (Docker, full control)? (Recommend Convex Cloud for most projects -- zero infrastructure overhead. Recommend Self-Hosted if the user needs data sovereignty, air-gapped environments, or wants to avoid vendor lock-in.)
266
267
 
267
268
  **Bundle 3 sub-choices:**
268
269
  - MySQL vs PostgreSQL? (Same guidance as above)
@@ -290,6 +291,16 @@ Quick context: Docker makes it easy to set up identical dev environments across
290
291
 
291
292
  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.").
292
293
 
294
+ ### Web Server / Reverse Proxy Guidelines
295
+
296
+ When Docker is used and a web server or reverse proxy is needed (e.g., for Laravel, Express, NestJS, or a Dockerized frontend):
297
+
298
+ - **Always use Caddy** as the web server and reverse proxy -- do NOT use or recommend Nginx or Apache.
299
+ - Caddy automatically handles HTTPS (via Let's Encrypt or ZeroSSL) in production with zero extra configuration.
300
+ - For local development, Caddy serves HTTP by default -- no certificate setup needed.
301
+ - Add a `Caddyfile` at the project root and a `caddy` service in `docker-compose.yml`.
302
+ - Mention Caddy in the final plan summary under the Docker/web server row and in the recommended next steps.
303
+
293
304
  ### Laravel + Docker Guidelines
294
305
 
295
306
  When the user chooses a Laravel stack (Bundle 3, 4, or 5) with Docker:
@@ -300,6 +311,29 @@ When the user chooses a Laravel stack (Bundle 3, 4, or 5) with Docker:
300
311
  - Any other long-running processes the project needs (e.g., scheduler via `php artisan schedule:work`)
301
312
  - Mention this in the final plan summary under the Docker row and in the recommended next steps.
302
313
 
314
+ ### Convex Self-Hosted Guidelines
315
+
316
+ When the user chooses React + Convex (Bundle 2) with **self-hosted** deployment:
317
+
318
+ - **Use Docker Compose** with two Convex services:
319
+ - `convex` — backend image `ghcr.io/get-convex/convex-backend:latest`
320
+ - `convex-dashboard` — dashboard image `ghcr.io/get-convex/convex-dashboard:latest`
321
+ - **Two environment files** are required:
322
+ - `.env.dev` (Docker Compose config) — contains `CONVEX_PORT`, `CONVEX_DASHBOARD_PORT`, `CONVEX_DASHBOARD_UI_PORT`, `VITE_CONVEX_URL`, `CONVEX_ADMIN_KEY`, `CONVEX_CLOUD_ORIGIN`, `CONVEX_SITE_ORIGIN`
323
+ - `.env.local` (CLI and frontend, never committed) — contains `VITE_CONVEX_URL`, `CONVEX_SELF_HOSTED_URL`, `CONVEX_SELF_HOSTED_ADMIN_KEY`
324
+ - **Admin key generation**: After starting the backend, generate the CLI admin key from the running container:
325
+ ```bash
326
+ docker compose --env-file .env.dev exec convex ./generate_admin_key.sh
327
+ ```
328
+ Copy the printed `convex-self-hosted|...` value into `.env.local` as `CONVEX_SELF_HOSTED_ADMIN_KEY`. Never use a random string or the Docker `CONVEX_ADMIN_KEY` value directly for CLI use.
329
+ - **Add a deploy script** to `package.json`:
330
+ ```json
331
+ "deploy:selfhosted": "convex deploy --url $CONVEX_SELF_HOSTED_URL --admin-key $CONVEX_SELF_HOSTED_ADMIN_KEY"
332
+ ```
333
+ - **Reserved index names**: Self-hosted Convex does not allow reserved index names such as `by_id`. Rename them to non-reserved names (e.g., `by_external_id`) before deploying.
334
+ - **Frontend wiring**: The frontend reads `VITE_CONVEX_URL` at build time. Ensure this value is reachable by the browser and is passed as a Docker build argument when building the frontend image.
335
+ - Mention this setup in the final plan summary under the Docker/Convex row and in the recommended next steps.
336
+
303
337
  ---
304
338
 
305
339
  ## Step 9: Deployment & Hosting
@@ -68,10 +68,12 @@
68
68
  | Layer | Choice | Rationale |
69
69
  |-------|--------|-----------|
70
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] |
71
+ | Backend | [e.g., NestJS / Convex] | [Why] |
72
+ | ORM / DB Layer | [e.g., Drizzle / Convex built-in] | [Why] |
73
+ | Database | [e.g., PostgreSQL / Convex document DB] | [Why] |
74
+ | Convex Hosting | [Cloud / Self-Hosted] | [Why -- only include if using Convex] |
74
75
  | Styling | [e.g., Tailwind CSS] | [Why] |
76
+ | Web Server | [e.g., Caddy] | [Why -- include when Docker is used] |
75
77
  | Docker | Yes/No | [Why] |
76
78
 
77
79
  ---
@@ -109,6 +111,7 @@
109
111
  # [Insert the exact setup command(s) for the chosen stack]
110
112
  # React (Vite): npm create vite@latest
111
113
  # Next.js: npx create-next-app@latest {project_name} --yes
114
+ # React + Convex: npm create convex@latest
112
115
  # Express: npm install express --save
113
116
  # NestJS: npm i -g @nestjs/cli && nest new {project_name}
114
117
  # Laravel 12: composer create-project laravel/laravel:^12.0 {project_name}
@@ -116,7 +119,38 @@
116
119
  ```
117
120
  > Replace the above with only the command(s) matching the selected stack.
118
121
 
119
- ### 2. Further steps
122
+ ### 2. Convex Self-Hosted Setup (only if self-hosted Convex was chosen)
123
+ ```bash
124
+ # 1. Copy environment files
125
+ cp env.dev.example .env.dev
126
+ # Edit .env.dev with your port and origin values
127
+
128
+ # 2. Create initial .env.local
129
+ echo 'VITE_CONVEX_URL=http://localhost:3220' > .env.local
130
+
131
+ # 3. Start Convex backend and dashboard
132
+ docker compose --env-file .env.dev up -d convex convex-dashboard
133
+
134
+ # 4. Generate the self-hosted admin key from the running container
135
+ docker compose --env-file .env.dev exec convex ./generate_admin_key.sh
136
+ # Copy the printed convex-self-hosted|... value
137
+
138
+ # 5. Append CLI credentials to .env.local
139
+ # CONVEX_SELF_HOSTED_URL=http://localhost:3220
140
+ # CONVEX_SELF_HOSTED_ADMIN_KEY=convex-self-hosted|...
141
+
142
+ # 6. Deploy schema and functions
143
+ npm run deploy:selfhosted
144
+
145
+ # 7. (Optional) Seed data
146
+ npx convex run seed:run '{}' --url http://localhost:3220 --admin-key "$CONVEX_SELF_HOSTED_ADMIN_KEY"
147
+ ```
148
+ > Notes:
149
+ > - Do NOT use a random string as `CONVEX_SELF_HOSTED_ADMIN_KEY` -- always generate it from the container.
150
+ > - Avoid reserved index names like `by_id` in your Convex schema -- rename them (e.g., `by_external_id`) before deploying.
151
+ > - `VITE_CONVEX_URL` must be reachable by the browser; pass it as a Docker build argument when building the frontend image.
152
+
153
+ ### 3. Further steps
120
154
  - [e.g., Define database schema based on data model above]
121
155
  - [e.g., Implement authentication and user management]
122
156
  - [e.g., Build core feature X]
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: prompter-workflow
3
+ description: Guide spec-driven development through Prompter's three-stage workflow — creating change proposals with spec deltas, implementing approved changes, and archiving completed work. Use this skill whenever the user mentions proposals, specs, changes, plans, or asks to create/apply/archive a Prompter change. Also trigger when the user wants to add features, make breaking changes, update architecture, or plan implementation work that should go through a formal proposal process.
4
+ ---
5
+
6
+ # Prompter Workflow
7
+
8
+ Drive spec-driven development through three stages: **Propose**, **Apply**, and **Archive**. Each stage has guardrails to keep changes minimal, scoped, and traceable.
9
+
10
+ ## Before You Begin
11
+
12
+ 1. Search existing specs under `prompter/specs/` and active changes under `prompter/changes/` to understand current state and avoid conflicts.
13
+ 2. Search existing requirements with `rg -n "Requirement:|Scenario:" prompter/specs` before writing new ones.
14
+
15
+ ## Detecting Which Stage
16
+
17
+ Determine which stage the user needs based on their request:
18
+
19
+ | Signal | Stage |
20
+ |--------|-------|
21
+ | "create a proposal", "plan a change", "add a feature", "I want to spec..." | **Propose** |
22
+ | "implement", "apply", "build this", references an existing change ID + wants code | **Apply** |
23
+ | "archive", "mark as done", "move to archive", references a completed change | **Archive** |
24
+
25
+ If unclear, default to **Propose** — it's always safer to plan first.
26
+
27
+ ---
28
+
29
+ ## Stage 1: Propose
30
+
31
+ Create a change proposal with spec deltas. No code gets written here — only design documents.
32
+
33
+ ### Guardrails
34
+
35
+ - Favor straightforward, minimal implementations first.
36
+ - Keep changes tightly scoped to the requested outcome.
37
+ - Identify vague or ambiguous details and ask follow-up questions before editing files.
38
+ - Do not write any code during this stage.
39
+
40
+ ### Steps
41
+
42
+ 1. **Ground the proposal in current state.**
43
+ - List `prompter/changes/` to see active changes (check for conflicts).
44
+ - List `prompter/specs/` to see existing capabilities.
45
+ - Inspect related code or docs to understand current behavior.
46
+ - Note any gaps that require clarification from the user.
47
+
48
+ 2. **Choose a change ID and scaffold.**
49
+ - Pick a unique, verb-led, kebab-case ID (e.g., `add-two-factor-auth`, `update-payment-flow`, `remove-legacy-api`).
50
+ - Create the directory structure:
51
+ ```
52
+ prompter/changes/<change-id>/
53
+ ├── proposal.md
54
+ ├── tasks.md
55
+ ├── design.md (only if needed — see criteria below)
56
+ └── specs/
57
+ └── <capability>/
58
+ └── spec.md
59
+ ```
60
+
61
+ 3. **Map the change into capabilities.**
62
+ - Break multi-scope efforts into distinct spec deltas with clear relationships.
63
+ - Prefer modifying existing specs over creating duplicates.
64
+ - One folder per affected capability under `specs/`.
65
+
66
+ 4. **Write design.md (only when needed).**
67
+ Create `design.md` if the solution spans multiple systems, introduces new patterns, or demands trade-off discussion. Include: Context, Goals/Non-Goals, Decisions, Risks/Trade-offs, Migration Plan, Open Questions.
68
+
69
+ 5. **Draft spec deltas.**
70
+ - Use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements` headers.
71
+ - Include at least one `#### Scenario:` per requirement.
72
+ - Use SHALL/MUST for normative requirements.
73
+ - Cross-reference related capabilities when relevant.
74
+ - For MODIFIED requirements: copy the full existing requirement, then edit. Partial deltas lose detail at archive time.
75
+
76
+ 6. **Draft tasks.md.**
77
+ - Ordered list of small, verifiable work items.
78
+ - Each task should deliver user-visible progress.
79
+ - Include validation steps (tests, tooling).
80
+ - Highlight dependencies or parallelizable work.
81
+
82
+ ### Spec Format Reference
83
+
84
+ ```markdown
85
+ ## ADDED Requirements
86
+ ### Requirement: Feature Name
87
+ The system SHALL provide [capability].
88
+
89
+ #### Scenario: Success case
90
+ - **WHEN** user performs action
91
+ - **THEN** expected result occurs
92
+
93
+ ## MODIFIED Requirements
94
+ ### Requirement: Existing Feature (full copy, then edit)
95
+ ...
96
+
97
+ ## REMOVED Requirements
98
+ ### Requirement: Old Feature
99
+ **Reason**: [Why removing]
100
+ **Migration**: [How to handle]
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Stage 2: Apply
106
+
107
+ Implement an approved change proposal. Work through tasks sequentially, keeping edits minimal.
108
+
109
+ ### Guardrails
110
+
111
+ - Do not start implementation until the proposal is reviewed and approved.
112
+ - Keep changes tightly scoped to what the proposal specifies.
113
+ - Favor straightforward, minimal implementations.
114
+
115
+ ### Steps
116
+
117
+ 1. **Read the proposal.**
118
+ - Read `changes/<id>/proposal.md` to understand scope and motivation.
119
+ - Read `changes/<id>/design.md` (if present) for technical decisions.
120
+ - Read `changes/<id>/tasks.md` for the implementation checklist.
121
+
122
+ 2. **Implement tasks sequentially.**
123
+ - Work through each task in order.
124
+ - Keep edits minimal and focused on the requested change.
125
+
126
+ 3. **Confirm completion.**
127
+ - Verify every item in `tasks.md` is actually finished before updating statuses.
128
+ - Run tests and validation as specified in the tasks.
129
+
130
+ 4. **Update the checklist.**
131
+ - Mark each task `- [x]` only after all work is done.
132
+ - Ensure the checklist reflects reality.
133
+
134
+ ---
135
+
136
+ ## Stage 3: Archive
137
+
138
+ Move a completed change to the archive and update specs.
139
+
140
+ ### Steps
141
+
142
+ 1. **Determine the change ID.**
143
+ - If the user specified a change ID, use it (trim whitespace).
144
+ - If referenced loosely (by title or summary), list `prompter/changes/` to find candidates and confirm with the user.
145
+
146
+ 2. **Verify the change exists and is ready.**
147
+ - Check `prompter/changes/<id>/` exists and is not already under `prompter/changes/archive/`.
148
+
149
+ 3. **Move the change to archive.**
150
+ - Move `prompter/changes/<id>/` to `prompter/changes/archive/YYYY-MM-DD-<id>/` (use today's date).
151
+ - Apply the spec deltas: for each `changes/<id>/specs/<capability>/spec.md`, merge the ADDED/MODIFIED/REMOVED requirements into the corresponding `prompter/specs/<capability>/spec.md`.
152
+ - Skip spec merging only for tooling-only changes that don't affect specifications.
153
+
154
+ 4. **Confirm archive landed.**
155
+ - Verify the directory moved to `prompter/changes/archive/`.
156
+ - Verify target specs were updated correctly.
157
+
158
+ ---
159
+
160
+ ## Troubleshooting
161
+
162
+ | Error | Fix |
163
+ |-------|-----|
164
+ | "Change must have at least one delta" | Check `changes/<id>/specs/` has `.md` files with `## ADDED\|MODIFIED\|REMOVED Requirements` headers |
165
+ | "Requirement must have at least one scenario" | Use `#### Scenario:` format (4 hashtags, not bullets or bold) |
166
+ | Silent scenario parsing failures | Exact format required: `#### Scenario: Name` |