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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Coordinate multiple agents for complex tasks. Use for multi-perspective analysis, comprehensive reviews, or tasks
|
|
2
|
+
description: Coordinate multiple agents for complex tasks. Use for multi-perspective analysis, comprehensive reviews requiring different domain expertise, or tasks where a single agent would miss domain-specific failures. Fan-Out dispatch → parallel execution → Fan-In synthesis → Human Gate.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# /orchestrate — Multi-Agent Coordination
|
|
@@ -8,144 +8,161 @@ $ARGUMENTS
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## When to Use /orchestrate
|
|
12
|
+
|
|
13
|
+
|Use `/orchestrate` when...|Use something else when...|
|
|
14
|
+
|:---|:---|
|
|
15
|
+
|Task spans 2+ technical domains|Single domain → use specialist directly|
|
|
16
|
+
|Multi-perspective review is needed|Simple code generation → `/generate`|
|
|
17
|
+
|Fan-out parallelism would save time|Debugging → `/debug` (sequential by nature)|
|
|
18
|
+
|One agent would miss domain failures|Planning only → `/plan`|
|
|
12
19
|
|
|
13
20
|
---
|
|
14
21
|
|
|
15
|
-
##
|
|
22
|
+
## Phase 1 — Scope Classification
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
Before dispatching workers:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
1. Is this actually multi-domain? (2+ distinct technical areas)
|
|
28
|
+
→ YES → proceed to Phase 2
|
|
29
|
+
→ NO → route to the single correct specialist agent
|
|
30
|
+
|
|
31
|
+
2. Can tasks be parallelized (no dependencies between them)?
|
|
32
|
+
→ YES → Fan-Out dispatch (all workers simultaneous)
|
|
33
|
+
→ NO → Sequential wave dispatch
|
|
34
|
+
|
|
35
|
+
3. Context budget check:
|
|
36
|
+
□ How many files does each worker need?
|
|
37
|
+
□ Total context across all workers manageable?
|
|
38
|
+
□ Can I pass context_summary instead of full file dumps?
|
|
39
|
+
```
|
|
23
40
|
|
|
24
41
|
---
|
|
25
42
|
|
|
26
|
-
##
|
|
43
|
+
## Phase 2 — Worker Decomposition
|
|
27
44
|
|
|
28
|
-
|
|
29
|
-
>
|
|
30
|
-
> Before marking any orchestration session as complete, count the agents invoked. If the count is less than 3, activate more. A single agent delegated to is just a delegation.
|
|
45
|
+
Break the goal into atomic, non-overlapping worker tasks:
|
|
31
46
|
|
|
32
|
-
|
|
47
|
+
```
|
|
48
|
+
Goal: Review the full checkout feature before launch
|
|
33
49
|
|
|
34
|
-
|
|
50
|
+
Decomposed Workers:
|
|
51
|
+
├── Worker A [backend-specialist]: Review API routes for auth and validation
|
|
52
|
+
├── Worker B [database-architect]: Review DB queries for N+1 and transactions
|
|
53
|
+
├── Worker C [frontend-specialist]: Review UI components for RSC compliance
|
|
54
|
+
└── Worker D [security-auditor]: Review the full checkout flow for OWASP issues
|
|
55
|
+
```
|
|
35
56
|
|
|
36
|
-
|
|
37
|
-
|---|---|
|
|
38
|
-
| Full-stack feature | `frontend-specialist` + `backend-specialist` + `test-engineer` |
|
|
39
|
-
| API build | `backend-specialist` + `security-auditor` + `test-engineer` |
|
|
40
|
-
| Database-heavy work | `database-architect` + `backend-specialist` + `security-auditor` |
|
|
41
|
-
| Complete product | `project-planner` + `frontend-specialist` + `backend-specialist` + `devops-engineer` |
|
|
42
|
-
| Security investigation | `security-auditor` + `penetration-tester` + `devops-engineer` |
|
|
43
|
-
| Complex bug | `debugger` + `explorer-agent` + `test-engineer` |
|
|
44
|
-
| New codebase or unknown repo | `explorer-agent` + relevant specialists |
|
|
57
|
+
**Worker files cannot overlap.** If two workers both need to modify the same file → one worker owns it.
|
|
45
58
|
|
|
46
59
|
---
|
|
47
60
|
|
|
48
|
-
##
|
|
49
|
-
|
|
50
|
-
### Phase A — Planning Only
|
|
61
|
+
## Fan-Out Pattern (Parallel Dispatch)
|
|
51
62
|
|
|
52
|
-
|
|
63
|
+
When tasks are independent, dispatch all simultaneously:
|
|
53
64
|
|
|
54
65
|
```
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
━━━ Wave 1: Fan-Out ━━━━━━━━━━━━━━━━━━━━━━━
|
|
67
|
+
Worker A (backend) → RUNNING (reading: src/app/api/checkout/)
|
|
68
|
+
Worker B (database) → RUNNING (reading: prisma/schema.prisma, checkout queries)
|
|
69
|
+
Worker C (frontend) → RUNNING (reading: src/app/checkout/page.tsx)
|
|
70
|
+
Worker D (security) → RUNNING (reading: all of the above)
|
|
71
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
72
|
+
|
|
73
|
+
Wait for ALL workers (allSettled — single worker failure doesn't cancel siblings)
|
|
74
|
+
|
|
75
|
+
━━━ Wave 1: Results ━━━━━━━━━━━━━━━━━━━━━━━
|
|
76
|
+
Worker A: ✅ COMPLETE
|
|
77
|
+
Worker B: ✅ COMPLETE
|
|
78
|
+
Worker C: ⚠️ BLOCKED (missing: what state management pattern to assume)
|
|
79
|
+
Worker D: ✅ COMPLETE
|
|
80
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
81
|
+
|
|
82
|
+
Supervisor provides missing info to Worker C → redispatch
|
|
57
83
|
```
|
|
58
84
|
|
|
59
|
-
|
|
85
|
+
---
|
|
60
86
|
|
|
61
|
-
|
|
87
|
+
## BLOCKED Worker Protocol
|
|
62
88
|
|
|
63
|
-
|
|
64
|
-
✅ Plan ready: docs/PLAN-{slug}.md
|
|
89
|
+
When a worker cannot proceed:
|
|
65
90
|
|
|
66
|
-
|
|
91
|
+
```
|
|
92
|
+
Status: BLOCKED
|
|
93
|
+
Reason: Missing context — the auth middleware file is not in provided scope
|
|
94
|
+
Unblocked by: Read src/middleware.ts first and pass auth pattern to worker
|
|
95
|
+
|
|
96
|
+
Supervisor action:
|
|
97
|
+
1. Provide the missing context if available
|
|
98
|
+
2. Escalate to human if decision is needed
|
|
99
|
+
3. Never guess — BLOCKED beats hallucinating
|
|
67
100
|
```
|
|
68
101
|
|
|
69
|
-
|
|
102
|
+
---
|
|
70
103
|
|
|
71
|
-
|
|
104
|
+
## Sequential Wave Execution
|
|
72
105
|
|
|
73
|
-
|
|
106
|
+
When tasks depend on each other:
|
|
74
107
|
|
|
75
108
|
```
|
|
76
|
-
Wave 1
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
↓
|
|
80
|
-
Wave 2: backend-specialist + frontend-specialist (JSON dispatch #2)
|
|
81
|
-
↓
|
|
82
|
-
[Wait for completion & Tribunal review]
|
|
83
|
-
↓
|
|
84
|
-
Wave 3: test-engineer (JSON dispatch #3)
|
|
85
|
-
↓
|
|
86
|
-
[Wait for completion & Human Gate]
|
|
109
|
+
Wave 1 → Foundation (must complete first)
|
|
110
|
+
Wave 2 → Depends on Wave 1 output (receives context_summary, not full output)
|
|
111
|
+
Wave 3 → Synthesis (combines all wave outputs)
|
|
87
112
|
```
|
|
88
113
|
|
|
89
|
-
|
|
114
|
+
**Context discipline between waves:** Summarize Wave N output in 3-5 bullets before passing to Wave N+1.
|
|
90
115
|
|
|
91
116
|
---
|
|
92
117
|
|
|
93
|
-
##
|
|
94
|
-
|
|
95
|
-
When dispatching workers, the Orchestrator MUST use the `dispatch_micro_workers` JSON format.
|
|
118
|
+
## Fan-In — Synthesis
|
|
96
119
|
|
|
97
|
-
|
|
120
|
+
After all workers complete:
|
|
98
121
|
|
|
99
122
|
```
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
123
|
+
1. Merge findings by severity
|
|
124
|
+
2. Identify conflicts (Worker A says X, Worker B says Y)
|
|
125
|
+
3. Resolve conflicts with evidence (which worker has specific file evidence?)
|
|
126
|
+
4. Produce unified output sorted by priority
|
|
104
127
|
```
|
|
105
128
|
|
|
106
|
-
**Per-worker context limit:** Excerpt only the relevant function or schema section — never the entire file.
|
|
107
|
-
|
|
108
129
|
---
|
|
109
130
|
|
|
110
|
-
##
|
|
131
|
+
## Human Gate
|
|
111
132
|
|
|
112
133
|
```
|
|
113
|
-
|
|
114
|
-
Attempt 2 → Worker runs with stricter constraints + failure feedback
|
|
115
|
-
Attempt 3 → Worker runs with max constraints + full context dump
|
|
116
|
-
Attempt 4 → HALT. Report to human with full failure history.
|
|
117
|
-
```
|
|
134
|
+
━━━ Orchestration Complete ━━━━━━━━━━━━━━━━━
|
|
118
135
|
|
|
119
|
-
|
|
136
|
+
Workers: 4 dispatched / 4 complete / 0 blocked
|
|
120
137
|
|
|
121
|
-
|
|
138
|
+
━━━ Synthesized Findings ━━━━━━━━━━━━━━━━━━
|
|
139
|
+
[Critical issues first, then high, then medium]
|
|
122
140
|
|
|
123
|
-
|
|
141
|
+
━━━ Required Changes ━━━━━━━━━━━━━━━━━━━━━
|
|
142
|
+
Files to modify: [list]
|
|
143
|
+
Files to create: [list]
|
|
124
144
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
- Retry limit: 3 Maker revisions per agent; after 3 failures → stop and report
|
|
129
|
-
- `context_summary` is the only mechanism for sharing context across agents — no full dumps
|
|
145
|
+
━━━ Human Gate ━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
146
|
+
Approve? Y = proceed | N = discard | R = revise
|
|
147
|
+
```
|
|
130
148
|
|
|
131
149
|
---
|
|
132
150
|
|
|
133
|
-
##
|
|
151
|
+
## Error Recovery
|
|
134
152
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
| Single domain needs specialist audit | Use the domain-specific `/tribunal-*` |
|
|
153
|
+
```
|
|
154
|
+
Worker failure (after 3 retries):
|
|
155
|
+
Report: agent=[name], task=[what], attempts=3, last_error=[error], suggestion=[what to check]
|
|
156
|
+
Action: continue remaining workers, include failure in final synthesis
|
|
157
|
+
```
|
|
141
158
|
|
|
142
159
|
---
|
|
143
160
|
|
|
144
|
-
## Usage
|
|
161
|
+
## Usage Examples
|
|
145
162
|
|
|
146
163
|
```
|
|
147
|
-
/orchestrate
|
|
148
|
-
/orchestrate
|
|
149
|
-
/orchestrate
|
|
150
|
-
/orchestrate
|
|
164
|
+
/orchestrate review the entire authentication system for security and correctness
|
|
165
|
+
/orchestrate analyze the payment feature: backend logic + DB queries + frontend UX
|
|
166
|
+
/orchestrate comprehensive code review before launch: security + tests + performance
|
|
167
|
+
/orchestrate compare three different caching strategies and recommend the best fit
|
|
151
168
|
```
|
|
@@ -1,305 +1,114 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Run standardized performance benchmarks including Lighthouse, bundle analysis, and latency checks.
|
|
2
|
+
description: Run standardized performance benchmarks including Lighthouse CI, bundle analysis, and API latency checks. Records before/after metrics. No optimization claims without measured evidence.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# /performance-benchmarker —
|
|
5
|
+
# /performance-benchmarker — Evidence-Based Performance Measurement
|
|
6
6
|
|
|
7
7
|
$ARGUMENTS
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## When to Use /performance-benchmarker
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
- When user reports "it feels slow" or asks to "check performance".
|
|
20
|
-
- When triggered by `benchmark`, `lighthouse`, `bundle size`, or `latency` keywords.
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Pipeline Flow
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
Request (scope: full / web-vitals / bundle / api)
|
|
28
|
-
│
|
|
29
|
-
▼
|
|
30
|
-
Environment detection — framework, build tool, package manager
|
|
31
|
-
│
|
|
32
|
-
▼
|
|
33
|
-
Tool availability check — lighthouse? build script? dev server?
|
|
34
|
-
│
|
|
35
|
-
▼
|
|
36
|
-
Benchmark execution — run selected checks
|
|
37
|
-
│
|
|
38
|
-
▼
|
|
39
|
-
Score calculation — weighted composite
|
|
40
|
-
│
|
|
41
|
-
▼
|
|
42
|
-
Regression detection — compare against previous baselines (if available)
|
|
43
|
-
│
|
|
44
|
-
▼
|
|
45
|
-
Report — scores, pass/fail, recommendations, fix priority
|
|
46
|
-
```
|
|
13
|
+
|Use `/performance-benchmarker` when...|Use something else when...|
|
|
14
|
+
|:---|:---|
|
|
15
|
+
|Establishing performance baseline|Code optimization decisions → `/tribunal-performance`|
|
|
16
|
+
|After optimization — verify improvement|Memory leaks investigation → `/debug`|
|
|
17
|
+
|Pre-release performance gate|Bundle analysis only → run ANALYZE=true npm run build|
|
|
18
|
+
|Regular weekly benchmark|API review only → `/tribunal-backend`|
|
|
47
19
|
|
|
48
20
|
---
|
|
49
21
|
|
|
50
|
-
## Benchmark Suite
|
|
22
|
+
## Benchmark Suite (Run in Order)
|
|
51
23
|
|
|
52
|
-
### 1. Web Vitals (Frontend Performance)
|
|
53
|
-
|
|
54
|
-
| Metric | Good | Needs Work | Poor | Measurement |
|
|
55
|
-
|---|---|---|---|---|
|
|
56
|
-
| LCP (Largest Contentful Paint) | < 2.5s | 2.5-4.0s | > 4.0s | Lighthouse or `web-vitals` library |
|
|
57
|
-
| INP (Interaction to Next Paint) | < 200ms | 200-500ms | > 500ms | Lab approximation via TBT |
|
|
58
|
-
| CLS (Cumulative Layout Shift) | < 0.1 | 0.1-0.25 | > 0.25 | Layout shift detection |
|
|
59
|
-
| TTFB (Time to First Byte) | < 800ms | 800-1800ms | > 1800ms | Server response timing |
|
|
60
|
-
| FCP (First Contentful Paint) | < 1.8s | 1.8-3.0s | > 3.0s | Lighthouse |
|
|
61
|
-
| Speed Index | < 3.4s | 3.4-5.8s | > 5.8s | Lighthouse |
|
|
62
|
-
|
|
63
|
-
**How to Run:**
|
|
64
24
|
```bash
|
|
65
|
-
#
|
|
66
|
-
npx lighthouse http://localhost:3000
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
25
|
+
# 1. Lighthouse CI — Core Web Vitals
|
|
26
|
+
npx lighthouse http://localhost:3000 \
|
|
27
|
+
--output=json \
|
|
28
|
+
--output-path=./reports/lighthouse-$(date +%Y%m%d).json \
|
|
29
|
+
--only-categories=performance,accessibility,best-practices,seo
|
|
30
|
+
|
|
31
|
+
# 2. Bundle Analysis
|
|
32
|
+
ANALYZE=true npm run build
|
|
33
|
+
|
|
34
|
+
# 3. API latency (using autocannon for load test)
|
|
35
|
+
npx autocannon -c 10 -d 20 http://localhost:3000/api/products
|
|
36
|
+
# -c: 10 concurrent connections
|
|
37
|
+
# -d: 20 second duration
|
|
38
|
+
|
|
39
|
+
# 4. Database query analysis
|
|
40
|
+
# (Prisma): Add to your test route temporarily
|
|
41
|
+
const plan = await prisma.$queryRaw`EXPLAIN ANALYZE SELECT * FROM orders WHERE user_id = ${userId}`;
|
|
42
|
+
console.log(plan);
|
|
70
43
|
```
|
|
71
44
|
|
|
72
|
-
**Common Fixes by Metric:**
|
|
73
|
-
|
|
74
|
-
| Metric | Fix | Impact |
|
|
75
|
-
|---|---|---|
|
|
76
|
-
| LCP slow | Preload hero image, use `fetchpriority="high"` | High |
|
|
77
|
-
| LCP slow | Eliminate render-blocking CSS/JS | High |
|
|
78
|
-
| INP slow | Break long tasks > 50ms into smaller chunks | High |
|
|
79
|
-
| INP slow | Use `requestIdleCallback` for non-critical work | Medium |
|
|
80
|
-
| CLS high | Set explicit `width`/`height` on images/embeds | High |
|
|
81
|
-
| CLS high | Use `font-display: swap` + font preload | Medium |
|
|
82
|
-
| TTFB slow | Add caching headers, use CDN | High |
|
|
83
|
-
| TTFB slow | Optimize database queries, add indexes | High |
|
|
84
|
-
| FCP slow | Inline critical CSS, defer non-critical | High |
|
|
85
|
-
|
|
86
|
-
### 2. Bundle Analysis (JavaScript/CSS)
|
|
87
|
-
|
|
88
|
-
| Check | Target | Warning | Fail | Tool |
|
|
89
|
-
|---|---|---|---|---|
|
|
90
|
-
| Total JS (gzipped) | < 100KB | 100-200KB | > 200KB | Build output |
|
|
91
|
-
| Largest chunk (gzipped) | < 50KB | 50-100KB | > 100KB | Build output |
|
|
92
|
-
| CSS total | < 50KB | 50-100KB | > 100KB | Build output |
|
|
93
|
-
| Unused CSS | < 5% | 5-15% | > 15% | PurgeCSS |
|
|
94
|
-
| Duplicate packages | 0 | 1-2 | > 2 | Bundle analyzer |
|
|
95
|
-
| Tree-shaking | No side-effect barrel exports | — | Side-effect imports found | Manual analysis |
|
|
96
|
-
|
|
97
|
-
**How to Run:**
|
|
98
|
-
```bash
|
|
99
|
-
# Build and analyze
|
|
100
|
-
npm run build -- --stats
|
|
101
|
-
# VERIFY: check if the build script supports --stats flag
|
|
102
|
-
|
|
103
|
-
# Alternative: analyze existing build output
|
|
104
|
-
npx source-map-explorer dist/**/*.js
|
|
105
|
-
# VERIFY: check if source-map-explorer is available
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
**Common Fixes:**
|
|
109
|
-
|
|
110
|
-
| Issue | Fix | Savings |
|
|
111
|
-
|---|---|---|
|
|
112
|
-
| Large lodash import | `import debounce from 'lodash/debounce'` not `import { debounce } from 'lodash'` | 50-80KB |
|
|
113
|
-
| Moment.js | Replace with `dayjs` or `date-fns` | 60-70KB |
|
|
114
|
-
| Full icon library | Use tree-shakeable imports or individual icon files | 20-100KB |
|
|
115
|
-
| Uncompressed images | Use WebP/AVIF, add `loading="lazy"` | 50-500KB |
|
|
116
|
-
| CSS framework unused | PurgeCSS or `content` config in Tailwind | 30-90KB |
|
|
117
|
-
|
|
118
|
-
### 3. API Latency (Backend Performance)
|
|
119
|
-
|
|
120
|
-
| Check | Target | Warning | Fail | Method |
|
|
121
|
-
|---|---|---|---|---|
|
|
122
|
-
| Avg response (simple GET) | < 100ms | 100-300ms | > 300ms | 10 sequential requests |
|
|
123
|
-
| Avg response (complex query) | < 300ms | 300-800ms | > 800ms | 10 sequential requests |
|
|
124
|
-
| P95 response | < 500ms | 500-1000ms | > 1000ms | Sort, pick 95th percentile |
|
|
125
|
-
| P99 response | < 1000ms | 1-3s | > 3s | Sort, pick 99th percentile |
|
|
126
|
-
| Cold start | < 1s | 1-3s | > 3s | First request after 30s idle |
|
|
127
|
-
| Concurrent handling | Linear scaling up to 10 req | — | Exponential degradation | 10 parallel requests |
|
|
128
|
-
|
|
129
|
-
**How to Run:**
|
|
130
|
-
```bash
|
|
131
|
-
# Using curl timing
|
|
132
|
-
curl -o /dev/null -s -w "time_total: %{time_total}s\n" http://localhost:3000/api/health
|
|
133
|
-
|
|
134
|
-
# Loop for average
|
|
135
|
-
for i in $(seq 1 10); do
|
|
136
|
-
curl -o /dev/null -s -w "%{time_total}\n" http://localhost:3000/api/endpoint
|
|
137
|
-
done
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
**Common Fixes:**
|
|
141
|
-
|
|
142
|
-
| Symptom | Likely Cause | Fix |
|
|
143
|
-
|---|---|---|
|
|
144
|
-
| Slow first request | Cold start, no connection pool | Pre-warm, use connection pooling |
|
|
145
|
-
| Slow list endpoints | N+1 queries | Add eager loading / `include` |
|
|
146
|
-
| Slow under load | No caching | Add Redis/in-memory cache for hot paths |
|
|
147
|
-
| Inconsistent P95 | GC pauses | Optimize memory allocation, reduce object churn |
|
|
148
|
-
|
|
149
|
-
### 4. Build Performance (DX)
|
|
150
|
-
|
|
151
|
-
| Check | Target | Warning | Fail |
|
|
152
|
-
|---|---|---|---|
|
|
153
|
-
| Dev server cold start | < 3s | 3-8s | > 8s |
|
|
154
|
-
| Hot reload (HMR) | < 200ms | 200-500ms | > 500ms |
|
|
155
|
-
| Full production build | < 30s | 30-60s | > 60s |
|
|
156
|
-
| TypeScript type-check | < 15s | 15-30s | > 30s |
|
|
157
|
-
|
|
158
45
|
---
|
|
159
46
|
|
|
160
|
-
##
|
|
47
|
+
## Benchmark Report Format
|
|
161
48
|
|
|
162
49
|
```
|
|
163
|
-
Performance
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
50
|
+
━━━ Performance Benchmark — [date] ━━━━━━━━━
|
|
51
|
+
|
|
52
|
+
━━━ Core Web Vitals (Lighthouse) ━━━━━━━━━━
|
|
53
|
+
LCP: [time] [✅ Good | ⚠️ Needs Work | ❌ Poor]
|
|
54
|
+
INP: [time] [✅ Good | ⚠️ Needs Work | ❌ Poor]
|
|
55
|
+
CLS: [score] [✅ Good | ⚠️ Needs Work | ❌ Poor]
|
|
56
|
+
FCP: [time]
|
|
57
|
+
TTFB: [time]
|
|
58
|
+
|
|
59
|
+
Performance Score: [N]/100
|
|
60
|
+
|
|
61
|
+
━━━ Bundle Sizes ━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
62
|
+
First Load JS (shared): [size]
|
|
63
|
+
Largest page: [size] ([route])
|
|
64
|
+
Largest 3 bundles:
|
|
65
|
+
[bundle]: [size]
|
|
66
|
+
[bundle]: [size]
|
|
67
|
+
[bundle]: [size]
|
|
68
|
+
|
|
69
|
+
━━━ API Latency (10 concurrent, 20s) ━━━━━━
|
|
70
|
+
GET /api/products: avg [ms] | p99 [ms] | [req/s] req/s
|
|
71
|
+
POST /api/orders: avg [ms] | p99 [ms]
|
|
72
|
+
|
|
73
|
+
━━━ Comparison (vs last run) ━━━━━━━━━━━━━━
|
|
74
|
+
LCP: 4.2s → 1.9s ▼ IMPROVED ✅
|
|
75
|
+
INP: 480ms → 140ms ▼ IMPROVED ✅
|
|
76
|
+
Bundle: 890kb → 310kb ▼ IMPROVED ✅
|
|
77
|
+
p99 latency: 230ms → 89ms ▼ IMPROVED ✅
|
|
176
78
|
```
|
|
177
79
|
|
|
178
|
-
Each sub-score is calculated as: `(checks_passed / total_checks)` weighted by target (1.0), warning (0.6), fail (0.0).
|
|
179
|
-
|
|
180
80
|
---
|
|
181
81
|
|
|
182
|
-
##
|
|
82
|
+
## Performance Gates (Fail Criteria)
|
|
183
83
|
|
|
184
84
|
```
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
FCP: 1.2s ✅ Good (target: < 1.8s)
|
|
198
|
-
Score: 92/100
|
|
199
|
-
|
|
200
|
-
━━━ Bundle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
201
|
-
|
|
202
|
-
Total JS: 156KB gzipped 🟡 Warning (target: < 100KB)
|
|
203
|
-
Largest chunk: 82KB gzipped 🟡 Warning (target: < 50KB)
|
|
204
|
-
CSS total: 28KB gzipped ✅ Good
|
|
205
|
-
Unused CSS: 4.2% ✅ Good
|
|
206
|
-
Duplicates: 0 ✅ Good
|
|
207
|
-
Score: 72/100
|
|
208
|
-
|
|
209
|
-
━━━ API Latency ━━━━━━━━━━━━━━━━━━━━━━━━
|
|
210
|
-
|
|
211
|
-
GET /api/users: avg 89ms ✅ | p95 142ms ✅
|
|
212
|
-
POST /api/auth: avg 210ms 🟡 | p95 480ms 🟡
|
|
213
|
-
GET /api/dashboard: avg 340ms ❌ | p95 820ms ❌
|
|
214
|
-
Cold start: 680ms ✅
|
|
215
|
-
Score: 58/100
|
|
216
|
-
|
|
217
|
-
━━━ Build ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
218
|
-
|
|
219
|
-
Dev cold start: 2.1s ✅
|
|
220
|
-
HMR: 89ms ✅
|
|
221
|
-
Production build: 18s ✅
|
|
222
|
-
Type-check: 12s ✅
|
|
223
|
-
Score: 100/100
|
|
224
|
-
|
|
225
|
-
━━━ Fix Priority (by impact) ━━━━━━━━━━━
|
|
226
|
-
|
|
227
|
-
1. 🔴 GET /api/dashboard avg 340ms
|
|
228
|
-
→ Add database index on dashboard query joins
|
|
229
|
-
→ Expected: < 100ms (70% improvement)
|
|
230
|
-
|
|
231
|
-
2. 🟡 Total JS 156KB
|
|
232
|
-
→ Lazy-load chart library (80KB)
|
|
233
|
-
→ Expected: < 80KB initial (50% reduction)
|
|
234
|
-
|
|
235
|
-
3. 🟡 POST /api/auth avg 210ms
|
|
236
|
-
→ Cache user lookup in auth flow
|
|
237
|
-
→ Expected: < 100ms (50% improvement)
|
|
238
|
-
|
|
239
|
-
━━━ Trend (if baseline available) ━━━━━━
|
|
240
|
-
|
|
241
|
-
LCP: 1.8s → 1.8s → (no change)
|
|
242
|
-
Bundle: 140KB → 156KB ↑ (+11%) ⚠️ Regression
|
|
243
|
-
API p95: 400ms → 480ms ↑ (+20%) ⚠️ Regression
|
|
85
|
+
Failing these means optimization is blocking — not optional:
|
|
86
|
+
|
|
87
|
+
LCP > 4.0s → ❌ Must fix — users see blank page
|
|
88
|
+
INP > 500ms → ❌ Must fix — UI feels unresponsive
|
|
89
|
+
CLS > 0.25 → ❌ Must fix — layout jumps are jarring
|
|
90
|
+
Bundle > 1mb → ❌ Must fix — 3G users abandon
|
|
91
|
+
p99 API > 2000ms → ❌ Must fix — timeout risk on slow connections
|
|
92
|
+
|
|
93
|
+
Warning range (fix before major release):
|
|
94
|
+
LCP 2.5–4.0s → ⚠️
|
|
95
|
+
INP 200–500ms → ⚠️
|
|
96
|
+
Bundle 500kb–1mb → ⚠️
|
|
244
97
|
```
|
|
245
98
|
|
|
246
99
|
---
|
|
247
100
|
|
|
248
|
-
##
|
|
249
|
-
|
|
250
|
-
If a previous benchmark baseline exists (stored in `perf-baseline.json` or similar):
|
|
101
|
+
## Historical Tracking
|
|
251
102
|
|
|
252
|
-
|
|
253
|
-
|---|---|---|
|
|
254
|
-
| < 5% increase | No change | ✅ Stable |
|
|
255
|
-
| 5-15% increase | Minor regression | 🟡 Flag |
|
|
256
|
-
| > 15% increase | Significant regression | 🔴 Block deploy |
|
|
257
|
-
| Any decrease | Improvement | 🎉 Celebrate |
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
## Baseline Management
|
|
262
|
-
|
|
263
|
-
After a successful benchmark, save a baseline to detect future regressions:
|
|
103
|
+
Save every benchmark run:
|
|
264
104
|
|
|
265
105
|
```bash
|
|
266
|
-
#
|
|
267
|
-
|
|
106
|
+
# Benchmarks should be saved with date stamps
|
|
107
|
+
./reports/lighthouse-2026-04-02.json
|
|
108
|
+
./reports/bundle-2026-04-02.txt
|
|
109
|
+
./reports/latency-2026-04-02.txt
|
|
268
110
|
```
|
|
269
111
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
---
|
|
273
|
-
|
|
274
|
-
## Cross-Workflow Navigation
|
|
275
|
-
|
|
276
|
-
| After /performance-benchmarker shows... | Go to |
|
|
277
|
-
|---|---|
|
|
278
|
-
| Grade D or F | `/tribunal-performance` on the slowest code paths |
|
|
279
|
-
| Bundle regression (+15%) | `/audit` for dependency analysis, then `/fix` |
|
|
280
|
-
| API latency P95 > 500ms | `/debug` to identify the slow query or operation |
|
|
281
|
-
| Web vitals LCP > 4s | `/enhance` to add image preloading and critical CSS |
|
|
282
|
-
| Grade A or B, ready for deploy | `/deploy` following pre-flight checklist |
|
|
112
|
+
This enables trend analysis: is performance improving or degrading over time?
|
|
283
113
|
|
|
284
114
|
---
|
|
285
|
-
|
|
286
|
-
## Hallucination Guard
|
|
287
|
-
|
|
288
|
-
- **Only run benchmarks with installed tools** — check with `which` or `npx --dry-run` first.
|
|
289
|
-
- **Never fabricate benchmark numbers** — report "SKIPPED: [tool] not installed" if unavailable.
|
|
290
|
-
- **Flag anomalies**: `// NOTE: unusually fast — may be cached` or `// NOTE: first run, cold start included`.
|
|
291
|
-
- **Mark tool availability**: `// VERIFY: lighthouse-cli not detected, using fallback estimation`.
|
|
292
|
-
- **Don't guess fixes** — only recommend fixes for issues that have measured evidence.
|
|
293
|
-
|
|
294
|
-
---
|
|
295
|
-
|
|
296
|
-
## Usage
|
|
297
|
-
|
|
298
|
-
```
|
|
299
|
-
/performance-benchmarker full audit
|
|
300
|
-
/performance-benchmarker web vitals only
|
|
301
|
-
/performance-benchmarker bundle analysis
|
|
302
|
-
/performance-benchmarker api latency for /api/users /api/posts
|
|
303
|
-
/performance-benchmarker build performance
|
|
304
|
-
/performance-benchmarker compare with baseline
|
|
305
|
-
```
|