tribunal-kit 4.4.0 → 4.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.
Files changed (85) 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/scripts/_colors.js +18 -18
  10. package/.agent/scripts/_utils.js +42 -42
  11. package/.agent/scripts/append_flow.js +72 -72
  12. package/.agent/scripts/auto_preview.js +197 -197
  13. package/.agent/scripts/bundle_analyzer.js +290 -290
  14. package/.agent/scripts/case_law_manager.js +17 -6
  15. package/.agent/scripts/checklist.js +266 -266
  16. package/.agent/scripts/colors.js +17 -17
  17. package/.agent/scripts/compress_skills.js +141 -141
  18. package/.agent/scripts/consolidate_skills.js +149 -149
  19. package/.agent/scripts/context_broker.js +611 -609
  20. package/.agent/scripts/deep_compress.js +150 -150
  21. package/.agent/scripts/dependency_analyzer.js +272 -272
  22. package/.agent/scripts/graph_builder.js +313 -311
  23. package/.agent/scripts/graph_visualizer.js +384 -384
  24. package/.agent/scripts/inner_loop_validator.js +451 -465
  25. package/.agent/scripts/lint_runner.js +187 -187
  26. package/.agent/scripts/minify_context.js +100 -100
  27. package/.agent/scripts/mutation_runner.js +280 -280
  28. package/.agent/scripts/patch_skills_meta.js +156 -156
  29. package/.agent/scripts/patch_skills_output.js +244 -244
  30. package/.agent/scripts/schema_validator.js +297 -297
  31. package/.agent/scripts/security_scan.js +303 -303
  32. package/.agent/scripts/session_manager.js +276 -276
  33. package/.agent/scripts/skill_evolution.js +644 -644
  34. package/.agent/scripts/skill_integrator.js +313 -313
  35. package/.agent/scripts/strengthen_skills.js +193 -193
  36. package/.agent/scripts/strip_tribunal.js +47 -47
  37. package/.agent/scripts/swarm_dispatcher.js +360 -360
  38. package/.agent/scripts/test_runner.js +193 -193
  39. package/.agent/scripts/utils.js +32 -32
  40. package/.agent/scripts/verify_all.js +257 -256
  41. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +1 -1
  42. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +1 -1
  43. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +1 -1
  44. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +1 -1
  45. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +1 -1
  46. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +1 -1
  47. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +1 -1
  48. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +1 -1
  49. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +1 -1
  50. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +1 -1
  51. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +1 -1
  52. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +1 -1
  53. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +1 -1
  54. package/.agent/skills/doc.md +1 -1
  55. package/.agent/skills/knowledge-graph/SKILL.md +52 -52
  56. package/.agent/skills/ui-ux-pro-max/SKILL.md +562 -562
  57. package/.agent/workflows/generate.md +183 -183
  58. package/.agent/workflows/tribunal-speed.md +183 -183
  59. package/README.md +1 -1
  60. package/bin/tribunal-kit.js +76 -87
  61. package/package.json +6 -3
  62. package/scripts/changelog.js +167 -167
  63. package/scripts/sync-version.js +81 -81
  64. package/.agent/history/architecture-explorer.html +0 -352
  65. package/.agent/history/architecture-graph.yaml +0 -109
  66. package/.agent/history/graph-cache.json +0 -215
  67. package/.agent/history/snapshots/migrate_refs.js.json +0 -11
  68. package/.agent/history/snapshots/scripts__changelog.js.json +0 -12
  69. package/.agent/history/snapshots/scripts__sync-version.js.json +0 -11
  70. package/.agent/history/snapshots/scripts__validate-payload.js.json +0 -11
  71. package/.agent/history/snapshots/test__integration__bridges.test.js.json +0 -13
  72. package/.agent/history/snapshots/test__integration__init.test.js.json +0 -13
  73. package/.agent/history/snapshots/test__integration__routing.test.js.json +0 -11
  74. package/.agent/history/snapshots/test__integration__swarm_dispatcher.test.js.json +0 -13
  75. package/.agent/history/snapshots/test__integration__wave2.test.js.json +0 -13
  76. package/.agent/history/snapshots/test__unit__args.test.js.json +0 -10
  77. package/.agent/history/snapshots/test__unit__case_law_manager.test.js.json +0 -10
  78. package/.agent/history/snapshots/test__unit__copyDir.test.js.json +0 -13
  79. package/.agent/history/snapshots/test__unit__graph_tools.test.js.json +0 -11
  80. package/.agent/history/snapshots/test__unit__selfInstall.test.js.json +0 -13
  81. package/.agent/history/snapshots/test__unit__semver.test.js.json +0 -10
  82. package/.agent/history/snapshots/test__unit__swarm_dispatcher.test.js.json +0 -11
  83. package/.agent/scripts/__pycache__/_colors.cpython-311.pyc +0 -0
  84. package/.agent/scripts/__pycache__/_utils.cpython-311.pyc +0 -0
  85. package/.agent/scripts/__pycache__/case_law_manager.cpython-311.pyc +0 -0
@@ -1,156 +1,156 @@
1
- #!/usr/bin/env node
2
- /**
3
- * patch_skills_meta.js — Injects version/freshness metadata into SKILL.md frontmatter.
4
- */
5
-
6
- 'use strict';
7
-
8
- const fs = require('fs');
9
- const path = require('path');
10
-
11
- const { RED, GREEN, YELLOW, BLUE, BOLD, RESET } = require('./colors.js');
12
-
13
- const META_FIELDS = {
14
- "version": "1.0.0",
15
- "last-updated": "2026-03-12",
16
- "applies-to-model": "gemini-2.5-pro, claude-3-7-sonnet"
17
- };
18
-
19
- function header(title) { console.log(`\n${BOLD}${BLUE}━━━ ${title} ━━━${RESET}`); }
20
- function ok(msg) { console.log(` ${GREEN}✅ ${msg}${RESET}`); }
21
- function skip(msg) { console.log(` ${YELLOW}⏭️ ${msg}${RESET}`); }
22
- function warn(msg) { console.log(` ${YELLOW}⚠️ ${msg}${RESET}`); }
23
- function fail(msg) { console.log(` ${RED}❌ ${msg}${RESET}`); }
24
-
25
- function patchFrontmatter(content) {
26
- const added = [];
27
- const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
28
-
29
- if (!fmMatch) {
30
- const newFmLines = ["---"];
31
- for (const [key, value] of Object.entries(META_FIELDS)) {
32
- newFmLines.push(`${key}: ${value}`);
33
- added.push(key);
34
- }
35
- newFmLines.push("---");
36
- return [newFmLines.join("\n") + "\n\n" + content, added];
37
- }
38
-
39
- const fmText = fmMatch[1];
40
- const fmEnd = fmMatch[0].length;
41
-
42
- const existingKeys = new Set();
43
- const lines = fmText.split("\n");
44
- for (const line of lines) {
45
- const m = line.match(/^([a-zA-Z0-9_-]+)\s*:/);
46
- if (m) existingKeys.add(m[1]);
47
- }
48
-
49
- const newFmLines = fmText.trimEnd().split("\n");
50
- for (const [key, value] of Object.entries(META_FIELDS)) {
51
- if (!existingKeys.has(key)) {
52
- newFmLines.push(`${key}: ${value}`);
53
- added.push(key);
54
- }
55
- }
56
-
57
- if (added.length === 0) return [content, []];
58
-
59
- const patched = "---\n" + newFmLines.join("\n") + "\n---" + content.slice(fmEnd);
60
- return [patched, added];
61
- }
62
-
63
- function processSkill(skillPath, dryRun) {
64
- const skillName = path.basename(path.dirname(skillPath));
65
- try {
66
- const content = fs.readFileSync(skillPath, 'utf8');
67
- const [patched, added] = patchFrontmatter(content);
68
-
69
- if (added.length === 0) {
70
- skip(`${skillName} — all meta fields present`);
71
- return "skipped";
72
- }
73
-
74
- const fieldList = added.join(', ');
75
- if (dryRun) {
76
- warn(`[DRY RUN] ${skillName} — would add: ${fieldList}`);
77
- return "updated";
78
- }
79
-
80
- fs.writeFileSync(skillPath, patched, 'utf8');
81
- ok(`${skillName} — added: ${fieldList}`);
82
- return "updated";
83
- } catch (e) {
84
- fail(`${skillName} — ${e.message}`);
85
- return "error";
86
- }
87
- }
88
-
89
- function main() {
90
- const args = process.argv.slice(2);
91
- let targetPath = null;
92
- let dryRun = false;
93
- let skillArg = null;
94
-
95
- let i = 0;
96
- while (i < args.length) {
97
- if (args[i] === '--dry-run') dryRun = true;
98
- else if (args[i] === '--skill' && i + 1 < args.length) skillArg = args[++i];
99
- else if (args[i] === '-h' || args[i] === '--help') {
100
- console.log("Usage: node patch_skills_meta.js <path> [--dry-run] [--skill <name>]");
101
- process.exit(0);
102
- } else if (!args[i].startsWith('-') && !targetPath) {
103
- targetPath = args[i];
104
- }
105
- i++;
106
- }
107
-
108
- if (!targetPath) {
109
- console.log("Usage: node patch_skills_meta.js <path> [--dry-run] [--skill <name>]");
110
- process.exit(1);
111
- }
112
-
113
- const projectRoot = path.resolve(targetPath);
114
- const skillsDir = path.join(projectRoot, ".agent", "skills");
115
-
116
- if (!fs.existsSync(skillsDir) || !fs.statSync(skillsDir).isDirectory()) {
117
- fail(`Skills directory not found: ${skillsDir}`);
118
- process.exit(1);
119
- }
120
-
121
- console.log(`${BOLD}Tribunal — patch_skills_meta.js${RESET}`);
122
- if (dryRun) console.log(` ${YELLOW}DRY RUN — no files will be written${RESET}`);
123
- console.log(`Skills dir: ${skillsDir}\n`);
124
-
125
- const counts = { updated: 0, skipped: 0, error: 0 };
126
- header("Patching Frontmatter");
127
-
128
- const dirs = fs.readdirSync(skillsDir, { withFileTypes: true });
129
- dirs.sort((a, b) => a.name.localeCompare(b.name));
130
-
131
- for (const dir of dirs) {
132
- if (!dir.isDirectory()) continue;
133
- if (skillArg && dir.name !== skillArg) continue;
134
-
135
- const skillMd = path.join(skillsDir, dir.name, "SKILL.md");
136
- if (!fs.existsSync(skillMd)) {
137
- warn(`${dir.name} — no SKILL.md found`);
138
- continue;
139
- }
140
-
141
- const result = processSkill(skillMd, dryRun);
142
- counts[result]++;
143
- }
144
-
145
- console.log(`\n${BOLD}━━━ Summary ━━━${RESET}`);
146
- console.log(` ${GREEN}✅ Updated: ${counts.updated}${RESET}`);
147
- console.log(` ${YELLOW}⏭️ Skipped: ${counts.skipped}${RESET}`);
148
- if (counts.error > 0) console.log(` ${RED}❌ Errors: ${counts.error}${RESET}`);
149
- if (dryRun) console.log(` ${YELLOW}(dry-run — nothing written)${RESET}`);
150
-
151
- process.exit(counts.error > 0 ? 1 : 0);
152
- }
153
-
154
- if (require.main === module) {
155
- main();
156
- }
1
+ #!/usr/bin/env node
2
+ /**
3
+ * patch_skills_meta.js — Injects version/freshness metadata into SKILL.md frontmatter.
4
+ */
5
+
6
+ 'use strict';
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+
11
+ const { RED, GREEN, YELLOW, BLUE, BOLD, RESET } = require('./colors.js');
12
+
13
+ const META_FIELDS = {
14
+ "version": "1.0.0",
15
+ "last-updated": "2026-03-12",
16
+ "applies-to-model": "gemini-2.5-pro, claude-3-7-sonnet"
17
+ };
18
+
19
+ function header(title) { console.log(`\n${BOLD}${BLUE}━━━ ${title} ━━━${RESET}`); }
20
+ function ok(msg) { console.log(` ${GREEN}✅ ${msg}${RESET}`); }
21
+ function skip(msg) { console.log(` ${YELLOW}⏭️ ${msg}${RESET}`); }
22
+ function warn(msg) { console.log(` ${YELLOW}⚠️ ${msg}${RESET}`); }
23
+ function fail(msg) { console.log(` ${RED}❌ ${msg}${RESET}`); }
24
+
25
+ function patchFrontmatter(content) {
26
+ const added = [];
27
+ const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
28
+
29
+ if (!fmMatch) {
30
+ const newFmLines = ["---"];
31
+ for (const [key, value] of Object.entries(META_FIELDS)) {
32
+ newFmLines.push(`${key}: ${value}`);
33
+ added.push(key);
34
+ }
35
+ newFmLines.push("---");
36
+ return [newFmLines.join("\n") + "\n\n" + content, added];
37
+ }
38
+
39
+ const fmText = fmMatch[1];
40
+ const fmEnd = fmMatch[0].length;
41
+
42
+ const existingKeys = new Set();
43
+ const lines = fmText.split("\n");
44
+ for (const line of lines) {
45
+ const m = line.match(/^([a-zA-Z0-9_-]+)\s*:/);
46
+ if (m) existingKeys.add(m[1]);
47
+ }
48
+
49
+ const newFmLines = fmText.trimEnd().split("\n");
50
+ for (const [key, value] of Object.entries(META_FIELDS)) {
51
+ if (!existingKeys.has(key)) {
52
+ newFmLines.push(`${key}: ${value}`);
53
+ added.push(key);
54
+ }
55
+ }
56
+
57
+ if (added.length === 0) return [content, []];
58
+
59
+ const patched = "---\n" + newFmLines.join("\n") + "\n---" + content.slice(fmEnd);
60
+ return [patched, added];
61
+ }
62
+
63
+ function processSkill(skillPath, dryRun) {
64
+ const skillName = path.basename(path.dirname(skillPath));
65
+ try {
66
+ const content = fs.readFileSync(skillPath, 'utf8');
67
+ const [patched, added] = patchFrontmatter(content);
68
+
69
+ if (added.length === 0) {
70
+ skip(`${skillName} — all meta fields present`);
71
+ return "skipped";
72
+ }
73
+
74
+ const fieldList = added.join(', ');
75
+ if (dryRun) {
76
+ warn(`[DRY RUN] ${skillName} — would add: ${fieldList}`);
77
+ return "updated";
78
+ }
79
+
80
+ fs.writeFileSync(skillPath, patched, 'utf8');
81
+ ok(`${skillName} — added: ${fieldList}`);
82
+ return "updated";
83
+ } catch (e) {
84
+ fail(`${skillName} — ${e.message}`);
85
+ return "error";
86
+ }
87
+ }
88
+
89
+ function main() {
90
+ const args = process.argv.slice(2);
91
+ let targetPath = null;
92
+ let dryRun = false;
93
+ let skillArg = null;
94
+
95
+ let i = 0;
96
+ while (i < args.length) {
97
+ if (args[i] === '--dry-run') dryRun = true;
98
+ else if (args[i] === '--skill' && i + 1 < args.length) skillArg = args[++i];
99
+ else if (args[i] === '-h' || args[i] === '--help') {
100
+ console.log("Usage: node patch_skills_meta.js <path> [--dry-run] [--skill <name>]");
101
+ process.exit(0);
102
+ } else if (!args[i].startsWith('-') && !targetPath) {
103
+ targetPath = args[i];
104
+ }
105
+ i++;
106
+ }
107
+
108
+ if (!targetPath) {
109
+ console.log("Usage: node patch_skills_meta.js <path> [--dry-run] [--skill <name>]");
110
+ process.exit(1);
111
+ }
112
+
113
+ const projectRoot = path.resolve(targetPath);
114
+ const skillsDir = path.join(projectRoot, ".agent", "skills");
115
+
116
+ if (!fs.existsSync(skillsDir) || !fs.statSync(skillsDir).isDirectory()) {
117
+ fail(`Skills directory not found: ${skillsDir}`);
118
+ process.exit(1);
119
+ }
120
+
121
+ console.log(`${BOLD}Tribunal — patch_skills_meta.js${RESET}`);
122
+ if (dryRun) console.log(` ${YELLOW}DRY RUN — no files will be written${RESET}`);
123
+ console.log(`Skills dir: ${skillsDir}\n`);
124
+
125
+ const counts = { updated: 0, skipped: 0, error: 0 };
126
+ header("Patching Frontmatter");
127
+
128
+ const dirs = fs.readdirSync(skillsDir, { withFileTypes: true });
129
+ dirs.sort((a, b) => a.name.localeCompare(b.name));
130
+
131
+ for (const dir of dirs) {
132
+ if (!dir.isDirectory()) continue;
133
+ if (skillArg && dir.name !== skillArg) continue;
134
+
135
+ const skillMd = path.join(skillsDir, dir.name, "SKILL.md");
136
+ if (!fs.existsSync(skillMd)) {
137
+ warn(`${dir.name} — no SKILL.md found`);
138
+ continue;
139
+ }
140
+
141
+ const result = processSkill(skillMd, dryRun);
142
+ counts[result]++;
143
+ }
144
+
145
+ console.log(`\n${BOLD}━━━ Summary ━━━${RESET}`);
146
+ console.log(` ${GREEN}✅ Updated: ${counts.updated}${RESET}`);
147
+ console.log(` ${YELLOW}⏭️ Skipped: ${counts.skipped}${RESET}`);
148
+ if (counts.error > 0) console.log(` ${RED}❌ Errors: ${counts.error}${RESET}`);
149
+ if (dryRun) console.log(` ${YELLOW}(dry-run — nothing written)${RESET}`);
150
+
151
+ process.exit(counts.error > 0 ? 1 : 0);
152
+ }
153
+
154
+ if (require.main === module) {
155
+ main();
156
+ }