tribunal-kit 2.4.6 β†’ 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/.agent/ARCHITECTURE.md +99 -99
  2. package/.agent/GEMINI.md +52 -52
  3. package/.agent/agents/accessibility-reviewer.md +139 -86
  4. package/.agent/agents/ai-code-reviewer.md +160 -90
  5. package/.agent/agents/backend-specialist.md +164 -127
  6. package/.agent/agents/code-archaeologist.md +115 -73
  7. package/.agent/agents/database-architect.md +130 -110
  8. package/.agent/agents/debugger.md +137 -97
  9. package/.agent/agents/dependency-reviewer.md +78 -30
  10. package/.agent/agents/devops-engineer.md +161 -118
  11. package/.agent/agents/documentation-writer.md +151 -87
  12. package/.agent/agents/explorer-agent.md +117 -99
  13. package/.agent/agents/frontend-reviewer.md +127 -47
  14. package/.agent/agents/frontend-specialist.md +169 -109
  15. package/.agent/agents/game-developer.md +28 -164
  16. package/.agent/agents/logic-reviewer.md +87 -49
  17. package/.agent/agents/mobile-developer.md +151 -103
  18. package/.agent/agents/mobile-reviewer.md +133 -50
  19. package/.agent/agents/orchestrator.md +121 -110
  20. package/.agent/agents/penetration-tester.md +103 -77
  21. package/.agent/agents/performance-optimizer.md +136 -92
  22. package/.agent/agents/performance-reviewer.md +139 -69
  23. package/.agent/agents/product-manager.md +104 -70
  24. package/.agent/agents/product-owner.md +6 -25
  25. package/.agent/agents/project-planner.md +95 -95
  26. package/.agent/agents/qa-automation-engineer.md +174 -87
  27. package/.agent/agents/security-auditor.md +133 -129
  28. package/.agent/agents/seo-specialist.md +160 -99
  29. package/.agent/agents/sql-reviewer.md +132 -44
  30. package/.agent/agents/supervisor-agent.md +137 -109
  31. package/.agent/agents/swarm-worker-contracts.md +17 -17
  32. package/.agent/agents/swarm-worker-registry.md +46 -46
  33. package/.agent/agents/test-coverage-reviewer.md +132 -53
  34. package/.agent/agents/test-engineer.md +0 -21
  35. package/.agent/agents/type-safety-reviewer.md +143 -33
  36. package/.agent/patterns/generator.md +9 -9
  37. package/.agent/patterns/inversion.md +12 -12
  38. package/.agent/patterns/pipeline.md +9 -9
  39. package/.agent/patterns/reviewer.md +13 -13
  40. package/.agent/patterns/tool-wrapper.md +9 -9
  41. package/.agent/rules/GEMINI.md +63 -63
  42. package/.agent/scripts/__pycache__/auto_preview.cpython-311.pyc +0 -0
  43. package/.agent/scripts/__pycache__/bundle_analyzer.cpython-311.pyc +0 -0
  44. package/.agent/scripts/__pycache__/checklist.cpython-311.pyc +0 -0
  45. package/.agent/scripts/__pycache__/dependency_analyzer.cpython-311.pyc +0 -0
  46. package/.agent/scripts/__pycache__/security_scan.cpython-311.pyc +0 -0
  47. package/.agent/scripts/__pycache__/session_manager.cpython-311.pyc +0 -0
  48. package/.agent/scripts/__pycache__/skill_integrator.cpython-311.pyc +0 -0
  49. package/.agent/scripts/__pycache__/swarm_dispatcher.cpython-311.pyc +0 -0
  50. package/.agent/scripts/__pycache__/test_runner.cpython-311.pyc +0 -0
  51. package/.agent/scripts/__pycache__/verify_all.cpython-311.pyc +0 -0
  52. package/.agent/scripts/compress_skills.py +167 -0
  53. package/.agent/scripts/consolidate_skills.py +173 -0
  54. package/.agent/scripts/deep_compress.py +202 -0
  55. package/.agent/scripts/minify_context.py +80 -0
  56. package/.agent/scripts/security_scan.py +1 -1
  57. package/.agent/scripts/strip_tribunal.py +41 -0
  58. package/.agent/skills/agent-organizer/SKILL.md +60 -100
  59. package/.agent/skills/agentic-patterns/SKILL.md +0 -70
  60. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +108 -53
  61. package/.agent/skills/api-patterns/SKILL.md +197 -257
  62. package/.agent/skills/api-security-auditor/SKILL.md +125 -57
  63. package/.agent/skills/app-builder/SKILL.md +326 -50
  64. package/.agent/skills/app-builder/templates/SKILL.md +13 -15
  65. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +16 -16
  66. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +22 -22
  67. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +18 -18
  68. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +20 -20
  69. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +17 -17
  70. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +18 -18
  71. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +21 -21
  72. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +19 -19
  73. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +26 -26
  74. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +26 -26
  75. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +19 -19
  76. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +18 -18
  77. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +20 -20
  78. package/.agent/skills/appflow-wireframe/SKILL.md +71 -98
  79. package/.agent/skills/architecture/SKILL.md +161 -200
  80. package/.agent/skills/authentication-best-practices/SKILL.md +121 -54
  81. package/.agent/skills/bash-linux/SKILL.md +71 -166
  82. package/.agent/skills/behavioral-modes/SKILL.md +8 -69
  83. package/.agent/skills/brainstorming/SKILL.md +345 -127
  84. package/.agent/skills/building-native-ui/SKILL.md +125 -57
  85. package/.agent/skills/clean-code/SKILL.md +266 -149
  86. package/.agent/skills/code-review-checklist/SKILL.md +0 -62
  87. package/.agent/skills/config-validator/SKILL.md +73 -131
  88. package/.agent/skills/csharp-developer/SKILL.md +434 -73
  89. package/.agent/skills/database-design/SKILL.md +190 -275
  90. package/.agent/skills/deployment-procedures/SKILL.md +81 -158
  91. package/.agent/skills/devops-engineer/SKILL.md +255 -94
  92. package/.agent/skills/devops-incident-responder/SKILL.md +50 -69
  93. package/.agent/skills/doc.md +5 -5
  94. package/.agent/skills/documentation-templates/SKILL.md +19 -63
  95. package/.agent/skills/edge-computing/SKILL.md +75 -165
  96. package/.agent/skills/extract-design-system/SKILL.md +84 -58
  97. package/.agent/skills/framer-motion-expert/SKILL.md +195 -0
  98. package/.agent/skills/frontend-design/SKILL.md +151 -499
  99. package/.agent/skills/game-design-expert/SKILL.md +71 -0
  100. package/.agent/skills/game-engineering-expert/SKILL.md +88 -0
  101. package/.agent/skills/geo-fundamentals/SKILL.md +52 -178
  102. package/.agent/skills/github-operations/SKILL.md +197 -272
  103. package/.agent/skills/gsap-expert/SKILL.md +194 -0
  104. package/.agent/skills/i18n-localization/SKILL.md +60 -172
  105. package/.agent/skills/intelligent-routing/SKILL.md +123 -103
  106. package/.agent/skills/lint-and-validate/SKILL.md +8 -52
  107. package/.agent/skills/llm-engineering/SKILL.md +281 -195
  108. package/.agent/skills/local-first/SKILL.md +76 -159
  109. package/.agent/skills/mcp-builder/SKILL.md +48 -188
  110. package/.agent/skills/mobile-design/SKILL.md +213 -219
  111. package/.agent/skills/motion-engineering/SKILL.md +184 -0
  112. package/.agent/skills/nextjs-react-expert/SKILL.md +184 -203
  113. package/.agent/skills/nodejs-best-practices/SKILL.md +403 -185
  114. package/.agent/skills/observability/SKILL.md +211 -203
  115. package/.agent/skills/parallel-agents/SKILL.md +53 -146
  116. package/.agent/skills/performance-profiling/SKILL.md +171 -151
  117. package/.agent/skills/plan-writing/SKILL.md +49 -153
  118. package/.agent/skills/platform-engineer/SKILL.md +57 -103
  119. package/.agent/skills/playwright-best-practices/SKILL.md +110 -63
  120. package/.agent/skills/powershell-windows/SKILL.md +61 -179
  121. package/.agent/skills/python-patterns/SKILL.md +7 -35
  122. package/.agent/skills/python-pro/SKILL.md +273 -114
  123. package/.agent/skills/react-specialist/SKILL.md +227 -108
  124. package/.agent/skills/readme-builder/SKILL.md +15 -85
  125. package/.agent/skills/realtime-patterns/SKILL.md +216 -243
  126. package/.agent/skills/red-team-tactics/SKILL.md +10 -51
  127. package/.agent/skills/rust-pro/SKILL.md +525 -142
  128. package/.agent/skills/seo-fundamentals/SKILL.md +92 -153
  129. package/.agent/skills/server-management/SKILL.md +110 -166
  130. package/.agent/skills/shadcn-ui-expert/SKILL.md +154 -55
  131. package/.agent/skills/skill-creator/SKILL.md +18 -58
  132. package/.agent/skills/sql-pro/SKILL.md +543 -68
  133. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +28 -68
  134. package/.agent/skills/swiftui-expert/SKILL.md +124 -57
  135. package/.agent/skills/systematic-debugging/SKILL.md +49 -151
  136. package/.agent/skills/tailwind-patterns/SKILL.md +433 -149
  137. package/.agent/skills/tdd-workflow/SKILL.md +63 -169
  138. package/.agent/skills/test-result-analyzer/SKILL.md +33 -73
  139. package/.agent/skills/testing-patterns/SKILL.md +437 -130
  140. package/.agent/skills/trend-researcher/SKILL.md +30 -71
  141. package/.agent/skills/ui-ux-pro-max/SKILL.md +0 -41
  142. package/.agent/skills/ui-ux-researcher/SKILL.md +51 -91
  143. package/.agent/skills/vue-expert/SKILL.md +225 -119
  144. package/.agent/skills/vulnerability-scanner/SKILL.md +264 -226
  145. package/.agent/skills/web-accessibility-auditor/SKILL.md +141 -58
  146. package/.agent/skills/web-design-guidelines/SKILL.md +17 -61
  147. package/.agent/skills/webapp-testing/SKILL.md +71 -196
  148. package/.agent/skills/whimsy-injector/SKILL.md +58 -132
  149. package/.agent/skills/workflow-optimizer/SKILL.md +28 -68
  150. package/.agent/workflows/api-tester.md +96 -224
  151. package/.agent/workflows/audit.md +81 -122
  152. package/.agent/workflows/brainstorm.md +69 -105
  153. package/.agent/workflows/changelog.md +65 -97
  154. package/.agent/workflows/create.md +73 -88
  155. package/.agent/workflows/debug.md +80 -111
  156. package/.agent/workflows/deploy.md +119 -92
  157. package/.agent/workflows/enhance.md +80 -91
  158. package/.agent/workflows/fix.md +68 -97
  159. package/.agent/workflows/generate.md +165 -164
  160. package/.agent/workflows/migrate.md +106 -109
  161. package/.agent/workflows/orchestrate.md +103 -86
  162. package/.agent/workflows/performance-benchmarker.md +77 -268
  163. package/.agent/workflows/plan.md +120 -98
  164. package/.agent/workflows/preview.md +39 -96
  165. package/.agent/workflows/refactor.md +105 -97
  166. package/.agent/workflows/review-ai.md +63 -102
  167. package/.agent/workflows/review.md +71 -110
  168. package/.agent/workflows/session.md +53 -113
  169. package/.agent/workflows/status.md +42 -88
  170. package/.agent/workflows/strengthen-skills.md +90 -51
  171. package/.agent/workflows/swarm.md +114 -129
  172. package/.agent/workflows/test.md +125 -102
  173. package/.agent/workflows/tribunal-backend.md +60 -78
  174. package/.agent/workflows/tribunal-database.md +62 -100
  175. package/.agent/workflows/tribunal-frontend.md +62 -82
  176. package/.agent/workflows/tribunal-full.md +56 -100
  177. package/.agent/workflows/tribunal-mobile.md +65 -94
  178. package/.agent/workflows/tribunal-performance.md +62 -105
  179. package/.agent/workflows/ui-ux-pro-max.md +72 -121
  180. package/README.md +11 -15
  181. package/package.json +1 -1
  182. package/.agent/skills/api-patterns/api-style.md +0 -42
  183. package/.agent/skills/api-patterns/auth.md +0 -24
  184. package/.agent/skills/api-patterns/documentation.md +0 -26
  185. package/.agent/skills/api-patterns/graphql.md +0 -41
  186. package/.agent/skills/api-patterns/rate-limiting.md +0 -31
  187. package/.agent/skills/api-patterns/response.md +0 -37
  188. package/.agent/skills/api-patterns/rest.md +0 -40
  189. package/.agent/skills/api-patterns/security-testing.md +0 -122
  190. package/.agent/skills/api-patterns/trpc.md +0 -41
  191. package/.agent/skills/api-patterns/versioning.md +0 -22
  192. package/.agent/skills/app-builder/agent-coordination.md +0 -71
  193. package/.agent/skills/app-builder/feature-building.md +0 -53
  194. package/.agent/skills/app-builder/project-detection.md +0 -34
  195. package/.agent/skills/app-builder/scaffolding.md +0 -118
  196. package/.agent/skills/app-builder/tech-stack.md +0 -40
  197. package/.agent/skills/architecture/context-discovery.md +0 -43
  198. package/.agent/skills/architecture/examples.md +0 -94
  199. package/.agent/skills/architecture/pattern-selection.md +0 -68
  200. package/.agent/skills/architecture/patterns-reference.md +0 -50
  201. package/.agent/skills/architecture/trade-off-analysis.md +0 -77
  202. package/.agent/skills/brainstorming/dynamic-questioning.md +0 -360
  203. package/.agent/skills/database-design/database-selection.md +0 -43
  204. package/.agent/skills/database-design/indexing.md +0 -39
  205. package/.agent/skills/database-design/migrations.md +0 -48
  206. package/.agent/skills/database-design/optimization.md +0 -36
  207. package/.agent/skills/database-design/orm-selection.md +0 -30
  208. package/.agent/skills/database-design/schema-design.md +0 -56
  209. package/.agent/skills/dotnet-core-expert/SKILL.md +0 -103
  210. package/.agent/skills/framer-motion-animations/SKILL.md +0 -74
  211. package/.agent/skills/frontend-design/animation-guide.md +0 -331
  212. package/.agent/skills/frontend-design/color-system.md +0 -329
  213. package/.agent/skills/frontend-design/decision-trees.md +0 -418
  214. package/.agent/skills/frontend-design/motion-graphics.md +0 -306
  215. package/.agent/skills/frontend-design/typography-system.md +0 -363
  216. package/.agent/skills/frontend-design/ux-psychology.md +0 -1116
  217. package/.agent/skills/frontend-design/visual-effects.md +0 -383
  218. package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
  219. package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
  220. package/.agent/skills/game-development/SKILL.md +0 -236
  221. package/.agent/skills/game-development/game-art/SKILL.md +0 -185
  222. package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
  223. package/.agent/skills/game-development/game-design/SKILL.md +0 -129
  224. package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
  225. package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
  226. package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
  227. package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
  228. package/.agent/skills/game-development/web-games/SKILL.md +0 -150
  229. package/.agent/skills/intelligent-routing/router-manifest.md +0 -65
  230. package/.agent/skills/mobile-design/decision-trees.md +0 -516
  231. package/.agent/skills/mobile-design/mobile-backend.md +0 -491
  232. package/.agent/skills/mobile-design/mobile-color-system.md +0 -420
  233. package/.agent/skills/mobile-design/mobile-debugging.md +0 -122
  234. package/.agent/skills/mobile-design/mobile-design-thinking.md +0 -357
  235. package/.agent/skills/mobile-design/mobile-navigation.md +0 -458
  236. package/.agent/skills/mobile-design/mobile-performance.md +0 -767
  237. package/.agent/skills/mobile-design/mobile-testing.md +0 -356
  238. package/.agent/skills/mobile-design/mobile-typography.md +0 -433
  239. package/.agent/skills/mobile-design/platform-android.md +0 -666
  240. package/.agent/skills/mobile-design/platform-ios.md +0 -561
  241. package/.agent/skills/mobile-design/touch-psychology.md +0 -537
  242. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
  243. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
  244. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
  245. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
  246. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
  247. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
  248. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
  249. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
  250. package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
@@ -1,139 +1,128 @@
1
1
  ---
2
- description: Add or update features in existing application. Used for iterative development.
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 β€” Extend What Exists
5
+ # /enhance β€” Feature Addition & Modification
6
6
 
7
7
  $ARGUMENTS
8
8
 
9
9
  ---
10
10
 
11
- This command adds to or improves existing code **without breaking what already works**. Enhancement is not greenfield β€” the existing system shapes what can be done and how.
11
+ ## When to Use /enhance
12
12
 
13
- ---
14
-
15
- ## When to Use /enhance vs Other Commands
16
-
17
- | Use `/enhance` when... | Use something else when... |
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
- ## First Rule: Read, Then Write
22
+ ## Phase 1 β€” Impact Analysis (MANDATORY Before Any Change)
27
23
 
28
- > Never modify code you haven't read.
29
- > Never modify a function without checking what calls it.
24
+ Before writing any code, map what will be affected:
30
25
 
31
- The first step of every enhancement is a **reading pass** β€” not a writing pass.
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
- ## Enhancement Sequence
33
+ # Who references the specific function/type being changed?
34
+ grep -r "targetFunction\|TargetType" src/ --include="*.ts" --include="*.tsx"
35
+ ```
36
36
 
37
- ### Step 1 β€” Map the Impact Zone
37
+ **Risk Classification:**
38
38
 
39
- Before touching any file, produce this map:
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
- ### Step 2 β€” Define What Changes vs What Stays
47
+ ## Phase 2 β€” Breaking Change Detection
52
48
 
53
49
  ```
54
- Adding: [new capability being added]
55
- Modifying: [existing behavior being changed β€” explain why]
56
- Preserving: [things that must not change β€” API contracts, test expectations, response formats]
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
- Any change to a **public interface** (function signature, API response shape, exported type) triggers an update of **all callers** β€” not just the changed file.
66
+ If any breaking changes are detected β†’ document them in the plan before proceeding.
60
67
 
61
- ### Step 3 β€” Implement Through Tribunal Gate
68
+ ---
62
69
 
63
- | Enhancement Type | Tribunal Gate |
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
- The code goes through Tribunal **before** being shown to the user.
72
+ ```markdown
73
+ ## Enhancement: [Feature Name]
73
74
 
74
- ### Step 4 β€” Regression Safety Check
75
+ Scope: [what is changing]
76
+ Impact zone: [N files affected]
77
+ Breaking changes: [Yes: list | None detected]
75
78
 
76
- ```
77
- β–‘ Existing tests: still pass (none were broken by the change)
78
- β–‘ New tests added: covering the new behavior
79
- β–‘ Callers updated: if any interface changed, all callers are updated together
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
- All four must be true before the enhancement is considered complete.
85
+ **Human Gate:** Plan presented before any editing begins.
84
86
 
85
87
  ---
86
88
 
87
- ## Response Template
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 result:
97
- [reviewer]: [APPROVED | REJECTED β€” reason]
91
+ Each file change goes through the Tribunal pipeline:
98
92
 
99
- Regression risk:
100
- 🟒 Low β€” new path only, no existing path changed
101
- 🟑 Medium β€” shared code modified, callers reviewed and updated
102
- πŸ”΄ High β€” interface changed, all callers updated and verified
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
- ## Cross-Workflow Navigation
103
+ ## Phase 5 β€” Consistency Verification
104
+
105
+ After all changes:
121
106
 
122
- | If during /enhance you encounter... | Go to |
123
- |---|---|
124
- | Unexpected behavior in existing code | `/debug` to root-cause before changing anything |
125
- | Code quality so poor it needs restructuring | `/refactor` first, then come back to `/enhance` |
126
- | Security vulnerability in the code you're reading | `/audit` to determine blast radius |
127
- | Tests don't exist for the area being changed | `/test` first to establish a baseline |
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
- ## Usage
117
+ ## Enhancement Guard
132
118
 
133
119
  ```
134
- /enhance add pagination to the users list API endpoint
135
- /enhance add rate limiting to all authentication routes
136
- /enhance upgrade the search component to support filters
137
- /enhance add retry logic to the payment service's HTTP client
138
- /enhance extend the user model to support multiple email addresses
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
+ ---
@@ -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 Issue Resolution
5
+ # /fix β€” Automated Error Resolution
6
6
 
7
7
  $ARGUMENTS
8
8
 
9
9
  ---
10
10
 
11
- This command runs auto-fixable checks and applies corrections. **Every fix requires human approval** β€” nothing is written to disk without explicit confirmation.
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
- ## When to Use /fix vs Other Commands
23
+ ## What /fix Handles (Auto-Fixable)
16
24
 
17
- | Use `/fix` when... | Use something else when... |
18
- |---|---|
19
- | Lint reports many auto-fixable issues | Logic bugs β†’ `/debug` |
20
- | Formatting is inconsistent after a merge | Security vulnerabilities β†’ `/audit` |
21
- | Dependency upgrade changed import paths | TypeScript type errors β†’ `/generate` or manual fix |
22
- | Quick cleanup before a PR | Full project health check β†’ `/audit` |
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
- ## What Happens
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
- # Lint auto-fix dry run (show issues without applying)
34
- // turbo
45
+ # 1. Run lint with auto-fix
35
46
  python .agent/scripts/lint_runner.py . --fix
36
47
 
37
- # Prettier check (show files that would be reformatted)
38
- // turbo
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
- ⚠️ Manual fixes required (not auto-fixable):
56
- - src/auth/jwt.ts line 34: Type 'string | undefined' is not assignable to 'string'
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
- ⏸️ Proceed with auto-fix? [Y = apply | N = cancel]
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
- ### Stage 2 β€” Apply Fixes (After Approval)
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
- # Step 2: Prettier formatting
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
- ### Stage 3 β€” Verify After Fix
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
- ```bash
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
- # Tests must still pass (fixes should not change behavior)
91
- // turbo
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
- # Show git diff of all applied changes
95
- git diff --stat
83
+ ━━━ Human Gate ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
84
+ Apply auto-fixes? Y = write to disk | N = discard | S = select specific files
96
85
  ```
97
86
 
98
- If tests fail after auto-fix β†’ **revert immediately** and report which fix caused the failure.
87
+ **No files are written without explicit "Y" approval.**
99
88
 
100
89
  ---
101
90
 
102
- ## What This Does NOT Fix
91
+ ## Fix Guard
103
92
 
104
- | Issue type | Handled by |
105
- |---|---|
106
- | TypeScript type errors requiring logic changes | Manual fix or `/generate` |
107
- | Logic bugs | `/debug` |
108
- | Security vulnerabilities | `/audit` then `/generate` |
109
- | Test failures | `/debug` then `/test` |
110
- | Architecture issues | `/refactor` |
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
- ## Safety Rules
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
- ## Cross-Workflow Navigation
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
- | After /fix... | Go to |
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
- ```