@boyingliu01/xp-gate 0.8.12 → 0.8.14
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/bin/xp-gate.js +6 -0
- package/lib/__tests__/check-version.test.js +307 -0
- package/lib/__tests__/doctor.test.js +100 -47
- package/lib/__tests__/upgrade-exec.test.js +236 -0
- package/lib/__tests__/upgrade.test.js +77 -0
- package/lib/check-version.js +288 -0
- package/lib/doctor.js +10 -0
- package/lib/upgrade.js +116 -0
- package/mock-policy/AGENTS.md +3 -3
- package/mutation/AGENTS.md +3 -3
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/bin/xp-gate-version-check.sh +62 -0
- package/plugins/claude-code/hooks/hooks.json +9 -0
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/opencode/index.ts +77 -48
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
- package/principles/AGENTS.md +3 -3
- package/skills/delphi-review/AGENTS.md +3 -3
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/test-specification-alignment/AGENTS.md +3 -3
package/lib/upgrade.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const { checkUpgrade, formatUpgradeMsg, clearCache, getLocalVersion, getPackageName } = require('./check-version.js');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* xp-gate upgrade command handler.
|
|
6
|
+
*
|
|
7
|
+
* Modes:
|
|
8
|
+
* xp-gate upgrade — human-readable output
|
|
9
|
+
* xp-gate upgrade --preview — single-line JSON for plugin consumption
|
|
10
|
+
* xp-gate upgrade --apply — auto-upgrade via npm install -g
|
|
11
|
+
*
|
|
12
|
+
* @param {string[]} args
|
|
13
|
+
* @returns {Promise<number>} exit code
|
|
14
|
+
*/
|
|
15
|
+
async function upgrade(args) {
|
|
16
|
+
const isPreview = args.includes('--preview');
|
|
17
|
+
const isApply = args.includes('--apply');
|
|
18
|
+
const pkgName = getPackageName();
|
|
19
|
+
|
|
20
|
+
// --- check for upgrade ---
|
|
21
|
+
let result;
|
|
22
|
+
try {
|
|
23
|
+
result = await checkUpgrade(pkgName);
|
|
24
|
+
} catch (err) {
|
|
25
|
+
if (isPreview) {
|
|
26
|
+
console.log(JSON.stringify({ error: 'check failed', detail: err.message }));
|
|
27
|
+
} else {
|
|
28
|
+
console.error('Unable to check for updates (check error).');
|
|
29
|
+
}
|
|
30
|
+
return 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Guard: if checkUpgrade returned null remote (network issue)
|
|
34
|
+
if (!result.remote) {
|
|
35
|
+
if (isPreview) {
|
|
36
|
+
console.log(JSON.stringify({
|
|
37
|
+
local: result.local || 'unknown',
|
|
38
|
+
remote: null,
|
|
39
|
+
outdated: false,
|
|
40
|
+
lagDays: 0,
|
|
41
|
+
error: 'Unable to check for updates (network issue)',
|
|
42
|
+
}));
|
|
43
|
+
} else {
|
|
44
|
+
console.error('Unable to check for updates (network issue).');
|
|
45
|
+
}
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// --- --preview: JSON output ---
|
|
50
|
+
if (isPreview) {
|
|
51
|
+
const releaseUrl = result.outdated
|
|
52
|
+
? `https://github.com/boyingliu01/xp-gate/releases/tag/v${result.remote}`
|
|
53
|
+
: null;
|
|
54
|
+
console.log(JSON.stringify({
|
|
55
|
+
local: result.local,
|
|
56
|
+
remote: result.remote,
|
|
57
|
+
outdated: result.outdated,
|
|
58
|
+
lagDays: result.lagDays,
|
|
59
|
+
releaseUrl,
|
|
60
|
+
publishedAt: result.publishedAt || null,
|
|
61
|
+
}));
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// --- --apply: auto-upgrade ---
|
|
66
|
+
if (isApply) {
|
|
67
|
+
if (!result.outdated) {
|
|
68
|
+
if (result.local) {
|
|
69
|
+
console.log(`\u2713 xp-gate v${result.local} is up to date`);
|
|
70
|
+
} else {
|
|
71
|
+
console.log('xp-gate is up to date.');
|
|
72
|
+
}
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
console.log(`Upgrading xp-gate from v${result.local} to v${result.remote}...`);
|
|
77
|
+
try {
|
|
78
|
+
execSync(`npm install -g ${pkgName}@${result.remote}`, {
|
|
79
|
+
stdio: 'inherit',
|
|
80
|
+
timeout: 120000, // 2 minute timeout
|
|
81
|
+
});
|
|
82
|
+
// clear cache so next check picks up the new version
|
|
83
|
+
clearCache();
|
|
84
|
+
console.log(`\u2713 Upgraded to v${result.remote}`);
|
|
85
|
+
return 0;
|
|
86
|
+
} catch (err) {
|
|
87
|
+
const stderr = (err.stderr || '').toString();
|
|
88
|
+
if (stderr.includes('EACCES') || stderr.includes('permission') || stderr.includes('EPERM')) {
|
|
89
|
+
console.error(`Permission denied. Try: sudo npm install -g ${pkgName}`);
|
|
90
|
+
} else if (err.code === 'ETIMEDOUT' || stderr.includes('ETIMEDOUT')) {
|
|
91
|
+
console.error('npm install timed out. Check your network and try again.');
|
|
92
|
+
console.error(` Retry: npm install -g ${pkgName}@latest`);
|
|
93
|
+
} else {
|
|
94
|
+
console.error('Upgrade failed:');
|
|
95
|
+
console.error(` ${err.message}`);
|
|
96
|
+
console.error(` Retry manually: npm install -g ${pkgName}@latest`);
|
|
97
|
+
}
|
|
98
|
+
return 1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// --- default mode: human-readable ---
|
|
103
|
+
if (!result.outdated) {
|
|
104
|
+
if (result.local) {
|
|
105
|
+
console.log(`\u2713 xp-gate v${result.local} is up to date`);
|
|
106
|
+
} else {
|
|
107
|
+
console.log('xp-gate is up to date.');
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
const msg = formatUpgradeMsg(result, 'cli');
|
|
111
|
+
console.log(msg);
|
|
112
|
+
}
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
module.exports = { upgrade };
|
package/mock-policy/AGENTS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SRC/MOCK-POLICY KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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.
|
package/mutation/AGENTS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SRC/MUTATION KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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": "xp-gate",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.14",
|
|
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": {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# xp-gate-version-check.sh — Claude Code PostToolUse hook
|
|
4
|
+
#
|
|
5
|
+
# Checks whether a newer xp-gate version is available.
|
|
6
|
+
# Caches the check result in /tmp/.xp-gate-version-checked with 5-minute TTL.
|
|
7
|
+
# Uses flock for concurrent-session safety.
|
|
8
|
+
#
|
|
9
|
+
|
|
10
|
+
set -e
|
|
11
|
+
|
|
12
|
+
CACHE_FILE="/tmp/.xp-gate-version-checked"
|
|
13
|
+
CACHE_TTL=300 # 5 minutes
|
|
14
|
+
|
|
15
|
+
# ── flock-based concurrent access guard ──
|
|
16
|
+
LOCK_FILE="/tmp/.xp-gate-version-check.lock"
|
|
17
|
+
exec 200>"$LOCK_FILE"
|
|
18
|
+
flock -n 200 2>/dev/null || exit 0 # another instance is already checking
|
|
19
|
+
|
|
20
|
+
# ── Check cache validity ──
|
|
21
|
+
if [[ -f "$CACHE_FILE" ]]; then
|
|
22
|
+
read -r CACHED_VERSION CACHED_TS < "$CACHE_FILE" 2>/dev/null || true
|
|
23
|
+
NOW=$(date +%s 2>/dev/null || echo 0)
|
|
24
|
+
if [[ -n "$CACHED_TS" && -n "$NOW" ]]; then
|
|
25
|
+
AGE=$(( NOW - CACHED_TS ))
|
|
26
|
+
if [[ "$AGE" -lt "$CACHE_TTL" ]]; then
|
|
27
|
+
# cache valid — no output needed unless outdated
|
|
28
|
+
exit 0
|
|
29
|
+
fi
|
|
30
|
+
fi
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# ── Check version via xp-gate CLI ──
|
|
34
|
+
if ! command -v xp-gate &>/dev/null; then
|
|
35
|
+
echo "[xp-gate] CLI not found — install with: npm install -g @boyingliu01/xp-gate" >&2
|
|
36
|
+
exit 0
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# run with 5-second timeout, capture exit code
|
|
40
|
+
set +e
|
|
41
|
+
PREVIEW=$(xp-gate upgrade --preview 2>/dev/null)
|
|
42
|
+
EXIT_CODE=$?
|
|
43
|
+
set -e
|
|
44
|
+
|
|
45
|
+
if [[ "$EXIT_CODE" -ne 0 || -z "$PREVIEW" ]]; then
|
|
46
|
+
# check failed — update cache with empty to avoid retry storm
|
|
47
|
+
echo "failed $(date +%s)" > "$CACHE_FILE"
|
|
48
|
+
exit 0
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# parse JSON to extract outdated flag and remote version
|
|
52
|
+
REMOTE=$(echo "$PREVIEW" | grep -o '"remote":"[^"]*"' | cut -d'"' -f4 2>/dev/null || echo '')
|
|
53
|
+
OUTDATED=$(echo "$PREVIEW" | grep -o '"outdated":true' 2>/dev/null || echo '')
|
|
54
|
+
|
|
55
|
+
# update cache (even if not outdated)
|
|
56
|
+
echo "$REMOTE $(date +%s)" > "$CACHE_FILE"
|
|
57
|
+
|
|
58
|
+
if [[ -n "$REMOTE" && -n "$OUTDATED" ]]; then
|
|
59
|
+
echo "[xp-gate] New version v${REMOTE} available — run: xp-gate upgrade" >&2
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
exit 0
|
|
@@ -20,6 +20,15 @@
|
|
|
20
20
|
"command": "\"$CLAUDE_PLUGIN_ROOT\"/bin/xp-gate-check \"${TOOL_INPUT_FILE}\""
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"matcher": ".*",
|
|
26
|
+
"hooks": [
|
|
27
|
+
{
|
|
28
|
+
"type": "command",
|
|
29
|
+
"command": "\"$CLAUDE_PLUGIN_ROOT\"/bin/xp-gate-version-check.sh"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
23
32
|
}
|
|
24
33
|
],
|
|
25
34
|
"Stop": [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|
|
@@ -1,33 +1,69 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* XP-Gate OpenCode Plugin
|
|
3
|
-
*
|
|
4
|
-
* Exposes 3 OpenCode tools that mirror the equivalent `xp-gate` CLI subcommands:
|
|
5
|
-
* - gate-check: Run user-invokable quality gates (Gate 4 Principles + Gate 6 Arch) on a path
|
|
6
|
-
* - gate-principles: Run Clean Code + SOLID principles checker (Gate 4 standalone)
|
|
7
|
-
* - gate-arch: Run architecture validation (Gate 6 standalone)
|
|
8
|
-
*
|
|
9
|
-
* Dual-surface design (fixes #208): every tool is callable BOTH from inside an
|
|
10
|
-
* OpenCode session (as these tools) AND from a plain shell (as `xp-gate check`,
|
|
11
|
-
* `xp-gate principles`, `xp-gate arch`). The tools prefer the global `xp-gate`
|
|
12
|
-
* CLI when available, but fall back to running the checker source directly via
|
|
13
|
-
* `npx -y tsx` so they work even before `npm install -g @boyingliu01/xp-gate`.
|
|
14
|
-
*/
|
|
15
1
|
import { tool } from "@opencode-ai/plugin"
|
|
16
2
|
import { z } from "zod"
|
|
3
|
+
import { exec } from "child_process"
|
|
4
|
+
import { promisify } from "util"
|
|
5
|
+
|
|
6
|
+
const execAsync = promisify(exec)
|
|
17
7
|
|
|
18
8
|
interface OpenCodePluginInput {
|
|
19
9
|
directory: string
|
|
20
10
|
$: (strings: TemplateStringsArray, ...values: unknown[]) => Promise<{ text(): Promise<string> }>
|
|
21
11
|
}
|
|
22
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Run a shell command via async exec, returning stdout or error message.
|
|
15
|
+
* Never throws — returns error string on failure.
|
|
16
|
+
*/
|
|
17
|
+
async function runCmd(cmd: string, cwd: string): Promise<string> {
|
|
18
|
+
try {
|
|
19
|
+
const { stdout } = await execAsync(cmd, { cwd, timeout: 30000 })
|
|
20
|
+
return stdout || "[XP-Gate] Command completed (no output)."
|
|
21
|
+
} catch (err: unknown) {
|
|
22
|
+
const error = err as { stderr?: string; message?: string }
|
|
23
|
+
if (error.stderr) return error.stderr
|
|
24
|
+
if (error.message) return `[XP-Gate] Error: ${error.message}`
|
|
25
|
+
return "[XP-Gate] Command failed."
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Check for xp-gate CLI availability and run a command via exec.
|
|
31
|
+
*/
|
|
32
|
+
async function runXpGate(subcommand: string, cwd: string): Promise<string> {
|
|
33
|
+
// Check if xp-gate is on PATH
|
|
34
|
+
try {
|
|
35
|
+
await execAsync("command -v xp-gate", { cwd })
|
|
36
|
+
} catch {
|
|
37
|
+
return "" // CLI not available — caller should fall back
|
|
38
|
+
}
|
|
39
|
+
return runCmd(`xp-gate ${subcommand}`, cwd)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check for a newer xp-gate version (non-blocking, advisory only).
|
|
44
|
+
*/
|
|
45
|
+
async function getUpgradeSuggestion(cwd: string): Promise<string> {
|
|
46
|
+
try {
|
|
47
|
+
const result = await runXpGate("upgrade --preview", cwd)
|
|
48
|
+
if (!result) return ""
|
|
49
|
+
const parsed = JSON.parse(result)
|
|
50
|
+
if (parsed.outdated && parsed.remote) {
|
|
51
|
+
const releaseUrl = `https://github.com/boyingliu01/xp-gate/releases/tag/v${parsed.remote}`
|
|
52
|
+
return `[XP-Gate] New version v${parsed.remote} available (${releaseUrl}) — run: xp-gate upgrade`
|
|
53
|
+
}
|
|
54
|
+
return ""
|
|
55
|
+
} catch {
|
|
56
|
+
return ""
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
23
60
|
export const XpGatePlugin = async (input: OpenCodePluginInput) => {
|
|
24
|
-
const { directory
|
|
61
|
+
const { directory } = input
|
|
25
62
|
|
|
26
63
|
return {
|
|
27
64
|
tool: {
|
|
28
65
|
"gate-check": tool({
|
|
29
|
-
description:
|
|
30
|
-
"Run xp-gate user-invokable quality gates (Gate 4 Principles + Gate 6 Architecture) on a file or directory. Prefers global xp-gate CLI; falls back to running checker source directly.",
|
|
66
|
+
description: "Run xp-gate quality gates (Gate 4 + Gate 6) on a file or directory. Prefers global xp-gate CLI; falls back to direct checker source.",
|
|
31
67
|
args: {
|
|
32
68
|
path: z.string().describe("File or directory path (absolute or relative to workspace)"),
|
|
33
69
|
gates: z.array(z.string()).optional().describe("Optional gate subset (e.g. ['principles', 'arch'])"),
|
|
@@ -36,57 +72,50 @@ export const XpGatePlugin = async (input: OpenCodePluginInput) => {
|
|
|
36
72
|
const cwd = ctx.directory || directory
|
|
37
73
|
const target = args.path.startsWith("/") ? args.path : `${cwd}/${args.path}`
|
|
38
74
|
const gatesFlag = args.gates?.length ? ` --gates ${args.gates.join(",")}` : ""
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
try {
|
|
44
|
-
const result = await $`bash -c ${cmd}`
|
|
45
|
-
const text = await result.text()
|
|
46
|
-
return text || "[XP-Gate] Check complete (no violations)."
|
|
47
|
-
} catch (err) {
|
|
48
|
-
return `[XP-Gate] gate-check failed.\nInstall xp-gate CLI: npm install -g @boyingliu01/xp-gate\n${err instanceof Error ? err.message : ""}`
|
|
75
|
+
const result = await runXpGate(`check "${target}"${gatesFlag}`, cwd)
|
|
76
|
+
if (result) {
|
|
77
|
+
const upgrade = await getUpgradeSuggestion(cwd)
|
|
78
|
+
return upgrade ? `${result}\n${upgrade}` : result
|
|
49
79
|
}
|
|
80
|
+
// Fallback: invoke xp-gate source directly via node
|
|
81
|
+
const cmd = `node ${directory}/src/npm-package/bin/xp-gate.js check "${target}"${gatesFlag}`
|
|
82
|
+
return runCmd(cmd, cwd)
|
|
50
83
|
},
|
|
51
84
|
}),
|
|
52
85
|
"gate-principles": tool({
|
|
53
|
-
description:
|
|
54
|
-
"Run Clean Code + SOLID principles checker (Gate 4 standalone) on a file or directory.",
|
|
86
|
+
description: "Run Clean Code + SOLID principles checker (Gate 4 standalone) on a file or directory.",
|
|
55
87
|
args: {
|
|
56
88
|
path: z.string().describe("Source file or directory path to check"),
|
|
57
89
|
},
|
|
58
90
|
async execute(args, ctx) {
|
|
59
91
|
const cwd = ctx.directory || directory
|
|
60
92
|
const target = args.path.startsWith("/") ? args.path : `${cwd}/${args.path}`
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const text = await result.text()
|
|
66
|
-
return text || "[XP-Gate] Principles check complete (no violations)."
|
|
67
|
-
} catch (err) {
|
|
68
|
-
return `[XP-Gate] Principles checker failed.\nInstall xp-gate CLI: npm install -g @boyingliu01/xp-gate\n${err instanceof Error ? err.message : ""}`
|
|
93
|
+
const result = await runXpGate(`principles "${target}"`, cwd)
|
|
94
|
+
if (result) {
|
|
95
|
+
const upgrade = await getUpgradeSuggestion(cwd)
|
|
96
|
+
return upgrade ? `${result}\n${upgrade}` : result
|
|
69
97
|
}
|
|
98
|
+
// Fallback: npx tsx on the principles source
|
|
99
|
+
const cmd = `npx -y tsx ${directory}/src/principles/index.ts --files "${target}" --format console`
|
|
100
|
+
return runCmd(cmd, cwd)
|
|
70
101
|
},
|
|
71
102
|
}),
|
|
72
103
|
"gate-arch": tool({
|
|
73
|
-
description:
|
|
74
|
-
"Run architecture validation (Gate 6 standalone, layer boundary checks) on the repository.",
|
|
104
|
+
description: "Run architecture validation (Gate 6 standalone, layer boundary checks) on the repository.",
|
|
75
105
|
args: {
|
|
76
106
|
config: z.string().describe("Path to architecture config file").default("architecture.yaml"),
|
|
77
107
|
},
|
|
78
108
|
async execute(args, ctx) {
|
|
79
109
|
const cwd = ctx.directory || directory
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const text = await result.text()
|
|
86
|
-
return text || "[XP-Gate] Architecture check complete."
|
|
87
|
-
} catch (err) {
|
|
88
|
-
return `[XP-Gate] Architecture validation failed.\nRequires architecture.yaml in repo root.\nInstall xp-gate CLI: npm install -g @boyingliu01/xp-gate\n${err instanceof Error ? err.message : ""}`
|
|
110
|
+
const config = args.config || "architecture.yaml"
|
|
111
|
+
const result = await runXpGate(`arch --config ${config}`, cwd)
|
|
112
|
+
if (result) {
|
|
113
|
+
const upgrade = await getUpgradeSuggestion(cwd)
|
|
114
|
+
return upgrade ? `${result}\n${upgrade}` : result
|
|
89
115
|
}
|
|
116
|
+
// Fallback: @archlinter/cli directly
|
|
117
|
+
const cmd = `npx -y @archlinter/cli scan . --config ${config}`
|
|
118
|
+
return runCmd(cmd, cwd)
|
|
90
119
|
},
|
|
91
120
|
}),
|
|
92
121
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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
|
# SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|
package/principles/AGENTS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# PRINCIPLES CHECKER MODULE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.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
|
-
**Generated:** 2026-06-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-06-16
|
|
4
|
+
**Commit:** 027813b
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.14.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|