@anhth2/spec-driven-dev-plugin 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +285 -11
- package/commands/debug.md +233 -11
- package/commands/debug.tmpl +170 -6
- package/commands/define-product.md +68 -6
- package/commands/define-product.tmpl +5 -1
- package/commands/fix-bug.md +111 -11
- package/commands/fix-bug.tmpl +48 -6
- package/commands/generate-bdd.md +86 -9
- package/commands/generate-bdd.tmpl +23 -4
- package/commands/generate-code.md +146 -19
- package/commands/generate-code.tmpl +83 -14
- package/commands/generate-design-spec.md +754 -0
- package/commands/generate-design-spec.tmpl +399 -0
- package/commands/generate-prd.md +91 -7
- package/commands/generate-prd.tmpl +28 -2
- package/commands/generate-spec-manifest.md +519 -0
- package/commands/generate-spec-manifest.tmpl +164 -0
- package/commands/generate-tech-docs.md +122 -9
- package/commands/generate-tech-docs.tmpl +59 -4
- package/commands/generate-tests.md +491 -37
- package/commands/generate-tests.tmpl +428 -32
- package/commands/refine-prd.md +76 -8
- package/commands/refine-prd.tmpl +13 -3
- package/commands/review-code.md +94 -6
- package/commands/review-code.tmpl +31 -1
- package/commands/review-context.md +118 -12
- package/commands/review-context.tmpl +55 -7
- package/commands/review-tech-docs.md +76 -9
- package/commands/review-tech-docs.tmpl +13 -4
- package/commands/run-tests.md +196 -18
- package/commands/run-tests.tmpl +133 -13
- package/commands/setup-ai-first.md +192 -6
- package/commands/setup-ai-first.tmpl +136 -5
- package/commands/smoke-test.md +228 -22
- package/commands/smoke-test.tmpl +165 -17
- package/commands/validate-traces.md +77 -8
- package/commands/validate-traces.tmpl +14 -3
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +233 -11
- package/core/commands/define-product.md +68 -6
- package/core/commands/fix-bug.md +111 -11
- package/core/commands/generate-bdd.md +86 -9
- package/core/commands/generate-code.md +146 -19
- package/core/commands/generate-design-spec.md +754 -0
- package/core/commands/generate-prd.md +91 -7
- package/core/commands/generate-spec-manifest.md +519 -0
- package/core/commands/generate-tech-docs.md +122 -9
- package/core/commands/generate-tests.md +491 -37
- package/core/commands/refine-prd.md +76 -8
- package/core/commands/review-code.md +94 -6
- package/core/commands/review-context.md +118 -12
- package/core/commands/review-tech-docs.md +76 -9
- package/core/commands/run-tests.md +196 -18
- package/core/commands/setup-ai-first.md +192 -6
- package/core/commands/smoke-test.md +228 -22
- package/core/commands/validate-traces.md +77 -8
- package/core/skills/code/SKILL.md +68 -8
- package/core/skills/debug/SKILL.md +72 -10
- package/core/skills/design-spec/SKILL.md +450 -0
- package/core/skills/discovery/SKILL.md +62 -4
- package/core/skills/prd/SKILL.md +12 -8
- package/core/skills/setup-ai-first/SKILL.md +5 -3
- package/core/skills/spec/SKILL.md +11 -7
- package/core/skills/test/SKILL.md +130 -12
- package/core/steps/context-loader.md +57 -1
- package/core/steps/gate.md +1 -1
- package/core/steps/report-footer.md +5 -3
- package/core/steps/spawn-agent.md +3 -1
- package/core/templates/design-spec.template.md +209 -0
- package/core/templates/project-context.yaml +29 -0
- package/package.json +1 -1
- package/skills/code/SKILL.md +68 -8
- package/skills/debug/SKILL.md +72 -10
- package/skills/design-spec/SKILL.md +450 -0
- package/skills/design-spec/SKILL.tmpl +95 -0
- package/skills/discovery/SKILL.md +62 -4
- package/skills/prd/SKILL.md +12 -8
- package/skills/setup-ai-first/SKILL.md +5 -3
- package/skills/spec/SKILL.md +11 -7
- package/skills/test/SKILL.md +130 -12
- package/steps/context-loader.md +57 -1
- package/steps/gate.md +1 -1
- package/steps/report-footer.md +5 -3
- package/steps/spawn-agent.md +3 -1
- package/templates/design-spec.template.md +209 -0
- package/templates/project-context.yaml +29 -0
package/commands/smoke-test.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# /smoke-test — Test Live
|
|
1
|
+
# /smoke-test — Smoke Test Live Service or App
|
|
2
2
|
|
|
3
|
-
Use when service is **already running**. Different from `/run-tests` (no live server needed).
|
|
3
|
+
Use when service/app is **already running**. Different from `/run-tests` (no live server needed).
|
|
4
4
|
|
|
5
5
|
## Gate
|
|
6
6
|
# Gate — Universal Entry Procedure
|
|
@@ -33,7 +33,7 @@ Display and wait for response:
|
|
|
33
33
|
```
|
|
34
34
|
⚙️ MODEL CHECK
|
|
35
35
|
──────────────────────────────────────────────────────────────────
|
|
36
|
-
Recommended : claude-opus-4
|
|
36
|
+
Recommended : claude-opus-4 (or latest Opus model)
|
|
37
37
|
Why needed : Spec analysis, architecture review, code generation
|
|
38
38
|
require deep reasoning. Smaller models miss edge cases.
|
|
39
39
|
|
|
@@ -86,7 +86,7 @@ Wait for explicit "Y" or "N" from the user before continuing.
|
|
|
86
86
|
- "N" → stop and ask what the user wants to change.
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
*Note: For this command, the target in Step 1 is a UC-ID from `$ARGUMENTS`. Context loading provides `conventions.service_run
|
|
89
|
+
*Note: For this command, the target in Step 1 is a UC-ID from `$ARGUMENTS`. Context loading provides `conventions.service_run`, port information, and `tech_stack.module`.*
|
|
90
90
|
|
|
91
91
|
## Context
|
|
92
92
|
# Context Loader — Load All Project Context
|
|
@@ -133,6 +133,7 @@ Read `.agent/project-context.yaml`. Extract and store:
|
|
|
133
133
|
- `paths.core_entities` → path to core-entities.md
|
|
134
134
|
- `paths.tech_docs_dir` → technical documentation root
|
|
135
135
|
- `paths.trace_dir` → trace state directory
|
|
136
|
+
- `paths.design_spec_dir` → Design Spec documents root (FE/App only)
|
|
136
137
|
|
|
137
138
|
If `paths` section is absent, use these defaults:
|
|
138
139
|
- `specs_dir` = `specs/bdd`
|
|
@@ -142,13 +143,46 @@ If `paths` section is absent, use these defaults:
|
|
|
142
143
|
- `domain_knowledge_dir` = `specs/domain-knowledge`
|
|
143
144
|
- `business_dictionary` = `specs/domain-knowledge/business-dictionary.md`
|
|
144
145
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
145
|
-
- `tech_docs_dir` = `tech-docs`
|
|
146
|
+
- `tech_docs_dir` = `specs/tech-docs`
|
|
146
147
|
- `trace_dir` = `.trace`
|
|
148
|
+
- `design_spec_dir` = `specs/design-spec`
|
|
147
149
|
|
|
148
150
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
149
151
|
|
|
150
152
|
---
|
|
151
153
|
|
|
154
|
+
## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
|
|
155
|
+
|
|
156
|
+
*Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
|
|
157
|
+
|
|
158
|
+
If `services` section is present:
|
|
159
|
+
|
|
160
|
+
**1. Detect active domain** (in priority order):
|
|
161
|
+
- Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
|
|
162
|
+
- Extract from target file path: segment immediately after `prd_dir` base path
|
|
163
|
+
*(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
|
|
164
|
+
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
165
|
+
|
|
166
|
+
**2. Route to service** — if active domain matches a key in `services`:
|
|
167
|
+
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
168
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
169
|
+
- Store `active_service` = `services.{domain}.path`
|
|
170
|
+
- Store `active_service_module` = `services.{domain}.module`
|
|
171
|
+
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
172
|
+
|
|
173
|
+
**3. Fallback** — if domain not detected or no matching service key:
|
|
174
|
+
- Keep default paths from Step 1
|
|
175
|
+
- Set `active_service = unresolved`
|
|
176
|
+
|
|
177
|
+
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
178
|
+
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
179
|
+
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
180
|
+
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
181
|
+
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
182
|
+
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
152
186
|
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
153
187
|
|
|
154
188
|
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
@@ -219,6 +253,26 @@ If the file does not exist → skip silently.
|
|
|
219
253
|
|
|
220
254
|
---
|
|
221
255
|
|
|
256
|
+
## Step 6.5 — [PLATFORM] Derive active_module and platform_type
|
|
257
|
+
|
|
258
|
+
Using `tech_stack.module` loaded in Step 1, derive and store two variables for use by all downstream commands:
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
active_module = tech_stack.module (e.g. "java-spring", "react", "flutter")
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
| `platform_type` | Modules |
|
|
265
|
+
|---|---|
|
|
266
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
267
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
268
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
269
|
+
|
|
270
|
+
If `tech_stack.module` is blank or not recognized → set `platform_type = "unknown"` and flag as ⚠️ in the Step 7 recap.
|
|
271
|
+
|
|
272
|
+
These two variables (`active_module`, `platform_type`) are the canonical source for all branching logic in commands that need platform-specific behavior (generate-tests, debug, fix-bug, smoke-test).
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
222
276
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
223
277
|
|
|
224
278
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -229,10 +283,12 @@ Output exactly this block:
|
|
|
229
283
|
```
|
|
230
284
|
[CTX LOADED]
|
|
231
285
|
Stack : {language} / {framework} / {database}
|
|
286
|
+
Platform : {active_module} ({platform_type})
|
|
232
287
|
Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Service → Repository}
|
|
233
288
|
Ticket : {ticket_prefix}-
|
|
234
289
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
235
290
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
291
|
+
Service : {active_service} ({active_service_module}) | single-service
|
|
236
292
|
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
237
293
|
```
|
|
238
294
|
|
|
@@ -256,19 +312,40 @@ Proceed to the next step of the calling command.
|
|
|
256
312
|
|
|
257
313
|
---
|
|
258
314
|
|
|
259
|
-
##
|
|
315
|
+
## Service Detection
|
|
316
|
+
|
|
317
|
+
Read `active_module` from context. Use to select the correct smoke-test approach.
|
|
318
|
+
|
|
319
|
+
| Platform | Modules |
|
|
320
|
+
|---|---|
|
|
321
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
322
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
323
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## If `platform_type = backend`
|
|
328
|
+
|
|
329
|
+
### Phase 1 — Verify service is running
|
|
330
|
+
|
|
260
331
|
Read `conventions.service_run` from project-context.yaml to determine port.
|
|
332
|
+
|
|
261
333
|
```bash
|
|
262
|
-
|
|
334
|
+
# Try common health endpoints (use whichever applies):
|
|
335
|
+
curl -s http://localhost:{port}/health # generic / Go / Node
|
|
336
|
+
curl -s http://localhost:{port}/actuator/health # Spring Boot
|
|
337
|
+
curl -s http://localhost:{port}/ping # some frameworks
|
|
263
338
|
```
|
|
264
|
-
If not running: "Start with `{conventions.service_run}` from project root."
|
|
265
339
|
|
|
266
|
-
|
|
267
|
-
|
|
340
|
+
If not running → "Start with `{conventions.service_run}` from project root."
|
|
341
|
+
|
|
342
|
+
### Phase 2 — Identify endpoints
|
|
343
|
+
|
|
344
|
+
From UC-ID → find controller/handler with `@trace.implements={UC-ID}`.
|
|
268
345
|
List: method, path, required auth/role.
|
|
269
346
|
|
|
270
|
-
|
|
271
|
-
|
|
347
|
+
### Phase 3 — Get auth token (if needed)
|
|
348
|
+
|
|
272
349
|
```
|
|
273
350
|
Endpoint requires auth. Options:
|
|
274
351
|
1. Paste Bearer token (from Postman/DevTools)
|
|
@@ -276,10 +353,11 @@ Endpoint requires auth. Options:
|
|
|
276
353
|
3. Skip — test public endpoints only
|
|
277
354
|
```
|
|
278
355
|
|
|
279
|
-
|
|
356
|
+
### Phase 4 — Run
|
|
357
|
+
|
|
280
358
|
```bash
|
|
281
359
|
# GET
|
|
282
|
-
curl -s -X GET "http://localhost:{port}/v1/{resource}
|
|
360
|
+
curl -s -X GET "http://localhost:{port}/v1/{resource}" \
|
|
283
361
|
-H "Authorization: Bearer {token}" | {JSON_FORMATTER}
|
|
284
362
|
|
|
285
363
|
# POST
|
|
@@ -289,7 +367,6 @@ curl -s -X POST "http://localhost:{port}/v1/{resource}" \
|
|
|
289
367
|
-d '{"field1": "test_value"}'
|
|
290
368
|
```
|
|
291
369
|
|
|
292
|
-
## Interpret Results
|
|
293
370
|
| Result | Meaning |
|
|
294
371
|
|--------|---------|
|
|
295
372
|
| 200/201 + correct data | ✅ OK |
|
|
@@ -297,9 +374,131 @@ curl -s -X POST "http://localhost:{port}/v1/{resource}" \
|
|
|
297
374
|
| 400 | Wrong request body → check required fields |
|
|
298
375
|
| 401 | Token expired or wrong config |
|
|
299
376
|
| 403 | Wrong role → check auth rules |
|
|
300
|
-
| 500 | Server error →
|
|
377
|
+
| 500 | Server error → /debug |
|
|
301
378
|
| Connection refused | Service not running |
|
|
302
379
|
|
|
380
|
+
### If `active_module = context-engineering`
|
|
381
|
+
|
|
382
|
+
#### Phase 1 — Verify pipeline entry point is reachable
|
|
383
|
+
|
|
384
|
+
Run the prompt function directly with a minimal valid input:
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
# Python (pytest / script):
|
|
388
|
+
python -c "from {module}.{function} import {function}; print({function}(input='{test_input}'))"
|
|
389
|
+
|
|
390
|
+
# Or using the project test command with a smoke marker:
|
|
391
|
+
{conventions.test_command} -m smoke -v
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
#### Phase 2 — Verify output structure
|
|
395
|
+
|
|
396
|
+
Check the output conforms to the expected schema:
|
|
397
|
+
|
|
398
|
+
```
|
|
399
|
+
Expected output schema: {output fields from @trace or tech-doc}
|
|
400
|
+
Actual output: {paste output here}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
#### Phase 3 — Interpret results
|
|
404
|
+
|
|
405
|
+
| Result | Meaning |
|
|
406
|
+
|--------|---------|
|
|
407
|
+
| Output matches schema | ✅ OK |
|
|
408
|
+
| Output present but wrong format | ⚠️ Logic bug → /debug |
|
|
409
|
+
| `APIError` / `AuthenticationError` | API key invalid or service unavailable |
|
|
410
|
+
| `TokenLimitError` | Input too long — check prompt template size |
|
|
411
|
+
| Exception / traceback | Code error → /debug |
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## If `platform_type = web-frontend`
|
|
416
|
+
|
|
417
|
+
### Phase 1 — Verify dev server is running
|
|
418
|
+
|
|
419
|
+
```bash
|
|
420
|
+
# Linux / macOS:
|
|
421
|
+
curl -s -o /dev/null -w "%{http_code}" http://localhost:{port}
|
|
422
|
+
|
|
423
|
+
# Windows (cmd / PowerShell):
|
|
424
|
+
curl -s -o NUL -w "%{http_code}" http://localhost:{port}
|
|
425
|
+
|
|
426
|
+
# Should return 200. If not: start with {conventions.service_run} (e.g., npm run dev)
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Phase 2 — Run E2E smoke test
|
|
430
|
+
|
|
431
|
+
Identify E2E tool in the project (Playwright or Cypress):
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
# Playwright — run scenarios tagged with this UC:
|
|
435
|
+
npx playwright test --grep "{UC-ID}"
|
|
436
|
+
|
|
437
|
+
# Cypress:
|
|
438
|
+
npx cypress run --spec "cypress/e2e/{UC-ID}*"
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
If no E2E tests exist yet → open browser and manually verify:
|
|
442
|
+
1. Navigate to the route for this UC
|
|
443
|
+
2. Perform the main user action
|
|
444
|
+
3. Confirm the expected outcome is visible
|
|
445
|
+
|
|
446
|
+
### Phase 3 — Interpret results
|
|
447
|
+
|
|
448
|
+
| Result | Meaning |
|
|
449
|
+
|--------|---------|
|
|
450
|
+
| All E2E tests pass | ✅ OK |
|
|
451
|
+
| Assertion failed | ⚠️ Logic bug → /debug |
|
|
452
|
+
| `ERR_CONNECTION_REFUSED` | Dev server not running |
|
|
453
|
+
| API returns 4xx/5xx | Backend issue → check backend service |
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## If `platform_type = mobile`
|
|
458
|
+
|
|
459
|
+
### Phase 1 — Verify device/emulator is ready
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
# Flutter:
|
|
463
|
+
flutter devices # list connected devices/emulators
|
|
464
|
+
flutter install # install current build on device
|
|
465
|
+
|
|
466
|
+
# React Native:
|
|
467
|
+
npx react-native run-android # build + install on connected Android
|
|
468
|
+
npx react-native run-ios # build + install on iOS simulator
|
|
469
|
+
|
|
470
|
+
# Android (Compose):
|
|
471
|
+
./gradlew installDebug # install APK on connected device/emulator
|
|
472
|
+
|
|
473
|
+
# iOS (SwiftUI):
|
|
474
|
+
# Open Xcode → select simulator → Product → Run
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
### Phase 2 — Manual smoke-test checklist
|
|
478
|
+
|
|
479
|
+
For the UC under test, verify on device:
|
|
480
|
+
1. Navigate to the screen for this UC
|
|
481
|
+
2. Perform the main action from the `.feature` Scenario (`When` step)
|
|
482
|
+
3. Confirm the expected outcome is visible (`Then` step)
|
|
483
|
+
4. Check for any crash or unexpected error dialog
|
|
484
|
+
|
|
485
|
+
### Phase 3 — Capture issues if found
|
|
486
|
+
|
|
487
|
+
```bash
|
|
488
|
+
# Flutter:
|
|
489
|
+
flutter logs
|
|
490
|
+
|
|
491
|
+
# Android:
|
|
492
|
+
adb logcat -d | grep -i "error\|exception\|crash"
|
|
493
|
+
|
|
494
|
+
# iOS:
|
|
495
|
+
# Copy crash log from Xcode → Devices and Simulators → View Device Logs
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
Paste output into `/debug`.
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
303
502
|
## Output
|
|
304
503
|
|
|
305
504
|
# Report Footer — Standard Command Output Format
|
|
@@ -330,21 +529,23 @@ Suggest the logical next command based on workflow phase:
|
|
|
330
529
|
|
|
331
530
|
| Current command | Suggest next |
|
|
332
531
|
|-------------------------|-----------------------------------------------|
|
|
532
|
+
| /setup-ai-first | `/define-product` to start your first feature |
|
|
333
533
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
334
534
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
335
535
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
336
|
-
| /review-context (PRD) | `/generate-
|
|
536
|
+
| /review-context (PRD) | FE/App: `/generate-design-spec {prd-file}` (then BDD after sign-off); BE: `/generate-bdd {prd-file}` directly; fix PRD if NEEDS_FIX |
|
|
537
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
337
538
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
338
539
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
339
540
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
340
541
|
| /review-tech-docs | `/generate-code {feature-file}` if APPROVED; fix doc if NEEDS_FIX |
|
|
341
|
-
| /generate-code | `/generate-tests {UC-ID}`
|
|
542
|
+
| /generate-code | First gen → `/review-code {UC-ID}`; re-gen → `/generate-tests {UC-ID}` |
|
|
342
543
|
| /generate-tests | `/run-tests {UC-ID}` |
|
|
343
544
|
| /run-tests (passing) | `/review-code {UC-ID}` |
|
|
344
545
|
| /run-tests (failing) | `/fix-bug {ticket-id}` or `/debug {error}` |
|
|
345
546
|
| /review-code | `/smoke-test {UC-ID}` or create PR |
|
|
346
547
|
| /smoke-test | Create PR and link to ticket |
|
|
347
|
-
| /validate-traces | `/generate-code {UC-ID}
|
|
548
|
+
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
348
549
|
| /fix-bug | Create PR and link to ticket |
|
|
349
550
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
350
551
|
|
|
@@ -359,8 +560,13 @@ Next : {suggested command with example arguments}
|
|
|
359
560
|
|
|
360
561
|
```
|
|
361
562
|
/smoke-test Report — {UC-ID}
|
|
362
|
-
|
|
363
|
-
|
|
563
|
+
Platform: {backend | web-frontend | mobile}
|
|
564
|
+
| Endpoint / Flow | Status | Result |
|
|
565
|
+
|-----------------------|-------------|---------|
|
|
566
|
+
| {method} {path/screen}| ✅/⚠️/❌ | {notes} |
|
|
567
|
+
|
|
568
|
+
Status legend: ✅ = OK | ⚠️ = Responded but wrong data / logic bug | ❌ = Error / not running
|
|
569
|
+
|
|
364
570
|
Issues: {describe any failures}
|
|
365
|
-
Next: /debug
|
|
571
|
+
Next: /debug (paste error interactively) OR /fix-bug {TICKET_ID} OR ready to PR
|
|
366
572
|
```
|
package/commands/smoke-test.tmpl
CHANGED
|
@@ -1,30 +1,51 @@
|
|
|
1
|
-
# /smoke-test — Test Live
|
|
1
|
+
# /smoke-test — Smoke Test Live Service or App
|
|
2
2
|
|
|
3
|
-
Use when service is **already running**. Different from `/run-tests` (no live server needed).
|
|
3
|
+
Use when service/app is **already running**. Different from `/run-tests` (no live server needed).
|
|
4
4
|
|
|
5
5
|
## Gate
|
|
6
6
|
{{include:steps/gate.md}}
|
|
7
7
|
|
|
8
|
-
*Note: For this command, the target in Step 1 is a UC-ID from `$ARGUMENTS`. Context loading provides `conventions.service_run
|
|
8
|
+
*Note: For this command, the target in Step 1 is a UC-ID from `$ARGUMENTS`. Context loading provides `conventions.service_run`, port information, and `tech_stack.module`.*
|
|
9
9
|
|
|
10
10
|
## Context
|
|
11
11
|
{{include:steps/context-loader.md}}
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Service Detection
|
|
16
|
+
|
|
17
|
+
Read `active_module` from context. Use to select the correct smoke-test approach.
|
|
18
|
+
|
|
19
|
+
| Platform | Modules |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `backend` | `java-spring`, `golang`, `dotnet`, `php-laravel`, `context-engineering` |
|
|
22
|
+
| `web-frontend` | `react`, `nextjs`, `vue`, `nuxt`, `angular` |
|
|
23
|
+
| `mobile` | `flutter`, `react-native`, `ios-swiftui`, `android-compose` |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## If `platform_type = backend`
|
|
28
|
+
|
|
29
|
+
### Phase 1 — Verify service is running
|
|
30
|
+
|
|
16
31
|
Read `conventions.service_run` from project-context.yaml to determine port.
|
|
32
|
+
|
|
17
33
|
```bash
|
|
18
|
-
|
|
34
|
+
# Try common health endpoints (use whichever applies):
|
|
35
|
+
curl -s http://localhost:{port}/health # generic / Go / Node
|
|
36
|
+
curl -s http://localhost:{port}/actuator/health # Spring Boot
|
|
37
|
+
curl -s http://localhost:{port}/ping # some frameworks
|
|
19
38
|
```
|
|
20
|
-
If not running: "Start with `{conventions.service_run}` from project root."
|
|
21
39
|
|
|
22
|
-
|
|
23
|
-
|
|
40
|
+
If not running → "Start with `{conventions.service_run}` from project root."
|
|
41
|
+
|
|
42
|
+
### Phase 2 — Identify endpoints
|
|
43
|
+
|
|
44
|
+
From UC-ID → find controller/handler with `@trace.implements={UC-ID}`.
|
|
24
45
|
List: method, path, required auth/role.
|
|
25
46
|
|
|
26
|
-
|
|
27
|
-
|
|
47
|
+
### Phase 3 — Get auth token (if needed)
|
|
48
|
+
|
|
28
49
|
```
|
|
29
50
|
Endpoint requires auth. Options:
|
|
30
51
|
1. Paste Bearer token (from Postman/DevTools)
|
|
@@ -32,10 +53,11 @@ Endpoint requires auth. Options:
|
|
|
32
53
|
3. Skip — test public endpoints only
|
|
33
54
|
```
|
|
34
55
|
|
|
35
|
-
|
|
56
|
+
### Phase 4 — Run
|
|
57
|
+
|
|
36
58
|
```bash
|
|
37
59
|
# GET
|
|
38
|
-
curl -s -X GET "http://localhost:{port}/v1/{resource}
|
|
60
|
+
curl -s -X GET "http://localhost:{port}/v1/{resource}" \
|
|
39
61
|
-H "Authorization: Bearer {token}" | {JSON_FORMATTER}
|
|
40
62
|
|
|
41
63
|
# POST
|
|
@@ -45,7 +67,6 @@ curl -s -X POST "http://localhost:{port}/v1/{resource}" \
|
|
|
45
67
|
-d '{"field1": "test_value"}'
|
|
46
68
|
```
|
|
47
69
|
|
|
48
|
-
## Interpret Results
|
|
49
70
|
| Result | Meaning |
|
|
50
71
|
|--------|---------|
|
|
51
72
|
| 200/201 + correct data | ✅ OK |
|
|
@@ -53,17 +74,144 @@ curl -s -X POST "http://localhost:{port}/v1/{resource}" \
|
|
|
53
74
|
| 400 | Wrong request body → check required fields |
|
|
54
75
|
| 401 | Token expired or wrong config |
|
|
55
76
|
| 403 | Wrong role → check auth rules |
|
|
56
|
-
| 500 | Server error →
|
|
77
|
+
| 500 | Server error → /debug |
|
|
57
78
|
| Connection refused | Service not running |
|
|
58
79
|
|
|
80
|
+
### If `active_module = context-engineering`
|
|
81
|
+
|
|
82
|
+
#### Phase 1 — Verify pipeline entry point is reachable
|
|
83
|
+
|
|
84
|
+
Run the prompt function directly with a minimal valid input:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Python (pytest / script):
|
|
88
|
+
python -c "from {module}.{function} import {function}; print({function}(input='{test_input}'))"
|
|
89
|
+
|
|
90
|
+
# Or using the project test command with a smoke marker:
|
|
91
|
+
{conventions.test_command} -m smoke -v
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### Phase 2 — Verify output structure
|
|
95
|
+
|
|
96
|
+
Check the output conforms to the expected schema:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
Expected output schema: {output fields from @trace or tech-doc}
|
|
100
|
+
Actual output: {paste output here}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### Phase 3 — Interpret results
|
|
104
|
+
|
|
105
|
+
| Result | Meaning |
|
|
106
|
+
|--------|---------|
|
|
107
|
+
| Output matches schema | ✅ OK |
|
|
108
|
+
| Output present but wrong format | ⚠️ Logic bug → /debug |
|
|
109
|
+
| `APIError` / `AuthenticationError` | API key invalid or service unavailable |
|
|
110
|
+
| `TokenLimitError` | Input too long — check prompt template size |
|
|
111
|
+
| Exception / traceback | Code error → /debug |
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## If `platform_type = web-frontend`
|
|
116
|
+
|
|
117
|
+
### Phase 1 — Verify dev server is running
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Linux / macOS:
|
|
121
|
+
curl -s -o /dev/null -w "%{http_code}" http://localhost:{port}
|
|
122
|
+
|
|
123
|
+
# Windows (cmd / PowerShell):
|
|
124
|
+
curl -s -o NUL -w "%{http_code}" http://localhost:{port}
|
|
125
|
+
|
|
126
|
+
# Should return 200. If not: start with {conventions.service_run} (e.g., npm run dev)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Phase 2 — Run E2E smoke test
|
|
130
|
+
|
|
131
|
+
Identify E2E tool in the project (Playwright or Cypress):
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Playwright — run scenarios tagged with this UC:
|
|
135
|
+
npx playwright test --grep "{UC-ID}"
|
|
136
|
+
|
|
137
|
+
# Cypress:
|
|
138
|
+
npx cypress run --spec "cypress/e2e/{UC-ID}*"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
If no E2E tests exist yet → open browser and manually verify:
|
|
142
|
+
1. Navigate to the route for this UC
|
|
143
|
+
2. Perform the main user action
|
|
144
|
+
3. Confirm the expected outcome is visible
|
|
145
|
+
|
|
146
|
+
### Phase 3 — Interpret results
|
|
147
|
+
|
|
148
|
+
| Result | Meaning |
|
|
149
|
+
|--------|---------|
|
|
150
|
+
| All E2E tests pass | ✅ OK |
|
|
151
|
+
| Assertion failed | ⚠️ Logic bug → /debug |
|
|
152
|
+
| `ERR_CONNECTION_REFUSED` | Dev server not running |
|
|
153
|
+
| API returns 4xx/5xx | Backend issue → check backend service |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## If `platform_type = mobile`
|
|
158
|
+
|
|
159
|
+
### Phase 1 — Verify device/emulator is ready
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Flutter:
|
|
163
|
+
flutter devices # list connected devices/emulators
|
|
164
|
+
flutter install # install current build on device
|
|
165
|
+
|
|
166
|
+
# React Native:
|
|
167
|
+
npx react-native run-android # build + install on connected Android
|
|
168
|
+
npx react-native run-ios # build + install on iOS simulator
|
|
169
|
+
|
|
170
|
+
# Android (Compose):
|
|
171
|
+
./gradlew installDebug # install APK on connected device/emulator
|
|
172
|
+
|
|
173
|
+
# iOS (SwiftUI):
|
|
174
|
+
# Open Xcode → select simulator → Product → Run
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Phase 2 — Manual smoke-test checklist
|
|
178
|
+
|
|
179
|
+
For the UC under test, verify on device:
|
|
180
|
+
1. Navigate to the screen for this UC
|
|
181
|
+
2. Perform the main action from the `.feature` Scenario (`When` step)
|
|
182
|
+
3. Confirm the expected outcome is visible (`Then` step)
|
|
183
|
+
4. Check for any crash or unexpected error dialog
|
|
184
|
+
|
|
185
|
+
### Phase 3 — Capture issues if found
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Flutter:
|
|
189
|
+
flutter logs
|
|
190
|
+
|
|
191
|
+
# Android:
|
|
192
|
+
adb logcat -d | grep -i "error\|exception\|crash"
|
|
193
|
+
|
|
194
|
+
# iOS:
|
|
195
|
+
# Copy crash log from Xcode → Devices and Simulators → View Device Logs
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Paste output into `/debug`.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
59
202
|
## Output
|
|
60
203
|
|
|
61
204
|
{{include:steps/report-footer.md}}
|
|
62
205
|
|
|
63
206
|
```
|
|
64
207
|
/smoke-test Report — {UC-ID}
|
|
65
|
-
|
|
66
|
-
|
|
208
|
+
Platform: {backend | web-frontend | mobile}
|
|
209
|
+
| Endpoint / Flow | Status | Result |
|
|
210
|
+
|-----------------------|-------------|---------|
|
|
211
|
+
| {method} {path/screen}| ✅/⚠️/❌ | {notes} |
|
|
212
|
+
|
|
213
|
+
Status legend: ✅ = OK | ⚠️ = Responded but wrong data / logic bug | ❌ = Error / not running
|
|
214
|
+
|
|
67
215
|
Issues: {describe any failures}
|
|
68
|
-
Next: /debug
|
|
216
|
+
Next: /debug (paste error interactively) OR /fix-bug {TICKET_ID} OR ready to PR
|
|
69
217
|
```
|