@anhth2/spec-driven-dev-plugin 0.7.0 → 0.9.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/ARCHITECTURE.md +6 -2
- package/bin/index.js +105 -0
- package/commands/debug.md +189 -1
- package/commands/debug.tmpl +16 -0
- package/commands/define-product.md +94 -1
- package/commands/fix-bug.md +190 -1
- package/commands/fix-bug.tmpl +17 -0
- package/commands/generate-bdd.md +314 -14
- package/commands/generate-bdd.tmpl +220 -13
- package/commands/generate-code.md +191 -3
- package/commands/generate-code.tmpl +97 -2
- package/commands/generate-design-spec.md +811 -0
- package/commands/generate-design-spec.tmpl +399 -0
- package/commands/generate-prd.md +133 -1
- package/commands/generate-prd.tmpl +39 -0
- package/commands/generate-spec-manifest.md +576 -0
- package/commands/generate-spec-manifest.tmpl +164 -0
- package/commands/generate-tech-docs.md +116 -2
- package/commands/generate-tech-docs.tmpl +22 -1
- package/commands/generate-tests.md +94 -1
- package/commands/learn.md +554 -0
- package/commands/learn.tmpl +63 -0
- package/commands/propose-scenario.md +521 -0
- package/commands/propose-scenario.tmpl +109 -0
- package/commands/refine-prd.md +94 -1
- package/commands/report-bug.md +543 -0
- package/commands/report-bug.tmpl +131 -0
- package/commands/review-code.md +190 -1
- package/commands/review-code.tmpl +17 -0
- package/commands/review-context.md +134 -1
- package/commands/review-context.tmpl +40 -0
- package/commands/review-tech-docs.md +176 -5
- package/commands/review-tech-docs.tmpl +82 -4
- package/commands/run-tests.md +119 -1
- package/commands/run-tests.tmpl +25 -0
- package/commands/setup-ai-first.md +142 -4
- package/commands/setup-ai-first.tmpl +135 -3
- package/commands/smoke-test.md +94 -1
- package/commands/sync.md +405 -0
- package/commands/sync.tmpl +345 -0
- package/commands/update-framework.md +211 -0
- package/commands/update-framework.tmpl +151 -0
- package/commands/validate-traces.md +152 -3
- package/commands/validate-traces.tmpl +58 -2
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/commands/debug.md +189 -1
- package/core/commands/define-product.md +94 -1
- package/core/commands/fix-bug.md +190 -1
- package/core/commands/generate-bdd.md +314 -14
- package/core/commands/generate-code.md +191 -3
- package/core/commands/generate-design-spec.md +811 -0
- package/core/commands/generate-prd.md +133 -1
- package/core/commands/generate-spec-manifest.md +576 -0
- package/core/commands/generate-tech-docs.md +116 -2
- package/core/commands/generate-tests.md +94 -1
- package/core/commands/learn.md +554 -0
- package/core/commands/propose-scenario.md +521 -0
- package/core/commands/refine-prd.md +94 -1
- package/core/commands/report-bug.md +543 -0
- package/core/commands/review-code.md +190 -1
- package/core/commands/review-context.md +134 -1
- package/core/commands/review-tech-docs.md +176 -5
- package/core/commands/run-tests.md +119 -1
- package/core/commands/setup-ai-first.md +142 -4
- package/core/commands/smoke-test.md +94 -1
- package/core/commands/sync.md +405 -0
- package/core/commands/update-framework.md +211 -0
- package/core/commands/validate-traces.md +152 -3
- package/core/skills/code/SKILL.md +101 -2
- package/core/skills/debug/SKILL.md +108 -3
- package/core/skills/design-spec/SKILL.md +507 -0
- package/core/skills/discovery/SKILL.md +94 -1
- package/core/skills/prd/SKILL.md +14 -2
- package/core/skills/setup-ai-first/SKILL.md +7 -1
- package/core/skills/spec/SKILL.md +14 -2
- package/core/skills/test/SKILL.md +195 -3
- package/core/steps/capture-lesson.md +79 -0
- package/core/steps/context-loader.md +87 -0
- package/core/steps/report-footer.md +7 -1
- package/core/templates/design-spec.template.md +209 -0
- package/core/templates/project-context.yaml +40 -0
- package/package.json +1 -1
- package/skills/code/SKILL.md +101 -2
- package/skills/debug/SKILL.md +108 -3
- package/skills/design-spec/SKILL.md +507 -0
- package/skills/design-spec/SKILL.tmpl +95 -0
- package/skills/discovery/SKILL.md +94 -1
- package/skills/prd/SKILL.md +14 -2
- package/skills/setup-ai-first/SKILL.md +7 -1
- package/skills/spec/SKILL.md +14 -2
- package/skills/test/SKILL.md +195 -3
- package/steps/capture-lesson.md +79 -0
- package/steps/context-loader.md +87 -0
- package/steps/report-footer.md +7 -1
- package/templates/design-spec.template.md +209 -0
- package/templates/project-context.yaml +40 -0
package/core/skills/prd/SKILL.md
CHANGED
|
@@ -190,7 +190,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
190
190
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
191
191
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
192
192
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
193
|
-
| /review-context (PRD) | `/generate-
|
|
193
|
+
| /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 |
|
|
194
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
194
195
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
195
196
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
196
197
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -204,6 +205,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
204
205
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
205
206
|
| /fix-bug | Create PR and link to ticket |
|
|
206
207
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
208
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
209
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
210
|
+
| /learn | Continue working — lesson applies on next command |
|
|
211
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
212
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
207
213
|
|
|
208
214
|
Format the footer as:
|
|
209
215
|
```
|
|
@@ -433,7 +439,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
433
439
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
434
440
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
435
441
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
436
|
-
| /review-context (PRD) | `/generate-
|
|
442
|
+
| /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 |
|
|
443
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
437
444
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
438
445
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
439
446
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -447,6 +454,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
447
454
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
448
455
|
| /fix-bug | Create PR and link to ticket |
|
|
449
456
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
457
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
458
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
459
|
+
| /learn | Continue working — lesson applies on next command |
|
|
460
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
461
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
450
462
|
|
|
451
463
|
Format the footer as:
|
|
452
464
|
```
|
|
@@ -136,7 +136,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
136
136
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
137
137
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
138
138
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
139
|
-
| /review-context (PRD) | `/generate-
|
|
139
|
+
| /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 |
|
|
140
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
140
141
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
141
142
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
142
143
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -150,6 +151,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
150
151
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
151
152
|
| /fix-bug | Create PR and link to ticket |
|
|
152
153
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
154
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
155
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
156
|
+
| /learn | Continue working — lesson applies on next command |
|
|
157
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
158
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
153
159
|
|
|
154
160
|
Format the footer as:
|
|
155
161
|
```
|
|
@@ -207,7 +207,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
207
207
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
208
208
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
209
209
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
210
|
-
| /review-context (PRD) | `/generate-
|
|
210
|
+
| /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 |
|
|
211
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
211
212
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
212
213
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
213
214
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -221,6 +222,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
221
222
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
222
223
|
| /fix-bug | Create PR and link to ticket |
|
|
223
224
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
225
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
226
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
227
|
+
| /learn | Continue working — lesson applies on next command |
|
|
228
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
229
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
224
230
|
|
|
225
231
|
Format the footer as:
|
|
226
232
|
```
|
|
@@ -338,7 +344,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
338
344
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
339
345
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
340
346
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
341
|
-
| /review-context (PRD) | `/generate-
|
|
347
|
+
| /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 |
|
|
348
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
342
349
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
343
350
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
344
351
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -352,6 +359,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
352
359
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
353
360
|
| /fix-bug | Create PR and link to ticket |
|
|
354
361
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
362
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
363
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
364
|
+
| /learn | Continue working — lesson applies on next command |
|
|
365
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
366
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
355
367
|
|
|
356
368
|
Format the footer as:
|
|
357
369
|
```
|
|
@@ -250,7 +250,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
250
250
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
251
251
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
252
252
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
253
|
-
| /review-context (PRD) | `/generate-
|
|
253
|
+
| /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 |
|
|
254
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
254
255
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
255
256
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
256
257
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -264,6 +265,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
264
265
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
265
266
|
| /fix-bug | Create PR and link to ticket |
|
|
266
267
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
268
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
269
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
270
|
+
| /learn | Continue working — lesson applies on next command |
|
|
271
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
272
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
267
273
|
|
|
268
274
|
Format the footer as:
|
|
269
275
|
```
|
|
@@ -324,6 +330,7 @@ Read `.agent/project-context.yaml`. Extract and store:
|
|
|
324
330
|
- `paths.core_entities` → path to core-entities.md
|
|
325
331
|
- `paths.tech_docs_dir` → technical documentation root
|
|
326
332
|
- `paths.trace_dir` → trace state directory
|
|
333
|
+
- `paths.design_spec_dir` → Design Spec documents root (FE/App only)
|
|
327
334
|
|
|
328
335
|
If `paths` section is absent, use these defaults:
|
|
329
336
|
- `specs_dir` = `specs/bdd`
|
|
@@ -335,11 +342,75 @@ If `paths` section is absent, use these defaults:
|
|
|
335
342
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
336
343
|
- `tech_docs_dir` = `specs/tech-docs`
|
|
337
344
|
- `trace_dir` = `.trace`
|
|
345
|
+
- `design_spec_dir` = `specs/design-spec`
|
|
338
346
|
|
|
339
347
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
340
348
|
|
|
341
349
|
---
|
|
342
350
|
|
|
351
|
+
## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
|
|
352
|
+
|
|
353
|
+
*Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
|
|
354
|
+
|
|
355
|
+
If `services` section is present:
|
|
356
|
+
|
|
357
|
+
**1. Detect active domain** (in priority order):
|
|
358
|
+
- Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
|
|
359
|
+
- Extract from target file path: segment immediately after `prd_dir` base path
|
|
360
|
+
*(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
|
|
361
|
+
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
362
|
+
|
|
363
|
+
**2. Route to service** — if active domain matches a key in `services`:
|
|
364
|
+
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
365
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
366
|
+
- Store `active_service` = `services.{domain}.path`
|
|
367
|
+
- Store `active_service_module` = `services.{domain}.module`
|
|
368
|
+
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
369
|
+
|
|
370
|
+
**3. Fallback** — if domain not detected or no matching service key:
|
|
371
|
+
- Keep default paths from Step 1
|
|
372
|
+
- Set `active_service = unresolved`
|
|
373
|
+
|
|
374
|
+
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
375
|
+
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
376
|
+
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
377
|
+
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
378
|
+
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
379
|
+
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
380
|
+
- Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
|
|
381
|
+
- Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
|
|
382
|
+
|
|
383
|
+
> **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## Step 1.6 — [SERVICE CONVENTIONS] Load service-specific conventions (umbrella mode)
|
|
388
|
+
|
|
389
|
+
*Skip this step entirely if `active_service` is `"unresolved"` or context is single-service mode.*
|
|
390
|
+
|
|
391
|
+
When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-service/`):
|
|
392
|
+
|
|
393
|
+
**1. Locate service config** — try in priority order:
|
|
394
|
+
- `{active_service}/.agent/project-context.yaml`
|
|
395
|
+
- `{active_service}/project-context.yaml`
|
|
396
|
+
|
|
397
|
+
**2. If found, override with service-specific values:**
|
|
398
|
+
|
|
399
|
+
| Variable | Source |
|
|
400
|
+
|----------|--------|
|
|
401
|
+
| `conventions.test_command` | service's `conventions.test_command` |
|
|
402
|
+
| `conventions.build_command` | service's `conventions.build_command` |
|
|
403
|
+
| `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` — default: `{active_service}/.trace` |
|
|
404
|
+
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
405
|
+
|
|
406
|
+
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
407
|
+
- Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
|
|
408
|
+
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
409
|
+
|
|
410
|
+
**4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
343
414
|
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
344
415
|
|
|
345
416
|
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
@@ -430,6 +501,25 @@ These two variables (`active_module`, `platform_type`) are the canonical source
|
|
|
430
501
|
|
|
431
502
|
---
|
|
432
503
|
|
|
504
|
+
## Step 6.7 — [GUARDRAILS] Load Project Lessons (conditional)
|
|
505
|
+
|
|
506
|
+
*Accumulated mistakes the AI must not repeat in this project. These are added over time via `/learn`
|
|
507
|
+
or accepted during `/review-code`, `/fix-bug`, `/debug`.*
|
|
508
|
+
|
|
509
|
+
Resolve the lessons file path:
|
|
510
|
+
- Use `paths.lessons_file` if set (may be service-overridden in umbrella mode, Step 1.6)
|
|
511
|
+
- Else default `specs/domain-knowledge/lessons-learned.md`
|
|
512
|
+
- In umbrella/service mode (when `service_root` is set), if `paths.lessons_file` is unset, default to `{service_root}/.agent/project-lessons.md`
|
|
513
|
+
|
|
514
|
+
If the file exists, read it and store ALL lessons as **ACTIVE GUARDRAILS** for the session:
|
|
515
|
+
- Treat each lesson's **Rule** as a hard constraint — same priority as CLAUDE.md coding standards (Step 3).
|
|
516
|
+
- Before generating or modifying any artifact (PRD, BDD, tech-doc, code, test), check the output against every lesson whose `category` matches the current command AND whose `scope` matches the target (domain / file).
|
|
517
|
+
- If a generated output would violate a lesson → correct it **before** presenting, and note which lesson (`L-NNN`) was applied.
|
|
518
|
+
|
|
519
|
+
If the file does not exist → skip silently (no lessons captured yet).
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
|
|
433
523
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
434
524
|
|
|
435
525
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -445,6 +535,9 @@ Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Ser
|
|
|
445
535
|
Ticket : {ticket_prefix}-
|
|
446
536
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
447
537
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
538
|
+
Lessons : {loaded — N guardrails | none yet}
|
|
539
|
+
Service : {active_service} ({active_service_module}) | single-service
|
|
540
|
+
Svc Root : {service_root} — conventions + trace_dir loaded from service config | —
|
|
448
541
|
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
449
542
|
```
|
|
450
543
|
|
|
@@ -557,7 +650,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
557
650
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
558
651
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
559
652
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
560
|
-
| /review-context (PRD) | `/generate-
|
|
653
|
+
| /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 |
|
|
654
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
561
655
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
562
656
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
563
657
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -571,6 +665,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
571
665
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
572
666
|
| /fix-bug | Create PR and link to ticket |
|
|
573
667
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
668
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
669
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
670
|
+
| /learn | Continue working — lesson applies on next command |
|
|
671
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
672
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
574
673
|
|
|
575
674
|
Format the footer as:
|
|
576
675
|
```
|
|
@@ -634,6 +733,7 @@ Read `.agent/project-context.yaml`. Extract and store:
|
|
|
634
733
|
- `paths.core_entities` → path to core-entities.md
|
|
635
734
|
- `paths.tech_docs_dir` → technical documentation root
|
|
636
735
|
- `paths.trace_dir` → trace state directory
|
|
736
|
+
- `paths.design_spec_dir` → Design Spec documents root (FE/App only)
|
|
637
737
|
|
|
638
738
|
If `paths` section is absent, use these defaults:
|
|
639
739
|
- `specs_dir` = `specs/bdd`
|
|
@@ -645,11 +745,75 @@ If `paths` section is absent, use these defaults:
|
|
|
645
745
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
646
746
|
- `tech_docs_dir` = `specs/tech-docs`
|
|
647
747
|
- `trace_dir` = `.trace`
|
|
748
|
+
- `design_spec_dir` = `specs/design-spec`
|
|
648
749
|
|
|
649
750
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
650
751
|
|
|
651
752
|
---
|
|
652
753
|
|
|
754
|
+
## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
|
|
755
|
+
|
|
756
|
+
*Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
|
|
757
|
+
|
|
758
|
+
If `services` section is present:
|
|
759
|
+
|
|
760
|
+
**1. Detect active domain** (in priority order):
|
|
761
|
+
- Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
|
|
762
|
+
- Extract from target file path: segment immediately after `prd_dir` base path
|
|
763
|
+
*(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
|
|
764
|
+
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
765
|
+
|
|
766
|
+
**2. Route to service** — if active domain matches a key in `services`:
|
|
767
|
+
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
768
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
769
|
+
- Store `active_service` = `services.{domain}.path`
|
|
770
|
+
- Store `active_service_module` = `services.{domain}.module`
|
|
771
|
+
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
772
|
+
|
|
773
|
+
**3. Fallback** — if domain not detected or no matching service key:
|
|
774
|
+
- Keep default paths from Step 1
|
|
775
|
+
- Set `active_service = unresolved`
|
|
776
|
+
|
|
777
|
+
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
778
|
+
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
779
|
+
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
780
|
+
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
781
|
+
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
782
|
+
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
783
|
+
- Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
|
|
784
|
+
- Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
|
|
785
|
+
|
|
786
|
+
> **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
|
|
787
|
+
|
|
788
|
+
---
|
|
789
|
+
|
|
790
|
+
## Step 1.6 — [SERVICE CONVENTIONS] Load service-specific conventions (umbrella mode)
|
|
791
|
+
|
|
792
|
+
*Skip this step entirely if `active_service` is `"unresolved"` or context is single-service mode.*
|
|
793
|
+
|
|
794
|
+
When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-service/`):
|
|
795
|
+
|
|
796
|
+
**1. Locate service config** — try in priority order:
|
|
797
|
+
- `{active_service}/.agent/project-context.yaml`
|
|
798
|
+
- `{active_service}/project-context.yaml`
|
|
799
|
+
|
|
800
|
+
**2. If found, override with service-specific values:**
|
|
801
|
+
|
|
802
|
+
| Variable | Source |
|
|
803
|
+
|----------|--------|
|
|
804
|
+
| `conventions.test_command` | service's `conventions.test_command` |
|
|
805
|
+
| `conventions.build_command` | service's `conventions.build_command` |
|
|
806
|
+
| `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` — default: `{active_service}/.trace` |
|
|
807
|
+
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
808
|
+
|
|
809
|
+
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
810
|
+
- Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
|
|
811
|
+
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
812
|
+
|
|
813
|
+
**4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
|
|
814
|
+
|
|
815
|
+
---
|
|
816
|
+
|
|
653
817
|
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
654
818
|
|
|
655
819
|
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
@@ -740,6 +904,25 @@ These two variables (`active_module`, `platform_type`) are the canonical source
|
|
|
740
904
|
|
|
741
905
|
---
|
|
742
906
|
|
|
907
|
+
## Step 6.7 — [GUARDRAILS] Load Project Lessons (conditional)
|
|
908
|
+
|
|
909
|
+
*Accumulated mistakes the AI must not repeat in this project. These are added over time via `/learn`
|
|
910
|
+
or accepted during `/review-code`, `/fix-bug`, `/debug`.*
|
|
911
|
+
|
|
912
|
+
Resolve the lessons file path:
|
|
913
|
+
- Use `paths.lessons_file` if set (may be service-overridden in umbrella mode, Step 1.6)
|
|
914
|
+
- Else default `specs/domain-knowledge/lessons-learned.md`
|
|
915
|
+
- In umbrella/service mode (when `service_root` is set), if `paths.lessons_file` is unset, default to `{service_root}/.agent/project-lessons.md`
|
|
916
|
+
|
|
917
|
+
If the file exists, read it and store ALL lessons as **ACTIVE GUARDRAILS** for the session:
|
|
918
|
+
- Treat each lesson's **Rule** as a hard constraint — same priority as CLAUDE.md coding standards (Step 3).
|
|
919
|
+
- Before generating or modifying any artifact (PRD, BDD, tech-doc, code, test), check the output against every lesson whose `category` matches the current command AND whose `scope` matches the target (domain / file).
|
|
920
|
+
- If a generated output would violate a lesson → correct it **before** presenting, and note which lesson (`L-NNN`) was applied.
|
|
921
|
+
|
|
922
|
+
If the file does not exist → skip silently (no lessons captured yet).
|
|
923
|
+
|
|
924
|
+
---
|
|
925
|
+
|
|
743
926
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
744
927
|
|
|
745
928
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -755,6 +938,9 @@ Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Ser
|
|
|
755
938
|
Ticket : {ticket_prefix}-
|
|
756
939
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
757
940
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
941
|
+
Lessons : {loaded — N guardrails | none yet}
|
|
942
|
+
Service : {active_service} ({active_service_module}) | single-service
|
|
943
|
+
Svc Root : {service_root} — conventions + trace_dir loaded from service config | —
|
|
758
944
|
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
759
945
|
```
|
|
760
946
|
|
|
@@ -882,7 +1068,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
882
1068
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
883
1069
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
884
1070
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
885
|
-
| /review-context (PRD) | `/generate-
|
|
1071
|
+
| /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 |
|
|
1072
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
886
1073
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
887
1074
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
888
1075
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -896,6 +1083,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
896
1083
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
897
1084
|
| /fix-bug | Create PR and link to ticket |
|
|
898
1085
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
1086
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
1087
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
1088
|
+
| /learn | Continue working — lesson applies on next command |
|
|
1089
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
1090
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
899
1091
|
|
|
900
1092
|
Format the footer as:
|
|
901
1093
|
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Capture Lesson — Record a Recurring Mistake as a Guardrail
|
|
2
|
+
|
|
3
|
+
Reusable procedure to persist a "lesson" so the AI does not repeat a mistake in this project.
|
|
4
|
+
Used by `/learn` (manual) and offered by `/review-code`, `/fix-bug`, `/debug` (auto).
|
|
5
|
+
|
|
6
|
+
> **Project memory, not model training.** A lesson is plain text injected into context at the
|
|
7
|
+
> start of every command (context-loader Step 6.7). Functionally this stops the repeat — the AI
|
|
8
|
+
> sees the guardrail before it generates. No model weights change.
|
|
9
|
+
|
|
10
|
+
## L1 — Resolve the lessons file
|
|
11
|
+
|
|
12
|
+
Resolve `lessons_path` in this order:
|
|
13
|
+
1. `paths.lessons_file` from loaded context (may be service-overridden in umbrella mode, Step 1.6)
|
|
14
|
+
2. Default `specs/domain-knowledge/lessons-learned.md` (single-service)
|
|
15
|
+
3. In umbrella/service mode (when `service_root` is set) default `{service_root}/.agent/project-lessons.md`
|
|
16
|
+
|
|
17
|
+
## L2 — Build the lesson
|
|
18
|
+
|
|
19
|
+
Gather these fields — from `$ARGUMENTS` (for `/learn`) or from the calling command's findings
|
|
20
|
+
(for `/review-code`, `/fix-bug`, `/debug`):
|
|
21
|
+
|
|
22
|
+
| Field | Meaning |
|
|
23
|
+
|-------|---------|
|
|
24
|
+
| `category` | one of: `code-gen` \| `bdd` \| `tech-docs` \| `tests` \| `prd` \| `general` |
|
|
25
|
+
| `title` | short phrase naming the mistake |
|
|
26
|
+
| `mistake` | concretely, what the AI did wrong |
|
|
27
|
+
| `rule` | imperative correction — "Always …" / "Never …" — testable, not vague |
|
|
28
|
+
| `scope` | where it applies: a domain, a file glob (e.g. `*Controller.*`), or `all` |
|
|
29
|
+
| `source` | how captured: `/learn` \| `/review-code {UC-ID}` \| `/fix-bug {TICKET}` \| `/debug` |
|
|
30
|
+
|
|
31
|
+
If `rule` is vague (e.g. "be careful"), rewrite it into a concrete, checkable instruction before saving.
|
|
32
|
+
|
|
33
|
+
## L3 — De-duplicate
|
|
34
|
+
|
|
35
|
+
Read existing lessons in `lessons_path`. If one already covers the same mistake:
|
|
36
|
+
- **Refine** that entry (tighten the Rule, widen/narrow Scope, bump Date, append the new Source) — do NOT add a duplicate.
|
|
37
|
+
|
|
38
|
+
Otherwise assign the next id `L-{NNN}` = (highest existing number + 1), zero-padded to 3 digits.
|
|
39
|
+
|
|
40
|
+
## L4 — Write
|
|
41
|
+
|
|
42
|
+
If `lessons_path` does not exist, create it with this header first:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
# Project Lessons — Learned Guardrails
|
|
46
|
+
|
|
47
|
+
> Mistakes the AI must NOT repeat in this project. Loaded by context-loader at the start of
|
|
48
|
+
> every command and treated as hard constraints (same priority as CLAUDE.md coding standards).
|
|
49
|
+
> Add with /learn, or accept the prompt during /review-code, /fix-bug, /debug.
|
|
50
|
+
> Commit this file so the whole team shares the guardrails.
|
|
51
|
+
|
|
52
|
+
| Category | Applies to |
|
|
53
|
+
|----------|-----------|
|
|
54
|
+
| code-gen | /generate-code output |
|
|
55
|
+
| bdd | /generate-bdd output |
|
|
56
|
+
| tech-docs | /generate-tech-docs output |
|
|
57
|
+
| tests | /generate-tests output |
|
|
58
|
+
| prd | /generate-prd, /refine-prd output |
|
|
59
|
+
| general | every command |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Insert the new lesson directly under the `---` separator (**newest first**), in this exact shape:
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
### L-{NNN} — [{category}] {title}
|
|
68
|
+
- **Date**: {today YYYY-MM-DD}
|
|
69
|
+
- **Scope**: {scope}
|
|
70
|
+
- **Mistake**: {mistake}
|
|
71
|
+
- **Rule**: {rule}
|
|
72
|
+
- **Source**: {source}
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## L5 — Confirm
|
|
77
|
+
|
|
78
|
+
Print: `📝 Lesson {id} recorded → {lessons_path} ([{category}] {title})`
|
|
79
|
+
Then remind: `Commit {lessons_path} so the team shares this guardrail.`
|
|
@@ -42,6 +42,7 @@ Read `.agent/project-context.yaml`. Extract and store:
|
|
|
42
42
|
- `paths.core_entities` → path to core-entities.md
|
|
43
43
|
- `paths.tech_docs_dir` → technical documentation root
|
|
44
44
|
- `paths.trace_dir` → trace state directory
|
|
45
|
+
- `paths.design_spec_dir` → Design Spec documents root (FE/App only)
|
|
45
46
|
|
|
46
47
|
If `paths` section is absent, use these defaults:
|
|
47
48
|
- `specs_dir` = `specs/bdd`
|
|
@@ -53,11 +54,75 @@ If `paths` section is absent, use these defaults:
|
|
|
53
54
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
54
55
|
- `tech_docs_dir` = `specs/tech-docs`
|
|
55
56
|
- `trace_dir` = `.trace`
|
|
57
|
+
- `design_spec_dir` = `specs/design-spec`
|
|
56
58
|
|
|
57
59
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
58
60
|
|
|
59
61
|
---
|
|
60
62
|
|
|
63
|
+
## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
|
|
64
|
+
|
|
65
|
+
*Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
|
|
66
|
+
|
|
67
|
+
If `services` section is present:
|
|
68
|
+
|
|
69
|
+
**1. Detect active domain** (in priority order):
|
|
70
|
+
- Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
|
|
71
|
+
- Extract from target file path: segment immediately after `prd_dir` base path
|
|
72
|
+
*(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
|
|
73
|
+
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
74
|
+
|
|
75
|
+
**2. Route to service** — if active domain matches a key in `services`:
|
|
76
|
+
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
77
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
78
|
+
- Store `active_service` = `services.{domain}.path`
|
|
79
|
+
- Store `active_service_module` = `services.{domain}.module`
|
|
80
|
+
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
81
|
+
|
|
82
|
+
**3. Fallback** — if domain not detected or no matching service key:
|
|
83
|
+
- Keep default paths from Step 1
|
|
84
|
+
- Set `active_service = unresolved`
|
|
85
|
+
|
|
86
|
+
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
87
|
+
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
88
|
+
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
89
|
+
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
90
|
+
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
91
|
+
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
92
|
+
- Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
|
|
93
|
+
- Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
|
|
94
|
+
|
|
95
|
+
> **Why under `spec_source`:** tester feedback (`/report-bug`, `/propose-scenario`) must land in the **shared spec repo** so PO/Dev see it when they `/sync`. In single-service mode (no `spec_source`), these default to `feedback/bug-reports` and `feedback/bdd-proposals` at repo root — still shared, same repo.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Step 1.6 — [SERVICE CONVENTIONS] Load service-specific conventions (umbrella mode)
|
|
100
|
+
|
|
101
|
+
*Skip this step entirely if `active_service` is `"unresolved"` or context is single-service mode.*
|
|
102
|
+
|
|
103
|
+
When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-service/`):
|
|
104
|
+
|
|
105
|
+
**1. Locate service config** — try in priority order:
|
|
106
|
+
- `{active_service}/.agent/project-context.yaml`
|
|
107
|
+
- `{active_service}/project-context.yaml`
|
|
108
|
+
|
|
109
|
+
**2. If found, override with service-specific values:**
|
|
110
|
+
|
|
111
|
+
| Variable | Source |
|
|
112
|
+
|----------|--------|
|
|
113
|
+
| `conventions.test_command` | service's `conventions.test_command` |
|
|
114
|
+
| `conventions.build_command` | service's `conventions.build_command` |
|
|
115
|
+
| `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` — default: `{active_service}/.trace` |
|
|
116
|
+
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
117
|
+
|
|
118
|
+
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
119
|
+
- Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
|
|
120
|
+
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
121
|
+
|
|
122
|
+
**4. If service config not found** — keep umbrella defaults, still set `service_root = {active_service}` (path anchor is always needed even without a config override).
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
61
126
|
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
62
127
|
|
|
63
128
|
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
@@ -148,6 +213,25 @@ These two variables (`active_module`, `platform_type`) are the canonical source
|
|
|
148
213
|
|
|
149
214
|
---
|
|
150
215
|
|
|
216
|
+
## Step 6.7 — [GUARDRAILS] Load Project Lessons (conditional)
|
|
217
|
+
|
|
218
|
+
*Accumulated mistakes the AI must not repeat in this project. These are added over time via `/learn`
|
|
219
|
+
or accepted during `/review-code`, `/fix-bug`, `/debug`.*
|
|
220
|
+
|
|
221
|
+
Resolve the lessons file path:
|
|
222
|
+
- Use `paths.lessons_file` if set (may be service-overridden in umbrella mode, Step 1.6)
|
|
223
|
+
- Else default `specs/domain-knowledge/lessons-learned.md`
|
|
224
|
+
- In umbrella/service mode (when `service_root` is set), if `paths.lessons_file` is unset, default to `{service_root}/.agent/project-lessons.md`
|
|
225
|
+
|
|
226
|
+
If the file exists, read it and store ALL lessons as **ACTIVE GUARDRAILS** for the session:
|
|
227
|
+
- Treat each lesson's **Rule** as a hard constraint — same priority as CLAUDE.md coding standards (Step 3).
|
|
228
|
+
- Before generating or modifying any artifact (PRD, BDD, tech-doc, code, test), check the output against every lesson whose `category` matches the current command AND whose `scope` matches the target (domain / file).
|
|
229
|
+
- If a generated output would violate a lesson → correct it **before** presenting, and note which lesson (`L-NNN`) was applied.
|
|
230
|
+
|
|
231
|
+
If the file does not exist → skip silently (no lessons captured yet).
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
151
235
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
152
236
|
|
|
153
237
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -163,6 +247,9 @@ Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Ser
|
|
|
163
247
|
Ticket : {ticket_prefix}-
|
|
164
248
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
165
249
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
250
|
+
Lessons : {loaded — N guardrails | none yet}
|
|
251
|
+
Service : {active_service} ({active_service_module}) | single-service
|
|
252
|
+
Svc Root : {service_root} — conventions + trace_dir loaded from service config | —
|
|
166
253
|
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
167
254
|
```
|
|
168
255
|
|
|
@@ -30,7 +30,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
30
30
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
31
31
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
32
32
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
33
|
-
| /review-context (PRD) | `/generate-
|
|
33
|
+
| /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 |
|
|
34
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
34
35
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
35
36
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
36
37
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -44,6 +45,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
44
45
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
45
46
|
| /fix-bug | Create PR and link to ticket |
|
|
46
47
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
48
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
49
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
50
|
+
| /learn | Continue working — lesson applies on next command |
|
|
51
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
52
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
47
53
|
|
|
48
54
|
Format the footer as:
|
|
49
55
|
```
|