lean-agent-harness 0.0.0-stage → 1.3.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.
Files changed (45) hide show
  1. package/AGENTS.md +34 -0
  2. package/CHANGELOG.md +54 -0
  3. package/CLAUDE.md +12 -0
  4. package/GLOSSARY.md +53 -0
  5. package/LICENSE +21 -0
  6. package/README.md +92 -2
  7. package/adapters/opencode/commands/audit-code.md +5 -0
  8. package/adapters/opencode/commands/commit.md +5 -0
  9. package/adapters/opencode/commands/orchestrate.md +5 -0
  10. package/adapters/opencode/commands/plan-flow.md +5 -0
  11. package/adapters/opencode/commands/review.md +5 -0
  12. package/bin/cli.js +310 -0
  13. package/guard/claude/hook.json +7 -0
  14. package/guard/claude/lah-guard/core.js +101 -0
  15. package/guard/claude/lah-guard/index.js +76 -0
  16. package/guard/claude/lah-guard/policy.json +33 -0
  17. package/guard/claude/merge-settings.js +70 -0
  18. package/guard/codex/lah.rules +74 -0
  19. package/guard/pi/lah-guard/core.js +101 -0
  20. package/guard/pi/lah-guard/index.js +49 -0
  21. package/guard/pi/lah-guard/policy.json +33 -0
  22. package/install.sh +263 -0
  23. package/manifest.tsv +31 -0
  24. package/package.json +54 -4
  25. package/profile-extras.txt +6 -0
  26. package/skills/audit-code/SKILL.md +14 -0
  27. package/skills/audit-code/agents/openai.yaml +2 -0
  28. package/skills/code-review/SKILL.md +42 -0
  29. package/skills/commit/SKILL.md +15 -0
  30. package/skills/commit/agents/openai.yaml +2 -0
  31. package/skills/db-migration/SKILL.md +40 -0
  32. package/skills/diagnosing-bugs/SKILL.md +32 -0
  33. package/skills/diagram-design/SKILL.md +43 -0
  34. package/skills/diagram-design/references/template.md +33 -0
  35. package/skills/humanizer/SKILL.md +30 -0
  36. package/skills/impeccable/SKILL.md +36 -0
  37. package/skills/orchestrate/SKILL.md +38 -0
  38. package/skills/orchestrate/agents/openai.yaml +2 -0
  39. package/skills/plan-flow/SKILL.md +37 -0
  40. package/skills/plan-flow/agents/openai.yaml +2 -0
  41. package/skills/review/SKILL.md +22 -0
  42. package/skills/review/agents/openai.yaml +2 -0
  43. package/skills/security-audit/SKILL.md +32 -0
  44. package/skills/testing/SKILL.md +28 -0
  45. package/templates/GLOSSARY.md +11 -0
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Policy matcher shared by every guard (Pi extension, Claude Code hook). guard/build.js copies this
5
+ * file beside each of them, because each is deployed on its own.
6
+ *
7
+ * Best effort, not a sandbox: a command built through an interpreter (`python -c`) is not seen.
8
+ */
9
+
10
+ const path = require("node:path");
11
+
12
+ const SEGMENT_SEPARATORS = /&&|\|\||[;|\n]/;
13
+
14
+ /**
15
+ * Case-insensitive: the default macOS and Windows file systems open `.ENV` as `.env`.
16
+ *
17
+ * @param {string} pattern glob where `*` stands for any run of characters inside one path segment
18
+ * @returns {RegExp}
19
+ */
20
+ function globToRegExp(pattern) {
21
+ const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*");
22
+ return new RegExp(`^${escaped}$`, "i");
23
+ }
24
+
25
+ /** @param {string} word @returns {string} */
26
+ function unquote(word) {
27
+ return word.replace(/^['"]+|['"]+$/g, "");
28
+ }
29
+
30
+ /**
31
+ * Words of one shell segment, without leading VAR=value assignments.
32
+ * @param {string} segment
33
+ * @returns {string[]}
34
+ */
35
+ function wordsOf(segment) {
36
+ const words = segment.trim().split(/\s+/).filter(Boolean).map(unquote);
37
+ while (words.length > 0 && /^[A-Za-z_][A-Za-z0-9_]*=/.test(words[0])) words.shift();
38
+ return words;
39
+ }
40
+
41
+ /** @param {string} command @returns {string[][]} */
42
+ function segmentsOf(command) {
43
+ return command.split(SEGMENT_SEPARATORS).map(wordsOf).filter((words) => words.length > 0);
44
+ }
45
+
46
+ /**
47
+ * @typedef {Object} ShellRule
48
+ * @property {string[]} command
49
+ * @property {string[]} [anyOf]
50
+ * @property {"ask" | "deny"} decision
51
+ * @property {string} reason
52
+ *
53
+ * @typedef {Object} Policy
54
+ * @property {{basenames: string[], except: string[], directories: string[], readers: string[]}} secrets
55
+ * @property {ShellRule[]} shell
56
+ */
57
+
58
+ /**
59
+ * @param {Policy} policy
60
+ * @returns {{isSecretPath: (filePath: string) => boolean, readsSecret: (command: string) => boolean, ruleHit: (command: string) => ShellRule | undefined}}
61
+ */
62
+ function createMatcher(policy) {
63
+ const secretBasenames = policy.secrets.basenames.map(globToRegExp);
64
+ const allowedBasenames = policy.secrets.except.map(globToRegExp);
65
+ const secretDirectories = policy.secrets.directories.map((name) => name.toLowerCase());
66
+
67
+ /** @param {string} filePath @returns {boolean} */
68
+ function isSecretPath(filePath) {
69
+ const base = path.basename(filePath);
70
+ if (allowedBasenames.some((pattern) => pattern.test(base))) return false;
71
+ if (secretBasenames.some((pattern) => pattern.test(base))) return true;
72
+ return filePath.split("/").some((part) => secretDirectories.includes(part.toLowerCase()));
73
+ }
74
+
75
+ /** @param {string} command @returns {boolean} */
76
+ function readsSecret(command) {
77
+ return segmentsOf(command).some(
78
+ ([first, ...args]) => policy.secrets.readers.includes(first) && args.some(isSecretPath),
79
+ );
80
+ }
81
+
82
+ /**
83
+ * @param {string} command
84
+ * @returns {ShellRule | undefined} the first policy rule the command hits
85
+ */
86
+ function ruleHit(command) {
87
+ for (const words of segmentsOf(command)) {
88
+ for (const rule of policy.shell) {
89
+ const matchesCommand = rule.command.every((token, index) => words[index] === token);
90
+ if (!matchesCommand) continue;
91
+ const rest = words.slice(rule.command.length);
92
+ if (!rule.anyOf || rest.some((word) => rule.anyOf.includes(word))) return rule;
93
+ }
94
+ }
95
+ return undefined;
96
+ }
97
+
98
+ return { isSecretPath, readsSecret, ruleHit };
99
+ }
100
+
101
+ module.exports = { createMatcher };
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ /**
5
+ * Lean Agent Harness guard for Claude Code (PreToolUse hook).
6
+ *
7
+ * Enforces the secret and destructive-command rules of AGENTS.md: secret files are denied outright,
8
+ * destructive shell commands go back to the user through Claude Code's own permission prompt.
9
+ * Rules live in policy.json and the matcher in core.js (both installed beside this file, generated
10
+ * by guard/build.js). Input it cannot read exits 2, which blocks the call: a broken guard fails closed.
11
+ *
12
+ * Best effort, not a sandbox: a command built through an interpreter (`python -c`) is not seen.
13
+ */
14
+
15
+ const { createMatcher } = require("./core.js");
16
+ const policy = require("./policy.json");
17
+
18
+ const { isSecretPath, readsSecret, ruleHit } = createMatcher(policy);
19
+ // Grep reads file contents through `path` (a file) and `glob` (a file name filter).
20
+ const FILE_PATH_KEYS = ["file_path", "notebook_path", "path", "glob"];
21
+
22
+ /**
23
+ * @param {string} toolName
24
+ * @param {Record<string, unknown>} toolInput
25
+ * @returns {{decision: "ask" | "deny", reason: string} | undefined}
26
+ */
27
+ function decide(toolName, toolInput) {
28
+ if (toolName === "Bash") {
29
+ const command = toolInput.command;
30
+ if (typeof command !== "string") return undefined;
31
+ if (readsSecret(command)) {
32
+ return { decision: "deny", reason: "This command reads a secret file: AGENTS.md forbids it." };
33
+ }
34
+ const hit = ruleHit(command);
35
+ return hit ? { decision: hit.decision, reason: hit.reason } : undefined;
36
+ }
37
+
38
+ for (const key of FILE_PATH_KEYS) {
39
+ const target = toolInput[key];
40
+ if (typeof target === "string" && isSecretPath(target)) {
41
+ return { decision: "deny", reason: `"${target}" is a secret file: AGENTS.md forbids reading, editing or writing it.` };
42
+ }
43
+ }
44
+ return undefined;
45
+ }
46
+
47
+ /** @param {string} raw @returns {string} the hook's stdout */
48
+ function run(raw) {
49
+ const event = JSON.parse(raw);
50
+ if (typeof event !== "object" || event === null || typeof event.tool_name !== "string" || typeof event.tool_input !== "object" || event.tool_input === null) {
51
+ throw new Error("expected {tool_name, tool_input}");
52
+ }
53
+ const verdict = decide(event.tool_name, event.tool_input);
54
+ if (!verdict) return "";
55
+ return JSON.stringify({
56
+ hookSpecificOutput: {
57
+ hookEventName: "PreToolUse",
58
+ permissionDecision: verdict.decision,
59
+ permissionDecisionReason: verdict.reason,
60
+ },
61
+ });
62
+ }
63
+
64
+ let raw = "";
65
+ process.stdin.setEncoding("utf8");
66
+ process.stdin.on("data", (chunk) => {
67
+ raw += chunk;
68
+ });
69
+ process.stdin.on("end", () => {
70
+ try {
71
+ process.stdout.write(run(raw));
72
+ } catch (err) {
73
+ process.stderr.write(`lah-guard: cannot read the hook input (${err.message}); blocking the call.\n`);
74
+ process.exitCode = 2;
75
+ }
76
+ });
@@ -0,0 +1,33 @@
1
+ {
2
+ "secrets": {
3
+ "basenames": [".env", ".env.*", "*.pem", "*.key", "id_rsa", "id_ed25519"],
4
+ "except": [".env.example"],
5
+ "directories": [".ssh"],
6
+ "readers": ["cat", "less", "more", "head", "tail", "grep", "rg", "sed", "awk", "cp", "mv", "scp", "base64", "xxd", "strings", "bat", "nl", "tac", "od", "hexdump", "source", "."]
7
+ },
8
+ "shell": [
9
+ {
10
+ "command": ["rm"],
11
+ "anyOf": ["-rf", "-fr", "-rF", "-Rf", "-fR", "-r", "-R", "--recursive"],
12
+ "decision": "ask",
13
+ "reason": "Recursive delete requires explicit human confirmation."
14
+ },
15
+ {
16
+ "command": ["git", "reset"],
17
+ "anyOf": ["--hard"],
18
+ "decision": "ask",
19
+ "reason": "git reset --hard discards uncommitted work and requires explicit human confirmation."
20
+ },
21
+ {
22
+ "command": ["git", "push"],
23
+ "anyOf": ["--force", "-f"],
24
+ "decision": "ask",
25
+ "reason": "Force push rewrites remote history and requires explicit human confirmation."
26
+ },
27
+ {
28
+ "command": ["sudo"],
29
+ "decision": "ask",
30
+ "reason": "sudo is not allowed without explicit human confirmation."
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ /**
5
+ * Registers the lah guard hook in a Claude Code settings.json without touching anything else.
6
+ * Used by bin/cli.js (require) and install.sh (`node merge-settings.js <hook.json> <settings.json>`).
7
+ *
8
+ * A settings.json that is not valid JSON, or whose `hooks` have an unexpected shape, is never
9
+ * modified. When the file changes, the previous one is kept as "<name>.bak" (or the next free .bak.N).
10
+ */
11
+
12
+ const fs = require("node:fs");
13
+ const path = require("node:path");
14
+
15
+ /** @param {unknown} value @returns {value is Record<string, unknown>} */
16
+ const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
17
+
18
+ /**
19
+ * @param {string} hookPath JSON file with {event, entry}
20
+ * @param {string} settingsPath
21
+ * @returns {boolean} true when settings.json was written
22
+ */
23
+ function mergeHook(hookPath, settingsPath) {
24
+ const { event, entry } = JSON.parse(fs.readFileSync(hookPath, "utf8"));
25
+
26
+ let raw = null;
27
+ try {
28
+ raw = fs.readFileSync(settingsPath, "utf8");
29
+ } catch (err) {
30
+ if (err.code !== "ENOENT") throw err;
31
+ }
32
+
33
+ let settings = {};
34
+ if (raw !== null) {
35
+ try {
36
+ settings = JSON.parse(raw);
37
+ } catch (err) {
38
+ throw new Error(`${settingsPath} is not valid JSON (${err.message}); fix it and run again`);
39
+ }
40
+ }
41
+ const hooks = settings.hooks ?? {};
42
+ const entries = hooks[event] ?? [];
43
+ if (!isObject(settings) || !isObject(hooks) || !Array.isArray(entries)) {
44
+ throw new Error(`${settingsPath} has an unexpected "hooks" shape; fix it and run again`);
45
+ }
46
+
47
+ const command = entry.hooks[0].command;
48
+ const registered = entries.some((existing) => Array.isArray(existing?.hooks) && existing.hooks.some((hook) => hook?.command === command));
49
+ if (registered) return false;
50
+
51
+ if (raw !== null) {
52
+ let backup = `${settingsPath}.bak`;
53
+ for (let n = 1; fs.existsSync(backup); n++) backup = `${settingsPath}.bak.${n}`;
54
+ fs.copyFileSync(settingsPath, backup);
55
+ }
56
+ fs.mkdirSync(path.dirname(settingsPath), { recursive: true });
57
+ fs.writeFileSync(settingsPath, `${JSON.stringify({ ...settings, hooks: { ...hooks, [event]: [...entries, entry] } }, null, 2)}\n`);
58
+ return true;
59
+ }
60
+
61
+ if (require.main === module) {
62
+ try {
63
+ mergeHook(process.argv[2], process.argv[3]);
64
+ } catch (err) {
65
+ process.stderr.write(`${err.message}\n`);
66
+ process.exitCode = 1;
67
+ }
68
+ }
69
+
70
+ module.exports = { mergeHook };
@@ -0,0 +1,74 @@
1
+ # Generated from guard/policy.json by guard/build.js. Do not edit.
2
+ # Codex rules match command prefixes only: a flag placed after other arguments is not seen.
3
+
4
+ prefix_rule(
5
+ pattern = ["rm", "-rf"],
6
+ decision = "prompt",
7
+ justification = "Recursive delete requires explicit human confirmation.",
8
+ )
9
+
10
+ prefix_rule(
11
+ pattern = ["rm", "-fr"],
12
+ decision = "prompt",
13
+ justification = "Recursive delete requires explicit human confirmation.",
14
+ )
15
+
16
+ prefix_rule(
17
+ pattern = ["rm", "-rF"],
18
+ decision = "prompt",
19
+ justification = "Recursive delete requires explicit human confirmation.",
20
+ )
21
+
22
+ prefix_rule(
23
+ pattern = ["rm", "-Rf"],
24
+ decision = "prompt",
25
+ justification = "Recursive delete requires explicit human confirmation.",
26
+ )
27
+
28
+ prefix_rule(
29
+ pattern = ["rm", "-fR"],
30
+ decision = "prompt",
31
+ justification = "Recursive delete requires explicit human confirmation.",
32
+ )
33
+
34
+ prefix_rule(
35
+ pattern = ["rm", "-r"],
36
+ decision = "prompt",
37
+ justification = "Recursive delete requires explicit human confirmation.",
38
+ )
39
+
40
+ prefix_rule(
41
+ pattern = ["rm", "-R"],
42
+ decision = "prompt",
43
+ justification = "Recursive delete requires explicit human confirmation.",
44
+ )
45
+
46
+ prefix_rule(
47
+ pattern = ["rm", "--recursive"],
48
+ decision = "prompt",
49
+ justification = "Recursive delete requires explicit human confirmation.",
50
+ )
51
+
52
+ prefix_rule(
53
+ pattern = ["git", "reset", "--hard"],
54
+ decision = "prompt",
55
+ justification = "git reset --hard discards uncommitted work and requires explicit human confirmation.",
56
+ )
57
+
58
+ prefix_rule(
59
+ pattern = ["git", "push", "--force"],
60
+ decision = "prompt",
61
+ justification = "Force push rewrites remote history and requires explicit human confirmation.",
62
+ )
63
+
64
+ prefix_rule(
65
+ pattern = ["git", "push", "-f"],
66
+ decision = "prompt",
67
+ justification = "Force push rewrites remote history and requires explicit human confirmation.",
68
+ )
69
+
70
+ prefix_rule(
71
+ pattern = ["sudo"],
72
+ decision = "prompt",
73
+ justification = "sudo is not allowed without explicit human confirmation.",
74
+ )
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Policy matcher shared by every guard (Pi extension, Claude Code hook). guard/build.js copies this
5
+ * file beside each of them, because each is deployed on its own.
6
+ *
7
+ * Best effort, not a sandbox: a command built through an interpreter (`python -c`) is not seen.
8
+ */
9
+
10
+ const path = require("node:path");
11
+
12
+ const SEGMENT_SEPARATORS = /&&|\|\||[;|\n]/;
13
+
14
+ /**
15
+ * Case-insensitive: the default macOS and Windows file systems open `.ENV` as `.env`.
16
+ *
17
+ * @param {string} pattern glob where `*` stands for any run of characters inside one path segment
18
+ * @returns {RegExp}
19
+ */
20
+ function globToRegExp(pattern) {
21
+ const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*");
22
+ return new RegExp(`^${escaped}$`, "i");
23
+ }
24
+
25
+ /** @param {string} word @returns {string} */
26
+ function unquote(word) {
27
+ return word.replace(/^['"]+|['"]+$/g, "");
28
+ }
29
+
30
+ /**
31
+ * Words of one shell segment, without leading VAR=value assignments.
32
+ * @param {string} segment
33
+ * @returns {string[]}
34
+ */
35
+ function wordsOf(segment) {
36
+ const words = segment.trim().split(/\s+/).filter(Boolean).map(unquote);
37
+ while (words.length > 0 && /^[A-Za-z_][A-Za-z0-9_]*=/.test(words[0])) words.shift();
38
+ return words;
39
+ }
40
+
41
+ /** @param {string} command @returns {string[][]} */
42
+ function segmentsOf(command) {
43
+ return command.split(SEGMENT_SEPARATORS).map(wordsOf).filter((words) => words.length > 0);
44
+ }
45
+
46
+ /**
47
+ * @typedef {Object} ShellRule
48
+ * @property {string[]} command
49
+ * @property {string[]} [anyOf]
50
+ * @property {"ask" | "deny"} decision
51
+ * @property {string} reason
52
+ *
53
+ * @typedef {Object} Policy
54
+ * @property {{basenames: string[], except: string[], directories: string[], readers: string[]}} secrets
55
+ * @property {ShellRule[]} shell
56
+ */
57
+
58
+ /**
59
+ * @param {Policy} policy
60
+ * @returns {{isSecretPath: (filePath: string) => boolean, readsSecret: (command: string) => boolean, ruleHit: (command: string) => ShellRule | undefined}}
61
+ */
62
+ function createMatcher(policy) {
63
+ const secretBasenames = policy.secrets.basenames.map(globToRegExp);
64
+ const allowedBasenames = policy.secrets.except.map(globToRegExp);
65
+ const secretDirectories = policy.secrets.directories.map((name) => name.toLowerCase());
66
+
67
+ /** @param {string} filePath @returns {boolean} */
68
+ function isSecretPath(filePath) {
69
+ const base = path.basename(filePath);
70
+ if (allowedBasenames.some((pattern) => pattern.test(base))) return false;
71
+ if (secretBasenames.some((pattern) => pattern.test(base))) return true;
72
+ return filePath.split("/").some((part) => secretDirectories.includes(part.toLowerCase()));
73
+ }
74
+
75
+ /** @param {string} command @returns {boolean} */
76
+ function readsSecret(command) {
77
+ return segmentsOf(command).some(
78
+ ([first, ...args]) => policy.secrets.readers.includes(first) && args.some(isSecretPath),
79
+ );
80
+ }
81
+
82
+ /**
83
+ * @param {string} command
84
+ * @returns {ShellRule | undefined} the first policy rule the command hits
85
+ */
86
+ function ruleHit(command) {
87
+ for (const words of segmentsOf(command)) {
88
+ for (const rule of policy.shell) {
89
+ const matchesCommand = rule.command.every((token, index) => words[index] === token);
90
+ if (!matchesCommand) continue;
91
+ const rest = words.slice(rule.command.length);
92
+ if (!rule.anyOf || rest.some((word) => rule.anyOf.includes(word))) return rule;
93
+ }
94
+ }
95
+ return undefined;
96
+ }
97
+
98
+ return { isSecretPath, readsSecret, ruleHit };
99
+ }
100
+
101
+ module.exports = { createMatcher };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Lean Agent Harness guard for Pi.
5
+ *
6
+ * Enforces the secret and destructive-command rules of AGENTS.md at the tool_call boundary:
7
+ * secret files are denied outright, destructive shell commands need a human answer, and without a
8
+ * UI to answer they are blocked. Rules live in policy.json and the matcher in core.js (both
9
+ * installed beside this file, generated by guard/build.js).
10
+ *
11
+ * Best effort, not a sandbox: a command built through an interpreter (`python -c`) is not seen.
12
+ */
13
+
14
+ const { createMatcher } = require("./core.js");
15
+ const policy = require("./policy.json");
16
+
17
+ const { isSecretPath, readsSecret, ruleHit } = createMatcher(policy);
18
+ const FILE_TOOLS = new Set(["read", "edit", "write"]);
19
+
20
+ /** @param {string} reason @returns {{block: true, reason: string}} */
21
+ const block = (reason) => ({ block: true, reason });
22
+
23
+ /** @param {{on: Function}} pi */
24
+ module.exports = function lahGuard(pi) {
25
+ pi.on("tool_call", async (event, ctx) => {
26
+ const input = event.input || {};
27
+
28
+ if (FILE_TOOLS.has(event.toolName)) {
29
+ const target = input.path ?? input.file_path;
30
+ if (typeof target === "string" && isSecretPath(target)) {
31
+ return block(`"${target}" is a secret file: AGENTS.md forbids reading, editing or writing it.`);
32
+ }
33
+ return undefined;
34
+ }
35
+
36
+ if (event.toolName !== "bash" || typeof input.command !== "string") return undefined;
37
+
38
+ if (readsSecret(input.command)) {
39
+ return block("This command reads a secret file: AGENTS.md forbids it.");
40
+ }
41
+
42
+ const hit = ruleHit(input.command);
43
+ if (!hit) return undefined;
44
+ if (hit.decision === "deny") return block(hit.reason);
45
+ if (!ctx.hasUI) return block(`${hit.reason} Blocked: no UI for confirmation.`);
46
+ const confirmed = await ctx.ui.confirm("Confirm command", `${input.command}\n\n${hit.reason}`);
47
+ return confirmed ? undefined : block("Blocked by the user.");
48
+ });
49
+ };
@@ -0,0 +1,33 @@
1
+ {
2
+ "secrets": {
3
+ "basenames": [".env", ".env.*", "*.pem", "*.key", "id_rsa", "id_ed25519"],
4
+ "except": [".env.example"],
5
+ "directories": [".ssh"],
6
+ "readers": ["cat", "less", "more", "head", "tail", "grep", "rg", "sed", "awk", "cp", "mv", "scp", "base64", "xxd", "strings", "bat", "nl", "tac", "od", "hexdump", "source", "."]
7
+ },
8
+ "shell": [
9
+ {
10
+ "command": ["rm"],
11
+ "anyOf": ["-rf", "-fr", "-rF", "-Rf", "-fR", "-r", "-R", "--recursive"],
12
+ "decision": "ask",
13
+ "reason": "Recursive delete requires explicit human confirmation."
14
+ },
15
+ {
16
+ "command": ["git", "reset"],
17
+ "anyOf": ["--hard"],
18
+ "decision": "ask",
19
+ "reason": "git reset --hard discards uncommitted work and requires explicit human confirmation."
20
+ },
21
+ {
22
+ "command": ["git", "push"],
23
+ "anyOf": ["--force", "-f"],
24
+ "decision": "ask",
25
+ "reason": "Force push rewrites remote history and requires explicit human confirmation."
26
+ },
27
+ {
28
+ "command": ["sudo"],
29
+ "decision": "ask",
30
+ "reason": "sudo is not allowed without explicit human confirmation."
31
+ }
32
+ ]
33
+ }