@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
|
@@ -73,6 +73,7 @@ Read `.agent/project-context.yaml`. Extract and store:
|
|
|
73
73
|
- `paths.core_entities` → path to core-entities.md
|
|
74
74
|
- `paths.tech_docs_dir` → technical documentation root
|
|
75
75
|
- `paths.trace_dir` → trace state directory
|
|
76
|
+
- `paths.design_spec_dir` → Design Spec documents root (FE/App only)
|
|
76
77
|
|
|
77
78
|
If `paths` section is absent, use these defaults:
|
|
78
79
|
- `specs_dir` = `specs/bdd`
|
|
@@ -84,11 +85,75 @@ If `paths` section is absent, use these defaults:
|
|
|
84
85
|
- `core_entities` = `specs/domain-knowledge/core-entities.md`
|
|
85
86
|
- `tech_docs_dir` = `specs/tech-docs`
|
|
86
87
|
- `trace_dir` = `.trace`
|
|
88
|
+
- `design_spec_dir` = `specs/design-spec`
|
|
87
89
|
|
|
88
90
|
If `tech_stack.module` is set, also load `.agent/modules/{module}/stack-profile.yaml` if it exists.
|
|
89
91
|
|
|
90
92
|
---
|
|
91
93
|
|
|
94
|
+
## Step 1.5 — [SERVICE ROUTING] Resolve service paths (umbrella mode)
|
|
95
|
+
|
|
96
|
+
*Skip this step entirely if `setup.mode` is not `"umbrella"` and `services` section is absent from project-context.yaml.*
|
|
97
|
+
|
|
98
|
+
If `services` section is present:
|
|
99
|
+
|
|
100
|
+
**1. Detect active domain** (in priority order):
|
|
101
|
+
- Read `@trace.domain` from target file frontmatter (if Gate loaded a target file)
|
|
102
|
+
- Extract from target file path: segment immediately after `prd_dir` base path
|
|
103
|
+
*(e.g., `specs/prd/user/FEAT-01.md` → domain = `user`)*
|
|
104
|
+
- If `$ARGUMENTS` contains a path, extract the segment after `prd_dir`
|
|
105
|
+
|
|
106
|
+
**2. Route to service** — if active domain matches a key in `services`:
|
|
107
|
+
- Override `paths.specs_dir` → `services.{domain}.specs_dir`
|
|
108
|
+
- Override `paths.tech_docs_dir` → `services.{domain}.tech_docs_dir`
|
|
109
|
+
- Store `active_service` = `services.{domain}.path`
|
|
110
|
+
- Store `active_service_module` = `services.{domain}.module`
|
|
111
|
+
- If service has its own `module` → use it as `active_module` (overrides `tech_stack.module`)
|
|
112
|
+
|
|
113
|
+
**3. Fallback** — if domain not detected or no matching service key:
|
|
114
|
+
- Keep default paths from Step 1
|
|
115
|
+
- Set `active_service = unresolved`
|
|
116
|
+
|
|
117
|
+
**4. Spec source auto-override** — if `setup.spec_source` is set AND the corresponding path was not already explicitly set in `paths:`:
|
|
118
|
+
- Override `paths.prd_dir` → `{spec_source}/specs/prd`
|
|
119
|
+
- Override `paths.design_spec_dir` → `{spec_source}/specs/design-spec`
|
|
120
|
+
- Override `paths.domain_knowledge_dir` → `{spec_source}/specs/domain-knowledge`
|
|
121
|
+
- Override `paths.business_dictionary` → `{spec_source}/specs/domain-knowledge/business-dictionary.md`
|
|
122
|
+
- Override `paths.core_entities` → `{spec_source}/specs/domain-knowledge/core-entities.md`
|
|
123
|
+
- Override `paths.bug_reports_dir` → `{spec_source}/feedback/bug-reports`
|
|
124
|
+
- Override `paths.bdd_proposals_dir` → `{spec_source}/feedback/bdd-proposals`
|
|
125
|
+
|
|
126
|
+
> **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.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Step 1.6 — [SERVICE CONVENTIONS] Load service-specific conventions (umbrella mode)
|
|
131
|
+
|
|
132
|
+
*Skip this step entirely if `active_service` is `"unresolved"` or context is single-service mode.*
|
|
133
|
+
|
|
134
|
+
When `active_service` has been resolved to a real path in Step 1.5 (e.g., `user-service/`):
|
|
135
|
+
|
|
136
|
+
**1. Locate service config** — try in priority order:
|
|
137
|
+
- `{active_service}/.agent/project-context.yaml`
|
|
138
|
+
- `{active_service}/project-context.yaml`
|
|
139
|
+
|
|
140
|
+
**2. If found, override with service-specific values:**
|
|
141
|
+
|
|
142
|
+
| Variable | Source |
|
|
143
|
+
|----------|--------|
|
|
144
|
+
| `conventions.test_command` | service's `conventions.test_command` |
|
|
145
|
+
| `conventions.build_command` | service's `conventions.build_command` |
|
|
146
|
+
| `paths.trace_dir` | `{active_service}/{service paths.trace_dir}` — default: `{active_service}/.trace` |
|
|
147
|
+
| `paths.specs_dir` | `{active_service}/{service paths.specs_dir}` (if set in service config, else keep Step 1.5 override) |
|
|
148
|
+
|
|
149
|
+
**3. Store** `service_root = {active_service}` as the working directory anchor for all downstream commands:
|
|
150
|
+
- Shell commands (`/run-tests`, `/generate-tests`) run **from within** `service_root`
|
|
151
|
+
- File write operations (test files, trace TSVs) use paths **relative to** `service_root`
|
|
152
|
+
|
|
153
|
+
**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).
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
92
157
|
## Step 2 — [PROJECT-CONFIG] Load module stack profile (conditional)
|
|
93
158
|
|
|
94
159
|
If `tech_stack.module` is set, read `.agent/modules/{module}/stack-profile.yaml`.
|
|
@@ -179,6 +244,25 @@ These two variables (`active_module`, `platform_type`) are the canonical source
|
|
|
179
244
|
|
|
180
245
|
---
|
|
181
246
|
|
|
247
|
+
## Step 6.7 — [GUARDRAILS] Load Project Lessons (conditional)
|
|
248
|
+
|
|
249
|
+
*Accumulated mistakes the AI must not repeat in this project. These are added over time via `/learn`
|
|
250
|
+
or accepted during `/review-code`, `/fix-bug`, `/debug`.*
|
|
251
|
+
|
|
252
|
+
Resolve the lessons file path:
|
|
253
|
+
- Use `paths.lessons_file` if set (may be service-overridden in umbrella mode, Step 1.6)
|
|
254
|
+
- Else default `specs/domain-knowledge/lessons-learned.md`
|
|
255
|
+
- In umbrella/service mode (when `service_root` is set), if `paths.lessons_file` is unset, default to `{service_root}/.agent/project-lessons.md`
|
|
256
|
+
|
|
257
|
+
If the file exists, read it and store ALL lessons as **ACTIVE GUARDRAILS** for the session:
|
|
258
|
+
- Treat each lesson's **Rule** as a hard constraint — same priority as CLAUDE.md coding standards (Step 3).
|
|
259
|
+
- 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).
|
|
260
|
+
- If a generated output would violate a lesson → correct it **before** presenting, and note which lesson (`L-NNN`) was applied.
|
|
261
|
+
|
|
262
|
+
If the file does not exist → skip silently (no lessons captured yet).
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
182
266
|
## Step 7 — [RECAP] Working Memory Recap (anti-lost-in-middle)
|
|
183
267
|
|
|
184
268
|
After loading all context, synthesize and output a compact summary block.
|
|
@@ -194,6 +278,9 @@ Layers : {layer order from CLAUDE.md §2, e.g., Controller → Facade → Ser
|
|
|
194
278
|
Ticket : {ticket_prefix}-
|
|
195
279
|
Dict : {loaded — N canonical terms, M banned terms | missing}
|
|
196
280
|
Entities : {loaded — EntityA, EntityB, EntityC | missing}
|
|
281
|
+
Lessons : {loaded — N guardrails | none yet}
|
|
282
|
+
Service : {active_service} ({active_service_module}) | single-service
|
|
283
|
+
Svc Root : {service_root} — conventions + trace_dir loaded from service config | —
|
|
197
284
|
Status : {FULL | PARTIAL — missing: CLAUDE.md / business-dict / core-entities | MINIMAL}
|
|
198
285
|
```
|
|
199
286
|
|
|
@@ -350,7 +437,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
350
437
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
351
438
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
352
439
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
353
|
-
| /review-context (PRD) | `/generate-
|
|
440
|
+
| /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 |
|
|
441
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
354
442
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
355
443
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
356
444
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -364,6 +452,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
364
452
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
365
453
|
| /fix-bug | Create PR and link to ticket |
|
|
366
454
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
455
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
456
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
457
|
+
| /learn | Continue working — lesson applies on next command |
|
|
458
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
459
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
367
460
|
|
|
368
461
|
Format the footer as:
|
|
369
462
|
```
|
|
@@ -488,7 +581,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
488
581
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
489
582
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
490
583
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
491
|
-
| /review-context (PRD) | `/generate-
|
|
584
|
+
| /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 |
|
|
585
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
492
586
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
493
587
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
494
588
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -502,6 +596,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
502
596
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
503
597
|
| /fix-bug | Create PR and link to ticket |
|
|
504
598
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
599
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
600
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
601
|
+
| /learn | Continue working — lesson applies on next command |
|
|
602
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
603
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
505
604
|
|
|
506
605
|
Format the footer as:
|
|
507
606
|
```
|
|
@@ -583,7 +682,8 @@ Suggest the logical next command based on workflow phase:
|
|
|
583
682
|
| /define-product | `/generate-prd {product-definition-file}` |
|
|
584
683
|
| /generate-prd | `/refine-prd {prd-file}` then `/review-context {prd-file}` |
|
|
585
684
|
| /refine-prd | Open Review Board → update PRD → `/review-context {prd-file}` |
|
|
586
|
-
| /review-context (PRD) | `/generate-
|
|
685
|
+
| /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 |
|
|
686
|
+
| /generate-design-spec | Designer review → Figma links confirmed → PO + Designer sign-off → `/generate-bdd {prd-file}` |
|
|
587
687
|
| /generate-bdd | `/review-context {feature-file}` to verify coverage |
|
|
588
688
|
| /review-context (BDD) | `/generate-tech-docs {UC-ID}` if APPROVED; regenerate if NEEDS_FIX |
|
|
589
689
|
| /generate-tech-docs | `/review-tech-docs {tech-design-file}` |
|
|
@@ -597,6 +697,11 @@ Suggest the logical next command based on workflow phase:
|
|
|
597
697
|
| /validate-traces | DRIFT/UNTRACKED → `/generate-code {UC-ID}`; GAP → `/generate-tests {UC-ID}`; all OK → create PR |
|
|
598
698
|
| /fix-bug | Create PR and link to ticket |
|
|
599
699
|
| /debug | `/fix-bug {ticket-id}` if fix needed |
|
|
700
|
+
| /report-bug | Send to dev (`/fix-bug {BUG-ID}`); if coverage gap → `/propose-scenario {UC-ID}` |
|
|
701
|
+
| /propose-scenario | Notify PO/Dev to review the proposal in `feedback/bdd-proposals/` |
|
|
702
|
+
| /learn | Continue working — lesson applies on next command |
|
|
703
|
+
| /sync | `/validate-traces` for full coverage; act on any `📥 tester feedback` surfaced |
|
|
704
|
+
| /update-framework | Review `git diff .agent/`, commit; `/sync` for project content |
|
|
600
705
|
|
|
601
706
|
Format the footer as:
|
|
602
707
|
```
|