Daily Investment Digest
Overview
- - Pull investment/financing events from
https://api.iyiou.com/skill/info. - Normalize fields, deduplicate rows, and generate a structured Chinese daily report.
Workflow
- 1. One-command full report (recommended, default uses yesterday).
CODEBLOCK0
- 2. If user explicitly asks for today's report, pass today's date.
CODEBLOCK1
- 3. Direct output mode (stdout only, no file).
CODEBLOCK2
Path Safety
- - Always call scripts with quoted
{baseDir} paths to avoid whitespace-path issues. - Scripts resolve relative input paths against the skill root directory.
Required API Rules
- - Use
pageSize=10. - Start at
page=1. - Increment
page by 1 each request. - Stop when
page>5 or API event list is empty. - Parse response strictly by schema:
response.code -> response.data.posts. - Treat non-zero
code as API failure. - Retry failed requests up to 3 times before skipping a page.
Script Interfaces
scripts/run_full_report.mjs
- - One-command pipeline: fetch + generate
- Defaults to full output (
top-n=0) - Supports
--report-date, --max-page, --page-size, --timeout-seconds, --retry, INLINECODE16 - Supports
--top-n (0 means all events)
scripts/fetch_events.mjs
- -
--page-size default INLINECODE21 - INLINECODE22 default INLINECODE23
- INLINECODE24 default yesterday (
YYYY-MM-DD) - INLINECODE26 default INLINECODE27
- INLINECODE28 default INLINECODE29
- INLINECODE30 default INLINECODE31
- Always prints JSON to stdout (
--stdout-json kept only for compatibility) - Numeric args are bounded for safety:
page-size[1,100], max-page[1,500], INLINECODE35
scripts/generate_report.mjs
- -
--input-json required - INLINECODE38 default
0 (0 means all events) - Always prints report text to stdout (
--stdout kept only for compatibility) - Numeric args are bounded for safety: INLINECODE42
Output Files
- - Disabled by design. This skill is stdout-only and does not write report artifacts to disk.
Data Mapping
- - Follow field_mapping.md for source-to-target mapping and fallback rules.
- To reduce context size, the fetch output keeps only:
brief, createdAt, originalLink, postTitle, tags.
Failure Handling
- - Continue on single-page failure after retries.
- Use progressive retry backoff (
0.5s, 1.0s, 1.5s, ...). - Record page-level errors in output JSON
meta.errors. - Generate a report even when no events are found, and clearly mark it as an empty-day report.
Output Policy
- - Date policy: default to yesterday; only use today when the user explicitly asks for today.
- If user asks full detail, run with
--top-n 0. - Use script stdout as the main body and keep event entries unchanged.
- Output order is mandatory:
- 1. First output the full event list.
- Each event must include:
公司简称、轮次、投资方、事件摘要、来源链接. - After the full event list, append one ending section titled
投资事件总结.
- - Do not output
投资事件总结 before event entries.
Quick Checks
- 1. Run fetch step and confirm
meta.total_unique_events > 0 on active days. - Run report step and confirm stdout contains:
- - INLINECODE61
- INLINECODE62
- 3. In final AI response, confirm order:
- - Event list appears first and each item includes
公司简称、轮次、投资方、事件摘要、来源链接. - INLINECODE68 appears only after the event list.
- INLINECODE69 appears exactly once at the end.
- 4. In final AI response, confirm it appends:
Example End-to-End Command
CODEBLOCK3
每日投资摘要
概述
- - 从 https://api.iyiou.com/skill/info 拉取投融资事件。
- 标准化字段、去重行,并生成结构化的中文每日报告。
工作流程
- 1. 一键生成完整报告(推荐,默认使用昨天日期)。
bash
node {baseDir}/scripts/run
fullreport.mjs \
--max-page 5
- 2. 如果用户明确要求今日报告,传入今天日期。
bash
node {baseDir}/scripts/run
fullreport.mjs \
--report-date 2026-03-11 \
--max-page 5
- 3. 直接输出模式(仅标准输出,不生成文件)。
bash
node {baseDir}/scripts/fetch_events.mjs \
--report-date 2026-03-11 \
--stdout-json | \
node {baseDir}/scripts/generate_report.mjs \
--input-json - \
--top-n 0 \
--stdout
路径安全
- - 始终使用带引号的 {baseDir} 路径调用脚本,避免因路径含空格导致问题。
- 脚本会相对于技能根目录解析输入路径。
必需API规则
- - 使用 pageSize=10。
- 从 page=1 开始。
- 每次请求将 page 递增 1。
- 当 page>5 或API事件列表为空时停止。
- 严格按照模式解析响应:response.code -> response.data.posts。
- 将非零 code 视为API失败。
- 跳过某页前,最多重试失败请求3次。
脚本接口
scripts/runfullreport.mjs
- - 一键流水线:获取 + 生成
- 默认完整输出(top-n=0)
- 支持 --report-date、--max-page、--page-size、--timeout-seconds、--retry、--delay-seconds
- 支持 --top-n(0 表示所有事件)
scripts/fetch_events.mjs
- - --page-size 默认 10
- --max-page 默认 5
- --report-date 默认为昨天(YYYY-MM-DD)
- --timeout-seconds 默认 15
- --retry 默认 3
- --delay-seconds 默认 0
- 始终将JSON输出到标准输出(--stdout-json 仅为兼容保留)
- 数值参数有安全边界:page-size[1,100]、max-page[1,500]、retry[1,10]
scripts/generate_report.mjs
- - --input-json 为必需参数
- --top-n 默认 0(0 表示所有事件)
- 始终将报告文本输出到标准输出(--stdout 仅为兼容保留)
- 数值参数有安全边界:top-n[0,500]
输出文件
- - 默认不生成文件。本技能仅输出到标准输出,不将报告产物写入磁盘。
数据映射
- - 遵循 field_mapping.md 中的源到目标映射及回退规则。
- 为减少上下文大小,获取输出仅保留:brief、createdAt、originalLink、postTitle、tags。
失败处理
- - 单页失败重试后继续处理。
- 使用渐进式重试退避(0.5秒、1.0秒、1.5秒……)。
- 在输出JSON的 meta.errors 中记录页面级错误。
- 即使未找到事件也生成报告,并明确标记为空日报告。
输出策略
- - 日期策略:默认为昨天;仅当用户明确要求时才使用今天。
- 如果用户要求完整详情,使用 --top-n 0 运行。
- 使用脚本标准输出作为主体,保持事件条目不变。
- 输出顺序强制要求:
- 1. 首先输出完整事件列表。
- 每个事件必须包含:公司简称、轮次、投资方、事件摘要、来源链接。
- 完整事件列表后,附加一个以 投资事件总结 为标题的结尾部分。
快速检查
- 1. 运行获取步骤,确认活跃日 meta.totaluniqueevents > 0。
- 运行报告步骤,确认标准输出包含:
- 3. 在最终AI响应中,确认顺序:
- - 事件列表首先出现,每个条目包含 公司简称、轮次、投资方、事件摘要、来源链接。
- 投资事件总结 仅在事件列表之后出现。
- 投资事件总结 在末尾恰好出现一次。
- 4. 在最终AI响应中,确认附加了:
端到端命令示例
bash
node {baseDir}/scripts/runfullreport.mjs \
--report-date 2026-03-11 \
--max-page 5