@zgeoff/skill-gate 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/dist/index.js +20 -20
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -23,9 +23,11 @@ The hook runs a file in the repo that calls the package's `runSkillGate`, at
|
|
|
23
23
|
file from zgeoff/tools. `runSkillGate` reads the hook payload from stdin, prints the hook output,
|
|
24
24
|
and exits the process.
|
|
25
25
|
|
|
26
|
-
Register the entry point in `.claude/settings.json`, before a Bash command and after it. The
|
|
27
|
-
|
|
28
|
-
the
|
|
26
|
+
Register the entry point in `.claude/settings.json`, before a Bash command and after it. The command
|
|
27
|
+
runs Bun with `--no-install`, so the hook never fetches the package from npm: in a checkout with no
|
|
28
|
+
`node_modules`, the hook blocks each gated edit until `bun install` runs. The `PreToolUse` matcher
|
|
29
|
+
names each tool that a tool gate names, since the hook never sees a call that the matcher skips.
|
|
30
|
+
This example gates `mcp__tracker__update_ticket`:
|
|
29
31
|
|
|
30
32
|
```json
|
|
31
33
|
{
|
|
@@ -36,7 +38,7 @@ the matcher skips. This example gates `mcp__tracker__update_ticket`:
|
|
|
36
38
|
"hooks": [
|
|
37
39
|
{
|
|
38
40
|
"type": "command",
|
|
39
|
-
"command": "bun \"$CLAUDE_PROJECT_DIR/.claude/hooks/skill-gate/skill-gate.ts\""
|
|
41
|
+
"command": "bun --no-install \"$CLAUDE_PROJECT_DIR/.claude/hooks/skill-gate/skill-gate.ts\""
|
|
40
42
|
}
|
|
41
43
|
]
|
|
42
44
|
}
|
|
@@ -47,7 +49,7 @@ the matcher skips. This example gates `mcp__tracker__update_ticket`:
|
|
|
47
49
|
"hooks": [
|
|
48
50
|
{
|
|
49
51
|
"type": "command",
|
|
50
|
-
"command": "bun \"$CLAUDE_PROJECT_DIR/.claude/hooks/skill-gate/skill-gate.ts\""
|
|
52
|
+
"command": "bun --no-install \"$CLAUDE_PROJECT_DIR/.claude/hooks/skill-gate/skill-gate.ts\""
|
|
51
53
|
}
|
|
52
54
|
]
|
|
53
55
|
}
|
|
@@ -58,7 +60,7 @@ the matcher skips. This example gates `mcp__tracker__update_ticket`:
|
|
|
58
60
|
"hooks": [
|
|
59
61
|
{
|
|
60
62
|
"type": "command",
|
|
61
|
-
"command": "bun \"$CLAUDE_PROJECT_DIR/.claude/hooks/skill-gate/skill-gate.ts\""
|
|
63
|
+
"command": "bun --no-install \"$CLAUDE_PROJECT_DIR/.claude/hooks/skill-gate/skill-gate.ts\""
|
|
62
64
|
}
|
|
63
65
|
]
|
|
64
66
|
}
|
package/dist/index.js
CHANGED
|
@@ -5572,7 +5572,7 @@ var wo = (t, e) => {
|
|
|
5572
5572
|
return Array.isArray(r.config) && n.add(qs(r.config)), n.add(zs(r.unsafe)), n.add(Ws(r.completion)), r.abort && n.add(Is(r.abort)), r.progress && n.add(so(r.progress)), r.timeout && n.add(uo(r.timeout)), r.spawnOptions && n.add(io(r.spawnOptions)), n.add(ao()), n.add(no(r.input)), n.add(Mt(to(true))), r.errors && n.add(Mt(r.errors)), Xs(n, r.binary, r.unsafe?.allowUnsafeCustomBinary), n.add(Fs(r.allowEnvironment ?? [], r.unsafe?.allowAbbreviatedOptions)), new f2(r, n);
|
|
5573
5573
|
};
|
|
5574
5574
|
|
|
5575
|
-
// ../../node_modules/.bun/ts-pattern@5.9.
|
|
5575
|
+
// ../../node_modules/.bun/ts-pattern@5.9.2/node_modules/ts-pattern/dist/index.js
|
|
5576
5576
|
var t2 = Symbol.for("@ts-pattern/matcher");
|
|
5577
5577
|
var e = Symbol.for("@ts-pattern/isVariadic");
|
|
5578
5578
|
var n = "@ts-pattern/anonymous-select-key";
|
|
@@ -5761,7 +5761,7 @@ function F3(t) {
|
|
|
5761
5761
|
throw new I3(t);
|
|
5762
5762
|
}
|
|
5763
5763
|
|
|
5764
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
5764
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/util.js
|
|
5765
5765
|
function getEnumValues(entries) {
|
|
5766
5766
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
5767
5767
|
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -6308,7 +6308,7 @@ function constantCatch(value) {
|
|
|
6308
6308
|
return fn;
|
|
6309
6309
|
}
|
|
6310
6310
|
|
|
6311
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
6311
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/core.js
|
|
6312
6312
|
var _a;
|
|
6313
6313
|
var _zodDesc = { value: undefined, enumerable: false };
|
|
6314
6314
|
var _E = "captureStackTrace" in Error ? Error : null;
|
|
@@ -6426,7 +6426,7 @@ function config(newConfig) {
|
|
|
6426
6426
|
Object.assign(globalConfig, newConfig);
|
|
6427
6427
|
return globalConfig;
|
|
6428
6428
|
}
|
|
6429
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
6429
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/errors.js
|
|
6430
6430
|
function _getMessage() {
|
|
6431
6431
|
const internals = this._zod;
|
|
6432
6432
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -6541,7 +6541,7 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
6541
6541
|
return fieldErrors;
|
|
6542
6542
|
}
|
|
6543
6543
|
|
|
6544
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
6544
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/parse.js
|
|
6545
6545
|
function finalizeParams(callee, params) {
|
|
6546
6546
|
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
6547
6547
|
}
|
|
@@ -6688,7 +6688,7 @@ var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
6688
6688
|
var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
6689
6689
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
6690
6690
|
};
|
|
6691
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
6691
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/regexes.js
|
|
6692
6692
|
var cuid = /^[cC][0-9a-z]{6,}$/;
|
|
6693
6693
|
var cuid2 = /^[0-9a-z]+$/;
|
|
6694
6694
|
var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
|
|
@@ -6746,7 +6746,7 @@ var boolean = /^(?:true|false)$/i;
|
|
|
6746
6746
|
var lowercase = /^[^A-Z]*$/;
|
|
6747
6747
|
var uppercase = /^[^a-z]*$/;
|
|
6748
6748
|
|
|
6749
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
6749
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/checks.js
|
|
6750
6750
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
6751
6751
|
var _a;
|
|
6752
6752
|
inst._zod ?? (inst._zod = {});
|
|
@@ -6932,7 +6932,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
6932
6932
|
};
|
|
6933
6933
|
});
|
|
6934
6934
|
|
|
6935
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
6935
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/doc.js
|
|
6936
6936
|
class Doc {
|
|
6937
6937
|
constructor(args = [], closed = {}) {
|
|
6938
6938
|
this.content = [];
|
|
@@ -6974,14 +6974,14 @@ ${content.join(`
|
|
|
6974
6974
|
}
|
|
6975
6975
|
}
|
|
6976
6976
|
|
|
6977
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
6977
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/versions.js
|
|
6978
6978
|
var version = {
|
|
6979
6979
|
major: 4,
|
|
6980
6980
|
minor: 6,
|
|
6981
|
-
patch:
|
|
6981
|
+
patch: 7
|
|
6982
6982
|
};
|
|
6983
6983
|
|
|
6984
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
6984
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/schemas.js
|
|
6985
6985
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
6986
6986
|
var _a;
|
|
6987
6987
|
inst ?? (inst = {});
|
|
@@ -8590,7 +8590,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
8590
8590
|
payload.issues.push(issue(_iss));
|
|
8591
8591
|
}
|
|
8592
8592
|
}
|
|
8593
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
8593
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/memoizer.js
|
|
8594
8594
|
class $ZodCyclicError extends Error {
|
|
8595
8595
|
constructor() {
|
|
8596
8596
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -8859,7 +8859,7 @@ function isBackEdge(ctx, value) {
|
|
|
8859
8859
|
const backEdges = ctx[STATE]?.backEdges;
|
|
8860
8860
|
return backEdges !== undefined && isRef(value) && backEdges.has(value);
|
|
8861
8861
|
}
|
|
8862
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
8862
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/locales/en.js
|
|
8863
8863
|
var error = () => {
|
|
8864
8864
|
const Sizable = {
|
|
8865
8865
|
string: { unit: "characters", verb: "to have" },
|
|
@@ -8981,7 +8981,7 @@ function en_default() {
|
|
|
8981
8981
|
localeError: error()
|
|
8982
8982
|
};
|
|
8983
8983
|
}
|
|
8984
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
8984
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/registries.js
|
|
8985
8985
|
var _a2;
|
|
8986
8986
|
class $ZodRegistry {
|
|
8987
8987
|
constructor() {
|
|
@@ -9028,7 +9028,7 @@ function registry() {
|
|
|
9028
9028
|
}
|
|
9029
9029
|
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
9030
9030
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
9031
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
9031
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/api.js
|
|
9032
9032
|
function snapshotChecks(def) {
|
|
9033
9033
|
if (def.checks)
|
|
9034
9034
|
def.checks = [...def.checks];
|
|
@@ -9425,7 +9425,7 @@ function _check(fn, params) {
|
|
|
9425
9425
|
ch._zod.check = fn;
|
|
9426
9426
|
return ch;
|
|
9427
9427
|
}
|
|
9428
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
9428
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js
|
|
9429
9429
|
function assignProps(target, ...sources) {
|
|
9430
9430
|
for (const source of sources) {
|
|
9431
9431
|
for (const key of Reflect.ownKeys(source)) {
|
|
@@ -9948,7 +9948,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
9948
9948
|
extractDefs(ctx, schema);
|
|
9949
9949
|
return finalize(ctx, schema);
|
|
9950
9950
|
};
|
|
9951
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
9951
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js
|
|
9952
9952
|
var narrowMin = (agg, key, value) => {
|
|
9953
9953
|
if (agg[key] === undefined || value > agg[key])
|
|
9954
9954
|
agg[key] = value;
|
|
@@ -10431,7 +10431,7 @@ var optionalProcessor = (schema, ctx, _json, params) => {
|
|
|
10431
10431
|
const seen = ctx.seen.get(schema);
|
|
10432
10432
|
seen.ref = def.innerType;
|
|
10433
10433
|
};
|
|
10434
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
10434
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/errors.js
|
|
10435
10435
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
10436
10436
|
function _lazyMethod(proto, key, make) {
|
|
10437
10437
|
Object.defineProperty(proto, key, {
|
|
@@ -10476,7 +10476,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, undefi
|
|
|
10476
10476
|
Parent: Error
|
|
10477
10477
|
});
|
|
10478
10478
|
|
|
10479
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
10479
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/parse.js
|
|
10480
10480
|
var parse2 = /* @__PURE__ */ _parse(ZodRealError);
|
|
10481
10481
|
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
10482
10482
|
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -10490,7 +10490,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
10490
10490
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
10491
10491
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
10492
10492
|
|
|
10493
|
-
// ../../node_modules/.bun/zod@4.6.
|
|
10493
|
+
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
|
|
10494
10494
|
function _ensureDefaultLocale() {
|
|
10495
10495
|
if (!globalConfig.localeError)
|
|
10496
10496
|
config(en_default());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgeoff/skill-gate",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "A Claude Code and Codex CLI hook that denies an edit or a gated tool call until the session loads the skills and reads the reference files it needs, and blocks after a Bash command that changed a gated file without them",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"typecheck": "tsrs"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/bun": "1.4.
|
|
37
|
+
"@types/bun": "1.4.3",
|
|
38
38
|
"@types/picomatch": "4.0.3",
|
|
39
39
|
"@zgeoff/std": "0.3.0",
|
|
40
40
|
"picomatch": "4.0.7",
|
|
41
41
|
"simple-git": "4.0.2",
|
|
42
42
|
"tiny-invariant": "1.3.3",
|
|
43
|
-
"ts-pattern": "5.9.
|
|
43
|
+
"ts-pattern": "5.9.2",
|
|
44
44
|
"tsrs": "0.18.0-ts7.1.0-dev.20260929",
|
|
45
45
|
"typescript": "7.0.2",
|
|
46
|
-
"zod": "4.6.
|
|
46
|
+
"zod": "4.6.7"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"bun": ">=1.3"
|