luckiest-co 1.0.0 → 1.0.3

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 (618) hide show
  1. package/.claude-plugin/marketplace.json +16 -0
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/LICENSE +24 -0
  4. package/bin/install.js +7 -5
  5. package/commands/{luckiest/finish.md → finish.md} +2 -0
  6. package/commands/go.md +53 -0
  7. package/commands/plan.md +66 -0
  8. package/package.json +16 -5
  9. package/skills/brainstorm/ATTRIBUTION.md +27 -0
  10. package/skills/brainstorm/SKILL.md +139 -0
  11. package/skills/luckiest-ab-testing/ATTRIBUTION.md +35 -0
  12. package/skills/luckiest-ab-testing/CHANGELOG.md +27 -0
  13. package/skills/luckiest-ab-testing/SKILL.md +379 -0
  14. package/skills/luckiest-ab-testing/evals/evals.json +118 -0
  15. package/skills/luckiest-ab-testing/references/sample-size-guide.md +290 -0
  16. package/skills/luckiest-ab-testing/references/test-templates.md +284 -0
  17. package/skills/luckiest-ad-creative/ATTRIBUTION.md +35 -0
  18. package/skills/luckiest-ad-creative/CHANGELOG.md +23 -0
  19. package/skills/luckiest-ad-creative/SKILL.md +393 -0
  20. package/skills/luckiest-ad-creative/evals/evals.json +90 -0
  21. package/skills/luckiest-ad-creative/references/generative-tools.md +637 -0
  22. package/skills/luckiest-ad-creative/references/platform-specs.md +213 -0
  23. package/skills/luckiest-ads/ATTRIBUTION.md +36 -0
  24. package/skills/luckiest-ads/CHANGELOG.md +24 -0
  25. package/skills/luckiest-ads/LICENSE +21 -0
  26. package/skills/luckiest-ads/SKILL.md +434 -0
  27. package/skills/luckiest-ads/evals/evals.json +90 -0
  28. package/skills/luckiest-ads/references/ad-copy-templates.md +207 -0
  29. package/skills/luckiest-ads/references/audience-targeting.md +243 -0
  30. package/skills/luckiest-ads/references/conversion-tracking.md +361 -0
  31. package/skills/luckiest-ads/references/platform-setup-checklists.md +277 -0
  32. package/skills/luckiest-advisors/ATTRIBUTION.md +16 -0
  33. package/skills/luckiest-advisors/CHANGELOG.md +99 -0
  34. package/skills/luckiest-advisors/SKILL.md +151 -0
  35. package/skills/luckiest-aeo-grader/ATTRIBUTION.md +19 -0
  36. package/skills/luckiest-aeo-grader/CHANGELOG.md +52 -0
  37. package/skills/luckiest-aeo-grader/SKILL.md +200 -0
  38. package/skills/luckiest-aeo-grader/evals/evals.json +19 -0
  39. package/skills/luckiest-aeo-grader/references/rubric.md +72 -0
  40. package/skills/luckiest-aeo-grader/scripts/scan.py +265 -0
  41. package/skills/luckiest-ai-seo/ATTRIBUTION.md +38 -0
  42. package/skills/luckiest-ai-seo/CHANGELOG.md +23 -0
  43. package/skills/luckiest-ai-seo/SKILL.md +510 -0
  44. package/skills/luckiest-ai-seo/evals/evals.json +90 -0
  45. package/skills/luckiest-ai-seo/references/content-patterns.md +285 -0
  46. package/skills/luckiest-ai-seo/references/content-types.md +71 -0
  47. package/skills/luckiest-ai-seo/references/okf.md +104 -0
  48. package/skills/luckiest-ai-seo/references/platform-ranking-factors.md +154 -0
  49. package/skills/luckiest-analytics/ATTRIBUTION.md +42 -0
  50. package/skills/luckiest-analytics/CHANGELOG.md +36 -0
  51. package/skills/luckiest-analytics/SKILL.md +380 -0
  52. package/skills/luckiest-analytics/evals/evals.json +90 -0
  53. package/skills/luckiest-analytics/references/event-library.md +260 -0
  54. package/skills/luckiest-analytics/references/ga4-implementation.md +300 -0
  55. package/skills/luckiest-analytics/references/gtm-implementation.md +390 -0
  56. package/skills/luckiest-aso/ATTRIBUTION.md +40 -0
  57. package/skills/luckiest-aso/CHANGELOG.md +33 -0
  58. package/skills/luckiest-aso/SKILL.md +327 -0
  59. package/skills/luckiest-aso/evals/evals.json +91 -0
  60. package/skills/luckiest-aso/references/apple-specs.md +107 -0
  61. package/skills/luckiest-aso/references/benchmarks.md +129 -0
  62. package/skills/luckiest-aso/references/google-play-specs.md +131 -0
  63. package/skills/luckiest-aso/references/report-template.md +213 -0
  64. package/skills/luckiest-aso/references/scoring-criteria.md +213 -0
  65. package/skills/luckiest-churn-prevention/ATTRIBUTION.md +41 -0
  66. package/skills/luckiest-churn-prevention/CHANGELOG.md +24 -0
  67. package/skills/luckiest-churn-prevention/SKILL.md +445 -0
  68. package/skills/luckiest-churn-prevention/evals/evals.json +93 -0
  69. package/skills/luckiest-churn-prevention/references/cancel-flow-patterns.md +316 -0
  70. package/skills/luckiest-churn-prevention/references/dunning-playbook.md +408 -0
  71. package/skills/luckiest-co-marketing/ATTRIBUTION.md +38 -0
  72. package/skills/luckiest-co-marketing/CHANGELOG.md +25 -0
  73. package/skills/luckiest-co-marketing/SKILL.md +331 -0
  74. package/skills/luckiest-co-marketing/evals/evals.json +84 -0
  75. package/skills/luckiest-coder/ATTRIBUTION.md +26 -0
  76. package/skills/luckiest-coder/CHANGELOG.md +30 -0
  77. package/skills/luckiest-coder/SKILL.md +77 -0
  78. package/skills/luckiest-coder/references/antigravity-tools.md +23 -0
  79. package/skills/luckiest-coder/references/codex-tools.md +39 -0
  80. package/skills/luckiest-coder/references/pi-tools.md +16 -0
  81. package/skills/luckiest-coder-brainstorming/ATTRIBUTION.md +26 -0
  82. package/skills/luckiest-coder-brainstorming/CHANGELOG.md +31 -0
  83. package/skills/luckiest-coder-brainstorming/SKILL.md +173 -0
  84. package/skills/luckiest-coder-brainstorming/scripts/frame-template.html +213 -0
  85. package/skills/luckiest-coder-brainstorming/scripts/helper.js +168 -0
  86. package/skills/luckiest-coder-brainstorming/scripts/server.cjs +721 -0
  87. package/skills/luckiest-coder-brainstorming/scripts/start-server.sh +209 -0
  88. package/skills/luckiest-coder-brainstorming/scripts/stop-server.sh +120 -0
  89. package/skills/luckiest-coder-brainstorming/spec-document-reviewer-prompt.md +49 -0
  90. package/skills/luckiest-coder-brainstorming/visual-companion.md +291 -0
  91. package/skills/luckiest-coder-consistency/ATTRIBUTION.md +30 -0
  92. package/skills/luckiest-coder-consistency/CHANGELOG.md +26 -0
  93. package/skills/luckiest-coder-consistency/SKILL.md +98 -0
  94. package/skills/luckiest-coder-constitution/ATTRIBUTION.md +28 -0
  95. package/skills/luckiest-coder-constitution/CHANGELOG.md +25 -0
  96. package/skills/luckiest-coder-constitution/SKILL.md +115 -0
  97. package/skills/luckiest-coder-debugging/ATTRIBUTION.md +26 -0
  98. package/skills/luckiest-coder-debugging/CHANGELOG.md +22 -0
  99. package/skills/luckiest-coder-debugging/CREATION-LOG.md +119 -0
  100. package/skills/luckiest-coder-debugging/SKILL.md +309 -0
  101. package/skills/luckiest-coder-debugging/condition-based-waiting-example.ts +158 -0
  102. package/skills/luckiest-coder-debugging/condition-based-waiting.md +115 -0
  103. package/skills/luckiest-coder-debugging/defense-in-depth.md +122 -0
  104. package/skills/luckiest-coder-debugging/find-polluter.sh +63 -0
  105. package/skills/luckiest-coder-debugging/root-cause-tracing.md +169 -0
  106. package/skills/luckiest-coder-debugging/test-academic.md +14 -0
  107. package/skills/luckiest-coder-debugging/test-pressure-1.md +58 -0
  108. package/skills/luckiest-coder-debugging/test-pressure-2.md +68 -0
  109. package/skills/luckiest-coder-debugging/test-pressure-3.md +69 -0
  110. package/skills/luckiest-coder-dispatching-parallel-agents/ATTRIBUTION.md +26 -0
  111. package/skills/luckiest-coder-dispatching-parallel-agents/CHANGELOG.md +23 -0
  112. package/skills/luckiest-coder-dispatching-parallel-agents/SKILL.md +198 -0
  113. package/skills/luckiest-coder-executing-plans/ATTRIBUTION.md +26 -0
  114. package/skills/luckiest-coder-executing-plans/CHANGELOG.md +22 -0
  115. package/skills/luckiest-coder-executing-plans/SKILL.md +83 -0
  116. package/skills/luckiest-coder-finishing-a-branch/ATTRIBUTION.md +26 -0
  117. package/skills/luckiest-coder-finishing-a-branch/CHANGELOG.md +22 -0
  118. package/skills/luckiest-coder-finishing-a-branch/SKILL.md +258 -0
  119. package/skills/luckiest-coder-git-worktrees/ATTRIBUTION.md +26 -0
  120. package/skills/luckiest-coder-git-worktrees/CHANGELOG.md +22 -0
  121. package/skills/luckiest-coder-git-worktrees/SKILL.md +215 -0
  122. package/skills/luckiest-coder-guard/ATTRIBUTION.md +29 -0
  123. package/skills/luckiest-coder-guard/CHANGELOG.md +48 -0
  124. package/skills/luckiest-coder-guard/LICENSE +21 -0
  125. package/skills/luckiest-coder-guard/SKILL.md +126 -0
  126. package/skills/luckiest-coder-guard/bin/check-careful.sh +65 -0
  127. package/skills/luckiest-coder-guard/bin/check-freeze.sh +48 -0
  128. package/skills/luckiest-coder-qa/ATTRIBUTION.md +28 -0
  129. package/skills/luckiest-coder-qa/CHANGELOG.md +49 -0
  130. package/skills/luckiest-coder-qa/LICENSE +21 -0
  131. package/skills/luckiest-coder-qa/SKILL.md +160 -0
  132. package/skills/luckiest-coder-qa/references/issue-taxonomy.md +85 -0
  133. package/skills/luckiest-coder-qa/references/qa-report-template.md +126 -0
  134. package/skills/luckiest-coder-receiving-code-review/ATTRIBUTION.md +26 -0
  135. package/skills/luckiest-coder-receiving-code-review/CHANGELOG.md +28 -0
  136. package/skills/luckiest-coder-receiving-code-review/SKILL.md +226 -0
  137. package/skills/luckiest-coder-requesting-code-review/ATTRIBUTION.md +26 -0
  138. package/skills/luckiest-coder-requesting-code-review/CHANGELOG.md +31 -0
  139. package/skills/luckiest-coder-requesting-code-review/SKILL.md +118 -0
  140. package/skills/luckiest-coder-requesting-code-review/code-reviewer.md +172 -0
  141. package/skills/luckiest-coder-shipping/ATTRIBUTION.md +26 -0
  142. package/skills/luckiest-coder-shipping/CHANGELOG.md +48 -0
  143. package/skills/luckiest-coder-shipping/LICENSE +21 -0
  144. package/skills/luckiest-coder-shipping/SKILL.md +148 -0
  145. package/skills/luckiest-coder-shipping/references/canary.md +44 -0
  146. package/skills/luckiest-coder-shipping/references/test-and-coverage.md +91 -0
  147. package/skills/luckiest-coder-subagent-driven-development/ATTRIBUTION.md +26 -0
  148. package/skills/luckiest-coder-subagent-driven-development/CHANGELOG.md +28 -0
  149. package/skills/luckiest-coder-subagent-driven-development/SKILL.md +439 -0
  150. package/skills/luckiest-coder-subagent-driven-development/implementer-prompt.md +139 -0
  151. package/skills/luckiest-coder-subagent-driven-development/scripts/review-package +44 -0
  152. package/skills/luckiest-coder-subagent-driven-development/scripts/sdd-workspace +22 -0
  153. package/skills/luckiest-coder-subagent-driven-development/scripts/task-brief +40 -0
  154. package/skills/luckiest-coder-subagent-driven-development/task-reviewer-prompt.md +188 -0
  155. package/skills/luckiest-coder-tdd/ATTRIBUTION.md +26 -0
  156. package/skills/luckiest-coder-tdd/CHANGELOG.md +26 -0
  157. package/skills/luckiest-coder-tdd/SKILL.md +384 -0
  158. package/skills/luckiest-coder-tdd/testing-anti-patterns.md +299 -0
  159. package/skills/luckiest-coder-verification/ATTRIBUTION.md +26 -0
  160. package/skills/luckiest-coder-verification/CHANGELOG.md +22 -0
  161. package/skills/luckiest-coder-verification/SKILL.md +152 -0
  162. package/skills/luckiest-coder-writing-plans/ATTRIBUTION.md +26 -0
  163. package/skills/luckiest-coder-writing-plans/CHANGELOG.md +22 -0
  164. package/skills/luckiest-coder-writing-plans/SKILL.md +191 -0
  165. package/skills/luckiest-coder-writing-plans/plan-document-reviewer-prompt.md +49 -0
  166. package/skills/luckiest-coder-writing-skills/ATTRIBUTION.md +26 -0
  167. package/skills/luckiest-coder-writing-skills/CHANGELOG.md +31 -0
  168. package/skills/luckiest-coder-writing-skills/SKILL.md +702 -0
  169. package/skills/luckiest-coder-writing-skills/anthropic-best-practices.md +1150 -0
  170. package/skills/luckiest-coder-writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  171. package/skills/luckiest-coder-writing-skills/graphviz-conventions.dot +172 -0
  172. package/skills/luckiest-coder-writing-skills/persuasion-principles.md +187 -0
  173. package/skills/luckiest-coder-writing-skills/render-graphs.js +168 -0
  174. package/skills/luckiest-coder-writing-skills/testing-skills-with-subagents.md +384 -0
  175. package/skills/luckiest-cold-email/ATTRIBUTION.md +36 -0
  176. package/skills/luckiest-cold-email/CHANGELOG.md +24 -0
  177. package/skills/luckiest-cold-email/SKILL.md +213 -0
  178. package/skills/luckiest-cold-email/evals/evals.json +94 -0
  179. package/skills/luckiest-cold-email/references/benchmarks.md +83 -0
  180. package/skills/luckiest-cold-email/references/follow-up-sequences.md +81 -0
  181. package/skills/luckiest-cold-email/references/frameworks.md +90 -0
  182. package/skills/luckiest-cold-email/references/personalization.md +79 -0
  183. package/skills/luckiest-cold-email/references/subject-lines.md +53 -0
  184. package/skills/luckiest-community-marketing/ATTRIBUTION.md +41 -0
  185. package/skills/luckiest-community-marketing/CHANGELOG.md +35 -0
  186. package/skills/luckiest-community-marketing/SKILL.md +200 -0
  187. package/skills/luckiest-community-marketing/evals/evals.json +89 -0
  188. package/skills/luckiest-competitor-profiling/ATTRIBUTION.md +36 -0
  189. package/skills/luckiest-competitor-profiling/CHANGELOG.md +24 -0
  190. package/skills/luckiest-competitor-profiling/SKILL.md +443 -0
  191. package/skills/luckiest-competitor-profiling/evals/evals.json +85 -0
  192. package/skills/luckiest-competitor-profiling/references/templates.md +167 -0
  193. package/skills/luckiest-competitor-profiling/references/tool-reference.md +179 -0
  194. package/skills/luckiest-competitors/ATTRIBUTION.md +36 -0
  195. package/skills/luckiest-competitors/CHANGELOG.md +25 -0
  196. package/skills/luckiest-competitors/SKILL.md +171 -0
  197. package/skills/luckiest-competitors/evals/evals.json +93 -0
  198. package/skills/luckiest-competitors/references/content-architecture.md +271 -0
  199. package/skills/luckiest-competitors/references/templates.md +223 -0
  200. package/skills/luckiest-content-strategy/ATTRIBUTION.md +39 -0
  201. package/skills/luckiest-content-strategy/CHANGELOG.md +23 -0
  202. package/skills/luckiest-content-strategy/SKILL.md +395 -0
  203. package/skills/luckiest-content-strategy/evals/evals.json +90 -0
  204. package/skills/luckiest-content-strategy/references/headless-cms.md +194 -0
  205. package/skills/luckiest-copy-editing/ATTRIBUTION.md +41 -0
  206. package/skills/luckiest-copy-editing/CHANGELOG.md +31 -0
  207. package/skills/luckiest-copy-editing/SKILL.md +491 -0
  208. package/skills/luckiest-copy-editing/evals/evals.json +89 -0
  209. package/skills/luckiest-copy-editing/references/checklist.md +66 -0
  210. package/skills/luckiest-copy-editing/references/content-refresh.md +38 -0
  211. package/skills/luckiest-copy-editing/references/plain-english-alternatives.md +394 -0
  212. package/skills/luckiest-copywriting/ATTRIBUTION.md +35 -0
  213. package/skills/luckiest-copywriting/CHANGELOG.md +23 -0
  214. package/skills/luckiest-copywriting/SKILL.md +296 -0
  215. package/skills/luckiest-copywriting/evals/evals.json +111 -0
  216. package/skills/luckiest-copywriting/references/copy-frameworks.md +344 -0
  217. package/skills/luckiest-copywriting/references/natural-transitions.md +272 -0
  218. package/skills/luckiest-cro/ATTRIBUTION.md +34 -0
  219. package/skills/luckiest-cro/CHANGELOG.md +23 -0
  220. package/skills/luckiest-cro/SKILL.md +215 -0
  221. package/skills/luckiest-cro/evals/evals.json +111 -0
  222. package/skills/luckiest-cro/references/experiments.md +248 -0
  223. package/skills/luckiest-cro/references/form.md +422 -0
  224. package/skills/luckiest-customer-research/ATTRIBUTION.md +40 -0
  225. package/skills/luckiest-customer-research/CHANGELOG.md +26 -0
  226. package/skills/luckiest-customer-research/SKILL.md +293 -0
  227. package/skills/luckiest-customer-research/evals/evals.json +162 -0
  228. package/skills/luckiest-customer-research/references/source-guides.md +401 -0
  229. package/skills/luckiest-directory-submissions/ATTRIBUTION.md +40 -0
  230. package/skills/luckiest-directory-submissions/CHANGELOG.md +33 -0
  231. package/skills/luckiest-directory-submissions/SKILL.md +419 -0
  232. package/skills/luckiest-directory-submissions/evals/evals.json +94 -0
  233. package/skills/luckiest-directory-submissions/references/directory-list.md +477 -0
  234. package/skills/luckiest-directory-submissions/references/positioning-variations.md +232 -0
  235. package/skills/luckiest-directory-submissions/references/submission-tracker-template.csv +266 -0
  236. package/skills/luckiest-emails/ATTRIBUTION.md +42 -0
  237. package/skills/luckiest-emails/CHANGELOG.md +33 -0
  238. package/skills/luckiest-emails/SKILL.md +220 -0
  239. package/skills/luckiest-emails/evals/evals.json +93 -0
  240. package/skills/luckiest-emails/references/copy-guidelines.md +120 -0
  241. package/skills/luckiest-emails/references/email-types.md +515 -0
  242. package/skills/luckiest-emails/references/sequence-templates.md +168 -0
  243. package/skills/luckiest-extract-design-system/ATTRIBUTION.md +8 -0
  244. package/skills/luckiest-extract-design-system/CHANGELOG.md +37 -0
  245. package/skills/luckiest-extract-design-system/SKILL.md +83 -0
  246. package/skills/luckiest-free-tools/ATTRIBUTION.md +43 -0
  247. package/skills/luckiest-free-tools/CHANGELOG.md +25 -0
  248. package/skills/luckiest-free-tools/SKILL.md +220 -0
  249. package/skills/luckiest-free-tools/evals/evals.json +90 -0
  250. package/skills/luckiest-free-tools/references/tool-types.md +217 -0
  251. package/skills/luckiest-image/ATTRIBUTION.md +43 -0
  252. package/skills/luckiest-image/CHANGELOG.md +23 -0
  253. package/skills/luckiest-image/SKILL.md +376 -0
  254. package/skills/luckiest-image/evals/evals.json +89 -0
  255. package/skills/luckiest-image/references/ai-image-prompting.md +229 -0
  256. package/skills/luckiest-launch/ATTRIBUTION.md +40 -0
  257. package/skills/luckiest-launch/CHANGELOG.md +43 -0
  258. package/skills/luckiest-launch/SKILL.md +385 -0
  259. package/skills/luckiest-launch/evals/evals.json +91 -0
  260. package/skills/luckiest-lead-magnets/ATTRIBUTION.md +35 -0
  261. package/skills/luckiest-lead-magnets/CHANGELOG.md +23 -0
  262. package/skills/luckiest-lead-magnets/SKILL.md +331 -0
  263. package/skills/luckiest-lead-magnets/evals/evals.json +87 -0
  264. package/skills/luckiest-lead-magnets/references/benchmarks.md +129 -0
  265. package/skills/luckiest-lead-magnets/references/format-guide.md +196 -0
  266. package/skills/luckiest-marketing-ideas/ATTRIBUTION.md +39 -0
  267. package/skills/luckiest-marketing-ideas/CHANGELOG.md +33 -0
  268. package/skills/luckiest-marketing-ideas/SKILL.md +191 -0
  269. package/skills/luckiest-marketing-ideas/evals/evals.json +90 -0
  270. package/skills/luckiest-marketing-ideas/references/ideas-by-category.md +366 -0
  271. package/skills/luckiest-marketing-plan/ATTRIBUTION.md +40 -0
  272. package/skills/luckiest-marketing-plan/CHANGELOG.md +23 -0
  273. package/skills/luckiest-marketing-plan/SKILL.md +285 -0
  274. package/skills/luckiest-marketing-plan/evals/evals.json +96 -0
  275. package/skills/luckiest-marketing-plan/references/aarrr-framework.md +180 -0
  276. package/skills/luckiest-marketing-plan/references/budget-planning.md +168 -0
  277. package/skills/luckiest-marketing-plan/references/client-types.md +373 -0
  278. package/skills/luckiest-marketing-plan/references/current-state-rubric.md +255 -0
  279. package/skills/luckiest-marketing-plan/references/example-quietude.md +972 -0
  280. package/skills/luckiest-marketing-plan/references/funding-stage-unlocks.md +230 -0
  281. package/skills/luckiest-marketing-plan/references/growth-patterns.md +148 -0
  282. package/skills/luckiest-marketing-plan/references/idea-cross-reference.md +265 -0
  283. package/skills/luckiest-marketing-plan/references/measurement-framework.md +213 -0
  284. package/skills/luckiest-marketing-plan/references/methodology.md +363 -0
  285. package/skills/luckiest-marketing-plan/references/ops-stack-mapping.md +197 -0
  286. package/skills/luckiest-marketing-plan/references/plan-template.md +494 -0
  287. package/skills/luckiest-marketing-plan/references/team-and-agency-model.md +278 -0
  288. package/skills/luckiest-marketing-psychology/ATTRIBUTION.md +31 -0
  289. package/skills/luckiest-marketing-psychology/CHANGELOG.md +32 -0
  290. package/skills/luckiest-marketing-psychology/SKILL.md +202 -0
  291. package/skills/luckiest-marketing-psychology/evals.json +88 -0
  292. package/skills/luckiest-model-router/ATTRIBUTION.md +11 -0
  293. package/skills/luckiest-model-router/CHANGELOG.md +45 -0
  294. package/skills/luckiest-model-router/SKILL.md +74 -0
  295. package/skills/luckiest-model-router/scripts/route.py +145 -0
  296. package/skills/luckiest-offers/ATTRIBUTION.md +39 -0
  297. package/skills/luckiest-offers/CHANGELOG.md +23 -0
  298. package/skills/luckiest-offers/SKILL.md +167 -0
  299. package/skills/luckiest-offers/references/bonus-stacking.md +150 -0
  300. package/skills/luckiest-offers/references/examples.md +215 -0
  301. package/skills/luckiest-offers/references/guarantee-design.md +172 -0
  302. package/skills/luckiest-offers/references/offer-anatomy.md +203 -0
  303. package/skills/luckiest-offers/references/offer-formats.md +240 -0
  304. package/skills/luckiest-offers/references/scarcity-urgency.md +175 -0
  305. package/skills/luckiest-offers/references/value-equation.md +134 -0
  306. package/skills/luckiest-onboarding/ATTRIBUTION.md +43 -0
  307. package/skills/luckiest-onboarding/CHANGELOG.md +31 -0
  308. package/skills/luckiest-onboarding/SKILL.md +243 -0
  309. package/skills/luckiest-onboarding/references/experiments.md +258 -0
  310. package/skills/luckiest-paywalls/ATTRIBUTION.md +39 -0
  311. package/skills/luckiest-paywalls/CHANGELOG.md +25 -0
  312. package/skills/luckiest-paywalls/SKILL.md +256 -0
  313. package/skills/luckiest-paywalls/evals/evals.json +93 -0
  314. package/skills/luckiest-paywalls/references/experiments.md +164 -0
  315. package/skills/luckiest-popups/ATTRIBUTION.md +35 -0
  316. package/skills/luckiest-popups/CHANGELOG.md +27 -0
  317. package/skills/luckiest-popups/SKILL.md +477 -0
  318. package/skills/luckiest-popups/evals/evals.json +107 -0
  319. package/skills/luckiest-pricing/ATTRIBUTION.md +35 -0
  320. package/skills/luckiest-pricing/CHANGELOG.md +31 -0
  321. package/skills/luckiest-pricing/SKILL.md +283 -0
  322. package/skills/luckiest-pricing/evals/evals.json +90 -0
  323. package/skills/luckiest-pricing/references/research-methods.md +152 -0
  324. package/skills/luckiest-pricing/references/tier-structure.md +232 -0
  325. package/skills/luckiest-product-marketing/ATTRIBUTION.md +38 -0
  326. package/skills/luckiest-product-marketing/CHANGELOG.md +23 -0
  327. package/skills/luckiest-product-marketing/SKILL.md +256 -0
  328. package/skills/luckiest-product-marketing/evals/evals.json +85 -0
  329. package/skills/luckiest-programmatic-seo/ATTRIBUTION.md +35 -0
  330. package/skills/luckiest-programmatic-seo/CHANGELOG.md +24 -0
  331. package/skills/luckiest-programmatic-seo/SKILL.md +286 -0
  332. package/skills/luckiest-programmatic-seo/evals/evals.json +95 -0
  333. package/skills/luckiest-programmatic-seo/references/playbooks.md +308 -0
  334. package/skills/luckiest-prompt-rewrite/ATTRIBUTION.md +39 -0
  335. package/skills/luckiest-prompt-rewrite/CHANGELOG.md +70 -0
  336. package/skills/luckiest-prompt-rewrite/LICENSE +21 -0
  337. package/skills/luckiest-prompt-rewrite/SKILL.md +494 -0
  338. package/skills/luckiest-prompt-rewrite/references/patterns.md +82 -0
  339. package/skills/luckiest-prompt-rewrite/references/templates.md +454 -0
  340. package/skills/luckiest-prospecting/ATTRIBUTION.md +29 -0
  341. package/skills/luckiest-prospecting/CHANGELOG.md +24 -0
  342. package/skills/luckiest-prospecting/SKILL.md +275 -0
  343. package/skills/luckiest-prospecting/evals/evals.json +107 -0
  344. package/skills/luckiest-prospecting/references/b2b-prospecting.md +106 -0
  345. package/skills/luckiest-prospecting/references/compliance.md +123 -0
  346. package/skills/luckiest-prospecting/references/data-sources.md +287 -0
  347. package/skills/luckiest-prospecting/references/local-prospecting.md +165 -0
  348. package/skills/luckiest-prospecting/references/saas-prospecting.md +123 -0
  349. package/skills/luckiest-public-relations/ATTRIBUTION.md +34 -0
  350. package/skills/luckiest-public-relations/CHANGELOG.md +23 -0
  351. package/skills/luckiest-public-relations/SKILL.md +154 -0
  352. package/skills/luckiest-public-relations/references/journalist-pitching.md +368 -0
  353. package/skills/luckiest-public-relations/references/media-outlets.md +207 -0
  354. package/skills/luckiest-public-relations/references/newsjacking.md +218 -0
  355. package/skills/luckiest-public-relations/references/press-platforms.md +188 -0
  356. package/skills/luckiest-referrals/ATTRIBUTION.md +41 -0
  357. package/skills/luckiest-referrals/CHANGELOG.md +23 -0
  358. package/skills/luckiest-referrals/SKILL.md +292 -0
  359. package/skills/luckiest-referrals/evals/evals.json +90 -0
  360. package/skills/luckiest-referrals/references/affiliate-programs.md +167 -0
  361. package/skills/luckiest-referrals/references/program-examples.md +143 -0
  362. package/skills/luckiest-revops/ATTRIBUTION.md +40 -0
  363. package/skills/luckiest-revops/CHANGELOG.md +24 -0
  364. package/skills/luckiest-revops/SKILL.md +362 -0
  365. package/skills/luckiest-revops/evals/evals.json +91 -0
  366. package/skills/luckiest-revops/references/automation-playbooks.md +290 -0
  367. package/skills/luckiest-revops/references/lifecycle-definitions.md +278 -0
  368. package/skills/luckiest-revops/references/routing-rules.md +203 -0
  369. package/skills/luckiest-revops/references/scoring-models.md +247 -0
  370. package/skills/luckiest-sales-enablement/ATTRIBUTION.md +39 -0
  371. package/skills/luckiest-sales-enablement/CHANGELOG.md +23 -0
  372. package/skills/luckiest-sales-enablement/SKILL.md +379 -0
  373. package/skills/luckiest-sales-enablement/evals/evals.json +91 -0
  374. package/skills/luckiest-sales-enablement/references/deck-frameworks.md +263 -0
  375. package/skills/luckiest-sales-enablement/references/demo-scripts.md +355 -0
  376. package/skills/luckiest-sales-enablement/references/objection-library.md +270 -0
  377. package/skills/luckiest-sales-enablement/references/one-pager-templates.md +208 -0
  378. package/skills/luckiest-schema/ATTRIBUTION.md +39 -0
  379. package/skills/luckiest-schema/CHANGELOG.md +25 -0
  380. package/skills/luckiest-schema/SKILL.md +209 -0
  381. package/skills/luckiest-schema/evals/evals.json +88 -0
  382. package/skills/luckiest-schema/references/schema-examples.md +398 -0
  383. package/skills/luckiest-seo-audit/ATTRIBUTION.md +39 -0
  384. package/skills/luckiest-seo-audit/CHANGELOG.md +23 -0
  385. package/skills/luckiest-seo-audit/SKILL.md +529 -0
  386. package/skills/luckiest-seo-audit/evals/evals.json +136 -0
  387. package/skills/luckiest-seo-audit/references/ai-writing-detection.md +200 -0
  388. package/skills/luckiest-seo-audit/references/international-seo.md +230 -0
  389. package/skills/luckiest-session-handoff/ATTRIBUTION.md +14 -0
  390. package/skills/luckiest-session-handoff/CHANGELOG.md +30 -0
  391. package/skills/luckiest-session-handoff/SKILL.md +96 -0
  392. package/skills/luckiest-signup/ATTRIBUTION.md +48 -0
  393. package/skills/luckiest-signup/CHANGELOG.md +24 -0
  394. package/skills/luckiest-signup/SKILL.md +382 -0
  395. package/skills/luckiest-signup/evals/evals.json +88 -0
  396. package/skills/luckiest-site-architecture/ATTRIBUTION.md +38 -0
  397. package/skills/luckiest-site-architecture/CHANGELOG.md +23 -0
  398. package/skills/luckiest-site-architecture/SKILL.md +383 -0
  399. package/skills/luckiest-site-architecture/evals/evals.json +88 -0
  400. package/skills/luckiest-site-architecture/references/mermaid-templates.md +216 -0
  401. package/skills/luckiest-site-architecture/references/navigation-patterns.md +305 -0
  402. package/skills/luckiest-site-architecture/references/site-type-templates.md +293 -0
  403. package/skills/luckiest-sms/ATTRIBUTION.md +27 -0
  404. package/skills/luckiest-sms/CHANGELOG.md +24 -0
  405. package/skills/luckiest-sms/SKILL.md +400 -0
  406. package/skills/luckiest-sms/evals/evals.json +100 -0
  407. package/skills/luckiest-sms/references/compliance.md +202 -0
  408. package/skills/luckiest-sms/references/platforms.md +318 -0
  409. package/skills/luckiest-sms/references/sequence-templates.md +282 -0
  410. package/skills/luckiest-social/ATTRIBUTION.md +27 -0
  411. package/skills/luckiest-social/CHANGELOG.md +24 -0
  412. package/skills/luckiest-social/SKILL.md +430 -0
  413. package/skills/luckiest-social/evals/evals.json +92 -0
  414. package/skills/luckiest-social/references/listening-sources-template.md +123 -0
  415. package/skills/luckiest-social/references/listening.md +283 -0
  416. package/skills/luckiest-social/references/platform-limits.md +110 -0
  417. package/skills/luckiest-social/references/platforms.md +170 -0
  418. package/skills/luckiest-social/references/post-templates.md +177 -0
  419. package/skills/luckiest-social/references/reverse-engineering.md +195 -0
  420. package/skills/luckiest-social/references/short-form-video.md +237 -0
  421. package/skills/luckiest-thinker/ATTRIBUTION.md +16 -0
  422. package/skills/luckiest-thinker/CHANGELOG.md +20 -0
  423. package/skills/luckiest-thinker/LICENSE +21 -0
  424. package/skills/luckiest-thinker/SKILL.md +92 -0
  425. package/skills/luckiest-thinker/references/distribution-calibration.md +106 -0
  426. package/skills/luckiest-thinker/references/research-foundations.md +214 -0
  427. package/skills/luckiest-thinker/references/thinking-patterns.md +138 -0
  428. package/skills/luckiest-trends/.skillignore +10 -0
  429. package/skills/luckiest-trends/ATTRIBUTION.md +43 -0
  430. package/skills/luckiest-trends/CHANGELOG.md +86 -0
  431. package/skills/luckiest-trends/LICENSE +21 -0
  432. package/skills/luckiest-trends/SKILL.md +194 -0
  433. package/skills/luckiest-trends/agents/openai.yaml +8 -0
  434. package/skills/luckiest-trends/references/engine-contract.md +2041 -0
  435. package/skills/luckiest-trends/references/save-html-brief.md +206 -0
  436. package/skills/luckiest-trends/scripts/briefing.py +272 -0
  437. package/skills/luckiest-trends/scripts/build-skill.sh +39 -0
  438. package/skills/luckiest-trends/scripts/compare.sh +61 -0
  439. package/skills/luckiest-trends/scripts/evaluate_search_quality.py +573 -0
  440. package/skills/luckiest-trends/scripts/last30days.py +1467 -0
  441. package/skills/luckiest-trends/scripts/lib/__init__.py +1 -0
  442. package/skills/luckiest-trends/scripts/lib/__pycache__/__init__.cpython-313.pyc +0 -0
  443. package/skills/luckiest-trends/scripts/lib/__pycache__/arxiv.cpython-313.pyc +0 -0
  444. package/skills/luckiest-trends/scripts/lib/__pycache__/bird_x.cpython-313.pyc +0 -0
  445. package/skills/luckiest-trends/scripts/lib/__pycache__/bluesky.cpython-313.pyc +0 -0
  446. package/skills/luckiest-trends/scripts/lib/__pycache__/categories.cpython-313.pyc +0 -0
  447. package/skills/luckiest-trends/scripts/lib/__pycache__/cjk.cpython-313.pyc +0 -0
  448. package/skills/luckiest-trends/scripts/lib/__pycache__/cluster.cpython-313.pyc +0 -0
  449. package/skills/luckiest-trends/scripts/lib/__pycache__/dates.cpython-313.pyc +0 -0
  450. package/skills/luckiest-trends/scripts/lib/__pycache__/dedupe.cpython-313.pyc +0 -0
  451. package/skills/luckiest-trends/scripts/lib/__pycache__/digg.cpython-313.pyc +0 -0
  452. package/skills/luckiest-trends/scripts/lib/__pycache__/entity_extract.cpython-313.pyc +0 -0
  453. package/skills/luckiest-trends/scripts/lib/__pycache__/env.cpython-313.pyc +0 -0
  454. package/skills/luckiest-trends/scripts/lib/__pycache__/fusion.cpython-313.pyc +0 -0
  455. package/skills/luckiest-trends/scripts/lib/__pycache__/github.cpython-313.pyc +0 -0
  456. package/skills/luckiest-trends/scripts/lib/__pycache__/grounding.cpython-313.pyc +0 -0
  457. package/skills/luckiest-trends/scripts/lib/__pycache__/hackernews.cpython-313.pyc +0 -0
  458. package/skills/luckiest-trends/scripts/lib/__pycache__/hiring_signals.cpython-313.pyc +0 -0
  459. package/skills/luckiest-trends/scripts/lib/__pycache__/html_render.cpython-313.pyc +0 -0
  460. package/skills/luckiest-trends/scripts/lib/__pycache__/http.cpython-313.pyc +0 -0
  461. package/skills/luckiest-trends/scripts/lib/__pycache__/instagram.cpython-313.pyc +0 -0
  462. package/skills/luckiest-trends/scripts/lib/__pycache__/jobs.cpython-313.pyc +0 -0
  463. package/skills/luckiest-trends/scripts/lib/__pycache__/linkedin.cpython-313.pyc +0 -0
  464. package/skills/luckiest-trends/scripts/lib/__pycache__/log.cpython-313.pyc +0 -0
  465. package/skills/luckiest-trends/scripts/lib/__pycache__/normalize.cpython-313.pyc +0 -0
  466. package/skills/luckiest-trends/scripts/lib/__pycache__/permission_preflight.cpython-313.pyc +0 -0
  467. package/skills/luckiest-trends/scripts/lib/__pycache__/perplexity.cpython-313.pyc +0 -0
  468. package/skills/luckiest-trends/scripts/lib/__pycache__/pinterest.cpython-313.pyc +0 -0
  469. package/skills/luckiest-trends/scripts/lib/__pycache__/pipeline.cpython-313.pyc +0 -0
  470. package/skills/luckiest-trends/scripts/lib/__pycache__/planner.cpython-313.pyc +0 -0
  471. package/skills/luckiest-trends/scripts/lib/__pycache__/polymarket.cpython-313.pyc +0 -0
  472. package/skills/luckiest-trends/scripts/lib/__pycache__/preflight.cpython-313.pyc +0 -0
  473. package/skills/luckiest-trends/scripts/lib/__pycache__/providers.cpython-313.pyc +0 -0
  474. package/skills/luckiest-trends/scripts/lib/__pycache__/quality_nudge.cpython-313.pyc +0 -0
  475. package/skills/luckiest-trends/scripts/lib/__pycache__/query.cpython-313.pyc +0 -0
  476. package/skills/luckiest-trends/scripts/lib/__pycache__/reddit.cpython-313.pyc +0 -0
  477. package/skills/luckiest-trends/scripts/lib/__pycache__/reddit_arctic.cpython-313.pyc +0 -0
  478. package/skills/luckiest-trends/scripts/lib/__pycache__/reddit_enrich.cpython-313.pyc +0 -0
  479. package/skills/luckiest-trends/scripts/lib/__pycache__/reddit_keyless.cpython-313.pyc +0 -0
  480. package/skills/luckiest-trends/scripts/lib/__pycache__/reddit_listing.cpython-313.pyc +0 -0
  481. package/skills/luckiest-trends/scripts/lib/__pycache__/reddit_public.cpython-313.pyc +0 -0
  482. package/skills/luckiest-trends/scripts/lib/__pycache__/reddit_rss.cpython-313.pyc +0 -0
  483. package/skills/luckiest-trends/scripts/lib/__pycache__/reddit_shreddit.cpython-313.pyc +0 -0
  484. package/skills/luckiest-trends/scripts/lib/__pycache__/relevance.cpython-313.pyc +0 -0
  485. package/skills/luckiest-trends/scripts/lib/__pycache__/render.cpython-313.pyc +0 -0
  486. package/skills/luckiest-trends/scripts/lib/__pycache__/rerank.cpython-313.pyc +0 -0
  487. package/skills/luckiest-trends/scripts/lib/__pycache__/resolve.cpython-313.pyc +0 -0
  488. package/skills/luckiest-trends/scripts/lib/__pycache__/schema.cpython-313.pyc +0 -0
  489. package/skills/luckiest-trends/scripts/lib/__pycache__/signals.cpython-313.pyc +0 -0
  490. package/skills/luckiest-trends/scripts/lib/__pycache__/skill_meta.cpython-313.pyc +0 -0
  491. package/skills/luckiest-trends/scripts/lib/__pycache__/snippet.cpython-313.pyc +0 -0
  492. package/skills/luckiest-trends/scripts/lib/__pycache__/subproc.cpython-313.pyc +0 -0
  493. package/skills/luckiest-trends/scripts/lib/__pycache__/techmeme.cpython-313.pyc +0 -0
  494. package/skills/luckiest-trends/scripts/lib/__pycache__/threads.cpython-313.pyc +0 -0
  495. package/skills/luckiest-trends/scripts/lib/__pycache__/tiktok.cpython-313.pyc +0 -0
  496. package/skills/luckiest-trends/scripts/lib/__pycache__/trustpilot.cpython-313.pyc +0 -0
  497. package/skills/luckiest-trends/scripts/lib/__pycache__/truthsocial.cpython-313.pyc +0 -0
  498. package/skills/luckiest-trends/scripts/lib/__pycache__/ui.cpython-313.pyc +0 -0
  499. package/skills/luckiest-trends/scripts/lib/__pycache__/web_search_keyless.cpython-313.pyc +0 -0
  500. package/skills/luckiest-trends/scripts/lib/__pycache__/xai_x.cpython-313.pyc +0 -0
  501. package/skills/luckiest-trends/scripts/lib/__pycache__/xiaohongshu_api.cpython-313.pyc +0 -0
  502. package/skills/luckiest-trends/scripts/lib/__pycache__/xquik.cpython-313.pyc +0 -0
  503. package/skills/luckiest-trends/scripts/lib/__pycache__/xurl_x.cpython-313.pyc +0 -0
  504. package/skills/luckiest-trends/scripts/lib/__pycache__/youtube_yt.cpython-313.pyc +0 -0
  505. package/skills/luckiest-trends/scripts/lib/arxiv.py +290 -0
  506. package/skills/luckiest-trends/scripts/lib/bird_x.py +639 -0
  507. package/skills/luckiest-trends/scripts/lib/bluesky.py +323 -0
  508. package/skills/luckiest-trends/scripts/lib/categories.py +283 -0
  509. package/skills/luckiest-trends/scripts/lib/chrome_cookies.py +414 -0
  510. package/skills/luckiest-trends/scripts/lib/cjk.py +107 -0
  511. package/skills/luckiest-trends/scripts/lib/cluster.py +271 -0
  512. package/skills/luckiest-trends/scripts/lib/competitors.py +198 -0
  513. package/skills/luckiest-trends/scripts/lib/cookie_extract.py +508 -0
  514. package/skills/luckiest-trends/scripts/lib/dates.py +169 -0
  515. package/skills/luckiest-trends/scripts/lib/dedupe.py +145 -0
  516. package/skills/luckiest-trends/scripts/lib/digg.py +440 -0
  517. package/skills/luckiest-trends/scripts/lib/entity_extract.py +127 -0
  518. package/skills/luckiest-trends/scripts/lib/env.py +1073 -0
  519. package/skills/luckiest-trends/scripts/lib/fanout.py +84 -0
  520. package/skills/luckiest-trends/scripts/lib/fusion.py +207 -0
  521. package/skills/luckiest-trends/scripts/lib/github.py +996 -0
  522. package/skills/luckiest-trends/scripts/lib/grounding.py +331 -0
  523. package/skills/luckiest-trends/scripts/lib/hackernews.py +357 -0
  524. package/skills/luckiest-trends/scripts/lib/health.py +92 -0
  525. package/skills/luckiest-trends/scripts/lib/hiring_signals.py +326 -0
  526. package/skills/luckiest-trends/scripts/lib/html_publish.py +73 -0
  527. package/skills/luckiest-trends/scripts/lib/html_render.py +738 -0
  528. package/skills/luckiest-trends/scripts/lib/http.py +372 -0
  529. package/skills/luckiest-trends/scripts/lib/instagram.py +521 -0
  530. package/skills/luckiest-trends/scripts/lib/jobs.py +708 -0
  531. package/skills/luckiest-trends/scripts/lib/linkedin.py +363 -0
  532. package/skills/luckiest-trends/scripts/lib/log.py +35 -0
  533. package/skills/luckiest-trends/scripts/lib/normalize.py +759 -0
  534. package/skills/luckiest-trends/scripts/lib/permission_preflight.py +242 -0
  535. package/skills/luckiest-trends/scripts/lib/perplexity.py +745 -0
  536. package/skills/luckiest-trends/scripts/lib/pinterest.py +154 -0
  537. package/skills/luckiest-trends/scripts/lib/pipeline.py +1720 -0
  538. package/skills/luckiest-trends/scripts/lib/planner.py +763 -0
  539. package/skills/luckiest-trends/scripts/lib/polymarket.py +794 -0
  540. package/skills/luckiest-trends/scripts/lib/preflight.py +119 -0
  541. package/skills/luckiest-trends/scripts/lib/providers.py +380 -0
  542. package/skills/luckiest-trends/scripts/lib/quality_nudge.py +383 -0
  543. package/skills/luckiest-trends/scripts/lib/query.py +202 -0
  544. package/skills/luckiest-trends/scripts/lib/reddit.py +731 -0
  545. package/skills/luckiest-trends/scripts/lib/reddit_arctic.py +92 -0
  546. package/skills/luckiest-trends/scripts/lib/reddit_enrich.py +322 -0
  547. package/skills/luckiest-trends/scripts/lib/reddit_keyless.py +329 -0
  548. package/skills/luckiest-trends/scripts/lib/reddit_listing.py +188 -0
  549. package/skills/luckiest-trends/scripts/lib/reddit_public.py +275 -0
  550. package/skills/luckiest-trends/scripts/lib/reddit_rss.py +224 -0
  551. package/skills/luckiest-trends/scripts/lib/reddit_shreddit.py +184 -0
  552. package/skills/luckiest-trends/scripts/lib/relevance.py +200 -0
  553. package/skills/luckiest-trends/scripts/lib/render.py +2130 -0
  554. package/skills/luckiest-trends/scripts/lib/rerank.py +708 -0
  555. package/skills/luckiest-trends/scripts/lib/resolve.py +345 -0
  556. package/skills/luckiest-trends/scripts/lib/safari_cookies.py +193 -0
  557. package/skills/luckiest-trends/scripts/lib/schema.py +319 -0
  558. package/skills/luckiest-trends/scripts/lib/setup_wizard.py +843 -0
  559. package/skills/luckiest-trends/scripts/lib/signals.py +334 -0
  560. package/skills/luckiest-trends/scripts/lib/skill_meta.py +33 -0
  561. package/skills/luckiest-trends/scripts/lib/snippet.py +51 -0
  562. package/skills/luckiest-trends/scripts/lib/subproc.py +116 -0
  563. package/skills/luckiest-trends/scripts/lib/techmeme.py +239 -0
  564. package/skills/luckiest-trends/scripts/lib/threads.py +207 -0
  565. package/skills/luckiest-trends/scripts/lib/tiktok.py +596 -0
  566. package/skills/luckiest-trends/scripts/lib/transcribe.py +235 -0
  567. package/skills/luckiest-trends/scripts/lib/trustpilot.py +277 -0
  568. package/skills/luckiest-trends/scripts/lib/truthsocial.py +162 -0
  569. package/skills/luckiest-trends/scripts/lib/ui.py +626 -0
  570. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/LICENSE +21 -0
  571. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/bird-search.mjs +147 -0
  572. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/cookies.js +220 -0
  573. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/features.json +17 -0
  574. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/paginate-cursor.js +37 -0
  575. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/query-ids.json +20 -0
  576. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/runtime-features.js +151 -0
  577. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/runtime-query-ids.js +264 -0
  578. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/twitter-client-base.js +129 -0
  579. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/twitter-client-constants.js +50 -0
  580. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/twitter-client-features.js +347 -0
  581. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/twitter-client-search.js +157 -0
  582. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/twitter-client-types.js +2 -0
  583. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/lib/twitter-client-utils.js +511 -0
  584. package/skills/luckiest-trends/scripts/lib/vendor/bird-search/package.json +13 -0
  585. package/skills/luckiest-trends/scripts/lib/web_fetch_keyless.py +105 -0
  586. package/skills/luckiest-trends/scripts/lib/web_search_keyless.py +158 -0
  587. package/skills/luckiest-trends/scripts/lib/xai_x.py +236 -0
  588. package/skills/luckiest-trends/scripts/lib/xiaohongshu_api.py +162 -0
  589. package/skills/luckiest-trends/scripts/lib/xquik.py +404 -0
  590. package/skills/luckiest-trends/scripts/lib/xurl_x.py +171 -0
  591. package/skills/luckiest-trends/scripts/lib/youtube_yt.py +1365 -0
  592. package/skills/luckiest-trends/scripts/setup-keychain.sh +123 -0
  593. package/skills/luckiest-trends/scripts/setup-pass.sh +132 -0
  594. package/skills/luckiest-trends/scripts/store.py +1020 -0
  595. package/skills/luckiest-trends/scripts/test-v1-vs-v2.sh +220 -0
  596. package/skills/luckiest-trends/scripts/test_device_auth.py +128 -0
  597. package/skills/luckiest-trends/scripts/verify_v3.py +195 -0
  598. package/skills/luckiest-trends/scripts/watchlist.py +318 -0
  599. package/skills/luckiest-video/ATTRIBUTION.md +27 -0
  600. package/skills/luckiest-video/CHANGELOG.md +23 -0
  601. package/skills/luckiest-video/SKILL.md +371 -0
  602. package/skills/luckiest-video/evals/evals.json +88 -0
  603. package/skills/luckiest-video/references/ai-video-prompting.md +175 -0
  604. package/skills/remix/SKILL.md +32 -0
  605. package/commands/luckiest/go.md +0 -45
  606. package/commands/luckiest/plan.md +0 -55
  607. /package/commands/{luckiest/charms.md → charms.md} +0 -0
  608. /package/commands/{luckiest/helpers.md → helpers.md} +0 -0
  609. /package/commands/{luckiest/home.md → home.md} +0 -0
  610. /package/commands/{luckiest/leaderboard.md → leaderboard.md} +0 -0
  611. /package/commands/{luckiest/merge.md → merge.md} +0 -0
  612. /package/commands/{luckiest/overlaps.md → overlaps.md} +0 -0
  613. /package/commands/{luckiest/skills.md → skills.md} +0 -0
  614. /package/commands/{luckiest/start.md → start.md} +0 -0
  615. /package/commands/{luckiest/status.md → status.md} +0 -0
  616. /package/commands/{luckiest/updates.md → updates.md} +0 -0
  617. /package/commands/{luckiest/vouch.md → vouch.md} +0 -0
  618. /package/commands/{luckiest/wishes.md → wishes.md} +0 -0
@@ -0,0 +1,731 @@
1
+ """Reddit search via ScrapeCreators API for the v3 pipeline.
2
+
3
+ Uses ScrapeCreators REST API to search Reddit globally, discover relevant
4
+ subreddits, run targeted subreddit searches, and fetch comment trees.
5
+
6
+ Requires SCRAPECREATORS_API_KEY in config (same key as TikTok + Instagram).
7
+ API docs: https://scrapecreators.com/docs
8
+ """
9
+
10
+ import math
11
+ import re
12
+ import sys
13
+ import time
14
+ from collections import Counter
15
+ from concurrent.futures import ThreadPoolExecutor, as_completed, wait as futures_wait
16
+ from typing import Any, Dict, List, Optional, Set
17
+
18
+ def _first_of(*values, default=None):
19
+ """Return first value that is not None."""
20
+ for v in values:
21
+ if v is not None:
22
+ return v
23
+ return default
24
+
25
+ from . import dates, http, log
26
+
27
+ SCRAPECREATORS_BASE = "https://api.scrapecreators.com/v1/reddit"
28
+
29
+ # Reddit's highest-upvote content (relationship drama, AITA, viral news) often
30
+ # has near-zero topic overlap. Engagement-only ranking floats it above on-topic
31
+ # posts, especially on bare global searches where no subreddits were resolved
32
+ # upstream. A relevance floor + relevance-first ranking (see _relevance_rank_key
33
+ # below and RELEVANCE_FLOOR / MIN_ON_TOPIC in relevance.py) keeps an off-topic
34
+ # viral post from ever outranking an on-topic one.
35
+
36
+ # Depth configurations: how many API calls per phase
37
+ DEPTH_CONFIG = {
38
+ "quick": {
39
+ "global_searches": 1,
40
+ "subreddit_searches": 2,
41
+ "comment_enrichments": 3,
42
+ "timeframe": "week",
43
+ },
44
+ "default": {
45
+ "global_searches": 2,
46
+ "subreddit_searches": 3,
47
+ "comment_enrichments": 5,
48
+ "timeframe": "month",
49
+ },
50
+ "deep": {
51
+ "global_searches": 3,
52
+ "subreddit_searches": 5,
53
+ "comment_enrichments": 8,
54
+ "timeframe": "month",
55
+ },
56
+ }
57
+
58
+ from .query import extract_core_subject as _query_extract, infer_query_intent
59
+ from .relevance import token_overlap_relevance, RELEVANCE_FLOOR, MIN_ON_TOPIC
60
+
61
+
62
+ # Reddit-specific noise words (preserves original smaller set)
63
+ NOISE_WORDS = frozenset({
64
+ 'best', 'top', 'good', 'great', 'awesome', 'killer',
65
+ 'latest', 'new', 'news', 'update', 'updates',
66
+ 'trending', 'hottest', 'popular',
67
+ 'practices', 'features', 'tips',
68
+ 'recommendations', 'advice',
69
+ 'prompt', 'prompts', 'prompting',
70
+ 'methods', 'strategies', 'approaches',
71
+ 'how', 'to', 'the', 'a', 'an', 'for', 'with',
72
+ 'of', 'in', 'on', 'is', 'are', 'what', 'which',
73
+ 'guide', 'tutorial', 'using',
74
+ })
75
+
76
+
77
+ def _log(msg: str):
78
+ log.source_log("Reddit", msg, tty_only=False)
79
+
80
+
81
+ def _extract_core_subject(topic: str) -> str:
82
+ """Extract core subject from verbose query.
83
+
84
+ Strips meta/research words to keep only the core product/concept name.
85
+ """
86
+ return _query_extract(topic, noise=NOISE_WORDS)
87
+
88
+
89
+ def expand_reddit_queries(topic: str, depth: str) -> List[str]:
90
+ """Generate multiple Reddit search queries from a topic.
91
+
92
+ Uses local logic (no LLM call needed):
93
+ 1. Extract core subject (strip noise words)
94
+ 2. Include original topic if different from core
95
+ 3. For default/deep: add casual/review variant
96
+ 4. For deep: add problem/issues variant
97
+
98
+ Returns 1-4 query strings depending on depth.
99
+ """
100
+ core = _extract_core_subject(topic)
101
+ queries = [core]
102
+
103
+ # Broader variant: include more context from original topic
104
+ original_clean = topic.strip().rstrip('?!.')
105
+ if core.lower() != original_clean.lower() and len(original_clean.split()) <= 8:
106
+ queries.append(original_clean)
107
+
108
+ qtype = infer_query_intent(topic)
109
+
110
+ # Product queries: always include review-oriented variant to bias toward
111
+ # review communities instead of keyword-matching unrelated subreddits.
112
+ if qtype == "product":
113
+ queries.append(f"{core} review OR recommendation OR best")
114
+
115
+ # Comparison queries: include head-to-head discussion variant.
116
+ if qtype == "comparison":
117
+ queries.append(f"{core} worth it OR vs OR compared")
118
+
119
+ # Opinion/review variants for default/deep depth.
120
+ if depth in ("default", "deep") and qtype in ("product", "opinion"):
121
+ queries.append(f"{core} worth it OR thoughts OR review")
122
+
123
+ # Problem/bug variants are useful for tool workflows, not generic news.
124
+ if depth == "deep" and qtype in ("product", "opinion", "how_to"):
125
+ queries.append(f"{core} issues OR problems OR bug OR broken")
126
+
127
+ return queries
128
+
129
+
130
+ # Known utility/meta subreddits that match queries but aren't discussion subs.
131
+ # These get a 0.3x penalty (not banned) in subreddit discovery scoring.
132
+ UTILITY_SUBS = frozenset({
133
+ 'namethatsong', 'findthatsong', 'tipofmytongue',
134
+ 'whatisthissong', 'helpmefind', 'whatisthisthing',
135
+ 'whatsthissong', 'findareddit', 'subredditdrama',
136
+ })
137
+
138
+
139
+ def discover_subreddits(
140
+ results: List[Dict[str, Any]],
141
+ topic: str = "",
142
+ max_subs: int = 5,
143
+ ) -> List[str]:
144
+ """Extract top subreddits from global search results with relevance weighting.
145
+
146
+ Uses frequency + topic-word matching + utility-sub penalties + engagement
147
+ bonus to find discussion subs rather than utility/meta subs.
148
+
149
+ Args:
150
+ results: List of post dicts from global search
151
+ topic: Original search topic (for relevance matching)
152
+ max_subs: Maximum subreddits to return
153
+
154
+ Returns:
155
+ Top subreddit names sorted by weighted score
156
+ """
157
+ core = _extract_core_subject(topic) if topic else ""
158
+ core_words = set(core.lower().split()) if core else set()
159
+
160
+ scores = Counter()
161
+ for post in results:
162
+ sub = _extract_subreddit_name(post.get("subreddit", ""))
163
+ if not sub:
164
+ continue
165
+
166
+ # Base: frequency count
167
+ base = 1.0
168
+
169
+ # Bonus: subreddit name contains a core topic word
170
+ sub_lower = sub.lower()
171
+ if core_words and any(w in sub_lower for w in core_words if len(w) > 2):
172
+ base += 2.0
173
+
174
+ # Penalty: known utility/meta subreddits
175
+ if sub_lower in UTILITY_SUBS:
176
+ base *= 0.3
177
+
178
+ # Bonus: post engagement (high-engagement posts = better sub)
179
+ ups = _first_of(post.get("ups"), post.get("score"), post.get("votes"), default=0)
180
+ if ups and ups > 100:
181
+ base += 0.5
182
+
183
+ scores[sub] += base
184
+
185
+ return [sub for sub, _ in scores.most_common(max_subs)]
186
+
187
+
188
+ def _parse_date(value) -> Optional[str]:
189
+ """Convert Unix timestamp or ISO-8601 string to YYYY-MM-DD.
190
+
191
+ Global search returns ``created_at`` as an ISO string
192
+ (e.g. "2018-05-03T01:09:17.620000+0000"); subreddit search returns
193
+ ``created_utc`` as a Unix timestamp. dates.parse_date() handles both,
194
+ plus edge cases like Z suffix and +0000 (no colon) offset.
195
+
196
+ Falsy inputs (None, "", 0) return None, matching the original behavior
197
+ where a Unix timestamp of 0 meant "no date" rather than epoch 0.
198
+ """
199
+ if not value:
200
+ return None
201
+ dt = dates.parse_date(str(value))
202
+ return dt.strftime("%Y-%m-%d") if dt else None
203
+
204
+
205
+ def _extract_subreddit_name(value: Any) -> str:
206
+ """Extract subreddit name from string or API object dict."""
207
+ if isinstance(value, dict):
208
+ return str(value.get("name") or value.get("display_name") or "").strip()
209
+ return str(value).strip()
210
+
211
+
212
+ def _extract_score(post: Dict[str, Any]) -> int:
213
+ """Extract post score from either API schema.
214
+
215
+ Global search uses ``votes``; subreddit search uses ``ups``/``score``.
216
+ """
217
+ return _first_of(post.get("ups"), post.get("score"), post.get("votes"), default=0)
218
+
219
+
220
+ def _extract_date(post: Dict[str, Any]) -> Optional[str]:
221
+ """Extract date from either API schema.
222
+
223
+ Global search uses ``created_at`` (ISO); subreddit search uses ``created_utc`` (Unix).
224
+ """
225
+ return _parse_date(
226
+ post.get("created_utc") or post.get("created_at") or post.get("created_at_iso")
227
+ )
228
+
229
+
230
+ def _normalize_reddit_id(raw_id: str) -> str:
231
+ """Strip Reddit fullname prefix (t3_) for consistent dedup."""
232
+ s = str(raw_id or "")
233
+ return s[3:] if s.startswith("t3_") else s
234
+
235
+
236
+ def _total_engagement(item: Dict[str, Any]) -> int:
237
+ """Combined engagement score: upvotes + comment count.
238
+
239
+ Used for selecting which threads to enrich with comments.
240
+ Threads with lots of comments are high-value even if upvote score is low.
241
+ """
242
+ eng = item.get("engagement", {})
243
+ score = eng.get("score", 0) or 0
244
+ num_comments = eng.get("num_comments", 0) or 0
245
+ return score + num_comments
246
+
247
+
248
+ def _relevance_rank_key(item: Dict[str, Any]) -> float:
249
+ """Rank by relevance first, with a bounded engagement bonus as tiebreaker.
250
+
251
+ The log-scaled bonus is capped at 0.25 so it orders similarly-relevant posts
252
+ by discussion volume but is too small to lift an off-topic post (relevance
253
+ ~0) above an on-topic one (relevance >= RELEVANCE_FLOOR).
254
+ """
255
+ rel = item.get("relevance") or 0.0
256
+ eng_bonus = min(0.25, math.log10(_total_engagement(item) + 1) / 20.0)
257
+ return rel + eng_bonus
258
+
259
+
260
+ def _normalize_post(post: Dict[str, Any], idx: int, source_label: str = "global", query: str = "") -> Dict[str, Any]:
261
+ """Normalize a ScrapeCreators Reddit post to our internal format.
262
+
263
+ Handles both the global-search schema (``votes``, ``created_at``,
264
+ ``subreddit`` as dict) and the subreddit-search schema (``ups``/``score``,
265
+ ``created_utc``, ``subreddit`` as string).
266
+ """
267
+ permalink = post.get("permalink", "")
268
+ url = f"https://www.reddit.com{permalink}" if permalink else post.get("url", "")
269
+
270
+ # Ensure URL looks like a Reddit thread
271
+ if url and "reddit.com" not in url:
272
+ url = ""
273
+
274
+ title = str(post.get("title", "")).strip()
275
+ selftext = str(post.get("selftext", ""))
276
+
277
+ # Score the title first, then let the body provide limited support.
278
+ # This keeps long selftexts from overpowering the visible topic signal.
279
+ relevance = _compute_post_relevance(query, title, selftext) if query else 0.7
280
+
281
+ return {
282
+ "id": f"R{idx}",
283
+ "reddit_id": _normalize_reddit_id(post.get("id", "")),
284
+ "title": title,
285
+ "url": url,
286
+ "subreddit": _extract_subreddit_name(post.get("subreddit", "")),
287
+ "date": _extract_date(post),
288
+ "engagement": {
289
+ "score": _extract_score(post),
290
+ "num_comments": post.get("num_comments", 0),
291
+ "upvote_ratio": post.get("upvote_ratio"),
292
+ },
293
+ "relevance": relevance,
294
+ "why_relevant": f"Reddit {source_label} search",
295
+ "selftext": str(post.get("selftext", ""))[:500],
296
+ }
297
+
298
+
299
+ def _compute_post_relevance(query: str, title: str, selftext: str) -> float:
300
+ """Compute Reddit relevance with title-first weighting.
301
+
302
+ Title should carry most of the weight because it is the visible summary the
303
+ user sees. Selftext can lift a marginal match, but it should not rescue a
304
+ weak or ambiguous title into the top ranks.
305
+ """
306
+ title_score = token_overlap_relevance(query, title)
307
+ if not selftext.strip():
308
+ return title_score
309
+
310
+ body_score = token_overlap_relevance(query, selftext)
311
+ support_score = max(title_score, body_score)
312
+ return round(0.75 * title_score + 0.25 * support_score, 2)
313
+
314
+
315
+ def _global_search(
316
+ query: str,
317
+ token: str,
318
+ sort: str = "relevance",
319
+ timeframe: str = "month",
320
+ ) -> List[Dict[str, Any]]:
321
+ """Search across all of Reddit via ScrapeCreators global search.
322
+
323
+ Args:
324
+ query: Search query
325
+ token: ScrapeCreators API key
326
+ sort: Sort order (relevance, hot, top, new)
327
+ timeframe: Time filter (hour, day, week, month, year, all)
328
+
329
+ Returns:
330
+ List of post dicts
331
+ """
332
+ try:
333
+ data = http.get(
334
+ f"{SCRAPECREATORS_BASE}/search",
335
+ headers=http.scrapecreators_headers(token),
336
+ params={"query": query, "sort": sort, "timeframe": timeframe},
337
+ timeout=30,
338
+ retries=2,
339
+ )
340
+ return data.get("posts", data.get("data", []))
341
+ except http.HTTPError as e:
342
+ if e.status_code in (401, 402, 403):
343
+ raise
344
+ _log(f"Global search error: {e}")
345
+ return []
346
+ except Exception as e:
347
+ _log(f"Global search error: {e}")
348
+ return []
349
+
350
+
351
+ def _subreddit_search(
352
+ subreddit: str,
353
+ query: str,
354
+ token: str,
355
+ sort: str = "relevance",
356
+ timeframe: str = "month",
357
+ ) -> List[Dict[str, Any]]:
358
+ """Search within a specific subreddit via ScrapeCreators.
359
+
360
+ Args:
361
+ subreddit: Subreddit name (without r/)
362
+ query: Search query
363
+ token: ScrapeCreators API key
364
+ sort: Sort order
365
+ timeframe: Time filter
366
+
367
+ Returns:
368
+ List of post dicts
369
+ """
370
+ try:
371
+ data = http.get(
372
+ f"{SCRAPECREATORS_BASE}/subreddit/search",
373
+ headers=http.scrapecreators_headers(token),
374
+ params={
375
+ "subreddit": subreddit,
376
+ "query": query,
377
+ "sort": sort,
378
+ "timeframe": timeframe,
379
+ },
380
+ timeout=30,
381
+ retries=2,
382
+ )
383
+ return data.get("posts", data.get("data", []))
384
+ except http.HTTPError as e:
385
+ if e.status_code in (401, 402, 403):
386
+ raise
387
+ _log(f"Subreddit search error for r/{subreddit}: {e}")
388
+ return []
389
+ except Exception as e:
390
+ _log(f"Subreddit search error for r/{subreddit}: {e}")
391
+ return []
392
+
393
+
394
+ def fetch_post_comments(
395
+ url: str,
396
+ token: str,
397
+ ) -> List[Dict[str, Any]]:
398
+ """Fetch comments for a Reddit post via ScrapeCreators.
399
+
400
+ Args:
401
+ url: Reddit post URL or permalink
402
+ token: ScrapeCreators API key
403
+
404
+ Returns:
405
+ List of comment dicts with score, author, body, etc.
406
+ """
407
+ try:
408
+ data = http.get(
409
+ f"{SCRAPECREATORS_BASE}/post/comments",
410
+ headers=http.scrapecreators_headers(token),
411
+ params={"url": url},
412
+ timeout=30,
413
+ retries=2,
414
+ )
415
+ return data.get("comments", data.get("data", []))
416
+ except http.HTTPError as e:
417
+ if e.status_code in (401, 402, 403):
418
+ raise
419
+ _log(f"Comment fetch error: {e}")
420
+ return []
421
+ except Exception as e:
422
+ _log(f"Comment fetch error: {e}")
423
+ return []
424
+
425
+
426
+ def _dedupe_posts(posts: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
427
+ """Deduplicate posts by reddit_id, keeping first occurrence."""
428
+ seen_ids = set()
429
+ seen_urls = set()
430
+ unique = []
431
+ for post in posts:
432
+ rid = post.get("reddit_id", "")
433
+ url = post.get("url", "")
434
+ if rid and rid in seen_ids:
435
+ continue
436
+ if url and url in seen_urls:
437
+ continue
438
+ if rid:
439
+ seen_ids.add(rid)
440
+ if url:
441
+ seen_urls.add(url)
442
+ unique.append(post)
443
+ return unique
444
+
445
+
446
+ def search_reddit(
447
+ topic: str,
448
+ from_date: str,
449
+ to_date: str,
450
+ depth: str = "default",
451
+ token: str = None,
452
+ subreddits: List[str] | None = None,
453
+ ) -> Dict[str, Any]:
454
+ """Full Reddit search: multi-query global discovery + subreddit drill-down.
455
+
456
+ This is the main v3 Reddit entry point.
457
+
458
+ Args:
459
+ topic: Search topic
460
+ from_date: Start date (YYYY-MM-DD)
461
+ to_date: End date (YYYY-MM-DD)
462
+ depth: 'quick', 'default', or 'deep'
463
+ token: ScrapeCreators API key
464
+ subreddits: Optional list of subreddit names to search first (pre-resolved)
465
+
466
+ Returns:
467
+ Dict with 'items' list and optional 'error'.
468
+ """
469
+ if not token:
470
+ return {"items": [], "error": "No SCRAPECREATORS_API_KEY configured"}
471
+
472
+ config = DEPTH_CONFIG.get(depth, DEPTH_CONFIG["default"])
473
+ timeframe = config["timeframe"]
474
+ intent = infer_query_intent(topic)
475
+
476
+ # === Phase 1: Query Expansion ===
477
+ queries = expand_reddit_queries(topic, depth)
478
+ _log(f"Expanded '{topic}' into {len(queries)} queries: {queries}")
479
+
480
+ core = _extract_core_subject(topic)
481
+
482
+ # === Phase 1.5: Pre-resolved subreddit search (high-signal) ===
483
+ all_raw_posts = []
484
+ all_items: List[Dict[str, Any]] = []
485
+ if subreddits:
486
+ _log(f"Searching pre-resolved subreddits: {subreddits}")
487
+ with ThreadPoolExecutor(max_workers=min(5, len(subreddits))) as executor:
488
+ futures = {}
489
+ for sub in subreddits:
490
+ futures[executor.submit(_subreddit_search, sub, core, token, "relevance", timeframe)] = sub
491
+ for future in as_completed(futures):
492
+ sub = futures[future]
493
+ sub_posts = future.result()
494
+ _log(f" -> {len(sub_posts)} results from pre-resolved r/{sub}")
495
+ for j, post in enumerate(sub_posts):
496
+ item = _normalize_post(post, len(all_items) + j + 1, f"r/{sub}", query=core)
497
+ all_items.append(item)
498
+
499
+ # === Phase 2: Global Discovery ===
500
+ max_global = config["global_searches"]
501
+
502
+ with ThreadPoolExecutor(max_workers=max_global or 1) as executor:
503
+ futures = {}
504
+ for i, query in enumerate(queries[:max_global]):
505
+ # Product/comparison queries: sort=top surfaces high-engagement posts
506
+ # from relevant communities instead of keyword-matched noise.
507
+ sort = "top" if intent in ("product", "comparison") else ("relevance" if i == 0 else "top")
508
+ _log(f"Global search {i+1}/{max_global}: '{query}' (sort={sort})")
509
+ futures[executor.submit(_global_search, query, token, sort, timeframe)] = query
510
+ for future in as_completed(futures):
511
+ query = futures[future]
512
+ posts = future.result()
513
+ _log(f" -> {len(posts)} results for '{query}'")
514
+ all_raw_posts.extend(posts)
515
+
516
+ # Normalize all posts (with query for relevance scoring)
517
+ for i, post in enumerate(all_raw_posts):
518
+ item = _normalize_post(post, i + 1, "global", query=core)
519
+ all_items.append(item)
520
+
521
+ # === Phase 3: Subreddit Discovery + Targeted Search ===
522
+ subreddit_budget = 0 if intent == "how_to" else config["subreddit_searches"]
523
+ discovered_subs = discover_subreddits(all_raw_posts, topic=topic, max_subs=subreddit_budget)
524
+ _log(f"Discovered subreddits: {discovered_subs}")
525
+
526
+ subreddit_limit = subreddit_budget
527
+ if subreddit_limit > 0:
528
+ with ThreadPoolExecutor(max_workers=subreddit_limit) as executor:
529
+ futures = {}
530
+ for sub in discovered_subs[:subreddit_limit]:
531
+ _log(f"Subreddit search: r/{sub} for '{core}'")
532
+ futures[executor.submit(_subreddit_search, sub, core, token, "relevance", timeframe)] = sub
533
+ for future in as_completed(futures):
534
+ sub = futures[future]
535
+ sub_posts = future.result()
536
+ _log(f" -> {len(sub_posts)} results from r/{sub}")
537
+ for j, post in enumerate(sub_posts):
538
+ item = _normalize_post(post, len(all_items) + j + 1, f"r/{sub}", query=core)
539
+ all_items.append(item)
540
+
541
+ # === Phase 4: Deduplicate ===
542
+ all_items = _dedupe_posts(all_items)
543
+ _log(f"After dedup: {len(all_items)} unique posts")
544
+
545
+ # === Phase 5: Date filter ===
546
+ in_range = []
547
+ out_of_range = 0
548
+ for item in all_items:
549
+ if item["date"] and from_date <= item["date"] <= to_date:
550
+ in_range.append(item)
551
+ elif item["date"] is None:
552
+ in_range.append(item) # Keep unknown dates
553
+ else:
554
+ out_of_range += 1
555
+
556
+ if in_range:
557
+ all_items = in_range
558
+ if out_of_range:
559
+ _log(f"Filtered {out_of_range} posts outside date range")
560
+ else:
561
+ _log(f"No posts within date range, keeping all {len(all_items)}")
562
+
563
+ # === Phase 6: Relevance floor + relevance-weighted ranking ===
564
+ # Drop the off-topic tail when enough on-topic posts remain (guard mirrors
565
+ # the date filter: keep all if too few clear the floor). When too few clear
566
+ # the soft floor, still strip zero-overlap posts (relevance exactly 0 = no
567
+ # title/body token match at all, never on-topic) whenever anything relevant
568
+ # remains, so viral high-upvote junk can't fill the section. Then rank by
569
+ # relevance with a bounded engagement bonus (see RELEVANCE_FLOOR note above).
570
+ before = len(all_items)
571
+ on_topic = [it for it in all_items if (it.get("relevance") or 0) >= RELEVANCE_FLOOR]
572
+ if len(on_topic) >= MIN_ON_TOPIC:
573
+ all_items = on_topic
574
+ else:
575
+ nonzero = [it for it in all_items if (it.get("relevance") or 0) > 0]
576
+ if nonzero:
577
+ all_items = nonzero
578
+ if len(all_items) < before:
579
+ _log(f"Relevance floor dropped {before - len(all_items)} off-topic posts")
580
+ all_items.sort(key=_relevance_rank_key, reverse=True)
581
+
582
+ # Re-index IDs
583
+ for i, item in enumerate(all_items):
584
+ item["id"] = f"R{i+1}"
585
+
586
+ _log(f"Final: {len(all_items)} Reddit posts")
587
+ return {"items": all_items}
588
+
589
+
590
+ def enrich_with_comments(
591
+ items: List[Dict[str, Any]],
592
+ token: str,
593
+ depth: str = "default",
594
+ budget_seconds: int = 60,
595
+ ) -> List[Dict[str, Any]]:
596
+ """Enrich top items with comment data from ScrapeCreators.
597
+
598
+ Args:
599
+ items: Reddit items from search_reddit()
600
+ token: ScrapeCreators API key
601
+ depth: Depth for comment limit
602
+ budget_seconds: Maximum total time for enrichment. If exceeded,
603
+ returns items with whatever enrichment completed. Never discards items.
604
+
605
+ Returns:
606
+ Items with top_comments and comment_insights added.
607
+ """
608
+ config = DEPTH_CONFIG.get(depth, DEPTH_CONFIG["default"])
609
+ max_comments = config["comment_enrichments"]
610
+
611
+ if not items or not token or max_comments <= 0:
612
+ return items
613
+
614
+ # Select the top threads by total engagement (upvotes + comment count),
615
+ # not by list position. This ensures high-comment threads like [FRESH ALBUM]
616
+ # always get enriched even if their upvote score is low.
617
+ ranked = sorted(items, key=_total_engagement, reverse=True)
618
+ top_items = ranked[:max_comments]
619
+ _log(f"Enriching comments for {len(top_items)} posts (by total engagement)")
620
+
621
+ start = time.monotonic()
622
+
623
+ with ThreadPoolExecutor(max_workers=min(4, len(top_items))) as executor:
624
+ futures = {
625
+ executor.submit(fetch_post_comments, item.get("url", ""), token): item
626
+ for item in top_items
627
+ if item.get("url")
628
+ }
629
+
630
+ # Wait with budget instead of unbounded as_completed
631
+ remaining = max(0, budget_seconds - (time.monotonic() - start))
632
+ done, not_done = futures_wait(futures, timeout=remaining)
633
+
634
+ enriched_count = 0
635
+ for future in done:
636
+ item = futures[future]
637
+ try:
638
+ raw_comments = future.result(timeout=0)
639
+ except Exception:
640
+ continue
641
+ if not raw_comments:
642
+ continue
643
+
644
+ top_comments = []
645
+ insights = []
646
+
647
+ for ci, c in enumerate(raw_comments[:10]):
648
+ body = c.get("body", "")
649
+ if not body or body in ("[deleted]", "[removed]"):
650
+ continue
651
+
652
+ score = c.get("ups") or c.get("score", 0)
653
+ author = c.get("author", "[deleted]")
654
+ permalink = c.get("permalink", "")
655
+ comment_url = f"https://reddit.com{permalink}" if permalink else ""
656
+
657
+ max_excerpt = 400 if ci == 0 else 300
658
+ top_comments.append({
659
+ "score": score,
660
+ "date": _parse_date(c.get("created_utc")),
661
+ "author": author,
662
+ "excerpt": body[:max_excerpt],
663
+ "url": comment_url,
664
+ })
665
+
666
+ if len(body) >= 30 and author not in ("[deleted]", "[removed]", "AutoModerator"):
667
+ insight = body[:150]
668
+ if len(body) > 150:
669
+ for i, char in enumerate(insight):
670
+ if char in '.!?' and i > 50:
671
+ insight = insight[:i+1]
672
+ break
673
+ else:
674
+ insight = insight.rstrip() + "..."
675
+ insights.append(insight)
676
+
677
+ top_comments.sort(key=lambda c: c.get("score", 0), reverse=True)
678
+ item["top_comments"] = top_comments[:10]
679
+ item["comment_insights"] = insights[:10]
680
+ enriched_count += 1
681
+
682
+ if not_done:
683
+ _log(f"Enrichment budget hit ({budget_seconds}s): {enriched_count}/{len(futures)} posts enriched, {len(not_done)} skipped")
684
+ for future in not_done:
685
+ future.cancel()
686
+ else:
687
+ elapsed = time.monotonic() - start
688
+ _log(f"Enriched {enriched_count}/{len(futures)} posts in {elapsed:.1f}s")
689
+
690
+ return items
691
+
692
+
693
+ def search_and_enrich(
694
+ topic: str,
695
+ from_date: str,
696
+ to_date: str,
697
+ depth: str = "default",
698
+ token: str = None,
699
+ subreddits: List[str] | None = None,
700
+ ) -> Dict[str, Any]:
701
+ """Full Reddit pipeline: search + comment enrichment.
702
+
703
+ This is the convenience function that does everything.
704
+
705
+ Args:
706
+ topic: Search topic
707
+ from_date: Start date (YYYY-MM-DD)
708
+ to_date: End date (YYYY-MM-DD)
709
+ depth: 'quick', 'default', or 'deep'
710
+ token: ScrapeCreators API key
711
+ subreddits: Optional list of subreddit names to search first (pre-resolved)
712
+
713
+ Returns:
714
+ Dict with 'items' list. Items include top_comments and comment_insights.
715
+ """
716
+ result = search_reddit(topic, from_date, to_date, depth, token, subreddits=subreddits)
717
+ items = result.get("items", [])
718
+
719
+ if items and token:
720
+ items = enrich_with_comments(items, token, depth)
721
+ result["items"] = items
722
+
723
+ return result
724
+
725
+
726
+ def parse_reddit_response(response: Dict[str, Any]) -> List[Dict[str, Any]]:
727
+ """Parse ScrapeCreators response to item list.
728
+
729
+ Parse raw Reddit search output into the generic item shape.
730
+ """
731
+ return response.get("items", [])