tribunal-kit 4.4.0 → 4.4.2

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 (90) hide show
  1. package/.agent/agents/api-architect.md +66 -66
  2. package/.agent/agents/db-latency-auditor.md +216 -216
  3. package/.agent/agents/precedence-reviewer.md +250 -250
  4. package/.agent/agents/resilience-reviewer.md +88 -88
  5. package/.agent/agents/schema-reviewer.md +67 -67
  6. package/.agent/agents/throughput-optimizer.md +299 -299
  7. package/.agent/agents/ui-ux-auditor.md +292 -292
  8. package/.agent/agents/vitals-reviewer.md +223 -223
  9. package/.agent/history/architecture-graph.yaml +32 -1
  10. package/.agent/history/graph-cache.json +66 -19
  11. package/.agent/history/snapshots/bin__tribunal-kit.js.json +19 -0
  12. package/.agent/history/snapshots/eslint.config.js.json +9 -0
  13. package/.agent/history/snapshots/migrate_refs.js.json +3 -3
  14. package/.agent/history/snapshots/scripts__changelog.js.json +2 -1
  15. package/.agent/history/snapshots/scripts__sync-version.js.json +2 -1
  16. package/.agent/history/snapshots/scripts__validate-payload.js.json +1 -0
  17. package/.agent/history/snapshots/test__integration__bridges.test.js.json +2 -1
  18. package/.agent/history/snapshots/test__integration__init.test.js.json +1 -0
  19. package/.agent/history/snapshots/test__integration__routing.test.js.json +1 -0
  20. package/.agent/history/snapshots/test__integration__swarm_dispatcher.test.js.json +2 -1
  21. package/.agent/history/snapshots/test__integration__wave2.test.js.json +2 -1
  22. package/.agent/history/snapshots/test__unit__args.test.js.json +11 -1
  23. package/.agent/history/snapshots/test__unit__case_law_manager.test.js.json +1 -0
  24. package/.agent/history/snapshots/test__unit__context_broker.test.js.json +11 -0
  25. package/.agent/history/snapshots/test__unit__copyDir.test.js.json +11 -1
  26. package/.agent/history/snapshots/test__unit__graph_tools.test.js.json +1 -0
  27. package/.agent/history/snapshots/test__unit__inner_loop_validator.test.js.json +11 -0
  28. package/.agent/history/snapshots/test__unit__selfInstall.test.js.json +11 -1
  29. package/.agent/history/snapshots/test__unit__semver.test.js.json +11 -1
  30. package/.agent/history/snapshots/test__unit__swarm_dispatcher.test.js.json +1 -0
  31. package/.agent/scripts/_colors.js +154 -2
  32. package/.agent/scripts/_utils.js +205 -3
  33. package/.agent/scripts/append_flow.js +72 -72
  34. package/.agent/scripts/auto_preview.js +197 -197
  35. package/.agent/scripts/bundle_analyzer.js +90 -119
  36. package/.agent/scripts/case_law_manager.js +18 -13
  37. package/.agent/scripts/checklist.js +100 -88
  38. package/.agent/scripts/colors.js +7 -13
  39. package/.agent/scripts/compress_skills.js +141 -141
  40. package/.agent/scripts/consolidate_skills.js +149 -149
  41. package/.agent/scripts/context_broker.js +605 -609
  42. package/.agent/scripts/deep_compress.js +150 -150
  43. package/.agent/scripts/dependency_analyzer.js +68 -106
  44. package/.agent/scripts/graph_builder.js +341 -311
  45. package/.agent/scripts/graph_visualizer.js +390 -384
  46. package/.agent/scripts/graph_zoom.js +6 -4
  47. package/.agent/scripts/inner_loop_validator.js +445 -465
  48. package/.agent/scripts/lint_runner.js +27 -28
  49. package/.agent/scripts/minify_context.js +100 -100
  50. package/.agent/scripts/mutation_runner.js +280 -280
  51. package/.agent/scripts/patch_skills_meta.js +156 -156
  52. package/.agent/scripts/patch_skills_output.js +244 -244
  53. package/.agent/scripts/schema_validator.js +280 -297
  54. package/.agent/scripts/security_scan.js +37 -64
  55. package/.agent/scripts/session_manager.js +270 -276
  56. package/.agent/scripts/skill_evolution.js +637 -644
  57. package/.agent/scripts/skill_integrator.js +307 -313
  58. package/.agent/scripts/strengthen_skills.js +193 -193
  59. package/.agent/scripts/strip_tribunal.js +47 -47
  60. package/.agent/scripts/swarm_dispatcher.js +360 -360
  61. package/.agent/scripts/test_runner.js +32 -39
  62. package/.agent/scripts/utils.js +10 -25
  63. package/.agent/scripts/verify_all.js +84 -92
  64. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +1 -1
  65. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +1 -1
  66. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +1 -1
  67. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +1 -1
  68. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +1 -1
  69. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +1 -1
  70. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +1 -1
  71. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +1 -1
  72. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +1 -1
  73. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +1 -1
  74. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +1 -1
  75. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +1 -1
  76. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +1 -1
  77. package/.agent/skills/doc.md +1 -1
  78. package/.agent/skills/knowledge-graph/SKILL.md +52 -52
  79. package/.agent/skills/ui-ux-pro-max/SKILL.md +562 -562
  80. package/.agent/workflows/generate.md +183 -183
  81. package/.agent/workflows/tribunal-speed.md +183 -183
  82. package/README.md +1 -1
  83. package/bin/tribunal-kit.js +76 -87
  84. package/package.json +6 -3
  85. package/scripts/changelog.js +167 -167
  86. package/scripts/sync-version.js +81 -81
  87. package/.agent/history/architecture-explorer.html +0 -352
  88. package/.agent/scripts/__pycache__/_colors.cpython-311.pyc +0 -0
  89. package/.agent/scripts/__pycache__/_utils.cpython-311.pyc +0 -0
  90. package/.agent/scripts/__pycache__/case_law_manager.cpython-311.pyc +0 -0
@@ -1,193 +1,193 @@
1
- #!/usr/bin/env node
2
- /**
3
- * strengthen_skills.js — Appends Tribunal guardrails to SKILL.md files missing them.
4
- *
5
- * Usage:
6
- * node .agent/scripts/strengthen_skills.js .
7
- * node .agent/scripts/strengthen_skills.js . --dry-run
8
- * node .agent/scripts/strengthen_skills.js . --skill python-pro
9
- * node .agent/scripts/strengthen_skills.js . --skills-path /custom/skills/dir
10
- */
11
-
12
- 'use strict';
13
-
14
- const fs = require('fs');
15
- const path = require('path');
16
-
17
- const { RED, GREEN, YELLOW, BLUE, BOLD, RESET } = require('./colors.js');
18
-
19
- const GUARDRAILS_BLOCK = `
20
-
21
- ---
22
-
23
- ## 🤖 LLM-Specific Traps
24
-
25
- AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
26
-
27
- 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
28
- 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always \`// VERIFY\` or check \`package.json\` / \`requirements.txt\`.
29
- 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
30
- 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
31
- 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
32
-
33
- ---
34
-
35
- ## 🏛️ Tribunal Integration (Anti-Hallucination)
36
-
37
- **Slash command: \`/review\` or \`/tribunal-full\`**
38
- **Active reviewers: \`logic-reviewer\` · \`security-auditor\`**
39
-
40
- ### ❌ Forbidden AI Tropes
41
-
42
- 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with \`// VERIFY: [reason]\`.
43
- 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
44
- 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
45
-
46
- ### ✅ Pre-Flight Self-Audit
47
-
48
- Review these questions before confirming output:
49
- \`\`\`
50
- ✅ Did I rely ONLY on real, verified tools and methods?
51
- ✅ Is this solution appropriately scoped to the user's constraints?
52
- ✅ Did I handle potential failure modes and edge cases?
53
- ✅ Have I avoided generic boilerplate that doesn't add value?
54
- \`\`\`
55
-
56
- ### 🛑 Verification-Before-Completion (VBC) Protocol
57
-
58
- **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
59
- - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
60
- - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
61
- `;
62
-
63
- const TRIBUNAL_MARKERS = [
64
- "Tribunal Integration",
65
- "Tribunal Integration (Anti-Hallucination)",
66
- ];
67
-
68
- const VBC_MARKERS = [
69
- "Verification-Before-Completion",
70
- "VBC Protocol",
71
- ];
72
-
73
- function hasTribunalBlock(content) {
74
- return TRIBUNAL_MARKERS.some(m => content.includes(m));
75
- }
76
-
77
- function hasVbcBlock(content) {
78
- return VBC_MARKERS.some(m => content.includes(m));
79
- }
80
-
81
- function header(title) { console.log(`\n${BOLD}${BLUE}━━━ ${title} ━━━${RESET}`); }
82
- function ok(msg) { console.log(` ${GREEN}✅ ${msg}${RESET}`); }
83
- function skip(msg) { console.log(` ${YELLOW}⏭️ ${msg}${RESET}`); }
84
- function warn(msg) { console.log(` ${YELLOW}⚠️ ${msg}${RESET}`); }
85
- function fail(msg) { console.log(` ${RED}❌ ${msg}${RESET}`); }
86
-
87
- function processSkill(skillMd, dryRun) {
88
- const skillName = path.basename(path.dirname(skillMd));
89
- try {
90
- const content = fs.readFileSync(skillMd, 'utf8');
91
- const hasTribunal = hasTribunalBlock(content);
92
- const hasVbc = hasVbcBlock(content);
93
-
94
- if (hasTribunal && hasVbc) {
95
- skip(`${skillName} — already has Tribunal + VBC blocks`);
96
- return "skipped";
97
- }
98
-
99
- const missing = [];
100
- if (!hasTribunal) missing.push("Tribunal Integration");
101
- if (!hasVbc) missing.push("VBC Protocol");
102
-
103
- if (dryRun) {
104
- warn(`[DRY RUN] ${skillName} — would add: ${missing.join(', ')}`);
105
- return "updated";
106
- }
107
-
108
- fs.appendFileSync(skillMd, GUARDRAILS_BLOCK, 'utf8');
109
- ok(`${skillName} — strengthened (${missing.join(', ')} added)`);
110
- return "updated";
111
- } catch (e) {
112
- fail(`${skillName} — ${e.message}`);
113
- return "error";
114
- }
115
- }
116
-
117
- function main() {
118
- const args = process.argv.slice(2);
119
- let targetPath = ".";
120
- let dryRun = false;
121
- let skillArg = null;
122
- let skillsPathArg = null;
123
-
124
- let i = 0;
125
- while (i < args.length) {
126
- if (args[i] === '--dry-run') {
127
- dryRun = true;
128
- } else if (args[i] === '--skill' && i + 1 < args.length) {
129
- skillArg = args[++i];
130
- } else if (args[i] === '--skills-path' && i + 1 < args.length) {
131
- skillsPathArg = args[++i];
132
- } else if (args[i] === '-h' || args[i] === '--help') {
133
- console.log("Usage: node strengthen_skills.js <path> [--dry-run] [--skill <name>] [--skills-path <path>]");
134
- process.exit(0);
135
- } else if (!args[i].startsWith('-')) {
136
- targetPath = args[i];
137
- }
138
- i++;
139
- }
140
-
141
- const projectRoot = path.resolve(targetPath);
142
- let skillsDir;
143
- if (skillsPathArg) {
144
- skillsDir = path.resolve(skillsPathArg);
145
- } else {
146
- skillsDir = path.join(projectRoot, ".agent", "skills");
147
- }
148
-
149
- if (!fs.existsSync(skillsDir) || !fs.statSync(skillsDir).isDirectory()) {
150
- fail(`Skills directory not found: ${skillsDir}`);
151
- process.exit(1);
152
- }
153
-
154
- console.log(`${BOLD}Tribunal — strengthen_skills.js${RESET}`);
155
- if (dryRun) console.log(` ${YELLOW}DRY RUN — no files will be written${RESET}`);
156
- console.log(`Skills dir: ${skillsDir}\n`);
157
-
158
- const counts = { updated: 0, skipped: 0, error: 0 };
159
- header("Strengthening Skills");
160
-
161
- const dirs = fs.readdirSync(skillsDir, { withFileTypes: true });
162
- dirs.sort((a, b) => a.name.localeCompare(b.name));
163
-
164
- for (const dir of dirs) {
165
- if (!dir.isDirectory()) continue;
166
- if (skillArg && dir.name !== skillArg) continue;
167
-
168
- const skillMd = path.join(skillsDir, dir.name, "SKILL.md");
169
- if (!fs.existsSync(skillMd)) {
170
- warn(`${dir.name} — no SKILL.md found`);
171
- continue;
172
- }
173
-
174
- const result = processSkill(skillMd, dryRun);
175
- counts[result]++;
176
- }
177
-
178
- console.log(`\n${BOLD}━━━ Summary ━━━${RESET}`);
179
- console.log(` ${GREEN}✅ Strengthened: ${counts.updated}${RESET}`);
180
- console.log(` ${YELLOW}⏭️ Skipped: ${counts.skipped}${RESET}`);
181
- if (counts.error > 0) {
182
- console.log(` ${RED}❌ Errors: ${counts.error}${RESET}`);
183
- }
184
- if (dryRun) {
185
- console.log(` ${YELLOW}(dry-run — nothing written)${RESET}`);
186
- }
187
-
188
- process.exit(counts.error > 0 ? 1 : 0);
189
- }
190
-
191
- if (require.main === module) {
192
- main();
193
- }
1
+ #!/usr/bin/env node
2
+ /**
3
+ * strengthen_skills.js — Appends Tribunal guardrails to SKILL.md files missing them.
4
+ *
5
+ * Usage:
6
+ * node .agent/scripts/strengthen_skills.js .
7
+ * node .agent/scripts/strengthen_skills.js . --dry-run
8
+ * node .agent/scripts/strengthen_skills.js . --skill python-pro
9
+ * node .agent/scripts/strengthen_skills.js . --skills-path /custom/skills/dir
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ const fs = require('fs');
15
+ const path = require('path');
16
+
17
+ const { RED, GREEN, YELLOW, BLUE, BOLD, RESET } = require('./colors.js');
18
+
19
+ const GUARDRAILS_BLOCK = `
20
+
21
+ ---
22
+
23
+ ## 🤖 LLM-Specific Traps
24
+
25
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
26
+
27
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
28
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always \`// VERIFY\` or check \`package.json\` / \`requirements.txt\`.
29
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
30
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
31
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
32
+
33
+ ---
34
+
35
+ ## 🏛️ Tribunal Integration (Anti-Hallucination)
36
+
37
+ **Slash command: \`/review\` or \`/tribunal-full\`**
38
+ **Active reviewers: \`logic-reviewer\` · \`security-auditor\`**
39
+
40
+ ### ❌ Forbidden AI Tropes
41
+
42
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with \`// VERIFY: [reason]\`.
43
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
44
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
45
+
46
+ ### ✅ Pre-Flight Self-Audit
47
+
48
+ Review these questions before confirming output:
49
+ \`\`\`
50
+ ✅ Did I rely ONLY on real, verified tools and methods?
51
+ ✅ Is this solution appropriately scoped to the user's constraints?
52
+ ✅ Did I handle potential failure modes and edge cases?
53
+ ✅ Have I avoided generic boilerplate that doesn't add value?
54
+ \`\`\`
55
+
56
+ ### 🛑 Verification-Before-Completion (VBC) Protocol
57
+
58
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
59
+ - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
60
+ - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
61
+ `;
62
+
63
+ const TRIBUNAL_MARKERS = [
64
+ "Tribunal Integration",
65
+ "Tribunal Integration (Anti-Hallucination)",
66
+ ];
67
+
68
+ const VBC_MARKERS = [
69
+ "Verification-Before-Completion",
70
+ "VBC Protocol",
71
+ ];
72
+
73
+ function hasTribunalBlock(content) {
74
+ return TRIBUNAL_MARKERS.some(m => content.includes(m));
75
+ }
76
+
77
+ function hasVbcBlock(content) {
78
+ return VBC_MARKERS.some(m => content.includes(m));
79
+ }
80
+
81
+ function header(title) { console.log(`\n${BOLD}${BLUE}━━━ ${title} ━━━${RESET}`); }
82
+ function ok(msg) { console.log(` ${GREEN}✅ ${msg}${RESET}`); }
83
+ function skip(msg) { console.log(` ${YELLOW}⏭️ ${msg}${RESET}`); }
84
+ function warn(msg) { console.log(` ${YELLOW}⚠️ ${msg}${RESET}`); }
85
+ function fail(msg) { console.log(` ${RED}❌ ${msg}${RESET}`); }
86
+
87
+ function processSkill(skillMd, dryRun) {
88
+ const skillName = path.basename(path.dirname(skillMd));
89
+ try {
90
+ const content = fs.readFileSync(skillMd, 'utf8');
91
+ const hasTribunal = hasTribunalBlock(content);
92
+ const hasVbc = hasVbcBlock(content);
93
+
94
+ if (hasTribunal && hasVbc) {
95
+ skip(`${skillName} — already has Tribunal + VBC blocks`);
96
+ return "skipped";
97
+ }
98
+
99
+ const missing = [];
100
+ if (!hasTribunal) missing.push("Tribunal Integration");
101
+ if (!hasVbc) missing.push("VBC Protocol");
102
+
103
+ if (dryRun) {
104
+ warn(`[DRY RUN] ${skillName} — would add: ${missing.join(', ')}`);
105
+ return "updated";
106
+ }
107
+
108
+ fs.appendFileSync(skillMd, GUARDRAILS_BLOCK, 'utf8');
109
+ ok(`${skillName} — strengthened (${missing.join(', ')} added)`);
110
+ return "updated";
111
+ } catch (e) {
112
+ fail(`${skillName} — ${e.message}`);
113
+ return "error";
114
+ }
115
+ }
116
+
117
+ function main() {
118
+ const args = process.argv.slice(2);
119
+ let targetPath = ".";
120
+ let dryRun = false;
121
+ let skillArg = null;
122
+ let skillsPathArg = null;
123
+
124
+ let i = 0;
125
+ while (i < args.length) {
126
+ if (args[i] === '--dry-run') {
127
+ dryRun = true;
128
+ } else if (args[i] === '--skill' && i + 1 < args.length) {
129
+ skillArg = args[++i];
130
+ } else if (args[i] === '--skills-path' && i + 1 < args.length) {
131
+ skillsPathArg = args[++i];
132
+ } else if (args[i] === '-h' || args[i] === '--help') {
133
+ console.log("Usage: node strengthen_skills.js <path> [--dry-run] [--skill <name>] [--skills-path <path>]");
134
+ process.exit(0);
135
+ } else if (!args[i].startsWith('-')) {
136
+ targetPath = args[i];
137
+ }
138
+ i++;
139
+ }
140
+
141
+ const projectRoot = path.resolve(targetPath);
142
+ let skillsDir;
143
+ if (skillsPathArg) {
144
+ skillsDir = path.resolve(skillsPathArg);
145
+ } else {
146
+ skillsDir = path.join(projectRoot, ".agent", "skills");
147
+ }
148
+
149
+ if (!fs.existsSync(skillsDir) || !fs.statSync(skillsDir).isDirectory()) {
150
+ fail(`Skills directory not found: ${skillsDir}`);
151
+ process.exit(1);
152
+ }
153
+
154
+ console.log(`${BOLD}Tribunal — strengthen_skills.js${RESET}`);
155
+ if (dryRun) console.log(` ${YELLOW}DRY RUN — no files will be written${RESET}`);
156
+ console.log(`Skills dir: ${skillsDir}\n`);
157
+
158
+ const counts = { updated: 0, skipped: 0, error: 0 };
159
+ header("Strengthening Skills");
160
+
161
+ const dirs = fs.readdirSync(skillsDir, { withFileTypes: true });
162
+ dirs.sort((a, b) => a.name.localeCompare(b.name));
163
+
164
+ for (const dir of dirs) {
165
+ if (!dir.isDirectory()) continue;
166
+ if (skillArg && dir.name !== skillArg) continue;
167
+
168
+ const skillMd = path.join(skillsDir, dir.name, "SKILL.md");
169
+ if (!fs.existsSync(skillMd)) {
170
+ warn(`${dir.name} — no SKILL.md found`);
171
+ continue;
172
+ }
173
+
174
+ const result = processSkill(skillMd, dryRun);
175
+ counts[result]++;
176
+ }
177
+
178
+ console.log(`\n${BOLD}━━━ Summary ━━━${RESET}`);
179
+ console.log(` ${GREEN}✅ Strengthened: ${counts.updated}${RESET}`);
180
+ console.log(` ${YELLOW}⏭️ Skipped: ${counts.skipped}${RESET}`);
181
+ if (counts.error > 0) {
182
+ console.log(` ${RED}❌ Errors: ${counts.error}${RESET}`);
183
+ }
184
+ if (dryRun) {
185
+ console.log(` ${YELLOW}(dry-run — nothing written)${RESET}`);
186
+ }
187
+
188
+ process.exit(counts.error > 0 ? 1 : 0);
189
+ }
190
+
191
+ if (require.main === module) {
192
+ main();
193
+ }
@@ -1,47 +1,47 @@
1
- #!/usr/bin/env node
2
- /**
3
- * strip_tribunal.js
4
- */
5
- 'use strict';
6
-
7
- const fs = require('fs');
8
- const path = require('path');
9
-
10
- function stripBoilerplate(filePath) {
11
- const original = fs.readFileSync(filePath, 'utf8');
12
- const originalLen = Buffer.byteLength(original, 'utf8');
13
-
14
- let content = original;
15
- content = content.replace(/## 🏛️ Tribunal Integration[\s\S]*?(?=\n# |\Z)/g, '');
16
- content = content.replace(/## Tribunal Integration[\s\S]*?(?=\n# |\Z)/g, '');
17
- content = content.replace(/## Cross-Workflow Navigation[\s\S]*?(?=\n# |\Z)/g, '');
18
- content = content.replace(/## What the Maker Is Not Allowed to Do[\s\S]*?(?=\n# |\Z)/g, '');
19
-
20
- fs.writeFileSync(filePath, content.trim() + '\n', 'utf8');
21
- const newLen = Buffer.byteLength(content.trim() + '\n', 'utf8');
22
-
23
- return [originalLen, newLen];
24
- }
25
-
26
- function main() {
27
- const dirsToCheck = ['.agent/agents', '.agent/workflows'];
28
- let totalStripped = 0;
29
-
30
- for (const d of dirsToCheck) {
31
- if (!fs.existsSync(d)) continue;
32
- const files = fs.readdirSync(d);
33
- for (const file of files) {
34
- if (file.endsWith('.md')) {
35
- const filePath = path.join(d, file);
36
- const [orig, newL] = stripBoilerplate(filePath);
37
- totalStripped += (orig - newL);
38
- }
39
- }
40
- }
41
-
42
- console.log(`Stripped ${totalStripped} bytes of repetitive boilerplate.`);
43
- }
44
-
45
- if (require.main === module) {
46
- main();
47
- }
1
+ #!/usr/bin/env node
2
+ /**
3
+ * strip_tribunal.js
4
+ */
5
+ 'use strict';
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+
10
+ function stripBoilerplate(filePath) {
11
+ const original = fs.readFileSync(filePath, 'utf8');
12
+ const originalLen = Buffer.byteLength(original, 'utf8');
13
+
14
+ let content = original;
15
+ content = content.replace(/## 🏛️ Tribunal Integration[\s\S]*?(?=\n# |\Z)/g, '');
16
+ content = content.replace(/## Tribunal Integration[\s\S]*?(?=\n# |\Z)/g, '');
17
+ content = content.replace(/## Cross-Workflow Navigation[\s\S]*?(?=\n# |\Z)/g, '');
18
+ content = content.replace(/## What the Maker Is Not Allowed to Do[\s\S]*?(?=\n# |\Z)/g, '');
19
+
20
+ fs.writeFileSync(filePath, content.trim() + '\n', 'utf8');
21
+ const newLen = Buffer.byteLength(content.trim() + '\n', 'utf8');
22
+
23
+ return [originalLen, newLen];
24
+ }
25
+
26
+ function main() {
27
+ const dirsToCheck = ['.agent/agents', '.agent/workflows'];
28
+ let totalStripped = 0;
29
+
30
+ for (const d of dirsToCheck) {
31
+ if (!fs.existsSync(d)) continue;
32
+ const files = fs.readdirSync(d);
33
+ for (const file of files) {
34
+ if (file.endsWith('.md')) {
35
+ const filePath = path.join(d, file);
36
+ const [orig, newL] = stripBoilerplate(filePath);
37
+ totalStripped += (orig - newL);
38
+ }
39
+ }
40
+ }
41
+
42
+ console.log(`Stripped ${totalStripped} bytes of repetitive boilerplate.`);
43
+ }
44
+
45
+ if (require.main === module) {
46
+ main();
47
+ }