| 1 | # Agent mode |
| 2 | |
| 3 | Read when `--agent` appears in skill arguments or the user explicitly requests machine-readable JSON. This mode never grants browser-cookie consent. Skip interactive questions only when doing so is compatible with the root's consent requirements; use the cookie-free path when consent is absent. |
| 4 | |
| 5 | ## Agent Mode (--agent flag) |
| 6 | |
| 7 | If `--agent` appears in ARGUMENTS (e.g., `/last30days plaud granola --agent`): |
| 8 | |
| 9 | 1. **Skip** the intro display block ("I'll research X across Reddit...") |
| 10 | 2. **Skip** any `AskUserQuestion` calls - use `TARGET_TOOL = "unknown"` if not specified |
| 11 | 3. **Run** the research script and WebSearch exactly as normal |
| 12 | 4. **Skip** the "WAIT FOR USER RESPONSE" pause |
| 13 | 5. **Skip** the follow-up invitation ("I'm now an expert on X...") |
| 14 | 6. **Output** the complete research report and stop - do not wait for further input |
| 15 | |
| 16 | When the resolved directory is nonempty, agent mode saves raw research data to `LAST30DAYS_MEMORY_DIR` (defaults to `~/Documents/Last30Days`) automatically via `--save-dir` (handled by the script, no extra tool calls). An empty directory disables these saves and their footer pointer. Use `--output <file>` only when a caller needs the rendered stdout artifact at an exact path, with the format controlled by `--emit`. |
| 17 | |
| 18 | **Machine-readable JSON exception:** If the user explicitly asks for structured JSON for an agent, script, or workflow, replace the normal `--emit=compact` engine invocation with `--emit=json` and pass the engine's stdout through verbatim instead of synthesizing the report format below. The default `--json-profile=agent` is the stable, versioned flat contract; use `--json-profile=raw` only when the user explicitly requests the full internal `Report` dump. `--preflight --emit=json` is a separate permission-preflight contract and is not affected by `--json-profile`. Full field documentation and the versioning policy live in `docs/reference/json-export.md` in the repository. |
| 19 | |
| 20 | Agent mode report format: |
| 21 | |
| 22 | ``` |
| 23 | ## Research Report: {TOPIC} |
| 24 | Generated: {date} | Sources: Reddit, X, Bluesky, YouTube, TikTok, HN, Polymarket, Web |
| 25 | |
| 26 | ### Key Findings |
| 27 | [3-5 bullet points, highest-signal insights with citations] |
| 28 | |
| 29 | ### What I learned |
| 30 | {The full "What I learned" synthesis from normal output} |
| 31 | |
| 32 | ### Stats |
| 33 | {The standard stats block} |
| 34 | ``` |
| 35 | |
| 36 | --- |
| 37 |