finance-report
Masthead + KPIs + Revenue/Burn Charts + P&L Table + Highlights + Outlook
1How It Works & Mechanism
This skill is not an executable program, but a prompt injected into the local coding-agent CLI: the host takes the SKILL.md body, prepends a global shared design instruction, appends user content, and combines them into a single prompt sent to the authenticated agent, capturing the agent's stdout as HTML.
【输入格式】: ${opts.format} 【用户内容】: ${opts.content}
The shared instruction layer (which does not belong to any single skill, but governs every template) mandates that the output must be a 'self-contained single-file HTML' and strictly forbids the agent from using file system tools like Write/Edit/Bash; the HTML is streamed directly as the conversation body.
- **禁止使用 Write / Edit / MultiEdit / Bash / Create / 任何文件系统工具**。不要把 HTML 写到任何 \`.html\` 文件里。前端直接捕获你的 stdout 文本, 文件落盘由前端负责。
Outside SKILL.md, there is also a 'content-driven quantity' override rule: any page, frame, or card count written in the template is treated as a reference minimum, with the actual quantity determined by user content—preventing the agent from compressing user content to match template numbers.
- 模板只定义"可用版面 / 风格 / 配色 / 字体 / 组件库", **不定义** slide / 帧 / 卡片 / section 的数量。
The loading convention is 'one skill = one directory': SKILL.md (YAML frontmatter for the selector + body as the template prompt), with optional example.md (sample input) and example.html (ready-to-open preview sample); adding a new template only requires adding a directory without modifying TS code.
* SKILL.md — frontmatter (id, scenario, tags, …) + prompt body * example.md — (optional) sample input content * example.html — (optional) pre-rendered preview, shown inline in the picker
The selection pipeline (CLI side) is a three-stage funnel: strong keyword signal (2 points per matched word, threshold of 3) → fallback to tags/scenario scoring → if still uncertain, sending the first 800 characters of user content to the local agent for a one-sentence classification.
const CONFIDENCE_THRESHOLD = 3;
The preview pipeline is independent of generation: /api/templates/<id>/preview returns example.html verbatim as text/html to an iframe; the frontend iframe uses sandbox="allow-scripts allow-same-origin".
sandbox="allow-scripts allow-same-origin"
The template is a pure skeleton (22 lines in total): it organizes financial materials into a single-page report using 6 fixed layout sections—Masthead + 4 hero KPIs, two charts for revenue and burn, a P&L summary table, 5 top-line highlights, an Outlook paragraph, and a collapsible Methodology section.
【布局】 - Masthead (公司 + Q + 报告标题) + 4 个 hero KPI - Revenue chart + Burn chart (Chart.js / ECharts) - P&L 概要表 (zebra + sticky header) - Top-line highlights (5 条 bullet) - Outlook 段落 - Methodology 折叠区
The intent is compressed into one sentence: a financial one-page report featuring numbers + charts + written insights—demanding both quantitative layout and narrative interpretation rather than a plain table.
【意图】财务向单页报告, 数字 + 图表 + 文字洞察。
Layout details provide concrete implementation specifications: the P&L table requires zebra striping + sticky headers (ensuring long tables remain scrollable and readable).
- P&L 概要表 (zebra + sticky header)
The above-the-fold KPI count is strictly fixed at 4 hero KPIs, co-located with the Masthead (Company + Quarter + Report Title), ensuring that opening it immediately answers 'which company, which quarter, and the four key metrics'.
- Masthead (公司 + Q + 报告标题) + 4 个 hero KPI
This skill does not have an example.md, and the preview sample example.html is entirely self-contained: no external URLs, no <script>, charts are hand-drawn using CSS/SVG, and typography relies on local serif font stacks.
--display: 'Iowan Old Style', 'Charter', 'Iowan', Georgia, serif;
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| network | Tailwind 与 Google Fonts 由共享指令层强制(本模板 SKILL.md 未提任何 CDN;官方示例页零外链) |
| package | Chart.js / ECharts(SKILL.md 指定的图表方案;示例页未使用,改为手写 SVG/CSS) |
4Recommended Governance & Evidence
- SKILL.md: Pure prompt instructions and rule text, without script execution or external impact
5Second-Pass Verification
- [ok] 『6 段版面』宣称 — 重读 SKILL.md【布局】6 条与 JSON 引用逐字一致,无遗漏无夸大。
- [discrepancy] 图表库条目(Chart.js / ECharts) — SKILL.md 写 `Revenue chart + Burn chart (Chart.js / ECharts)`,但 example.html 无任何 <script>、无 CDN 引用,图表为 CSS/SVG 手绘——规范建议与示例实现不一致,已写入 risks。
- [ok] 『示例页零外链』结论 — 对 example.html 做 URL 正则扫描零命中、<script> 计数为 0,坐实自包含。
- [ok] 运行时机制 — 重读 loader.ts loadSkillFromDir / shared.ts assemblePrompt,与第一遍结论一致。
- [ok] 安全面 — skill 目录 2 个文件均无脚本/凭证/写盘/网络调用 token。
- [ok] meta 元数据 — GitHub API 实查:stars=8827、pushed_at=2026-09-15T03:36:24Z、license Apache-2.0。
- [unlocatable] 安装量 — 无公开安装量数据源,installs=null。
6Verdict & Scenarios
3d200da22fb65eba…