@lovrozagar/grunt 0.4.0 → 0.4.1
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/.agents/agents/grunt.md +2 -2
- package/.agents/agents/implementer.md +3 -2
- package/.agents/agents/orchestrator.md +17 -11
- package/.agents/agents/thinker.md +7 -2
- package/.agents/skills/explain/SKILL.md +2 -0
- package/.agents/skills/handoff/SKILL.md +1 -1
- package/.agents/skills/solo/SKILL.md +1 -1
- package/.claude/agents/grunt.md +2 -2
- package/.claude/agents/implementer.md +5 -2
- package/.claude/agents/orchestrator.md +17 -11
- package/.claude/agents/thinker.md +9 -2
- package/.claude/skills/explain/SKILL.md +2 -0
- package/.claude/skills/handoff/SKILL.md +1 -1
- package/.claude/skills/solo/SKILL.md +1 -1
- package/.codex/agents/grunt.toml +2 -2
- package/.codex/agents/implementer.toml +3 -2
- package/.codex/agents/orchestrator.toml +17 -11
- package/.codex/agents/thinker.toml +7 -2
- package/.grok/agents/grunt.md +2 -2
- package/.grok/agents/implementer.md +3 -2
- package/.grok/agents/orchestrator.md +17 -11
- package/.grok/agents/thinker.md +7 -2
- package/.grok/hooks/orchestrate-parent.js +25 -10
- package/.grok/skills/explain/SKILL.md +2 -0
- package/.grok/skills/handoff/SKILL.md +1 -1
- package/.grok/skills/solo/SKILL.md +1 -1
- package/.rulesync/reference/cascade.md +12 -6
- package/.rulesync/reference/hooks.md +2 -2
- package/.rulesync/reference/output.md +38 -1
- package/.rulesync/rules/CLAUDE.md +17 -11
- package/.rulesync/rules/overview.md +17 -11
- package/.rulesync/skills/explain/SKILL.md +2 -0
- package/.rulesync/skills/handoff/SKILL.md +1 -1
- package/.rulesync/skills/solo/SKILL.md +1 -1
- package/.rulesync/subagents/grunt.md +2 -2
- package/.rulesync/subagents/implementer.md +3 -2
- package/.rulesync/subagents/orchestrator.md +17 -11
- package/.rulesync/subagents/thinker.md +7 -2
- package/AGENTS.md +19 -11
- package/CLAUDE.md +19 -11
- package/README.md +6 -6
- package/cli/init.mjs +194 -26
- package/cli/init.test.ts +442 -21
- package/package.json +9 -5
- package/scripts/emit-gemini.mjs +7 -1
- package/scripts/guarded-roots.mjs +83 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/** Snapshot/remerge AGENTS.md CLAUDE.md GEMINI.md around generate/check/watch. */
|
|
3
|
+
import { execSync } from "node:child_process";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import {
|
|
8
|
+
GUARDED_ROOT_FILES,
|
|
9
|
+
healGuardedRootFile,
|
|
10
|
+
remergeGuardedRoots,
|
|
11
|
+
snapshotGuardedRoots,
|
|
12
|
+
withGuardedCheckInteriors,
|
|
13
|
+
} from "../cli/init.mjs";
|
|
14
|
+
|
|
15
|
+
const GENERATE_RAW = "rulesync:generate:raw";
|
|
16
|
+
const CHECK_RAW = "rulesync:check:raw";
|
|
17
|
+
const WATCH_RAW = "rulesync:watch:raw";
|
|
18
|
+
|
|
19
|
+
export function attachGuardedRootWatchers(cwd, heal) {
|
|
20
|
+
const w = fs.watch(cwd, (_event, filename) => {
|
|
21
|
+
if (!filename) return;
|
|
22
|
+
const base = path.basename(String(filename));
|
|
23
|
+
if (!GUARDED_ROOT_FILES.includes(base)) return;
|
|
24
|
+
heal(base);
|
|
25
|
+
});
|
|
26
|
+
return () => {
|
|
27
|
+
try {
|
|
28
|
+
w.close();
|
|
29
|
+
} catch {
|
|
30
|
+
/* ignore */
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function runGuardedRoots(mode, { cwd = process.cwd(), exec = execSync, attachWatchers } = {}) {
|
|
36
|
+
if (mode === "generate") {
|
|
37
|
+
const snap = snapshotGuardedRoots(cwd);
|
|
38
|
+
try {
|
|
39
|
+
exec(`npm run ${GENERATE_RAW}`, { cwd, stdio: "inherit", shell: true });
|
|
40
|
+
} finally {
|
|
41
|
+
remergeGuardedRoots(cwd, snap);
|
|
42
|
+
}
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (mode === "check") {
|
|
46
|
+
withGuardedCheckInteriors(cwd, () => {
|
|
47
|
+
exec(`npm run ${CHECK_RAW}`, { cwd, stdio: "inherit", shell: true });
|
|
48
|
+
});
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (mode === "watch") {
|
|
52
|
+
const snap = snapshotGuardedRoots(cwd);
|
|
53
|
+
const heal = (file) => healGuardedRootFile(cwd, file, snap);
|
|
54
|
+
const attach = attachWatchers || ((opts) => attachGuardedRootWatchers(opts.cwd, opts.heal));
|
|
55
|
+
const stop = attach({ cwd, snap, heal });
|
|
56
|
+
try {
|
|
57
|
+
exec(`npm run ${WATCH_RAW}`, { cwd, stdio: "inherit", shell: true });
|
|
58
|
+
} finally {
|
|
59
|
+
try {
|
|
60
|
+
stop?.();
|
|
61
|
+
} catch {
|
|
62
|
+
/* ignore */
|
|
63
|
+
}
|
|
64
|
+
remergeGuardedRoots(cwd, snap);
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
throw new Error("usage: guarded-roots.mjs generate|check|watch");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function main() {
|
|
72
|
+
try {
|
|
73
|
+
runGuardedRoots(process.argv[2] || "");
|
|
74
|
+
return 0;
|
|
75
|
+
} catch (err) {
|
|
76
|
+
process.stderr.write((err && err.message ? err.message : String(err)) + "\n");
|
|
77
|
+
return 1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
82
|
+
const invoked = process.argv[1] ? path.resolve(process.argv[1]) : "";
|
|
83
|
+
if (invoked === thisFile) process.exit(main());
|