@ngocsangairvds/vsaf 3.1.0 → 3.1.1

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/README.md CHANGED
@@ -1,42 +1,37 @@
1
1
  # VSAF — SDLC Agentic Framework
2
2
 
3
- A development framework for Claude Code built on 4 integrated tools. Plan with
4
- AI agents, understand impact before coding, execute with TDD guardrails, track
5
- every decision. $20/month total.
3
+ A development framework for Claude Code. Plan with AI agents, understand impact
4
+ before coding, execute with TDD guardrails. $20/month total.
6
5
 
7
6
  ---
8
7
 
9
8
  ## Architecture
10
9
 
10
+ 3 tools, 5 workflow phases:
11
+
11
12
  ```
12
- ┌──────────────────────────────────────────────────────────────────────┐
13
- DISCOVERY BMAD (agents)
14
- │ PM · Analyst · domain/market/tech research │
15
- ├──────────────────────────────────────────────────────────────────────┤
16
- │ PLANNING BMAD (agents)
17
- Analyst · Architect · Brainstorming · QA
18
- ├──────────────────────────────────────────────────────────────────────┤
19
- CODE INTEL GitNexus (MCP backbone)
20
- │ call-graph, impact analysis, blast radius │
21
- ├──────────────────────────────────────────────────────────────────────┤
22
- │ MEMORY MemPalace (knowledge base) │
23
- │ architecture decisions, temporal KG │
24
- ├──────────────────────────────────────────────────────────────────────┤
25
- │ IMPLEMENTATION Claude Code + Superpowers │
26
- │ TDD execution, code review │
27
- ├──────────────────────────────────────────────────────────────────────┤
28
- │ KNOWLEDGE Graphify + BMAD (tech writer, editors) │
29
- │ wiki, docs sync, distillation │
30
- └──────────────────────────────────────────────────────────────────────┘
13
+ ┌────────────────────────────────────────────────────────┐
14
+ Phase Tools used
15
+ ├────────────────────────────────────────────────────────┤
16
+ │ DISCOVERY BMAD — domain, market, tech research │
17
+ │ PLANNING BMAD — analyst, architect, QA
18
+ CODE INTEL GitNexus impact, call-graph
19
+ │ IMPLEMENTATION Claude Code + Superpowers — TDD │
20
+ KNOWLEDGE BMAD tech writer, docs sync
21
+ └────────────────────────────────────────────────────────┘
31
22
  ```
32
23
 
33
- See [1-setup-guide.md](docs/onboarding/1-setup-guide.md#2-how-the-tools-fit-together) for what each layer does and how the tools relate.
24
+ | Tool | Role |
25
+ |------|------|
26
+ | **BMAD** | AI agents for planning, review, docs (PM, Analyst, Architect, QA, Tech Writer) |
27
+ | **GitNexus** | Code knowledge graph via MCP — blast radius before every code change |
28
+ | **Superpowers** | Claude Code plugin — TDD execution, code review, debugging discipline |
29
+
30
+ ---
34
31
 
35
32
  ## Quickstart
36
33
 
37
- Requires **Node.js ≥ 18**, **Python 3.10**, **Git**, and a
38
- **Claude Code subscription** ($20/mo). Full prerequisites in
39
- [1-setup-guide.md](docs/onboarding/1-setup-guide.md#3-prerequisites).
34
+ Requires **Node.js ≥ 18**, **Git**, and a **Claude Code subscription** ($20/mo).
40
35
 
41
36
  ```bash
42
37
  git clone <this-repo> && cd vsaf
@@ -44,7 +39,7 @@ npx @ngocsangairvds/vsaf@latest init
44
39
  npx @ngocsangairvds/vsaf@latest status
45
40
  ```
46
41
 
47
- One manual post-setup step (requires an interactive Claude Code session):
42
+ One manual step inside Claude Code:
48
43
 
49
44
  ```
50
45
  /plugin install superpowers@claude-plugins-official
@@ -52,9 +47,9 @@ One manual post-setup step (requires an interactive Claude Code session):
52
47
 
53
48
  Restart Claude Code after installing Superpowers.
54
49
 
55
- ## Documentation
50
+ ---
56
51
 
57
- All onboarding docs live in [`docs/onboarding/`](docs/onboarding/).
52
+ ## Documentation
58
53
 
59
54
  | # | Doc | Covers |
60
55
  |---|-----|--------|
@@ -63,10 +58,11 @@ All onboarding docs live in [`docs/onboarding/`](docs/onboarding/).
63
58
  | 3 | [3-cheatsheet.md](docs/onboarding/3-cheatsheet.md) | 1-page command reference — print and pin |
64
59
  | 4 | [4-milestones.md](docs/onboarding/4-milestones.md) | Day 1 / Week 1 / Month 1 ramp-up path |
65
60
  | 5 | [5-faq.md](docs/onboarding/5-faq.md) | Mindset questions every new dev asks |
66
- | — | [2-workflow-guide.vi.md](docs/onboarding/2-workflow-guide.vi.md) | Bản tiếng Việt của workflow guide |
61
+ | — | [2-workflow-guide.vi.md](docs/onboarding/2-workflow-guide.vi.md) | Vietnamese version of the workflow guide |
67
62
 
68
- **New here?** Start with **1-setup-guide** → then **4-milestones** for your
69
- first 30 days.
63
+ **New here?** Start with **1-setup-guide** → then **4-milestones**.
64
+
65
+ ---
70
66
 
71
67
  ## Directory Layout
72
68
 
@@ -76,10 +72,10 @@ first 30 days.
76
72
  │ ├── settings.json # Local AI settings
77
73
  │ └── skills/ # VSAF + BMAD + GitNexus skills
78
74
  ├── _bmad/ # BMAD agent workspace
79
- ├── docs/project/ # Generated project artifacts (SRS, testcases, plans)
75
+ ├── docs/project/ # Generated artifacts (PRD, SRS, testcases, plans)
80
76
  ├── docs/
81
77
  │ ├── architecture/ # Architecture documents (from BMAD Architect)
82
- │ └── onboarding/ # Developer onboarding (see table above)
78
+ │ └── onboarding/ # Developer onboarding docs
83
79
  ├── assets/templates/ # Project scaffold templates
84
80
  ├── scripts/
85
81
  │ └── setup-vsaf.sh # Full setup automation (used by `vsaf init`)
@@ -87,9 +83,9 @@ first 30 days.
87
83
  └── AGENTS.md # GitNexus rules for AI agents
88
84
  ```
89
85
 
90
- ## Daily Operations
86
+ ---
91
87
 
92
- Run `npx @ngocsangairvds/vsaf@latest --help` for the full list. Highlights:
88
+ ## Daily Operations
93
89
 
94
90
  | Command | What It Does |
95
91
  |---|---|
@@ -97,177 +93,328 @@ Run `npx @ngocsangairvds/vsaf@latest --help` for the full list. Highlights:
97
93
  | `vsaf index` | Re-index codebase (GitNexus) — run after every merge |
98
94
  | `vsaf review` | 2-layer review coordinator |
99
95
  | `vsaf status` | Show status of all installed tools |
100
- | `vsaf mine` | Extract decisions into MemPalace (weekly + after major decisions) |
101
96
 
102
97
  Main skill commands inside Claude Code:
103
98
 
104
- - `/vsaf-discover <product/domain>` product discovery *(new)*
105
- - `/vsaf-sprint plan|status|story` — sprint management *(new)*
106
- - `/vsaf-onboard`
107
- - `/vsaf-plan <feature>`
108
- - `/vsaf-doc`
109
- - `/vsaf-test <path/to/srs>`
110
- - `/vsaf-build <path/to/srs> <path/to/testcases>`
111
- - `/vsaf-ship`
112
- - `/vsaf-docs` documentation sync *(new)*
99
+ | Command | When |
100
+ |---------|------|
101
+ | `/vsaf-discover <product>` | Starting a new product |
102
+ | `/vsaf-sprint plan\|status\|story` | Sprint management |
103
+ | `/vsaf-onboard` | First time on a codebase |
104
+ | `/vsaf-plan <feature>` | Scope + impact + approach |
105
+ | `/vsaf-doc-prd` | Write PRD from approved plan |
106
+ | `/vsaf-doc-srs` | Write SRS from PRD |
107
+ | `/vsaf-test <path/to/srs>` | Generate testcases from SRS |
108
+ | `/vsaf-build <prd> <srs> <testcases>` | Implement with TDD (reads all 3 docs first) |
109
+ | `/vsaf-test run <path/to/testcases>` | Run tests, write results to file |
110
+ | `/vsaf-ship` | Review + ship |
111
+ | `/vsaf-docs` | Documentation sync |
112
+ | `/vsaf-retro` | Sprint/epic retrospective |
113
+
114
+ ---
113
115
 
114
116
  ## Workflow
115
117
 
116
- Full product lifecycle:
118
+ ### Standard Flow (features)
119
+
120
+ ```
121
+ [Product level — once per product]
122
+ /vsaf-discover → /vsaf-sprint plan
123
+
124
+ [Per feature in sprint]
125
+ /vsaf-onboard
126
+ → /vsaf-plan <feature>
127
+ → /vsaf-doc-prd
128
+ → /vsaf-doc-srs
129
+ → /vsaf-test <path/to/srs> # generate testcases
130
+ → /vsaf-build <prd> <srs> <testcases> # reads all 3 docs before writing code
131
+ → /vsaf-test run <path/to/testcases> # run tests, write results to file
132
+ → /vsaf-ship
133
+
134
+ [End of sprint]
135
+ /vsaf-docs → /vsaf-sprint status → /vsaf-retro → next sprint
136
+ ```
137
+
138
+ ### Quick Flow (bug fixes / small changes)
117
139
 
118
140
  ```
119
- /vsaf-discover /vsaf-sprint plan → [per feature in sprint]:
120
- /vsaf-onboard → /vsaf-plan → /vsaf-doc → /vsaf-test → /vsaf-build → /vsaf-ship
121
- /vsaf-docs → /vsaf-sprint status → next sprint
141
+ gitnexus_impact on symbol(s) you'll touch
142
+ /vsaf-doc-srs (mini-SRS)
143
+ /vsaf-test <mini-srs>
144
+ /vsaf-build <mini-srs> <mini-testcases> # reads docs before coding
145
+ /vsaf-test run <mini-testcases>
146
+ /vsaf-ship
122
147
  ```
123
148
 
124
- Every feature follows an **SRS-first cycle**. Bug fixes (Quick Flow) may use
125
- mini-SRS + mini-testcases, but still require `gitnexus_impact` before editing
126
- symbols and `gitnexus_detect_changes` before commit.
149
+ ### Hotfix Flow (production incidents bypass, then backfill)
150
+
151
+ ```
152
+ gitnexus_impact on target symbol # mandatory, even under pressure
153
+ [minimal fix — 1 commit]
154
+ /superpowers:code-review (Layer 1)
155
+ vsaf index (Layer 2)
156
+ git push --hotfix-branch
157
+ ↓ after incident resolved:
158
+ /vsaf-doc-srs (retroactive mini-SRS)
159
+ /vsaf-test <mini-srs> + /vsaf-test run
160
+ /vsaf-ship (close the loop)
161
+ ```
162
+
163
+ > **Hotfix rule:** Impact analysis is never skipped. Gates are minimised, not removed.
164
+ > Retroactive SRS + testcases must be completed before the next sprint starts.
165
+
166
+ ---
127
167
 
128
- ### Flow breakdown
168
+ ## Flow breakdown
169
+
170
+ ### `/vsaf-discover <product/domain>` — Product discovery
171
+
172
+ > Run once when starting a new product. Skip for features inside an existing product.
129
173
 
130
- #### `/vsaf-discover <product/domain>` — Product discovery *(new)*
131
174
  | Step | Tool | Does |
132
175
  |------|------|------|
133
- | 1 | **MemPalace** `mempalace_search` | Checks for prior research |
134
- | 2 | **BMAD** `bmad-domain-research` | Deep dive into domain/industry terminology, rules, patterns |
135
- | 3 | **BMAD** `bmad-market-research` | Competition landscape, customer needs, market trends |
136
- | 4 | **BMAD** `bmad-technical-research` | Tech stack options, feasibility, build-vs-buy |
137
- | 5 | **BMAD** `bmad-product-brief` | Synthesises findings into product brief |
138
- | 6 | **BMAD** `bmad-prfaq` | Working Backwards stress-tests product concept |
139
- | 7 | **BMAD** `bmad-agent-pm` + `bmad-create-prd` | PM creates PRD from brief; `bmad-validate-prd` checks quality; `bmad-edit-prd` fixes issues |
140
- | 8 | **BMAD** `bmad-party-mode` | Multi-agent roundtable: PM + Analyst + Architect review |
141
- | 9 | **MemPalace** `mempalace_add_drawer` | Saves market insights + product decisions |
142
- | → | Output | Research artifacts, product brief, validated PRD, open questions |
143
-
144
- #### `/vsaf-sprint plan|status|story` — Sprint management *(new)*
176
+ | 1 | **BMAD** `bmad-domain-research` | Domain/industry terminology, rules, patterns |
177
+ | 2 | **BMAD** `bmad-market-research` | Competition, customer needs, market trends |
178
+ | 3 | **BMAD** `bmad-technical-research` | Tech stack options, feasibility, build-vs-buy |
179
+ | 4 | **BMAD** `bmad-product-brief` | Synthesises findings into product brief |
180
+ | 5 | **BMAD** `bmad-prfaq` | Working Backwards stress-tests product concept |
181
+ | 6 | **BMAD** `bmad-agent-pm` + `bmad-create-prd` | PM creates initial PRD from brief |
182
+ | 7 | **BMAD** `bmad-party-mode` | Multi-agent roundtable: PM + Analyst + Architect |
183
+ | | Output | Product brief, validated PRD, open questions |
184
+
185
+ ---
186
+
187
+ ### `/vsaf-sprint plan|status|story` — Sprint management
188
+
145
189
  | Mode | Tool | Does |
146
190
  |------|------|------|
147
- | **plan** | **BMAD** `bmad-create-epics-and-stories` | Breaks PRD into epics + prioritised user stories |
191
+ | **plan** | **BMAD** `bmad-create-epics-and-stories` | Breaks PRD into epics + prioritised stories |
148
192
  | **plan** | **BMAD** `bmad-sprint-planning` | Assigns stories to sprint, identifies dependencies |
149
- | **plan** | **MemPalace** `mempalace_add_drawer` | Saves sprint decisions, priorities, trade-offs |
150
193
  | **status** | **BMAD** `bmad-sprint-status` | Progress %, burndown, blocked items, risks |
151
- | **story** | **BMAD** `bmad-create-story` | Creates detailed story file with full context for implementation |
194
+ | **story** | **BMAD** `bmad-create-story` | Creates detailed story file for implementation |
152
195
  | → | Output | Sprint plan, status dashboard, or story file |
153
196
 
154
- #### `/vsaf-onboard` — Understand the codebase
197
+ ---
198
+
199
+ ### `/vsaf-onboard` — Understand the codebase
200
+
155
201
  | Step | Tool | Does |
156
202
  |------|------|------|
157
- | 1 | **GitNexus** `mcp__gitnexus__query` + `group_list` | Maps modules, clusters, entry points, hot symbols |
158
- | 2 | **MemPalace** `mempalace_search` × 3 | Surfaces past architecture decisions, patterns, rationale |
159
- | | Output | Project overview: architecture, patterns, key decisions, risk areas |
203
+ | 1 | **GitNexus** `READ gitnexus://repo/{name}/context` | Codebase overview — size, index freshness, health |
204
+ | 2 | **GitNexus** `READ gitnexus://repo/{name}/clusters` | Functional areas + cohesion scores |
205
+ | 3 | **GitNexus** `READ gitnexus://repo/{name}/processes` | All execution flows in the codebase |
206
+ | 4 | **GitNexus** `group_list` + `group_query` | Module groupings + inter-module relationships |
207
+ | 5 | **GitNexus** `route_map` *(API projects)* | Maps all API routes to handlers |
208
+ | 6 | **GitNexus** `context` on 3-5 key symbols | 360° view on main entry points — callers, callees, process participation |
209
+ | 7 | *(Claude)* | Reads existing docs, synthesises project overview: architecture, patterns, key decisions, risk areas |
210
+ | → | Output | Full mental model: modules, flows, API surface, hot symbols, risk areas |
211
+
212
+ ---
213
+
214
+ ### `/vsaf-plan <feature>` — Scope + impact + approach
215
+
216
+ Output of this step: **approved scope document** (not yet PRD — that's next).
160
217
 
161
- #### `/vsaf-plan <feature>` — Analyse and plan
162
218
  | Step | Tool | Does |
163
219
  |------|------|------|
164
- | 1 | **MemPalace** `mempalace_search` | Checks for prior decisions that affect this feature |
165
- | 2 | **BMAD** `bmad-agent-analyst` (Mary) | Elicits FRs, NFRs, edge cases, scope boundaries |
166
- | 3 | **GitNexus** `mcp__gitnexus__impact` + `query` | Blast radiushow many modules touched, risk level |
167
- | 4 | **Graphify** `/graphify path A B` *(if needed)* | Traces dependency path between two services |
168
- | 5 | **BMAD** `bmad-agent-architect` (Winston) | Proposes architecture approach, compares alternatives |
169
- | 5b | **BMAD** `bmad-create-architecture` *(if HIGH risk / >3 modules)* | Formal ADR `docs/project/planning-artifacts/adr-[feature].md` |
170
- | 6 | **BMAD** `bmad-brainstorming` | Creative exploration — min. 20 alternatives / risk angles |
171
- | 7 | **BMAD** `bmad-advanced-elicitation` | Pre-mortem + red team challenges chosen approach, finds failure modes |
172
- | | Output | Scope, impact, approach, pre-mortem findings, rejected alternatives |
173
-
174
- #### `/vsaf-doc` — Write the SRS
220
+ | 1 | **BMAD** `bmad-agent-analyst` | Elicits FRs, NFRs, edge cases, scope boundaries |
221
+ | 2 | **GitNexus** `impact` + `query` | Blast radius modules touched, risk level |
222
+ | 2b | **GitNexus** `group_query` | Module boundarieswhich groups are affected, interface contracts |
223
+ | 3 | **BMAD** `bmad-agent-architect` | Proposes architecture approach, compares alternatives |
224
+ | 3b | **BMAD** `bmad-create-architecture` *(HIGH risk / >3 modules)* | Formal ADR `docs/project/planning-artifacts/adr-[feature].md` |
225
+ | 4 | **Superpowers** `brainstorming` | Structured approach exploration trade-offs, constraints, 2-3 viable options |
226
+ | 4b | **BMAD** `bmad-brainstorming` | Creative exploration — min. 20 alternatives / risk angles |
227
+ | 4c | **Superpowers** `dispatching-parallel-agents` *(>2 approaches)* | Parallel deep-dive research on top candidate approaches |
228
+ | 5 | **BMAD** `bmad-advanced-elicitation` | Pre-mortem + red team finds failure modes |
229
+ | → | Output | Scope doc: boundaries, impact level, chosen approach, rejected alternatives |
230
+
231
+ > **Gate:** If impact > 3 modules → split into smaller features before proceeding.
232
+
233
+ ---
234
+
235
+ ### `/vsaf-doc-prd` — Write the PRD
236
+
237
+ Input: approved scope document from `/vsaf-plan`.
238
+ Output: `docs/project/planning-artifacts/prd-[feature].md` — *what* to build, for whom, why.
239
+
240
+ | Step | Tool | Does |
241
+ |------|------|------|
242
+ | 1 | **BMAD** `bmad-agent-pm` + `bmad-create-prd` | Writes PRD: goals, user stories, FRs, NFRs, success metrics |
243
+ | 2 | **BMAD** `bmad-validate-prd` | Validates quality — completeness, clarity, testability |
244
+ | 3 | **BMAD** `bmad-edit-prd` *(if FAIL)* | Fixes issues, re-validates |
245
+ | 4 | **BMAD** `bmad-party-mode` *(HIGH risk features)* | Multi-agent roundtable (PM + Analyst + Architect) — catches blind spots single-agent misses |
246
+ | → | Output | Approved `docs/project/planning-artifacts/prd-[feature].md` |
247
+
248
+ > **PRD vs SRS:** PRD = business contract (why/what). SRS = engineering contract (how). Both are required before coding.
249
+
250
+ ---
251
+
252
+ ### `/vsaf-doc-srs` — Write the SRS
253
+
254
+ Input: approved PRD from `/vsaf-doc-prd`.
255
+ Output: `docs/project/srs/[feature].md` — *how* to build it.
256
+
175
257
  | Step | Tool | Does |
176
258
  |------|------|------|
177
259
  | 0 | *(Claude)* | Detects mode: **CREATE** (new SRS) or **EDIT** (modify existing) |
178
- | 1 | **MemPalace** `mempalace_search` | Checks for old decisions to reference in SRS |
179
- | 2a | **BMAD** `bmad-create-prd` *or* *(Claude)* | **CREATE mode**: writes SRS/PRD with FRs/NFRs + traceability IDs |
180
- | 2b | **BMAD** `bmad-edit-prd` | **EDIT mode**: modifies existing SRS in-place, preserves traceability IDs, flags testcase impact |
181
- | 3 | **BMAD** `bmad-validate-prd` | Validates SRS quality; if FAIL in EDIT mode `bmad-edit-prd` fixes again |
182
- | 4 | *(Claude)* | Writes implement notes: affected modules, technical constraints |
183
- | 5 | **MemPalace** `mempalace_add_drawer` | Persists chosen approach + rejected alternatives |
184
- | → | Output | Validated `docs/project/srs/[feature].md` + testcase impact report |
185
-
186
- #### `/vsaf-test <path/to/srs>` Generate testcases
260
+ | 1a | *(Claude)* | **CREATE**: derives SRS from PRD FRs/NFRs with traceability IDs |
261
+ | 1b | **BMAD** `bmad-edit-prd` | **EDIT**: modifies existing SRS in-place, preserves traceability IDs, flags testcase impact |
262
+ | 2 | **GitNexus** `context` on key symbols | Validates technical feasibility are the symbols/APIs the SRS references real and reachable? |
263
+ | 2b | **GitNexus** `group_contracts` *(cross-module features)* | Understands interface contracts between modules the SRS will touch |
264
+ | 3 | **BMAD** `bmad-validate-prd` | Validates SRS quality; FAIL fix and re-validate |
265
+ | 4 | *(Claude)* | Writes implementation notes: affected modules, technical constraints |
266
+ | → | Output | Validated `docs/project/srs/[feature].md` |
267
+
268
+ > **Change request mid-build:** If requirements change after SRS is approved → run `/vsaf-doc-srs` in EDIT mode → re-run `/vsaf-test <srs>` to update testcases → resume `/vsaf-build`. Do not proceed with stale SRS.
269
+
270
+ ---
271
+
272
+ ### `/vsaf-test <path/to/srs>` — Generate testcases
273
+
274
+ Input: approved SRS.
275
+ Output: `docs/project/testcases/[feature].md` — testcase contract used in build and post-build verification.
276
+
187
277
  | Step | Tool | Does |
188
278
  |------|------|------|
279
+ | 0 | **GitNexus** `query({query: "test <feature>"})` | Finds existing test patterns and conventions in the codebase — follow, don't reinvent |
189
280
  | 1 | **BMAD** `bmad-qa-generate-e2e-tests` | Derives unit / integration / edge-case tests from SRS FRs/NFRs |
190
- | 2 | **BMAD** `bmad-review-edge-case-hunter` | Finds unhandled boundaries, race conditions, null/empty cases — adds tests |
281
+ | 2 | **BMAD** `bmad-review-edge-case-hunter` | Finds unhandled boundaries, race conditions, null/empty cases |
191
282
  | 3 | *(Claude)* | Validates every FR/NFR has ≥ 1 test, builds traceability matrix |
192
283
  | 4 | *(Claude)* | Saves to `docs/project/testcases/[feature].md` |
193
- | 5 | **BMAD** `bmad-check-implementation-readiness` | **Quality gate** — blocks build if SRS/testcase/architecture gaps found |
194
- | → | Output | Testcase contract + implementation readiness verdict (PASS/FAIL) |
284
+ | 5 | **BMAD** `bmad-check-implementation-readiness` | **Quality gate** — blocks build if SRS/testcase/architecture gaps |
285
+ | → | Output | Testcase contract + readiness verdict (PASS/FAIL) |
286
+
287
+ ---
288
+
289
+ ### `/vsaf-build <prd> <srs> <testcases>` — Implement with TDD
290
+
291
+ > **Before writing a single line of code**, Claude reads and confirms understanding of all 3 input documents: PRD (what/why), SRS (how/FRs/NFRs), testcases (acceptance criteria). Implementation must not begin until this is complete.
292
+
293
+ | Step | Tool | Does |
294
+ |------|------|------|
295
+ | 0 | *(Claude)* | **Reads PRD + SRS + testcases in full.** Confirms FR/NFR → testcase mapping. Reports any gaps before starting. |
296
+ | 0b | **Superpowers** `brainstorming` | Brainstorms implementation approaches — trade-offs, risk, alternative designs before committing to a plan |
297
+ | 1 | **Superpowers** `writing-plans` *or* *(Claude)* | Generates atomic task list from SRS + testcases. Each task maps to ≥1 FR/NFR. |
298
+ | 1b | **Superpowers** `subagent-driven-development` *(plan >20 tasks)* | Alternative: dispatches tasks to sub-agents with two-phase review pipeline |
299
+ | 2 | **Superpowers** `executing-plans` + `test-driven-development` | TDD loop per task: RED → GREEN → REFACTOR → COMMIT |
300
+ | 2b | **GitNexus** `detect_changes` | Verifies only intended files changed before each commit |
301
+ | 2c | **Superpowers** `verification-before-completion` | After each task: explicit verification that outcome matches spec — not just "tests pass" |
302
+ | 3 | **BMAD** `bmad-checkpoint-preview` *(every 3-5 tasks)* | Human-in-the-loop — progress summary, flag issues, ask to continue |
303
+ | 4 | **Superpowers** `systematic-debugging` | On failure: structured hypothesis → experiment → conclusion |
304
+ | 4b | **BMAD** `bmad-correct-course` *(scope drift detected)* | Assesses impact, proposes plan adjustment. If requirements changed → stop, update SRS first. |
305
+ | → | Output | Working code, all tests passing, verified against spec, 1 commit per task |
306
+
307
+ > **3-strike rule:** Task fails 3 times → STOP. Architectural problem, not execution. Re-read SRS + testcases and redesign the task.
308
+
309
+ ---
310
+
311
+ ### `/vsaf-test run <path/to/testcases>` — Run tests + record results
312
+
313
+ Run after `/vsaf-build` completes. Executes the full test suite against the implementation and writes a structured results file.
314
+
315
+ | Step | Tool | Does |
316
+ |------|------|------|
317
+ | 1 | *(Claude)* | Re-reads testcase file, confirms all tests are present |
318
+ | 2 | *(Claude + project test runner)* | Runs test suite (unit + integration + e2e) |
319
+ | 3 | *(Claude)* | Records pass/fail per testcase, maps results back to FR/NFR traceability IDs |
320
+ | 4 | **GitNexus** `detect_changes({scope: "compare", base_ref: "main"})` | Verifies tests cover all changed files/symbols — flags untested changes |
321
+ | 5 | **GitNexus** `shape_check` *(optional)* | Validates no architectural constraints violated by the implementation |
322
+ | 6 | *(Claude)* | Saves results to `docs/project/testcases/[feature]-results.md` (includes coverage + constraint compliance) |
323
+ | 7 | *(Claude)* | **Gate:** if any FR/NFR has 0 passing tests OR untested changes detected → blocks ship, reports failures |
324
+ | → | Output | `docs/project/testcases/[feature]-results.md` with pass rate, coverage, constraint check, and failure details |
325
+
326
+ > Results file is required input for `/vsaf-ship`. Ship is blocked if gate fails.
327
+
328
+ ---
329
+
330
+ ### `/vsaf-ship` — Review and ship
331
+
332
+ Input: working code + test results file (from `/vsaf-test run`).
195
333
 
196
- #### `/vsaf-build <path/to/srs> <path/to/testcases>` — Implement with TDD
197
334
  | Step | Tool | Does |
198
335
  |------|------|------|
199
- | 0 | **Superpowers** check | Detects plugin. If yes uses write-plan, execute-plan, TDD, debugging. If no warns + fallback |
200
- | 1 | **MemPalace** `mempalace_search` | Last check no old decisions conflict with implementation |
201
- | 2 | *(Claude)* | Reads SRS + testcases, confirms FR/NFR testcase mapping |
202
- | 3 | **Superpowers** `write-plan` *or* *(Claude)* | Generates atomic task list from SRS + testcases |
203
- | 4 | **Superpowers** `execute-plan` + `test-driven-development` *or* **Claude Code** | TDD loop per task. Large plans (20+): `subagent-driven-development` |
204
- | 4b | **GitNexus** `mcp__gitnexus__detect_changes` | Verifies only intended files changed before each commit |
205
- | 4.5 | **BMAD** `bmad-checkpoint-preview` *(every 3-5 tasks)* | Human-in-the-loop reviewsummarise progress, flag issues, ask user to continue |
206
- | 5 | **Superpowers** `systematic-debugging` *or* manual | On failure: structured hypothesis experiment conclusion |
207
- | 5b | **BMAD** `bmad-correct-course` *(if scope drift detected)* | Assesses impact of scope change, proposes adjusted plan vs re-plan |
208
- | | Output | Working code, all tests passing, 1 commit per task |
209
-
210
- #### `/vsaf-ship` — Review, sync, and record
336
+ | 0 | **GitNexus** `detect_changes({scope: "compare", base_ref: "main"})` | Full branch scope check confirms only expected files/symbols changed |
337
+ | 1 | **Superpowers** `requesting-code-review` | Structured handoff: what changed, why, what to watch for — gives reviewer context |
338
+ | 2 | **Superpowers** `code-review` *or* **BMAD** `bmad-code-review` | Layer 1 code quality, patterns, SOLID |
339
+ | 2b | **Superpowers** `receiving-code-review` *(if feedback)* | Systematic response to reviewer pushback no ad-hoc fixes |
340
+ | 3 | **BMAD** `bmad-review-adversarial-general` + `bmad-review-edge-case-hunter` | Layer 1.5 cynical attack + boundary analysis. Triage: MUST FIX / SHOULD FIX / NOTED |
341
+ | 4 | **GitNexus** `shape_check` | Architectural constraint validation no violations shipped |
342
+ | 5 | **GitNexus** `vsaf index` | Layer 2updates call graph to reflect new code |
343
+ | 6 | **Superpowers** `verification-before-completion` | Final gate explicit verification that all deliverables match spec |
344
+ | 7 | **Superpowers** `finishing-a-development-branch` | Pre-PR checklist runs final checks before push |
345
+ | 8 | *(git)* | Push branch, open PR (must include: impact summary, test results link, adversarial triage) |
346
+ | → | Output | Shipped feature, updated graph, PR ready for review |
347
+
348
+ ---
349
+
350
+ ### `/vsaf-retro` — Retrospective
351
+
352
+ > Run at end of sprint or end of epic. Separate from ship. Data-backed, not opinion-based.
353
+
211
354
  | Step | Tool | Does |
212
355
  |------|------|------|
213
- | 1 | **Superpowers** `code-review` + `verification-before-completion` *or* **BMAD** `bmad-code-review` | Layer 1code quality, patterns, SOLID |
214
- | 2 | **BMAD** `bmad-review-adversarial-general` + `bmad-review-edge-case-hunter` | Layer 1.5 cynical attack + boundary analysis. Triage: MUST FIX / SHOULD FIX / NOTED |
215
- | 3 | **GitNexus** `gitnexus analyze` / `vsaf index` | Layer 2updates call graph to reflect new code |
216
- | 4 | **Superpowers** `finishing-a-development-branch` *or* manual | Pre-PR checklist |
217
- | 5 | **MemPalace** `mempalace_add_drawer` + `diary_write` | Saves decisions, adversarial findings, session summary |
218
- | 6 | *(git)* | Push branch, open PR with impact + test + adversarial summary |
219
- | 7 | **BMAD** `bmad-retrospective` *(end of epic only)* | Lessons learned → MemPalace. What went well / what to improve |
220
- | → | Output | Shipped feature, updated graph, persistent knowledge, follow-up tasks |
221
-
222
- #### `/vsaf-docs` — Documentation & knowledge sync *(new)*
356
+ | 1 | **GitNexus** `detect_changes({scope: "compare", base_ref: "<sprint-start-tag>"})` | Total sprint changes files, symbols, processes affected |
357
+ | 2 | **GitNexus** `READ gitnexus://repo/{name}/context` | Codebase health metrics post-sprint size, complexity, index freshness |
358
+ | 3 | **GitNexus** `group_status` | Module healthany module degraded during sprint? |
359
+ | 4 | **BMAD** `bmad-retrospective` | What went well, what to improve, action items — informed by data from steps 1-3 |
360
+ | 5 | **BMAD** `bmad-sprint-status` | Final sprint metrics — velocity, burndown, completion rate |
361
+ | | Output | Data-backed retro: sprint impact, module health, action items for next sprint planning |
362
+
363
+ ---
364
+
365
+ ### `/vsaf-docs` — Documentation & knowledge sync
366
+
367
+ > Run once per sprint, after all features are shipped.
368
+
223
369
  | Step | Tool | Does |
224
370
  |------|------|------|
225
- | 1 | **GitNexus** `query` + **MemPalace** `search` | Scans codebase + decisions, finds stale docs |
371
+ | 1 | **GitNexus** `query` | Scans codebase, finds stale docs |
226
372
  | 2 | **BMAD** `bmad-document-project` | Generates/updates project documentation from code |
227
373
  | 3 | **BMAD** `bmad-generate-project-context` | Creates `project-context.md` — AI agent instructions |
228
- | 4 | **BMAD** `bmad-agent-tech-writer` (Paige) | Reviews docs for clarity, completeness, consistency |
229
- | 5 | **BMAD** `bmad-editorial-review-prose` + `bmad-editorial-review-structure` | Polish prose + restructure for readability |
374
+ | 4 | **BMAD** `bmad-agent-tech-writer` | Reviews docs for clarity, completeness, consistency |
375
+ | 5 | **BMAD** `bmad-editorial-review-prose` + `bmad-editorial-review-structure` | Polish prose + restructure |
230
376
  | 6 | **BMAD** `bmad-distillator` | Compresses long docs into LLM-optimised format |
231
377
  | 7 | **BMAD** `bmad-index-docs` | Generates `index.md` for each docs folder |
232
- | 8 | **Graphify** `/graphify . --wiki` | Builds agent-crawlable wiki from codebase |
233
- | 9 | **MemPalace** `diary_write` | Records what was updated/replaced |
234
- | → | Output | Updated docs, project context, wiki, doc indexes |
378
+ | | Output | Updated docs, project context, doc indexes |
235
379
 
236
- ### Generated docs path convention
380
+ ---
381
+
382
+ ## Generated docs path convention
237
383
 
238
384
  | Artifact | Path |
239
385
  |----------|------|
386
+ | PRD | `docs/project/planning-artifacts/prd-<feature>.md` |
240
387
  | SRS | `docs/project/srs/<feature>.md` |
241
388
  | Testcases | `docs/project/testcases/<feature>.md` |
242
- | Planning artifacts | `docs/project/planning-artifacts/` |
389
+ | Test results | `docs/project/testcases/<feature>-results.md` |
390
+ | Other planning artifacts | `docs/project/planning-artifacts/` |
243
391
  | Implementation artifacts | `docs/project/implementation-artifacts/` |
244
392
 
245
- ### Command naming map
246
-
247
- - `/vsaf-onboarding` → `vsaf-onboard`
248
- - `/vsaf-planning <requirement>` → `vsaf-plan` + `vsaf-doc`
249
- - `/vsaf-testcase <path/to/srs>` → `vsaf-test <path/to/srs>`
250
- - `/vsaf-implement <srs> <testcases>` → `vsaf-build <srs> <testcases>`
251
-
252
- See [1-setup-guide.md § Your First Project](docs/onboarding/1-setup-guide.md#5-your-first-project--a-walkthrough)
253
- for a walkthrough, or [2-workflow-guide.md § JWT Demo](docs/onboarding/2-workflow-guide.md#4-full-sdlc-demo)
254
- for a full code-by-code example.
393
+ ---
255
394
 
256
- ## Tools
395
+ ## Command naming map
257
396
 
258
- | Tool | What It Does | Cost |
259
- |---|---|---|
260
- | **Claude Code** | AI coding agent — everything else plugs into it | $20/mo |
261
- | **BMAD Method** | AI agents for full lifecycle: PM, Analyst, Architect, QA, Tech Writer, Code Review + 40 skills | Free |
262
- | **Superpowers** | Claude Code plugin: plan execution, TDD, debugging, code review, pre-PR checklist *(optional — BMAD/manual fallback)* | Free |
263
- | **GitNexus** | Code knowledge graph via MCP impact analysis, dependency queries | Free |
264
- | **MemPalace** | Knowledge base verbatim storage of decisions, temporal knowledge graph | Free |
265
- | **Graphify** | Any input → knowledge graph → clustered communities, dependency tracing, wiki | Free |
397
+ | Alias | Resolves to |
398
+ |-------|-------------|
399
+ | `/vsaf-onboarding` | `vsaf-onboard` |
400
+ | `/vsaf-planning <req>` | `vsaf-plan` + `vsaf-doc-prd` + `vsaf-doc-srs` |
401
+ | `/vsaf-testcase <srs>` | `vsaf-test <path/to/srs>` |
402
+ | `/vsaf-implement <prd> <srs> <tc>` | `vsaf-build <prd> <srs> <testcases>` |
403
+ | `/vsaf-doc` | DEPRECATEDuse `vsaf-doc-prd` then `vsaf-doc-srs` |
266
404
 
267
405
  ---
268
406
 
269
- **Core principles:** Discover before planning. Onboard first. SRS before implementation.
270
- Testcases derived from SRS. Impact analysis before touching any symbol.
271
- Run `gitnexus_detect_changes` before commit. 2-layer review before every PR.
272
- Re-index after every merge. Mine decisions weekly. Sync docs every sprint.
273
- MemPalace = decisions. Not CLAUDE.md.
407
+ ## Core principles
408
+
409
+ 1. **Discover before planning.** Research the domain before writing PRD.
410
+ 2. **Onboard first.** Understand the codebase before touching it.
411
+ 3. **PRD before SRS.** Business contract before engineering contract.
412
+ 4. **SRS before code.** Engineering contract before implementation.
413
+ 5. **Testcases from SRS.** Every FR/NFR must have a testcase before coding starts.
414
+ 6. **Read all 3 docs before coding.** PRD + SRS + testcases — no exceptions.
415
+ 7. **Impact analysis before every symbol edit.** `gitnexus_impact` is mandatory.
416
+ 8. **Run tests, write results.** `/vsaf-test run` after build, before ship.
417
+ 9. **2-layer review before every PR.** Code review → graph sync.
418
+ 10. **Re-index after every merge.** `vsaf index` keeps GitNexus accurate.
419
+ 11. **Split when impact is HIGH.** > 3 modules or > 400 lines → separate PRs.
420
+ 12. **Retroactive SRS for hotfixes.** No hotfix closes without backfill docs.
package/bin/vsaf.js CHANGED
@@ -13,12 +13,11 @@ USAGE
13
13
  vsaf status Show installation status
14
14
  vsaf index Re-index codebase (GitNexus)
15
15
  vsaf review Run 2-layer review flow
16
- vsaf mine Mine conversations into MemPalace
17
16
  vsaf clean Clean GitNexus index
18
17
 
19
18
  GLOBAL (once per machine → ~/.claude/)
20
- Skills : bmad (41), vsaf (5), gitnexus (6), graphify (1)
21
- Binaries: gitnexus, mempalace, graphify
19
+ Skills : bmad (41), vsaf (5), gitnexus (6)
20
+ Binaries: gitnexus
22
21
 
23
22
  PER PROJECT (per repo, run inside the repo root)
24
23
  .claude/settings.json Local AI settings
@@ -74,11 +73,6 @@ async function main() {
74
73
  runAndExit(runReview(), 'Review');
75
74
  break;
76
75
  }
77
- case 'mine': {
78
- const { runMine } = require('../src/workflow');
79
- runAndExit(runMine(), 'Mine');
80
- break;
81
- }
82
76
  case 'clean': {
83
77
  const { runClean } = require('../src/workflow');
84
78
  runAndExit(runClean(), 'Clean');
@@ -109,7 +103,6 @@ function printInstallHint() {
109
103
  \x1b[36mvsaf status\x1b[0m # kiểm tra cài đặt
110
104
  \x1b[36mvsaf index\x1b[0m # index codebase (GitNexus)
111
105
  \x1b[36mvsaf review\x1b[0m # chạy 2-layer review
112
- \x1b[36mvsaf mine\x1b[0m # mine conversations → MemPalace
113
106
 
114
107
  \x1b[90mHoặc tiếp tục dùng npx nếu không muốn cài global:\x1b[0m
115
108
  \x1b[90m npx ${pkg} <command>\x1b[0m