@devrik-tools/claude-gates 0.1.3 → 0.2.0
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.
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "claude-gates",
|
|
3
|
-
"owner": {
|
|
4
|
-
"name": "claude-gates"
|
|
5
|
-
},
|
|
6
|
-
"metadata": {
|
|
7
|
-
"description": "Installable deterministic gates (hooks) for Claude Code, selectable per project or globally with `npx @devrik99/claude-gates init`."
|
|
8
|
-
},
|
|
9
|
-
"plugins": [
|
|
10
|
-
{
|
|
11
|
-
"name": "gates",
|
|
12
|
-
"source": "./plugins/gates",
|
|
13
|
-
"description": "PreToolUse gates: destructive-command blocks, protected paths, delegation/spec/quality rules, tool-discovery and forge-pipeline enforcement. Which gates run is decided by .ai/config.json (project) or ~/.claude/claude-gates/config.json (global).",
|
|
14
|
-
"version": "0.
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"name": "tasks",
|
|
18
|
-
"source": "./plugins/tasks",
|
|
19
|
-
"description": "Deterministic task tracking: the model registers tasks via the CLI, a UserPromptSubmit hook reminds of open tasks every few messages, and a SessionStart hook lists active tasks when a session opens.",
|
|
20
|
-
"version": "0.
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "claude-gates",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "claude-gates"
|
|
5
|
+
},
|
|
6
|
+
"metadata": {
|
|
7
|
+
"description": "Installable deterministic gates (hooks) for Claude Code, selectable per project or globally with `npx @devrik99/claude-gates init`."
|
|
8
|
+
},
|
|
9
|
+
"plugins": [
|
|
10
|
+
{
|
|
11
|
+
"name": "gates",
|
|
12
|
+
"source": "./plugins/gates",
|
|
13
|
+
"description": "PreToolUse gates: destructive-command blocks, protected paths, delegation/spec/quality rules, tool-discovery and forge-pipeline enforcement. Which gates run is decided by .ai/config.json (project) or ~/.claude/claude-gates/config.json (global).",
|
|
14
|
+
"version": "0.2.0"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "tasks",
|
|
18
|
+
"source": "./plugins/tasks",
|
|
19
|
+
"description": "Deterministic task tracking: the model registers tasks via the CLI, a UserPromptSubmit hook reminds of open tasks every few messages, and a SessionStart hook lists active tasks when a session opens.",
|
|
20
|
+
"version": "0.2.0"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Version coherence guard. This exists because of a real incident: the npm package was
|
|
2
|
+
// bumped to 0.1.3 and published, but plugin.json / marketplace.json stayed at 0.1.0. Claude
|
|
3
|
+
// Code versions a plugin by its plugin.json/marketplace version, so a machine that already
|
|
4
|
+
// had 0.1.0 cached NEVER updated the code on reinstall — it ran the old, pre-migration gates
|
|
5
|
+
// while the freshly written config.json said 0.1.3. The gates looked "enabled but broken".
|
|
6
|
+
//
|
|
7
|
+
// The rule this enforces: the npm package version, both plugin.json versions, and every
|
|
8
|
+
// marketplace.json plugin entry must be the SAME string. Bump them together, every release.
|
|
9
|
+
|
|
10
|
+
import assert from 'node:assert/strict';
|
|
11
|
+
import { readFileSync } from 'node:fs';
|
|
12
|
+
import { dirname, join } from 'node:path';
|
|
13
|
+
import { test } from 'node:test';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
|
|
16
|
+
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
17
|
+
|
|
18
|
+
function readJson(relativePath) {
|
|
19
|
+
return JSON.parse(readFileSync(join(ROOT, relativePath), 'utf8').replace(/^/, ''));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
test('npm, both plugin.json, and every marketplace entry share one version', () => {
|
|
23
|
+
const versions = {
|
|
24
|
+
'package.json': readJson('package.json').version,
|
|
25
|
+
'plugins/gates/.claude-plugin/plugin.json': readJson(
|
|
26
|
+
'plugins/gates/.claude-plugin/plugin.json',
|
|
27
|
+
).version,
|
|
28
|
+
'plugins/tasks/.claude-plugin/plugin.json': readJson(
|
|
29
|
+
'plugins/tasks/.claude-plugin/plugin.json',
|
|
30
|
+
).version,
|
|
31
|
+
};
|
|
32
|
+
for (const plugin of readJson('.claude-plugin/marketplace.json').plugins) {
|
|
33
|
+
versions[`marketplace.json:${plugin.name}`] = plugin.version;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const distinct = [...new Set(Object.values(versions))];
|
|
37
|
+
assert.equal(
|
|
38
|
+
distinct.length,
|
|
39
|
+
1,
|
|
40
|
+
`all versions must match; found ${JSON.stringify(versions)}. ` +
|
|
41
|
+
'A plugin.json/marketplace version behind the npm version means Claude Code keeps ' +
|
|
42
|
+
'serving the OLD cached plugin code on reinstall. Bump them together.',
|
|
43
|
+
);
|
|
44
|
+
});
|
package/package.json
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@devrik-tools/claude-gates",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Installable, deterministic gates (hooks) for Claude Code: block destructive commands, protected paths, and enforce delegation/spec/quality rules. Configurable per project.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"claude-code",
|
|
7
|
-
"hooks",
|
|
8
|
-
"gates",
|
|
9
|
-
"guardrails",
|
|
10
|
-
"pretooluse",
|
|
11
|
-
"policy-enforcement",
|
|
12
|
-
"ai-agent"
|
|
13
|
-
],
|
|
14
|
-
"type": "module",
|
|
15
|
-
"bin": {
|
|
16
|
-
"claude-gates": "./cli/index.mjs"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/DevRik99/claude-gates.git"
|
|
21
|
-
},
|
|
22
|
-
"homepage": "https://github.com/DevRik99/claude-gates#readme",
|
|
23
|
-
"bugs": {
|
|
24
|
-
"url": "https://github.com/DevRik99/claude-gates/issues"
|
|
25
|
-
},
|
|
26
|
-
"author": "Devrik",
|
|
27
|
-
"publishConfig": {
|
|
28
|
-
"access": "public"
|
|
29
|
-
},
|
|
30
|
-
"files": [
|
|
31
|
-
"cli",
|
|
32
|
-
"registry.json",
|
|
33
|
-
"README.md",
|
|
34
|
-
"README.es.md",
|
|
35
|
-
"plugins",
|
|
36
|
-
".claude-plugin"
|
|
37
|
-
],
|
|
38
|
-
"scripts": {
|
|
39
|
-
"test": "node --test",
|
|
40
|
-
"test:gate": "node --test",
|
|
41
|
-
"registry:check": "node cli/index.mjs registry --check",
|
|
42
|
-
"lint": "eslint .",
|
|
43
|
-
"lint:fix": "eslint . --fix",
|
|
44
|
-
"format": "prettier --write \"cli/**/*.mjs\" \"*.mjs\" \"*.json\" \".claude-plugin/*.json\" \"plugins/gates/.claude-plugin/*.json\" \"plugins/gates/hooks/hooks.json\"",
|
|
45
|
-
"format:check": "prettier --check \"cli/**/*.mjs\" \"*.mjs\""
|
|
46
|
-
},
|
|
47
|
-
"engines": {
|
|
48
|
-
"node": ">=22.5.0"
|
|
49
|
-
},
|
|
50
|
-
"license": "MIT",
|
|
51
|
-
"dependencies": {
|
|
52
|
-
"@clack/prompts": "1.7.0",
|
|
53
|
-
"commander": "^15.0.0",
|
|
54
|
-
"find-up": "^8.0.0",
|
|
55
|
-
"zod": "^4.5.2"
|
|
56
|
-
},
|
|
57
|
-
"devDependencies": {
|
|
58
|
-
"@cspell/eslint-plugin": "^10.1.1",
|
|
59
|
-
"@eslint/js": "^10.0.1",
|
|
60
|
-
"@stryker-mutator/core": "^10.0.0",
|
|
61
|
-
"eslint": "^10.9.1",
|
|
62
|
-
"eslint-config-prettier": "^10.1.8",
|
|
63
|
-
"eslint-plugin-boundaries": "^7.2.0",
|
|
64
|
-
"eslint-plugin-import-x": "^4.17.1",
|
|
65
|
-
"eslint-plugin-n": "^18.3.0",
|
|
66
|
-
"eslint-plugin-prettier": "^5.5.6",
|
|
67
|
-
"eslint-plugin-promise": "^7.3.0",
|
|
68
|
-
"eslint-plugin-sonarjs": "^4.2.0",
|
|
69
|
-
"eslint-plugin-unicorn": "^74.0.0",
|
|
70
|
-
"eslint-plugin-unused-imports": "^4.4.1",
|
|
71
|
-
"globals": "^17.11.0",
|
|
72
|
-
"prettier": "^3.9.6"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@devrik-tools/claude-gates",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Installable, deterministic gates (hooks) for Claude Code: block destructive commands, protected paths, and enforce delegation/spec/quality rules. Configurable per project.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"claude-code",
|
|
7
|
+
"hooks",
|
|
8
|
+
"gates",
|
|
9
|
+
"guardrails",
|
|
10
|
+
"pretooluse",
|
|
11
|
+
"policy-enforcement",
|
|
12
|
+
"ai-agent"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"bin": {
|
|
16
|
+
"claude-gates": "./cli/index.mjs"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/DevRik99/claude-gates.git"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/DevRik99/claude-gates#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/DevRik99/claude-gates/issues"
|
|
25
|
+
},
|
|
26
|
+
"author": "Devrik",
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"cli",
|
|
32
|
+
"registry.json",
|
|
33
|
+
"README.md",
|
|
34
|
+
"README.es.md",
|
|
35
|
+
"plugins",
|
|
36
|
+
".claude-plugin"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"test": "node --test",
|
|
40
|
+
"test:gate": "node --test",
|
|
41
|
+
"registry:check": "node cli/index.mjs registry --check",
|
|
42
|
+
"lint": "eslint .",
|
|
43
|
+
"lint:fix": "eslint . --fix",
|
|
44
|
+
"format": "prettier --write \"cli/**/*.mjs\" \"*.mjs\" \"*.json\" \".claude-plugin/*.json\" \"plugins/gates/.claude-plugin/*.json\" \"plugins/gates/hooks/hooks.json\"",
|
|
45
|
+
"format:check": "prettier --check \"cli/**/*.mjs\" \"*.mjs\""
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=22.5.0"
|
|
49
|
+
},
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@clack/prompts": "1.7.0",
|
|
53
|
+
"commander": "^15.0.0",
|
|
54
|
+
"find-up": "^8.0.0",
|
|
55
|
+
"zod": "^4.5.2"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@cspell/eslint-plugin": "^10.1.1",
|
|
59
|
+
"@eslint/js": "^10.0.1",
|
|
60
|
+
"@stryker-mutator/core": "^10.0.0",
|
|
61
|
+
"eslint": "^10.9.1",
|
|
62
|
+
"eslint-config-prettier": "^10.1.8",
|
|
63
|
+
"eslint-plugin-boundaries": "^7.2.0",
|
|
64
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
65
|
+
"eslint-plugin-n": "^18.3.0",
|
|
66
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
67
|
+
"eslint-plugin-promise": "^7.3.0",
|
|
68
|
+
"eslint-plugin-sonarjs": "^4.2.0",
|
|
69
|
+
"eslint-plugin-unicorn": "^74.0.0",
|
|
70
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
71
|
+
"globals": "^17.11.0",
|
|
72
|
+
"prettier": "^3.9.6"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gates",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Deterministic gates for Claude Code: destructive-command blocks, protected paths, delegation briefs, spec-driven flow and session-start validation. Selection lives in config, not in code.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Devrik"
|
|
7
7
|
},
|
|
8
|
-
"keywords": [
|
|
8
|
+
"keywords": [
|
|
9
|
+
"hooks",
|
|
10
|
+
"guards",
|
|
11
|
+
"gates",
|
|
12
|
+
"PreToolUse",
|
|
13
|
+
"SessionStart"
|
|
14
|
+
]
|
|
9
15
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "tasks",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Deterministic task tracking for Claude Code: persists tasks the model registers via the CLI, reminds of open tasks on a message counter, and lists active tasks on session start.",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Devrik"
|
|
7
|
-
},
|
|
8
|
-
"keywords": [
|
|
9
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "tasks",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Deterministic task tracking for Claude Code: persists tasks the model registers via the CLI, reminds of open tasks on a message counter, and lists active tasks on session start.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Devrik"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [
|
|
9
|
+
"hooks",
|
|
10
|
+
"tasks",
|
|
11
|
+
"UserPromptSubmit",
|
|
12
|
+
"SessionStart"
|
|
13
|
+
]
|
|
14
|
+
}
|