{"skill":{"slug":"daily-investment-digest","displayName":"daily-investment-digest","summary":"Fetch financing event lists from the iYiou skill API and generate daily or recent-N-days financing reports in Markdown to stdout. Use when the task asks to p...","description":"---\nname: daily-investment-digest\ndescription: Fetch financing event lists from the iYiou skill API and generate daily or recent-N-days financing reports in Markdown to stdout. Use when the task asks to pull investment/financing events via `https://api.iyiou.com/skill/info?page=...&pageSize=...`, deduplicate records, default to yesterday for single-day reports, and support recent 2-7 day windows by fetching up to the hard limit of 250 records and filtering by `createdAt`.\n---\n\n# Daily Investment Digest\n\n## Overview\n\n- Pull investment/financing events from `https://api.iyiou.com/skill/info`.\n- Normalize fields, deduplicate rows, and generate a structured Chinese investment report.\n\n## Workflow\n\n1. One-command full report (recommended, default uses yesterday).\n```bash\nnode \"{baseDir}/scripts/run_full_report.mjs\" \\\n  --max-page 5\n```\n\n2. If user explicitly asks for today's report, pass today's date.\n```bash\nnode \"{baseDir}/scripts/run_full_report.mjs\" \\\n  --report-date 2026-03-11 \\\n  --max-page 5\n```\n\n3. If user asks for recent 2-7 days, use `--recent-days`.\n```bash\nnode \"{baseDir}/scripts/run_full_report.mjs\" \\\n  --recent-days 7\n```\n\n4. Direct output mode (stdout only, no file).\n```bash\nnode \"{baseDir}/scripts/fetch_events.mjs\" \\\n  --recent-days 3 \\\n  --stdout-json | \\\nnode \"{baseDir}/scripts/generate_report.mjs\" \\\n  --input-json - \\\n  --top-n 0 \\\n  --stdout\n```\n\n## Path Safety\n\n- Always call scripts with quoted `{baseDir}` paths to avoid whitespace-path issues.\n- Scripts resolve relative input paths against the skill root directory.\n\n## Required API Rules\n\n- Use `pageSize=10`.\n- Start at `page=1`.\n- Increment `page` by 1 each request.\n- Single-day mode: stop when `page>5` or API event list is empty.\n- Recent-N-days mode (`N=2..7`): fetch up to the hard limit of 250 records, i.e. `pageSize=10` and `page<=25`, then filter by `createdAt`.\n- Parse response strictly by schema: `response.code` -> `response.data.posts`.\n- Treat non-zero `code` as API failure.\n- Retry failed requests up to 3 times before skipping a page.\n\n## Script Interfaces\n\n### `scripts/run_full_report.mjs`\n\n- One-command pipeline: fetch + generate\n- Defaults to full output (`top-n=0`)\n- Supports `--report-date`, `--recent-days`, `--max-page`, `--page-size`, `--timeout-seconds`, `--retry`, `--delay-seconds`\n- Supports `--top-n` (`0` means all events)\n\n### `scripts/fetch_events.mjs`\n\n- `--page-size` default `10`\n- `--max-page` default `5` for single-day mode, forced to `25` for recent-N-days mode\n- `--report-date` default yesterday (`YYYY-MM-DD`) and acts as range end date\n- `--recent-days` supports `1..7`; `1` means a single-day report, `2..7` means recent-N-days report\n- `--timeout-seconds` default `15`\n- `--retry` default `3`\n- `--delay-seconds` default `0`\n- Always prints JSON to stdout (`--stdout-json` kept only for compatibility)\n- Numeric args are bounded for safety: `recent-days[1,7]`, `page-size[1,100]`, `max-page[1,25]`, `retry[1,10]`\n\n### `scripts/generate_report.mjs`\n\n- `--input-json` required\n- `--top-n` default `0` (`0` means all events)\n- Always prints report text to stdout (`--stdout` kept only for compatibility)\n- Numeric args are bounded for safety: `top-n[0,500]`\n\n## Output Files\n\n- Disabled by design. This skill is stdout-only and does not write report artifacts to disk.\n\n## Data Mapping\n\n- Follow [field_mapping.md](references/field_mapping.md) for source-to-target mapping and fallback rules.\n- To reduce context size, the fetch output keeps only: `brief`, `createdAt`, `originalLink`, `postTitle`, `tags`.\n\n## Failure Handling\n\n- Continue on single-page failure after retries.\n- Use progressive retry backoff (`0.5s`, `1.0s`, `1.5s`, ...).\n- Record page-level errors in output JSON `meta.errors`.\n- Generate a report even when no events are found, and clearly mark it as an empty-day report.\n\n## Output Policy\n\n- Date policy: default to yesterday for single-day reports; only use today when the user explicitly asks for today.\n- Window policy: support `最近两天`、`最近三天` ... `最近一周` by mapping to `--recent-days 2..7`.\n- If user asks full detail, run with `--top-n 0`.\n- Use script stdout as the main body and keep event entries unchanged.\n- The scripts are responsible only for fetching, filtering, deduplicating, and rendering the event list plus basic statistics.\n- The ending section `投资事件总结` must be added by the AI in the final response, not by the scripts.\n- Output order is mandatory:\n1. First output the full event list.\n2. Each event must include: `公司简称`、`轮次`、`投资方`、`事件摘要`、`来源链接`.\n3. After the full event list, the final AI response must append one ending section titled `投资事件总结`.\n- Do not place `投资事件总结` before event entries.\n\n## Quick Checks\n\n1. Run fetch step and confirm `meta.total_unique_events > 0` on active days.\n2. In recent-N-days mode, confirm `meta.recent_days` and `meta.range_start_date` are present and `max_page=25`.\n2. Run report step and confirm stdout contains:\n- `核心数据概览`\n- `融资事件按行业分类`\n3. In final AI response, confirm order:\n- Event list appears first and each item includes `公司简称`、`轮次`、`投资方`、`事件摘要`、`来源链接`.\n- `投资事件总结` appears only after the event list.\n- `投资事件总结` appears exactly once at the end.\n4. In final AI response, confirm the AI appends:\n- `投资事件总结`\n\n## Example End-to-End Command\n\n```bash\nnode \"{baseDir}/scripts/run_full_report.mjs\" \\\n  --recent-days 7\n```\n","topics":["Investment"],"tags":{"latest":"1.0.1"},"stats":{"comments":0,"downloads":830,"installsAllTime":31,"installsCurrent":0,"stars":2,"versions":2},"createdAt":1773275212829,"updatedAt":1780456033137},"latestVersion":{"version":"1.0.1","createdAt":1780456033137,"changelog":"- Added support for recent-N-day reports (2–7 days) with filtering and larger fetch window (up to 250 records).\n- Updated CLI and script interfaces: new --recent-days argument; --max-page capped at 25 in recent-days mode.\n- Clarified output policy: scripts do not emit \"投资事件总结\"; final section must be AI-appended.\n- Improved documentation and usage examples for multi-day reporting. \n- Removed sample card file (skill-card.md).","license":"MIT-0"},"metadata":null,"owner":{"handle":"ai-byte","userId":"s1744ghz9kh4r662gcd6anre0n83g896","displayName":"iyiou","image":"https://avatars.githubusercontent.com/u/66202593?v=4"},"moderation":null}