dsh-ecc-skills 0.4.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 (278) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +99 -0
  3. package/cordis.patch.yml +5 -0
  4. package/lib/index.js +195 -0
  5. package/package.json +46 -0
  6. package/skills/accessibility/SKILL.md +147 -0
  7. package/skills/agent-architecture-audit/SKILL.md +257 -0
  8. package/skills/agent-eval/SKILL.md +147 -0
  9. package/skills/agent-harness-construction/SKILL.md +74 -0
  10. package/skills/agent-introspection-debugging/SKILL.md +154 -0
  11. package/skills/agent-payment-x402/SKILL.md +225 -0
  12. package/skills/agent-self-evaluation/SKILL.md +182 -0
  13. package/skills/agent-sort/SKILL.md +216 -0
  14. package/skills/agentic-engineering/SKILL.md +64 -0
  15. package/skills/agentic-os/SKILL.md +388 -0
  16. package/skills/ai-first-engineering/SKILL.md +52 -0
  17. package/skills/ai-regression-testing/SKILL.md +386 -0
  18. package/skills/android-clean-architecture/SKILL.md +340 -0
  19. package/skills/angular-developer/SKILL.md +155 -0
  20. package/skills/api-connector-builder/SKILL.md +121 -0
  21. package/skills/api-design/SKILL.md +524 -0
  22. package/skills/architecture-decision-records/SKILL.md +180 -0
  23. package/skills/article-writing/SKILL.md +80 -0
  24. package/skills/automation-audit-ops/SKILL.md +143 -0
  25. package/skills/autonomous-agent-harness/SKILL.md +274 -0
  26. package/skills/autonomous-loops/SKILL.md +611 -0
  27. package/skills/backend-patterns/SKILL.md +562 -0
  28. package/skills/benchmark/SKILL.md +95 -0
  29. package/skills/benchmark-methodology/SKILL.md +191 -0
  30. package/skills/benchmark-optimization-loop/SKILL.md +71 -0
  31. package/skills/blender-motion-state-inspection/SKILL.md +165 -0
  32. package/skills/blueprint/SKILL.md +106 -0
  33. package/skills/brand-discovery/SKILL.md +145 -0
  34. package/skills/brand-voice/SKILL.md +98 -0
  35. package/skills/browser-qa/SKILL.md +105 -0
  36. package/skills/bun-runtime/SKILL.md +85 -0
  37. package/skills/canary-watch/SKILL.md +108 -0
  38. package/skills/carrier-relationship-management/SKILL.md +212 -0
  39. package/skills/cisco-ios-patterns/SKILL.md +164 -0
  40. package/skills/ck/SKILL.md +148 -0
  41. package/skills/claude-devfleet/SKILL.md +112 -0
  42. package/skills/click-path-audit/SKILL.md +245 -0
  43. package/skills/clickhouse-io/SKILL.md +445 -0
  44. package/skills/code-tour/SKILL.md +254 -0
  45. package/skills/codebase-onboarding/SKILL.md +234 -0
  46. package/skills/codehealth-mcp/SKILL.md +167 -0
  47. package/skills/coding-standards/SKILL.md +551 -0
  48. package/skills/competitive-platform-analysis/SKILL.md +214 -0
  49. package/skills/competitive-report-structure/SKILL.md +162 -0
  50. package/skills/compose-multiplatform-patterns/SKILL.md +300 -0
  51. package/skills/config-gc/SKILL.md +120 -0
  52. package/skills/configure-ecc/SKILL.md +206 -0
  53. package/skills/connections-optimizer/SKILL.md +190 -0
  54. package/skills/content-engine/SKILL.md +132 -0
  55. package/skills/content-hash-cache-pattern/SKILL.md +162 -0
  56. package/skills/context-budget/SKILL.md +136 -0
  57. package/skills/continuous-agent-loop/SKILL.md +46 -0
  58. package/skills/contract-first/SKILL.md +287 -0
  59. package/skills/cost-aware-llm-pipeline/SKILL.md +184 -0
  60. package/skills/cost-tracking/SKILL.md +97 -0
  61. package/skills/council/SKILL.md +204 -0
  62. package/skills/council-multi-model/SKILL.md +167 -0
  63. package/skills/cpp-coding-standards/SKILL.md +724 -0
  64. package/skills/cpp-testing/SKILL.md +325 -0
  65. package/skills/crosspost/SKILL.md +112 -0
  66. package/skills/csharp-testing/SKILL.md +322 -0
  67. package/skills/customer-billing-ops/SKILL.md +141 -0
  68. package/skills/customs-trade-compliance/SKILL.md +263 -0
  69. package/skills/dart-flutter-patterns/SKILL.md +564 -0
  70. package/skills/dashboard-builder/SKILL.md +109 -0
  71. package/skills/data-scraper-agent/SKILL.md +765 -0
  72. package/skills/data-throughput-accelerator/SKILL.md +74 -0
  73. package/skills/database-migrations/SKILL.md +430 -0
  74. package/skills/deep-research/SKILL.md +160 -0
  75. package/skills/defi-amm-security/SKILL.md +167 -0
  76. package/skills/delivery-gate/SKILL.md +126 -0
  77. package/skills/deployment-patterns/SKILL.md +428 -0
  78. package/skills/design-system/SKILL.md +83 -0
  79. package/skills/dev-team/SKILL.md +203 -0
  80. package/skills/django-celery/SKILL.md +458 -0
  81. package/skills/django-patterns/SKILL.md +735 -0
  82. package/skills/django-security/SKILL.md +644 -0
  83. package/skills/django-tdd/SKILL.md +730 -0
  84. package/skills/django-verification/SKILL.md +470 -0
  85. package/skills/dmux-workflows/SKILL.md +192 -0
  86. package/skills/docker-patterns/SKILL.md +520 -0
  87. package/skills/documentation-lookup/SKILL.md +91 -0
  88. package/skills/dotnet-patterns/SKILL.md +322 -0
  89. package/skills/dynamic-workflow-mode/SKILL.md +124 -0
  90. package/skills/e2e-testing/SKILL.md +327 -0
  91. package/skills/ecc-tools-cost-audit/SKILL.md +161 -0
  92. package/skills/email-ops/SKILL.md +122 -0
  93. package/skills/energy-procurement/SKILL.md +228 -0
  94. package/skills/enterprise-agent-ops/SKILL.md +51 -0
  95. package/skills/error-handling/SKILL.md +377 -0
  96. package/skills/eval-harness/SKILL.md +271 -0
  97. package/skills/evm-token-decimals/SKILL.md +131 -0
  98. package/skills/exa-search/SKILL.md +108 -0
  99. package/skills/fal-ai-media/SKILL.md +289 -0
  100. package/skills/fastapi-patterns/SKILL.md +514 -0
  101. package/skills/finance-billing-ops/SKILL.md +128 -0
  102. package/skills/flox-environments/SKILL.md +497 -0
  103. package/skills/flutter-dart-code-review/SKILL.md +436 -0
  104. package/skills/foundation-models-on-device/SKILL.md +243 -0
  105. package/skills/frontend-a11y/SKILL.md +446 -0
  106. package/skills/frontend-design-direction/SKILL.md +93 -0
  107. package/skills/frontend-patterns/SKILL.md +657 -0
  108. package/skills/fsharp-testing/SKILL.md +281 -0
  109. package/skills/gan-style-harness/SKILL.md +279 -0
  110. package/skills/generating-python-installer/SKILL.md +820 -0
  111. package/skills/git-workflow/SKILL.md +716 -0
  112. package/skills/github-ops/SKILL.md +145 -0
  113. package/skills/golang-patterns/SKILL.md +676 -0
  114. package/skills/golang-testing/SKILL.md +721 -0
  115. package/skills/google-workspace-ops/SKILL.md +96 -0
  116. package/skills/growth-log/SKILL.md +128 -0
  117. package/skills/healthcare-cdss-patterns/SKILL.md +246 -0
  118. package/skills/healthcare-emr-patterns/SKILL.md +160 -0
  119. package/skills/healthcare-eval-harness/SKILL.md +208 -0
  120. package/skills/healthcare-phi-compliance/SKILL.md +146 -0
  121. package/skills/hermes-imports/SKILL.md +89 -0
  122. package/skills/hexagonal-architecture/SKILL.md +277 -0
  123. package/skills/hipaa-compliance/SKILL.md +79 -0
  124. package/skills/homelab-network-readiness/SKILL.md +170 -0
  125. package/skills/homelab-network-setup/SKILL.md +130 -0
  126. package/skills/homelab-pihole-dns/SKILL.md +275 -0
  127. package/skills/homelab-vlan-segmentation/SKILL.md +312 -0
  128. package/skills/homelab-wireguard-vpn/SKILL.md +306 -0
  129. package/skills/hookify-rules/SKILL.md +128 -0
  130. package/skills/inherit-legacy-style/SKILL.md +157 -0
  131. package/skills/intent-driven-development/SKILL.md +360 -0
  132. package/skills/inventory-demand-planning/SKILL.md +247 -0
  133. package/skills/investor-materials/SKILL.md +97 -0
  134. package/skills/investor-outreach/SKILL.md +92 -0
  135. package/skills/ios-icon-gen/SKILL.md +158 -0
  136. package/skills/iterative-retrieval/SKILL.md +212 -0
  137. package/skills/ito-baskets/SKILL.md +263 -0
  138. package/skills/ito-compute/SKILL.md +151 -0
  139. package/skills/ito-inference/SKILL.md +119 -0
  140. package/skills/ito-training/SKILL.md +123 -0
  141. package/skills/java-coding-standards/SKILL.md +384 -0
  142. package/skills/jira-integration/SKILL.md +303 -0
  143. package/skills/jpa-patterns/SKILL.md +152 -0
  144. package/skills/knowledge-ops/SKILL.md +155 -0
  145. package/skills/kotlin-coroutines-flows/SKILL.md +285 -0
  146. package/skills/kotlin-exposed-patterns/SKILL.md +720 -0
  147. package/skills/kotlin-ktor-patterns/SKILL.md +690 -0
  148. package/skills/kotlin-patterns/SKILL.md +712 -0
  149. package/skills/kotlin-testing/SKILL.md +825 -0
  150. package/skills/kubernetes-patterns/SKILL.md +756 -0
  151. package/skills/laravel-patterns/SKILL.md +416 -0
  152. package/skills/laravel-plugin-discovery/SKILL.md +230 -0
  153. package/skills/laravel-security/SKILL.md +948 -0
  154. package/skills/laravel-tdd/SKILL.md +675 -0
  155. package/skills/laravel-verification/SKILL.md +180 -0
  156. package/skills/latency-critical-systems/SKILL.md +75 -0
  157. package/skills/lead-intelligence/SKILL.md +322 -0
  158. package/skills/liquid-glass-design/SKILL.md +279 -0
  159. package/skills/living-docs-governance/SKILL.md +137 -0
  160. package/skills/llm-trading-agent-security/SKILL.md +147 -0
  161. package/skills/logistics-exception-management/SKILL.md +222 -0
  162. package/skills/loop-design-check/SKILL.md +143 -0
  163. package/skills/mailtrap-email-integration/SKILL.md +77 -0
  164. package/skills/make-interfaces-feel-better/SKILL.md +152 -0
  165. package/skills/manim-video/SKILL.md +90 -0
  166. package/skills/market-research/SKILL.md +76 -0
  167. package/skills/marketing-campaign/SKILL.md +114 -0
  168. package/skills/mcp-server-patterns/SKILL.md +70 -0
  169. package/skills/messages-ops/SKILL.md +105 -0
  170. package/skills/ml-adoption-playbook/SKILL.md +57 -0
  171. package/skills/mle-workflow/SKILL.md +348 -0
  172. package/skills/motion-advanced/SKILL.md +597 -0
  173. package/skills/motion-foundations/SKILL.md +300 -0
  174. package/skills/motion-patterns/SKILL.md +435 -0
  175. package/skills/motion-ui/SKILL.md +576 -0
  176. package/skills/mysql-patterns/SKILL.md +413 -0
  177. package/skills/nanoclaw-repl/SKILL.md +34 -0
  178. package/skills/nasiko-control-plane/SKILL.md +49 -0
  179. package/skills/nestjs-patterns/SKILL.md +231 -0
  180. package/skills/netmiko-ssh-automation/SKILL.md +174 -0
  181. package/skills/network-bgp-diagnostics/SKILL.md +168 -0
  182. package/skills/network-config-validation/SKILL.md +211 -0
  183. package/skills/network-interface-health/SKILL.md +153 -0
  184. package/skills/nextjs-turbopack/SKILL.md +58 -0
  185. package/skills/nodejs-keccak256/SKILL.md +103 -0
  186. package/skills/nutrient-document-processing/SKILL.md +168 -0
  187. package/skills/nuxt4-patterns/SKILL.md +101 -0
  188. package/skills/opensource-pipeline/SKILL.md +256 -0
  189. package/skills/orch-add-feature/SKILL.md +45 -0
  190. package/skills/orch-build-mvp/SKILL.md +49 -0
  191. package/skills/orch-change-feature/SKILL.md +43 -0
  192. package/skills/orch-fix-defect/SKILL.md +43 -0
  193. package/skills/orch-pipeline/SKILL.md +121 -0
  194. package/skills/orch-refine-code/SKILL.md +44 -0
  195. package/skills/parallel-execution-optimizer/SKILL.md +74 -0
  196. package/skills/perl-patterns/SKILL.md +505 -0
  197. package/skills/perl-security/SKILL.md +504 -0
  198. package/skills/perl-testing/SKILL.md +476 -0
  199. package/skills/plan-canvas/SKILL.md +196 -0
  200. package/skills/plankton-code-quality/SKILL.md +237 -0
  201. package/skills/postgres-patterns/SKILL.md +148 -0
  202. package/skills/prediction-market-oracle-research/SKILL.md +64 -0
  203. package/skills/prediction-market-risk-review/SKILL.md +61 -0
  204. package/skills/prisma-patterns/SKILL.md +401 -0
  205. package/skills/product-capability/SKILL.md +142 -0
  206. package/skills/product-lens/SKILL.md +93 -0
  207. package/skills/production-audit/SKILL.md +207 -0
  208. package/skills/production-scheduling/SKILL.md +238 -0
  209. package/skills/project-flow-ops/SKILL.md +112 -0
  210. package/skills/prompt-optimizer/SKILL.md +398 -0
  211. package/skills/python-patterns/SKILL.md +751 -0
  212. package/skills/python-testing/SKILL.md +817 -0
  213. package/skills/pytorch-patterns/SKILL.md +397 -0
  214. package/skills/quality-nonconformance/SKILL.md +260 -0
  215. package/skills/quarkus-patterns/SKILL.md +723 -0
  216. package/skills/quarkus-security/SKILL.md +468 -0
  217. package/skills/quarkus-tdd/SKILL.md +812 -0
  218. package/skills/quarkus-verification/SKILL.md +481 -0
  219. package/skills/ralphinho-rfc-pipeline/SKILL.md +68 -0
  220. package/skills/react-native-patterns/SKILL.md +326 -0
  221. package/skills/react-patterns/SKILL.md +342 -0
  222. package/skills/react-performance/SKILL.md +575 -0
  223. package/skills/react-testing/SKILL.md +424 -0
  224. package/skills/recsys-pipeline-architect/SKILL.md +115 -0
  225. package/skills/recursive-decision-ledger/SKILL.md +81 -0
  226. package/skills/redis-patterns/SKILL.md +404 -0
  227. package/skills/regex-vs-llm-structured-text/SKILL.md +221 -0
  228. package/skills/remotion-video-creation/SKILL.md +43 -0
  229. package/skills/repo-scan/SKILL.md +170 -0
  230. package/skills/research-ops/SKILL.md +113 -0
  231. package/skills/returns-reverse-logistics/SKILL.md +240 -0
  232. package/skills/rules-distill/SKILL.md +265 -0
  233. package/skills/rust-patterns/SKILL.md +500 -0
  234. package/skills/rust-testing/SKILL.md +501 -0
  235. package/skills/safety-guard/SKILL.md +76 -0
  236. package/skills/santa-method/SKILL.md +307 -0
  237. package/skills/scientific-db-pubmed-database/SKILL.md +176 -0
  238. package/skills/scientific-db-uspto-database/SKILL.md +178 -0
  239. package/skills/scientific-pkg-gget/SKILL.md +167 -0
  240. package/skills/scientific-thinking-literature-review/SKILL.md +193 -0
  241. package/skills/scientific-thinking-scholar-evaluation/SKILL.md +161 -0
  242. package/skills/search-first/SKILL.md +183 -0
  243. package/skills/security-bounty-hunter/SKILL.md +100 -0
  244. package/skills/security-scan/SKILL.md +166 -0
  245. package/skills/seo/SKILL.md +155 -0
  246. package/skills/skill-scout/SKILL.md +141 -0
  247. package/skills/skill-stocktake/SKILL.md +195 -0
  248. package/skills/social-graph-ranker/SKILL.md +155 -0
  249. package/skills/social-publisher/SKILL.md +130 -0
  250. package/skills/springboot-patterns/SKILL.md +315 -0
  251. package/skills/springboot-security/SKILL.md +273 -0
  252. package/skills/springboot-tdd/SKILL.md +159 -0
  253. package/skills/springboot-verification/SKILL.md +232 -0
  254. package/skills/swift-actor-persistence/SKILL.md +144 -0
  255. package/skills/swift-concurrency-6-2/SKILL.md +216 -0
  256. package/skills/swift-protocol-di-testing/SKILL.md +191 -0
  257. package/skills/swiftui-patterns/SKILL.md +259 -0
  258. package/skills/taste/SKILL.md +264 -0
  259. package/skills/tdd-workflow/SKILL.md +583 -0
  260. package/skills/team-agent-orchestration/SKILL.md +111 -0
  261. package/skills/team-builder/SKILL.md +169 -0
  262. package/skills/terminal-opener/SKILL.md +55 -0
  263. package/skills/terminal-ops/SKILL.md +110 -0
  264. package/skills/tinystruct-patterns/SKILL.md +279 -0
  265. package/skills/token-budget-advisor/SKILL.md +134 -0
  266. package/skills/ui-demo/SKILL.md +466 -0
  267. package/skills/ui-to-vue/SKILL.md +135 -0
  268. package/skills/uncloud/SKILL.md +344 -0
  269. package/skills/unified-memory/SKILL.md +170 -0
  270. package/skills/unified-notifications-ops/SKILL.md +188 -0
  271. package/skills/verification-loop/SKILL.md +129 -0
  272. package/skills/video-editing/SKILL.md +311 -0
  273. package/skills/videodb/SKILL.md +375 -0
  274. package/skills/vite-patterns/SKILL.md +450 -0
  275. package/skills/vue-patterns/SKILL.md +471 -0
  276. package/skills/windows-desktop-e2e/SKILL.md +888 -0
  277. package/skills/workspace-surface-audit/SKILL.md +126 -0
  278. package/skills/x-api/SKILL.md +235 -0
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: token-budget-advisor
3
+ description: >-
4
+ Offers the user an informed choice about how much response depth to
5
+ consume before answering. Use this skill when the user explicitly
6
+ wants to control response length, depth, or token budget.
7
+ TRIGGER when: "token budget", "token count", "token usage", "token limit",
8
+ "response length", "answer depth", "short version", "brief answer",
9
+ "detailed answer", "exhaustive answer", "respuesta corta vs larga",
10
+ "cuántos tokens", "ahorrar tokens", "responde al 50%", "dame la versión
11
+ corta", "quiero controlar cuánto usas", or clear variants where the
12
+ user is explicitly asking to control answer size or depth.
13
+ DO NOT TRIGGER when: user has already specified a level in the current
14
+ session (maintain it), the request is clearly a one-word answer, or
15
+ "token" refers to auth/session/payment tokens rather than response size.
16
+ metadata:
17
+ origin: community
18
+ ---
19
+
20
+ # Token Budget Advisor (TBA)
21
+
22
+ Intercept the response flow to offer the user a choice about response depth **before** Claude answers.
23
+
24
+ ## When to Use
25
+
26
+ - User wants to control how long or detailed a response is
27
+ - User mentions tokens, budget, depth, or response length
28
+ - User says "short version", "tldr", "brief", "al 25%", "exhaustive", etc.
29
+ - Any time the user wants to choose depth/detail level upfront
30
+
31
+ **Do not trigger** when: user already set a level this session (maintain it silently), or the answer is trivially one line.
32
+
33
+ ## How It Works
34
+
35
+ ### Step 1 — Estimate input tokens
36
+
37
+ Use the repository's canonical context-budget heuristics to estimate the prompt's token count mentally.
38
+
39
+ Use the same calibration guidance as [context-budget](../context-budget/SKILL.md):
40
+
41
+ - prose: `words × 1.3`
42
+ - code-heavy or mixed/code blocks: `chars / 4`
43
+
44
+ For mixed content, use the dominant content type and keep the estimate heuristic.
45
+
46
+ ### Step 2 — Estimate response size by complexity
47
+
48
+ Classify the prompt, then apply the multiplier range to get the full response window:
49
+
50
+ | Complexity | Multiplier range | Example prompts |
51
+ |--------------|------------------|------------------------------------------------------|
52
+ | Simple | 3× – 8× | "What is X?", yes/no, single fact |
53
+ | Medium | 8× – 20× | "How does X work?" |
54
+ | Medium-High | 10× – 25× | Code request with context |
55
+ | Complex | 15× – 40× | Multi-part analysis, comparisons, architecture |
56
+ | Creative | 10× – 30× | Stories, essays, narrative writing |
57
+
58
+ Response window = `input_tokens × mult_min` to `input_tokens × mult_max` (but don’t exceed your model’s configured output-token limit).
59
+
60
+ ### Step 3 — Present depth options
61
+
62
+ Present this block **before** answering, using the actual estimated numbers:
63
+
64
+ ```
65
+ Analyzing your prompt...
66
+
67
+ Input: ~[N] tokens | Type: [type] | Complexity: [level] | Language: [lang]
68
+
69
+ Choose your depth level:
70
+
71
+ [1] Essential (25%) -> ~[tokens] Direct answer only, no preamble
72
+ [2] Moderate (50%) -> ~[tokens] Answer + context + 1 example
73
+ [3] Detailed (75%) -> ~[tokens] Full answer with alternatives
74
+ [4] Exhaustive (100%) -> ~[tokens] Everything, no limits
75
+
76
+ Which level? (1-4 or say "25% depth", "50% depth", "75% depth", "100% depth")
77
+
78
+ Precision: heuristic estimate ~85-90% accuracy (±15%).
79
+ ```
80
+
81
+ Level token estimates (within the response window):
82
+ - 25% → `min + (max - min) × 0.25`
83
+ - 50% → `min + (max - min) × 0.50`
84
+ - 75% → `min + (max - min) × 0.75`
85
+ - 100% → `max`
86
+
87
+ ### Step 4 — Respond at the chosen level
88
+
89
+ | Level | Target length | Include | Omit |
90
+ |------------------|---------------------|-----------------------------------------------------|---------------------------------------------------|
91
+ | 25% Essential | 2-4 sentences max | Direct answer, key conclusion | Context, examples, nuance, alternatives |
92
+ | 50% Moderate | 1-3 paragraphs | Answer + necessary context + 1 example | Deep analysis, edge cases, references |
93
+ | 75% Detailed | Structured response | Multiple examples, pros/cons, alternatives | Extreme edge cases, exhaustive references |
94
+ | 100% Exhaustive | No restriction | Everything — full analysis, all code, all perspectives | Nothing |
95
+
96
+ ## Shortcuts — skip the question
97
+
98
+ If the user already signals a level, respond at that level immediately without asking:
99
+
100
+ | What they say | Level |
101
+ |----------------------------------------------------|-------|
102
+ | "1" / "25% depth" / "short version" / "brief answer" / "tldr" | 25% |
103
+ | "2" / "50% depth" / "moderate depth" / "balanced answer" | 50% |
104
+ | "3" / "75% depth" / "detailed answer" / "thorough answer" | 75% |
105
+ | "4" / "100% depth" / "exhaustive answer" / "full deep dive" | 100% |
106
+
107
+ If the user set a level earlier in the session, **maintain it silently** for subsequent responses unless they change it.
108
+
109
+ ## Precision note
110
+
111
+ This skill uses heuristic estimation — no real tokenizer. Accuracy ~85-90%, variance ±15%. Always show the disclaimer.
112
+
113
+ ## Examples
114
+
115
+ ### Triggers
116
+
117
+ - "Give me the short version first."
118
+ - "How many tokens will your answer use?"
119
+ - "Respond at 50% depth."
120
+ - "I want the exhaustive answer, not the summary."
121
+ - "Dame la version corta y luego la detallada."
122
+
123
+ ### Does Not Trigger
124
+
125
+ - "What is a JWT token?"
126
+ - "The checkout flow uses a payment token."
127
+ - "Is this normal?"
128
+ - "Complete the refactor."
129
+ - Follow-up questions after the user already chose a depth for the session
130
+
131
+ ## Source
132
+
133
+ Standalone skill from [TBA — Token Budget Advisor for Claude Code](https://github.com/Xabilimon1/Token-Budget-Advisor-Claude-Code-).
134
+ Original project also ships a Python estimator script, but this repository keeps the skill self-contained and heuristic-only.
@@ -0,0 +1,466 @@
1
+ ---
2
+ name: ui-demo
3
+ description: Record polished UI demo videos using Playwright. Use when the user asks to create a demo, walkthrough, screen recording, or tutorial video of a web application. Produces WebM videos with visible cursor, natural pacing, and professional feel.
4
+ metadata:
5
+ origin: ECC
6
+ ---
7
+
8
+ # UI Demo Video Recorder
9
+
10
+ Record polished demo videos of web applications using Playwright's video recording with an injected cursor overlay, natural pacing, and storytelling flow.
11
+
12
+ ## When to Use
13
+
14
+ - User asks for a "demo video", "screen recording", "walkthrough", or "tutorial"
15
+ - User wants to showcase a feature or workflow visually
16
+ - User needs a video for documentation, onboarding, or stakeholder presentation
17
+
18
+ ## Three-Phase Process
19
+
20
+ Every demo goes through three phases: **Discover -> Rehearse -> Record**. Never skip straight to recording.
21
+
22
+ ---
23
+
24
+ ## Phase 1: Discover
25
+
26
+ Before writing any script, explore the target pages to understand what is actually there.
27
+
28
+ ### Why
29
+
30
+ You cannot script what you have not seen. Fields may be `<input>` not `<textarea>`, dropdowns may be custom components not `<select>`, and comment boxes may support `@mentions` or `#tags`. Assumptions break recordings silently.
31
+
32
+ ### How
33
+
34
+ Navigate to each page in the flow and dump its interactive elements:
35
+
36
+ ```javascript
37
+ // Run this for each page in the flow BEFORE writing the demo script
38
+ const fields = await page.evaluate(() => {
39
+ const els = [];
40
+ document.querySelectorAll('input, select, textarea, button, [contenteditable]').forEach(el => {
41
+ if (el.offsetParent !== null) {
42
+ els.push({
43
+ tag: el.tagName,
44
+ type: el.type || '',
45
+ name: el.name || '',
46
+ placeholder: el.placeholder || '',
47
+ text: el.textContent?.trim().substring(0, 40) || '',
48
+ contentEditable: el.contentEditable === 'true',
49
+ role: el.getAttribute('role') || '',
50
+ });
51
+ }
52
+ });
53
+ return els;
54
+ });
55
+ console.log(JSON.stringify(fields, null, 2));
56
+ ```
57
+
58
+ ### What to look for
59
+
60
+ - **Form fields**: Are they `<select>`, `<input>`, custom dropdowns, or comboboxes?
61
+ - **Select options**: Dump option values AND text. Placeholders often have `value="0"` or `value=""` which looks non-empty. Use `Array.from(el.options).map(o => ({ value: o.value, text: o.text }))`. Skip options where text includes "Select" or value is `"0"`.
62
+ - **Rich text**: Does the comment box support `@mentions`, `#tags`, markdown, or emoji? Check placeholder text.
63
+ - **Required fields**: Which fields block form submission? Check `required`, `*` in labels, and try submitting empty to see validation errors.
64
+ - **Dynamic content**: Do fields appear after other fields are filled?
65
+ - **Button labels**: Exact text such as `"Submit"`, `"Submit Request"`, or `"Send"`.
66
+ - **Table column headers**: For table-driven modals, map each `input[type="number"]` to its column header instead of assuming all numeric inputs mean the same thing.
67
+
68
+ ### Output
69
+
70
+ A field map for each page, used to write correct selectors in the script. Example:
71
+
72
+ ```text
73
+ /purchase-requests/new:
74
+ - Budget Code: <select> (first select on page, 4 options)
75
+ - Desired Delivery: <input type="date">
76
+ - Context: <textarea> (not input)
77
+ - BOM table: inline-editable cells with span.cursor-pointer -> input pattern
78
+ - Submit: <button> text="Submit"
79
+
80
+ /purchase-requests/N (detail):
81
+ - Comment: <input placeholder="Type a message..."> supports @user and #PR tags
82
+ - Send: <button> text="Send" (disabled until input has content)
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Phase 2: Rehearse
88
+
89
+ Run through all steps without recording. Verify every selector resolves.
90
+
91
+ ### Why
92
+
93
+ Silent selector failures are the main reason demo recordings break. Rehearsal catches them before you waste a recording.
94
+
95
+ ### How
96
+
97
+ Use `ensureVisible`, a wrapper that logs and fails loudly:
98
+
99
+ ```javascript
100
+ async function ensureVisible(page, locator, label) {
101
+ const el = typeof locator === 'string' ? page.locator(locator).first() : locator;
102
+ const visible = await el.isVisible().catch(() => false);
103
+ if (!visible) {
104
+ const msg = `REHEARSAL FAIL: "${label}" not found - selector: ${typeof locator === 'string' ? locator : '(locator object)'}`;
105
+ console.error(msg);
106
+ const found = await page.evaluate(() => {
107
+ return Array.from(document.querySelectorAll('button, input, select, textarea, a'))
108
+ .filter(el => el.offsetParent !== null)
109
+ .map(el => `${el.tagName}[${el.type || ''}] "${el.textContent?.trim().substring(0, 30)}"`)
110
+ .join('\n ');
111
+ });
112
+ console.error(' Visible elements:\n ' + found);
113
+ return false;
114
+ }
115
+ console.log(`REHEARSAL OK: "${label}"`);
116
+ return true;
117
+ }
118
+ ```
119
+
120
+ ### Rehearsal script structure
121
+
122
+ ```javascript
123
+ const steps = [
124
+ { label: 'Login email field', selector: '#email' },
125
+ { label: 'Login submit', selector: 'button[type="submit"]' },
126
+ { label: 'New Request button', selector: 'button:has-text("New Request")' },
127
+ { label: 'Budget Code select', selector: 'select' },
128
+ { label: 'Delivery date', selector: 'input[type="date"]:visible' },
129
+ { label: 'Description field', selector: 'textarea:visible' },
130
+ { label: 'Add Item button', selector: 'button:has-text("Add Item")' },
131
+ { label: 'Submit button', selector: 'button:has-text("Submit")' },
132
+ ];
133
+
134
+ let allOk = true;
135
+ for (const step of steps) {
136
+ if (!await ensureVisible(page, step.selector, step.label)) {
137
+ allOk = false;
138
+ }
139
+ }
140
+ if (!allOk) {
141
+ console.error('REHEARSAL FAILED - fix selectors before recording');
142
+ process.exit(1);
143
+ }
144
+ console.log('REHEARSAL PASSED - all selectors verified');
145
+ ```
146
+
147
+ ### When rehearsal fails
148
+
149
+ 1. Read the visible-element dump.
150
+ 2. Find the correct selector.
151
+ 3. Update the script.
152
+ 4. Re-run rehearsal.
153
+ 5. Only proceed when every selector passes.
154
+
155
+ ---
156
+
157
+ ## Phase 3: Record
158
+
159
+ Only after discovery and rehearsal pass should you create the recording.
160
+
161
+ ### Recording Principles
162
+
163
+ #### 1. Storytelling Flow
164
+
165
+ Plan the video as a story. Follow user-specified order, or use this default:
166
+
167
+ - **Entry**: Login or navigate to the starting point
168
+ - **Context**: Pan the surroundings so viewers orient themselves
169
+ - **Action**: Perform the main workflow steps
170
+ - **Variation**: Show a secondary feature such as settings, theme, or localization
171
+ - **Result**: Show the outcome, confirmation, or new state
172
+
173
+ #### 2. Pacing
174
+
175
+ - After login: `4s`
176
+ - After navigation: `3s`
177
+ - After clicking a button: `2s`
178
+ - Between major steps: `1.5-2s`
179
+ - After the final action: `3s`
180
+ - Typing delay: `25-40ms` per character
181
+
182
+ #### 3. Cursor Overlay
183
+
184
+ Inject an SVG arrow cursor that follows mouse movements:
185
+
186
+ ```javascript
187
+ async function injectCursor(page) {
188
+ await page.evaluate(() => {
189
+ if (document.getElementById('demo-cursor')) return;
190
+ const cursor = document.createElement('div');
191
+ cursor.id = 'demo-cursor';
192
+ cursor.innerHTML = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
193
+ <path d="M5 3L19 12L12 13L9 20L5 3Z" fill="white" stroke="black" stroke-width="1.5" stroke-linejoin="round"/>
194
+ </svg>`;
195
+ cursor.style.cssText = `
196
+ position: fixed; z-index: 999999; pointer-events: none;
197
+ width: 24px; height: 24px;
198
+ transition: left 0.1s, top 0.1s;
199
+ filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));
200
+ `;
201
+ cursor.style.left = '0px';
202
+ cursor.style.top = '0px';
203
+ document.body.appendChild(cursor);
204
+ document.addEventListener('mousemove', (e) => {
205
+ cursor.style.left = e.clientX + 'px';
206
+ cursor.style.top = e.clientY + 'px';
207
+ });
208
+ });
209
+ }
210
+ ```
211
+
212
+ Call `injectCursor(page)` after every page navigation because the overlay is destroyed on navigate.
213
+
214
+ #### 4. Mouse Movement
215
+
216
+ Never teleport the cursor. Move to the target before clicking:
217
+
218
+ ```javascript
219
+ async function moveAndClick(page, locator, label, opts = {}) {
220
+ const { postClickDelay = 800, ...clickOpts } = opts;
221
+ const el = typeof locator === 'string' ? page.locator(locator).first() : locator;
222
+ const visible = await el.isVisible().catch(() => false);
223
+ if (!visible) {
224
+ console.error(`WARNING: moveAndClick skipped - "${label}" not visible`);
225
+ return false;
226
+ }
227
+ try {
228
+ await el.scrollIntoViewIfNeeded();
229
+ await page.waitForTimeout(300);
230
+ const box = await el.boundingBox();
231
+ if (box) {
232
+ await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2, { steps: 10 });
233
+ await page.waitForTimeout(400);
234
+ }
235
+ await el.click(clickOpts);
236
+ } catch (e) {
237
+ console.error(`WARNING: moveAndClick failed on "${label}": ${e.message}`);
238
+ return false;
239
+ }
240
+ await page.waitForTimeout(postClickDelay);
241
+ return true;
242
+ }
243
+ ```
244
+
245
+ Every call should include a descriptive `label` for debugging.
246
+
247
+ #### 5. Typing
248
+
249
+ Type visibly, not instant-fill:
250
+
251
+ ```javascript
252
+ async function typeSlowly(page, locator, text, label, charDelay = 35) {
253
+ const el = typeof locator === 'string' ? page.locator(locator).first() : locator;
254
+ const visible = await el.isVisible().catch(() => false);
255
+ if (!visible) {
256
+ console.error(`WARNING: typeSlowly skipped - "${label}" not visible`);
257
+ return false;
258
+ }
259
+ await moveAndClick(page, el, label);
260
+ await el.fill('');
261
+ await el.pressSequentially(text, { delay: charDelay });
262
+ await page.waitForTimeout(500);
263
+ return true;
264
+ }
265
+ ```
266
+
267
+ #### 6. Scrolling
268
+
269
+ Use smooth scroll instead of jumps:
270
+
271
+ ```javascript
272
+ await page.evaluate(() => window.scrollTo({ top: 400, behavior: 'smooth' }));
273
+ await page.waitForTimeout(1500);
274
+ ```
275
+
276
+ #### 7. Dashboard Panning
277
+
278
+ When showing a dashboard or overview page, move the cursor across key elements:
279
+
280
+ ```javascript
281
+ async function panElements(page, selector, maxCount = 6) {
282
+ const elements = await page.locator(selector).all();
283
+ for (let i = 0; i < Math.min(elements.length, maxCount); i++) {
284
+ try {
285
+ const box = await elements[i].boundingBox();
286
+ if (box && box.y < 700) {
287
+ await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2, { steps: 8 });
288
+ await page.waitForTimeout(600);
289
+ }
290
+ } catch (e) {
291
+ console.warn(`WARNING: panElements skipped element ${i} (selector: "${selector}"): ${e.message}`);
292
+ }
293
+ }
294
+ }
295
+ ```
296
+
297
+ #### 8. Subtitles
298
+
299
+ Inject a subtitle bar at the bottom of the viewport:
300
+
301
+ ```javascript
302
+ async function injectSubtitleBar(page) {
303
+ await page.evaluate(() => {
304
+ if (document.getElementById('demo-subtitle')) return;
305
+ const bar = document.createElement('div');
306
+ bar.id = 'demo-subtitle';
307
+ bar.style.cssText = `
308
+ position: fixed; bottom: 0; left: 0; right: 0; z-index: 999998;
309
+ text-align: center; padding: 12px 24px;
310
+ background: rgba(0, 0, 0, 0.75);
311
+ color: white; font-family: -apple-system, "Segoe UI", sans-serif;
312
+ font-size: 16px; font-weight: 500; letter-spacing: 0.3px;
313
+ transition: opacity 0.3s;
314
+ pointer-events: none;
315
+ `;
316
+ bar.textContent = '';
317
+ bar.style.opacity = '0';
318
+ document.body.appendChild(bar);
319
+ });
320
+ }
321
+
322
+ async function showSubtitle(page, text) {
323
+ await page.evaluate((t) => {
324
+ const bar = document.getElementById('demo-subtitle');
325
+ if (!bar) return;
326
+ if (t) {
327
+ bar.textContent = t;
328
+ bar.style.opacity = '1';
329
+ } else {
330
+ bar.style.opacity = '0';
331
+ }
332
+ }, text);
333
+ if (text) await page.waitForTimeout(800);
334
+ }
335
+ ```
336
+
337
+ Call `injectSubtitleBar(page)` alongside `injectCursor(page)` after every navigation.
338
+
339
+ Usage pattern:
340
+
341
+ ```javascript
342
+ await showSubtitle(page, 'Step 1 - Logging in');
343
+ await showSubtitle(page, 'Step 2 - Dashboard overview');
344
+ await showSubtitle(page, '');
345
+ ```
346
+
347
+ Guidelines:
348
+
349
+ - Keep subtitle text short, ideally under 60 characters.
350
+ - Use `Step N - Action` format for consistency.
351
+ - Clear the subtitle during long pauses where the UI can speak for itself.
352
+
353
+ ## Script Template
354
+
355
+ ```javascript
356
+ 'use strict';
357
+ const { chromium } = require('playwright');
358
+ const path = require('path');
359
+ const fs = require('fs');
360
+
361
+ const BASE_URL = process.env.QA_BASE_URL || 'http://localhost:3000';
362
+ const VIDEO_DIR = path.join(__dirname, 'screenshots');
363
+ const OUTPUT_NAME = 'demo-FEATURE.webm';
364
+ const REHEARSAL = process.argv.includes('--rehearse');
365
+
366
+ // Paste injectCursor, injectSubtitleBar, showSubtitle, moveAndClick,
367
+ // typeSlowly, ensureVisible, and panElements here.
368
+
369
+ (async () => {
370
+ const browser = await chromium.launch({ headless: true });
371
+
372
+ if (REHEARSAL) {
373
+ const context = await browser.newContext({ viewport: { width: 1280, height: 720 } });
374
+ const page = await context.newPage();
375
+ // Navigate through the flow and run ensureVisible for each selector.
376
+ await browser.close();
377
+ return;
378
+ }
379
+
380
+ const context = await browser.newContext({
381
+ recordVideo: { dir: VIDEO_DIR, size: { width: 1280, height: 720 } },
382
+ viewport: { width: 1280, height: 720 }
383
+ });
384
+ const page = await context.newPage();
385
+
386
+ try {
387
+ await injectCursor(page);
388
+ await injectSubtitleBar(page);
389
+
390
+ await showSubtitle(page, 'Step 1 - Logging in');
391
+ // login actions
392
+
393
+ await page.goto(`${BASE_URL}/dashboard`);
394
+ await injectCursor(page);
395
+ await injectSubtitleBar(page);
396
+ await showSubtitle(page, 'Step 2 - Dashboard overview');
397
+ // pan dashboard
398
+
399
+ await showSubtitle(page, 'Step 3 - Main workflow');
400
+ // action sequence
401
+
402
+ await showSubtitle(page, 'Step 4 - Result');
403
+ // final reveal
404
+ await showSubtitle(page, '');
405
+ } catch (err) {
406
+ console.error('DEMO ERROR:', err.message);
407
+ } finally {
408
+ await context.close();
409
+ const video = page.video();
410
+ if (video) {
411
+ const src = await video.path();
412
+ const dest = path.join(VIDEO_DIR, OUTPUT_NAME);
413
+ try {
414
+ fs.copyFileSync(src, dest);
415
+ console.log('Video saved:', dest);
416
+ } catch (e) {
417
+ console.error('ERROR: Failed to copy video:', e.message);
418
+ console.error(' Source:', src);
419
+ console.error(' Destination:', dest);
420
+ }
421
+ }
422
+ await browser.close();
423
+ }
424
+ })();
425
+ ```
426
+
427
+ Usage:
428
+
429
+ ```bash
430
+ # Phase 2: Rehearse
431
+ node demo-script.cjs --rehearse
432
+
433
+ # Phase 3: Record
434
+ node demo-script.cjs
435
+ ```
436
+
437
+ ## Checklist Before Recording
438
+
439
+ - [ ] Discovery phase completed
440
+ - [ ] Rehearsal passes with all selectors OK
441
+ - [ ] Headless mode enabled
442
+ - [ ] Resolution set to `1280x720`
443
+ - [ ] Cursor and subtitle overlays re-injected after every navigation
444
+ - [ ] `showSubtitle(page, 'Step N - ...')` used at major transitions
445
+ - [ ] `moveAndClick` used for all clicks with descriptive labels
446
+ - [ ] `typeSlowly` used for visible input
447
+ - [ ] No silent catches; helpers log warnings
448
+ - [ ] Smooth scrolling used for content reveal
449
+ - [ ] Key pauses are visible to a human viewer
450
+ - [ ] Flow matches the requested story order
451
+ - [ ] Script reflects the actual UI discovered in phase 1
452
+
453
+ ## Common Pitfalls
454
+
455
+ 1. Cursor disappears after navigation - re-inject it.
456
+ 2. Video is too fast - add pauses.
457
+ 3. Cursor is a dot instead of an arrow - use the SVG overlay.
458
+ 4. Cursor teleports - move before clicking.
459
+ 5. Select dropdowns look wrong - show the move, then pick the option.
460
+ 6. Modals feel abrupt - add a read pause before confirming.
461
+ 7. Video file path is random - copy it to a stable output name.
462
+ 8. Selector failures are swallowed - never use silent catch blocks.
463
+ 9. Field types were assumed - discover them first.
464
+ 10. Features were assumed - inspect the actual UI before scripting.
465
+ 11. Placeholder select values look real - watch for `"0"` and `"Select..."`.
466
+ 12. Popups create separate videos - capture popup pages explicitly and merge later if needed.