@vigolium/piolium 0.0.1

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 (271) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -0
  3. package/agents/access-auditor.md +300 -0
  4. package/agents/assumption-breaker.md +154 -0
  5. package/agents/attack-designer.md +116 -0
  6. package/agents/code-scanner.md +139 -0
  7. package/agents/concurrency-auditor.md +238 -0
  8. package/agents/confirm-writer.md +257 -0
  9. package/agents/context-reviewer.md +274 -0
  10. package/agents/cross-verifier.md +165 -0
  11. package/agents/cve-scout.md +381 -0
  12. package/agents/env-builder.md +282 -0
  13. package/agents/env-profiler.md +205 -0
  14. package/agents/evidence-collector.md +140 -0
  15. package/agents/finding-grader.md +142 -0
  16. package/agents/finding-writer.md +148 -0
  17. package/agents/flow-tracer.md +106 -0
  18. package/agents/goal-backtracer.md +146 -0
  19. package/agents/history-miner.md +467 -0
  20. package/agents/independent-verifier.md +118 -0
  21. package/agents/intent-mapper.md +183 -0
  22. package/agents/longshot-collector.md +128 -0
  23. package/agents/longshot-prober.md +126 -0
  24. package/agents/patch-auditor.md +73 -0
  25. package/agents/poc-author.md +124 -0
  26. package/agents/poc-runner.md +194 -0
  27. package/agents/probe-lead.md +269 -0
  28. package/agents/red-challenger.md +101 -0
  29. package/agents/report-composer.md +208 -0
  30. package/agents/review-adjudicator.md +216 -0
  31. package/agents/spec-auditor.md +155 -0
  32. package/agents/taint-tracer.md +265 -0
  33. package/agents/test-locator.md +209 -0
  34. package/agents/threat-modeler.md +132 -0
  35. package/agents/variant-scanner.md +108 -0
  36. package/agents/variant-spotter.md +110 -0
  37. package/bin/piolium.mjs +376 -0
  38. package/extensions/piolium/_vendor/yaml.bundle.d.mts +6 -0
  39. package/extensions/piolium/_vendor/yaml.bundle.mjs +139 -0
  40. package/extensions/piolium/agent-runner.ts +322 -0
  41. package/extensions/piolium/agents.ts +266 -0
  42. package/extensions/piolium/audit-state.ts +522 -0
  43. package/extensions/piolium/bundled-resources.ts +97 -0
  44. package/extensions/piolium/candidate-scan.ts +966 -0
  45. package/extensions/piolium/command-target.ts +177 -0
  46. package/extensions/piolium/console-stream.ts +57 -0
  47. package/extensions/piolium/export-results.ts +380 -0
  48. package/extensions/piolium/findings.ts +448 -0
  49. package/extensions/piolium/heartbeat.ts +182 -0
  50. package/extensions/piolium/help.ts +234 -0
  51. package/extensions/piolium/index.ts +1865 -0
  52. package/extensions/piolium/longshot.ts +530 -0
  53. package/extensions/piolium/matcher-suggestions.ts +196 -0
  54. package/extensions/piolium/matcher-utils.ts +83 -0
  55. package/extensions/piolium/modes/balanced.ts +750 -0
  56. package/extensions/piolium/modes/confirm-bootstrap.ts +186 -0
  57. package/extensions/piolium/modes/confirm.ts +697 -0
  58. package/extensions/piolium/modes/deep.ts +917 -0
  59. package/extensions/piolium/modes/diff.ts +177 -0
  60. package/extensions/piolium/modes/lite.ts +540 -0
  61. package/extensions/piolium/modes/longshot.ts +595 -0
  62. package/extensions/piolium/modes/merge.ts +204 -0
  63. package/extensions/piolium/modes/phase-runner.ts +267 -0
  64. package/extensions/piolium/modes/reinvest.ts +546 -0
  65. package/extensions/piolium/modes/revisit.ts +279 -0
  66. package/extensions/piolium/modes.ts +48 -0
  67. package/extensions/piolium/phase-labels.ts +123 -0
  68. package/extensions/piolium/phase-status-strip.ts +92 -0
  69. package/extensions/piolium/prompt-prefix-editor.ts +39 -0
  70. package/extensions/piolium/providers/anthropic-vertex.ts +836 -0
  71. package/extensions/piolium/recon.ts +409 -0
  72. package/extensions/piolium/result-stats.ts +105 -0
  73. package/extensions/piolium/retry.ts +120 -0
  74. package/extensions/piolium/scheduler.ts +212 -0
  75. package/extensions/piolium/secrets.ts +368 -0
  76. package/extensions/piolium/tools/web-tools.ts +148 -0
  77. package/package.json +77 -0
  78. package/skills/agentic-actions-auditor/SKILL.md +327 -0
  79. package/skills/agentic-actions-auditor/references/action-profiles.md +186 -0
  80. package/skills/agentic-actions-auditor/references/cross-file-resolution.md +209 -0
  81. package/skills/agentic-actions-auditor/references/foundations.md +94 -0
  82. package/skills/agentic-actions-auditor/references/vector-a-env-var-intermediary.md +77 -0
  83. package/skills/agentic-actions-auditor/references/vector-b-direct-expression-injection.md +83 -0
  84. package/skills/agentic-actions-auditor/references/vector-c-cli-data-fetch.md +83 -0
  85. package/skills/agentic-actions-auditor/references/vector-d-pr-target-checkout.md +88 -0
  86. package/skills/agentic-actions-auditor/references/vector-e-error-log-injection.md +88 -0
  87. package/skills/agentic-actions-auditor/references/vector-f-subshell-expansion.md +82 -0
  88. package/skills/agentic-actions-auditor/references/vector-g-eval-of-ai-output.md +91 -0
  89. package/skills/agentic-actions-auditor/references/vector-h-dangerous-sandbox-configs.md +102 -0
  90. package/skills/agentic-actions-auditor/references/vector-i-wildcard-allowlists.md +88 -0
  91. package/skills/audit/SKILL.md +562 -0
  92. package/skills/audit/assets/icon.svg +7 -0
  93. package/skills/audit/hooks/scripts/validate_phase_output.py +550 -0
  94. package/skills/audit/references/adversarial-review.md +148 -0
  95. package/skills/audit/references/architecture-aware-sast.md +306 -0
  96. package/skills/audit/references/audit-workflow.md +737 -0
  97. package/skills/audit/references/chamber-protocol.md +384 -0
  98. package/skills/audit/references/creative-attack-modes.md +221 -0
  99. package/skills/audit/references/deep-analysis.md +273 -0
  100. package/skills/audit/references/domain-attack-playbooks.md +1129 -0
  101. package/skills/audit/references/knowledge-base-template.md +513 -0
  102. package/skills/audit/references/real-env-validation.md +191 -0
  103. package/skills/audit/references/report-templates.md +417 -0
  104. package/skills/audit/references/triage-and-prereqs.md +134 -0
  105. package/skills/audit/scripts/consolidate_drafts.py +554 -0
  106. package/skills/audit/scripts/partition_findings.py +152 -0
  107. package/skills/audit/scripts/rg-hotspots.sh +121 -0
  108. package/skills/audit/scripts/stamp_file_state.py +349 -0
  109. package/skills/code-reviewer/SKILL.md +65 -0
  110. package/skills/codeql/SKILL.md +281 -0
  111. package/skills/codeql/references/build-fixes.md +90 -0
  112. package/skills/codeql/references/diagnostic-query-templates.md +339 -0
  113. package/skills/codeql/references/extension-yaml-format.md +209 -0
  114. package/skills/codeql/references/important-only-suite.md +153 -0
  115. package/skills/codeql/references/language-details.md +207 -0
  116. package/skills/codeql/references/macos-arm64e-workaround.md +179 -0
  117. package/skills/codeql/references/performance-tuning.md +111 -0
  118. package/skills/codeql/references/quality-assessment.md +172 -0
  119. package/skills/codeql/references/ruleset-catalog.md +63 -0
  120. package/skills/codeql/references/run-all-suite.md +92 -0
  121. package/skills/codeql/references/sarif-processing.md +79 -0
  122. package/skills/codeql/references/threat-models.md +51 -0
  123. package/skills/codeql/workflows/build-database.md +280 -0
  124. package/skills/codeql/workflows/create-data-extensions.md +261 -0
  125. package/skills/codeql/workflows/run-analysis.md +301 -0
  126. package/skills/differential-review/SKILL.md +220 -0
  127. package/skills/differential-review/adversarial.md +203 -0
  128. package/skills/differential-review/methodology.md +234 -0
  129. package/skills/differential-review/patterns.md +300 -0
  130. package/skills/differential-review/reporting.md +369 -0
  131. package/skills/fp-check/SKILL.md +125 -0
  132. package/skills/fp-check/references/bug-class-verification.md +114 -0
  133. package/skills/fp-check/references/deep-verification.md +143 -0
  134. package/skills/fp-check/references/evidence-templates.md +91 -0
  135. package/skills/fp-check/references/false-positive-patterns.md +115 -0
  136. package/skills/fp-check/references/gate-reviews.md +27 -0
  137. package/skills/fp-check/references/standard-verification.md +78 -0
  138. package/skills/insecure-defaults/SKILL.md +117 -0
  139. package/skills/insecure-defaults/references/examples.md +409 -0
  140. package/skills/last30days/SKILL.md +444 -0
  141. package/skills/sarif-parsing/SKILL.md +483 -0
  142. package/skills/sarif-parsing/resources/jq-queries.md +162 -0
  143. package/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
  144. package/skills/security-threat-model/LICENSE.txt +201 -0
  145. package/skills/security-threat-model/SKILL.md +81 -0
  146. package/skills/security-threat-model/agents/openai.yaml +4 -0
  147. package/skills/security-threat-model/references/prompt-template.md +255 -0
  148. package/skills/security-threat-model/references/security-controls-and-assets.md +32 -0
  149. package/skills/semgrep/SKILL.md +212 -0
  150. package/skills/semgrep/references/rulesets.md +162 -0
  151. package/skills/semgrep/references/scan-modes.md +110 -0
  152. package/skills/semgrep/references/scanner-task-prompt.md +140 -0
  153. package/skills/semgrep/scripts/merge_sarif.py +203 -0
  154. package/skills/semgrep/workflows/scan-workflow.md +311 -0
  155. package/skills/semgrep-rule-creator/SKILL.md +168 -0
  156. package/skills/semgrep-rule-creator/references/quick-reference.md +202 -0
  157. package/skills/semgrep-rule-creator/references/workflow.md +240 -0
  158. package/skills/semgrep-rule-variant-creator/SKILL.md +205 -0
  159. package/skills/semgrep-rule-variant-creator/references/applicability-analysis.md +250 -0
  160. package/skills/semgrep-rule-variant-creator/references/language-syntax-guide.md +324 -0
  161. package/skills/semgrep-rule-variant-creator/references/workflow.md +518 -0
  162. package/skills/sharp-edges/SKILL.md +292 -0
  163. package/skills/sharp-edges/references/auth-patterns.md +252 -0
  164. package/skills/sharp-edges/references/case-studies.md +274 -0
  165. package/skills/sharp-edges/references/config-patterns.md +333 -0
  166. package/skills/sharp-edges/references/crypto-apis.md +190 -0
  167. package/skills/sharp-edges/references/lang-c.md +205 -0
  168. package/skills/sharp-edges/references/lang-csharp.md +285 -0
  169. package/skills/sharp-edges/references/lang-go.md +270 -0
  170. package/skills/sharp-edges/references/lang-java.md +263 -0
  171. package/skills/sharp-edges/references/lang-javascript.md +269 -0
  172. package/skills/sharp-edges/references/lang-kotlin.md +265 -0
  173. package/skills/sharp-edges/references/lang-php.md +245 -0
  174. package/skills/sharp-edges/references/lang-python.md +274 -0
  175. package/skills/sharp-edges/references/lang-ruby.md +273 -0
  176. package/skills/sharp-edges/references/lang-rust.md +272 -0
  177. package/skills/sharp-edges/references/lang-swift.md +287 -0
  178. package/skills/sharp-edges/references/language-specific.md +588 -0
  179. package/skills/spec-to-code-compliance/SKILL.md +357 -0
  180. package/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
  181. package/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
  182. package/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
  183. package/skills/supply-chain-risk-auditor/SKILL.md +67 -0
  184. package/skills/supply-chain-risk-auditor/resources/results-template.md +41 -0
  185. package/skills/variant-analysis/METHODOLOGY.md +327 -0
  186. package/skills/variant-analysis/SKILL.md +142 -0
  187. package/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
  188. package/skills/variant-analysis/resources/codeql/go.ql +69 -0
  189. package/skills/variant-analysis/resources/codeql/java.ql +71 -0
  190. package/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
  191. package/skills/variant-analysis/resources/codeql/python.ql +80 -0
  192. package/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
  193. package/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
  194. package/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
  195. package/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
  196. package/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
  197. package/skills/variant-analysis/resources/variant-report-template.md +75 -0
  198. package/skills/vuln-report/SKILL.md +137 -0
  199. package/skills/vuln-report/agents/openai.yaml +4 -0
  200. package/skills/vuln-report/references/report-template.md +135 -0
  201. package/skills/wooyun-legacy/SKILL.md +367 -0
  202. package/skills/wooyun-legacy/references/bank-penetration.md +222 -0
  203. package/skills/wooyun-legacy/references/checklists/command-execution-checklist.md +119 -0
  204. package/skills/wooyun-legacy/references/checklists/csrf-checklist.md +74 -0
  205. package/skills/wooyun-legacy/references/checklists/file-upload-checklist.md +108 -0
  206. package/skills/wooyun-legacy/references/checklists/info-disclosure-checklist.md +114 -0
  207. package/skills/wooyun-legacy/references/checklists/logic-flaws-checklist.md +95 -0
  208. package/skills/wooyun-legacy/references/checklists/misconfig-checklist.md +124 -0
  209. package/skills/wooyun-legacy/references/checklists/path-traversal-checklist.md +87 -0
  210. package/skills/wooyun-legacy/references/checklists/rce-checklist.md +93 -0
  211. package/skills/wooyun-legacy/references/checklists/sql-injection-checklist.md +97 -0
  212. package/skills/wooyun-legacy/references/checklists/ssrf-checklist.md +99 -0
  213. package/skills/wooyun-legacy/references/checklists/unauthorized-access-checklist.md +89 -0
  214. package/skills/wooyun-legacy/references/checklists/weak-password-checklist.md +115 -0
  215. package/skills/wooyun-legacy/references/checklists/xss-checklist.md +103 -0
  216. package/skills/wooyun-legacy/references/checklists/xxe-checklist.md +130 -0
  217. package/skills/wooyun-legacy/references/info-disclosure.md +975 -0
  218. package/skills/wooyun-legacy/references/logic-flaws.md +721 -0
  219. package/skills/wooyun-legacy/references/path-traversal.md +1191 -0
  220. package/skills/wooyun-legacy/references/telecom-penetration.md +156 -0
  221. package/skills/wooyun-legacy/references/unauthorized-access.md +980 -0
  222. package/skills/wooyun-legacy/references/xss.md +746 -0
  223. package/skills/zeroize-audit/SKILL.md +371 -0
  224. package/skills/zeroize-audit/configs/c.yaml +21 -0
  225. package/skills/zeroize-audit/configs/default.yaml +128 -0
  226. package/skills/zeroize-audit/configs/rust.yaml +83 -0
  227. package/skills/zeroize-audit/prompts/report_template.md +238 -0
  228. package/skills/zeroize-audit/prompts/system.md +163 -0
  229. package/skills/zeroize-audit/prompts/task.md +97 -0
  230. package/skills/zeroize-audit/references/compile-commands.md +231 -0
  231. package/skills/zeroize-audit/references/detection-strategy.md +191 -0
  232. package/skills/zeroize-audit/references/ir-analysis.md +252 -0
  233. package/skills/zeroize-audit/references/mcp-analysis.md +221 -0
  234. package/skills/zeroize-audit/references/poc-generation.md +470 -0
  235. package/skills/zeroize-audit/references/rust-zeroization-patterns.md +867 -0
  236. package/skills/zeroize-audit/schemas/input.json +83 -0
  237. package/skills/zeroize-audit/schemas/output.json +140 -0
  238. package/skills/zeroize-audit/tools/analyze_asm.sh +202 -0
  239. package/skills/zeroize-audit/tools/analyze_cfg.py +381 -0
  240. package/skills/zeroize-audit/tools/analyze_heap.sh +211 -0
  241. package/skills/zeroize-audit/tools/analyze_ir_semantic.py +429 -0
  242. package/skills/zeroize-audit/tools/diff_ir.sh +135 -0
  243. package/skills/zeroize-audit/tools/diff_rust_mir.sh +189 -0
  244. package/skills/zeroize-audit/tools/emit_asm.sh +67 -0
  245. package/skills/zeroize-audit/tools/emit_ir.sh +77 -0
  246. package/skills/zeroize-audit/tools/emit_rust_asm.sh +178 -0
  247. package/skills/zeroize-audit/tools/emit_rust_ir.sh +150 -0
  248. package/skills/zeroize-audit/tools/emit_rust_mir.sh +158 -0
  249. package/skills/zeroize-audit/tools/extract_compile_flags.py +284 -0
  250. package/skills/zeroize-audit/tools/generate_poc.py +1329 -0
  251. package/skills/zeroize-audit/tools/mcp/apply_confidence_gates.py +113 -0
  252. package/skills/zeroize-audit/tools/mcp/check_mcp.sh +68 -0
  253. package/skills/zeroize-audit/tools/mcp/normalize_mcp_evidence.py +125 -0
  254. package/skills/zeroize-audit/tools/scripts/check_llvm_patterns.py +481 -0
  255. package/skills/zeroize-audit/tools/scripts/check_mir_patterns.py +554 -0
  256. package/skills/zeroize-audit/tools/scripts/check_rust_asm.py +424 -0
  257. package/skills/zeroize-audit/tools/scripts/check_rust_asm_aarch64.py +300 -0
  258. package/skills/zeroize-audit/tools/scripts/check_rust_asm_x86.py +283 -0
  259. package/skills/zeroize-audit/tools/scripts/find_dangerous_apis.py +375 -0
  260. package/skills/zeroize-audit/tools/scripts/semantic_audit.py +923 -0
  261. package/skills/zeroize-audit/tools/track_dataflow.sh +196 -0
  262. package/skills/zeroize-audit/tools/validate_rust_toolchain.sh +298 -0
  263. package/skills/zeroize-audit/workflows/phase-0-preflight.md +150 -0
  264. package/skills/zeroize-audit/workflows/phase-1-source-analysis.md +144 -0
  265. package/skills/zeroize-audit/workflows/phase-2-compiler-analysis.md +139 -0
  266. package/skills/zeroize-audit/workflows/phase-3-interim-report.md +46 -0
  267. package/skills/zeroize-audit/workflows/phase-4-poc-generation.md +46 -0
  268. package/skills/zeroize-audit/workflows/phase-5-poc-validation.md +136 -0
  269. package/skills/zeroize-audit/workflows/phase-6-final-report.md +44 -0
  270. package/skills/zeroize-audit/workflows/phase-7-test-generation.md +42 -0
  271. package/themes/piolium-srcery.json +94 -0
@@ -0,0 +1,444 @@
1
+ ---
2
+ name: last30days
3
+ description: "Researches a topic from the last 30 days on Reddit, X, and the web. Surfaces real community discussions with engagement metrics and synthesizes findings into actionable insights. Use when the user wants to know what people are saying about a topic right now."
4
+ argument-hint: 'nano banana pro prompts, NVIDIA news, best AI video tools'
5
+ allowed-tools:
6
+ - Bash
7
+ - Read
8
+ - Write
9
+ - AskUserQuestion
10
+ - WebSearch
11
+ - mcp__exa__web_search_exa
12
+ ---
13
+
14
+ # last30days: Research Any Topic from the Last 30 Days
15
+
16
+ Research ANY topic across Reddit, X, and the web. Surface what people are actually discussing, recommending, and debating right now.
17
+
18
+ ## When to Use
19
+
20
+ - User wants to know what people are saying about a topic in the last 30 days
21
+ - User asks for recent community sentiment, recommendations, or trending discussions
22
+ - User wants to research a topic before making a decision (tools, products, techniques)
23
+ - User asks "what's new with X" or "best Y" or "what are people saying about Z"
24
+
25
+ ## When NOT to Use
26
+
27
+ - User wants historical data older than 30 days
28
+ - User needs official documentation or API references (use docs tools instead)
29
+ - User wants to search a specific codebase (use code search tools)
30
+ - User asks a factual question that doesn't need community sentiment
31
+
32
+ ## CRITICAL: Parse User Intent
33
+
34
+ Before doing anything, parse the user's input for:
35
+
36
+ 1. **TOPIC**: What they want to learn about (e.g., "web app mockups", "Claude Code skills", "image generation")
37
+ 2. **TARGET TOOL** (if specified): Where they'll use the prompts (e.g., "Nano Banana Pro", "ChatGPT", "Midjourney")
38
+ 3. **QUERY TYPE**: What kind of research they want:
39
+ - **PROMPTING** - "X prompts", "prompting for X", "X best practices" -> User wants to learn techniques and get copy-paste prompts
40
+ - **RECOMMENDATIONS** - "best X", "top X", "what X should I use", "recommended X" -> User wants a LIST of specific things
41
+ - **NEWS** - "what's happening with X", "X news", "latest on X" -> User wants current events/updates
42
+ - **GENERAL** - anything else -> User wants broad understanding of the topic
43
+
44
+ Common patterns:
45
+ - `[topic] for [tool]` -> "web mockups for Nano Banana Pro" -> TOOL IS SPECIFIED
46
+ - `[topic] prompts for [tool]` -> "UI design prompts for Midjourney" -> TOOL IS SPECIFIED
47
+ - Just `[topic]` -> "iOS design mockups" -> TOOL NOT SPECIFIED, that's OK
48
+ - "best [topic]" or "top [topic]" -> QUERY_TYPE = RECOMMENDATIONS
49
+ - "what are the best [topic]" -> QUERY_TYPE = RECOMMENDATIONS
50
+
51
+ **IMPORTANT: Do NOT ask about target tool before research.**
52
+ - If tool is specified in the query, use it
53
+ - If tool is NOT specified, run research first, then ask AFTER showing results
54
+
55
+ **Store these variables:**
56
+ - `TOPIC = [extracted topic]`
57
+ - `TARGET_TOOL = [extracted tool, or "unknown" if not specified]`
58
+ - `QUERY_TYPE = [RECOMMENDATIONS | NEWS | HOW-TO | GENERAL]`
59
+
60
+ **DISPLAY your parsing to the user.** Before running any tools, output:
61
+
62
+ ```
63
+ I'll research {TOPIC} across Reddit, X, and the web to find what's been discussed in the last 30 days.
64
+
65
+ Parsed intent:
66
+ - TOPIC = {TOPIC}
67
+ - TARGET_TOOL = {TARGET_TOOL or "unknown"}
68
+ - QUERY_TYPE = {QUERY_TYPE}
69
+
70
+ Starting now.
71
+ ```
72
+
73
+ If TARGET_TOOL is known, mention it in the intro: "...to find {QUERY_TYPE}-style content for use in {TARGET_TOOL}."
74
+
75
+ This text MUST appear before you call any tools. It confirms to the user that you understood their request.
76
+
77
+ ---
78
+
79
+ ## Research Execution
80
+
81
+ **Step 1: Run the research script**
82
+ ```bash
83
+ python3 "{baseDir}/scripts/last30days.py" "$ARGUMENTS" --emit=compact 2>&1
84
+ ```
85
+
86
+ The script will automatically:
87
+ - Detect available API keys
88
+ - Run Reddit/X searches if keys exist
89
+ - Signal if WebSearch is needed
90
+
91
+ ---
92
+
93
+ ## STEP 2: DO WEBSEARCH WHILE SCRIPT RUNS
94
+
95
+ The script auto-detects sources (API keys, etc). While waiting for it, do WebSearch.
96
+
97
+ For **ALL modes**, do WebSearch to supplement (or provide all data in web-only mode).
98
+
99
+ Choose search queries based on QUERY_TYPE:
100
+
101
+ **If RECOMMENDATIONS** ("best X", "top X", "what X should I use"):
102
+ - Search for: `best {TOPIC} recommendations`
103
+ - Search for: `{TOPIC} list examples`
104
+ - Search for: `most popular {TOPIC}`
105
+ - Goal: Find SPECIFIC NAMES of things, not generic advice
106
+
107
+ **If NEWS** ("what's happening with X", "X news"):
108
+ - Search for: `{TOPIC} news 2026`
109
+ - Search for: `{TOPIC} announcement update`
110
+ - Goal: Find current events and recent developments
111
+
112
+ **If PROMPTING** ("X prompts", "prompting for X"):
113
+ - Search for: `{TOPIC} prompts examples 2026`
114
+ - Search for: `{TOPIC} techniques tips`
115
+ - Goal: Find prompting techniques and examples to create copy-paste prompts
116
+
117
+ **If GENERAL** (default):
118
+ - Search for: `{TOPIC} 2026`
119
+ - Search for: `{TOPIC} discussion`
120
+ - Goal: Find what people are actually saying
121
+
122
+ For ALL query types:
123
+ - **USE THE USER'S EXACT TERMINOLOGY** - don't substitute or add tech names based on your knowledge
124
+ - EXCLUDE reddit.com, x.com, twitter.com (covered by script)
125
+ - INCLUDE: blogs, tutorials, docs, news, GitHub repos
126
+ - **DO NOT output "Sources:" list** - this is noise, we'll show stats at the end
127
+
128
+ **Options** (passed through from user's command):
129
+ - `--days=N` -> Look back N days instead of 30 (e.g., `--days=7` for weekly roundup)
130
+ - `--quick` -> Faster, fewer sources (8-12 each)
131
+ - (default) -> Balanced (20-30 each)
132
+ - `--deep` -> Comprehensive (50-70 Reddit, 40-60 X)
133
+
134
+ ---
135
+
136
+ ## Judge Agent: Synthesize All Sources
137
+
138
+ **After all searches complete, internally synthesize (don't display stats yet):**
139
+
140
+ The Judge Agent must:
141
+ 1. Weight Reddit/X sources HIGHER (they have engagement signals: upvotes, likes)
142
+ 2. Weight WebSearch sources LOWER (no engagement data)
143
+ 3. Identify patterns that appear across ALL three sources (strongest signals)
144
+ 4. Note any contradictions between sources
145
+ 5. Extract the top 3-5 actionable insights
146
+
147
+ **Do NOT display stats here - they come at the end, right before the invitation.**
148
+
149
+ ---
150
+
151
+ ## FIRST: Internalize the Research
152
+
153
+ **CRITICAL: Ground your synthesis in the ACTUAL research content, not your pre-existing knowledge.**
154
+
155
+ Read the research output carefully. Pay attention to:
156
+ - **Exact product/tool names** mentioned (e.g., if research mentions "ClawdBot" or "@clawdbot", that's a DIFFERENT product than "Claude Code" - don't conflate them)
157
+ - **Specific quotes and insights** from the sources - use THESE, not generic knowledge
158
+ - **What the sources actually say**, not what you assume the topic is about
159
+
160
+ **ANTI-PATTERN TO AVOID**: If user asks about "clawdbot skills" and research returns ClawdBot content (self-hosted AI agent), do NOT synthesize this as "Claude Code skills" just because both involve "skills". Read what the research actually says.
161
+
162
+ ### If QUERY_TYPE = RECOMMENDATIONS
163
+
164
+ **CRITICAL: Extract SPECIFIC NAMES, not generic patterns.**
165
+
166
+ When user asks "best X" or "top X", they want a LIST of specific things:
167
+ - Scan research for specific product names, tool names, project names, skill names, etc.
168
+ - Count how many times each is mentioned
169
+ - Note which sources recommend each (Reddit thread, X post, blog)
170
+ - List them by popularity/mention count
171
+
172
+ **BAD synthesis for "best Claude Code skills":**
173
+ > "Skills are powerful. Keep them under 500 lines. Use progressive disclosure."
174
+
175
+ **GOOD synthesis for "best Claude Code skills":**
176
+ > "Most mentioned skills: /commit (5 mentions), remotion skill (4x), git-worktree (3x), /pr (3x). The Remotion announcement got 16K likes on X."
177
+
178
+ ### For all QUERY_TYPEs
179
+
180
+ Identify from the ACTUAL RESEARCH OUTPUT:
181
+ - **PROMPT FORMAT** - Does research recommend JSON, structured params, natural language, keywords?
182
+ - The top 3-5 patterns/techniques that appeared across multiple sources
183
+ - Specific keywords, structures, or approaches mentioned BY THE SOURCES
184
+ - Common pitfalls mentioned BY THE SOURCES
185
+
186
+ ---
187
+
188
+ ## THEN: Show Summary + Invite Vision
189
+
190
+ **Display in this EXACT sequence:**
191
+
192
+ **FIRST - What I learned (based on QUERY_TYPE):**
193
+
194
+ **If RECOMMENDATIONS** - Show specific things mentioned with sources:
195
+ ```
196
+ Most mentioned:
197
+
198
+ [Tool Name] - {n}x mentions
199
+ Use Case: [what it does]
200
+ Sources: @handle1, @handle2, r/sub, blog.com
201
+
202
+ [Tool Name] - {n}x mentions
203
+ Use Case: [what it does]
204
+ Sources: @handle3, r/sub2, Complex
205
+
206
+ Notable mentions: [other specific things with 1-2 mentions]
207
+ ```
208
+
209
+ **CRITICAL for RECOMMENDATIONS:**
210
+ - Each item MUST have a "Sources:" line with actual @handles from X posts (e.g., @LONGLIVE47, @ByDobson)
211
+ - Include subreddit names (r/hiphopheads) and web sources (Complex, Variety)
212
+ - Parse @handles from research output and include the highest-engagement ones
213
+ - Format naturally - tables work well for wide terminals, stacked cards for narrow
214
+
215
+ **If PROMPTING/NEWS/GENERAL** - Show synthesis and patterns:
216
+
217
+ CITATION RULE: Cite sources sparingly to prove research is real.
218
+ - In the "What I learned" intro: cite 1-2 top sources total, not every sentence
219
+ - In KEY PATTERNS: cite 1 source per pattern, short format: "per @handle" or "per r/sub"
220
+ - Do NOT include engagement metrics in citations (likes, upvotes) - save those for stats box
221
+ - Do NOT chain multiple citations: "per @x, @y, @z" is too much. Pick the strongest one.
222
+
223
+ CITATION PRIORITY (most to least preferred):
224
+ 1. @handles from X -- "per @handle" (these prove the tool's unique value)
225
+ 2. r/subreddits from Reddit -- "per r/subreddit"
226
+ 3. Web sources -- ONLY when Reddit/X don't cover that specific fact
227
+
228
+ The tool's value is surfacing what PEOPLE are saying, not what journalists wrote.
229
+ When both a web article and an X post cover the same fact, cite the X post.
230
+
231
+ URL FORMATTING: NEVER paste raw URLs in the output.
232
+ - **BAD:** "per https://www.rollingstone.com/music/music-news/kanye-west-bully-1235506094/"
233
+ - **GOOD:** "per Rolling Stone"
234
+ - **GOOD:** "per Complex"
235
+ Use the publication name, not the URL. The user doesn't need links -- they need clean, readable text.
236
+
237
+ **BAD:** "His album is set for March 20 (per Rolling Stone; Billboard; Complex)."
238
+ **GOOD:** "His album BULLY drops March 20 -- fans on X are split on the tracklist, per @honest30bgfan_"
239
+ **GOOD:** "Ye's apology got massive traction on r/hiphopheads"
240
+ **OK** (web, only when Reddit/X don't have it): "The Hellwatt Festival runs July 4-18 at RCF Arena, per Billboard"
241
+
242
+ **Lead with people, not publications.** Start each topic with what Reddit/X
243
+ users are saying/feeling, then add web context only if needed. The user came
244
+ here for the conversation, not the press release.
245
+
246
+ ```
247
+ What I learned:
248
+
249
+ **{Topic 1}** -- [1-2 sentences about what people are saying, per @handle or r/sub]
250
+
251
+ **{Topic 2}** -- [1-2 sentences, per @handle or r/sub]
252
+
253
+ **{Topic 3}** -- [1-2 sentences, per @handle or r/sub]
254
+
255
+ KEY PATTERNS from the research:
256
+ 1. [Pattern] -- per @handle
257
+ 2. [Pattern] -- per r/sub
258
+ 3. [Pattern] -- per @handle
259
+ ```
260
+
261
+ **THEN - Stats (right before invitation):**
262
+
263
+ **CRITICAL: Calculate actual totals from the research output.**
264
+ - Count posts/threads from each section
265
+ - Sum engagement: parse `[Xlikes, Yrt]` from each X post, `[Xpts, Ycmt]` from Reddit
266
+ - Identify top voices: highest-engagement @handles from X, most active subreddits
267
+
268
+ **Copy this EXACTLY, replacing only the {placeholders}:**
269
+
270
+ ```
271
+ ---
272
+ All agents reported back!
273
+ |- Reddit: {N} threads | {N} upvotes | {N} comments
274
+ |- X: {N} posts | {N} likes | {N} reposts (via xAI)
275
+ |- Web: {N} pages (supplementary)
276
+ |- Top voices: @{handle1} ({N} likes), @{handle2} | r/{sub1}, r/{sub2}
277
+ ---
278
+ ```
279
+
280
+ If Reddit returned 0 threads, write: "|- Reddit: 0 threads (no results this cycle)"
281
+
282
+ **SELF-CHECK before displaying**: Re-read your "What I learned" section. Does it match what the research ACTUALLY says? If you catch yourself projecting your own knowledge instead of the research, rewrite it.
283
+
284
+ **LAST - Invitation (adapt to QUERY_TYPE):**
285
+
286
+ **CRITICAL: Every invitation MUST include 2-3 specific example suggestions based on what you ACTUALLY learned from the research.** Don't be generic -- show the user you absorbed the content by referencing real things from the results.
287
+
288
+ **If QUERY_TYPE = PROMPTING:**
289
+ ```
290
+ ---
291
+ I'm now an expert on {TOPIC} for {TARGET_TOOL}. What do you want to make? For example:
292
+ - [specific idea based on popular technique from research]
293
+ - [specific idea based on trending style/approach from research]
294
+ - [specific idea riffing on what people are actually creating]
295
+
296
+ Just describe your vision and I'll write a prompt you can paste straight into {TARGET_TOOL}.
297
+ ```
298
+
299
+ **If QUERY_TYPE = RECOMMENDATIONS:**
300
+ ```
301
+ ---
302
+ I'm now an expert on {TOPIC}. Want me to go deeper? For example:
303
+ - [Compare specific item A vs item B from the results]
304
+ - [Explain why item C is trending right now]
305
+ - [Help you get started with item D]
306
+ ```
307
+
308
+ **If QUERY_TYPE = NEWS:**
309
+ ```
310
+ ---
311
+ I'm now an expert on {TOPIC}. Some things you could ask:
312
+ - [Specific follow-up question about the biggest story]
313
+ - [Question about implications of a key development]
314
+ - [Question about what might happen next based on current trajectory]
315
+ ```
316
+
317
+ **If QUERY_TYPE = GENERAL:**
318
+ ```
319
+ ---
320
+ I'm now an expert on {TOPIC}. Some things I can help with:
321
+ - [Specific question based on the most discussed aspect]
322
+ - [Specific creative/practical application of what you learned]
323
+ - [Deeper dive into a pattern or debate from the research]
324
+ ```
325
+
326
+ **Example invitations (to show the quality bar):**
327
+
328
+ For `/last30days nano banana pro prompts for Gemini`:
329
+ > I'm now an expert on Nano Banana Pro for Gemini. What do you want to make? For example:
330
+ > - Photorealistic product shots with natural lighting (the most requested style right now)
331
+ > - Logo designs with embedded text (Gemini's new strength per the research)
332
+ > - Multi-reference style transfer from a mood board
333
+ >
334
+ > Just describe your vision and I'll write a prompt you can paste straight into Gemini.
335
+
336
+ For `/last30days kanye west` (GENERAL):
337
+ > I'm now an expert on Kanye West. Some things I can help with:
338
+ > - What's the real story behind the apology letter -- genuine or PR move?
339
+ > - Break down the BULLY tracklist reactions and what fans are expecting
340
+ > - Compare how Reddit vs X are reacting to the Bianca narrative
341
+
342
+ For `/last30days war in Iran` (NEWS):
343
+ > I'm now an expert on the Iran situation. Some things you could ask:
344
+ > - What are the realistic escalation scenarios from here?
345
+ > - How is this playing differently in US vs international media?
346
+ > - What's the economic impact on oil markets so far?
347
+
348
+ ---
349
+
350
+ ## WAIT FOR USER'S RESPONSE
351
+
352
+ After showing the stats summary with your invitation, **STOP and wait** for the user to respond.
353
+
354
+ ---
355
+
356
+ ## WHEN USER RESPONDS
357
+
358
+ **Read their response and match the intent:**
359
+
360
+ - If they ask a **QUESTION** about the topic -> Answer from your research (no new searches, no prompt)
361
+ - If they ask to **GO DEEPER** on a subtopic -> Elaborate using your research findings
362
+ - If they describe something they want to **CREATE** -> Write ONE perfect prompt (see below)
363
+ - If they ask for a **PROMPT** explicitly -> Write ONE perfect prompt (see below)
364
+
365
+ **Only write a prompt when the user wants one.** Don't force a prompt on someone who asked "what could happen next with Iran."
366
+
367
+ ### Writing a Prompt
368
+
369
+ When the user wants a prompt, write a **single, highly-tailored prompt** using your research expertise.
370
+
371
+ ### CRITICAL: Match the FORMAT the research recommends
372
+
373
+ **If research says to use a specific prompt FORMAT, YOU MUST USE THAT FORMAT.**
374
+
375
+ **ANTI-PATTERN**: Research says "use JSON prompts with device specs" but you write plain prose. This defeats the entire purpose of the research.
376
+
377
+ ### Quality Checklist (run before delivering):
378
+ - [ ] **FORMAT MATCHES RESEARCH** - If research said JSON/structured/etc, prompt IS that format
379
+ - [ ] Directly addresses what the user said they want to create
380
+ - [ ] Uses specific patterns/keywords discovered in research
381
+ - [ ] Ready to paste with zero edits (or minimal [PLACEHOLDERS] clearly marked)
382
+ - [ ] Appropriate length and style for TARGET_TOOL
383
+
384
+ ### Output Format:
385
+
386
+ ```
387
+ Here's your prompt for {TARGET_TOOL}:
388
+
389
+ ---
390
+
391
+ [The actual prompt IN THE FORMAT THE RESEARCH RECOMMENDS]
392
+
393
+ ---
394
+
395
+ This uses [brief 1-line explanation of what research insight you applied].
396
+ ```
397
+
398
+ ---
399
+
400
+ ## IF USER ASKS FOR MORE OPTIONS
401
+
402
+ Only if they ask for alternatives or more prompts, provide 2-3 variations. Don't dump a prompt pack unless requested.
403
+
404
+ ---
405
+
406
+ ## AFTER EACH PROMPT: Stay in Expert Mode
407
+
408
+ After delivering a prompt, offer to write more:
409
+
410
+ > Want another prompt? Just tell me what you're creating next.
411
+
412
+ ---
413
+
414
+ ## CONTEXT MEMORY
415
+
416
+ For the rest of this conversation, remember:
417
+ - **TOPIC**: {topic}
418
+ - **TARGET_TOOL**: {tool}
419
+ - **KEY PATTERNS**: {list the top 3-5 patterns you learned}
420
+ - **RESEARCH FINDINGS**: The key facts and insights from the research
421
+
422
+ **CRITICAL: After research is complete, you are now an EXPERT on this topic.**
423
+
424
+ When the user asks follow-up questions:
425
+ - **DO NOT run new WebSearches** - you already have the research
426
+ - **Answer from what you learned** - cite the Reddit threads, X posts, and web sources
427
+ - **If they ask a question** - answer it from your research findings
428
+ - **If they ask for a prompt** - write one using your expertise
429
+
430
+ Only do new research if the user explicitly asks about a DIFFERENT topic.
431
+
432
+ ---
433
+
434
+ ## Output Summary Footer (After Each Prompt)
435
+
436
+ After delivering a prompt, end with:
437
+
438
+ ```
439
+ ---
440
+ Expert in: {TOPIC} for {TARGET_TOOL}
441
+ Based on: {n} Reddit threads ({sum} upvotes) + {n} X posts ({sum} likes) + {n} web pages
442
+
443
+ Want another prompt? Just tell me what you're creating next.
444
+ ```