@ngocsangairvds/vsaf 3.0.2 → 3.0.3
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/.claude/skills/vsaf-build/SKILL.md +2 -2
- package/.claude/skills/vsaf-ship/SKILL.md +2 -2
- package/README.md +16 -16
- package/assets/templates/.claude/settings.json +1 -2
- package/assets/templates/CLAUDE.md +13 -13
- package/assets/templates/Makefile +16 -64
- package/bin/vsaf.js +38 -4
- package/package.json +1 -1
- package/src/project.js +3 -5
- package/src/status.js +0 -2
- package/src/utils.js +6 -2
- package/src/workflow.js +83 -0
|
@@ -30,8 +30,8 @@ Với mỗi task trong spec:
|
|
|
30
30
|
5. Chạy `/opsx:verify` để check task đúng spec
|
|
31
31
|
6. Commit: `git commit -m "feat: <task description>"`
|
|
32
32
|
|
|
33
|
-
### Bước 4 —
|
|
34
|
-
-
|
|
33
|
+
### Bước 4 — Security (tự động)
|
|
34
|
+
- Security hooks chạy tự động — không cần gọi thủ công
|
|
35
35
|
- Nếu bị block: đọc message, không dùng `--no-verify` để bypass
|
|
36
36
|
|
|
37
37
|
### Bước 5 — Xử lý khi fail
|
|
@@ -24,8 +24,8 @@ description: Review 3 lớp, ship code, và ghi lại toàn bộ knowledge vào
|
|
|
24
24
|
- Kiểm tra: code có implement đúng tất cả FRs/NFRs trong spec không
|
|
25
25
|
- Nếu fail: quay lại `/vsaf-build` để fix
|
|
26
26
|
|
|
27
|
-
### Bước 3 — Review Layer 3: Security (
|
|
28
|
-
- Chạy `
|
|
27
|
+
### Bước 3 — Review Layer 3: Security (Security)
|
|
28
|
+
- Chạy `vsaf verify`
|
|
29
29
|
- Fix tất cả issues trước khi tiếp tục
|
|
30
30
|
- Không skip warnings
|
|
31
31
|
|
package/README.md
CHANGED
|
@@ -14,9 +14,9 @@ tools, $20/month total.
|
|
|
14
14
|
├──────────────────────────────────────────────────────────────────────┤
|
|
15
15
|
│ CODE INTEL GitNexus (MCP backbone) + Graphify (multimodal) │
|
|
16
16
|
├──────────────────────────────────────────────────────────────────────┤
|
|
17
|
-
│ MEMORY claude-mem (auto) + MemPalace (knowledge base)
|
|
17
|
+
│ MEMORY claude-mem (auto) + MemPalace (knowledge base) │
|
|
18
18
|
├──────────────────────────────────────────────────────────────────────┤
|
|
19
|
-
│ IMPLEMENTATION Claude Code + Superpowers +
|
|
19
|
+
│ IMPLEMENTATION Claude Code + Superpowers + security guardrails │
|
|
20
20
|
└──────────────────────────────────────────────────────────────────────┘
|
|
21
21
|
```
|
|
22
22
|
|
|
@@ -30,9 +30,9 @@ Requires **Node.js ≥ 18**, **Python ≥ 3.10**, **Git**, **jq**, and a
|
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
git clone <this-repo> && cd vsaf
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
npx @ngocsangairvds/vsaf@latest init
|
|
34
|
+
npx @ngocsangairvds/vsaf@latest index
|
|
35
|
+
npx @ngocsangairvds/vsaf@latest status
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
One manual post-setup step (requires an interactive Claude Code session):
|
|
@@ -64,31 +64,31 @@ first 30 days.
|
|
|
64
64
|
```
|
|
65
65
|
.
|
|
66
66
|
├── .claude/
|
|
67
|
-
│ ├── settings.json #
|
|
67
|
+
│ ├── settings.json # Security hooks: block secrets, protect config files
|
|
68
68
|
│ └── skills/ # Coding standards for Go, Rust, Python
|
|
69
69
|
├── docs/
|
|
70
70
|
│ ├── architecture/ # Architecture documents (from BMAD Architect)
|
|
71
71
|
│ └── onboarding/ # Developer onboarding (see table above)
|
|
72
72
|
├── githooks/ # Git hooks (pre-push runs verify + security scan)
|
|
73
|
-
├── graphify-out/ # Graphify output (gitignored, regenerated by
|
|
73
|
+
├── graphify-out/ # Graphify output (gitignored, regenerated by `vsaf index`)
|
|
74
74
|
├── openspec/ # OpenSpec workspace (proposals, specs, designs, tasks)
|
|
75
75
|
├── scripts/
|
|
76
|
-
│ └── setup-vsaf.sh # Full setup automation (
|
|
76
|
+
│ └── setup-vsaf.sh # Full setup automation (used by `vsaf init`)
|
|
77
77
|
├── CLAUDE.md # Claude Code system prompt — workflow rules
|
|
78
|
-
└── Makefile #
|
|
78
|
+
└── Makefile # Legacy wrapper (optional; use `vsaf` commands)
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
## Daily Operations
|
|
82
82
|
|
|
83
|
-
Run `
|
|
83
|
+
Run `npx @ngocsangairvds/vsaf@latest --help` for the full list. Highlights:
|
|
84
84
|
|
|
85
85
|
| Command | What It Does |
|
|
86
86
|
|---|---|
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
87
|
+
| `vsaf init` | Install or update all tools |
|
|
88
|
+
| `vsaf index` | Re-index codebase (GitNexus + Graphify) — run after every merge |
|
|
89
|
+
| `vsaf verify` | Check implementation against OpenSpec specs |
|
|
90
|
+
| `vsaf review` | Full 3-layer review coordinator |
|
|
91
|
+
| `vsaf status` | Show status of all installed tools |
|
|
92
92
|
|
|
93
93
|
All commands — including BMAD agents, OpenSpec, Superpowers, and GitNexus — are
|
|
94
94
|
listed in [3-cheatsheet.md](docs/onboarding/3-cheatsheet.md).
|
|
@@ -111,7 +111,7 @@ for a full command-by-command example.
|
|
|
111
111
|
| **BMAD Method** | AI agents for planning: Analyst, PM, Architect, Product Owner | Free |
|
|
112
112
|
| **OpenSpec** | Spec-driven development: proposals, specs, designs, task lists, verification | Free |
|
|
113
113
|
| **Superpowers** | Methodology engine: brainstorm, plan, TDD execution, code review | Free |
|
|
114
|
-
| **
|
|
114
|
+
| **Security guardrails** | Security scanner + git hooks (block secrets) + coding standards | Free |
|
|
115
115
|
| **GitNexus** | Code knowledge graph via MCP — impact analysis, dependency queries | Free |
|
|
116
116
|
| **Graphify** | Multimodal knowledge graph — visual dependency maps, path tracing | Free |
|
|
117
117
|
| **claude-mem** | Auto-pilot memory — captures sessions, re-injects context next time | Free |
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"hooks": [
|
|
27
27
|
{
|
|
28
28
|
"type": "command",
|
|
29
|
-
"command": "
|
|
29
|
+
"command": "ISSUES=\"\"; SECRETS=$(git diff --cached --diff-filter=ACM --name-only 2>/dev/null | xargs grep -lE \"AKIA[0-9A-Z]{16}|ghp_[a-zA-Z0-9]{36}|sk-[a-zA-Z0-9]{48}|xox[bpoas]-|BEGIN.*PRIVATE\" 2>/dev/null) || true; [ -n \"$SECRETS\" ] && ISSUES=\"${ISSUES}WARNING: Possible secrets staged: ${SECRETS} \"; LOGS=$(git diff --cached --name-only 2>/dev/null | xargs grep -lE \"console[.]log|debugger\" 2>/dev/null) || true; [ -n \"$LOGS\" ] && ISSUES=\"${ISSUES}WARNING: Debug artifacts in staged files: ${LOGS} \"; [ -n \"$ISSUES\" ] && echo \"$ISSUES\""
|
|
30
30
|
}
|
|
31
31
|
]
|
|
32
32
|
}
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
"Bash(npm test:*)",
|
|
54
54
|
"Bash(npm run:*)",
|
|
55
55
|
"Bash(npx:*)",
|
|
56
|
-
"Bash(make:*)",
|
|
57
56
|
"Bash(python:*)",
|
|
58
57
|
"Bash(node:*)"
|
|
59
58
|
],
|
|
@@ -23,7 +23,7 @@ VSAF is a meta-framework for AI-driven SDLC — not an application. It has no so
|
|
|
23
23
|
| Memory | claude-mem, MemPalace | Session continuity (auto), architecture decisions (manual) |
|
|
24
24
|
| Implementation | Superpowers, Claude Code | TDD execution, code review |
|
|
25
25
|
|
|
26
|
-
Key directories: `.claude/` (settings + skills), `openspec/` (spec proposals),
|
|
26
|
+
Key directories: `.claude/` (settings + skills), `openspec/` (spec proposals), `.gitnexus/` (knowledge graph index).
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
@@ -31,13 +31,13 @@ Key directories: `.claude/` (settings + skills), `openspec/` (spec proposals), `
|
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
npx vsaf init # Install all tools (one-time, idempotent)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
vsaf index # Re-index: gitnexus analyze + graphify update
|
|
35
|
+
vsaf verify # Check implementation against OpenSpec specs
|
|
36
|
+
vsaf review # Full 3-layer review coordinator
|
|
37
|
+
vsaf archive # Archive specs + re-index (post-merge)
|
|
38
|
+
vsaf mine # Mine conversations into MemPalace
|
|
39
|
+
vsaf status # Show status of all tools
|
|
40
|
+
vsaf clean # Clean GitNexus index
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
---
|
|
@@ -95,7 +95,7 @@ After every merge or significant change:
|
|
|
95
95
|
```
|
|
96
96
|
gitnexus analyze && /graphify . --update
|
|
97
97
|
```
|
|
98
|
-
Or: `
|
|
98
|
+
Or: `vsaf index`
|
|
99
99
|
|
|
100
100
|
---
|
|
101
101
|
|
|
@@ -165,10 +165,10 @@ Do not approve until every task has a verification step.
|
|
|
165
165
|
/superpowers:code-review
|
|
166
166
|
|
|
167
167
|
# Layer 2: Spec compliance
|
|
168
|
-
/opsx:verify # or:
|
|
168
|
+
/opsx:verify # or: vsaf verify
|
|
169
169
|
|
|
170
170
|
# Layer 3: Knowledge graph sync
|
|
171
|
-
|
|
171
|
+
vsaf index # gitnexus analyze + graphify update
|
|
172
172
|
```
|
|
173
173
|
If Layer 2 fails --> return to Step 7.
|
|
174
174
|
|
|
@@ -180,7 +180,7 @@ PR description must include: OpenSpec proposal link, impact summary, test result
|
|
|
180
180
|
|
|
181
181
|
### Step 10: Archive + Ship
|
|
182
182
|
```bash
|
|
183
|
-
|
|
183
|
+
vsaf archive # openspec archive + re-index
|
|
184
184
|
mempalace mine ~/chats/ --mode convos # Mine decisions
|
|
185
185
|
git tag v<version> && git push --tags
|
|
186
186
|
```
|
|
@@ -222,7 +222,7 @@ git tag v<version> && git push --tags
|
|
|
222
222
|
| Write code before specs | Spec first, code second: `/opsx:propose` |
|
|
223
223
|
| Skip brainstorm | `/superpowers:brainstorm` before planning |
|
|
224
224
|
| Push without review | 3-layer: Superpowers + OpenSpec verify + re-index |
|
|
225
|
-
| Forget to re-index | `
|
|
225
|
+
| Forget to re-index | `vsaf index` after every merge |
|
|
226
226
|
| Create PRs > 400 lines | Split into smaller PRs |
|
|
227
227
|
| Trust AI output blindly | AI writes -> Superpowers reviews -> human approves |
|
|
228
228
|
| Skip impact analysis | GitNexus + Graphify + MemPalace BEFORE coding |
|
|
@@ -1,77 +1,29 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
# Run `make help` for available commands.
|
|
1
|
+
# Optional compatibility wrapper for teams that still type `make`.
|
|
2
|
+
# Preferred usage: run `vsaf <command>` directly.
|
|
4
3
|
|
|
5
4
|
.PHONY: help index verify review archive status mine clean
|
|
6
5
|
|
|
7
|
-
SHELL := /bin/bash
|
|
8
|
-
|
|
9
|
-
# ── Help ───────────────────────────────────────────────────────────────────────
|
|
10
|
-
|
|
11
6
|
help: ## Show this help
|
|
12
7
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
|
|
13
8
|
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
index: ## Re-index codebase (GitNexus + Graphify)
|
|
18
|
-
@echo "==> Re-indexing codebase..."
|
|
19
|
-
gitnexus analyze
|
|
20
|
-
@if command -v graphify &>/dev/null; then \
|
|
21
|
-
graphify . --update 2>/dev/null || echo "[WARN] graphify update failed — run '/graphify . --update' in Claude Code"; \
|
|
22
|
-
fi
|
|
23
|
-
@echo "==> Index complete"
|
|
24
|
-
|
|
25
|
-
# ── Review (3-layer) ──────────────────────────────────────────────────────────
|
|
26
|
-
|
|
27
|
-
verify: ## Layer 2: Check implementation against OpenSpec specs
|
|
28
|
-
openspec validate --all
|
|
29
|
-
|
|
30
|
-
review: ## Run 3-layer review (methodology + spec + re-index)
|
|
31
|
-
@echo "==> Layer 1: Methodology review"
|
|
32
|
-
@echo " Run in Claude Code: /superpowers:code-review"
|
|
33
|
-
@echo ""
|
|
34
|
-
@echo "==> Layer 2: Spec compliance"
|
|
35
|
-
openspec validate --all
|
|
36
|
-
@echo ""
|
|
37
|
-
@echo "==> Layer 3: Re-index knowledge graph"
|
|
38
|
-
$(MAKE) index
|
|
39
|
-
@echo ""
|
|
40
|
-
@echo "==> 3-layer review complete"
|
|
41
|
-
|
|
42
|
-
# ── Spec Lifecycle ─────────────────────────────────────────────────────────────
|
|
43
|
-
|
|
44
|
-
archive: ## Archive specs + re-index (post-merge)
|
|
45
|
-
openspec archive
|
|
46
|
-
$(MAKE) index
|
|
47
|
-
@echo "==> Archived and re-indexed"
|
|
10
|
+
index: ## Run `vsaf index`
|
|
11
|
+
@vsaf index
|
|
48
12
|
|
|
49
|
-
|
|
13
|
+
verify: ## Run `vsaf verify`
|
|
14
|
+
@vsaf verify
|
|
50
15
|
|
|
51
|
-
|
|
52
|
-
@
|
|
16
|
+
review: ## Run `vsaf review`
|
|
17
|
+
@vsaf review
|
|
53
18
|
|
|
54
|
-
|
|
19
|
+
archive: ## Run `vsaf archive`
|
|
20
|
+
@vsaf archive
|
|
55
21
|
|
|
56
|
-
|
|
57
|
-
@
|
|
58
|
-
echo "==> GitNexus"; \
|
|
59
|
-
gitnexus status 2>/dev/null || echo " [not indexed]"; \
|
|
60
|
-
echo ""; \
|
|
61
|
-
echo "==> MemPalace"; \
|
|
62
|
-
mempalace status 2>/dev/null || echo " [not initialized]"; \
|
|
63
|
-
echo ""; \
|
|
64
|
-
echo "==> OpenSpec"; \
|
|
65
|
-
openspec list 2>/dev/null || echo " [no active changes]"; \
|
|
66
|
-
echo ""; \
|
|
67
|
-
echo "==> Graphify output"; \
|
|
68
|
-
ls graphify-out/ 2>/dev/null || echo " [no output — run '/graphify .' in Claude Code]"; \
|
|
69
|
-
echo ""; \
|
|
70
|
-
echo "==> claude-mem"; \
|
|
71
|
-
curl -sf http://localhost:37777 >/dev/null 2>&1 && echo " Web viewer: http://localhost:37777" || echo " [web viewer not running]"
|
|
22
|
+
mine: ## Run `vsaf mine`
|
|
23
|
+
@vsaf mine
|
|
72
24
|
|
|
73
|
-
|
|
25
|
+
status: ## Run `vsaf status`
|
|
26
|
+
@vsaf status
|
|
74
27
|
|
|
75
|
-
clean: ##
|
|
76
|
-
@
|
|
77
|
-
[ "$$confirm" = "y" ] && gitnexus clean || echo "Aborted."
|
|
28
|
+
clean: ## Run `vsaf clean`
|
|
29
|
+
@vsaf clean
|
package/bin/vsaf.js
CHANGED
|
@@ -11,6 +11,12 @@ USAGE
|
|
|
11
11
|
vsaf global Install global infra only (skills, binaries)
|
|
12
12
|
vsaf project Scaffold project files only (assumes global done)
|
|
13
13
|
vsaf status Show installation status
|
|
14
|
+
vsaf index Re-index codebase (GitNexus + Graphify)
|
|
15
|
+
vsaf verify Check implementation against OpenSpec specs
|
|
16
|
+
vsaf review Run 3-layer review flow
|
|
17
|
+
vsaf archive Archive specs and re-index
|
|
18
|
+
vsaf mine Mine conversations into MemPalace
|
|
19
|
+
vsaf clean Clean GitNexus index
|
|
14
20
|
|
|
15
21
|
GLOBAL (once per machine → ~/.claude/)
|
|
16
22
|
Skills : bmad (41), openspec (4), vsaf (5), gitnexus (6)
|
|
@@ -21,13 +27,11 @@ PER PROJECT (per repo, run inside the repo root)
|
|
|
21
27
|
.claude/skills + .codex/skills BMAD skills synced for local clients
|
|
22
28
|
_bmad + _bmad-output BMAD workspace + generated artifacts folders
|
|
23
29
|
CLAUDE.md 10-step workflow rules
|
|
24
|
-
Makefile index, verify, review, archive, mine, status
|
|
25
|
-
scripts/ Session-end check hook
|
|
26
30
|
|
|
27
31
|
EXAMPLES
|
|
28
32
|
npx vsaf init # New machine + new project (recommended)
|
|
29
|
-
npx vsaf
|
|
30
|
-
npx vsaf
|
|
33
|
+
npx vsaf verify # Validate current implementation
|
|
34
|
+
npx vsaf index # Refresh code intelligence indexes
|
|
31
35
|
npx vsaf status # Check what is installed
|
|
32
36
|
`;
|
|
33
37
|
|
|
@@ -55,6 +59,36 @@ async function main() {
|
|
|
55
59
|
await showStatus();
|
|
56
60
|
break;
|
|
57
61
|
}
|
|
62
|
+
case 'index': {
|
|
63
|
+
const { runIndex } = require('../src/workflow');
|
|
64
|
+
runIndex();
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
case 'verify': {
|
|
68
|
+
const { runVerify } = require('../src/workflow');
|
|
69
|
+
runVerify();
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
case 'review': {
|
|
73
|
+
const { runReview } = require('../src/workflow');
|
|
74
|
+
runReview();
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
case 'archive': {
|
|
78
|
+
const { runArchive } = require('../src/workflow');
|
|
79
|
+
runArchive();
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case 'mine': {
|
|
83
|
+
const { runMine } = require('../src/workflow');
|
|
84
|
+
runMine();
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
case 'clean': {
|
|
88
|
+
const { runClean } = require('../src/workflow');
|
|
89
|
+
runClean();
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
58
92
|
default:
|
|
59
93
|
console.log(HELP);
|
|
60
94
|
if (cmd && cmd !== '--help' && cmd !== 'help') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngocsangairvds/vsaf",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "VSAF — Agentic AI SDLC Framework. Spec-driven development, 3-layer review, 7 integrated tools.",
|
|
5
5
|
"keywords": ["claude", "claude-code", "ai", "sdlc", "framework", "bmad", "openspec"],
|
|
6
6
|
"bin": {
|
package/src/project.js
CHANGED
|
@@ -24,9 +24,9 @@ async function installProject() {
|
|
|
24
24
|
|
|
25
25
|
console.log('\n\x1b[32m\x1b[1m✓ Project ready.\x1b[0m');
|
|
26
26
|
console.log('\n Next steps:');
|
|
27
|
-
console.log('
|
|
28
|
-
console.log('
|
|
29
|
-
console.log(' /
|
|
27
|
+
console.log(' vsaf status check all tools');
|
|
28
|
+
console.log(' vsaf index build/update knowledge graph');
|
|
29
|
+
console.log(' /plugin install superpowers@claude-plugins-official\n');
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// ── File scaffold ────────────────────────────────────────────────────────────
|
|
@@ -37,8 +37,6 @@ function scaffoldFiles() {
|
|
|
37
37
|
const files = [
|
|
38
38
|
{ tpl: '.claude/settings.json', dst: '.claude/settings.json' },
|
|
39
39
|
{ tpl: 'CLAUDE.md', dst: 'CLAUDE.md' },
|
|
40
|
-
{ tpl: 'Makefile', dst: 'Makefile' },
|
|
41
|
-
{ tpl: 'scripts/session-end-check.sh', dst: 'scripts/session-end-check.sh', chmod: 0o755 },
|
|
42
40
|
];
|
|
43
41
|
|
|
44
42
|
for (const { tpl, dst, chmod } of files) {
|
package/src/status.js
CHANGED
|
@@ -19,8 +19,6 @@ async function showStatus() {
|
|
|
19
19
|
console.log('\n\x1b[1mProject (current repo)\x1b[0m');
|
|
20
20
|
checkPath('.claude/settings.json', 'Project settings');
|
|
21
21
|
checkPath('CLAUDE.md', 'Workflow rules');
|
|
22
|
-
checkPath('Makefile', 'Makefile');
|
|
23
|
-
checkPath('scripts/session-end-check.sh', 'Session-end hook');
|
|
24
22
|
checkPath('_bmad', 'BMAD workspace');
|
|
25
23
|
checkPath('_bmad-output', 'BMAD output folder');
|
|
26
24
|
checkProjectSkillDir('.claude/skills', 'Project BMAD skills (.claude)');
|
package/src/utils.js
CHANGED
|
@@ -12,8 +12,12 @@ const warn = (msg) => console.log(` \x1b[33m!\x1b[0m ${msg}`);
|
|
|
12
12
|
const step = (msg) => console.log(`\n\x1b[1m${msg}\x1b[0m`);
|
|
13
13
|
|
|
14
14
|
function hasCommand(cmd) {
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const versionCheck = spawnSync(cmd, ['--version'], { stdio: 'ignore', shell: false });
|
|
16
|
+
if (versionCheck.status === 0) return true;
|
|
17
|
+
|
|
18
|
+
// Some CLIs don't support --version but are still available on PATH.
|
|
19
|
+
const pathCheck = spawnSync('sh', ['-c', `command -v "${cmd}"`], { stdio: 'ignore', shell: false });
|
|
20
|
+
return pathCheck.status === 0;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
function exec(cmd, opts = {}) {
|
package/src/workflow.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { ok, info, warn, step, hasCommand, exec } = require('./utils');
|
|
4
|
+
|
|
5
|
+
function runIndex() {
|
|
6
|
+
step('Index');
|
|
7
|
+
|
|
8
|
+
if (!hasCommand('gitnexus')) {
|
|
9
|
+
warn('gitnexus not found — run: vsaf global');
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
info('Running gitnexus analyze...');
|
|
14
|
+
exec('gitnexus analyze') ? ok('GitNexus index updated') : warn('gitnexus analyze failed — run manually');
|
|
15
|
+
|
|
16
|
+
if (!hasCommand('graphify')) {
|
|
17
|
+
warn('graphify not found — skipping graphify update');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
info('Running graphify update...');
|
|
22
|
+
exec('graphify . --update') ? ok('Graphify updated') : warn('graphify update failed — run manually');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function runVerify() {
|
|
26
|
+
step('Verify');
|
|
27
|
+
if (!hasCommand('openspec')) {
|
|
28
|
+
warn('openspec not found — run: vsaf global');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
info('Running openspec validate --all...');
|
|
33
|
+
exec('openspec validate --all') ? ok('OpenSpec verification passed') : warn('OpenSpec verification failed');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function runReview() {
|
|
37
|
+
step('Review (3-layer)');
|
|
38
|
+
info('Layer 1: Methodology review — run in Claude Code: /superpowers:code-review');
|
|
39
|
+
info('Layer 2: Spec compliance');
|
|
40
|
+
runVerify();
|
|
41
|
+
info('Layer 3: Knowledge graph sync');
|
|
42
|
+
runIndex();
|
|
43
|
+
ok('Review flow completed');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function runArchive() {
|
|
47
|
+
step('Archive');
|
|
48
|
+
if (!hasCommand('openspec')) {
|
|
49
|
+
warn('openspec not found — run: vsaf global');
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
info('Running openspec archive...');
|
|
54
|
+
exec('openspec archive') ? ok('OpenSpec archived') : warn('openspec archive failed — run manually');
|
|
55
|
+
runIndex();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function runMine() {
|
|
59
|
+
step('Mine');
|
|
60
|
+
if (!hasCommand('mempalace')) {
|
|
61
|
+
warn('mempalace not found — run: vsaf global');
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
info('Running mempalace mine ~/chats/ --mode convos --extract general...');
|
|
66
|
+
exec('mempalace mine ~/chats/ --mode convos --extract general')
|
|
67
|
+
? ok('MemPalace mine completed')
|
|
68
|
+
: warn('mempalace mine failed — run manually');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function runClean() {
|
|
72
|
+
step('Clean');
|
|
73
|
+
if (!hasCommand('gitnexus')) {
|
|
74
|
+
warn('gitnexus not found — run: vsaf global');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
info('Running gitnexus clean...');
|
|
79
|
+
exec('gitnexus clean') ? ok('GitNexus index cleaned') : warn('gitnexus clean failed — run manually');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = { runIndex, runVerify, runReview, runArchive, runMine, runClean };
|
|
83
|
+
|