@boyingliu01/xp-gate 0.12.3 → 0.12.5

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.
Files changed (54) hide show
  1. package/adapters/cpp.sh +0 -0
  2. package/adapters/dart.sh +0 -0
  3. package/adapters/flutter.sh +0 -0
  4. package/adapters/go.sh +0 -0
  5. package/adapters/java.sh +0 -0
  6. package/adapters/kotlin.sh +0 -0
  7. package/adapters/objectivec.sh +0 -0
  8. package/adapters/powershell.sh +0 -0
  9. package/adapters/python.sh +13 -2
  10. package/adapters/shell.sh +0 -0
  11. package/adapters/swift.sh +0 -0
  12. package/adapters/typescript.sh +0 -0
  13. package/bin/xp-gate.js +0 -8
  14. package/gate-3.sh +0 -0
  15. package/gate-4.sh +0 -0
  16. package/gate-7.sh +0 -0
  17. package/gate-8.sh +0 -0
  18. package/gate-9.sh +13 -13
  19. package/hooks/gate-9.sh +130 -0
  20. package/hooks/pre-commit +139 -53
  21. package/lib/arch.js +42 -10
  22. package/lib/init.js +9 -6
  23. package/lib/sprint-status.js +35 -1
  24. package/lib/update-hooks.js +46 -46
  25. package/mock-policy/AGENTS.md +2 -2
  26. package/mutation/AGENTS.md +2 -2
  27. package/package.json +1 -1
  28. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  29. package/plugins/claude-code/skills/delphi-review/AGENTS.md +2 -2
  30. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +2 -2
  31. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +2 -2
  32. package/plugins/opencode/package.json +1 -1
  33. package/plugins/opencode/scripts/prepack.cjs +0 -15
  34. package/plugins/opencode/skills/delphi-review/AGENTS.md +2 -2
  35. package/plugins/opencode/skills/sprint-flow/AGENTS.md +2 -2
  36. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +2 -2
  37. package/plugins/qoder/plugin.json +1 -1
  38. package/plugins/qoder/skills/delphi-review/AGENTS.md +2 -2
  39. package/plugins/qoder/skills/sprint-flow/AGENTS.md +2 -2
  40. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +2 -2
  41. package/principles/AGENTS.md +2 -2
  42. package/principles/index.ts +15 -2
  43. package/skills/delphi-review/AGENTS.md +2 -2
  44. package/skills/sprint-flow/AGENTS.md +2 -2
  45. package/skills/test-specification-alignment/AGENTS.md +2 -2
  46. package/lib/__tests__/next-sprint.test.js +0 -231
  47. package/lib/next-sprint.js +0 -129
  48. package/lib/shared-phase-constants.d.ts +0 -17
  49. package/lib/shared-phase-constants.js +0 -77
  50. package/plugins/opencode/__tests__/tui-plugin.test.ts +0 -543
  51. package/plugins/opencode/__tests__/xp-gate-e2e-upgrade.test.ts +0 -562
  52. package/plugins/opencode/__tests__/xp-gate-update.test.ts +0 -518
  53. package/plugins/opencode/tui-plugin.ts +0 -414
  54. package/plugins/opencode/tui-plugin.tsx +0 -306
package/lib/arch.js CHANGED
@@ -4,7 +4,11 @@ const { spawnSync } = require('child_process');
4
4
  const fs = require('fs');
5
5
  const path = require('path');
6
6
 
7
- // Looks for architecture.yaml in CWD, then walks up to git root.
7
+ function isPythonProject(dir) {
8
+ const markers = ['setup.py', 'setup.cfg', 'pyproject.toml', 'requirements.txt'];
9
+ return markers.some((m) => fs.existsSync(path.join(dir, m)));
10
+ }
11
+
8
12
  function findArchConfig(startDir) {
9
13
  let dir = path.resolve(startDir);
10
14
  const root = path.parse(dir).root;
@@ -17,6 +21,39 @@ function findArchConfig(startDir) {
17
21
  return null;
18
22
  }
19
23
 
24
+ function runArchlinter(config) {
25
+ const result = spawnSync(
26
+ 'npx',
27
+ ['-y', '@archlinter/cli', 'scan', '.', '--config', config],
28
+ { stdio: 'inherit', shell: process.platform === 'win32' },
29
+ );
30
+ if (result.error && result.error.code === 'ENOENT') {
31
+ console.error('[xp-gate arch] ERROR: npx not found in PATH. Install Node.js >=18.');
32
+ return 1;
33
+ }
34
+ return result.status === null ? 1 : result.status;
35
+ }
36
+
37
+ function runArchy(config) {
38
+ const result = spawnSync('archy', ['check', '.', '--config', config], {
39
+ stdio: 'inherit',
40
+ shell: process.platform === 'win32',
41
+ });
42
+ if (result.error && result.error.code === 'ENOENT') {
43
+ console.warn('[xp-gate arch] archy not found on PATH; trying npx fallback.');
44
+ const npxResult = spawnSync('npx', ['-y', 'archy', 'check', '.', '--config', config], {
45
+ stdio: 'inherit',
46
+ shell: process.platform === 'win32',
47
+ });
48
+ if (npxResult.error && npxResult.error.code === 'ENOENT') {
49
+ console.error('[xp-gate arch] ERROR: neither archy nor npx found in PATH.');
50
+ return 1;
51
+ }
52
+ return npxResult.status === null ? 1 : npxResult.status;
53
+ }
54
+ return result.status === null ? 1 : result.status;
55
+ }
56
+
20
57
  function arch(args) {
21
58
  const configIdx = args.indexOf('--config');
22
59
  const explicitConfig = configIdx >= 0 ? args[configIdx + 1] : null;
@@ -33,17 +70,12 @@ function arch(args) {
33
70
  return Promise.resolve(1);
34
71
  }
35
72
 
36
- const result = spawnSync('npx', ['-y', '@archlinter/cli', 'scan', '.', '--config', config], {
37
- stdio: 'inherit',
38
- shell: process.platform === 'win32',
39
- });
40
-
41
- if (result.error && result.error.code === 'ENOENT') {
42
- console.error('[xp-gate arch] ERROR: npx not found in PATH. Install Node.js >=18.');
43
- return Promise.resolve(1);
73
+ if (isPythonProject(process.cwd())) {
74
+ console.log('[xp-gate arch] Detected Python project — using archy');
75
+ return Promise.resolve(runArchy(config));
44
76
  }
45
77
 
46
- return Promise.resolve(result.status === null ? 1 : result.status);
78
+ return Promise.resolve(runArchlinter(config));
47
79
  }
48
80
 
49
81
  module.exports = { arch };
package/lib/init.js CHANGED
@@ -35,13 +35,16 @@ function copyAdapters(srcDir, destDir) {
35
35
  }
36
36
  });
37
37
  }
38
- // Copy gate scripts (gate-3.sh through gate-9.sh) from package root to destDir.
38
+ // Copy gate scripts (gate-*.sh) from githooks/ source-of-truth to destDir.
39
39
  // These are sourced by pre-commit via GATE_DIR which resolves to the adapter dir.
40
- fs.readdirSync(srcDir).forEach(f => {
41
- if (f.startsWith('gate-') && f.endsWith('.sh')) {
42
- fs.copyFileSync(path.join(srcDir, f), path.join(destDir, f));
43
- }
44
- });
40
+ const githooksDir = path.resolve(srcDir, '..', '..', '..', 'githooks');
41
+ if (fs.existsSync(githooksDir)) {
42
+ fs.readdirSync(githooksDir).forEach(f => {
43
+ if (f.startsWith('gate-') && f.endsWith('.sh')) {
44
+ fs.copyFileSync(path.join(githooksDir, f), path.join(destDir, f));
45
+ }
46
+ });
47
+ }
45
48
  }
46
49
 
47
50
  function copyRecursive(src, dest) {
@@ -9,9 +9,43 @@
9
9
 
10
10
  const fs = require('fs');
11
11
  const path = require('path');
12
- const { PHASE_NAMES, PHASE_ORDER, getLatestTimestamp, isStale } = require('./shared-phase-constants');
13
12
  const { discoverActiveSprints } = require('./sprint-discovery');
14
13
 
14
+ // Phase constants (inlined; was shared-phase-constants.js, removed in v0.13.0 slimming)
15
+ const PHASE_NAMES = {
16
+ '-1': 'ISOLATE', '-0.5': 'AUTO-ESTIMATE',
17
+ '0': 'THINK', '1': 'PLAN', '2': 'BUILD', '3': 'REVIEW',
18
+ '4': 'USER ACCEPTANCE', '5': 'FEEDBACK', '6': 'SHIP', '7': 'LAND', '8': 'CLEANUP',
19
+ };
20
+ const PHASE_ORDER = ['-1', '-0.5', '0', '1', '2', '3', '4', '5', '6', '7', '8'];
21
+
22
+ function parseTime(value) {
23
+ if (!value) return 0;
24
+ const t = new Date(value).getTime();
25
+ return isNaN(t) ? 0 : t;
26
+ }
27
+
28
+ function getLatestTimestamp(state) {
29
+ if (!state || !state.started_at) return 0;
30
+ const started = parseTime(state.started_at);
31
+ if (!started) return 0;
32
+ const timestamps = [started];
33
+ if (Array.isArray(state.phase_history)) {
34
+ for (const ph of state.phase_history) {
35
+ timestamps.push(parseTime(ph.completed_at));
36
+ timestamps.push(parseTime(ph.started_at));
37
+ timestamps.push(parseTime(ph.timestamp));
38
+ }
39
+ }
40
+ return Math.max(...timestamps);
41
+ }
42
+
43
+ function isStale(state) {
44
+ if (!state || !state.started_at) return false;
45
+ const latest = getLatestTimestamp(state);
46
+ return latest > 0 && Date.now() - latest > 3600000;
47
+ }
48
+
15
49
  /**
16
50
  * Read and parse sprint-state.json from a project directory.
17
51
  * @param {string} dir - Project root directory
@@ -198,43 +198,25 @@ function copyGateScripts(srcDir, destDir, dryRun, noBackup) {
198
198
  });
199
199
  }
200
200
 
201
- /**
202
- * Main entry point: sync latest hook versions from xp-gate package to project or global directory.
203
- *
204
- * @param {Object} options
205
- * @param {boolean} [options.global=false] - Update global hooks (~/.config/xp-gate/)
206
- * @param {boolean} [options.force=false] - Skip local modification detection
207
- * @param {boolean} [options.dryRun=false] - Show what would be updated without writing
208
- * @param {boolean} [options.noBackup=false] - Skip creating .bak backup files
209
- * @param {string} [options.scope='all'] - Selectively update: 'hooks', 'adapters', or 'all'
210
- * @returns {number} Exit code (0 = success, 1 = error/warn)
211
- */
212
- function updateHooks(options = {}) {
213
- const { global = false, force = false, dryRun = false, noBackup = false, scope = 'all' } = options;
214
-
215
- // Use module.exports.getPackageRoot() so tests can mock via mod.getPackageRoot
216
- const srcDir = (module.exports && module.exports.getPackageRoot)
201
+ function resolveSrcDir() {
202
+ return (module.exports && module.exports.getPackageRoot)
217
203
  ? module.exports.getPackageRoot()
218
204
  : getPackageRoot();
205
+ }
219
206
 
220
- // Determine destination directories based on mode
221
- let hooksDestDir;
222
- let adaptersDestDir;
223
-
224
- if (global) {
225
- hooksDestDir = GLOBAL_HOOKS_DIR;
226
- adaptersDestDir = GLOBAL_ADAPTERS_DIR;
227
- } else {
228
- hooksDestDir = getProjectHooksDir();
229
- // For local mode, adapters go to project's githooks/ directory
230
- adaptersDestDir = path.join(process.cwd(), 'githooks');
231
- }
207
+ function resolveDirs(global) {
208
+ if (global) return { hooksDestDir: GLOBAL_HOOKS_DIR, adaptersDestDir: GLOBAL_ADAPTERS_DIR };
209
+ return { hooksDestDir: getProjectHooksDir(), adaptersDestDir: path.join(process.cwd(), 'githooks') };
210
+ }
232
211
 
233
- // Ensure destination directories exist
212
+ function ensureDirsExist(adaptersDestDir, hooksDestDir) {
234
213
  fs.mkdirSync(hooksDestDir, { recursive: true });
235
214
  fs.mkdirSync(adaptersDestDir, { recursive: true });
236
215
  fs.mkdirSync(path.join(adaptersDestDir, 'adapters'), { recursive: true });
216
+ }
237
217
 
218
+ function printUpdateHeader(opts) {
219
+ const { global, srcDir, hooksDestDir, adaptersDestDir, scope, dryRun } = opts;
238
220
  console.log(`XP-Gate Update Hooks`);
239
221
  console.log(`====================`);
240
222
  console.log(`Mode: ${global ? 'Global' : 'Local'}`);
@@ -244,35 +226,53 @@ function updateHooks(options = {}) {
244
226
  console.log(`Scope: ${scope}`);
245
227
  if (dryRun) console.log(`Dry run: yes (no files will be modified)`);
246
228
  console.log('');
229
+ }
247
230
 
248
- // Detect local modifications and warn (unless force or dryRun)
249
- if (!force && !dryRun) {
250
- const localMods = detectLocalModifications(srcDir, hooksDestDir, adaptersDestDir);
251
- if (localMods.length > 0) {
252
- console.warn(`[WARN] Detected ${localMods.length} locally modified file(s):`);
253
- localMods.forEach(f => console.warn(` - ${f}`));
254
- console.warn('Use --force to overwrite, or manually backup first.');
255
- return 1;
256
- }
257
- }
231
+ function checkLocalModifications(srcDir, hooksDestDir, adaptersDestDir, force, dryRun) {
232
+ if (force || dryRun) return 0;
233
+ const localMods = detectLocalModifications(srcDir, hooksDestDir, adaptersDestDir);
234
+ if (localMods.length === 0) return 0;
235
+ console.warn(`[WARN] Detected ${localMods.length} locally modified file(s):`);
236
+ localMods.forEach(f => console.warn(` - ${f}`));
237
+ console.warn('Use --force to overwrite, or manually backup first.');
238
+ return 1;
239
+ }
258
240
 
259
- // Copy files based on scope
241
+ function copyByScope(opts) {
242
+ const { scope, srcDir, hooksDestDir, adaptersDestDir, dryRun, noBackup } = opts;
260
243
  if (scope === 'all' || scope === 'hooks') {
261
- console.log('Updating hooks...');
244
+ printInfo('hooks');
262
245
  copyHooks(srcDir, hooksDestDir, dryRun, noBackup);
263
246
  }
264
247
  if (scope === 'all' || scope === 'adapters') {
265
- console.log('Updating adapters...');
248
+ printInfo('adapters');
266
249
  copyAdapters(srcDir, adaptersDestDir, dryRun, noBackup);
267
250
  }
268
251
  if (scope === 'all') {
269
- console.log('Updating gate scripts...');
252
+ printInfo('gate scripts');
270
253
  copyGateScripts(srcDir, adaptersDestDir, dryRun, noBackup);
271
254
  }
255
+ }
272
256
 
273
- if (!dryRun) {
274
- console.log('\nUpdate complete!');
275
- }
257
+ function printInfo(label) { console.log(`Updating ${label}...`); }
258
+
259
+ /**
260
+ * Main entry point: sync latest hook versions from xp-gate package to project or global directory.
261
+ */
262
+ function updateHooks(options = {}) {
263
+ const { global = false, force = false, dryRun = false, noBackup = false, scope = 'all' } = options;
264
+ const srcDir = resolveSrcDir();
265
+ const { hooksDestDir, adaptersDestDir } = resolveDirs(global);
266
+
267
+ ensureDirsExist(adaptersDestDir, hooksDestDir);
268
+ printUpdateHeader({ global, srcDir, hooksDestDir, adaptersDestDir, scope, dryRun });
269
+
270
+ const modCheck = checkLocalModifications(srcDir, hooksDestDir, adaptersDestDir, force, dryRun);
271
+ if (modCheck !== 0) return modCheck;
272
+
273
+ copyByScope({ scope, srcDir, hooksDestDir, adaptersDestDir, dryRun, noBackup });
274
+
275
+ if (!dryRun) console.log('\nUpdate complete!');
276
276
  return 0;
277
277
  }
278
278
 
@@ -1,9 +1,9 @@
1
1
  # SRC/MOCK-POLICY KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Mock layering policy enforcement — Gate M3 of pre-push hook. Ensures integration tests use real implementations for internal dependencies, mock external dependencies, and annotate pending mocks with removal plans. Combines project scope scanning, mock decision engine, and per-file validation into a single pipeline.
@@ -1,9 +1,9 @@
1
1
  # SRC/MUTATION KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **Gate M** (incremental mutation testing) + **Gate M2** helpers (test-layer detection used by `src/mock-policy/`). Pre-push quality gate. TypeScript-only; uses Stryker.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boyingliu01/xp-gate",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "description": "AI-driven development workflow: 6 quality gates + Delphi review + Sprint Flow",
5
5
  "bin": {
6
6
  "xp-gate": "./bin/xp-gate.js"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xp-gate",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Claude Code. Includes 10 quality gates (Gate 0-9), Sprint Flow (11 phases), and Delphi multi-expert review (>=90% consensus).",
6
6
  "author": {
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → SHIP → LAND → USER ACCEPTANCE → FEEDBACK → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: design must pass Delphi review (≥90% consensus) before any coding.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boyingliu01/opencode-plugin",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "description": "XP-Gate quality gates + AI workflow skills + Sprint Flow TUI sidebar for OpenCode",
@@ -80,21 +80,6 @@ function main() {
80
80
  }
81
81
 
82
82
  console.error(`[prepack] done: ${copied} skills bundled for @boyingliu01/opencode-plugin`);
83
-
84
- // Validate tui-plugin.ts structural integrity (Issue #248: stale cache detection)
85
- const tuiFile = path.join(PLUGIN_ROOT, 'tui-plugin.ts');
86
- const tuiContent = fs.readFileSync(tuiFile, 'utf8');
87
- const ok1 = tuiContent.includes('discoverActiveSprints') && tuiContent.includes('.worktrees');
88
- const ok2 = !tuiContent.match(/from\s+["'][^"']*\.\.\/\.\.\/src[^"']*["']/);
89
- if (!ok1) {
90
- console.error('[prepack] ERROR: tui-plugin.ts is missing discoverActiveSprints — old version detected');
91
- process.exit(1);
92
- }
93
- if (!ok2) {
94
- console.error('[prepack] ERROR: tui-plugin.ts contains broken import paths to ../../src/...');
95
- process.exit(1);
96
- }
97
- console.error('[prepack] OK: tui-plugin.ts structural checks passed');
98
83
  }
99
84
 
100
85
  main();
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → SHIP → LAND → USER ACCEPTANCE → FEEDBACK → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: design must pass Delphi review (≥90% consensus) before any coding.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xp-gate",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Qoder. Includes 10 quality gates (Gate 0-9), Sprint Flow (11 phases), and Delphi multi-expert review (>=90% consensus).",
6
6
  "author": {
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → USER ACCEPTANCE → FEEDBACK → SHIP → LAND → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: design must pass Delphi review (≥90% consensus) before any coding.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,9 +1,9 @@
1
1
  # PRINCIPLES CHECKER MODULE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Clean Code & SOLID principles checker — **Gate 4** of pre-commit. 14 rules × 9 language adapters, SARIF 2.1.0 output. Houses the **Boy Scout Rule** enforcement engine (Gate 6) and warning-baseline storage.
@@ -72,8 +72,21 @@ export async function main(args: string[]): Promise<number> {
72
72
  return result.summary.totalViolations > 0 ? 1 : 0;
73
73
  }
74
74
 
75
+ // Support both CJS (require.main === module) and ESM (import.meta.url) runtimes.
76
+ // npx tsx loads files via import() making require.main unreliable.
77
+ function isDirectExecution(): boolean {
78
+ if (typeof require !== 'undefined' && require.main === module) {
79
+ return true;
80
+ }
81
+ if (typeof import.meta !== 'undefined' && import.meta.url && process.argv[1]) {
82
+ const fileUrl = `file://${process.argv[1]}`;
83
+ return import.meta.url === fileUrl || import.meta.url.endsWith(`/${process.argv[1]}`);
84
+ }
85
+ return false;
86
+ }
87
+
75
88
  const args = process.argv.slice(2);
76
- if (typeof require !== 'undefined' && require.main === module) {
89
+ if (isDirectExecution()) {
77
90
  main(args)
78
91
  .then(exitCode => {
79
92
  if (exitCode !== 0) {
@@ -84,4 +97,4 @@ if (typeof require !== 'undefined' && require.main === module) {
84
97
  console.error('Analysis failed:', err.message);
85
98
  process.exit(1);
86
99
  });
87
- }
100
+ }
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → SHIP → LAND → USER ACCEPTANCE → FEEDBACK → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: design must pass Delphi review (≥90% consensus) before any coding.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-07-03
4
- **Commit:** 83b39b6
4
+ **Commit:** c3ed581
5
5
  **Branch:** main
6
- **Version:** 0.12.3.0
6
+ **Version:** 0.12.4.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.