tribunal-kit 1.0.0 โ†’ 2.4.2

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 (127) hide show
  1. package/.agent/.shared/ui-ux-pro-max/README.md +3 -3
  2. package/.agent/ARCHITECTURE.md +205 -10
  3. package/.agent/GEMINI.md +37 -7
  4. package/.agent/agents/accessibility-reviewer.md +134 -0
  5. package/.agent/agents/ai-code-reviewer.md +129 -0
  6. package/.agent/agents/frontend-specialist.md +3 -0
  7. package/.agent/agents/game-developer.md +21 -21
  8. package/.agent/agents/logic-reviewer.md +12 -0
  9. package/.agent/agents/mobile-reviewer.md +79 -0
  10. package/.agent/agents/orchestrator.md +56 -26
  11. package/.agent/agents/performance-reviewer.md +36 -0
  12. package/.agent/agents/supervisor-agent.md +156 -0
  13. package/.agent/agents/swarm-worker-contracts.md +166 -0
  14. package/.agent/agents/swarm-worker-registry.md +92 -0
  15. package/.agent/rules/GEMINI.md +134 -5
  16. package/.agent/scripts/bundle_analyzer.py +259 -0
  17. package/.agent/scripts/dependency_analyzer.py +247 -0
  18. package/.agent/scripts/lint_runner.py +188 -0
  19. package/.agent/scripts/patch_skills_meta.py +177 -0
  20. package/.agent/scripts/patch_skills_output.py +285 -0
  21. package/.agent/scripts/schema_validator.py +279 -0
  22. package/.agent/scripts/security_scan.py +224 -0
  23. package/.agent/scripts/session_manager.py +144 -3
  24. package/.agent/scripts/skill_integrator.py +234 -0
  25. package/.agent/scripts/strengthen_skills.py +220 -0
  26. package/.agent/scripts/swarm_dispatcher.py +317 -0
  27. package/.agent/scripts/test_runner.py +192 -0
  28. package/.agent/scripts/test_swarm_dispatcher.py +163 -0
  29. package/.agent/skills/agent-organizer/SKILL.md +132 -0
  30. package/.agent/skills/agentic-patterns/SKILL.md +335 -0
  31. package/.agent/skills/api-patterns/SKILL.md +226 -50
  32. package/.agent/skills/app-builder/SKILL.md +215 -52
  33. package/.agent/skills/architecture/SKILL.md +176 -31
  34. package/.agent/skills/bash-linux/SKILL.md +150 -134
  35. package/.agent/skills/behavioral-modes/SKILL.md +152 -160
  36. package/.agent/skills/brainstorming/SKILL.md +148 -101
  37. package/.agent/skills/brainstorming/dynamic-questioning.md +10 -0
  38. package/.agent/skills/clean-code/SKILL.md +139 -134
  39. package/.agent/skills/code-review-checklist/SKILL.md +177 -80
  40. package/.agent/skills/config-validator/SKILL.md +165 -0
  41. package/.agent/skills/csharp-developer/SKILL.md +107 -0
  42. package/.agent/skills/database-design/SKILL.md +252 -29
  43. package/.agent/skills/deployment-procedures/SKILL.md +122 -175
  44. package/.agent/skills/devops-engineer/SKILL.md +134 -0
  45. package/.agent/skills/devops-incident-responder/SKILL.md +98 -0
  46. package/.agent/skills/documentation-templates/SKILL.md +175 -121
  47. package/.agent/skills/dotnet-core-expert/SKILL.md +103 -0
  48. package/.agent/skills/edge-computing/SKILL.md +213 -0
  49. package/.agent/skills/frontend-design/SKILL.md +76 -0
  50. package/.agent/skills/frontend-design/color-system.md +18 -0
  51. package/.agent/skills/frontend-design/typography-system.md +18 -0
  52. package/.agent/skills/game-development/SKILL.md +69 -0
  53. package/.agent/skills/geo-fundamentals/SKILL.md +158 -99
  54. package/.agent/skills/github-operations/SKILL.md +354 -0
  55. package/.agent/skills/i18n-localization/SKILL.md +158 -96
  56. package/.agent/skills/intelligent-routing/SKILL.md +89 -285
  57. package/.agent/skills/intelligent-routing/router-manifest.md +65 -0
  58. package/.agent/skills/lint-and-validate/SKILL.md +229 -27
  59. package/.agent/skills/llm-engineering/SKILL.md +258 -0
  60. package/.agent/skills/local-first/SKILL.md +203 -0
  61. package/.agent/skills/mcp-builder/SKILL.md +159 -111
  62. package/.agent/skills/mobile-design/SKILL.md +102 -282
  63. package/.agent/skills/nextjs-react-expert/SKILL.md +143 -227
  64. package/.agent/skills/nodejs-best-practices/SKILL.md +201 -254
  65. package/.agent/skills/observability/SKILL.md +285 -0
  66. package/.agent/skills/parallel-agents/SKILL.md +124 -118
  67. package/.agent/skills/performance-profiling/SKILL.md +143 -89
  68. package/.agent/skills/plan-writing/SKILL.md +133 -97
  69. package/.agent/skills/platform-engineer/SKILL.md +135 -0
  70. package/.agent/skills/powershell-windows/SKILL.md +167 -104
  71. package/.agent/skills/python-patterns/SKILL.md +149 -361
  72. package/.agent/skills/python-pro/SKILL.md +114 -0
  73. package/.agent/skills/react-specialist/SKILL.md +107 -0
  74. package/.agent/skills/readme-builder/SKILL.md +270 -0
  75. package/.agent/skills/realtime-patterns/SKILL.md +296 -0
  76. package/.agent/skills/red-team-tactics/SKILL.md +136 -134
  77. package/.agent/skills/rust-pro/SKILL.md +237 -173
  78. package/.agent/skills/seo-fundamentals/SKILL.md +134 -82
  79. package/.agent/skills/server-management/SKILL.md +155 -104
  80. package/.agent/skills/sql-pro/SKILL.md +104 -0
  81. package/.agent/skills/systematic-debugging/SKILL.md +156 -79
  82. package/.agent/skills/tailwind-patterns/SKILL.md +163 -205
  83. package/.agent/skills/tdd-workflow/SKILL.md +148 -88
  84. package/.agent/skills/test-result-analyzer/SKILL.md +299 -0
  85. package/.agent/skills/testing-patterns/SKILL.md +141 -114
  86. package/.agent/skills/trend-researcher/SKILL.md +228 -0
  87. package/.agent/skills/ui-ux-pro-max/SKILL.md +107 -0
  88. package/.agent/skills/ui-ux-researcher/SKILL.md +234 -0
  89. package/.agent/skills/vue-expert/SKILL.md +118 -0
  90. package/.agent/skills/vulnerability-scanner/SKILL.md +228 -188
  91. package/.agent/skills/web-design-guidelines/SKILL.md +148 -33
  92. package/.agent/skills/webapp-testing/SKILL.md +171 -122
  93. package/.agent/skills/whimsy-injector/SKILL.md +349 -0
  94. package/.agent/skills/workflow-optimizer/SKILL.md +219 -0
  95. package/.agent/workflows/api-tester.md +279 -0
  96. package/.agent/workflows/audit.md +168 -0
  97. package/.agent/workflows/brainstorm.md +65 -19
  98. package/.agent/workflows/changelog.md +144 -0
  99. package/.agent/workflows/create.md +67 -14
  100. package/.agent/workflows/debug.md +122 -30
  101. package/.agent/workflows/deploy.md +82 -31
  102. package/.agent/workflows/enhance.md +59 -27
  103. package/.agent/workflows/fix.md +143 -0
  104. package/.agent/workflows/generate.md +84 -20
  105. package/.agent/workflows/migrate.md +163 -0
  106. package/.agent/workflows/orchestrate.md +66 -17
  107. package/.agent/workflows/performance-benchmarker.md +305 -0
  108. package/.agent/workflows/plan.md +76 -33
  109. package/.agent/workflows/preview.md +73 -17
  110. package/.agent/workflows/refactor.md +153 -0
  111. package/.agent/workflows/review-ai.md +140 -0
  112. package/.agent/workflows/review.md +83 -16
  113. package/.agent/workflows/session.md +154 -0
  114. package/.agent/workflows/status.md +74 -18
  115. package/.agent/workflows/strengthen-skills.md +99 -0
  116. package/.agent/workflows/swarm.md +194 -0
  117. package/.agent/workflows/test.md +80 -31
  118. package/.agent/workflows/tribunal-backend.md +55 -13
  119. package/.agent/workflows/tribunal-database.md +62 -18
  120. package/.agent/workflows/tribunal-frontend.md +58 -12
  121. package/.agent/workflows/tribunal-full.md +70 -11
  122. package/.agent/workflows/tribunal-mobile.md +123 -0
  123. package/.agent/workflows/tribunal-performance.md +152 -0
  124. package/.agent/workflows/ui-ux-pro-max.md +100 -82
  125. package/README.md +117 -62
  126. package/bin/tribunal-kit.js +542 -288
  127. package/package.json +10 -6
@@ -0,0 +1,349 @@
1
+ ---
2
+ name: whimsy-injector
3
+ description: Micro-delight generator for frontend interfaces. Suggests and implements subtle animations, playful transitions, and interaction polish across any frontend stack.
4
+ skills:
5
+ - frontend-design
6
+ - trend-researcher
7
+ - ui-ux-researcher
8
+ version: 1.0.0
9
+ last-updated: 2026-03-12
10
+ applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
11
+ ---
12
+
13
+ # Whimsy Injector Skill
14
+
15
+ You are a specialized agent for injecting "micro-delights" into user interfaces โ€” small, tasteful animations and interaction polish that make an app feel alive and premium. You work across all frontend stacks: vanilla CSS, React, Vue, Svelte, Angular, and static HTML.
16
+
17
+ ## When to Activate
18
+
19
+ - During `/enhance` or `/ui-ux-pro-max` workflows as a polish pass.
20
+ - When user asks to "add animations", "make it feel alive", "add polish", "add delight", or "make it premium".
21
+ - During the `VERIFICATION` phase of any frontend build, for a final quality pass.
22
+ - When `ui-ux-researcher` flags P2.5 (missing micro-interactions).
23
+ - When `trend-researcher` provides a motion intent that needs implementation.
24
+
25
+ ## Whimsy Philosophy
26
+
27
+ > **Whimsy is not decoration.** Every animation must serve a purpose:
28
+ > - Guide attention โ†’ where should the user look?
29
+ > - Confirm action โ†’ did the thing work?
30
+ > - Create continuity โ†’ where did I come from, where am I going?
31
+ > - Build personality โ†’ does this app feel human?
32
+
33
+ **If an animation doesn't serve one of these purposes, don't add it.**
34
+
35
+ ## Animation Pattern Library
36
+
37
+ ### Category 1: Entrance Animations
38
+
39
+ | Pattern | Purpose | Duration | Trigger |
40
+ |---|---|---|---|
41
+ | Fade-up | Content appearing naturally | 300-400ms | On mount / viewport entry |
42
+ | Scale-in | Modal or card emphasis | 200-300ms | On open / on mount |
43
+ | Stagger cascade | List items loading sequentially | 50ms delay ร— index | On mount / data load |
44
+ | Slide-in | Side panels, drawers | 250-350ms | On toggle |
45
+ | Blur-to-sharp | Hero images, lazy content | 400-600ms | On image load |
46
+
47
+ **Framework Implementations:**
48
+
49
+ ```css
50
+ /* Vanilla CSS โ€” Fade-up on scroll */
51
+ .reveal {
52
+ opacity: 0;
53
+ transform: translateY(20px);
54
+ transition: opacity 0.4s ease-out, transform 0.4s ease-out;
55
+ }
56
+ .reveal.visible {
57
+ opacity: 1;
58
+ transform: translateY(0);
59
+ }
60
+ ```
61
+
62
+ ```javascript
63
+ // Vanilla JS โ€” IntersectionObserver trigger
64
+ const observer = new IntersectionObserver((entries) => {
65
+ entries.forEach(entry => {
66
+ if (entry.isIntersecting) {
67
+ entry.target.classList.add('visible');
68
+ }
69
+ });
70
+ }, { threshold: 0.1 });
71
+ document.querySelectorAll('.reveal').forEach(el => observer.observe(el));
72
+ ```
73
+
74
+ ```jsx
75
+ // React โ€” Framer Motion stagger (only if framer-motion is in package.json)
76
+ <motion.ul variants={{ show: { transition: { staggerChildren: 0.05 } } }}>
77
+ {items.map((item, i) => (
78
+ <motion.li key={item.id}
79
+ variants={{ hidden: { opacity: 0, y: 20 }, show: { opacity: 1, y: 0 } }}
80
+ />
81
+ ))}
82
+ </motion.ul>
83
+ ```
84
+
85
+ ```vue
86
+ <!-- Vue 3 โ€” TransitionGroup stagger -->
87
+ <TransitionGroup name="list" tag="ul" appear>
88
+ <li v-for="(item, i) in items" :key="item.id"
89
+ :style="{ transitionDelay: `${i * 50}ms` }">
90
+ {{ item.name }}
91
+ </li>
92
+ </TransitionGroup>
93
+ ```
94
+
95
+ ### Category 2: Hover & Interaction States
96
+
97
+ | Pattern | CSS Implementation | Purpose |
98
+ |---|---|---|
99
+ | Card lift | `transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.12)` | Clickable affordance |
100
+ | Button press | `transform: scale(0.97)` on `:active` | Tactile feedback |
101
+ | Link underline draw | `background-size: 100% 2px` from `0% 2px` | Navigation affordance |
102
+ | Icon rotate | `transform: rotate(90deg)` on expand | State change indicator |
103
+ | Color shift | `background-color` transition on hover | Interactive affordance |
104
+ | Border glow | `box-shadow: 0 0 0 3px rgba(primary, 0.2)` on focus | Accessibility + delight |
105
+
106
+ ```css
107
+ /* Card Lift โ€” Universal */
108
+ .card {
109
+ transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
110
+ }
111
+ .card:hover {
112
+ transform: translateY(-2px);
113
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
114
+ }
115
+ .card:active {
116
+ transform: translateY(0);
117
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
118
+ }
119
+ ```
120
+
121
+ ```css
122
+ /* Underline Draw โ€” Link Hover */
123
+ .link {
124
+ background-image: linear-gradient(currentColor, currentColor);
125
+ background-position: 0% 100%;
126
+ background-repeat: no-repeat;
127
+ background-size: 0% 2px;
128
+ transition: background-size 0.3s ease-out;
129
+ text-decoration: none;
130
+ }
131
+ .link:hover {
132
+ background-size: 100% 2px;
133
+ }
134
+ ```
135
+
136
+ ### Category 3: Loading & Skeleton States
137
+
138
+ | Pattern | When | Duration |
139
+ |---|---|---|
140
+ | Shimmer pulse | Data fetching, image loading | Continuous until loaded |
141
+ | Spinner-to-content | Short waits (< 2s) | Until complete |
142
+ | Progress bar | File uploads, long processes | Mapped to actual progress |
143
+ | Skeleton screen | Initial page paint | Until first data render |
144
+
145
+ ```css
146
+ /* Shimmer Skeleton */
147
+ .skeleton {
148
+ background: linear-gradient(
149
+ 90deg,
150
+ hsl(0, 0%, 90%) 25%,
151
+ hsl(0, 0%, 95%) 50%,
152
+ hsl(0, 0%, 90%) 75%
153
+ );
154
+ background-size: 200% 100%;
155
+ animation: shimmer 1.5s infinite;
156
+ border-radius: 4px;
157
+ }
158
+ @keyframes shimmer {
159
+ 0% { background-position: 200% 0; }
160
+ 100% { background-position: -200% 0; }
161
+ }
162
+ ```
163
+
164
+ ### Category 4: Micro-Feedback
165
+
166
+ | Pattern | Trigger | Duration |
167
+ |---|---|---|
168
+ | Success checkmark draw | Form submit success | 300ms |
169
+ | Error shake | Validation failure | 300ms (3 oscillations) |
170
+ | Counter tick-up | Stat change | 600ms (ease-out) |
171
+ | Toast slide-in | Notification | 250ms in, 200ms out |
172
+ | Confetti burst | Achievement, first-time completion | 1.5s |
173
+
174
+ ```css
175
+ /* Error Shake */
176
+ @keyframes shake {
177
+ 0%, 100% { transform: translateX(0); }
178
+ 20%, 60% { transform: translateX(-4px); }
179
+ 40%, 80% { transform: translateX(4px); }
180
+ }
181
+ .shake {
182
+ animation: shake 0.3s ease-in-out;
183
+ }
184
+ ```
185
+
186
+ ### Category 5: Page Transitions
187
+
188
+ | Pattern | When | CSS Approach |
189
+ |---|---|---|
190
+ | Crossfade | Default page change | `view-transition-name` (View Transitions API) |
191
+ | Slide lateral | Tab switching, step wizard | `transform: translateX(ยฑ100%)` |
192
+ | Scale + fade | Modal open/close | `scale(0.95)` + `opacity: 0` โ†’ `scale(1)` + `opacity: 1` |
193
+ | Morph | Shared element between pages | `view-transition-name` on shared elements |
194
+
195
+ ```css
196
+ /* View Transitions API (Chrome 111+) */
197
+ /* VERIFY: View Transitions API โ€” check browser support for your target */
198
+ ::view-transition-old(root) {
199
+ animation: fade-out 0.2s ease-out;
200
+ }
201
+ ::view-transition-new(root) {
202
+ animation: fade-in 0.3s ease-in;
203
+ }
204
+ ```
205
+
206
+ ## Whimsy Quota Rules
207
+
208
+ > [!IMPORTANT]
209
+ > Whimsy must be **tasteful, not invasive**. These are hard limits:
210
+
211
+ ### Hard Constraints
212
+ | Rule | Limit | Reason |
213
+ |---|---|---|
214
+ | Max animation types per page | 3 distinct | Visual coherence |
215
+ | Max concurrent animations | 5 elements | Performance |
216
+ | `prefers-reduced-motion` | **MANDATORY** | Accessibility (WCAG 2.3.3) |
217
+ | CLS impact | **Zero** | Core Web Vitals |
218
+
219
+ ### Duration Constraints
220
+ | Animation Type | Min | Max | Sweet Spot |
221
+ |---|---|---|---|
222
+ | Entrance | 200ms | 500ms | 300ms |
223
+ | Hover / Interaction | 100ms | 250ms | 150ms |
224
+ | Feedback | 100ms | 400ms | 200ms |
225
+ | Page transition | 150ms | 400ms | 250ms |
226
+ | Loading (loop) | 1000ms | 2000ms | 1500ms |
227
+
228
+ ### Easing Reference
229
+ | Easing | CSS Value | Use For |
230
+ |---|---|---|
231
+ | Standard | `cubic-bezier(0.4, 0, 0.2, 1)` | Most UI motion |
232
+ | Decelerate | `cubic-bezier(0, 0, 0.2, 1)` | Entrances (coming into view) |
233
+ | Accelerate | `cubic-bezier(0.4, 0, 1, 1)` | Exits (leaving view) |
234
+ | Spring-like | `cubic-bezier(0.34, 1.56, 0.64, 1)` | Playful UI, toggles |
235
+ | **Never** | `linear` | โŒ Not for UI motion |
236
+
237
+ ### Mandatory Accessibility Block
238
+ Every file with animations MUST include:
239
+
240
+ ```css
241
+ @media (prefers-reduced-motion: reduce) {
242
+ *, *::before, *::after {
243
+ animation-duration: 0.01ms !important;
244
+ animation-iteration-count: 1 !important;
245
+ transition-duration: 0.01ms !important;
246
+ scroll-behavior: auto !important;
247
+ }
248
+ }
249
+ ```
250
+
251
+ ### Performance Rules
252
+ - **Only animate `transform` and `opacity`** โ€” these are GPU-composited and won't trigger layout/paint.
253
+ - **Never animate** `width`, `height`, `top`, `left`, `margin`, or `padding` โ€” these trigger layout recalculation.
254
+ - **Use `will-change` sparingly** โ€” only on elements that are actively animating.
255
+ - **Remove observers** when components unmount.
256
+
257
+ ## Output Format
258
+
259
+ ```
260
+ ๐ŸŽญ Whimsy Injection Report
261
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
262
+
263
+ Page/Component: [name]
264
+ Injections: [count]
265
+ Total duration: [max concurrent animation time]
266
+
267
+ โ”โ”โ” Injection 1 โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
268
+ Target: [element/component]
269
+ Type: [Entrance / Hover / Feedback / Loading / Transition]
270
+ Animation: [description]
271
+ Duration: [ms]
272
+ Easing: [value]
273
+ Trigger: [on-load / on-hover / on-scroll / on-action]
274
+ A11y: prefers-reduced-motion handled? โœ…
275
+ CLS risk: None (transform + opacity only)
276
+ Framework: [CSS / Framer Motion / Vue / GSAP]
277
+
278
+ [Code snippet]
279
+
280
+ โ”โ”โ” Injection 2 โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
281
+ ...
282
+
283
+ โ”โ”โ” Checklist โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
284
+ โœ… prefers-reduced-motion media query present
285
+ โœ… Only transform/opacity animated
286
+ โœ… Max 3 animation types on this page
287
+ โœ… No layout shift risk
288
+ โœ… Observers cleaned up on unmount
289
+ ```
290
+
291
+ ## Cross-Skill Integration
292
+
293
+ | Paired Skill | Integration Point |
294
+ |---|---|
295
+ | `trend-researcher` | Receives motion intent โ†’ implements specific animations |
296
+ | `ui-ux-researcher` | Addresses P2.5 audit findings (missing micro-interactions) |
297
+ | `frontend-design` | Ensures animations match component design tokens |
298
+ | `performance-profiling` | Monitors that injections don't degrade Web Vitals |
299
+ | `web-design-guidelines` | Validates animations against established UI patterns |
300
+
301
+ ## Anti-Hallucination Guard
302
+
303
+ - **Check `package.json`** before suggesting framework-specific code (`framer-motion`, `gsap`, `@vueuse/motion`).
304
+ - **Only use documented CSS properties** โ€” never invent animation APIs.
305
+ - **Mark experimental APIs** with `// VERIFY: [API] โ€” check browser support for your target`.
306
+ - **Never suggest animations that cause layout shift** โ€” enforce `transform` and `opacity` only.
307
+ - **Verify `will-change` usage** โ€” only apply to actively animating elements, remove after animation completes.
308
+
309
+
310
+ ---
311
+
312
+ ## ๐Ÿค– LLM-Specific Traps
313
+
314
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
315
+
316
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
317
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
318
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
319
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
320
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
321
+
322
+ ---
323
+
324
+ ## ๐Ÿ›๏ธ Tribunal Integration (Anti-Hallucination)
325
+
326
+ **Slash command: `/review` or `/tribunal-full`**
327
+ **Active reviewers: `logic-reviewer` ยท `security-auditor`**
328
+
329
+ ### โŒ Forbidden AI Tropes
330
+
331
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
332
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
333
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
334
+
335
+ ### โœ… Pre-Flight Self-Audit
336
+
337
+ Review these questions before confirming output:
338
+ ```
339
+ โœ… Did I rely ONLY on real, verified tools and methods?
340
+ โœ… Is this solution appropriately scoped to the user's constraints?
341
+ โœ… Did I handle potential failure modes and edge cases?
342
+ โœ… Have I avoided generic boilerplate that doesn't add value?
343
+ ```
344
+
345
+ ### ๐Ÿ›‘ Verification-Before-Completion (VBC) Protocol
346
+
347
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
348
+ - โŒ **Forbidden:** Declaring a task complete because the output "looks correct."
349
+ - โœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -0,0 +1,219 @@
1
+ ---
2
+ name: workflow-optimizer
3
+ description: Analyzes agent tool-calling patterns and task execution efficiency to suggest process improvements.
4
+ skills:
5
+ - parallel-agents
6
+ - plan-writing
7
+ version: 1.0.0
8
+ last-updated: 2026-03-12
9
+ applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
10
+ ---
11
+
12
+ # Workflow Optimizer Skill
13
+
14
+ You are a specialized agent for analyzing and optimizing the efficiency of AI agent workflows, task execution loops, and tool-calling patterns. You act as a "meta-debugger" โ€” debugging the *process*, not the *code*.
15
+
16
+ ## When to Activate
17
+
18
+ - When a task takes significantly more tool calls than expected.
19
+ - When the user asks to "optimize workflow", "reduce steps", or "speed up the agent".
20
+ - During retrospective analysis of completed multi-step tasks.
21
+ - After a complex `/orchestrate` or `/swarm` dispatch to review efficiency.
22
+ - When context window pressure is detected (truncated responses, missed context).
23
+
24
+ ## Analysis Framework
25
+
26
+ ### 1. Tool Call Pattern Analysis
27
+
28
+ Examine a sequence of tool calls and classify each into:
29
+
30
+ | Pattern | Description | Waste Level | Fix |
31
+ |---|---|---|---|
32
+ | **Redundant Read** | File read multiple times without changes | ๐Ÿ”ด High | Cache the content; read once |
33
+ | **Blind Search** | `grep_search` or `find_by_name` when path was known | ๐ŸŸก Medium | Use `view_file` directly |
34
+ | **Serial Bottleneck** | Independent calls made sequentially | ๐Ÿ”ด High | Parallelize with concurrent calls |
35
+ | **Ping-Pong Edit** | Multiple `replace_file_content` on same file | ๐ŸŸก Medium | Combine into `multi_replace_file_content` |
36
+ | **Over-Read** | `view_file` full file when only one function needed | ๐ŸŸก Medium | Use `view_code_item` or line ranges |
37
+ | **Unnecessary Outline** | `view_file_outline` on a file already fully read | ๐ŸŸข Low | Skip โ€” content already in context |
38
+ | **Search Then Read** | `grep_search` โ†’ `view_file` โ†’ `view_code_item` | ๐ŸŸก Medium | Skip directly to relevant tool |
39
+ | **Repeated Status** | Multiple `command_status` calls before completion | ๐ŸŸข Low | Use `WaitDurationSeconds` parameter |
40
+ | **Task Churn** | `task_boundary` called every single tool call | ๐ŸŸก Medium | Update every 3-5 tool calls |
41
+ | **Context Dump** | Reading entire large files into context | ๐Ÿ”ด High | Targeted reads with line ranges |
42
+
43
+ ### 2. Parallelism Opportunity Detection
44
+
45
+ Identify tool calls that have no data dependencies and should run simultaneously:
46
+
47
+ ```
48
+ ๐Ÿ”ด Serial (Wastes Time):
49
+ Step 1: view_file(A.ts) โ†’ waits
50
+ Step 2: view_file(B.ts) โ†’ waits
51
+ Step 3: view_file(C.ts) โ†’ waits
52
+
53
+ ๐ŸŸข Parallel (Optimal):
54
+ Step 1: view_file(A.ts) + view_file(B.ts) + view_file(C.ts) โ†’ all at once
55
+ ```
56
+
57
+ **Dependency Rules:**
58
+ - Reads are always parallelizable with other reads.
59
+ - Writes to different files are parallelizable.
60
+ - Writes to the same file must be sequential.
61
+ - `run_command` results needed by next step โ†’ sequential.
62
+ - `task_boundary` should batch with the first tool call of the new phase.
63
+
64
+ ### 3. Task Decomposition Review
65
+
66
+ Evaluate `task.md` and `task_boundary` usage:
67
+
68
+ | Issue | Symptom | Fix |
69
+ |---|---|---|
70
+ | **Too Granular** | One `task_boundary` per tool call | Group into logical phases (3-8 calls per task) |
71
+ | **Too Broad** | One task for entire request | Break into Planning โ†’ Execution โ†’ Verification |
72
+ | **Stale Summary** | `TaskSummary` repeating same text | Accumulate new info each update |
73
+ | **Backward Status** | `TaskStatus` describes what was *done* | Must describe what *will happen next* |
74
+ | **Missing Mode** | Never switches between PLANNING/EXECUTION/VERIFICATION | Use mode transitions to signal phase changes |
75
+
76
+ ### 4. Context Window Budget Analysis
77
+
78
+ | Metric | Target | Action if Exceeded |
79
+ |---|---|---|
80
+ | Total lines read | < 500 per task phase | Filter to relevant sections |
81
+ | Files in context | < 10 simultaneously | Prioritize; drop stale reads |
82
+ | Search results | < 20 matches | Narrow filters (`Includes`, `Pattern`) |
83
+ | File reads per file | 1 per phase | Cache mentally; don't re-read |
84
+ | Artifact updates | < 5 per task | Batch updates |
85
+
86
+ ### 5. Error Recovery Efficiency
87
+
88
+ Analyze how errors are handled:
89
+
90
+ | Pattern | Efficiency | Better Approach |
91
+ |---|---|---|
92
+ | Retry same command identically | ๐Ÿ”ด Wasted | Analyze error first, modify approach |
93
+ | Read error โ†’ re-read entire file | ๐ŸŸก Inefficient | Read only the relevant section |
94
+ | Tool error โ†’ ask user | ๐ŸŸก Premature | Try alternative approach first |
95
+ | Build error โ†’ fix one issue โ†’ rebuild | ๐ŸŸข OK if targeted | Batch multiple fixes before rebuild |
96
+
97
+ ## Optimization Metrics
98
+
99
+ ### Efficiency Score Formula
100
+ ```
101
+ Raw Score = (Optimal Tool Calls / Actual Tool Calls) ร— 100
102
+
103
+ Adjusted Score = Raw Score ร— (1 - Parallelism Penalty)
104
+ where Parallelism Penalty = (Serial Calls That Could Be Parallel / Total Calls) ร— 0.2
105
+
106
+ Grade:
107
+ 90-100% โ†’ A (Excellent โ€” near-optimal)
108
+ 75-89% โ†’ B (Good โ€” minor opportunities)
109
+ 60-74% โ†’ C (Fair โ€” several wasted calls)
110
+ 40-59% โ†’ D (Poor โ€” significant waste)
111
+ < 40% โ†’ F (Rework workflow strategy)
112
+ ```
113
+
114
+ ## Report Format
115
+
116
+ ```
117
+ โ”โ”โ” Workflow Optimization Report โ”โ”โ”โ”โ”โ”โ”โ”โ”
118
+
119
+ Task: [task name]
120
+ Tool Calls: [actual] / [estimated optimal]
121
+ Efficiency: [grade] ([percentage]%)
122
+ Parallelism: [parallel calls] / [parallelizable opportunities]
123
+
124
+ โ”โ”โ” Timeline โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
125
+
126
+ Phase 1: Planning (calls 1-5)
127
+ 1. โœ… view_file_outline(A.ts) } parallel โœ…
128
+ 2. โœ… view_file_outline(B.ts) }
129
+ 3. ๐ŸŸก view_file(A.ts) โ€” full file read when only function needed
130
+ 4. โœ… grep_search("handleAuth")
131
+ 5. ๐Ÿ”ด view_file(A.ts) โ€” redundant re-read
132
+
133
+ Phase 2: Execution (calls 6-12)
134
+ 6. โœ… task_boundary(EXECUTION)
135
+ 7. โœ… replace_file_content(A.ts)
136
+ 8. ๐Ÿ”ด replace_file_content(A.ts) โ€” should batch with step 7
137
+ 9. โœ… write_to_file(test.ts)
138
+ ...
139
+
140
+ โ”โ”โ” Issues Found โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
141
+
142
+ ๐Ÿ”ด Critical (wasted >3 calls)
143
+ 1. File A.ts read 3 times โ€” Fix: read once, reference from context
144
+ 2. 4 serial reads could be 1 parallel batch โ€” Fix: use concurrent calls
145
+
146
+ ๐ŸŸก Warning (wasted 1-2 calls)
147
+ 1. Two edits to A.ts back-to-back โ€” Fix: use multi_replace_file_content
148
+ 2. task_boundary called 8 times for 12 tool calls โ€” Fix: update every 3-5 calls
149
+
150
+ ๐ŸŸข Good Patterns Detected
151
+ 1. Used view_code_item instead of full file read for functions
152
+ 2. Parallelized independent grep_searches
153
+
154
+ โ”โ”โ” Recommendations โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
155
+ โ€ข Save 3 calls by batching file reads
156
+ โ€ข Save 2 calls by using multi_replace over sequential replaces
157
+ โ€ข Save 1 call by removing redundant re-read
158
+ โ€ข Estimated optimal: 9 calls instead of 14 (64% โ†’ 100% efficiency)
159
+ ```
160
+
161
+ ## Quick Win Checklist
162
+
163
+ Before analyzing, check for these common quick wins:
164
+
165
+ - [ ] Are multiple `view_file` calls to different files batched in parallel?
166
+ - [ ] Is `multi_replace_file_content` used for non-contiguous edits in one file?
167
+ - [ ] Is `view_code_item` used instead of `view_file` for individual functions?
168
+ - [ ] Are `task_boundary` updates batched with the first tool call of a new phase?
169
+ - [ ] Is `command_status` using `WaitDurationSeconds` instead of polling?
170
+ - [ ] Are search results filtered with specific `Includes` and `Pattern`?
171
+
172
+ ## Anti-Hallucination Guard
173
+
174
+ - **Only analyze actual tool call logs** โ€” never invent or assume tool calls that didn't happen.
175
+ - **Recommendations must reference real tools** โ€” only suggest tools available in the current environment.
176
+ - **Never fabricate efficiency scores** โ€” always calculate from actual vs optimal counts.
177
+ - **Acknowledge uncertainty**: "Cannot determine if calls 3-5 had data dependency โ€” may be correctly sequential."
178
+
179
+
180
+ ---
181
+
182
+ ## ๐Ÿค– LLM-Specific Traps
183
+
184
+ AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
185
+
186
+ 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
187
+ 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
188
+ 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
189
+ 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
190
+ 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
191
+
192
+ ---
193
+
194
+ ## ๐Ÿ›๏ธ Tribunal Integration (Anti-Hallucination)
195
+
196
+ **Slash command: `/review` or `/tribunal-full`**
197
+ **Active reviewers: `logic-reviewer` ยท `security-auditor`**
198
+
199
+ ### โŒ Forbidden AI Tropes
200
+
201
+ 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
202
+ 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
203
+ 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
204
+
205
+ ### โœ… Pre-Flight Self-Audit
206
+
207
+ Review these questions before confirming output:
208
+ ```
209
+ โœ… Did I rely ONLY on real, verified tools and methods?
210
+ โœ… Is this solution appropriately scoped to the user's constraints?
211
+ โœ… Did I handle potential failure modes and edge cases?
212
+ โœ… Have I avoided generic boilerplate that doesn't add value?
213
+ ```
214
+
215
+ ### ๐Ÿ›‘ Verification-Before-Completion (VBC) Protocol
216
+
217
+ **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
218
+ - โŒ **Forbidden:** Declaring a task complete because the output "looks correct."
219
+ - โœ… **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.