cue-ai 0.9.0 → 0.9.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 (310) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +82 -33
  3. package/bin/cue-review-progress +107 -0
  4. package/bin/cue-review-watch +98 -0
  5. package/dist/cue.js +7352 -3744
  6. package/package.json +16 -5
  7. package/profiles/_types.ts +9 -0
  8. package/profiles/backend/profile.yaml +2 -0
  9. package/profiles/blog-writer/profile.yaml +10 -0
  10. package/profiles/browser/profile.yaml +9 -2
  11. package/profiles/builder/profile.yaml +3 -6
  12. package/profiles/career/profile.yaml +13 -2
  13. package/profiles/claude-api/profile.yaml +1 -1
  14. package/profiles/commerce/profile.yaml +27 -3
  15. package/profiles/core/logo.png +0 -0
  16. package/profiles/core/profile.yaml +62 -2
  17. package/profiles/dash-merge-test/profile.yaml +109 -0
  18. package/profiles/designer/profile.yaml +2 -0
  19. package/profiles/designer-medusa-next/profile.yaml +4 -1
  20. package/profiles/designer-medusa-vite/profile.yaml +4 -1
  21. package/profiles/docs-writer/profile.yaml +3 -1
  22. package/profiles/eu-tender-research/README.md +48 -0
  23. package/profiles/eu-tender-research/logo.png +0 -0
  24. package/profiles/eu-tender-research/profile.yaml +108 -0
  25. package/profiles/finance/logo.png +0 -0
  26. package/profiles/finance/profile.yaml +46 -0
  27. package/profiles/frontend/profile.yaml +5 -9
  28. package/profiles/growth/profile.yaml +2 -3
  29. package/profiles/gstack/profile.yaml +15 -0
  30. package/profiles/higgsfield/profile.yaml +3 -0
  31. package/profiles/hyperframes/logo.png +0 -0
  32. package/profiles/hyperframes/profile.yaml +59 -0
  33. package/profiles/improver/profile.yaml +88 -0
  34. package/profiles/marketing/profile.yaml +0 -3
  35. package/profiles/medusa-dev/profile.yaml +2 -0
  36. package/profiles/medusa-next/profile.yaml +2 -3
  37. package/profiles/medusa-vite/profile.yaml +2 -3
  38. package/profiles/n8n/logo.png +0 -0
  39. package/profiles/n8n/profile.yaml +50 -0
  40. package/profiles/nextjs/profile.yaml +2 -3
  41. package/profiles/ops/profile.yaml +2 -0
  42. package/profiles/postizz/profile.yaml +13 -3
  43. package/profiles/python/profile.yaml +3 -0
  44. package/profiles/research/profile.yaml +3 -1
  45. package/profiles/schema.json +10 -0
  46. package/profiles/secops/profile.yaml +2 -0
  47. package/profiles/seo/profile.yaml +56 -0
  48. package/profiles/skill-writer/profile.yaml +8 -0
  49. package/profiles/ssh/profile.yaml +32 -0
  50. package/profiles/strapi/logo.png +0 -0
  51. package/profiles/strapi/profile.yaml +45 -0
  52. package/profiles/stripe/logo.png +0 -0
  53. package/profiles/stripe/profile.yaml +1 -0
  54. package/profiles/supabase/logo.png +0 -0
  55. package/profiles/supabase/profile.yaml +85 -0
  56. package/profiles/vercel/logo.png +0 -0
  57. package/profiles/vercel/profile.yaml +25 -1
  58. package/profiles/vite/profile.yaml +4 -3
  59. package/profiles/web-frontend-base/profile.yaml +5 -4
  60. package/profiles/webshop/profile.yaml +23 -5
  61. package/profiles/x-growth-bot/profile.yaml +44 -0
  62. package/resources/icons/generate-icons.py +128 -2
  63. package/resources/mcps/configs/claude.sanitized.json +42 -0
  64. package/resources/mcps/configs/codex.sanitized.json +7 -0
  65. package/resources/skills/skills/career/resume-version-manager/SKILL.md +351 -0
  66. package/resources/skills/skills/career/salary-negotiation-prep/SKILL.md +378 -0
  67. package/resources/skills/skills/content/pdf/SKILL.md +2 -0
  68. package/resources/skills/skills/content/postiz-cards/SKILL.md +48 -0
  69. package/resources/skills/skills/content/postiz-cards/scripts/analytics.sh +38 -0
  70. package/resources/skills/skills/content/postiz-cards/scripts/card.sh +42 -0
  71. package/resources/skills/skills/content/postiz-cards/scripts/lint.py +38 -0
  72. package/resources/skills/skills/design/headless-gif-demo/SKILL.md +1 -1
  73. package/resources/skills/skills/design/readme-svg-design/SKILL.md +1 -1
  74. package/resources/skills/skills/eu-funding/grant-outreach/SKILL.md +70 -0
  75. package/resources/skills/skills/eu-funding/hu-grant-finder/SKILL.md +114 -0
  76. package/resources/skills/skills/eu-funding/hu-grant-finder/evals.md +26 -0
  77. package/resources/skills/skills/eu-funding/ted-tender-search/SKILL.md +80 -0
  78. package/resources/skills/skills/eu-funding/ted-tender-search/evals.md +26 -0
  79. package/resources/skills/skills/eu-funding/ted-tender-search/scripts/ted-search.sh +46 -0
  80. package/resources/skills/skills/event-design/wedding-invitations/SKILL.md +1 -1
  81. package/resources/skills/skills/github/gx-agents/SKILL.md +96 -0
  82. package/resources/skills/skills/gstack/design-shotgun/SKILL.md +1 -1
  83. package/resources/skills/skills/marketing/ab-test-analyzer/SKILL.md +1 -1
  84. package/resources/skills/skills/marketing/ab-test-setup-and-analysis/SKILL.md +1 -1
  85. package/resources/skills/skills/marketing/account-structure-review/SKILL.md +1 -1
  86. package/resources/skills/skills/marketing/ad-copy-variant-generator/SKILL.md +1 -1
  87. package/resources/skills/skills/marketing/ad-extension-audit/SKILL.md +1 -1
  88. package/resources/skills/skills/marketing/ad-spend-allocator/SKILL.md +1 -1
  89. package/resources/skills/skills/marketing/anomaly-detection/SKILL.md +1 -1
  90. package/resources/skills/skills/marketing/attribution-model-comparison/SKILL.md +1 -1
  91. package/resources/skills/skills/marketing/audience-overlap-analysis/SKILL.md +7 -1
  92. package/resources/skills/skills/marketing/bid-strategy-recommendations/SKILL.md +7 -1
  93. package/resources/skills/skills/marketing/budget-scenario-planner/SKILL.md +6 -1
  94. package/resources/skills/skills/marketing/campaign-naming-convention-builder/SKILL.md +7 -1
  95. package/resources/skills/skills/marketing/channel-mix-optimizer/SKILL.md +7 -1
  96. package/resources/skills/skills/marketing/client-report-narratives/SKILL.md +6 -1
  97. package/resources/skills/skills/marketing/competitor-creative-analysis/SKILL.md +1 -1
  98. package/resources/skills/skills/marketing/competitor-teardown/SKILL.md +1 -1
  99. package/resources/skills/skills/marketing/content-repurposer/SKILL.md +1 -1
  100. package/resources/skills/skills/marketing/conversion-path-analysis/SKILL.md +1 -1
  101. package/resources/skills/skills/marketing/cpa-diagnostics/SKILL.md +1 -1
  102. package/resources/skills/skills/marketing/creative-fatigue-detection/SKILL.md +1 -1
  103. package/resources/skills/skills/marketing/day-hour-performance-breakdown/SKILL.md +1 -1
  104. package/resources/skills/skills/marketing/device-performance-split/SKILL.md +1 -1
  105. package/resources/skills/skills/marketing/e2e-seo-assistant/SKILL.md +1 -1
  106. package/resources/skills/skills/marketing/email-sequence-writer/SKILL.md +1 -1
  107. package/resources/skills/skills/marketing/frequency-cap-recommendations/SKILL.md +1 -1
  108. package/resources/skills/skills/marketing/geo-performance-analysis/SKILL.md +1 -1
  109. package/resources/skills/skills/marketing/google-ads-audit/SKILL.md +1 -1
  110. package/resources/skills/skills/marketing/icp-research-assistant/SKILL.md +1 -1
  111. package/resources/skills/skills/marketing/keyword-cannibalization-check/SKILL.md +1 -1
  112. package/resources/skills/skills/marketing/landing-page-audit/SKILL.md +1 -1
  113. package/resources/skills/skills/marketing/landing-page-audit-quick/SKILL.md +1 -1
  114. package/resources/skills/skills/marketing/linkedin-ads-audit/SKILL.md +1 -1
  115. package/resources/skills/skills/marketing/meta-ads-audit/SKILL.md +1 -1
  116. package/resources/skills/skills/marketing/pacing-monitor/SKILL.md +1 -1
  117. package/resources/skills/skills/marketing/performance-benchmarking/SKILL.md +1 -1
  118. package/resources/skills/skills/marketing/programmatic-seo-builder/SKILL.md +1 -1
  119. package/resources/skills/skills/marketing/quality-score-breakdown/SKILL.md +1 -1
  120. package/resources/skills/skills/marketing/reddit-ads-audit/SKILL.md +1 -1
  121. package/resources/skills/skills/marketing/retargeting-window-analysis/SKILL.md +1 -1
  122. package/resources/skills/skills/marketing/roas-forecasting/SKILL.md +1 -1
  123. package/resources/skills/skills/marketing/search-term-mining/SKILL.md +1 -1
  124. package/resources/skills/skills/marketing/utm-tracking-generator/SKILL.md +1 -1
  125. package/resources/skills/skills/marketing/wasted-spend-finder/SKILL.md +1 -1
  126. package/resources/skills/skills/marketing/weekly-account-summary/SKILL.md +1 -1
  127. package/resources/skills/skills/meta/awesome-list-submit/SKILL.md +4 -4
  128. package/resources/skills/skills/meta/cue-dashboard/SKILL.md +109 -0
  129. package/resources/skills/skills/meta/cue-developer/SKILL.md +161 -0
  130. package/resources/skills/skills/meta/cue-developer/evals/evals.json +57 -0
  131. package/resources/skills/skills/meta/cue-developer/references/architecture.md +65 -0
  132. package/resources/skills/skills/meta/cue-developer/references/build_and_test.md +72 -0
  133. package/resources/skills/skills/meta/cue-developer/references/contributing.md +75 -0
  134. package/resources/skills/skills/meta/cue-developer/references/conventions.md +57 -0
  135. package/resources/skills/skills/meta/cue-developer/references/first_time_setup.md +51 -0
  136. package/resources/skills/skills/meta/cue-developer/references/skill_and_mcp_authoring.md +84 -0
  137. package/resources/skills/skills/meta/cue-developer/references/troubleshooting.md +42 -0
  138. package/resources/skills/skills/meta/delegation-check/SKILL.md +148 -0
  139. package/resources/skills/skills/meta/delegation-check/specs/scan-algorithm.md +125 -0
  140. package/resources/skills/skills/meta/delegation-check/specs/separation-rules.md +190 -0
  141. package/resources/skills/skills/meta/focus/SKILL.md +62 -0
  142. package/resources/skills/skills/meta/help/SKILL.md +1 -1
  143. package/resources/skills/skills/meta/integrity-tags/SKILL.md +2 -0
  144. package/resources/skills/skills/meta/next-steps/SKILL.md +124 -0
  145. package/resources/skills/skills/meta/next-steps/evals/eval-set.json +92 -0
  146. package/resources/skills/skills/meta/profile-from-docs/SKILL.md +141 -0
  147. package/resources/skills/skills/meta/ralph-loop/SKILL.md +83 -0
  148. package/resources/skills/skills/meta/ralph-loop/scripts/loop.sh +73 -0
  149. package/resources/skills/skills/meta/skill-simplify/SKILL.md +136 -0
  150. package/resources/skills/skills/meta/skill-simplify/phases/01-analysis.md +173 -0
  151. package/resources/skills/skills/meta/skill-simplify/phases/02-optimize.md +104 -0
  152. package/resources/skills/skills/meta/skill-simplify/phases/03-check.md +145 -0
  153. package/resources/skills/skills/meta/smart-loader/scripts/smart-lookup.sh +13 -4
  154. package/resources/skills/skills/meta/verify-council/SKILL.md +182 -0
  155. package/resources/skills/skills/meta/verify-council/references/lane-prompts.md +103 -0
  156. package/resources/skills/skills/meta/verify-council/references/workflow.js +217 -0
  157. package/resources/skills/skills/nvidia/aiq-research/SKILL.md +1 -1
  158. package/resources/skills/skills/nvidia/cuopt-developer/SKILL.md +16 -1
  159. package/resources/skills/skills/nvidia/cuopt-developer/resources/contributing.md +2 -2
  160. package/resources/skills/skills/nvidia/cuopt-developer/resources/numerical_debugging.md +128 -0
  161. package/resources/skills/skills/nvidia/cuopt-developer/resources/python_bindings.md +2 -9
  162. package/resources/skills/skills/nvidia/cuopt-developer/resources/vrp_skills.md +166 -0
  163. package/resources/skills/skills/nvidia/cuopt-install/SKILL.md +2 -10
  164. package/resources/skills/skills/nvidia/cuopt-numerical-optimization-api-c/SKILL.md +3 -23
  165. package/resources/skills/skills/nvidia/cuopt-numerical-optimization-api-c/resources/examples.md +40 -20
  166. package/resources/skills/skills/nvidia/cuopt-numerical-optimization-api-python/SKILL.md +5 -1
  167. package/resources/skills/skills/nvidia/skill-evolution/SKILL.md +4 -5
  168. package/resources/skills/skills/research/trendradar/SKILL.md +1 -1
  169. package/resources/skills/skills/ssh/ssh-config/SKILL.md +94 -0
  170. package/resources/skills/skills/ssh/ssh-copy/SKILL.md +92 -0
  171. package/resources/skills/skills/ssh/ssh-harden/SKILL.md +108 -0
  172. package/resources/skills/skills/ssh/ssh-keys/SKILL.md +82 -0
  173. package/resources/skills/skills/ssh/ssh-paste-image/LICENSE +28 -0
  174. package/resources/skills/skills/ssh/ssh-paste-image/SKILL.md +149 -0
  175. package/resources/skills/skills/ssh/ssh-paste-image/scripts/build.sh +29 -0
  176. package/resources/skills/skills/ssh/ssh-paste-image/scripts/client/go.mod +3 -0
  177. package/resources/skills/skills/ssh/ssh-paste-image/scripts/client/main.go +79 -0
  178. package/resources/skills/skills/ssh/ssh-paste-image/scripts/daemon/ccimgd.service +12 -0
  179. package/resources/skills/skills/ssh/ssh-paste-image/scripts/daemon/com.ccimgd.plist +20 -0
  180. package/resources/skills/skills/ssh/ssh-paste-image/scripts/daemon/go.mod +3 -0
  181. package/resources/skills/skills/ssh/ssh-paste-image/scripts/daemon/main.go +98 -0
  182. package/resources/skills/skills/ssh/ssh-tunnel/SKILL.md +96 -0
  183. package/resources/skills/skills/strapi/building-with-strapi/SKILL.md +112 -0
  184. package/resources/skills/skills/strapi/strapi-cli/SKILL.md +93 -0
  185. package/resources/skills/skills/strapi/strapi-content-api/SKILL.md +115 -0
  186. package/resources/skills/skills/strapi/strapi-deploy/SKILL.md +89 -0
  187. package/resources/skills/skills/strapi/strapi-mcp-setup/SKILL.md +101 -0
  188. package/resources/skills/skills/strapi/strapi-plugins/SKILL.md +97 -0
  189. package/resources/skills/skills/tools/context7/SKILL.md +101 -0
  190. package/resources/skills/skills/tools/opensrc/SKILL.md +1 -1
  191. package/resources/skills/skills/tools/portless/SKILL.md +186 -0
  192. package/resources/skills/skills/xbot/operate/SKILL.md +229 -0
  193. package/src/commands/_index.ts +8 -0
  194. package/src/commands/ai-score.e2e.test.ts +11 -4
  195. package/src/commands/ai.ts +3 -4
  196. package/src/commands/auto-detect.ts +1 -1
  197. package/src/commands/cli.test.ts +1 -2
  198. package/src/commands/cli.ts +1 -1
  199. package/src/commands/cloud.ts +1 -1
  200. package/src/commands/current.ts +1 -4
  201. package/src/commands/dash.test.ts +110 -0
  202. package/src/commands/dash.ts +194 -0
  203. package/src/commands/dashboard.ts +26 -0
  204. package/src/commands/diff.ts +1 -1
  205. package/src/commands/discover.test.ts +1 -1
  206. package/src/commands/discover.ts +90 -40
  207. package/src/commands/doctor.test.ts +58 -0
  208. package/src/commands/doctor.ts +79 -3
  209. package/src/commands/eval-behavior.ts +1 -1
  210. package/src/commands/eval.ts +2 -2
  211. package/src/commands/evolve.ts +4 -3
  212. package/src/commands/failures.test.ts +1 -1
  213. package/src/commands/features-batch1.test.ts +6 -1
  214. package/src/commands/icon.ts +1 -5
  215. package/src/commands/import-profile.ts +1 -1
  216. package/src/commands/init.ts +50 -7
  217. package/src/commands/install-sh.e2e.test.ts +65 -0
  218. package/src/commands/launch-handoff.e2e.test.ts +88 -0
  219. package/src/commands/launch.e2e.test.ts +8 -1
  220. package/src/commands/launch.test.ts +29 -0
  221. package/src/commands/launch.ts +185 -131
  222. package/src/commands/lock.ts +0 -1
  223. package/src/commands/marketplace.ts +0 -4
  224. package/src/commands/materialize.ts +1 -1
  225. package/src/commands/mem.ts +341 -0
  226. package/src/commands/optimizer.ts +0 -3
  227. package/src/commands/playground.ts +1 -2
  228. package/src/commands/profile-draft-skill.ts +1 -1
  229. package/src/commands/replay-whatif.ts +1 -6
  230. package/src/commands/score.ts +2 -2
  231. package/src/commands/security.test.ts +88 -0
  232. package/src/commands/security.ts +74 -28
  233. package/src/commands/shell.test.ts +65 -4
  234. package/src/commands/shell.ts +67 -7
  235. package/src/commands/skills-test.ts +0 -1
  236. package/src/commands/skills.ts +28 -2
  237. package/src/commands/sources.ts +1 -2
  238. package/src/commands/status.ts +2 -6
  239. package/src/commands/submit-profile.ts +1 -1
  240. package/src/commands/suggest.ts +35 -10
  241. package/src/commands/trigger-gaps.test.ts +50 -0
  242. package/src/commands/trigger-gaps.ts +63 -29
  243. package/src/commands/update.ts +1 -1
  244. package/src/commands/validate.ts +16 -4
  245. package/src/commands/watch-live.ts +1 -1
  246. package/src/commands/workspace.ts +1 -1
  247. package/src/index.ts +26 -10
  248. package/src/lib/active-sessions.ts +1 -1
  249. package/src/lib/agent-adapters.test.ts +100 -0
  250. package/src/lib/agent-adapters.ts +2 -2
  251. package/src/lib/analytics.test.ts +88 -0
  252. package/src/lib/analytics.ts +82 -1
  253. package/src/lib/auto-detect.test.ts +10 -4
  254. package/src/lib/auto-detect.ts +19 -23
  255. package/src/lib/brand-icons.ts +0 -1
  256. package/src/lib/cache.ts +2 -3
  257. package/src/lib/claude-mem-env.test.ts +148 -0
  258. package/src/lib/claude-mem-env.ts +172 -0
  259. package/src/lib/combo-history.test.ts +53 -0
  260. package/src/lib/combo-history.ts +83 -0
  261. package/src/lib/companion-detect.test.ts +108 -0
  262. package/src/lib/companion-detect.ts +140 -0
  263. package/src/lib/companion-fetch.ts +4 -6
  264. package/src/lib/conditional-skills.test.ts +1 -1
  265. package/src/lib/config-paths.test.ts +53 -0
  266. package/src/lib/config-paths.ts +33 -0
  267. package/src/lib/dashboard-server.test.ts +351 -0
  268. package/src/lib/dashboard-server.ts +1476 -27
  269. package/src/lib/debug-log.test.ts +66 -0
  270. package/src/lib/debug-log.ts +45 -0
  271. package/src/lib/mcp-catalog.test.ts +102 -0
  272. package/src/lib/mcp-catalog.ts +193 -0
  273. package/src/lib/pair-suggestions.test.ts +111 -0
  274. package/src/lib/pair-suggestions.ts +98 -5
  275. package/src/lib/permissions.test.ts +76 -0
  276. package/src/lib/permissions.ts +125 -0
  277. package/src/lib/picker.test.ts +1106 -1
  278. package/src/lib/picker.ts +1230 -142
  279. package/src/lib/plugin-discovery.ts +126 -0
  280. package/src/lib/pr-poster.ts +1 -1
  281. package/src/lib/pr-throttle.ts +2 -6
  282. package/src/lib/profile-linter.test.ts +67 -1
  283. package/src/lib/profile-linter.ts +59 -14
  284. package/src/lib/profile-loader.test.ts +21 -0
  285. package/src/lib/profile-loader.ts +22 -3
  286. package/src/lib/profile-metrics.ts +2 -6
  287. package/src/lib/profile-names.test.ts +58 -0
  288. package/src/lib/repos.test.ts +57 -0
  289. package/src/lib/repos.ts +167 -0
  290. package/src/lib/resolver-npx.ts +10 -1
  291. package/src/lib/runtime-materializer.test.ts +200 -3
  292. package/src/lib/runtime-materializer.ts +129 -20
  293. package/src/lib/shared-profiles.ts +2 -3
  294. package/src/lib/skill-clis.test.ts +113 -0
  295. package/src/lib/skill-clis.ts +232 -0
  296. package/src/lib/skill-dependencies.ts +9 -1
  297. package/src/lib/skill-deps.ts +1 -1
  298. package/src/lib/skill-linter.ts +1 -1
  299. package/src/lib/skill-quality.ts +0 -1
  300. package/src/lib/skill-sandbox.test.ts +1 -1
  301. package/src/lib/skills-lock.test.ts +1 -1
  302. package/src/lib/telemetry-consent.ts +3 -5
  303. package/src/lib/telemetry-report.test.ts +2 -2
  304. package/src/lib/token-budget.ts +111 -0
  305. package/src/lib/trigger-gaps.test.ts +70 -0
  306. package/src/lib/trigger-gaps.ts +48 -6
  307. package/src/lib/tui/data.ts +1 -5
  308. package/src/lib/workflow-store.ts +150 -0
  309. package/src/lib/workspace-secrets.ts +0 -4
  310. package/src/lib/workspaces.ts +1 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ All notable changes to cue (`cue-ai`) are documented here.
4
+ The format follows [Keep a Changelog](https://keepachangelog.com/), and the project
5
+ adheres to [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [0.9.2] — 2026-06-05
8
+
9
+ ### Added
10
+
11
+ - **Live code-review visibility.** Watch an independent review move file-by-file in
12
+ real time instead of staring at an opaque "Precipitating…" spinner.
13
+ - `bin/cue-review-watch` — live renderer; run it in a second pane to follow the
14
+ latest review (`--id <id>` for a specific one, `--once` for a snapshot).
15
+ - `bin/cue-review-progress` — append-only progress events to
16
+ `~/.config/cue/review-progress/<id>.jsonl` (the shared schema every reviewer writes).
17
+ - `/code-review` now emits per-file / per-dimension / per-finding progress events.
18
+ - The `auto-review` Stop-hook gate streams its review to the same log, so the
19
+ independent merge-gate review is watchable live too (invariants unchanged:
20
+ recursion guard, fail-open, binary verdict).
21
+ - Docs: [`docs/review-visibility.md`](./docs/review-visibility.md).
22
+ - **Self-learner (experimental · opt-in · default-OFF).** Profiles capture where their
23
+ skills fell short during a task and feed gated improvements back over time.
24
+ - `resources/hooks/profile-self-improve.sh` — friction-signal capture plus an optional
25
+ live critic agent. Recursion-guarded, never blocks Stop, runs the critic at most once
26
+ per session, fully fail-open.
27
+ - New `skill_gap` analytics event (`src/lib/analytics.ts`), inert to existing readers.
28
+ - Piloted on the `skill-writer` profile. Enable with
29
+ `touch ~/.config/cue/.auto-improve-enabled`. Docs: [`docs/self-learner.md`](./docs/self-learner.md).
30
+
31
+ ### Documentation
32
+
33
+ - **README — "what you'll see during a run — the reviewer".** Explains the independent
34
+ review gate that runs during a Claude Code session: why a red "Stop hook error" means
35
+ the gate is working (not a failure), how to suppress or disable it, and how to watch a
36
+ review live with `cue-review-watch`. Includes a real catch (a `weight` kg/g unit
37
+ ambiguity that would have rendered per-kg prices as `€0.00`).
38
+
39
+ [0.9.2]: https://github.com/opencue/cuecards/compare/v0.9.1...v0.9.2
40
+ [0.9.1]: https://github.com/opencue/cuecards/releases/tag/v0.9.1
package/README.md CHANGED
@@ -14,10 +14,10 @@
14
14
  "applicationCategory": "DeveloperApplication",
15
15
  "operatingSystem": "Linux, macOS, Windows (WSL2)",
16
16
  "description": "cuecards is an open-source agent profile manager for Claude Code, OpenAI Codex, Cursor, Cline, Gemini CLI, GitHub Copilot, Windsurf, Roo Code, Sourcegraph Amp, and Aider. One cuecard per directory — skills, MCPs, plugins, persona, playbooks, gates. Cut per-message token cost 10–25×.",
17
- "url": "https://github.com/opencue/claude-code-skills",
17
+ "url": "https://github.com/opencue/cuecards",
18
18
  "downloadUrl": "https://www.npmjs.com/package/cue-ai",
19
- "codeRepository": "https://github.com/opencue/claude-code-skills",
20
- "license": "https://github.com/opencue/claude-code-skills/blob/main/LICENSE",
19
+ "codeRepository": "https://github.com/opencue/cuecards",
20
+ "license": "https://github.com/opencue/cuecards/blob/main/LICENSE",
21
21
  "programmingLanguage": "TypeScript",
22
22
  "runtimePlatform": "Bun",
23
23
  "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }
@@ -48,8 +48,8 @@
48
48
  <p align="center">
49
49
  <a href="https://www.npmjs.com/package/cue-ai"><img src="https://img.shields.io/npm/v/cue-ai?style=flat-square&label=npm&color=1d1d1f&labelColor=f5f5f7" alt="npm"></a>&nbsp;
50
50
  <a href="https://www.npmjs.com/package/cue-ai"><img src="https://img.shields.io/npm/dw/cue-ai?style=flat-square&label=downloads&color=1d1d1f&labelColor=f5f5f7" alt="downloads"></a>&nbsp;
51
- <a href="https://github.com/opencue/claude-code-skills/stargazers"><img src="https://img.shields.io/github/stars/opencue/claude-code-skills?style=flat-square&label=stars&color=1d1d1f&labelColor=f5f5f7" alt="stars"></a>&nbsp;
52
- <a href="./LICENSE"><img src="https://img.shields.io/github/license/opencue/claude-code-skills?style=flat-square&label=license&color=1d1d1f&labelColor=f5f5f7" alt="MIT"></a>&nbsp;
51
+ <a href="https://github.com/opencue/cuecards/stargazers"><img src="https://img.shields.io/github/stars/opencue/cuecards?style=flat-square&label=stars&color=1d1d1f&labelColor=f5f5f7" alt="stars"></a>&nbsp;
52
+ <a href="./LICENSE"><img src="https://img.shields.io/github/license/opencue/cuecards?style=flat-square&label=license&color=1d1d1f&labelColor=f5f5f7" alt="MIT"></a>&nbsp;
53
53
  <img src="https://img.shields.io/badge/telemetry-none-1d1d1f?style=flat-square&labelColor=f5f5f7" alt="zero telemetry">
54
54
  </p>
55
55
 
@@ -59,6 +59,12 @@
59
59
  <code>npm install -g cue-ai</code>
60
60
  </p>
61
61
 
62
+ <p align="center">
63
+ <sub>Requires Node ≥20 and an existing <a href="https://github.com/anthropics/claude-code">Claude Code</a> or <a href="https://github.com/openai/codex">Codex</a> install — cue is a thin shim that exec's your agent, not a replacement.</sub>
64
+ <br>
65
+ <sub>package <code>cue-ai</code> &nbsp;·&nbsp; command <code>cue</code> &nbsp;·&nbsp; repo <a href="https://github.com/opencue/cuecards"><code>opencue/cuecards</code></a></sub>
66
+ </p>
67
+
62
68
  <br>
63
69
  <br>
64
70
 
@@ -87,11 +93,15 @@ One cuecard per project. Your agent reads the right one the moment you launch.
87
93
 
88
94
  ```bash
89
95
  npm install -g cue-ai # 1. install
90
- cue discover search "code review" # 2. find a skill
91
- cue discover install review/code-review # 3. add it
92
- claude # 4. launch — the cuecard is loaded
96
+ cue shell install # 2. activate the claude shim (one-time; --codex adds codex)
97
+ cue discover search "code review" # 3. find a skill
98
+ cue discover install review/code-review # 4. add it
99
+ claude # 5. launch — the cuecard is loaded
93
100
  ```
94
101
 
102
+ > Step 2 is what makes `claude` load your cuecard: it installs a `~/.local/bin/claude`
103
+ > shim that hands off to `cue launch`. Skip it and `claude` just runs vanilla Claude Code.
104
+
95
105
  Search. Install. Use. No config files to edit. Works the same with `codex`, `cursor`, `cline`, `gemini`, and five other agents.
96
106
 
97
107
  <p align="center">
@@ -132,11 +142,11 @@ Search. Install. Use. No config files to edit. Works the same with `codex`, `cur
132
142
  ## by the numbers.
133
143
 
134
144
  <p align="center">
135
- <strong>10–25×</strong>&nbsp;&nbsp;token cost reduction
145
+ <strong>up to ~16×</strong>&nbsp;&nbsp;leaner always-on context
136
146
  <br><br>
137
147
  <strong>&lt; 5 ms</strong>&nbsp;&nbsp;warm launch overhead
138
148
  <br><br>
139
- <strong>69</strong>&nbsp;&nbsp;pre-built cuecards · <strong>110+</strong> local skills
149
+ <strong>69</strong>&nbsp;&nbsp;pre-built cuecards · <strong>330+</strong> local skills
140
150
  <br><br>
141
151
  <strong>10</strong>&nbsp;&nbsp;AI coding agents supported
142
152
  <br><br>
@@ -149,19 +159,19 @@ Search. Install. Use. No config files to edit. Works the same with `codex`, `cur
149
159
 
150
160
  ## the money shot.
151
161
 
152
- > Loading everything costs you tokens on every single message. cuecards cut context size by 10–25×.
162
+ > Loading everything costs you tokens on every single message. cuecards cut your always-on context ~9–16× and you can reproduce every number below with `cue cost --compare`.
153
163
 
154
- | Scenario | Context loaded | Cost per session (Sonnet) |
164
+ | Loadout | Always-on context | Cost / 100 msgs (Sonnet input) |
155
165
  |---|---|---|
156
- | **Without cuecards** — all skills + every MCP | ~180k tokens | ~$2.70 😱 |
157
- | **With cuecards** — `backend` profile | ~8k tokens | ~$0.12 ✅ |
158
- | **With cuecards** — `caveman-quick` | ~2k tokens | ~$0.03 🚀 |
166
+ | **Without cuecards** — `full` (every skill + MCP) | ~81k tokens | ~$24 😱 |
167
+ | **With cuecards** — `backend` profile | ~9k tokens | ~$2.70 ✅ |
168
+ | **With cuecards** — `caveman-quick` | ~6.8k tokens | ~$2.00 🚀 |
159
169
 
160
- That's **22× fewer tokens** on a real backend loadout vs the unmanaged baseline. Your model picks the right tool faster because it's not scanning irrelevant descriptions on every message.
170
+ That's **~9× fewer always-on tokens** on a backend loadout (≈12× on `caveman-quick`, up to ≈16× on the leanest profiles) versus loading everything. Your model also picks the right tool faster because it's not scanning irrelevant descriptions on every message.
161
171
 
162
172
  ```bash
163
173
  cue cost # token budget for your active profile
164
- cue cost --profile full # compare against the "everything" baseline
174
+ cue cost --compare # full table: every profile ranked vs the `full` baseline
165
175
  ```
166
176
 
167
177
  <br>
@@ -170,7 +180,7 @@ cue cost --profile full # compare against the "everything" baseline
170
180
 
171
181
  ## why cuecards.
172
182
 
173
- - **Cut per-message token cost 10–25×.** Skills, MCPs, and plugins scoped per directory, not globally loaded into every session.
183
+ - **Cut always-on context up to ~16×.** Skills, MCPs, and plugins scoped per directory, not globally loaded into every session — reproduce it with `cue cost --compare`.
174
184
  - **Five-dimensional agents.** Persona + playbooks + quality gates + evals + failure loop. Not just "more tools loaded" — composable expertise.
175
185
  - **One cuecard, ten agents.** The same `profile.yaml` materializes into Claude Code, Codex, Cursor, Cline, Gemini, Copilot, Windsurf, Roo, Amp, and Aider native formats.
176
186
 
@@ -210,6 +220,44 @@ Full system + when each tag fires: **[`resources/skills/skills/meta/integrity-ta
210
220
 
211
221
  ---
212
222
 
223
+ ## what you'll see during a run — the reviewer.
224
+
225
+ cuecards can ship an **independent review gate**. When the agent finishes a
226
+ code-producing turn in a cuecard that enables it, cue spawns a *fresh, separate*
227
+ reviewer agent over the working-tree diff **before the turn is allowed to finish**.
228
+ It runs as a normal step of a Claude Code run — so expect to see a reviewer agent
229
+ think for a while (a deep pass can run many minutes and tens of thousands of tokens).
230
+ This is by design, and it earns its keep.
231
+
232
+ A real catch from a live session: the reviewer flagged a **load-bearing unit bug** —
233
+ a product's `weight` was treated as kilograms in one place but grams in two others
234
+ (`weight >= 1000 ? kg : g`). Left in, the per-kg price renders as `€0.00` and a cart
235
+ reads `20000 kg`. The gate held the merge until it was fixed.
236
+
237
+ Two things so the behavior isn't surprising:
238
+
239
+ - **A red "Stop hook error" is the gate working, not a failure.** Claude Code renders
240
+ any *blocking* hook that way. It means the reviewer found a CRITICAL/HIGH issue and is
241
+ holding the turn until you address it. It caps at 2 rounds, then releases. Suppress it
242
+ for one turn with `[skip-auto-review]` in your message; turn it off entirely with
243
+ `rm ~/.config/cue/auto-review-enabled`.
244
+ - **You can watch the review live.** A long review otherwise shows only a spinner. Run
245
+ `cue-review-watch` in a second pane to see it move file-by-file with findings as they land:
246
+
247
+ ```
248
+ 16:42:03 📄 setup-plate-variants.ts
249
+ 16:42:03 → unit convention
250
+ 16:42:09 🔴 CRITICAL weight kg/g ambiguity → per-kg price shows €0.00
251
+ 16:45:30 ✅ review complete 1 CRITICAL
252
+ ```
253
+
254
+ Enable the gate with `touch ~/.config/cue/auto-review-enabled`. Full details:
255
+ [`docs/review-visibility.md`](./docs/review-visibility.md).
256
+
257
+ <br>
258
+
259
+ ---
260
+
213
261
  ## the catalog.
214
262
 
215
263
  > One repo. 69 pre-built expert agents. Pin one with `cue use <name>` and `claude` launches with that cuecard's skills, MCPs, hooks, and commands materialized.
@@ -307,8 +355,7 @@ cue list # see all available profiles
307
355
 
308
356
  # Measure
309
357
  cue cost # token budget for active profile
310
- cue eval --breakdown # per-message vs on-demand
311
- cue eval --compare a b # side-by-side delta
358
+ cue cost --compare # every profile ranked vs the `full` baseline
312
359
 
313
360
  # System dependencies
314
361
  cue cli install --all --yes # install every missing CLI
@@ -335,12 +382,13 @@ cue doctor --fix # diff declared vs actual state, auto-repair
335
382
  npm install -g cue-ai
336
383
  ```
337
384
 
338
- Then in any project:
385
+ Then activate the shim once, and pin a profile in any project:
339
386
 
340
387
  ```bash
388
+ cue shell install # one-time: installs the claude shim (--codex for codex)
341
389
  cd ~/projects/q4-launch
342
390
  echo marketing > .cue-profile
343
- claude
391
+ claude # launches with the marketing cuecard
344
392
  ```
345
393
 
346
394
  <details>
@@ -348,9 +396,10 @@ claude
348
396
 
349
397
  | Path | Command |
350
398
  |---|---|
351
- | One-line script | `curl -fsSL https://raw.githubusercontent.com/opencue/claude-code-skills/main/get.sh \| bash` |
352
- | Manual clone | `git clone https://github.com/opencue/claude-code-skills.git ~/Documents/cue && ~/Documents/cue/install.sh` |
353
- | Per-OS bootstrap | paste [`setup/macos.md`](./setup/macos.md) · [`setup/linux.md`](./setup/linux.md) · [`setup/windows.md`](./setup/windows.md) into Claude Code |
399
+ | One-line script | `curl -fsSL https://raw.githubusercontent.com/opencue/cuecards/main/get.sh \| bash` |
400
+ | Manual clone | `git clone https://github.com/opencue/cuecards.git ~/Documents/cue && ~/Documents/cue/install.sh` |
401
+ | Lean stack (core + caveman + RTK only, cross-OS) | paste [`setup/lean-cue.md`](./setup/lean-cue.md) into Claude Code |
402
+ | Per-OS bootstrap (full stack) | paste [`setup/macos.md`](./setup/macos.md) · [`setup/linux.md`](./setup/linux.md) · [`setup/windows.md`](./setup/windows.md) into Claude Code |
354
403
 
355
404
  </details>
356
405
 
@@ -440,11 +489,11 @@ The bits that didn't fit on the landing page:
440
489
 
441
490
  | Project | Profile | What they do |
442
491
  |---|---|---|
443
- | [opencue/claude-code-skills](https://github.com/opencue/claude-code-skills) | `full`, `skill-writer` | Dogfooding cue on itself |
492
+ | [opencue/cuecards](https://github.com/opencue/cuecards) | `full`, `skill-writer` | Dogfooding cue on itself |
444
493
  | [recodeee/colony](https://github.com/recodeee/colony) | `fleet-control` | Multi-agent coordination MCP |
445
494
  | [recodeee/gitguardex](https://github.com/recodeee/gitguardex) | `backend` | Branch + worktree isolation for parallel agents |
446
495
 
447
- > **Using cue?** Open a PR or drop a link in [Discussions](https://github.com/opencue/claude-code-skills/discussions).
496
+ > **Using cue?** Open a PR or drop a link in [Discussions](https://github.com/opencue/cuecards/discussions).
448
497
 
449
498
  <br>
450
499
 
@@ -452,11 +501,11 @@ The bits that didn't fit on the landing page:
452
501
 
453
502
  ## star history.
454
503
 
455
- <a href="https://star-history.com/#opencue/claude-code-skills&Date">
504
+ <a href="https://star-history.com/#opencue/cuecards&Date">
456
505
  <picture>
457
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=opencue/claude-code-skills&type=Date&theme=dark" />
458
- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=opencue/claude-code-skills&type=Date" />
459
- <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=opencue/claude-code-skills&type=Date" width="720" />
506
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=opencue/cuecards&type=Date&theme=dark" />
507
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=opencue/cuecards&type=Date" />
508
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=opencue/cuecards&type=Date" width="720" />
460
509
  </picture>
461
510
  </a>
462
511
 
@@ -467,7 +516,7 @@ The bits that didn't fit on the landing page:
467
516
  ## contributing.
468
517
 
469
518
  ```bash
470
- git clone https://github.com/opencue/claude-code-skills.git
519
+ git clone https://github.com/opencue/cuecards.git
471
520
  cd cue && bun install
472
521
  bun test # tests (lib + commands)
473
522
  bun run src/index.ts --help # run locally
@@ -478,6 +527,6 @@ bun run src/index.ts --help # run locally
478
527
  | Add a skill | `cue skills-new <name>` then edit `resources/skills/skills/<category>/<name>/SKILL.md` |
479
528
  | Add a profile | `cue new <name>` then `cue validate <name>` |
480
529
  | Share your profile | `cue share publish --profile <name>` |
481
- | Report a bug | [Open an issue](https://github.com/opencue/claude-code-skills/issues) |
530
+ | Report a bug | [Open an issue](https://github.com/opencue/cuecards/issues) |
482
531
 
483
532
  License: [MIT](./LICENSE).
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env bash
2
+ # cue-review-progress — emit live code-review progress events to a tail-able JSONL
3
+ # so `cue-review-watch` (or a dashboard panel) can show what a reviewer is doing
4
+ # in REAL TIME instead of an opaque spinner. No external deps.
5
+ #
6
+ # Any reviewer (the auto-review Stop hook, a code-reviewer subagent, /ship Step 9,
7
+ # a review workflow) appends one event per file / dimension / finding. The shared
8
+ # schema is the contract — see docs/review-visibility.md.
9
+ #
10
+ # Storage: ~/.config/cue/review-progress/<id>.jsonl (append-only)
11
+ # ~/.config/cue/review-progress/latest (pointer file holding <id>)
12
+ #
13
+ # Event schema (one JSON object per line):
14
+ # ts ISO-8601 UTC (auto)
15
+ # id review id
16
+ # kind start | file | dim | finding | note | end
17
+ # file path under review (file/dim/finding)
18
+ # dim dimension/lens being checked (dim/finding)
19
+ # severity CRITICAL|HIGH|MEDIUM|LOW (finding)
20
+ # title short text (finding/note/start/end)
21
+ # detail longer text (optional)
22
+ #
23
+ # Usage:
24
+ # cue-review-progress start [--id <id>] [--label <text>] [--files <n>] # prints id
25
+ # cue-review-progress emit [--id <id>] --kind <file|dim|finding|note> \
26
+ # [--file <p>] [--dim <d>] [--severity <S>] \
27
+ # [--title <t>] [--detail <x>]
28
+ # cue-review-progress end [--id <id>] [--summary <text>]
29
+ # cue-review-progress path [--id <id>] # print the jsonl path
30
+ # cue-review-progress latest # print current latest id
31
+ set -euo pipefail
32
+
33
+ DIR="${XDG_CONFIG_HOME:-$HOME/.config}/cue/review-progress"
34
+ mkdir -p "$DIR"
35
+
36
+ # JSON string escape: drop C0 control chars (a raw tab/newline breaks the line),
37
+ # then escape backslash and double-quote.
38
+ esc() { printf '%s' "${1:-}" | tr -d '\000-\037' | sed 's/\\/\\\\/g; s/"/\\"/g'; }
39
+ now() { date -u +%Y-%m-%dT%H:%M:%S.000Z; }
40
+
41
+ resolve_id() { # $1 = explicit id (may be empty)
42
+ if [[ -n "${1:-}" ]]; then printf '%s' "$1"; return; fi
43
+ if [[ -r "$DIR/latest" ]]; then head -1 "$DIR/latest"; return; fi
44
+ printf ''
45
+ }
46
+
47
+ cmd="${1:-}"; shift || true
48
+ ID="" KIND="" FILE="" DIM="" SEV="" TITLE="" DETAIL="" LABEL="" FILES="" SUMMARY=""
49
+ while [[ $# -gt 0 ]]; do
50
+ case "$1" in
51
+ --id) ID="$2"; shift 2 ;;
52
+ --kind) KIND="$2"; shift 2 ;;
53
+ --file) FILE="$2"; shift 2 ;;
54
+ --dim) DIM="$2"; shift 2 ;;
55
+ --severity) SEV="$2"; shift 2 ;;
56
+ --title) TITLE="$2"; shift 2 ;;
57
+ --detail) DETAIL="$2"; shift 2 ;;
58
+ --label) LABEL="$2"; shift 2 ;;
59
+ --files) FILES="$2"; shift 2 ;;
60
+ --summary) SUMMARY="$2"; shift 2 ;;
61
+ *) echo "cue-review-progress: unknown flag $1" >&2; exit 1 ;;
62
+ esac
63
+ done
64
+
65
+ append() { # $1 = full json object (without trailing newline)
66
+ printf '%s\n' "$1" >> "$DIR/$RID.jsonl"
67
+ }
68
+
69
+ case "$cmd" in
70
+ start)
71
+ RID="${ID:-rev-$(date -u +%Y%m%dT%H%M%SZ)-$$}"
72
+ printf '%s' "$RID" > "$DIR/latest"
73
+ : > "$DIR/$RID.jsonl"
74
+ append "$(printf '{"ts":"%s","id":"%s","kind":"start","title":"%s","detail":"%s"}' \
75
+ "$(now)" "$(esc "$RID")" "$(esc "$LABEL")" "$(esc "$FILES")")"
76
+ printf '%s\n' "$RID"
77
+ ;;
78
+ emit)
79
+ RID="$(resolve_id "$ID")"
80
+ [[ -z "$RID" ]] && { echo "cue-review-progress emit: no review id (run 'start' first or pass --id)" >&2; exit 1; }
81
+ case "$KIND" in
82
+ file|dim|finding|note) ;;
83
+ "") echo "cue-review-progress emit: --kind required (file|dim|finding|note)" >&2; exit 1 ;;
84
+ *) echo "cue-review-progress emit: invalid --kind '$KIND'" >&2; exit 1 ;;
85
+ esac
86
+ append "$(printf '{"ts":"%s","id":"%s","kind":"%s","file":"%s","dim":"%s","severity":"%s","title":"%s","detail":"%s"}' \
87
+ "$(now)" "$(esc "$RID")" "$KIND" "$(esc "$FILE")" "$(esc "$DIM")" "$(esc "$SEV")" "$(esc "$TITLE")" "$(esc "$DETAIL")")"
88
+ ;;
89
+ end)
90
+ RID="$(resolve_id "$ID")"
91
+ [[ -z "$RID" ]] && exit 0
92
+ append "$(printf '{"ts":"%s","id":"%s","kind":"end","title":"%s"}' \
93
+ "$(now)" "$(esc "$RID")" "$(esc "$SUMMARY")")"
94
+ ;;
95
+ path)
96
+ RID="$(resolve_id "$ID")"; [[ -z "$RID" ]] && { echo "no review yet" >&2; exit 1; }
97
+ printf '%s\n' "$DIR/$RID.jsonl"
98
+ ;;
99
+ latest)
100
+ [[ -r "$DIR/latest" ]] && head -1 "$DIR/latest" || { echo "no review yet" >&2; exit 1; }
101
+ ;;
102
+ ""|-h|--help|help)
103
+ sed -n '2,/^set -e/p' "$0" | sed 's/^# \{0,1\}//; s/^set -.*//'
104
+ ;;
105
+ *)
106
+ echo "cue-review-progress: unknown subcommand '$cmd' (start|emit|end|path|latest)" >&2; exit 1 ;;
107
+ esac
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env bash
2
+ # cue-review-watch — live view of a code review in progress. Run it in a second
3
+ # pane and watch the reviewer move file-by-file, dimension-by-dimension, with
4
+ # findings as they land — instead of an opaque "Precipitating…" spinner.
5
+ #
6
+ # Reads the JSONL written by cue-review-progress (and the auto-review Stop hook).
7
+ #
8
+ # Usage:
9
+ # cue-review-watch # follow the latest review, live
10
+ # cue-review-watch --id <id> # follow a specific review
11
+ # cue-review-watch --once # print what's there so far and exit (no follow)
12
+ set -euo pipefail
13
+
14
+ DIR="${XDG_CONFIG_HOME:-$HOME/.config}/cue/review-progress"
15
+ ID="" ONCE=0
16
+ while [[ $# -gt 0 ]]; do
17
+ case "$1" in
18
+ --id) ID="$2"; shift 2 ;;
19
+ --once) ONCE=1; shift ;;
20
+ -h|--help) grep '^#' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
21
+ *) echo "cue-review-watch: unknown flag $1" >&2; exit 1 ;;
22
+ esac
23
+ done
24
+
25
+ # Colors only on a tty.
26
+ if [[ -t 1 ]]; then
27
+ B=$'\033[1m'; D=$'\033[2m'; R=$'\033[31m'; Y=$'\033[33m'; G=$'\033[32m'; C=$'\033[36m'; M=$'\033[35m'; Z=$'\033[0m'
28
+ else
29
+ B="" D="" R="" Y="" G="" C="" M="" Z=""
30
+ fi
31
+
32
+ have_jq=0; command -v jq >/dev/null 2>&1 && have_jq=1
33
+
34
+ get() { # $1=field (reads $line); jq if present, grep fallback
35
+ if [[ $have_jq -eq 1 ]]; then
36
+ printf '%s' "$line" | jq -r --arg f "$1" '.[$f] // ""' 2>/dev/null
37
+ else
38
+ printf '%s' "$line" | grep -oE "\"$1\"[[:space:]]*:[[:space:]]*\"[^\"]*\"" | head -1 \
39
+ | sed -E "s/.*\"$1\"[[:space:]]*:[[:space:]]*\"([^\"]*)\".*/\1/"
40
+ fi
41
+ }
42
+
43
+ hhmmss() { printf '%s' "${1:-}" | sed -E 's/.*T([0-9:]{8}).*/\1/'; }
44
+
45
+ render() { # reads $line
46
+ local kind ts t file dim sev title detail
47
+ kind="$(get kind)"; [[ -z "$kind" ]] && return 0
48
+ ts="$(get ts)"; t="$(hhmmss "$ts")"
49
+ file="$(get file)"; dim="$(get dim)"; sev="$(get severity)"; title="$(get title)"; detail="$(get detail)"
50
+ case "$kind" in
51
+ start) printf '%s%s▶ review started%s %s%s%s\n' "$D$t $Z" "$B$C" "$Z" "$D" "${detail:+($detail files) }${title}" "$Z" ;;
52
+ file) printf '%s%s📄 %s%s\n' "$D$t $Z" "$B" "$file" "$Z" ;;
53
+ dim) printf '%s %s→ %s%s\n' "$D$t $Z" "$C" "$dim" "$Z" ;;
54
+ finding)
55
+ local col gl
56
+ case "$sev" in
57
+ CRITICAL) col="$R$B"; gl="🔴" ;;
58
+ HIGH) col="$R"; gl="🟠" ;;
59
+ MEDIUM) col="$Y"; gl="🟡" ;;
60
+ *) col="$D"; gl="⚪" ;;
61
+ esac
62
+ printf '%s %s%s %s%s %s%s\n' "$D$t $Z" "$col" "$gl" "${sev:-NOTE}" "$Z" "${file:+$file${dim:+ · $dim} }" "$title"
63
+ [[ -n "$detail" ]] && printf ' %s%s%s\n' "$D" "$detail" "$Z"
64
+ ;;
65
+ note) printf '%s %s· %s%s\n' "$D$t $Z" "$D" "${title}${detail:+: $detail}" "$Z" ;;
66
+ end) printf '%s%s✅ review complete%s %s%s%s\n' "$D$t $Z" "$B$G" "$Z" "$D" "$title" "$Z" ;;
67
+ esac
68
+ }
69
+
70
+ # Resolve the review id / file.
71
+ [[ -z "$ID" && -r "$DIR/latest" ]] && ID="$(head -1 "$DIR/latest")"
72
+ if [[ -z "$ID" ]]; then
73
+ echo "${D}cue-review-watch: no review yet. Start one, or a reviewer will.${Z}" >&2
74
+ fi
75
+
76
+ # Wait for the file to appear (a reviewer may not have started yet).
77
+ file_path="$DIR/${ID:-__none__}.jsonl"
78
+ if [[ ! -e "$file_path" ]]; then
79
+ printf '%swaiting for a review to start (%s)…%s\n' "$D" "$DIR" "$Z"
80
+ while [[ ! -e "$file_path" ]]; do
81
+ # latest may update to a new id while we wait
82
+ [[ -r "$DIR/latest" ]] && ID="$(head -1 "$DIR/latest")" && file_path="$DIR/$ID.jsonl"
83
+ sleep 1
84
+ done
85
+ fi
86
+
87
+ printf '%swatching %s%s\n\n' "$D" "$file_path" "$Z"
88
+
89
+ if [[ $ONCE -eq 1 ]]; then
90
+ while IFS= read -r line; do render; done < "$file_path"
91
+ exit 0
92
+ fi
93
+
94
+ # Follow live. -F keeps following across truncation/rotation.
95
+ tail -n +1 -F "$file_path" 2>/dev/null | while IFS= read -r line; do
96
+ render
97
+ printf '%s' "$(get kind)" | grep -q '^end$' && break || true
98
+ done