@dedesfr/prompter 0.8.5 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## [0.8.7] - 2026-04-05
4
+
5
+ ### ✨ Added
6
+ - **prompter-workflow Skill**: Guide spec-driven development through Prompter's three-stage workflow
7
+ - Orchestrates **Propose**, **Apply**, and **Archive** stages for safe, traceable changes
8
+ - Includes guardrails for minimal, scoped, and verifiable implementations
9
+ - Integrated with `prompter/changes/` and `prompter/specs/` for change management
10
+ - Supports drafting spec deltas with `ADDED|MODIFIED|REMOVED|RENAMED` requirements
11
+
12
+ ## [0.8.6] - 2026-04-04
13
+
14
+ ### ✨ Added
15
+ - **Convex Self-Hosted Deployment**: Comprehensive setup guide for self-hosted Convex deployments
16
+ - New `convex-setup.md` documentation covering Docker Compose setup with backend and dashboard containers
17
+ - Step-by-step instructions for admin key generation, schema deployment, and frontend integration
18
+ - Environment variable configuration for both compose stack (`.env.dev`) and CLI/frontend (`.env.local`)
19
+ - Troubleshooting guide and common mistakes reference
20
+ - Verification checklist for successful setup
21
+
22
+ ### 🔄 Changed
23
+ - **project-orchestrator Skill**: Added Convex self-hosted deployment options
24
+ - New Convex hosting sub-choice: Cloud (managed) vs Self-Hosted (Docker, full control)
25
+ - Comprehensive Convex Self-Hosted Guidelines including Docker Compose setup, environment variables, and admin key generation
26
+ - Updated plan summary template to include Convex hosting choice and web server configuration
27
+ - Added Convex self-hosted setup commands to project bootstrapping examples
28
+ - Best practices for reserved index names and frontend URL configuration in self-hosted deployments
29
+ - Web Server / Reverse Proxy Guidelines: Always use Caddy for automatic HTTPS in production with zero configuration
30
+
3
31
  ## [0.8.5] - 2026-03-30
4
32
 
5
33
  ### ✨ Added
@@ -0,0 +1,403 @@
1
+ # Convex Self-Hosted Setup Guide
2
+
3
+ This document explains how to set up a self-hosted Convex deployment for this project using the official Convex self-hosted flow.
4
+
5
+ It covers:
6
+
7
+ - the Convex backend container
8
+ - the Convex dashboard container
9
+ - the frontend app connected through `VITE_CONVEX_URL`
10
+ - the Convex CLI workflow for deploying schema and functions to a self-hosted instance
11
+
12
+ ## Official self-hosted flow
13
+
14
+ The official Convex self-hosted documentation uses this sequence:
15
+
16
+ 1. start the backend and dashboard
17
+ 2. generate the admin key from the running backend container
18
+ 3. save `CONVEX_SELF_HOSTED_URL` and `CONVEX_SELF_HOSTED_ADMIN_KEY` in `.env.local`
19
+ 4. use the Convex CLI to deploy schema and functions
20
+ 5. run queries, mutations, imports, or seeds against the self-hosted backend
21
+
22
+ Important:
23
+
24
+ - The CLI admin key is generated from the running backend.
25
+ - Do not assume the Docker env value `CONVEX_ADMIN_KEY` is the same value the CLI expects.
26
+ - Do not use a random `openssl rand -hex 32` string as `CONVEX_SELF_HOSTED_ADMIN_KEY` unless Convex explicitly tells you to do so for your setup.
27
+
28
+ ## How this project is wired
29
+
30
+ ### Frontend
31
+
32
+ The frontend creates the Convex React client from `VITE_CONVEX_URL`:
33
+
34
+ ```ts
35
+ const convex = new ConvexReactClient(import.meta.env.VITE_CONVEX_URL as string);
36
+ ```
37
+
38
+ That means:
39
+
40
+ - `VITE_CONVEX_URL` must be reachable by the browser
41
+ - the frontend needs this value during local development
42
+ - when building the Docker image, the same value must be passed as a build argument
43
+
44
+ ### Deploy script
45
+
46
+ This project exposes a self-hosted deploy script in `package.json`:
47
+
48
+ ```json
49
+ {
50
+ "scripts": {
51
+ "deploy:selfhosted": "convex deploy --url $CONVEX_SELF_HOSTED_URL --admin-key $CONVEX_SELF_HOSTED_ADMIN_KEY"
52
+ }
53
+ }
54
+ ```
55
+
56
+ ## Prerequisites
57
+
58
+ Install these first:
59
+
60
+ - Node.js 22+
61
+ - npm
62
+ - Docker Desktop or Docker Engine with Compose
63
+ - project dependencies installed with `npm install`
64
+
65
+ If `node` or `npm` are missing from your `PATH`, use the Node 22 install configured for this project:
66
+
67
+ ```bash
68
+ export PATH="$HOME/.nvm/versions/node/v22.17.1/bin:$PATH"
69
+ ```
70
+
71
+ ## Environment variables used by this project
72
+
73
+ This project uses two different configuration contexts.
74
+
75
+ ### 1. Docker Compose environment
76
+
77
+ The compose stack reads values such as:
78
+
79
+ ```env
80
+ APP_ENV=dev
81
+ WEB_PORT=8080
82
+ CONVEX_PORT=3220
83
+ CONVEX_DASHBOARD_PORT=3221
84
+ CONVEX_DASHBOARD_UI_PORT=6792
85
+ VITE_CONVEX_URL=http://localhost:3220
86
+ CONVEX_ADMIN_KEY=replace-with-placeholder-if-needed
87
+ CONVEX_CLOUD_ORIGIN=http://localhost:3220
88
+ CONVEX_SITE_ORIGIN=http://localhost:6792
89
+ ```
90
+
91
+ Notes:
92
+
93
+ - `CONVEX_ADMIN_KEY` is passed into the backend container.
94
+ - In practice, the Convex CLI should use the admin key generated from the running backend container.
95
+ - `CONVEX_CLOUD_ORIGIN` should point to the backend API origin.
96
+ - `CONVEX_SITE_ORIGIN` should point to the dashboard UI origin.
97
+
98
+ ### 2. Local CLI and frontend environment
99
+
100
+ For local development, `.env.local` should contain:
101
+
102
+ ```env
103
+ VITE_CONVEX_URL=http://localhost:3220
104
+ CONVEX_SELF_HOSTED_URL=http://localhost:3220
105
+ CONVEX_SELF_HOSTED_ADMIN_KEY=convex-self-hosted|generated-from-container
106
+ ```
107
+
108
+ Notes:
109
+
110
+ - `VITE_CONVEX_URL` is used by the frontend.
111
+ - `CONVEX_SELF_HOSTED_URL` and `CONVEX_SELF_HOSTED_ADMIN_KEY` are used by the Convex CLI.
112
+ - `.env.local` should not be committed.
113
+
114
+ ## Reference Docker Compose pattern
115
+
116
+ This project uses the same high-level pattern as the official self-hosted documentation: one backend service and one dashboard service.
117
+
118
+ ```yaml
119
+ services:
120
+ convex:
121
+ image: ghcr.io/get-convex/convex-backend:latest
122
+ ports:
123
+ - "${CONVEX_PORT:-3210}:3210"
124
+ - "${CONVEX_DASHBOARD_PORT:-3211}:3211"
125
+ volumes:
126
+ - convex-data:/convex/data
127
+ environment:
128
+ CONVEX_ADMIN_KEY: ${CONVEX_ADMIN_KEY}
129
+ CONVEX_CLOUD_ORIGIN: ${CONVEX_CLOUD_ORIGIN}
130
+ CONVEX_SITE_ORIGIN: ${CONVEX_SITE_ORIGIN}
131
+
132
+ convex-dashboard:
133
+ image: ghcr.io/get-convex/convex-dashboard:latest
134
+ depends_on:
135
+ convex:
136
+ condition: service_started
137
+ ports:
138
+ - "${CONVEX_DASHBOARD_UI_PORT:-6791}:6791"
139
+ environment:
140
+ NEXT_PUBLIC_DEPLOYMENT_URL: ${CONVEX_CLOUD_ORIGIN}
141
+ NEXT_PUBLIC_LOAD_MONACO_INTERNALLY: "true"
142
+
143
+ volumes:
144
+ convex-data:
145
+ ```
146
+
147
+ In this repository, the actual compose file also includes a `web` service for the frontend.
148
+
149
+ ## Step-by-step setup for this project
150
+
151
+ ### 1. Install dependencies
152
+
153
+ From the repository root:
154
+
155
+ ```bash
156
+ npm install
157
+ ```
158
+
159
+ ### 2. Create `.env.dev`
160
+
161
+ Copy the development template:
162
+
163
+ ```bash
164
+ cp env.dev.example .env.dev
165
+ ```
166
+
167
+ Recommended local values:
168
+
169
+ ```env
170
+ APP_ENV=dev
171
+ WEB_PORT=8080
172
+ CONVEX_PORT=3220
173
+ CONVEX_DASHBOARD_PORT=3221
174
+ CONVEX_DASHBOARD_UI_PORT=6792
175
+ VITE_CONVEX_URL=http://localhost:3220
176
+ CONVEX_ADMIN_KEY=replace-with-placeholder-if-needed
177
+ CONVEX_CLOUD_ORIGIN=http://localhost:3220
178
+ CONVEX_SITE_ORIGIN=http://localhost:6792
179
+ ```
180
+
181
+ Important:
182
+
183
+ - Treat `CONVEX_ADMIN_KEY` here as backend container configuration.
184
+ - Do not copy this value into `CONVEX_SELF_HOSTED_ADMIN_KEY` for CLI usage unless you have confirmed it is the generated self-hosted admin key for your instance.
185
+
186
+ ### 3. Create `.env.local`
187
+
188
+ Create the local file with the frontend URL first:
189
+
190
+ ```bash
191
+ cat > .env.local <<'EOF'
192
+ VITE_CONVEX_URL=http://localhost:3220
193
+ EOF
194
+ ```
195
+
196
+ You will append the self-hosted CLI settings after the backend starts and after you generate the real admin key.
197
+
198
+ ### 4. Start the Convex backend and dashboard
199
+
200
+ Run:
201
+
202
+ ```bash
203
+ docker compose --env-file .env.dev up -d convex convex-dashboard
204
+ ```
205
+
206
+ Check status:
207
+
208
+ ```bash
209
+ docker compose --env-file .env.dev ps
210
+ ```
211
+
212
+ Expected result:
213
+
214
+ - `convex` is running
215
+ - `convex-dashboard` is running
216
+
217
+ By default for local development in this project:
218
+
219
+ - backend API is available at `http://localhost:3220`
220
+ - backend dashboard/API port is mapped at `http://localhost:3221`
221
+ - dashboard UI is available at `http://localhost:6792`
222
+
223
+ ## 5. Generate the real self-hosted admin key
224
+
225
+ After the backend is running, generate the admin key from the live Convex container.
226
+
227
+ Run:
228
+
229
+ ```bash
230
+ docker compose --env-file .env.dev exec convex ./generate_admin_key.sh
231
+ ```
232
+
233
+ Expected output format:
234
+
235
+ ```text
236
+ convex-self-hosted|...
237
+ ```
238
+
239
+ Copy that exact value.
240
+
241
+ Now append the self-hosted CLI settings to `.env.local`:
242
+
243
+ ```bash
244
+ cat >> .env.local <<'EOF'
245
+ CONVEX_SELF_HOSTED_URL=http://localhost:3220
246
+ CONVEX_SELF_HOSTED_ADMIN_KEY=paste-the-generated-key-here
247
+ EOF
248
+ ```
249
+
250
+ Important:
251
+
252
+ - Use the generated key exactly as printed.
253
+ - If you later recreate the backend state, generate the key again.
254
+ - If the backend uses a persistent Docker volume, the instance credentials can persist across restarts.
255
+
256
+ ## 6. Deploy schema and functions
257
+
258
+ With `.env.local` configured, deploy the Convex schema and functions:
259
+
260
+ ```bash
261
+ npm run deploy:selfhosted
262
+ ```
263
+
264
+ Equivalent raw command:
265
+
266
+ ```bash
267
+ convex deploy --url "$CONVEX_SELF_HOSTED_URL" --admin-key "$CONVEX_SELF_HOSTED_ADMIN_KEY"
268
+ ```
269
+
270
+ If deployment succeeds, the self-hosted backend now has the current Convex schema and functions.
271
+
272
+ ### Project-specific warning
273
+
274
+ This repository currently has a known self-hosted compatibility issue in `convex/schema.ts`: reserved index names such as `by_id` can cause deploy to fail on self-hosted Convex.
275
+
276
+ If you see an error like:
277
+
278
+ ```text
279
+ IndexNameReserved: In table "agents" cannot name an index "by_id"
280
+ ```
281
+
282
+ rename the reserved index names to something non-reserved such as `by_external_id`, then deploy again.
283
+
284
+ ## 7. Seed or run commands against the backend
285
+
286
+ Once deploy succeeds, you can run Convex commands against the self-hosted instance.
287
+
288
+ For this project's seed function:
289
+
290
+ ```bash
291
+ npx convex run seed:run '{}' \
292
+ --url http://localhost:3220 \
293
+ --admin-key "$CONVEX_SELF_HOSTED_ADMIN_KEY"
294
+ ```
295
+
296
+ You can also use other CLI commands after configuration, for example:
297
+
298
+ ```bash
299
+ npx convex --help
300
+ ```
301
+
302
+ ## 8. Run the frontend locally
303
+
304
+ Start the frontend development server:
305
+
306
+ ```bash
307
+ npm run dev
308
+ ```
309
+
310
+ Open the local Vite URL shown in the terminal, typically:
311
+
312
+ ```text
313
+ http://localhost:5173
314
+ ```
315
+
316
+ ## 9. Optional Dockerized frontend
317
+
318
+ If you want to run the frontend through Docker Compose too:
319
+
320
+ ```bash
321
+ docker compose --env-file .env.dev up -d --build
322
+ ```
323
+
324
+ This project passes `VITE_CONVEX_URL` as a Docker build argument so the Vite app can be built with the correct public backend URL.
325
+
326
+ ## Verification checklist
327
+
328
+ - `npm install` completes successfully
329
+ - `docker compose --env-file .env.dev up -d convex convex-dashboard` succeeds
330
+ - `docker compose --env-file .env.dev exec convex ./generate_admin_key.sh` returns a `convex-self-hosted|...` key
331
+ - `.env.local` contains `VITE_CONVEX_URL`, `CONVEX_SELF_HOSTED_URL`, and the generated `CONVEX_SELF_HOSTED_ADMIN_KEY`
332
+ - `npm run deploy:selfhosted` succeeds
333
+ - any seed or query command against the backend succeeds
334
+ - `npm run dev` starts the frontend successfully
335
+ - the frontend can load data from Convex
336
+
337
+ ## Common mistakes
338
+
339
+ - using `.env.dev`'s `CONVEX_ADMIN_KEY` as the CLI admin key without generating the real self-hosted key from the container
340
+ - using a random string as `CONVEX_SELF_HOSTED_ADMIN_KEY`
341
+ - forgetting to deploy schema and functions before running seed commands
342
+ - using a `VITE_CONVEX_URL` that the browser cannot reach
343
+ - assuming changing `.env.dev` automatically updates credentials already persisted in a Docker volume
344
+ - overlooking self-hosted restrictions such as reserved index names during deploy
345
+
346
+ ## Troubleshooting
347
+
348
+ ### `401 Unauthorized: BadAdminKey`
349
+
350
+ Cause:
351
+
352
+ - the CLI is using the wrong admin key
353
+
354
+ Fix:
355
+
356
+ 1. make sure the backend is running
357
+ 2. run `docker compose --env-file .env.dev exec convex ./generate_admin_key.sh`
358
+ 3. copy the printed `convex-self-hosted|...` value into `.env.local` as `CONVEX_SELF_HOSTED_ADMIN_KEY`
359
+ 4. retry deploy or seed
360
+
361
+ ### `Could not find function for 'seed:run'`
362
+
363
+ Cause:
364
+
365
+ - deploy has not succeeded yet, so the function is not available on the backend
366
+
367
+ Fix:
368
+
369
+ 1. resolve the deploy error first
370
+ 2. rerun `npm run deploy:selfhosted`
371
+ 3. rerun the seed command
372
+
373
+ ### `IndexNameReserved`
374
+
375
+ Cause:
376
+
377
+ - the schema defines a reserved index name such as `by_id`
378
+
379
+ Fix:
380
+
381
+ - rename the reserved index to a non-reserved name such as `by_external_id`
382
+ - redeploy
383
+
384
+ ### Frontend fails because `VITE_CONVEX_URL` is missing
385
+
386
+ Cause:
387
+
388
+ - `.env.local` is missing or incomplete
389
+
390
+ Fix:
391
+
392
+ - recreate `.env.local`
393
+ - restart the frontend dev server
394
+
395
+ ## Files in this project you can reuse as references
396
+
397
+ - `package.json`
398
+ - `docker-compose.yml`
399
+ - `Dockerfile`
400
+ - `env.dev.example`
401
+ - `env.prod.example`
402
+ - `src/providers/ConvexClientProvider.tsx`
403
+ - `prompter/changes/add-convex-backend/guide.md`
package/dist/cli/index.js CHANGED
@@ -16,7 +16,7 @@ const program = new Command();
16
16
  program
17
17
  .name('prompter')
18
18
  .description('Enhance prompts directly in your AI coding workflow')
19
- .version('0.8.5');
19
+ .version('0.8.7');
20
20
  program
21
21
  .command('init')
22
22
  .description('Initialize Prompter in your project')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedesfr/prompter",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
4
4
  "description": "Enhance prompts directly in your AI coding workflow",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -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` |
@@ -0,0 +1,89 @@
1
+ {
2
+ "skill_name": "prompter-workflow",
3
+ "evals": [
4
+ {
5
+ "id": 1,
6
+ "prompt": "I want to add a webhook notification system so that when a user completes an order, we fire a POST to their configured endpoint. Can you create a proposal for this?",
7
+ "expected_output": "Creates a change proposal under prompter/changes/add-webhook-notifications/ with proposal.md, tasks.md, and at least one spec delta under specs/ with ADDED Requirements and Scenario blocks. Runs prompter validate with --strict.",
8
+ "files": [],
9
+ "assertions": [
10
+ {
11
+ "name": "Creates proposal.md with Why section",
12
+ "description": "Output or created files include a proposal.md that contains a ## Why section explaining the motivation"
13
+ },
14
+ {
15
+ "name": "Creates tasks.md",
16
+ "description": "Output or created files include a tasks.md with a checklist of implementation tasks using - [ ] format"
17
+ },
18
+ {
19
+ "name": "Creates spec delta with ADDED Requirements",
20
+ "description": "A spec delta file under specs/ contains '## ADDED Requirements' header"
21
+ },
22
+ {
23
+ "name": "Spec delta has Scenario block",
24
+ "description": "The spec delta contains at least one '#### Scenario:' block (4 hashtags, not bold or bullet)"
25
+ },
26
+ {
27
+ "name": "Does not write implementation code",
28
+ "description": "The output does not contain actual code implementation (no function definitions, no API endpoint implementations) — only design documents"
29
+ },
30
+ {
31
+ "name": "Mentions running prompter validate",
32
+ "description": "The output mentions running prompter validate with --strict flag to verify the proposal"
33
+ }
34
+ ]
35
+ },
36
+ {
37
+ "id": 2,
38
+ "prompt": "The add-webhook-notifications proposal has been approved. Please implement it now.",
39
+ "expected_output": "Reads the proposal.md, design.md (if any), and tasks.md from the change directory. Works through tasks sequentially. Updates tasks.md with checkmarks when done.",
40
+ "files": [],
41
+ "assertions": [
42
+ {
43
+ "name": "Reads proposal.md before implementing",
44
+ "description": "Output explicitly mentions reading or referencing proposal.md before starting implementation"
45
+ },
46
+ {
47
+ "name": "Reads tasks.md",
48
+ "description": "Output explicitly mentions reading or referencing tasks.md"
49
+ },
50
+ {
51
+ "name": "Works through tasks sequentially",
52
+ "description": "Output describes completing tasks in order, not all at once or in arbitrary order"
53
+ },
54
+ {
55
+ "name": "Updates task checklist",
56
+ "description": "Output mentions updating tasks.md checkboxes (- [x]) after completion"
57
+ },
58
+ {
59
+ "name": "Does not skip approval gate",
60
+ "description": "Output does not implement before acknowledging the proposal was approved — respects the approval gate"
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "id": 3,
66
+ "prompt": "We shipped the webhook feature last week. Can you archive that change?",
67
+ "expected_output": "Runs prompter list to identify the change, confirms the ID with the user or uses it directly, runs prompter archive <id> --yes, then validates with prompter validate --strict.",
68
+ "files": [],
69
+ "assertions": [
70
+ {
71
+ "name": "Mentions running prompter list to identify change",
72
+ "description": "Output mentions running `prompter list` or `prompter show` to verify the change ID before archiving"
73
+ },
74
+ {
75
+ "name": "Uses correct archive command with --yes",
76
+ "description": "Output includes `prompter archive add-webhook-notifications --yes` (or similar with the correct change ID and --yes flag)"
77
+ },
78
+ {
79
+ "name": "Runs post-archive validation",
80
+ "description": "Output mentions running `prompter validate --strict` after archiving to confirm specs are consistent"
81
+ },
82
+ {
83
+ "name": "Does not archive blindly without ID check",
84
+ "description": "Output shows the agent verifying or confirming the change ID rather than immediately running the archive command"
85
+ }
86
+ ]
87
+ }
88
+ ]
89
+ }
package/src/cli/index.ts CHANGED
@@ -18,7 +18,7 @@ const program = new Command();
18
18
  program
19
19
  .name('prompter')
20
20
  .description('Enhance prompts directly in your AI coding workflow')
21
- .version('0.8.5');
21
+ .version('0.8.7');
22
22
 
23
23
  program
24
24
  .command('init')