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,139 +1,128 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Add or update features in existing
|
|
2
|
+
description: Add or update features in existing applications. Performs impact analysis before any code change β identifies all dependents, detects breaking changes, generates Tribunal-reviewed modifications. No change is written to disk without Human Gate approval.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# /enhance β
|
|
5
|
+
# /enhance β Feature Addition & Modification
|
|
6
6
|
|
|
7
7
|
$ARGUMENTS
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## When to Use /enhance
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
| Adding to working, existing code | Building from scratch β `/create` |
|
|
20
|
-
| Extending a function or module | Restructuring without new behavior β `/refactor` |
|
|
21
|
-
| Adding a new endpoint to an existing API | Fixing a broken behavior β `/debug` |
|
|
22
|
-
| Upgrading a component's capabilities | Auditing for problems β `/review` |
|
|
13
|
+
|Use `/enhance` when...|Use something else when...|
|
|
14
|
+
|:---|:---|
|
|
15
|
+
|Adding a feature to an existing codebase|Starting from scratch β `/create`|
|
|
16
|
+
|Changing existing behavior|Fixing a bug β `/debug`|
|
|
17
|
+
|Iterating on a recently created feature|Full architecture review β `/plan`|
|
|
18
|
+
|Extending an existing API or component|Performance problems β `/tribunal-performance`|
|
|
23
19
|
|
|
24
20
|
---
|
|
25
21
|
|
|
26
|
-
##
|
|
22
|
+
## Phase 1 β Impact Analysis (MANDATORY Before Any Change)
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
> Never modify a function without checking what calls it.
|
|
24
|
+
Before writing any code, map what will be affected:
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
```bash
|
|
27
|
+
# What does the target file import?
|
|
28
|
+
head -30 [target-file] # Read all imports at the top
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
# Who imports the target file? (callers)
|
|
31
|
+
grep -r "from '.*target-module'" src/ --include="*.ts" --include="*.tsx"
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
# Who references the specific function/type being changed?
|
|
34
|
+
grep -r "targetFunction\|TargetType" src/ --include="*.ts" --include="*.tsx"
|
|
35
|
+
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
**Risk Classification:**
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
|File import count|Risk Level|Required Action|
|
|
40
|
+
|:---|:---|:---|
|
|
41
|
+
|0β2 importers|Low|Normal Tribunal review|
|
|
42
|
+
|3β5 importers|Medium|List all affected files in plan|
|
|
43
|
+
|6+ importers|High|Full dependency map + staged rollout|
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
Files to change: [list β explicit, not "etc."]
|
|
43
|
-
Functions affected: [list β every function being modified]
|
|
44
|
-
Callers of those: [list β these must remain unbroken]
|
|
45
|
-
Tests covering them: [list β these must pass after the change]
|
|
46
|
-
Exported symbols: [list β any public API that must stay compatible]
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
> β οΈ If the impact zone spans more than 10 files, pause and confirm scope with the user before proceeding.
|
|
45
|
+
---
|
|
50
46
|
|
|
51
|
-
|
|
47
|
+
## Phase 2 β Breaking Change Detection
|
|
52
48
|
|
|
53
49
|
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
Changes that BREAK existing callers:
|
|
51
|
+
β‘ Removing or renaming exported function/type/component
|
|
52
|
+
β‘ Adding required (non-optional) parameter to existing function
|
|
53
|
+
β‘ Changing a parameter type to incompatible type
|
|
54
|
+
β‘ Changing return type to incompatible type
|
|
55
|
+
β‘ Database schema changes (remove column, rename column, change type)
|
|
56
|
+
β‘ API contract changes (removing fields from response)
|
|
57
|
+
|
|
58
|
+
Changes that DON'T break callers:
|
|
59
|
+
β‘ Adding optional parameter with default value
|
|
60
|
+
β‘ Adding new exported function (existing callers unaffected)
|
|
61
|
+
β‘ Adding nullable column to DB schema
|
|
62
|
+
β‘ Widening return type (e.g., T β T | null)
|
|
63
|
+
β‘ Internal implementation changes with same interface
|
|
57
64
|
```
|
|
58
65
|
|
|
59
|
-
|
|
66
|
+
If any breaking changes are detected β document them in the plan before proceeding.
|
|
60
67
|
|
|
61
|
-
|
|
68
|
+
---
|
|
62
69
|
|
|
63
|
-
|
|
64
|
-
|---|---|
|
|
65
|
-
| Backend logic / API change | `/tribunal-backend` |
|
|
66
|
-
| Frontend / UI component | `/tribunal-frontend` |
|
|
67
|
-
| DB queries or schema | `/tribunal-database` |
|
|
68
|
-
| Cross-domain change | `/tribunal-full` |
|
|
69
|
-
| Mobile UI component | `/tribunal-mobile` |
|
|
70
|
-
| Performance-critical path | `/tribunal-performance` |
|
|
70
|
+
## Phase 3 β Enhancement Plan
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
```markdown
|
|
73
|
+
## Enhancement: [Feature Name]
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
Scope: [what is changing]
|
|
76
|
+
Impact zone: [N files affected]
|
|
77
|
+
Breaking changes: [Yes: list | None detected]
|
|
75
78
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
β‘ TypeScript / lint: check passes after the enhancement
|
|
79
|
+
Changes:
|
|
80
|
+
1. [file-a.ts] β [what changes and why]
|
|
81
|
+
2. [file-b.ts] β [downstream update required because...]
|
|
82
|
+
3. [file-c.test.ts] β [test updates required]
|
|
81
83
|
```
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
**Human Gate:** Plan presented before any editing begins.
|
|
84
86
|
|
|
85
87
|
---
|
|
86
88
|
|
|
87
|
-
##
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
Enhancement: [What was added or changed, in one sentence]
|
|
91
|
-
|
|
92
|
-
Impact Zone:
|
|
93
|
-
Changed: [files modified]
|
|
94
|
-
Callers updated: [files updated, or "none β interface preserved"]
|
|
89
|
+
## Phase 4 β Tribunal-Reviewed Implementation
|
|
95
90
|
|
|
96
|
-
Tribunal
|
|
97
|
-
[reviewer]: [APPROVED | REJECTED β reason]
|
|
91
|
+
Each file change goes through the Tribunal pipeline:
|
|
98
92
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
Changes:
|
|
105
|
-
[diff or before/after]
|
|
93
|
+
```
|
|
94
|
+
logic-reviewer: runs on every change
|
|
95
|
+
security-auditor: runs on every change
|
|
96
|
+
[domain-specific]: activated based on change type
|
|
106
97
|
```
|
|
107
98
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
## Hallucination Guard
|
|
111
|
-
|
|
112
|
-
- **Read existing code before describing it** β never assume what a function does from its name
|
|
113
|
-
- **Preserved interfaces must stay identical** β adding a required parameter breaks every caller silently
|
|
114
|
-
- **Unknown patterns get `// VERIFY`** β never guess at a codebase convention or framework behavior
|
|
115
|
-
- **Never delete or rename an export** without verifying all import sites are updated
|
|
116
|
-
- **`// VERIFY: check method exists`** on any method call not seen in existing code or official docs
|
|
99
|
+
**NEVER modify files outside the defined impact zone without approval.**
|
|
117
100
|
|
|
118
101
|
---
|
|
119
102
|
|
|
120
|
-
##
|
|
103
|
+
## Phase 5 β Consistency Verification
|
|
104
|
+
|
|
105
|
+
After all changes:
|
|
121
106
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
107
|
+
```
|
|
108
|
+
β‘ npx tsc --noEmit β zero new TypeScript errors
|
|
109
|
+
β‘ npm test β all existing tests still pass
|
|
110
|
+
β‘ New tests written for the new behavior
|
|
111
|
+
β‘ API response contracts verified not to have changed unexpectedly
|
|
112
|
+
β‘ Database migration (if schema changed) runs cleanly
|
|
113
|
+
```
|
|
128
114
|
|
|
129
115
|
---
|
|
130
116
|
|
|
131
|
-
##
|
|
117
|
+
## Enhancement Guard
|
|
132
118
|
|
|
133
119
|
```
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
120
|
+
β Never modify files outside the documented impact zone without re-running Impact Analysis
|
|
121
|
+
β Never add a required parameter without updating all callers
|
|
122
|
+
β Never rename an exported symbol without grepping all callers first
|
|
123
|
+
β Never change a DB column without an expand-and-contract migration plan
|
|
124
|
+
β Never update package versions silently β show in plan
|
|
125
|
+
β Never "fix other things while we're here" β scope creep
|
|
139
126
|
```
|
|
127
|
+
|
|
128
|
+
---
|
package/.agent/workflows/fix.md
CHANGED
|
@@ -1,143 +1,114 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Auto-fix known issues with lint, formatting, imports, and TypeScript errors. Human approval required before applying.
|
|
2
|
+
description: Auto-fix known issues with lint, formatting, imports, and TypeScript errors. Runs lint_runner.py and auto-fixers. Human approval required before applying any changes. Shows a diff of what will change before writing to disk.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# /fix β Automated
|
|
5
|
+
# /fix β Automated Error Resolution
|
|
6
6
|
|
|
7
7
|
$ARGUMENTS
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## When to Use /fix
|
|
12
|
+
|
|
13
|
+
|Use `/fix` when...|Use something else when...|
|
|
14
|
+
|:---|:---|
|
|
15
|
+
|Lint errors blocking CI|Logic bugs β `/debug`|
|
|
16
|
+
|TypeScript type errors|Feature changes needed β `/enhance`|
|
|
17
|
+
|Formatting inconsistencies|Security vulnerabilities β `/tribunal-backend`|
|
|
18
|
+
|Missing imports auto-detectable|Structural changes β `/refactor`|
|
|
19
|
+
|After a dependency version upgrade breaks types||
|
|
12
20
|
|
|
13
21
|
---
|
|
14
22
|
|
|
15
|
-
##
|
|
23
|
+
## What /fix Handles (Auto-Fixable)
|
|
16
24
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
```
|
|
26
|
+
β
AUTO-FIXABLE:
|
|
27
|
+
β ESLint β eslint --fix (formatting, unused imports, style)
|
|
28
|
+
β Prettier β prettier --write (spacing, quotes, semicolons)
|
|
29
|
+
β TypeScript β add missing required imports visible from types
|
|
30
|
+
β Tailwind β class ordering (prettier-plugin-tailwindcss)
|
|
31
|
+
β npm audit β npm audit fix (non-breaking dependency patches)
|
|
32
|
+
|
|
33
|
+
β οΈ REQUIRES HUMAN DECISION:
|
|
34
|
+
β TypeScript strict mode errors (may require type narrowing by developer)
|
|
35
|
+
β Breaking API changes after major version bump
|
|
36
|
+
β Logic errors flagged by ESLint (not just style)
|
|
37
|
+
β Security vulnerabilities (audit fix --force changes major versions)
|
|
38
|
+
```
|
|
23
39
|
|
|
24
40
|
---
|
|
25
41
|
|
|
26
|
-
##
|
|
27
|
-
|
|
28
|
-
### Stage 1 β Dry Run (Always First)
|
|
29
|
-
|
|
30
|
-
Before fixing anything, show what would change:
|
|
42
|
+
## Execution Sequence
|
|
31
43
|
|
|
32
44
|
```bash
|
|
33
|
-
#
|
|
34
|
-
// turbo
|
|
45
|
+
# 1. Run lint with auto-fix
|
|
35
46
|
python .agent/scripts/lint_runner.py . --fix
|
|
36
47
|
|
|
37
|
-
#
|
|
38
|
-
|
|
39
|
-
npx prettier --check .
|
|
40
|
-
|
|
41
|
-
# TypeScript errors (does not auto-fix β reports only)
|
|
42
|
-
// turbo
|
|
43
|
-
npx tsc --noEmit
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Present the dry run results to the user before touching anything:
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
π Auto-fixable issues found:
|
|
50
|
-
- ESLint: 12 fixable issues across 5 files
|
|
51
|
-
- Prettier: 8 files would be reformatted
|
|
52
|
-
- TypeScript: 3 unused imports (auto-fixable)
|
|
53
|
-
- TypeScript: 2 type errors (require manual fix β see below)
|
|
48
|
+
# 2. Fix remaining TypeScript errors (auto-detectable only)
|
|
49
|
+
npx tsc --noEmit 2>&1 | grep "error TS"
|
|
54
50
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- src/db/queries.ts line 12: Property 'userId' does not exist
|
|
51
|
+
# 3. Format all files
|
|
52
|
+
npx prettier --write "src/**/*.{ts,tsx,js,json,css}"
|
|
58
53
|
|
|
59
|
-
|
|
54
|
+
# 4. Check npm audit (report, don't auto-fix without approval)
|
|
55
|
+
npm audit --audit-level=high
|
|
60
56
|
```
|
|
61
57
|
|
|
62
|
-
> βΈοΈ **Human Gate** β never apply fixes without explicit user approval.
|
|
63
|
-
|
|
64
58
|
---
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Run fixers in this order (order matters β ESLint first prevents Prettier from undoing logic changes):
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
# Step 1: ESLint logic fixes
|
|
72
|
-
npx eslint . --fix
|
|
60
|
+
## Human Gate β Review Diff Before Applying
|
|
73
61
|
|
|
74
|
-
|
|
75
|
-
npx prettier --write .
|
|
62
|
+
After running fixers:
|
|
76
63
|
|
|
77
|
-
# Step 3: Import sorting (if configured)
|
|
78
|
-
npx organize-imports-cli tsconfig.json
|
|
79
64
|
```
|
|
65
|
+
βββ Fix Preview βββββββββββββββββββββββββββ
|
|
80
66
|
|
|
81
|
-
|
|
67
|
+
Files that will change:
|
|
68
|
+
src/components/Button.tsx (lint: 3 unused imports removed)
|
|
69
|
+
src/lib/auth.ts (lint: missing semicolons, trailing whitespace)
|
|
70
|
+
src/app/api/users/route.ts (prettier: formatting)
|
|
82
71
|
|
|
83
|
-
|
|
72
|
+
Diff preview:
|
|
73
|
+
--- src/components/Button.tsx
|
|
74
|
+
+++ src/components/Button.tsx
|
|
75
|
+
- import { useState, useEffect, useCallback } from 'react'; // useEffect unused
|
|
76
|
+
+ import { useState, useCallback } from 'react';
|
|
84
77
|
|
|
85
|
-
|
|
86
|
-
# Full lint must be clean after auto-fix
|
|
87
|
-
// turbo
|
|
88
|
-
python .agent/scripts/lint_runner.py .
|
|
78
|
+
βββ Remaining Errors (Need Human Review) βββ
|
|
89
79
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
python .agent/scripts/test_runner.py .
|
|
80
|
+
src/lib/payment.ts:34 β TS2345: Argument of type 'string | null' not assignable to 'string'
|
|
81
|
+
β This requires deliberate type narrowing β cannot auto-fix safely
|
|
93
82
|
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
βββ Human Gate ββββββββββββββββββββββββββββ
|
|
84
|
+
Apply auto-fixes? Y = write to disk | N = discard | S = select specific files
|
|
96
85
|
```
|
|
97
86
|
|
|
98
|
-
|
|
87
|
+
**No files are written without explicit "Y" approval.**
|
|
99
88
|
|
|
100
89
|
---
|
|
101
90
|
|
|
102
|
-
##
|
|
91
|
+
## Fix Guard
|
|
103
92
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
These are reported but left for human resolution. Auto-fix never attempts these.
|
|
93
|
+
```
|
|
94
|
+
β Never run --force on npm audit fix without human approval (can break major APIs)
|
|
95
|
+
β Never auto-fix TypeScript errors that require business logic decisions
|
|
96
|
+
β Never apply lint fixes to generated test files without human review
|
|
97
|
+
β Never "fix" ESLint disable comments β they may be intentional suppressions
|
|
98
|
+
β Never mix fix + refactoring in the same run
|
|
99
|
+
```
|
|
113
100
|
|
|
114
101
|
---
|
|
115
102
|
|
|
116
|
-
##
|
|
117
|
-
|
|
118
|
-
1. **Never auto-fix without showing the diff first**
|
|
119
|
-
2. **Never fix and commit in one step** β user reviews the diff before any commit
|
|
120
|
-
3. **If a fix changes behavior** (not just formatting): flag it as `β οΈ This fix may change runtime behavior β review manually`
|
|
121
|
-
4. **Revert on test failure** β if tests fail after fixing, undo the fix and report which change caused it
|
|
122
|
-
5. **Never modify files in `node_modules` or generated output directories**
|
|
123
|
-
|
|
124
|
-
---
|
|
103
|
+
## After /fix β Verify
|
|
125
104
|
|
|
126
|
-
|
|
105
|
+
```bash
|
|
106
|
+
# Verify fixes didn't introduce new errors
|
|
107
|
+
npx tsc --noEmit # Must be clean
|
|
108
|
+
npm test # Must still all pass
|
|
109
|
+
npm run lint # Must be zero errors
|
|
110
|
+
```
|
|
127
111
|
|
|
128
|
-
|
|
129
|
-
|---|---|
|
|
130
|
-
| Lint is clean, ready for review | `/review [file]` for logic audit |
|
|
131
|
-
| TypeScript errors remain after lint fix | Address manually or use `/generate` for targeted rewrite |
|
|
132
|
-
| Pre-deploy cleanup complete | `/audit` for full project health check |
|
|
112
|
+
If any verification step fails after fixes β report and revert auto-fixes for that file.
|
|
133
113
|
|
|
134
114
|
---
|
|
135
|
-
|
|
136
|
-
## Usage
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
/fix lint errors in this project
|
|
140
|
-
/fix formatting across all files
|
|
141
|
-
/fix unused imports and variables
|
|
142
|
-
/fix all ESLint and Prettier issues before the PR
|
|
143
|
-
```
|