tribunal-kit 2.4.6 → 3.1.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 (250) hide show
  1. package/.agent/ARCHITECTURE.md +99 -99
  2. package/.agent/GEMINI.md +52 -52
  3. package/.agent/agents/accessibility-reviewer.md +139 -86
  4. package/.agent/agents/ai-code-reviewer.md +160 -90
  5. package/.agent/agents/backend-specialist.md +164 -127
  6. package/.agent/agents/code-archaeologist.md +115 -73
  7. package/.agent/agents/database-architect.md +130 -110
  8. package/.agent/agents/debugger.md +137 -97
  9. package/.agent/agents/dependency-reviewer.md +78 -30
  10. package/.agent/agents/devops-engineer.md +161 -118
  11. package/.agent/agents/documentation-writer.md +151 -87
  12. package/.agent/agents/explorer-agent.md +117 -99
  13. package/.agent/agents/frontend-reviewer.md +127 -47
  14. package/.agent/agents/frontend-specialist.md +169 -109
  15. package/.agent/agents/game-developer.md +28 -164
  16. package/.agent/agents/logic-reviewer.md +87 -49
  17. package/.agent/agents/mobile-developer.md +151 -103
  18. package/.agent/agents/mobile-reviewer.md +133 -50
  19. package/.agent/agents/orchestrator.md +121 -110
  20. package/.agent/agents/penetration-tester.md +103 -77
  21. package/.agent/agents/performance-optimizer.md +136 -92
  22. package/.agent/agents/performance-reviewer.md +139 -69
  23. package/.agent/agents/product-manager.md +104 -70
  24. package/.agent/agents/product-owner.md +6 -25
  25. package/.agent/agents/project-planner.md +95 -95
  26. package/.agent/agents/qa-automation-engineer.md +174 -87
  27. package/.agent/agents/security-auditor.md +133 -129
  28. package/.agent/agents/seo-specialist.md +160 -99
  29. package/.agent/agents/sql-reviewer.md +132 -44
  30. package/.agent/agents/supervisor-agent.md +137 -109
  31. package/.agent/agents/swarm-worker-contracts.md +17 -17
  32. package/.agent/agents/swarm-worker-registry.md +46 -46
  33. package/.agent/agents/test-coverage-reviewer.md +132 -53
  34. package/.agent/agents/test-engineer.md +0 -21
  35. package/.agent/agents/type-safety-reviewer.md +143 -33
  36. package/.agent/patterns/generator.md +9 -9
  37. package/.agent/patterns/inversion.md +12 -12
  38. package/.agent/patterns/pipeline.md +9 -9
  39. package/.agent/patterns/reviewer.md +13 -13
  40. package/.agent/patterns/tool-wrapper.md +9 -9
  41. package/.agent/rules/GEMINI.md +63 -63
  42. package/.agent/scripts/__pycache__/auto_preview.cpython-311.pyc +0 -0
  43. package/.agent/scripts/__pycache__/bundle_analyzer.cpython-311.pyc +0 -0
  44. package/.agent/scripts/__pycache__/checklist.cpython-311.pyc +0 -0
  45. package/.agent/scripts/__pycache__/dependency_analyzer.cpython-311.pyc +0 -0
  46. package/.agent/scripts/__pycache__/security_scan.cpython-311.pyc +0 -0
  47. package/.agent/scripts/__pycache__/session_manager.cpython-311.pyc +0 -0
  48. package/.agent/scripts/__pycache__/skill_integrator.cpython-311.pyc +0 -0
  49. package/.agent/scripts/__pycache__/swarm_dispatcher.cpython-311.pyc +0 -0
  50. package/.agent/scripts/__pycache__/test_runner.cpython-311.pyc +0 -0
  51. package/.agent/scripts/__pycache__/verify_all.cpython-311.pyc +0 -0
  52. package/.agent/scripts/compress_skills.py +167 -0
  53. package/.agent/scripts/consolidate_skills.py +173 -0
  54. package/.agent/scripts/deep_compress.py +202 -0
  55. package/.agent/scripts/minify_context.py +80 -0
  56. package/.agent/scripts/security_scan.py +1 -1
  57. package/.agent/scripts/strip_tribunal.py +41 -0
  58. package/.agent/skills/agent-organizer/SKILL.md +60 -100
  59. package/.agent/skills/agentic-patterns/SKILL.md +0 -70
  60. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +108 -53
  61. package/.agent/skills/api-patterns/SKILL.md +197 -257
  62. package/.agent/skills/api-security-auditor/SKILL.md +125 -57
  63. package/.agent/skills/app-builder/SKILL.md +326 -50
  64. package/.agent/skills/app-builder/templates/SKILL.md +13 -15
  65. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +16 -16
  66. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +22 -22
  67. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +18 -18
  68. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +20 -20
  69. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +17 -17
  70. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +18 -18
  71. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +21 -21
  72. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +19 -19
  73. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +26 -26
  74. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +26 -26
  75. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +19 -19
  76. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +18 -18
  77. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +20 -20
  78. package/.agent/skills/appflow-wireframe/SKILL.md +71 -98
  79. package/.agent/skills/architecture/SKILL.md +161 -200
  80. package/.agent/skills/authentication-best-practices/SKILL.md +121 -54
  81. package/.agent/skills/bash-linux/SKILL.md +71 -166
  82. package/.agent/skills/behavioral-modes/SKILL.md +8 -69
  83. package/.agent/skills/brainstorming/SKILL.md +345 -127
  84. package/.agent/skills/building-native-ui/SKILL.md +125 -57
  85. package/.agent/skills/clean-code/SKILL.md +266 -149
  86. package/.agent/skills/code-review-checklist/SKILL.md +0 -62
  87. package/.agent/skills/config-validator/SKILL.md +73 -131
  88. package/.agent/skills/csharp-developer/SKILL.md +434 -73
  89. package/.agent/skills/database-design/SKILL.md +190 -275
  90. package/.agent/skills/deployment-procedures/SKILL.md +81 -158
  91. package/.agent/skills/devops-engineer/SKILL.md +255 -94
  92. package/.agent/skills/devops-incident-responder/SKILL.md +50 -69
  93. package/.agent/skills/doc.md +5 -5
  94. package/.agent/skills/documentation-templates/SKILL.md +19 -63
  95. package/.agent/skills/edge-computing/SKILL.md +75 -165
  96. package/.agent/skills/extract-design-system/SKILL.md +84 -58
  97. package/.agent/skills/framer-motion-expert/SKILL.md +195 -0
  98. package/.agent/skills/frontend-design/SKILL.md +151 -499
  99. package/.agent/skills/game-design-expert/SKILL.md +71 -0
  100. package/.agent/skills/game-engineering-expert/SKILL.md +88 -0
  101. package/.agent/skills/geo-fundamentals/SKILL.md +52 -178
  102. package/.agent/skills/github-operations/SKILL.md +197 -272
  103. package/.agent/skills/gsap-expert/SKILL.md +194 -0
  104. package/.agent/skills/i18n-localization/SKILL.md +60 -172
  105. package/.agent/skills/intelligent-routing/SKILL.md +123 -103
  106. package/.agent/skills/lint-and-validate/SKILL.md +8 -52
  107. package/.agent/skills/llm-engineering/SKILL.md +281 -195
  108. package/.agent/skills/local-first/SKILL.md +76 -159
  109. package/.agent/skills/mcp-builder/SKILL.md +48 -188
  110. package/.agent/skills/mobile-design/SKILL.md +213 -219
  111. package/.agent/skills/motion-engineering/SKILL.md +184 -0
  112. package/.agent/skills/nextjs-react-expert/SKILL.md +184 -203
  113. package/.agent/skills/nodejs-best-practices/SKILL.md +403 -185
  114. package/.agent/skills/observability/SKILL.md +211 -203
  115. package/.agent/skills/parallel-agents/SKILL.md +53 -146
  116. package/.agent/skills/performance-profiling/SKILL.md +171 -151
  117. package/.agent/skills/plan-writing/SKILL.md +49 -153
  118. package/.agent/skills/platform-engineer/SKILL.md +57 -103
  119. package/.agent/skills/playwright-best-practices/SKILL.md +110 -63
  120. package/.agent/skills/powershell-windows/SKILL.md +61 -179
  121. package/.agent/skills/python-patterns/SKILL.md +7 -35
  122. package/.agent/skills/python-pro/SKILL.md +273 -114
  123. package/.agent/skills/react-specialist/SKILL.md +227 -108
  124. package/.agent/skills/readme-builder/SKILL.md +15 -85
  125. package/.agent/skills/realtime-patterns/SKILL.md +216 -243
  126. package/.agent/skills/red-team-tactics/SKILL.md +10 -51
  127. package/.agent/skills/rust-pro/SKILL.md +525 -142
  128. package/.agent/skills/seo-fundamentals/SKILL.md +92 -153
  129. package/.agent/skills/server-management/SKILL.md +110 -166
  130. package/.agent/skills/shadcn-ui-expert/SKILL.md +154 -55
  131. package/.agent/skills/skill-creator/SKILL.md +18 -58
  132. package/.agent/skills/sql-pro/SKILL.md +543 -68
  133. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +28 -68
  134. package/.agent/skills/swiftui-expert/SKILL.md +124 -57
  135. package/.agent/skills/systematic-debugging/SKILL.md +49 -151
  136. package/.agent/skills/tailwind-patterns/SKILL.md +433 -149
  137. package/.agent/skills/tdd-workflow/SKILL.md +63 -169
  138. package/.agent/skills/test-result-analyzer/SKILL.md +33 -73
  139. package/.agent/skills/testing-patterns/SKILL.md +437 -130
  140. package/.agent/skills/trend-researcher/SKILL.md +30 -71
  141. package/.agent/skills/ui-ux-pro-max/SKILL.md +0 -41
  142. package/.agent/skills/ui-ux-researcher/SKILL.md +51 -91
  143. package/.agent/skills/vue-expert/SKILL.md +225 -119
  144. package/.agent/skills/vulnerability-scanner/SKILL.md +264 -226
  145. package/.agent/skills/web-accessibility-auditor/SKILL.md +141 -58
  146. package/.agent/skills/web-design-guidelines/SKILL.md +17 -61
  147. package/.agent/skills/webapp-testing/SKILL.md +71 -196
  148. package/.agent/skills/whimsy-injector/SKILL.md +58 -132
  149. package/.agent/skills/workflow-optimizer/SKILL.md +28 -68
  150. package/.agent/workflows/api-tester.md +96 -224
  151. package/.agent/workflows/audit.md +81 -122
  152. package/.agent/workflows/brainstorm.md +69 -105
  153. package/.agent/workflows/changelog.md +65 -97
  154. package/.agent/workflows/create.md +73 -88
  155. package/.agent/workflows/debug.md +80 -111
  156. package/.agent/workflows/deploy.md +119 -92
  157. package/.agent/workflows/enhance.md +80 -91
  158. package/.agent/workflows/fix.md +68 -97
  159. package/.agent/workflows/generate.md +165 -164
  160. package/.agent/workflows/migrate.md +106 -109
  161. package/.agent/workflows/orchestrate.md +103 -86
  162. package/.agent/workflows/performance-benchmarker.md +77 -268
  163. package/.agent/workflows/plan.md +120 -98
  164. package/.agent/workflows/preview.md +39 -96
  165. package/.agent/workflows/refactor.md +105 -97
  166. package/.agent/workflows/review-ai.md +63 -102
  167. package/.agent/workflows/review.md +71 -110
  168. package/.agent/workflows/session.md +53 -113
  169. package/.agent/workflows/status.md +42 -88
  170. package/.agent/workflows/strengthen-skills.md +90 -51
  171. package/.agent/workflows/swarm.md +114 -129
  172. package/.agent/workflows/test.md +125 -102
  173. package/.agent/workflows/tribunal-backend.md +60 -78
  174. package/.agent/workflows/tribunal-database.md +62 -100
  175. package/.agent/workflows/tribunal-frontend.md +62 -82
  176. package/.agent/workflows/tribunal-full.md +56 -100
  177. package/.agent/workflows/tribunal-mobile.md +65 -94
  178. package/.agent/workflows/tribunal-performance.md +62 -105
  179. package/.agent/workflows/ui-ux-pro-max.md +72 -121
  180. package/README.md +11 -15
  181. package/package.json +1 -1
  182. package/.agent/skills/api-patterns/api-style.md +0 -42
  183. package/.agent/skills/api-patterns/auth.md +0 -24
  184. package/.agent/skills/api-patterns/documentation.md +0 -26
  185. package/.agent/skills/api-patterns/graphql.md +0 -41
  186. package/.agent/skills/api-patterns/rate-limiting.md +0 -31
  187. package/.agent/skills/api-patterns/response.md +0 -37
  188. package/.agent/skills/api-patterns/rest.md +0 -40
  189. package/.agent/skills/api-patterns/security-testing.md +0 -122
  190. package/.agent/skills/api-patterns/trpc.md +0 -41
  191. package/.agent/skills/api-patterns/versioning.md +0 -22
  192. package/.agent/skills/app-builder/agent-coordination.md +0 -71
  193. package/.agent/skills/app-builder/feature-building.md +0 -53
  194. package/.agent/skills/app-builder/project-detection.md +0 -34
  195. package/.agent/skills/app-builder/scaffolding.md +0 -118
  196. package/.agent/skills/app-builder/tech-stack.md +0 -40
  197. package/.agent/skills/architecture/context-discovery.md +0 -43
  198. package/.agent/skills/architecture/examples.md +0 -94
  199. package/.agent/skills/architecture/pattern-selection.md +0 -68
  200. package/.agent/skills/architecture/patterns-reference.md +0 -50
  201. package/.agent/skills/architecture/trade-off-analysis.md +0 -77
  202. package/.agent/skills/brainstorming/dynamic-questioning.md +0 -360
  203. package/.agent/skills/database-design/database-selection.md +0 -43
  204. package/.agent/skills/database-design/indexing.md +0 -39
  205. package/.agent/skills/database-design/migrations.md +0 -48
  206. package/.agent/skills/database-design/optimization.md +0 -36
  207. package/.agent/skills/database-design/orm-selection.md +0 -30
  208. package/.agent/skills/database-design/schema-design.md +0 -56
  209. package/.agent/skills/dotnet-core-expert/SKILL.md +0 -103
  210. package/.agent/skills/framer-motion-animations/SKILL.md +0 -74
  211. package/.agent/skills/frontend-design/animation-guide.md +0 -331
  212. package/.agent/skills/frontend-design/color-system.md +0 -329
  213. package/.agent/skills/frontend-design/decision-trees.md +0 -418
  214. package/.agent/skills/frontend-design/motion-graphics.md +0 -306
  215. package/.agent/skills/frontend-design/typography-system.md +0 -363
  216. package/.agent/skills/frontend-design/ux-psychology.md +0 -1116
  217. package/.agent/skills/frontend-design/visual-effects.md +0 -383
  218. package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
  219. package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
  220. package/.agent/skills/game-development/SKILL.md +0 -236
  221. package/.agent/skills/game-development/game-art/SKILL.md +0 -185
  222. package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
  223. package/.agent/skills/game-development/game-design/SKILL.md +0 -129
  224. package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
  225. package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
  226. package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
  227. package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
  228. package/.agent/skills/game-development/web-games/SKILL.md +0 -150
  229. package/.agent/skills/intelligent-routing/router-manifest.md +0 -65
  230. package/.agent/skills/mobile-design/decision-trees.md +0 -516
  231. package/.agent/skills/mobile-design/mobile-backend.md +0 -491
  232. package/.agent/skills/mobile-design/mobile-color-system.md +0 -420
  233. package/.agent/skills/mobile-design/mobile-debugging.md +0 -122
  234. package/.agent/skills/mobile-design/mobile-design-thinking.md +0 -357
  235. package/.agent/skills/mobile-design/mobile-navigation.md +0 -458
  236. package/.agent/skills/mobile-design/mobile-performance.md +0 -767
  237. package/.agent/skills/mobile-design/mobile-testing.md +0 -356
  238. package/.agent/skills/mobile-design/mobile-typography.md +0 -433
  239. package/.agent/skills/mobile-design/platform-android.md +0 -666
  240. package/.agent/skills/mobile-design/platform-ios.md +0 -561
  241. package/.agent/skills/mobile-design/touch-psychology.md +0 -537
  242. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
  243. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
  244. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
  245. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
  246. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
  247. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
  248. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
  249. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
  250. package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
@@ -1,99 +1,138 @@
1
1
  ---
2
- description: Strengthen skills by appending Tribunal guardrails (LLM Traps, Pre-Flight checklist, VBC Protocol) to any SKILL.md missing them.
2
+ description: Strengthen skills by appending Tribunal guardrails (LLM Traps, Pre-Flight checklist, VBC Protocol) to any SKILL.md missing them. Reads each skill, checks for guardrails, appends if missing, skips if present.
3
3
  ---
4
4
 
5
- # /strengthen-skills Workflow
5
+ # /strengthen-skills — Skill Hardening Pipeline
6
6
 
7
- Use this command to audit and harden all skills in `.agent/skills/` that are missing
8
- the standard Tribunal guardrails block.
7
+ $ARGUMENTS
9
8
 
10
9
  ---
11
10
 
12
- ## What It Does
11
+ ## When to Use /strengthen-skills
13
12
 
14
- Runs `strengthen_skills.py` against all skill files.
15
- For each skill it checks:
13
+ |Use `/strengthen-skills` when...||
14
+ |:---|:---|
15
+ |New skills were just created|Append guardrails|
16
+ |Auditing existing skills|Check which are missing guardrails|
17
+ |After adding skills from external sources|Harden before activating|
16
18
 
17
- 1. **Tribunal Integration section** — does it have `🏛️ Tribunal Integration`?
18
- 2. **VBC Protocol** — does it have `Verification-Before-Completion`?
19
+ ---
20
+
21
+ ## Phase 1 — Skill Inventory
19
22
 
20
- Skills missing either are strengthened by appending the full canonical block:
21
- - `## 🤖 LLM-Specific Traps`
22
- - `## 🏛️ Tribunal Integration (Anti-Hallucination)`
23
- - Forbidden AI Tropes
24
- - Pre-Flight Self-Audit checklist
25
- - VBC Protocol
23
+ ```bash
24
+ # Find all SKILL.md files
25
+ find .agent/skills/ -name "SKILL.md" | sort
26
26
 
27
- Skills that already have both sections are skipped automatically.
27
+ # Count total
28
+ find .agent/skills/ -name "SKILL.md" | wc -l
29
+ ```
28
30
 
29
31
  ---
30
32
 
31
- ## Steps
33
+ ## Phase 2 — Guardrail Check
32
34
 
33
- ### Step 1 Dry Run (Always First)
35
+ For each SKILL.md, check if it already has guardrails:
34
36
 
35
- ```powershell
36
- python .agent/scripts/strengthen_skills.py . --dry-run
37
+ ```bash
38
+ # Check which skills are MISSING LLM Trap table
39
+ grep -rL "LLM Trap\|LLM Traps\|\*\*Trap\|TRAP TABLE" .agent/skills/*/SKILL.md
40
+
41
+ # Check which skills are MISSING Pre-Flight checklist
42
+ grep -rL "Pre-Flight\|Pre-flight\|Preflight\|Self-Audit" .agent/skills/*/SKILL.md
43
+
44
+ # Check which skills are MISSING VBC Protocol
45
+ grep -rL "VBC\|Verify.*Build.*Confirm\|verify.*build.*confirm" .agent/skills/*/SKILL.md
37
46
  ```
38
47
 
39
- Review the output. All lines prefixed with `⚠️ [DRY RUN]` are skills that would be strengthened.
48
+ ---
40
49
 
41
- > **Human Gate:** If the dry-run output looks correct, continue to Step 2.
42
- > If unexpected skills are listed, investigate before proceeding.
50
+ ## Phase 3 Append Guardrails (For Missing Skills Only)
43
51
 
52
+ For each skill missing guardrails, append the three sections:
53
+
54
+ ```markdown
44
55
  ---
45
56
 
46
- ### Step 2 Strengthen All Skills
57
+ ## 🚨 LLM Trap Table
47
58
 
48
- ```powershell
49
- python .agent/scripts/strengthen_skills.py .
50
- ```
59
+ |Pattern|What AI Does Wrong|What Is Actually Correct|
60
+ |:---|:---|:---|
61
+ |[domain-specific trap 1]|[hallucination]|[correct behavior]|
62
+ |[domain-specific trap 2]|[hallucination]|[correct behavior]|
63
+ |[domain-specific trap 3]|[hallucination]|[correct behavior]|
51
64
 
52
65
  ---
53
66
 
54
- ### Step 3 — Verify Summary
67
+ ## Pre-Flight Self-Audit
55
68
 
56
- The script prints a final summary:
69
+ Before producing any output, verify:
57
70
  ```
58
- Strengthened: N
59
- ⏭️ Skipped: N
60
- Errors: 0
71
+ Did I read the actual files before making claims about them?
72
+ ✅ Did I verify all method names against official documentation?
73
+ Did I add // VERIFY: on any uncertain API calls?
74
+ ✅ Are all imports from packages that actually exist in package.json?
75
+ ✅ Did I test my logic with edge cases (null, empty, 0, max)?
76
+ ✅ Did I avoid generating code for more than one module at a time?
77
+ ✅ Am I working from evidence, not assumption?
61
78
  ```
62
79
 
63
- Errors must be zero before proceeding. If any errors appear, fix them and re-run.
80
+ ---
81
+
82
+ ## 🔁 VBC Protocol (Verify → Build → Confirm)
83
+
84
+ ```
85
+ VERIFY: Read the actual codebase before writing anything
86
+ BUILD: Generate the smallest meaningful unit of code
87
+ CONFIRM: Verify the output is correct before presenting
88
+ ```
89
+ ```
64
90
 
65
91
  ---
66
92
 
67
- ### Step 4 — Strengthen a Single Skill (Optional)
93
+ ## Phase 4 — Report
68
94
 
69
- To strengthen one specific skill only:
95
+ After processing all skills:
70
96
 
71
- ```powershell
72
- python .agent/scripts/strengthen_skills.py . --skill <skill-name>
73
97
  ```
98
+ ━━━ Skill Strengthening Report ━━━━━━━━━━━━
99
+
100
+ Total skills found: [N]
101
+ Already have guardrails: [N] (skipped)
102
+ Guardrails added: [N]
103
+ Failed: [N]
104
+
105
+ ━━━ Strengthened Skills ━━━━━━━━━━━━━━━━━━
106
+ ✅ [skill-name] — LLM Trap + Pre-Flight + VBC added
74
107
 
75
- Example:
76
- ```powershell
77
- python .agent/scripts/strengthen_skills.py . --skill brainstorming
108
+ ━━━ Already Hardened (Skipped) ━━━━━━━━━━━
109
+ ⏭️ [skill-name]
110
+ ⏭️ [skill-name]
78
111
  ```
79
112
 
80
113
  ---
81
114
 
82
- ### Step 5 — Custom Skills Directory (Optional)
115
+ ## Guardrail Quality Guidelines
83
116
 
84
- If skills live in a non-standard location:
117
+ LLM Trap tables should be domain-specific — not generic:
85
118
 
86
- ```powershell
87
- python .agent/scripts/strengthen_skills.py . --skills-path /path/to/skills
88
119
  ```
120
+ ❌ Generic (useless):
121
+ "Don't use wrong method names"
122
+
123
+ ✅ Specific (valuable):
124
+ "React 19: useFormState() was renamed to useActionState().
125
+ AI generates old name — import fails at runtime."
126
+ ```
127
+
128
+ The Pre-Flight checklist should match the skill's specific domain — add domain-specific checks beyond the universal ones.
89
129
 
90
130
  ---
91
131
 
92
- ## Related Commands
132
+ ## Usage Examples
93
133
 
94
- | Command | Purpose |
95
- |---|---|
96
- | `/audit` | Full project health audit (includes skills review) |
97
- | `python .agent/scripts/patch_skills_meta.py .` | Inject version/freshness metadata into frontmatter |
98
- | `python .agent/scripts/patch_skills_output.py .` | Add Output Format sections to skills missing them |
99
- | `python .agent/scripts/config_validator.py .` | Validate all agent config consistency |
134
+ ```
135
+ /strengthen-skills → Check and harden all skills
136
+ /strengthen-skills nextjs-react-expert Harden only this skill
137
+ /strengthen-skills --check-only Audit without modifying
138
+ ```
@@ -1,194 +1,179 @@
1
1
  ---
2
- description: Multi-Agent Swarm Orchestration Supervisor decomposes a goal into sub-tasks, dispatches to specialist Workers, collects results, and synthesizes a unified response.
2
+ description: Multi-Agent Swarm Orchestration. Supervisor decomposes a complex goal into sub-tasks, dispatches to specialist Workers via structured JSON contracts, collects results via allSettled fan-in, and synthesizes a unified deliverable. Validates payloads via swarm_dispatcher.py before dispatch.
3
3
  ---
4
4
 
5
- # /swarm — Multi-Agent Swarm Orchestration
5
+ # /swarm — Multi-Agent Swarm Execution
6
6
 
7
7
  $ARGUMENTS
8
8
 
9
9
  ---
10
10
 
11
- ## What This Does
11
+ ## When to Use /swarm Over /orchestrate
12
12
 
13
- `/swarm` is for goals that are **too large or multi-domain for a single agent**.
14
-
15
- Instead of one agent trying to do everything (and hallucinating outside its expertise), the Supervisor:
16
-
17
- 1. **Decomposes** your goal into independent sub-tasks
18
- 2. **Dispatches** each sub-task to the best specialist Worker
19
- 3. **Collects** all results
20
- 4. **Synthesizes** a unified, coherent response
21
-
22
- Use `/swarm` when your request spans **2+ domains** (e.g., backend API + database schema + docs) or when you want specialist-quality output for each component.
13
+ |Use `/swarm` when...|Use `/orchestrate` when...|
14
+ |:---|:---|
15
+ |5+ workers needed simultaneously|2-4 workers in a review|
16
+ |Tasks are explicitly JSON-contracted|Tasks can be described informally|
17
+ |Supervisor/Worker role separation matters|Simple coordination needed|
18
+ |Wave execution needs session persisting across time|Single-session orchestration|
23
19
 
24
20
  ---
25
21
 
26
- ## When to Use /swarm vs Other Commands
22
+ ## Phase 1 Swarm Initialization
27
23
 
28
- | Use `/swarm` when... | Use something else when... |
29
- |---|---|
30
- | Goal spans 2+ specialist domains | Single-domain task → `/generate` |
31
- | You want parallel specialist output | Simple question → just ask |
32
- | Task needs backend + DB + docs together | Need a plan only → `/plan` |
33
- | Complex refactor across multiple files | Debugging one bug → `/debug` |
34
- | Maximum specialist coverage on large feature | Step-by-step incremental work → `/orchestrate` |
24
+ The Supervisor agent activates and:
35
25
 
36
- ---
26
+ 1. Reads the goal and identifies all atomic sub-tasks
27
+ 2. Validates that sub-tasks don't share output files
28
+ 3. Estimates context budget per worker
29
+ 4. Writes initial state to task.md
37
30
 
38
- ## Pipeline Flow
31
+ ---
39
32
 
33
+ ## Phase 2 — Worker Dispatch Contracts
34
+
35
+ Every worker receives a structured JSON contract (not natural language):
36
+
37
+ ```json
38
+ {
39
+ "task_id": "audit-auth-routes",
40
+ "worker_type": "backend-specialist",
41
+ "scope": "Audit all files in src/app/api/auth/ for security and type safety",
42
+ "files_to_read": [
43
+ "src/app/api/auth/login/route.ts",
44
+ "src/app/api/auth/register/route.ts",
45
+ "src/middleware.ts"
46
+ ],
47
+ "files_to_write": [],
48
+ "context_summary": [
49
+ "Next.js 15 App Router project",
50
+ "Auth uses next-auth v5 (auth.ts pattern)",
51
+ "Database: Prisma 6 on PostgreSQL"
52
+ ],
53
+ "constraints": [
54
+ "Report findings only — do not modify files",
55
+ "Report BLOCKED if you cannot determine auth pattern from provided files"
56
+ ],
57
+ "output_format": {
58
+ "status": "COMPLETE | BLOCKED | ERROR",
59
+ "findings": ["list of specific issues found with file+line references"],
60
+ "summary": "2-3 sentence summary"
61
+ }
62
+ }
40
63
  ```
41
- /swarm [your goal]
42
-
43
-
44
- supervisor-agent (triage)
45
- → Reads: swarm-worker-registry.md
46
- → Validates: swarm-worker-contracts.md
47
- → Emits: WorkerRequest JSON (validated) for each sub-task
48
-
49
- ├─── Worker 1: [agent-name] ──── WorkerResult 1
50
- ├─── Worker 2: [agent-name] ──── WorkerResult 2
51
- └─── Worker N: [agent-name] ──── WorkerResult N
52
-
53
-
54
- supervisor-agent (synthesize)
55
-
56
-
57
- ━━━ Swarm Complete ━━━
58
- Human Gate → Y / N / R
59
- ```
60
-
61
- **Constraints:**
62
- - Maximum **5 Workers** per swarm invocation
63
- - Workers are **independent** — no Worker depends on another's pending result
64
- - Workers that fail are **retried up to 3 times** with targeted feedback
65
- - Workers that still fail after 3 retries are **escalated** (not silently dropped)
66
- - Tribunal rules apply **inside each Worker** — no invented libraries, guessed columns, or uncited calls
67
64
 
68
65
  ---
69
66
 
70
- ## Step 1Supervisor Triage
67
+ ## Phase 3Payload Validation
71
68
 
72
- The `supervisor-agent` reads the goal and produces a dispatch plan.
73
-
74
- **Format:**
69
+ Before dispatching, validate all worker contracts:
75
70
 
71
+ ```bash
72
+ python .agent/scripts/swarm_dispatcher.py --file payload.json
76
73
  ```
77
- ━━━ Swarm Triage ━━━━━━━━━━━━━━━━━━━━━━━━
78
74
 
79
- Goal: [restate the user's goal in one sentence]
75
+ If validation passes dispatch workers in parallel.
76
+ If validation fails → fix payload before dispatch.
80
77
 
81
- Workers to dispatch: [N of max 5]
82
-
83
- Worker 1
84
- task_id: [uuid]
85
- type: [generate_code | research | review_code | write_docs | analyze]
86
- agent: [agent-name from swarm-worker-registry.md]
87
- goal: [single-sentence sub-task]
88
- context: [minimal context — only what this worker needs]
78
+ ---
89
79
 
90
- Worker 2
91
- ...
80
+ ## Phase 4 — Fan-Out Execution
92
81
 
93
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
+ ```
83
+ Wave dispatch: POST all contracts simultaneously
84
+
85
+ Wait for completion via allSettled (not Promise.all)
86
+
87
+ Collect ALL results — COMPLETE + BLOCKED + ERROR
88
+
89
+ Fan-In: Supervisor aggregates, resolves conflicts
90
+
91
+ Human Gate before writing anything to disk
94
92
  ```
95
93
 
96
- > ⚠️ Workers that share no dependency can run in parallel. Workers that share output must be serialized.
94
+ **allSettled vs Promise.all:** A single failed worker must NOT cancel all sibling workers. Collect all results, then handle failures.
97
95
 
98
96
  ---
99
97
 
100
- ## Step 2Worker Dispatch
101
-
102
- Each Worker receives its `WorkerRequest` in **isolation** — no Worker sees another Worker's prompt.
98
+ ## Phase 5Status Protocol
103
99
 
104
- Workers generate their output against the constraints of their specialist agent file (`.agent/agents/{agent}.md`).
100
+ Workers report exactly one of three terminal statuses:
105
101
 
106
- **All Tribunal anti-hallucination rules apply inside each Worker:**
107
- - No invented libraries or non-existent methods
108
- - No guessed database column names
109
- - `// VERIFY:` tags on any uncertain call
110
- - Retry limit: 3 per Worker
102
+ ```
103
+ COMPLETE: Work done. Include output_format fields.
111
104
 
112
- Validate WorkerRequest JSON before dispatch:
105
+ BLOCKED: Cannot proceed without missing prerequisite.
106
+ blocked_by: [specific missing information]
107
+ unblocked_by: [what must happen first]
108
+ → Supervisor: provide missing input or escalate to human
113
109
 
114
- ```bash
115
- // turbo
116
- python .agent/scripts/swarm_dispatcher.py --mode swarm --file worker_request.json
110
+ ERROR: Unrecoverable after 3 attempts.
111
+ error: [specific message]
112
+ attempts: 3
113
+ → Supervisor: report to human with ⚠️ Agent Failure Report
117
114
  ```
118
115
 
119
- A schema validation failure **halts the swarm** — it is not silently ignored.
120
-
121
116
  ---
122
117
 
123
- ## Step 3Collect and Validate
118
+ ## Phase 6Session Persistence
124
119
 
125
- After all Workers return a `WorkerResult`:
120
+ Supervisor writes task.md after each wave:
126
121
 
127
- | Status | Meaning | Action |
128
- |---|---|---|
129
- | `status: "success"` | Worker completed | Output included in synthesis |
130
- | `status: "failure"` | Worker errored | Re-dispatch with failure context (up to 3 retries) |
131
- | `status: "escalate"` | Worker hit retry limit | Noted as ⚠️ in report, not retried |
122
+ ```markdown
123
+ # Swarm Session: [goal-slug]
132
124
 
133
- ---
125
+ ## Wave 1 — [timestamp]
126
+ - [task-id]: COMPLETE — [2-line summary]
127
+ - [task-id]: BLOCKED — [reason] → redispatched with [context added]
134
128
 
135
- ## Step 4 — Synthesis and Human Gate
129
+ ## Issues Carrying Forward
130
+ - [cross-task issue affecting Wave 2]
136
131
 
132
+ ## Human Gate Status
133
+ - [ ] Pending review
137
134
  ```
138
- ━━━ Swarm Complete ━━━━━━━━━━━━━━━━━━━━━━━━
139
-
140
- Workers dispatched: [N]
141
- Workers succeeded: [N]
142
- Workers escalated: [N]
143
-
144
- ━━━ [Worker 1 goal] ━━━━━━━━━━━━━━━━━━━━━━
145
-
146
- [Worker 1 output — reviewed by Tribunal]
147
-
148
- ━━━ [Worker 2 goal] ━━━━━━━━━━━━━━━━━━━━━━
149
135
 
150
- [Worker 2 output — reviewed by Tribunal]
151
-
152
- ━━━ Escalations ━━━━━━━━━━━━━━━━━━━━━━━━━━
153
-
154
- ⚠️ [task_id] — [agent] — [reason for escalation after 3 retries]
136
+ ---
155
137
 
156
- ━━━ Human Gate ━━━━━━━━━━━━━━━━━━━━━━━━━━━
138
+ ## Phase 7 — Human Gate
157
139
 
158
- Write to disk? Y = approve | N = discard | R = revise with feedback
159
140
  ```
141
+ ━━━ Swarm Complete ━━━━━━━━━━━━━━━━━━━━━░░░
160
142
 
161
- **Human Gate is never skipped.** No files are written without explicit approval.
143
+ Workers: [N dispatched / N complete / N blocked / N error]
162
144
 
163
- ---
145
+ ━━━ Synthesized Results ━━━━━━━━━━━━━━━━━━
146
+ [Findings by severity — critical → high → medium → low]
164
147
 
165
- ## Hallucination Guard
148
+ ━━━ Files to Write ━━━━━━━━━━━━━━━━━━━━━━
149
+ [List all files with change summaries]
166
150
 
167
- - Supervisor only routes to agents listed in `swarm-worker-registry.md`
168
- - Each Worker only uses tools, packages, and methods it has seen documented
169
- - Every `WorkerRequest` is validated against `swarm-worker-contracts.md` before dispatch
170
- - `swarm_dispatcher.py` exits `1` on any schema violation — swarm halted, not silently degraded
171
- - Synthesis only combines verified Worker outputs — the Supervisor does not add new logic during synthesis
151
+ ━━━ Human Gate ━━━━━━━━━━━━━━━━━━━━━━━━━
152
+ Approve? Y = write to disk | N = discard | R = revise
153
+ ```
172
154
 
173
155
  ---
174
156
 
175
- ## Cross-Workflow Navigation
157
+ ## Failure Report Format
176
158
 
177
- | After /swarm reveals... | Go to |
178
- |---|---|
179
- | Security issues in Worker output | `/tribunal-full` to re-audit the flagged code |
180
- | Worker escalated after 3 retries | `/debug` to investigate what the worker failed on |
181
- | Need a more sequential approach | `/orchestrate` for wave-based multi-agent execution |
182
- | Want to verify final synthesized code | `/tribunal-full` before writing to disk |
159
+ ```
160
+ ⚠️ Agent Failure Report
161
+ ━━━━━━━━━━━━━━━━━━━━━
162
+ Agent: backend-specialist (Worker A)
163
+ Task: audit-auth-routes
164
+ Attempts: 3 of 3
165
+ Last Error: Could not resolve auth.ts import path — tsconfig paths not in scope
166
+ Context: Files provided: src/app/api/auth/*.ts — missing: tsconfig.json
167
+ Suggestion: Include tsconfig.json in files_to_read for next dispatch
168
+ ```
183
169
 
184
170
  ---
185
171
 
186
172
  ## Usage Examples
187
173
 
188
174
  ```
189
- /swarm build a REST API with user auth, a PostgreSQL schema, and API documentation
190
- /swarm analyze this repo, identify security vulnerabilities, and create a remediation plan
191
- /swarm create a React dashboard component with a backend data endpoint and unit tests
192
- /swarm refactor the payment module: review the code, optimize the SQL queries, and update the docs
193
- /swarm generate a full feature: file upload API + storage service + frontend uploader + tests
175
+ /swarm comprehensive pre-launch audit: security + tests + performance + accessibility
176
+ /swarm analyze all API routes for OWASP vulnerabilities simultaneously
177
+ /swarm generate full test suite for auth, checkout, and user management
178
+ /swarm review and optimize all N+1 query patterns across the codebase
194
179
  ```