tribunal-kit 2.4.2 โ 2.4.3
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/.agent/scripts/patch_skills_meta.py +177 -177
- package/.agent/scripts/patch_skills_output.py +285 -285
- package/.agent/scripts/strengthen_skills.py +220 -220
- package/.agent/skills/github-operations/SKILL.md +354 -354
- package/.agent/skills/readme-builder/SKILL.md +270 -270
- package/.agent/workflows/strengthen-skills.md +99 -99
- package/bin/tribunal-kit.js +547 -542
- package/package.json +53 -38
|
@@ -1,220 +1,220 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
strengthen_skills.py โ Appends Tribunal guardrails to SKILL.md files missing them.
|
|
4
|
-
|
|
5
|
-
Adds the following sections if not already present:
|
|
6
|
-
- ## ๐ค LLM-Specific Traps
|
|
7
|
-
- ## ๐๏ธ Tribunal Integration (Anti-Hallucination)
|
|
8
|
-
- โ Forbidden AI Tropes
|
|
9
|
-
- โ
Pre-Flight Self-Audit
|
|
10
|
-
- ๐ Verification-Before-Completion (VBC) Protocol
|
|
11
|
-
|
|
12
|
-
Usage:
|
|
13
|
-
python .agent/scripts/strengthen_skills.py .
|
|
14
|
-
python .agent/scripts/strengthen_skills.py . --dry-run
|
|
15
|
-
python .agent/scripts/strengthen_skills.py . --skill python-pro
|
|
16
|
-
python .agent/scripts/strengthen_skills.py . --path /custom/skills/dir
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
import os
|
|
20
|
-
import sys
|
|
21
|
-
import argparse
|
|
22
|
-
from pathlib import Path
|
|
23
|
-
|
|
24
|
-
RED = "\033[91m"
|
|
25
|
-
GREEN = "\033[92m"
|
|
26
|
-
YELLOW = "\033[93m"
|
|
27
|
-
BLUE = "\033[94m"
|
|
28
|
-
BOLD = "\033[1m"
|
|
29
|
-
RESET = "\033[0m"
|
|
30
|
-
|
|
31
|
-
# โโโ Rich guardrails block โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
32
|
-
# This is the canonical template appended to skills missing Tribunal sections.
|
|
33
|
-
|
|
34
|
-
GUARDRAILS_BLOCK = """
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## ๐ค LLM-Specific Traps
|
|
39
|
-
|
|
40
|
-
AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
|
|
41
|
-
|
|
42
|
-
1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
|
|
43
|
-
2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
|
|
44
|
-
3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
|
|
45
|
-
4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
46
|
-
5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## ๐๏ธ Tribunal Integration (Anti-Hallucination)
|
|
51
|
-
|
|
52
|
-
**Slash command: `/review` or `/tribunal-full`**
|
|
53
|
-
**Active reviewers: `logic-reviewer` ยท `security-auditor`**
|
|
54
|
-
|
|
55
|
-
### โ Forbidden AI Tropes
|
|
56
|
-
|
|
57
|
-
1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
|
|
58
|
-
2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
|
|
59
|
-
3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
60
|
-
|
|
61
|
-
### โ
Pre-Flight Self-Audit
|
|
62
|
-
|
|
63
|
-
Review these questions before confirming output:
|
|
64
|
-
```
|
|
65
|
-
โ
Did I rely ONLY on real, verified tools and methods?
|
|
66
|
-
โ
Is this solution appropriately scoped to the user's constraints?
|
|
67
|
-
โ
Did I handle potential failure modes and edge cases?
|
|
68
|
-
โ
Have I avoided generic boilerplate that doesn't add value?
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### ๐ Verification-Before-Completion (VBC) Protocol
|
|
72
|
-
|
|
73
|
-
**CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
|
|
74
|
-
- โ **Forbidden:** Declaring a task complete because the output "looks correct."
|
|
75
|
-
- โ
**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.
|
|
76
|
-
"""
|
|
77
|
-
|
|
78
|
-
# โโโ Detection โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
79
|
-
|
|
80
|
-
TRIBUNAL_MARKERS = [
|
|
81
|
-
"Tribunal Integration",
|
|
82
|
-
"Tribunal Integration (Anti-Hallucination)",
|
|
83
|
-
]
|
|
84
|
-
|
|
85
|
-
VBC_MARKERS = [
|
|
86
|
-
"Verification-Before-Completion",
|
|
87
|
-
"VBC Protocol",
|
|
88
|
-
]
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
def has_tribunal_block(content: str) -> bool:
|
|
92
|
-
return any(marker in content for marker in TRIBUNAL_MARKERS)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
def has_vbc_block(content: str) -> bool:
|
|
96
|
-
return any(marker in content for marker in VBC_MARKERS)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
# โโโ Output helpers โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
100
|
-
|
|
101
|
-
def header(title: str) -> None:
|
|
102
|
-
print(f"\n{BOLD}{BLUE}โโโ {title} โโโ{RESET}")
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
def ok(msg: str) -> None:
|
|
106
|
-
print(f" {GREEN}โ
{msg}{RESET}")
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
def skip(msg: str) -> None:
|
|
110
|
-
print(f" {YELLOW}โญ๏ธ {msg}{RESET}")
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
def warn(msg: str) -> None:
|
|
114
|
-
print(f" {YELLOW}โ ๏ธ {msg}{RESET}")
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
def fail(msg: str) -> None:
|
|
118
|
-
print(f" {RED}โ {msg}{RESET}")
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
# โโโ Core โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
122
|
-
|
|
123
|
-
def process_skill(skill_md: Path, dry_run: bool) -> str:
|
|
124
|
-
"""Process a single SKILL.md. Returns 'updated', 'skipped', or 'error'."""
|
|
125
|
-
skill_name = skill_md.parent.name
|
|
126
|
-
try:
|
|
127
|
-
content = skill_md.read_text(encoding="utf-8")
|
|
128
|
-
|
|
129
|
-
has_tribunal = has_tribunal_block(content)
|
|
130
|
-
has_vbc = has_vbc_block(content)
|
|
131
|
-
|
|
132
|
-
if has_tribunal and has_vbc:
|
|
133
|
-
skip(f"{skill_name} โ already has Tribunal + VBC blocks")
|
|
134
|
-
return "skipped"
|
|
135
|
-
|
|
136
|
-
missing = []
|
|
137
|
-
if not has_tribunal:
|
|
138
|
-
missing.append("Tribunal Integration")
|
|
139
|
-
if not has_vbc:
|
|
140
|
-
missing.append("VBC Protocol")
|
|
141
|
-
|
|
142
|
-
if dry_run:
|
|
143
|
-
warn(f"[DRY RUN] {skill_name} โ would add: {', '.join(missing)}")
|
|
144
|
-
return "updated"
|
|
145
|
-
|
|
146
|
-
with skill_md.open("a", encoding="utf-8") as f:
|
|
147
|
-
f.write(GUARDRAILS_BLOCK)
|
|
148
|
-
|
|
149
|
-
ok(f"{skill_name} โ strengthened ({', '.join(missing)} added)")
|
|
150
|
-
return "updated"
|
|
151
|
-
|
|
152
|
-
except Exception as e:
|
|
153
|
-
fail(f"{skill_name} โ {e}")
|
|
154
|
-
return "error"
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
# โโโ Main โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
158
|
-
|
|
159
|
-
def main() -> None:
|
|
160
|
-
parser = argparse.ArgumentParser(
|
|
161
|
-
description="Appends Tribunal guardrails (LLM Traps + Pre-Flight + VBC) to skills missing them"
|
|
162
|
-
)
|
|
163
|
-
parser.add_argument(
|
|
164
|
-
"path",
|
|
165
|
-
nargs="?",
|
|
166
|
-
default=".",
|
|
167
|
-
help="Project root directory (default: current directory)"
|
|
168
|
-
)
|
|
169
|
-
parser.add_argument("--dry-run", action="store_true", help="Show changes without writing")
|
|
170
|
-
parser.add_argument("--skill", help="Only strengthen a specific skill by name")
|
|
171
|
-
parser.add_argument(
|
|
172
|
-
"--skills-path",
|
|
173
|
-
help="Override the skills directory path (default: <path>/.agent/skills)"
|
|
174
|
-
)
|
|
175
|
-
args = parser.parse_args()
|
|
176
|
-
|
|
177
|
-
project_root = Path(args.path).resolve()
|
|
178
|
-
skills_dir = (
|
|
179
|
-
Path(args.skills_path).resolve()
|
|
180
|
-
if args.skills_path
|
|
181
|
-
else project_root / ".agent" / "skills"
|
|
182
|
-
)
|
|
183
|
-
|
|
184
|
-
if not skills_dir.is_dir():
|
|
185
|
-
fail(f"Skills directory not found: {skills_dir}")
|
|
186
|
-
sys.exit(1)
|
|
187
|
-
|
|
188
|
-
print(f"{BOLD}Tribunal โ strengthen_skills.py{RESET}")
|
|
189
|
-
if args.dry_run:
|
|
190
|
-
print(f" {YELLOW}DRY RUN โ no files will be written{RESET}")
|
|
191
|
-
print(f"Skills dir: {skills_dir}\n")
|
|
192
|
-
|
|
193
|
-
counts: dict[str, int] = {"updated": 0, "skipped": 0, "error": 0}
|
|
194
|
-
|
|
195
|
-
header("Strengthening Skills")
|
|
196
|
-
for skill_dir in sorted(skills_dir.iterdir()):
|
|
197
|
-
if not skill_dir.is_dir():
|
|
198
|
-
continue
|
|
199
|
-
if args.skill and skill_dir.name != args.skill:
|
|
200
|
-
continue
|
|
201
|
-
skill_md = skill_dir / "SKILL.md"
|
|
202
|
-
if not skill_md.exists():
|
|
203
|
-
warn(f"{skill_dir.name} โ no SKILL.md found")
|
|
204
|
-
continue
|
|
205
|
-
result = process_skill(skill_md, args.dry_run)
|
|
206
|
-
counts[result] += 1
|
|
207
|
-
|
|
208
|
-
print(f"\n{BOLD}โโโ Summary โโโ{RESET}")
|
|
209
|
-
print(f" {GREEN}โ
Strengthened: {counts['updated']}{RESET}")
|
|
210
|
-
print(f" {YELLOW}โญ๏ธ Skipped: {counts['skipped']}{RESET}")
|
|
211
|
-
if counts["error"]:
|
|
212
|
-
print(f" {RED}โ Errors: {counts['error']}{RESET}")
|
|
213
|
-
if args.dry_run:
|
|
214
|
-
print(f" {YELLOW}(dry-run โ nothing written){RESET}")
|
|
215
|
-
|
|
216
|
-
sys.exit(1 if counts["error"] > 0 else 0)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if __name__ == "__main__":
|
|
220
|
-
main()
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
strengthen_skills.py โ Appends Tribunal guardrails to SKILL.md files missing them.
|
|
4
|
+
|
|
5
|
+
Adds the following sections if not already present:
|
|
6
|
+
- ## ๐ค LLM-Specific Traps
|
|
7
|
+
- ## ๐๏ธ Tribunal Integration (Anti-Hallucination)
|
|
8
|
+
- โ Forbidden AI Tropes
|
|
9
|
+
- โ
Pre-Flight Self-Audit
|
|
10
|
+
- ๐ Verification-Before-Completion (VBC) Protocol
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
python .agent/scripts/strengthen_skills.py .
|
|
14
|
+
python .agent/scripts/strengthen_skills.py . --dry-run
|
|
15
|
+
python .agent/scripts/strengthen_skills.py . --skill python-pro
|
|
16
|
+
python .agent/scripts/strengthen_skills.py . --path /custom/skills/dir
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
import os
|
|
20
|
+
import sys
|
|
21
|
+
import argparse
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
|
|
24
|
+
RED = "\033[91m"
|
|
25
|
+
GREEN = "\033[92m"
|
|
26
|
+
YELLOW = "\033[93m"
|
|
27
|
+
BLUE = "\033[94m"
|
|
28
|
+
BOLD = "\033[1m"
|
|
29
|
+
RESET = "\033[0m"
|
|
30
|
+
|
|
31
|
+
# โโโ Rich guardrails block โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
32
|
+
# This is the canonical template appended to skills missing Tribunal sections.
|
|
33
|
+
|
|
34
|
+
GUARDRAILS_BLOCK = """
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## ๐ค LLM-Specific Traps
|
|
39
|
+
|
|
40
|
+
AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
|
|
41
|
+
|
|
42
|
+
1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
|
|
43
|
+
2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
|
|
44
|
+
3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
|
|
45
|
+
4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
46
|
+
5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## ๐๏ธ Tribunal Integration (Anti-Hallucination)
|
|
51
|
+
|
|
52
|
+
**Slash command: `/review` or `/tribunal-full`**
|
|
53
|
+
**Active reviewers: `logic-reviewer` ยท `security-auditor`**
|
|
54
|
+
|
|
55
|
+
### โ Forbidden AI Tropes
|
|
56
|
+
|
|
57
|
+
1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
|
|
58
|
+
2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
|
|
59
|
+
3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
|
|
60
|
+
|
|
61
|
+
### โ
Pre-Flight Self-Audit
|
|
62
|
+
|
|
63
|
+
Review these questions before confirming output:
|
|
64
|
+
```
|
|
65
|
+
โ
Did I rely ONLY on real, verified tools and methods?
|
|
66
|
+
โ
Is this solution appropriately scoped to the user's constraints?
|
|
67
|
+
โ
Did I handle potential failure modes and edge cases?
|
|
68
|
+
โ
Have I avoided generic boilerplate that doesn't add value?
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### ๐ Verification-Before-Completion (VBC) Protocol
|
|
72
|
+
|
|
73
|
+
**CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
|
|
74
|
+
- โ **Forbidden:** Declaring a task complete because the output "looks correct."
|
|
75
|
+
- โ
**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.
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
# โโโ Detection โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
79
|
+
|
|
80
|
+
TRIBUNAL_MARKERS = [
|
|
81
|
+
"Tribunal Integration",
|
|
82
|
+
"Tribunal Integration (Anti-Hallucination)",
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
VBC_MARKERS = [
|
|
86
|
+
"Verification-Before-Completion",
|
|
87
|
+
"VBC Protocol",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def has_tribunal_block(content: str) -> bool:
|
|
92
|
+
return any(marker in content for marker in TRIBUNAL_MARKERS)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def has_vbc_block(content: str) -> bool:
|
|
96
|
+
return any(marker in content for marker in VBC_MARKERS)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
# โโโ Output helpers โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
100
|
+
|
|
101
|
+
def header(title: str) -> None:
|
|
102
|
+
print(f"\n{BOLD}{BLUE}โโโ {title} โโโ{RESET}")
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def ok(msg: str) -> None:
|
|
106
|
+
print(f" {GREEN}โ
{msg}{RESET}")
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def skip(msg: str) -> None:
|
|
110
|
+
print(f" {YELLOW}โญ๏ธ {msg}{RESET}")
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def warn(msg: str) -> None:
|
|
114
|
+
print(f" {YELLOW}โ ๏ธ {msg}{RESET}")
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def fail(msg: str) -> None:
|
|
118
|
+
print(f" {RED}โ {msg}{RESET}")
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
# โโโ Core โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
122
|
+
|
|
123
|
+
def process_skill(skill_md: Path, dry_run: bool) -> str:
|
|
124
|
+
"""Process a single SKILL.md. Returns 'updated', 'skipped', or 'error'."""
|
|
125
|
+
skill_name = skill_md.parent.name
|
|
126
|
+
try:
|
|
127
|
+
content = skill_md.read_text(encoding="utf-8")
|
|
128
|
+
|
|
129
|
+
has_tribunal = has_tribunal_block(content)
|
|
130
|
+
has_vbc = has_vbc_block(content)
|
|
131
|
+
|
|
132
|
+
if has_tribunal and has_vbc:
|
|
133
|
+
skip(f"{skill_name} โ already has Tribunal + VBC blocks")
|
|
134
|
+
return "skipped"
|
|
135
|
+
|
|
136
|
+
missing = []
|
|
137
|
+
if not has_tribunal:
|
|
138
|
+
missing.append("Tribunal Integration")
|
|
139
|
+
if not has_vbc:
|
|
140
|
+
missing.append("VBC Protocol")
|
|
141
|
+
|
|
142
|
+
if dry_run:
|
|
143
|
+
warn(f"[DRY RUN] {skill_name} โ would add: {', '.join(missing)}")
|
|
144
|
+
return "updated"
|
|
145
|
+
|
|
146
|
+
with skill_md.open("a", encoding="utf-8") as f:
|
|
147
|
+
f.write(GUARDRAILS_BLOCK)
|
|
148
|
+
|
|
149
|
+
ok(f"{skill_name} โ strengthened ({', '.join(missing)} added)")
|
|
150
|
+
return "updated"
|
|
151
|
+
|
|
152
|
+
except Exception as e:
|
|
153
|
+
fail(f"{skill_name} โ {e}")
|
|
154
|
+
return "error"
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
# โโโ Main โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
158
|
+
|
|
159
|
+
def main() -> None:
|
|
160
|
+
parser = argparse.ArgumentParser(
|
|
161
|
+
description="Appends Tribunal guardrails (LLM Traps + Pre-Flight + VBC) to skills missing them"
|
|
162
|
+
)
|
|
163
|
+
parser.add_argument(
|
|
164
|
+
"path",
|
|
165
|
+
nargs="?",
|
|
166
|
+
default=".",
|
|
167
|
+
help="Project root directory (default: current directory)"
|
|
168
|
+
)
|
|
169
|
+
parser.add_argument("--dry-run", action="store_true", help="Show changes without writing")
|
|
170
|
+
parser.add_argument("--skill", help="Only strengthen a specific skill by name")
|
|
171
|
+
parser.add_argument(
|
|
172
|
+
"--skills-path",
|
|
173
|
+
help="Override the skills directory path (default: <path>/.agent/skills)"
|
|
174
|
+
)
|
|
175
|
+
args = parser.parse_args()
|
|
176
|
+
|
|
177
|
+
project_root = Path(args.path).resolve()
|
|
178
|
+
skills_dir = (
|
|
179
|
+
Path(args.skills_path).resolve()
|
|
180
|
+
if args.skills_path
|
|
181
|
+
else project_root / ".agent" / "skills"
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
if not skills_dir.is_dir():
|
|
185
|
+
fail(f"Skills directory not found: {skills_dir}")
|
|
186
|
+
sys.exit(1)
|
|
187
|
+
|
|
188
|
+
print(f"{BOLD}Tribunal โ strengthen_skills.py{RESET}")
|
|
189
|
+
if args.dry_run:
|
|
190
|
+
print(f" {YELLOW}DRY RUN โ no files will be written{RESET}")
|
|
191
|
+
print(f"Skills dir: {skills_dir}\n")
|
|
192
|
+
|
|
193
|
+
counts: dict[str, int] = {"updated": 0, "skipped": 0, "error": 0}
|
|
194
|
+
|
|
195
|
+
header("Strengthening Skills")
|
|
196
|
+
for skill_dir in sorted(skills_dir.iterdir()):
|
|
197
|
+
if not skill_dir.is_dir():
|
|
198
|
+
continue
|
|
199
|
+
if args.skill and skill_dir.name != args.skill:
|
|
200
|
+
continue
|
|
201
|
+
skill_md = skill_dir / "SKILL.md"
|
|
202
|
+
if not skill_md.exists():
|
|
203
|
+
warn(f"{skill_dir.name} โ no SKILL.md found")
|
|
204
|
+
continue
|
|
205
|
+
result = process_skill(skill_md, args.dry_run)
|
|
206
|
+
counts[result] += 1
|
|
207
|
+
|
|
208
|
+
print(f"\n{BOLD}โโโ Summary โโโ{RESET}")
|
|
209
|
+
print(f" {GREEN}โ
Strengthened: {counts['updated']}{RESET}")
|
|
210
|
+
print(f" {YELLOW}โญ๏ธ Skipped: {counts['skipped']}{RESET}")
|
|
211
|
+
if counts["error"]:
|
|
212
|
+
print(f" {RED}โ Errors: {counts['error']}{RESET}")
|
|
213
|
+
if args.dry_run:
|
|
214
|
+
print(f" {YELLOW}(dry-run โ nothing written){RESET}")
|
|
215
|
+
|
|
216
|
+
sys.exit(1 if counts["error"] > 0 else 0)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
if __name__ == "__main__":
|
|
220
|
+
main()
|