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: Debugging command. Activates DEBUG mode for systematic problem investigation. No fix is suggested until the root cause is confirmed.
|
|
2
|
+
description: Debugging command. Activates DEBUG mode for systematic problem investigation using the 4-phase methodology (Collect → Hypothesize → Test → Fix). No fix is suggested until the root cause is confirmed and tested. No random changes. No guessing.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# /debug — Root Cause Investigation
|
|
@@ -8,102 +8,98 @@ $ARGUMENTS
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
This command switches the AI into **investigation mode**. No fixes are suggested until the root cause is identified and confirmed. No random changes. No guessing.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
11
|
## The Investigation Contract
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
"A fix without a root cause is a patch on a symptom. It will fail again."
|
|
18
14
|
|
|
19
15
|
The `debugger` agent follows this sequence **without skipping steps**:
|
|
20
16
|
|
|
21
|
-
1. Collect evidence
|
|
22
|
-
2. Generate hypotheses
|
|
23
|
-
3. Test
|
|
24
|
-
4.
|
|
25
|
-
5. Apply targeted fix
|
|
26
|
-
6.
|
|
17
|
+
1. Collect all evidence first
|
|
18
|
+
2. Generate ranked hypotheses
|
|
19
|
+
3. Test exactly one hypothesis at a time
|
|
20
|
+
4. Confirm root cause with evidence
|
|
21
|
+
5. Apply the minimum targeted fix
|
|
22
|
+
6. Add a regression test to prevent recurrence
|
|
27
23
|
|
|
28
24
|
---
|
|
29
25
|
|
|
30
|
-
## When to Use /debug
|
|
26
|
+
## When to Use /debug
|
|
31
27
|
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
28
|
+
|Use `/debug` when...|Use something else when...|
|
|
29
|
+
|:---|:---|
|
|
30
|
+
|There's a specific error or unexpected behavior|Code needs to be written → `/generate`|
|
|
31
|
+
|You have a stack trace or error message|Code quality needs improving → `/refactor`|
|
|
32
|
+
|Production is broken right now|Missing test coverage → `/test`|
|
|
33
|
+
|A bug reappears after being "fixed"|Full health check needed → `/audit`|
|
|
38
34
|
|
|
39
35
|
---
|
|
40
36
|
|
|
41
|
-
## Step 1 — Evidence Collection
|
|
42
|
-
|
|
43
|
-
**Collect these before forming any hypothesis:**
|
|
37
|
+
## Step 1 — Evidence Collection (Collect All Before Hypothesizing)
|
|
44
38
|
|
|
45
39
|
```
|
|
46
|
-
□ Exact error text — full stack trace, not a
|
|
40
|
+
□ Exact error text — full stack trace, not a paraphrase
|
|
47
41
|
□ Minimum reproduction steps — fewest actions that trigger the bug
|
|
48
42
|
□ Last known-good state — commit hash, date, or config snapshot
|
|
49
|
-
□ Recent changes — code,
|
|
50
|
-
□ Environment — local
|
|
51
|
-
□ Frequency — always /
|
|
43
|
+
□ Recent changes — code, deps, env vars, infra, config changes
|
|
44
|
+
□ Environment — local/staging/prod, OS, Node version, browser, runtime
|
|
45
|
+
□ Frequency — always / intermittent / only under load / production only
|
|
52
46
|
```
|
|
53
47
|
|
|
54
|
-
> ⚠️ If the error is intermittent
|
|
48
|
+
> ⚠️ If the error is intermittent: collect timing patterns before hypothesizing.
|
|
49
|
+
|
|
50
|
+
### Priority Investigation Order (Most Likely Root Cause First)
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
1. Recent deployments — 90% of outages are caused by recent changes
|
|
54
|
+
2. Environment variables — rotated/missing secrets are common silent failures
|
|
55
|
+
3. Dependency updates — a package update can break APIs without errors
|
|
56
|
+
4. Infrastructure — firewall, Security Groups, DB connection limits
|
|
57
|
+
5. Application code — last to check, easiest to blame prematurely
|
|
58
|
+
```
|
|
55
59
|
|
|
56
60
|
---
|
|
57
61
|
|
|
58
|
-
## Step 2 — Hypothesis
|
|
62
|
+
## Step 2 — Hypothesis Formation
|
|
59
63
|
|
|
60
|
-
Map possible causes
|
|
64
|
+
Map all possible causes with explicit likelihood labels:
|
|
61
65
|
|
|
62
66
|
```
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
ROOT CAUSE CANDIDATES
|
|
68
|
+
━━━━━━━━━━━━━━━━━━━━━
|
|
69
|
+
H1 [High] — [cause] — Evidence: [what points to this]
|
|
70
|
+
H2 [Medium] — [cause] — Evidence: [what is consistent with this]
|
|
71
|
+
H3 [Low] — [cause] — Evidence: [theoretically possible]
|
|
66
72
|
```
|
|
67
73
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
**Hypothesis ranking rules:**
|
|
71
|
-
- High likelihood: directly supported by evidence or error message
|
|
72
|
-
- Medium likelihood: consistent with the error but no direct evidence
|
|
73
|
-
- Low likelihood: possible but requires unusual conditions
|
|
74
|
+
**Never state a hypothesis as confirmed fact until Step 3 proves it.**
|
|
74
75
|
|
|
75
76
|
---
|
|
76
77
|
|
|
77
78
|
## Step 3 — Single-Hypothesis Testing
|
|
78
79
|
|
|
79
|
-
Test
|
|
80
|
+
Test **one at a time**. Never test two simultaneously — results become ambiguous.
|
|
80
81
|
|
|
81
82
|
```
|
|
82
|
-
H1 tested: [
|
|
83
|
-
Result:
|
|
83
|
+
H1 tested: [how it was investigated]
|
|
84
|
+
Result: ✅ Confirmed | ❌ Ruled out — [specific evidence against]
|
|
84
85
|
|
|
85
|
-
H2 tested: [
|
|
86
|
-
Result:
|
|
86
|
+
H2 tested: [how it was investigated]
|
|
87
|
+
Result: ✅ Confirmed | ❌ Ruled out — [reason]
|
|
87
88
|
```
|
|
88
89
|
|
|
89
|
-
Stop when the first hypothesis is confirmed. Do not continue
|
|
90
|
+
Stop when the first hypothesis is confirmed. Do not continue investigating eliminated causes.
|
|
90
91
|
|
|
91
92
|
---
|
|
92
93
|
|
|
93
94
|
## Step 4 — Root Cause Statement
|
|
94
95
|
|
|
95
|
-
The root cause is
|
|
96
|
-
|
|
97
|
-
Format:
|
|
96
|
+
The root cause is one sentence: **WHY this happened**, not WHAT happened.
|
|
98
97
|
|
|
99
98
|
```
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
Example:
|
|
103
|
-
✅ "JWT verification was skipped when the Authorization header used 'bearer' (lowercase),
|
|
104
|
-
because the header check was case-sensitive."
|
|
99
|
+
✅ "JWT verification was skipped when Authorization header used lowercase 'bearer'
|
|
100
|
+
because the header check was case-sensitive"
|
|
105
101
|
|
|
106
|
-
❌ "The
|
|
102
|
+
❌ "The API returned 401" — This is the symptom, not the root cause
|
|
107
103
|
```
|
|
108
104
|
|
|
109
105
|
---
|
|
@@ -111,86 +107,59 @@ Example:
|
|
|
111
107
|
## Step 5 — Fix + Regression Prevention
|
|
112
108
|
|
|
113
109
|
```
|
|
114
|
-
Targeted fix:
|
|
115
|
-
Regression test: A specific test
|
|
116
|
-
Similar patterns:
|
|
110
|
+
Targeted fix: The minimum change that eliminates the root cause
|
|
111
|
+
Regression test: A specific test that will catch this exact failure if it returns
|
|
112
|
+
Similar patterns: Other locations in the codebase to audit for the same issue
|
|
113
|
+
Debug cleanup: All console.log/temporary changes removed from proposed fix
|
|
117
114
|
```
|
|
118
115
|
|
|
119
|
-
> ⚠️ All debug logging added during investigation must be removed before the fix is presented.
|
|
120
|
-
|
|
121
116
|
---
|
|
122
117
|
|
|
123
118
|
## Debug Report Format
|
|
124
119
|
|
|
125
120
|
```
|
|
126
|
-
━━━ Debug Report
|
|
121
|
+
━━━ Debug Report ━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
127
122
|
|
|
128
|
-
Symptom: [what the user
|
|
129
|
-
Error: [exact message
|
|
123
|
+
Symptom: [what the user observes]
|
|
124
|
+
Error: [exact message / stack trace]
|
|
130
125
|
Reproduced: Yes | No | Sometimes — [conditions]
|
|
131
|
-
Environment: [
|
|
132
|
-
Last working: [commit / date
|
|
133
|
-
|
|
134
|
-
━━━ Evidence Collected ━━━━━━━━━━━━━━━━
|
|
126
|
+
Environment: [Node v22, Next.js 15, PostgreSQL 16]
|
|
127
|
+
Last working: [commit hash / date]
|
|
135
128
|
|
|
129
|
+
━━━ Evidence ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
136
130
|
- [specific observation 1]
|
|
137
131
|
- [specific observation 2]
|
|
138
132
|
|
|
139
|
-
━━━ Hypotheses
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
H2 [Medium] — [cause and why it's possible]
|
|
143
|
-
H3 [Low] — [cause and why it's a stretch]
|
|
133
|
+
━━━ Hypotheses ━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
134
|
+
H1 [High] — [cause and reasoning]
|
|
135
|
+
H2 [Medium] — [cause and reasoning]
|
|
144
136
|
|
|
145
|
-
━━━ Investigation
|
|
137
|
+
━━━ Investigation ━━━━━━━━━━━━━━━━━━━━━━━
|
|
138
|
+
H1: [what was tested] → ✅ Confirmed root cause
|
|
139
|
+
H2: [what was tested] → ❌ Ruled out — [reason]
|
|
146
140
|
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
━━━ Root Cause ━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
142
|
+
[Single sentence WHY — not WHAT]
|
|
149
143
|
|
|
150
|
-
━━━
|
|
144
|
+
━━━ Fix ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
145
|
+
Before: [original code]
|
|
146
|
+
After: [corrected code]
|
|
151
147
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
━━━ Fix ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
155
|
-
|
|
156
|
-
Before: [original code]
|
|
157
|
-
After: [corrected code]
|
|
158
|
-
|
|
159
|
-
Regression test: [what test prevents this from recurring]
|
|
160
|
-
Similar patterns: [any other locations to check in the codebase]
|
|
148
|
+
Regression test: [test preventing recurrence]
|
|
149
|
+
Similar patterns: [other locations to check]
|
|
161
150
|
```
|
|
162
151
|
|
|
163
152
|
---
|
|
164
153
|
|
|
165
154
|
## Hallucination Guard
|
|
166
155
|
|
|
167
|
-
- Every hypothesis is **explicitly labeled as a hypothesis** — never as confirmed fact until evidence backs it
|
|
168
|
-
- Proposed fixes only use **real, documented APIs** — `// VERIFY: check method exists` on any uncertain call
|
|
169
|
-
- **One change per fix** — multi-file rewrites presented as "a debug session" are a red flag
|
|
170
|
-
- Debug logging added during investigation must be **removed** before the fix is presented
|
|
171
|
-
- **Never assume the error message is accurate** — verify it matches actual behavior
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## Cross-Workflow Navigation
|
|
176
|
-
|
|
177
|
-
| After /debug reveals... | Go to |
|
|
178
|
-
|---|---|
|
|
179
|
-
| Root cause confirmed, fix ready | `/generate` to write the fix safely through Tribunal |
|
|
180
|
-
| Multiple files need changing | `/enhance` for impact-zone analysis + callers update |
|
|
181
|
-
| Missing test allowed the bug in | `/test` to add regression coverage |
|
|
182
|
-
| Performance was the root cause | `/tribunal-performance` for full optimization review |
|
|
183
|
-
| Security vulnerability found | `/audit` to check if it exists elsewhere |
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## Usage
|
|
188
|
-
|
|
189
156
|
```
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
157
|
+
❌ Never propose a fix before root cause is confirmed with evidence
|
|
158
|
+
❌ Never test two hypotheses simultaneously
|
|
159
|
+
❌ Never propose a "rewrite" as a debug session
|
|
160
|
+
❌ Never leave console.log in the proposed fix
|
|
161
|
+
❌ Never assume the error message accurately describes the actual cause
|
|
162
|
+
❌ Never use real API methods without verifying they exist in this version
|
|
196
163
|
```
|
|
164
|
+
|
|
165
|
+
---
|
|
@@ -1,153 +1,180 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Production deployment command. Runs pre-flight safety checks (tests, type-check, lint, security, build), creates a rollback baseline, confirms Human Gate, then executes deployment. Requires explicit human approval before going live.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# /deploy — Production
|
|
5
|
+
# /deploy — Production Deployment
|
|
6
6
|
|
|
7
7
|
$ARGUMENTS
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## The Deployment Contract
|
|
12
|
+
|
|
13
|
+
"Production is the only environment that matters. Every deployment is a risk event."
|
|
14
|
+
Every step is logged. Every step has a rollback path. No surprises.
|
|
12
15
|
|
|
13
16
|
---
|
|
14
17
|
|
|
15
|
-
##
|
|
18
|
+
## When to Use /deploy
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
|Use `/deploy` when...|Do NOT deploy when...|
|
|
21
|
+
|:---|:---|
|
|
22
|
+
|All pre-flight checks pass|Any pre-flight check fails|
|
|
23
|
+
|Changes are reviewed and approved|In the middle of a debug session|
|
|
24
|
+
|You have a rollback plan|No tests run since last change|
|
|
25
|
+
|Non-peak traffic hours (if possible)|Security audit shows critical issues|
|
|
19
26
|
|
|
20
27
|
---
|
|
21
28
|
|
|
22
|
-
##
|
|
29
|
+
## Phase 1 — Pre-Flight Checks (ALL Must Pass)
|
|
23
30
|
|
|
24
|
-
|
|
31
|
+
**If ANY check in Phase 1 fails → deployment is BLOCKED.**
|
|
25
32
|
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
□ All tests pass on the current commit
|
|
29
|
-
□ CHANGELOG.md is updated
|
|
30
|
-
□ Environment variables are confirmed in the target environment
|
|
31
|
-
□ Database migrations (if any) have a rollback plan
|
|
32
|
-
□ Rollback target (tag or SHA) is documented
|
|
33
|
-
```
|
|
33
|
+
```bash
|
|
34
|
+
# T-minus safety sequence (in exact order)
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
# 1. Security: halt on critical
|
|
37
|
+
python .agent/scripts/security_scan.py . --level=critical
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
# 2. Dependencies: no exploitable CVEs
|
|
40
|
+
npm audit --audit-level=high
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
# 3. Type safety: zero errors allowed
|
|
43
|
+
npx tsc --noEmit
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
# 4. Tests: all must pass
|
|
46
|
+
npm test
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
✅ No debug endpoints left active
|
|
49
|
-
✅ No `console.log` with sensitive data
|
|
48
|
+
# 5. Build: production build must succeed
|
|
49
|
+
npm run build
|
|
50
|
+
|
|
51
|
+
# 6. Lint: blocking errors halt deployment
|
|
52
|
+
npm run lint --max-warnings=0
|
|
50
53
|
```
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
**Pre-Flight Report:**
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
━━━ Pre-Flight Status ━━━━━━━━━━━━━━━━━━━━━
|
|
59
|
+
|
|
60
|
+
Security: ✅ CLEAR | ❌ BLOCKED ([finding])
|
|
61
|
+
npm audit: ✅ CLEAR | ❌ BLOCKED ([CVE])
|
|
62
|
+
TypeScript: ✅ ZERO ERRORS | ❌ BLOCKED (N errors)
|
|
63
|
+
Tests: ✅ ALL PASS | ❌ BLOCKED (N failing)
|
|
64
|
+
Build: ✅ SUCCESS | ❌ BLOCKED (build error)
|
|
65
|
+
Linting: ✅ CLEAN | ⚠️ WARNINGS (N) | ❌ BLOCKING ERRORS (N)
|
|
55
66
|
```
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
---
|
|
58
69
|
|
|
59
|
-
|
|
70
|
+
## Phase 2 — Rollback Baseline
|
|
60
71
|
|
|
61
|
-
|
|
72
|
+
Before deployment, capture the rollback state:
|
|
62
73
|
|
|
63
74
|
```bash
|
|
64
|
-
#
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
```
|
|
75
|
+
# Option A: Git baseline
|
|
76
|
+
git rev-parse HEAD # Record current commit hash
|
|
77
|
+
# Rollback: git revert HEAD or git reset --hard [hash]
|
|
68
78
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
# Option B: Tag the current release
|
|
80
|
+
git tag release-$(date +%Y%m%d-%H%M%S)
|
|
81
|
+
git push origin --tags
|
|
82
|
+
|
|
83
|
+
# Option C: Database snapshot (if schema changed)
|
|
84
|
+
pg_dump $DATABASE_URL > backup-$(date +%Y%m%d-%H%M%S).sql
|
|
74
85
|
```
|
|
75
86
|
|
|
76
|
-
**
|
|
87
|
+
**Rollback baseline must be confirmed before deployment begins.**
|
|
77
88
|
|
|
78
|
-
|
|
89
|
+
---
|
|
79
90
|
|
|
80
|
-
|
|
91
|
+
## Phase 3 — Human Gate (Non-Negotiable)
|
|
92
|
+
|
|
93
|
+
After pre-flight passes, present to the deployer:
|
|
81
94
|
|
|
82
95
|
```
|
|
83
|
-
━━━
|
|
84
|
-
Target: [staging | production]
|
|
85
|
-
Commit: [SHA — first 8 chars]
|
|
86
|
-
Files changed: [N] — view diff?
|
|
87
|
-
Security gate: ✅ Passed (no CRITICAL/HIGH issues)
|
|
88
|
-
Tribunal gate: ✅ All reviewers APPROVED
|
|
89
|
-
Tests: ✅ [N] passed, [0] failed
|
|
90
|
-
|
|
91
|
-
Rollback to: [previous tag or commit SHA]
|
|
92
|
-
Rollback time: [estimate in minutes]
|
|
93
|
-
DB migration: [None | ⚠️ IRREVERSIBLE | ✅ Reversible]
|
|
94
|
-
DB backup: [Confirmed | Not confirmed — deployment blocked]
|
|
95
|
-
|
|
96
|
-
Proceed with deployment? Y = execute | N = cancel
|
|
97
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
98
|
-
```
|
|
96
|
+
━━━ Deployment Approval Required ━━━━━━━━━━━━━━
|
|
99
97
|
|
|
100
|
-
|
|
98
|
+
Target environment: [production | staging]
|
|
99
|
+
Changes in this deploy:
|
|
100
|
+
[commit summary: feat/fix/chore + description]
|
|
101
|
+
[number of files changed]
|
|
101
102
|
|
|
102
|
-
|
|
103
|
+
Database changes: [Yes: describe migration | None]
|
|
104
|
+
Breaking changes: [Yes: describe | None]
|
|
103
105
|
|
|
104
|
-
|
|
106
|
+
Pre-flight: ✅ ALL CHECKS PASSED
|
|
105
107
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Who gets notified on rollback? → [name or Slack channel]
|
|
108
|
+
Rollback baseline: Commit [hash] tagged as [release-name]
|
|
109
|
+
Rollback command: git reset --hard [hash]
|
|
110
|
+
|
|
111
|
+
Deploy? Y = proceed | N = abort | W = wait (deploy later)
|
|
111
112
|
```
|
|
112
113
|
|
|
113
|
-
**
|
|
114
|
+
**Nothing is deployed without explicit "Y" from the human.**
|
|
114
115
|
|
|
115
116
|
---
|
|
116
117
|
|
|
117
|
-
##
|
|
118
|
+
## Phase 4 — Deployment Execution
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Deploy (platform-specific — auto-detected from project config)
|
|
122
|
+
|
|
123
|
+
# → Render + GitHub Actions:
|
|
124
|
+
git push origin main # CI/CD deploys automatically
|
|
118
125
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
126
|
+
# → Manual Fly.io:
|
|
127
|
+
flyctl deploy --strategy rolling
|
|
128
|
+
|
|
129
|
+
# → Manual Kubernetes:
|
|
130
|
+
kubectl set image deployment/api api=[registry]/app:[commit-sha]
|
|
131
|
+
kubectl rollout status deployment/api
|
|
132
|
+
```
|
|
124
133
|
|
|
125
134
|
---
|
|
126
135
|
|
|
127
|
-
##
|
|
136
|
+
## Phase 5 — Post-Deploy Verification
|
|
128
137
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
Within 5 minutes of deployment completing:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Health check
|
|
142
|
+
curl -f https://api.yoursite.com/health # Must return 200
|
|
143
|
+
curl -f https://yoursite.com # Must load
|
|
144
|
+
curl -f https://yoursite.com/api/auth/session # Auth must work
|
|
145
|
+
|
|
146
|
+
# Monitor error rate (5 minutes)
|
|
147
|
+
# If error rate > 1% above baseline → initiate rollback immediately
|
|
148
|
+
```
|
|
133
149
|
|
|
134
150
|
---
|
|
135
151
|
|
|
136
|
-
##
|
|
152
|
+
## Rollback Decision Tree
|
|
137
153
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
154
|
+
```
|
|
155
|
+
After deploy, within 5 minutes:
|
|
156
|
+
├── Error rate normal + health checks pass → ✅ Deployment successful
|
|
157
|
+
├── Error rate elevated but < 1% above baseline → ⚠️ Monitor for 10 more minutes
|
|
158
|
+
├── Error rate > 1% above baseline → ❌ ROLLBACK IMMEDIATELY
|
|
159
|
+
└── Health check fails → ❌ ROLLBACK IMMEDIATELY
|
|
160
|
+
|
|
161
|
+
Rollback command:
|
|
162
|
+
git reset --hard [baseline-commit]
|
|
163
|
+
git push origin main --force-with-lease
|
|
164
|
+
```
|
|
144
165
|
|
|
145
166
|
---
|
|
146
167
|
|
|
147
|
-
##
|
|
168
|
+
## Schema Change Deployment Pattern
|
|
169
|
+
|
|
170
|
+
If this deploy includes database migrations:
|
|
148
171
|
|
|
149
172
|
```
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
173
|
+
1. Deploy migration in isolation (no application code change)
|
|
174
|
+
2. Verify migration succeeded and DB is healthy
|
|
175
|
+
3. THEN deploy application code that uses new schema
|
|
153
176
|
```
|
|
177
|
+
|
|
178
|
+
**Never deploy application code and schema changes in the same deployment.**
|
|
179
|
+
|
|
180
|
+
---
|