@ngocsangairvds/vsaf 3.0.2 → 3.0.4

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.
@@ -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 — ECC (tự động)
34
- - ECC hooks chạy tự động — không cần gọi thủ công
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 (ECC)
28
- - Chạy `npx ecc-agentshield scan`
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 + ECC cherry-pick
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
- make setup # Install all 8 tools (idempotent — safe to re-run)
34
- make index # Build knowledge graph
35
- make status # Verify everything is working
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 # ECC hooks: block secrets, protect config files
67
+ │ ├── settings.json # Local AI settings (optional hook policy)
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
- ├── githooks/ # Git hooks (pre-push runs verify + security scan)
73
- ├── graphify-out/ # Graphify output (gitignored, regenerated by make index)
72
+ ├── githooks/ # Optional local hooks (disabled by default)
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 (called by make setup)
76
+ │ └── setup-vsaf.sh # Full setup automation (used by `vsaf init`)
77
77
  ├── CLAUDE.md # Claude Code system prompt — workflow rules
78
- └── Makefile # All day-to-day operations
78
+ └── Makefile # Legacy wrapper (optional; use `vsaf` commands)
79
79
  ```
80
80
 
81
81
  ## Daily Operations
82
82
 
83
- Run `make help` for the full list. Highlights:
83
+ Run `npx @ngocsangairvds/vsaf@latest --help` for the full list. Highlights:
84
84
 
85
85
  | Command | What It Does |
86
86
  |---|---|
87
- | `make setup` | Install or update all tools |
88
- | `make index` | Re-index codebase (GitNexus + Graphify) — run after every merge |
89
- | `make verify` | Check implementation against OpenSpec specs |
90
- | `make review` | Full 3-layer review coordinator |
91
- | `make status` | Show status of all installed tools |
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
- | **ECC (cherry-pick)** | Security scanner (AgentShield) + git hooks (block secrets) + coding standards | Free |
114
+ | **Security guardrails** | Optional hooks/policies + coding standards (team-defined security scanning) | 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 |
@@ -121,4 +121,4 @@ for a full command-by-command example.
121
121
 
122
122
  **Core principles:** Spec before code. Context is king. Git is source of truth.
123
123
  3-layer review before every PR. Re-index after every merge. Mine decisions
124
- weekly.
124
+ weekly. Hooks are optional in the current simplified setup.
@@ -26,7 +26,7 @@
26
26
  "hooks": [
27
27
  {
28
28
  "type": "command",
29
- "command": "bash scripts/session-end-check.sh"
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), `scripts/` (helper scripts), `.gitnexus/` (knowledge graph index).
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
- make index # Re-index: gitnexus analyze + graphify update
35
- make verify # Check implementation against OpenSpec specs
36
- make review # Full 3-layer review coordinator
37
- make archive # Archive specs + re-index (post-merge)
38
- make mine # Mine conversations into MemPalace
39
- make status # Show status of all tools
40
- make clean # Clean GitNexus index
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: `make index`
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: make verify
168
+ /opsx:verify # or: vsaf verify
169
169
 
170
170
  # Layer 3: Knowledge graph sync
171
- make index # gitnexus analyze + graphify update
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
- make archive # openspec archive + re-index
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 | `make index` after every merge |
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
- # VSAF v3 Agentic AI SDLC Framework
2
- # Day-to-day operations via Make targets.
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
- # ── Knowledge Graph ────────────────────────────────────────────────────────────
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
- # ── Memory ─────────────────────────────────────────────────────────────────────
13
+ verify: ## Run `vsaf verify`
14
+ @vsaf verify
50
15
 
51
- mine: ## Mine conversations into MemPalace knowledge base
52
- @export PATH="$$HOME/.local/bin:$$PATH"; mempalace mine ~/chats/ --mode convos --extract general
16
+ review: ## Run `vsaf review`
17
+ @vsaf review
53
18
 
54
- # ── Status ─────────────────────────────────────────────────────────────────────
19
+ archive: ## Run `vsaf archive`
20
+ @vsaf archive
55
21
 
56
- status: ## Show status of all tools
57
- @export PATH="$$HOME/.local/bin:$$PATH"; \
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
- # ── Maintenance ────────────────────────────────────────────────────────────────
25
+ status: ## Run `vsaf status`
26
+ @vsaf status
74
27
 
75
- clean: ## Clean GitNexus index (requires confirmation)
76
- @read -p "This will remove the GitNexus index. Continue? [y/N] " confirm && \
77
- [ "$$confirm" = "y" ] && gitnexus clean || echo "Aborted."
28
+ clean: ## Run `vsaf clean`
29
+ @vsaf clean
package/bin/vsaf.js CHANGED
@@ -11,27 +11,38 @@ 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 (manual pre-push gate)
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)
17
23
  Binaries: gitnexus, openspec, graphify, mempalace, bun, claude-mem
18
24
 
19
25
  PER PROJECT (per repo, run inside the repo root)
20
- .claude/settings.json Hooks: secret detection, protected files
26
+ .claude/settings.json Local AI settings (optional hook policy)
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 global # Already have projects, new machine
30
- npx vsaf project # Global already done, add VSAF to existing repo
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
 
34
38
  async function main() {
39
+ const runAndExit = (result, label) => {
40
+ if (result === false) {
41
+ console.error(`\n${label} failed.`);
42
+ process.exit(1);
43
+ }
44
+ };
45
+
35
46
  switch (cmd) {
36
47
  case 'init': {
37
48
  const { installGlobal } = require('../src/global');
@@ -55,6 +66,36 @@ async function main() {
55
66
  await showStatus();
56
67
  break;
57
68
  }
69
+ case 'index': {
70
+ const { runIndex } = require('../src/workflow');
71
+ runAndExit(runIndex(), 'Index');
72
+ break;
73
+ }
74
+ case 'verify': {
75
+ const { runVerify } = require('../src/workflow');
76
+ runAndExit(runVerify(), 'Verify');
77
+ break;
78
+ }
79
+ case 'review': {
80
+ const { runReview } = require('../src/workflow');
81
+ runAndExit(runReview(), 'Review');
82
+ break;
83
+ }
84
+ case 'archive': {
85
+ const { runArchive } = require('../src/workflow');
86
+ runAndExit(runArchive(), 'Archive');
87
+ break;
88
+ }
89
+ case 'mine': {
90
+ const { runMine } = require('../src/workflow');
91
+ runAndExit(runMine(), 'Mine');
92
+ break;
93
+ }
94
+ case 'clean': {
95
+ const { runClean } = require('../src/workflow');
96
+ runAndExit(runClean(), 'Clean');
97
+ break;
98
+ }
58
99
  default:
59
100
  console.log(HELP);
60
101
  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.2",
3
+ "version": "3.0.4",
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
@@ -20,13 +20,12 @@ async function installProject() {
20
20
  initOpenSpec();
21
21
  initGitNexus();
22
22
  initMemPalace();
23
- configureGitHooks();
24
23
 
25
24
  console.log('\n\x1b[32m\x1b[1m✓ Project ready.\x1b[0m');
26
25
  console.log('\n Next steps:');
27
- console.log(' make status check all tools');
28
- console.log(' /graphify . build knowledge graph (inside Claude Code)');
29
- console.log(' /superpowers install install Superpowers plugin (inside Claude Code)\n');
26
+ console.log(' vsaf status check all tools');
27
+ console.log(' vsaf index build/update knowledge graph');
28
+ console.log(' /plugin install superpowers@claude-plugins-official\n');
30
29
  }
31
30
 
32
31
  // ── File scaffold ────────────────────────────────────────────────────────────
@@ -37,8 +36,6 @@ function scaffoldFiles() {
37
36
  const files = [
38
37
  { tpl: '.claude/settings.json', dst: '.claude/settings.json' },
39
38
  { 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
39
  ];
43
40
 
44
41
  for (const { tpl, dst, chmod } of files) {
@@ -166,12 +163,5 @@ function initMemPalace() {
166
163
  exec(`mempalace init --yes "${CWD}"`, { cwd: CWD }) ? ok('MemPalace initialised') : warn('mempalace init failed — run manually');
167
164
  }
168
165
 
169
- function configureGitHooks() {
170
- step('Git hooks');
171
- if (!fs.existsSync(path.join(CWD, '.git'))) { warn('Not a git repo — skipping'); return; }
172
- fs.mkdirSync(path.join(CWD, 'githooks'), { recursive: true });
173
- exec('git config core.hooksPath githooks/', { cwd: CWD });
174
- ok('Git hooks path → githooks/');
175
- }
176
166
 
177
167
  module.exports = { installProject };
package/src/status.js CHANGED
@@ -17,10 +17,8 @@ async function showStatus() {
17
17
 
18
18
  // ── Project ────────────────────────────────────────────────────────────────
19
19
  console.log('\n\x1b[1mProject (current repo)\x1b[0m');
20
- checkPath('.claude/settings.json', 'Project settings');
20
+ checkPath('.claude/settings.json', 'Project settings (optional hooks)');
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)');
@@ -28,7 +26,6 @@ async function showStatus() {
28
26
  checkPath('.gitnexus', 'GitNexus index');
29
27
  checkPath('openspec', 'OpenSpec');
30
28
  checkPath('mempalace.yaml', 'MemPalace');
31
- checkPath('githooks', 'Git hooks');
32
29
  console.log('');
33
30
  }
34
31
 
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 r = spawnSync(cmd, ['--version'], { stdio: 'ignore', shell: false });
16
- return r.status === 0;
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 = {}) {
@@ -0,0 +1,102 @@
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 false;
11
+ }
12
+
13
+ info('Running gitnexus analyze...');
14
+ const gitnexusOk = exec('gitnexus analyze');
15
+ gitnexusOk ? ok('GitNexus index updated') : warn('gitnexus analyze failed — run manually');
16
+
17
+ if (!hasCommand('graphify')) {
18
+ warn('graphify not found — skipping graphify update');
19
+ return false;
20
+ }
21
+
22
+ info('Running graphify update...');
23
+ const graphifyOk = exec('graphify update .');
24
+ graphifyOk ? ok('Graphify updated') : warn('graphify update failed — run manually');
25
+
26
+ return gitnexusOk && graphifyOk;
27
+ }
28
+
29
+ function runVerify() {
30
+ step('Verify');
31
+ if (!hasCommand('openspec')) {
32
+ warn('openspec not found — run: vsaf global');
33
+ return false;
34
+ }
35
+
36
+ info('Running openspec validate --all...');
37
+ const okVerify = exec('openspec validate --all');
38
+ okVerify ? ok('OpenSpec verification passed') : warn('OpenSpec verification failed');
39
+ return okVerify;
40
+ }
41
+
42
+ function runReview() {
43
+ step('Review (3-layer)');
44
+ info('Layer 1: Methodology review — run in Claude Code: /superpowers:code-review');
45
+ info('Layer 2: Spec compliance');
46
+ const verifyOk = runVerify();
47
+ info('Layer 3: Knowledge graph sync');
48
+ const indexOk = runIndex();
49
+
50
+ if (verifyOk && indexOk) {
51
+ ok('Review flow completed');
52
+ return true;
53
+ }
54
+
55
+ warn('Review flow completed with failures. Fix warnings and re-run.');
56
+ return false;
57
+ }
58
+
59
+ function runArchive() {
60
+ step('Archive');
61
+ if (!hasCommand('openspec')) {
62
+ warn('openspec not found — run: vsaf global');
63
+ return false;
64
+ }
65
+
66
+ info('Running openspec archive...');
67
+ const archiveOk = exec('openspec archive');
68
+ archiveOk ? ok('OpenSpec archived') : warn('openspec archive failed — run manually');
69
+ const indexOk = runIndex();
70
+ return archiveOk && indexOk;
71
+ }
72
+
73
+ function runMine() {
74
+ step('Mine');
75
+ if (!hasCommand('mempalace')) {
76
+ warn('mempalace not found — run: vsaf global');
77
+ return false;
78
+ }
79
+
80
+ info('Running mempalace mine ~/chats/ --mode convos --extract general...');
81
+ const mineOk = exec('mempalace mine ~/chats/ --mode convos --extract general');
82
+ mineOk
83
+ ? ok('MemPalace mine completed')
84
+ : warn('mempalace mine failed — run manually');
85
+ return mineOk;
86
+ }
87
+
88
+ function runClean() {
89
+ step('Clean');
90
+ if (!hasCommand('gitnexus')) {
91
+ warn('gitnexus not found — run: vsaf global');
92
+ return false;
93
+ }
94
+
95
+ info('Running gitnexus clean...');
96
+ const cleanOk = exec('gitnexus clean');
97
+ cleanOk ? ok('GitNexus index cleaned') : warn('gitnexus clean failed — run manually');
98
+ return cleanOk;
99
+ }
100
+
101
+ module.exports = { runIndex, runVerify, runReview, runArchive, runMine, runClean };
102
+