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.
- package/.agent/ARCHITECTURE.md +99 -99
- package/.agent/GEMINI.md +52 -52
- package/.agent/agents/accessibility-reviewer.md +139 -86
- package/.agent/agents/ai-code-reviewer.md +160 -90
- package/.agent/agents/backend-specialist.md +164 -127
- package/.agent/agents/code-archaeologist.md +115 -73
- package/.agent/agents/database-architect.md +130 -110
- package/.agent/agents/debugger.md +137 -97
- package/.agent/agents/dependency-reviewer.md +78 -30
- package/.agent/agents/devops-engineer.md +161 -118
- package/.agent/agents/documentation-writer.md +151 -87
- package/.agent/agents/explorer-agent.md +117 -99
- package/.agent/agents/frontend-reviewer.md +127 -47
- package/.agent/agents/frontend-specialist.md +169 -109
- package/.agent/agents/game-developer.md +28 -164
- package/.agent/agents/logic-reviewer.md +87 -49
- package/.agent/agents/mobile-developer.md +151 -103
- package/.agent/agents/mobile-reviewer.md +133 -50
- package/.agent/agents/orchestrator.md +121 -110
- package/.agent/agents/penetration-tester.md +103 -77
- package/.agent/agents/performance-optimizer.md +136 -92
- package/.agent/agents/performance-reviewer.md +139 -69
- package/.agent/agents/product-manager.md +104 -70
- package/.agent/agents/product-owner.md +6 -25
- package/.agent/agents/project-planner.md +95 -95
- package/.agent/agents/qa-automation-engineer.md +174 -87
- package/.agent/agents/security-auditor.md +133 -129
- package/.agent/agents/seo-specialist.md +160 -99
- package/.agent/agents/sql-reviewer.md +132 -44
- package/.agent/agents/supervisor-agent.md +137 -109
- package/.agent/agents/swarm-worker-contracts.md +17 -17
- package/.agent/agents/swarm-worker-registry.md +46 -46
- package/.agent/agents/test-coverage-reviewer.md +132 -53
- package/.agent/agents/test-engineer.md +0 -21
- package/.agent/agents/type-safety-reviewer.md +143 -33
- package/.agent/patterns/generator.md +9 -9
- package/.agent/patterns/inversion.md +12 -12
- package/.agent/patterns/pipeline.md +9 -9
- package/.agent/patterns/reviewer.md +13 -13
- package/.agent/patterns/tool-wrapper.md +9 -9
- package/.agent/rules/GEMINI.md +63 -63
- package/.agent/scripts/__pycache__/auto_preview.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/bundle_analyzer.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/checklist.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/dependency_analyzer.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/security_scan.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/session_manager.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/skill_integrator.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/swarm_dispatcher.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/test_runner.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/verify_all.cpython-311.pyc +0 -0
- package/.agent/scripts/compress_skills.py +167 -0
- package/.agent/scripts/consolidate_skills.py +173 -0
- package/.agent/scripts/deep_compress.py +202 -0
- package/.agent/scripts/minify_context.py +80 -0
- package/.agent/scripts/security_scan.py +1 -1
- package/.agent/scripts/strip_tribunal.py +41 -0
- package/.agent/skills/agent-organizer/SKILL.md +60 -100
- package/.agent/skills/agentic-patterns/SKILL.md +0 -70
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +108 -53
- package/.agent/skills/api-patterns/SKILL.md +197 -257
- package/.agent/skills/api-security-auditor/SKILL.md +125 -57
- package/.agent/skills/app-builder/SKILL.md +326 -50
- package/.agent/skills/app-builder/templates/SKILL.md +13 -15
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +16 -16
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +22 -22
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +18 -18
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +20 -20
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +17 -17
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +18 -18
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +21 -21
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +19 -19
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +26 -26
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +26 -26
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +19 -19
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +18 -18
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +20 -20
- package/.agent/skills/appflow-wireframe/SKILL.md +71 -98
- package/.agent/skills/architecture/SKILL.md +161 -200
- package/.agent/skills/authentication-best-practices/SKILL.md +121 -54
- package/.agent/skills/bash-linux/SKILL.md +71 -166
- package/.agent/skills/behavioral-modes/SKILL.md +8 -69
- package/.agent/skills/brainstorming/SKILL.md +345 -127
- package/.agent/skills/building-native-ui/SKILL.md +125 -57
- package/.agent/skills/clean-code/SKILL.md +266 -149
- package/.agent/skills/code-review-checklist/SKILL.md +0 -62
- package/.agent/skills/config-validator/SKILL.md +73 -131
- package/.agent/skills/csharp-developer/SKILL.md +434 -73
- package/.agent/skills/database-design/SKILL.md +190 -275
- package/.agent/skills/deployment-procedures/SKILL.md +81 -158
- package/.agent/skills/devops-engineer/SKILL.md +255 -94
- package/.agent/skills/devops-incident-responder/SKILL.md +50 -69
- package/.agent/skills/doc.md +5 -5
- package/.agent/skills/documentation-templates/SKILL.md +19 -63
- package/.agent/skills/edge-computing/SKILL.md +75 -165
- package/.agent/skills/extract-design-system/SKILL.md +84 -58
- package/.agent/skills/framer-motion-expert/SKILL.md +195 -0
- package/.agent/skills/frontend-design/SKILL.md +151 -499
- package/.agent/skills/game-design-expert/SKILL.md +71 -0
- package/.agent/skills/game-engineering-expert/SKILL.md +88 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +52 -178
- package/.agent/skills/github-operations/SKILL.md +197 -272
- package/.agent/skills/gsap-expert/SKILL.md +194 -0
- package/.agent/skills/i18n-localization/SKILL.md +60 -172
- package/.agent/skills/intelligent-routing/SKILL.md +123 -103
- package/.agent/skills/lint-and-validate/SKILL.md +8 -52
- package/.agent/skills/llm-engineering/SKILL.md +281 -195
- package/.agent/skills/local-first/SKILL.md +76 -159
- package/.agent/skills/mcp-builder/SKILL.md +48 -188
- package/.agent/skills/mobile-design/SKILL.md +213 -219
- package/.agent/skills/motion-engineering/SKILL.md +184 -0
- package/.agent/skills/nextjs-react-expert/SKILL.md +184 -203
- package/.agent/skills/nodejs-best-practices/SKILL.md +403 -185
- package/.agent/skills/observability/SKILL.md +211 -203
- package/.agent/skills/parallel-agents/SKILL.md +53 -146
- package/.agent/skills/performance-profiling/SKILL.md +171 -151
- package/.agent/skills/plan-writing/SKILL.md +49 -153
- package/.agent/skills/platform-engineer/SKILL.md +57 -103
- package/.agent/skills/playwright-best-practices/SKILL.md +110 -63
- package/.agent/skills/powershell-windows/SKILL.md +61 -179
- package/.agent/skills/python-patterns/SKILL.md +7 -35
- package/.agent/skills/python-pro/SKILL.md +273 -114
- package/.agent/skills/react-specialist/SKILL.md +227 -108
- package/.agent/skills/readme-builder/SKILL.md +15 -85
- package/.agent/skills/realtime-patterns/SKILL.md +216 -243
- package/.agent/skills/red-team-tactics/SKILL.md +10 -51
- package/.agent/skills/rust-pro/SKILL.md +525 -142
- package/.agent/skills/seo-fundamentals/SKILL.md +92 -153
- package/.agent/skills/server-management/SKILL.md +110 -166
- package/.agent/skills/shadcn-ui-expert/SKILL.md +154 -55
- package/.agent/skills/skill-creator/SKILL.md +18 -58
- package/.agent/skills/sql-pro/SKILL.md +543 -68
- package/.agent/skills/supabase-postgres-best-practices/SKILL.md +28 -68
- package/.agent/skills/swiftui-expert/SKILL.md +124 -57
- package/.agent/skills/systematic-debugging/SKILL.md +49 -151
- package/.agent/skills/tailwind-patterns/SKILL.md +433 -149
- package/.agent/skills/tdd-workflow/SKILL.md +63 -169
- package/.agent/skills/test-result-analyzer/SKILL.md +33 -73
- package/.agent/skills/testing-patterns/SKILL.md +437 -130
- package/.agent/skills/trend-researcher/SKILL.md +30 -71
- package/.agent/skills/ui-ux-pro-max/SKILL.md +0 -41
- package/.agent/skills/ui-ux-researcher/SKILL.md +51 -91
- package/.agent/skills/vue-expert/SKILL.md +225 -119
- package/.agent/skills/vulnerability-scanner/SKILL.md +264 -226
- package/.agent/skills/web-accessibility-auditor/SKILL.md +141 -58
- package/.agent/skills/web-design-guidelines/SKILL.md +17 -61
- package/.agent/skills/webapp-testing/SKILL.md +71 -196
- package/.agent/skills/whimsy-injector/SKILL.md +58 -132
- package/.agent/skills/workflow-optimizer/SKILL.md +28 -68
- package/.agent/workflows/api-tester.md +96 -224
- package/.agent/workflows/audit.md +81 -122
- package/.agent/workflows/brainstorm.md +69 -105
- package/.agent/workflows/changelog.md +65 -97
- package/.agent/workflows/create.md +73 -88
- package/.agent/workflows/debug.md +80 -111
- package/.agent/workflows/deploy.md +119 -92
- package/.agent/workflows/enhance.md +80 -91
- package/.agent/workflows/fix.md +68 -97
- package/.agent/workflows/generate.md +165 -164
- package/.agent/workflows/migrate.md +106 -109
- package/.agent/workflows/orchestrate.md +103 -86
- package/.agent/workflows/performance-benchmarker.md +77 -268
- package/.agent/workflows/plan.md +120 -98
- package/.agent/workflows/preview.md +39 -96
- package/.agent/workflows/refactor.md +105 -97
- package/.agent/workflows/review-ai.md +63 -102
- package/.agent/workflows/review.md +71 -110
- package/.agent/workflows/session.md +53 -113
- package/.agent/workflows/status.md +42 -88
- package/.agent/workflows/strengthen-skills.md +90 -51
- package/.agent/workflows/swarm.md +114 -129
- package/.agent/workflows/test.md +125 -102
- package/.agent/workflows/tribunal-backend.md +60 -78
- package/.agent/workflows/tribunal-database.md +62 -100
- package/.agent/workflows/tribunal-frontend.md +62 -82
- package/.agent/workflows/tribunal-full.md +56 -100
- package/.agent/workflows/tribunal-mobile.md +65 -94
- package/.agent/workflows/tribunal-performance.md +62 -105
- package/.agent/workflows/ui-ux-pro-max.md +72 -121
- package/README.md +11 -15
- package/package.json +1 -1
- package/.agent/skills/api-patterns/api-style.md +0 -42
- package/.agent/skills/api-patterns/auth.md +0 -24
- package/.agent/skills/api-patterns/documentation.md +0 -26
- package/.agent/skills/api-patterns/graphql.md +0 -41
- package/.agent/skills/api-patterns/rate-limiting.md +0 -31
- package/.agent/skills/api-patterns/response.md +0 -37
- package/.agent/skills/api-patterns/rest.md +0 -40
- package/.agent/skills/api-patterns/security-testing.md +0 -122
- package/.agent/skills/api-patterns/trpc.md +0 -41
- package/.agent/skills/api-patterns/versioning.md +0 -22
- package/.agent/skills/app-builder/agent-coordination.md +0 -71
- package/.agent/skills/app-builder/feature-building.md +0 -53
- package/.agent/skills/app-builder/project-detection.md +0 -34
- package/.agent/skills/app-builder/scaffolding.md +0 -118
- package/.agent/skills/app-builder/tech-stack.md +0 -40
- package/.agent/skills/architecture/context-discovery.md +0 -43
- package/.agent/skills/architecture/examples.md +0 -94
- package/.agent/skills/architecture/pattern-selection.md +0 -68
- package/.agent/skills/architecture/patterns-reference.md +0 -50
- package/.agent/skills/architecture/trade-off-analysis.md +0 -77
- package/.agent/skills/brainstorming/dynamic-questioning.md +0 -360
- package/.agent/skills/database-design/database-selection.md +0 -43
- package/.agent/skills/database-design/indexing.md +0 -39
- package/.agent/skills/database-design/migrations.md +0 -48
- package/.agent/skills/database-design/optimization.md +0 -36
- package/.agent/skills/database-design/orm-selection.md +0 -30
- package/.agent/skills/database-design/schema-design.md +0 -56
- package/.agent/skills/dotnet-core-expert/SKILL.md +0 -103
- package/.agent/skills/framer-motion-animations/SKILL.md +0 -74
- package/.agent/skills/frontend-design/animation-guide.md +0 -331
- package/.agent/skills/frontend-design/color-system.md +0 -329
- package/.agent/skills/frontend-design/decision-trees.md +0 -418
- package/.agent/skills/frontend-design/motion-graphics.md +0 -306
- package/.agent/skills/frontend-design/typography-system.md +0 -363
- package/.agent/skills/frontend-design/ux-psychology.md +0 -1116
- package/.agent/skills/frontend-design/visual-effects.md +0 -383
- package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
- package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
- package/.agent/skills/game-development/SKILL.md +0 -236
- package/.agent/skills/game-development/game-art/SKILL.md +0 -185
- package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
- package/.agent/skills/game-development/game-design/SKILL.md +0 -129
- package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
- package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
- package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
- package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
- package/.agent/skills/game-development/web-games/SKILL.md +0 -150
- package/.agent/skills/intelligent-routing/router-manifest.md +0 -65
- package/.agent/skills/mobile-design/decision-trees.md +0 -516
- package/.agent/skills/mobile-design/mobile-backend.md +0 -491
- package/.agent/skills/mobile-design/mobile-color-system.md +0 -420
- package/.agent/skills/mobile-design/mobile-debugging.md +0 -122
- package/.agent/skills/mobile-design/mobile-design-thinking.md +0 -357
- package/.agent/skills/mobile-design/mobile-navigation.md +0 -458
- package/.agent/skills/mobile-design/mobile-performance.md +0 -767
- package/.agent/skills/mobile-design/mobile-testing.md +0 -356
- package/.agent/skills/mobile-design/mobile-typography.md +0 -433
- package/.agent/skills/mobile-design/platform-android.md +0 -666
- package/.agent/skills/mobile-design/platform-ios.md +0 -561
- package/.agent/skills/mobile-design/touch-psychology.md +0 -537
- package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
- package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
- package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
- package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
- package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
- package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
- package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
- package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
- package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
package/.agent/rules/GEMINI.md
CHANGED
|
@@ -4,8 +4,8 @@ trigger: always_on
|
|
|
4
4
|
|
|
5
5
|
# Tribunal Agent Kit ā Master Rules
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
These rules are always active. Every agent, every request, every response.
|
|
8
|
+
Rule priority: this file (P0) agent .md file (P1) skill SKILL.md (P2)
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -13,14 +13,14 @@ trigger: always_on
|
|
|
13
13
|
|
|
14
14
|
Before any action, identify request type:
|
|
15
15
|
|
|
16
|
-
|
|
|
16
|
+
|Type|Keywords|What Happens|
|
|
17
17
|
|---|---|---|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
|**Question**|"what is", "how does", "explain", "why"|Text answer only ā no agents, no files|
|
|
19
|
+
|**Survey**|"analyze", "list", "overview", "scan"|Read + report ā no code written|
|
|
20
|
+
|**Simple edit**|"fix", "change", "update" (single file)|Direct edit ā no plan required|
|
|
21
|
+
|**Complex build**|"build", "create", "implement", "refactor"|Requires plan file + agent routing|
|
|
22
|
+
|**Design/UI**|"design", "UI", "page", "dashboard"|Requires design agent + plan file|
|
|
23
|
+
|**Slash command**|starts with `/`|Route to matching workflow file|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -30,26 +30,26 @@ Every code or design request activates an agent. This is not optional.
|
|
|
30
30
|
|
|
31
31
|
**Auto-routing rules:**
|
|
32
32
|
|
|
33
|
-
|
|
|
33
|
+
|Domain|Primary Agent / Skill|
|
|
34
34
|
|---|---|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
35
|
+
|API / server / backend|`backend-specialist`|
|
|
36
|
+
|C# / .NET / Blazor|`dotnet-core-expert`|
|
|
37
|
+
|Python / FastAPI / Django|`python-pro`|
|
|
38
|
+
|Database / schema / SQL|`database-architect`|
|
|
39
|
+
|Advanced SQL queries|`sql-pro`|
|
|
40
|
+
|React / Next.js / UI|`frontend-specialist`|
|
|
41
|
+
|Advanced React architecture|`react-specialist`|
|
|
42
|
+
|Vue / Nuxt|`vue-expert`|
|
|
43
|
+
|Mobile (RN / Flutter)|`mobile-developer`|
|
|
44
|
+
|Debugging / errors|`debugger`|
|
|
45
|
+
|Security / vulnerabilities|`security-auditor`|
|
|
46
|
+
|Performance / optimization|`performance-optimizer`|
|
|
47
|
+
|DevOps / CI-CD / Docker|`devops-engineer`|
|
|
48
|
+
|Production incidents|`devops-incident-responder`|
|
|
49
|
+
|Platform / Infrastructure|`platform-engineer`|
|
|
50
|
+
|Multi-agent architecture|`agent-organizer`|
|
|
51
|
+
|Multi-domain (2+ areas)|`orchestrator`|
|
|
52
|
+
|Unknown codebase|`explorer-agent`|
|
|
53
53
|
|
|
54
54
|
**When activated, announce the agent:**
|
|
55
55
|
|
|
@@ -76,12 +76,12 @@ For any complex build, new feature, or unclear request ā stop and ask before w
|
|
|
76
76
|
|
|
77
77
|
**Required questions by type:**
|
|
78
78
|
|
|
79
|
-
|
|
|
79
|
+
|Request|Minimum Questions|
|
|
80
80
|
|---|---|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
81
|
+
|New feature or build|3+ strategic questions about goal, stack, scope|
|
|
82
|
+
|Code edit or bug fix|Confirm understanding + ask about impact|
|
|
83
|
+
|Vague request|Ask about purpose, users, and scope|
|
|
84
|
+
|Full orchestration|Block all subagents until plan is confirmed|
|
|
85
85
|
|
|
86
86
|
**Rules:**
|
|
87
87
|
- Never assume. If even 1% is unclear ā ask.
|
|
@@ -136,14 +136,14 @@ The Human Gate is never skipped. No code is written to a file without explicit u
|
|
|
136
136
|
|
|
137
137
|
**Reviewer assignment by domain:**
|
|
138
138
|
|
|
139
|
-
|
|
|
139
|
+
|Code type|Reviewers|
|
|
140
140
|
|---|---|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
141
|
+
|Backend/API|logic + security + dependency + type-safety|
|
|
142
|
+
|Frontend/React|logic + security + frontend + type-safety|
|
|
143
|
+
|Database/SQL|logic + security + sql|
|
|
144
|
+
|Mobile/Cross-platform|logic + security + mobile-reviewer + type-safety|
|
|
145
|
+
|Any domain|+ performance (if optimization)|
|
|
146
|
+
|Before merge|/tribunal-full (all 9)|
|
|
147
147
|
|
|
148
148
|
---
|
|
149
149
|
|
|
@@ -200,21 +200,21 @@ Script crashes ā Catch exception, report stack trace, continue
|
|
|
200
200
|
|
|
201
201
|
These scripts live in `.agent/scripts/`. Agents and skills can invoke them:
|
|
202
202
|
|
|
203
|
-
|
|
|
203
|
+
|Script|Purpose|When|
|
|
204
204
|
|---|---|---|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
205
|
+
|`checklist.py`|Priority audit: SecurityāLintāSchemaāTestsāUXāSEO|Before/after any major change|
|
|
206
|
+
|`verify_all.py`|Full pre-deploy validation suite|Pre-deploy|
|
|
207
|
+
|`auto_preview.py`|Start/stop/restart local dev server|After /create or /enhance|
|
|
208
|
+
|`session_manager.py`|Track session state between conversations|Multi-session work|
|
|
209
|
+
|`lint_runner.py`|Standalone lint runner (ESLint, Prettier, Ruff)|Every code change|
|
|
210
|
+
|`test_runner.py`|Standalone test runner (Jest, Vitest, pytest, Go)|After logic changes|
|
|
211
|
+
|`security_scan.py`|Deep OWASP-aware source code security scan|Always on deploy, /audit|
|
|
212
|
+
|`dependency_analyzer.py`|Unused/phantom deps, npm audit|Weekly, /audit|
|
|
213
|
+
|`schema_validator.py`|Database schema validation (Prisma, SQL)|After DB changes|
|
|
214
|
+
|`bundle_analyzer.py`|JS/TS bundle size analysis|Before deploy|
|
|
215
|
+
|`skill_integrator.py`|Maps active skills to their executable scripts|Automatically when skills are invoked|
|
|
216
|
+
|`swarm_dispatcher.py`|Validate Orchestrator micro-worker JSON payloads|After /orchestrate, before dispatching agents|
|
|
217
|
+
|`test_swarm_dispatcher.py`|Unit tests for swarm_dispatcher|After modifying swarm_dispatcher.py|
|
|
218
218
|
|
|
219
219
|
**Run pattern:**
|
|
220
220
|
```
|
|
@@ -235,11 +235,11 @@ python .agent/scripts/test_swarm_dispatcher.py
|
|
|
235
235
|
|
|
236
236
|
## Mode Behavior
|
|
237
237
|
|
|
238
|
-
|
|
|
238
|
+
|Mode|Active Agent|Rules|
|
|
239
239
|
|---|---|---|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
|`plan`|`project-planner`|4-phase: Analyze ā Plan ā Solution ā Implement. NO CODE before Phase 4.|
|
|
241
|
+
|`ask`|none|Answer only ā no implementation|
|
|
242
|
+
|`edit`|`orchestrator`|Execute. Check `{task-slug}.md` first if multi-file.|
|
|
243
243
|
|
|
244
244
|
**Plan Mode phases:**
|
|
245
245
|
1. Analyze ā research and questions
|
|
@@ -273,12 +273,12 @@ AI agents have a finite context window. Poorly managed context causes truncation
|
|
|
273
273
|
|
|
274
274
|
**Context discipline by task type:**
|
|
275
275
|
|
|
276
|
-
|
|
|
276
|
+
|Task Type|Attach|Never Attach|
|
|
277
277
|
|---|---|---|
|
|
278
|
-
|
|
|
279
|
-
|
|
|
280
|
-
|
|
|
281
|
-
|
|
|
278
|
+
|Bug fix in one function|That function + its callers|Entire file|
|
|
279
|
+
|Schema migration|Schema file + migration history|Unrelated models|
|
|
280
|
+
|Orchestrator dispatch|context_summary per worker|Full conversation|
|
|
281
|
+
|Code review|File under review|Project-wide context|
|
|
282
282
|
|
|
283
283
|
---
|
|
284
284
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
compress_skills.py - Aggressive token reduction for .agent/skills/**/*.md files
|
|
4
|
+
WHAT IT DOES:
|
|
5
|
+
1. Strips ## šļø Tribunal Integration sections (in GEMINI.md globally)
|
|
6
|
+
2. Strips ## ā
Pre-Flight Self-Audit sections (duplication)
|
|
7
|
+
3. Strips ## Cross-Workflow Navigation sections
|
|
8
|
+
4. Strips ## Output Format sections
|
|
9
|
+
5. Strips inline comment blocks inside code (// Description of obvious stuff)
|
|
10
|
+
6. Collapses 3+ empty lines ā 1
|
|
11
|
+
7. Removes chatty intro paragraphs (patterns like "X is Y. If you Z, you're Z.")
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import os, re, sys
|
|
15
|
+
|
|
16
|
+
# āāā Section strippers āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
17
|
+
|
|
18
|
+
SECTION_PATTERNS = [
|
|
19
|
+
# Tribunal / pre-flight boilerplate (global in GEMINI.md)
|
|
20
|
+
r'(?m)^## šļø Tribunal Integration[\s\S]*?(?=\n## |\n# |\Z)',
|
|
21
|
+
r'(?m)^## Tribunal Integration[\s\S]*?(?=\n## |\n# |\Z)',
|
|
22
|
+
r'(?m)^### ā
Pre-Flight Self-Audit[\s\S]*?(?=\n## |\n### |\n# |\Z)',
|
|
23
|
+
r'(?m)^## Pre-Flight Self-Audit[\s\S]*?(?=\n## |\n# |\Z)',
|
|
24
|
+
r'(?m)^## Cross-Workflow Navigation[\s\S]*?(?=\n## |\n# |\Z)',
|
|
25
|
+
r'(?m)^## Output Format\s*\n```[\s\S]*?```\s*\n',
|
|
26
|
+
r'(?m)^## VBC Protocol[\s\S]*?(?=\n## |\n# |\Z)',
|
|
27
|
+
r'(?m)^## LLM Traps[\s\S]*?(?=\n## |\n# |\Z)',
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
# āāā Chatty intro line patterns āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
31
|
+
# e.g. "React 19 is a paradigm shift. Server Components are the default."
|
|
32
|
+
# These are after the frontmatter H1 title ā motivational filler.
|
|
33
|
+
CHATTY_INTRO = re.compile(
|
|
34
|
+
r'(?m)^(# .+\n)\n[A-Z][^#\n]{60,}\n[A-Z][^#\n]{40,}\n\n---',
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
def strip_chatty_intro(content):
|
|
38
|
+
def replace(m):
|
|
39
|
+
return m.group(1) + '\n---'
|
|
40
|
+
return CHATTY_INTRO.sub(replace, content)
|
|
41
|
+
|
|
42
|
+
# āāā Trim verbose inline comments in code blocks āāāāāāāāāāāāāāāāāāāāāāāāā
|
|
43
|
+
# Removes "// comment that just restates the surrounding code name"
|
|
44
|
+
OBVIOUS_COMMENT = re.compile(
|
|
45
|
+
r'(?m)^(\s*)(// (default for most properties|shorthand|number of repeats|default: \d+|spring tension|resistance|weight|approximate duration|deceleration rate)[^\n]*)\n'
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
def strip_obvious_comments(content):
|
|
49
|
+
return OBVIOUS_COMMENT.sub('', content)
|
|
50
|
+
|
|
51
|
+
# āāā Long repetitive ā
/ā rule blocks that repeat main section āāāāāāāāāāāā
|
|
52
|
+
# These are usually "Performance Rules" text blocks restating code above
|
|
53
|
+
PERF_TEXT_BLOCK = re.compile(
|
|
54
|
+
r'(?m)^```\n(ā
Use \w[^\n]*\n ā [^\n]*\n\n?){3,}```\n'
|
|
55
|
+
)
|
|
56
|
+
def compress_perf_blocks(content):
|
|
57
|
+
def to_bullets(m):
|
|
58
|
+
text = m.group(0)
|
|
59
|
+
lines = text.strip('`\n').splitlines()
|
|
60
|
+
bullets = []
|
|
61
|
+
for line in lines:
|
|
62
|
+
stripped = line.strip()
|
|
63
|
+
if stripped.startswith('ā
') or stripped.startswith('ā'):
|
|
64
|
+
bullets.append(f'- {stripped}')
|
|
65
|
+
elif stripped.startswith('ā'):
|
|
66
|
+
bullets[-1] += f' ({stripped[1:].strip()})'
|
|
67
|
+
return '\n'.join(bullets) + '\n'
|
|
68
|
+
return PERF_TEXT_BLOCK.sub(to_bullets, content)
|
|
69
|
+
|
|
70
|
+
# āāā Collapse empty lines āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
71
|
+
def collapse_blanks(content):
|
|
72
|
+
return re.sub(r'\n{3,}', '\n\n', content)
|
|
73
|
+
|
|
74
|
+
# āāā Remove "This is X ā not Y" filler sentences before the first ## āāāāā
|
|
75
|
+
FILLER_BEFORE_SECTION = re.compile(
|
|
76
|
+
r'(?m)(^# .+\n\n)([A-Z][^\n]+\n){1,4}(\n---\n)',
|
|
77
|
+
re.MULTILINE
|
|
78
|
+
)
|
|
79
|
+
def remove_filler_between_title_and_hr(content):
|
|
80
|
+
def replacement(m):
|
|
81
|
+
return m.group(1) + m.group(3)
|
|
82
|
+
return FILLER_BEFORE_SECTION.sub(replacement, content)
|
|
83
|
+
|
|
84
|
+
# āāā Strip redundant version comment banners āāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
85
|
+
# e.g. "// motion.div, motion.span, motion.button, motion.svg, motion.path, etc."
|
|
86
|
+
# "// Any HTML or SVG element can be prefixed with `motion.`" - obvious
|
|
87
|
+
REDUNDANT_NOTE = re.compile(r'(?m)^// (motion\.\w+|Any HTML|Note:|Variant names propagate|// )[^\n]*\n')
|
|
88
|
+
|
|
89
|
+
def strip_redundant_notes(content):
|
|
90
|
+
return REDUNDANT_NOTE.sub('', content)
|
|
91
|
+
|
|
92
|
+
# āāā Main pipeline āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
93
|
+
|
|
94
|
+
def compress_file(path):
|
|
95
|
+
with open(path, 'r', encoding='utf-8', errors='ignore') as f:
|
|
96
|
+
original = f.read()
|
|
97
|
+
|
|
98
|
+
content = original
|
|
99
|
+
|
|
100
|
+
# 1. Strip global boilerplate sections
|
|
101
|
+
for pattern in SECTION_PATTERNS:
|
|
102
|
+
content = re.sub(pattern, '', content)
|
|
103
|
+
|
|
104
|
+
# 2. Remove chatty intro paragraphs
|
|
105
|
+
content = strip_chatty_intro(content)
|
|
106
|
+
|
|
107
|
+
# 3. Remove filler between title and first ---
|
|
108
|
+
content = remove_filler_between_title_and_hr(content)
|
|
109
|
+
|
|
110
|
+
# 4. Strip obvious inline comments from code
|
|
111
|
+
content = strip_obvious_comments(content)
|
|
112
|
+
|
|
113
|
+
# 5. Strip redundant notes
|
|
114
|
+
content = strip_redundant_notes(content)
|
|
115
|
+
|
|
116
|
+
# 6. Compress verbose perf rule text blocks to bullet lists
|
|
117
|
+
content = compress_perf_blocks(content)
|
|
118
|
+
|
|
119
|
+
# 7. Collapse 3+ blank lines
|
|
120
|
+
content = collapse_blanks(content)
|
|
121
|
+
|
|
122
|
+
# Write back
|
|
123
|
+
with open(path, 'w', encoding='utf-8') as f:
|
|
124
|
+
f.write(content.strip() + '\n')
|
|
125
|
+
|
|
126
|
+
saved = len(original) - len(content)
|
|
127
|
+
return len(original), len(content), saved
|
|
128
|
+
|
|
129
|
+
def main():
|
|
130
|
+
base = '.agent/skills'
|
|
131
|
+
if not os.path.exists(base):
|
|
132
|
+
print(f"ERROR: '{base}' not found. Run from tribunal-kit root.", file=sys.stderr)
|
|
133
|
+
sys.exit(1)
|
|
134
|
+
|
|
135
|
+
total_orig = 0
|
|
136
|
+
total_new = 0
|
|
137
|
+
results = []
|
|
138
|
+
|
|
139
|
+
for root, _, files in os.walk(base):
|
|
140
|
+
for fname in files:
|
|
141
|
+
if fname.endswith('.md'):
|
|
142
|
+
path = os.path.join(root, fname)
|
|
143
|
+
orig, new, saved = compress_file(path)
|
|
144
|
+
total_orig += orig
|
|
145
|
+
total_new += new
|
|
146
|
+
if saved > 0:
|
|
147
|
+
results.append((saved, path))
|
|
148
|
+
|
|
149
|
+
results.sort(reverse=True)
|
|
150
|
+
|
|
151
|
+
print(f"\n{'='*55}")
|
|
152
|
+
print(f" Skill Compression Complete")
|
|
153
|
+
print(f"{'='*55}")
|
|
154
|
+
print(f" Original : {total_orig:,} bytes ({total_orig//1024}KB)")
|
|
155
|
+
print(f" After : {total_new:,} bytes ({total_new//1024}KB)")
|
|
156
|
+
saved_total = total_orig - total_new
|
|
157
|
+
pct = saved_total / total_orig * 100 if total_orig else 0
|
|
158
|
+
print(f" Saved : {saved_total:,} bytes ({saved_total//1024}KB) ā {pct:.1f}%")
|
|
159
|
+
print(f"\n Top savings:")
|
|
160
|
+
for saved, path in results[:15]:
|
|
161
|
+
skill = os.path.basename(os.path.dirname(path))
|
|
162
|
+
fname = os.path.basename(path)
|
|
163
|
+
print(f" -{saved//1024:2}KB {skill}/{fname}")
|
|
164
|
+
print()
|
|
165
|
+
|
|
166
|
+
if __name__ == '__main__':
|
|
167
|
+
main()
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
consolidate_skills.py
|
|
4
|
+
Merges all sub-files in skill directories into the main SKILL.md.
|
|
5
|
+
Strips: verbose intros, output format blocks, run scripts tables,
|
|
6
|
+
mandatory read tables, empty headers, redundant boilerplate.
|
|
7
|
+
Keeps: all code blocks, hallucination traps, checklist items.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
python .agent/scripts/consolidate_skills.py [skill_name]
|
|
11
|
+
python .agent/scripts/consolidate_skills.py # all skills
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import os, re, sys
|
|
15
|
+
|
|
16
|
+
BASE = '.agent/skills'
|
|
17
|
+
|
|
18
|
+
# These patterns are global (GEMINI.md) ā strip from sub-files before merge
|
|
19
|
+
STRIP_PATTERNS = [
|
|
20
|
+
r'(?ms)^## šļø Tribunal Integration.*?(?=^## |\Z)',
|
|
21
|
+
r'(?ms)^## Tribunal Integration.*?(?=^## |\Z)',
|
|
22
|
+
r'(?ms)^### ā
Pre-Flight Self-Audit.*?(?=^###|^## |\Z)',
|
|
23
|
+
r'(?ms)^## Pre-Flight Self-Audit.*?(?=^## |\Z)',
|
|
24
|
+
r'(?ms)^## Output Format\b.*?(?=^## |\Z)',
|
|
25
|
+
r'(?ms)^## š§ Runtime Scripts.*?(?=^## |\Z)',
|
|
26
|
+
r'(?ms)^## š“ MANDATORY.*?(?=^## |\Z)',
|
|
27
|
+
r'(?ms)^## ā ļø CRITICAL: ASK BEFORE ASSUMING.*?(?=^## |\Z)',
|
|
28
|
+
r'(?ms)^## š CHECKPOINT \(MANDATORY.*?(?=^## |\Z)',
|
|
29
|
+
r'(?ms)^## Output Format.*?```\n[^`]*```\n?(?=^## |\Z)',
|
|
30
|
+
r'(?ms)^\*\*Execute these for validation.*?---\n',
|
|
31
|
+
r'(?ms)^\*\*VBC \(Verification-Before-Completion\).*?\n',
|
|
32
|
+
# MANDATORY read tables
|
|
33
|
+
r'(?ms)^\*\*ā DO NOT start.*?---\n?',
|
|
34
|
+
r'(?ms)^> š§ \*\*mobile-design.*?\n',
|
|
35
|
+
r'(?ms)^> \*\*STOP.*?\n',
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
# Heading level adjustment (sub-files use H1 ā convert to H2 in merged output)
|
|
39
|
+
def adjust_headings(content, offset=1):
|
|
40
|
+
"""Promote headings by adding # chars"""
|
|
41
|
+
lines = content.split('\n')
|
|
42
|
+
out = []
|
|
43
|
+
for line in lines:
|
|
44
|
+
m = re.match(r'^(#{1,5}) ', line)
|
|
45
|
+
if m:
|
|
46
|
+
level = len(m.group(1))
|
|
47
|
+
new_level = min(level + offset, 6)
|
|
48
|
+
line = '#' * new_level + line[level:]
|
|
49
|
+
out.append(line)
|
|
50
|
+
return '\n'.join(out)
|
|
51
|
+
|
|
52
|
+
def clean_content(content):
|
|
53
|
+
"""Apply strip patterns"""
|
|
54
|
+
for p in STRIP_PATTERNS:
|
|
55
|
+
content = re.sub(p, '', content)
|
|
56
|
+
content = re.sub(r'\n{3,}', '\n\n', content)
|
|
57
|
+
return content.strip()
|
|
58
|
+
|
|
59
|
+
def extract_frontmatter(content):
|
|
60
|
+
"""Return (frontmatter_dict_str, body)"""
|
|
61
|
+
m = re.match(r'^---\n(.*?)\n---\n', content, re.DOTALL)
|
|
62
|
+
if m:
|
|
63
|
+
return m.group(1), content[m.end():]
|
|
64
|
+
return '', content
|
|
65
|
+
|
|
66
|
+
def get_sub_title(content):
|
|
67
|
+
"""Get first H1 from a sub-file"""
|
|
68
|
+
m = re.search(r'^# (.+)', content, re.MULTILINE)
|
|
69
|
+
return m.group(1) if m else None
|
|
70
|
+
|
|
71
|
+
def consolidate(skill_dir):
|
|
72
|
+
skill_name = os.path.basename(skill_dir)
|
|
73
|
+
main_path = os.path.join(skill_dir, 'SKILL.md')
|
|
74
|
+
if not os.path.exists(main_path):
|
|
75
|
+
return False
|
|
76
|
+
|
|
77
|
+
# Find sub-files (non-SKILL.md markdown files)
|
|
78
|
+
sub_files = sorted([
|
|
79
|
+
f for f in os.listdir(skill_dir)
|
|
80
|
+
if f.endswith('.md') and f != 'SKILL.md'
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
if not sub_files:
|
|
84
|
+
return False
|
|
85
|
+
|
|
86
|
+
print(f'\n ā Consolidating: {skill_name} ({len(sub_files)} sub-files)')
|
|
87
|
+
|
|
88
|
+
# Read main SKILL.md
|
|
89
|
+
main_content = open(main_path, 'r', encoding='utf-8', errors='ignore').read()
|
|
90
|
+
frontmatter, main_body = extract_frontmatter(main_content)
|
|
91
|
+
|
|
92
|
+
# Clean & update frontmatter version
|
|
93
|
+
fm_lines = frontmatter.split('\n')
|
|
94
|
+
new_fm = []
|
|
95
|
+
for line in fm_lines:
|
|
96
|
+
if line.startswith('version:'):
|
|
97
|
+
new_fm.append('version: 3.1.0')
|
|
98
|
+
elif line.startswith('last-updated:'):
|
|
99
|
+
new_fm.append('last-updated: 2026-04-06')
|
|
100
|
+
else:
|
|
101
|
+
new_fm.append(line)
|
|
102
|
+
frontmatter = '\n'.join(new_fm)
|
|
103
|
+
|
|
104
|
+
# Clean main body
|
|
105
|
+
main_body = clean_content(main_body)
|
|
106
|
+
|
|
107
|
+
# Remove MANDATORY read table from main body
|
|
108
|
+
# (links like [file.md](file.md) in tables)
|
|
109
|
+
main_body = re.sub(r'\|.*?\.md.*?\|.*?\|.*?\|\n', '', main_body)
|
|
110
|
+
main_body = re.sub(r'^\|[-| ]+\|\n', '', main_body, flags=re.MULTILINE)
|
|
111
|
+
main_body = re.sub(r'\n{3,}', '\n\n', main_body)
|
|
112
|
+
|
|
113
|
+
# Merge sub-files
|
|
114
|
+
merged_sections = []
|
|
115
|
+
for fname in sub_files:
|
|
116
|
+
fpath = os.path.join(skill_dir, fname)
|
|
117
|
+
raw = open(fpath, 'r', encoding='utf-8', errors='ignore').read()
|
|
118
|
+
_, body = extract_frontmatter(raw)
|
|
119
|
+
body = clean_content(body)
|
|
120
|
+
# Adjust headings: H1āH2, H2āH3, etc.
|
|
121
|
+
body = adjust_headings(body, offset=1)
|
|
122
|
+
if body.strip():
|
|
123
|
+
merged_sections.append(body.strip())
|
|
124
|
+
|
|
125
|
+
# Build final output
|
|
126
|
+
combined = f'---\n{frontmatter}\n---\n\n{main_body}'
|
|
127
|
+
if merged_sections:
|
|
128
|
+
combined += '\n\n---\n\n' + '\n\n---\n\n'.join(merged_sections)
|
|
129
|
+
|
|
130
|
+
# Final cleanup
|
|
131
|
+
combined = re.sub(r'\n{3,}', '\n\n', combined)
|
|
132
|
+
combined = combined.strip() + '\n'
|
|
133
|
+
|
|
134
|
+
# Measure savings
|
|
135
|
+
total_sub_bytes = sum(os.path.getsize(os.path.join(skill_dir, f)) for f in sub_files)
|
|
136
|
+
print(f' Sub-files total: {total_sub_bytes//1024}KB')
|
|
137
|
+
|
|
138
|
+
# Write consolidated SKILL.md
|
|
139
|
+
with open(main_path, 'w', encoding='utf-8') as f:
|
|
140
|
+
f.write(combined)
|
|
141
|
+
|
|
142
|
+
new_size = os.path.getsize(main_path)
|
|
143
|
+
print(f' New SKILL.md: {new_size//1024}KB (from {len(main_content)//1024}KB main + {total_sub_bytes//1024}KB subs ā {new_size//1024}KB)')
|
|
144
|
+
|
|
145
|
+
# Delete sub-files
|
|
146
|
+
for fname in sub_files:
|
|
147
|
+
os.remove(os.path.join(skill_dir, fname))
|
|
148
|
+
print(f' Deleted: {fname}')
|
|
149
|
+
|
|
150
|
+
return True
|
|
151
|
+
|
|
152
|
+
def main():
|
|
153
|
+
target = sys.argv[1] if len(sys.argv) > 1 else None
|
|
154
|
+
|
|
155
|
+
total_saved = 0
|
|
156
|
+
processed = 0
|
|
157
|
+
|
|
158
|
+
for skill_name in os.listdir(BASE):
|
|
159
|
+
skill_dir = os.path.join(BASE, skill_name)
|
|
160
|
+
if not os.path.isdir(skill_dir):
|
|
161
|
+
continue
|
|
162
|
+
if target and skill_name != target:
|
|
163
|
+
continue
|
|
164
|
+
if consolidate(skill_dir):
|
|
165
|
+
processed += 1
|
|
166
|
+
|
|
167
|
+
if processed == 0:
|
|
168
|
+
print('No skills with sub-files found (or target not matched).')
|
|
169
|
+
else:
|
|
170
|
+
print(f'\nā
Consolidated {processed} skills.')
|
|
171
|
+
|
|
172
|
+
if __name__ == '__main__':
|
|
173
|
+
main()
|