skills/html-report-framework/SKILL.md
HTML 报告生成通用框架 - CSS 变量设计系统、专业组件库、ECharts 图表、Mermaid 流程图、动态居中布局、可折叠侧栏、规则驱动结论。当用户需要生成 HTML 报告、数据看板、SOP 文档、KPI dashboard 或任何自包含网页报告时使用。
npx skillsauth add OliverOuyang/shuhe-work-skills html-report-frameworkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
提供 HTML 报告生成的完整工具链和最佳实践。涵盖 CSS 变量设计系统、专业级组件库、ECharts 图表渲染、动态居中布局、可折叠侧栏导航、规则驱动结论生成和 Python f-string 模板。从月报 V04 项目和 SOP 文档中心项目提炼。
当用户需要创建或优化任何 HTML 格式的数据报告时激活,特别适用于:
生成 HTML 报告时,必须从 starter-template 复制,禁止从零手写:
Read 文件 resources/starter-template.html(本 skill 目录下)__PLACEHOLDER__ 并替换为实际内容golden-template.html 中的组件作为参考<script> 区域的 chartConfigs 中定义 ECharts 配置<!DOCTYPE html> 开始手写 CSS/JS:root CSS 变量(除非用户明确要求换主题)| 文件 | 用途 |
|------|------|
| resources/starter-template.html | 空白骨架 — 复制此文件开始新报告 |
| resources/golden-template.html | 完整示例 — 查看组件的实际使用方式 |
blockquote.conclusion 或 callout 解读数据含义。图表不能孤立存在。生成完成后,运行验证脚本:
python resources/validate_report.py output.html
必须全部 PASS 才能交付。验证项包括:
__PLACEHOLDER__ 残留details.chart-detail)Section 1(项目概述)的结构是强制的,所有报告必须包含:
Section 1: 项目概述 (Executive Summary)
├── 1.1 项目背景
│ ├── callout.info — 项目/周期/口径/范围/粒度/目标
│ ├── pre.mermaid — 分析框架流程图(主线 → 子维度 → 核心指标)
│ └── table — 核心问题列表(#/问题/对应结论/详细分析跳转)
├── 1.2 核心结论 — 每个 conclusion-item 带折叠支撑图表(details.chart-detail)
└── 1.3 下一步行动 — 紧急/重点/持续 三级优先级(callout.danger/warning/info)
callout.info):包含项目名称、分析周期、指标口径、数据范围、分析粒度、分析目标。字段用 <strong> 标签加粗标注。pre.mermaid):替代静态 def-card 卡片组。用 flowchart TD 展示分析主线分支、子维度节点、汇聚到核心指标。节点使用语义化配色(style 指令)。<table>):列 = # / 核心问题 / 对应结论 / 详细分析。"对应结论"列链接到 #sub-conclusions(有结论时用颜色区分严重程度),"详细分析"列链接到具体 section/subsection 的 id。无对应结论的问题用 — 占位。<details class="collapsible chart-detail"> 折叠图表chartConfigs 对象懒加载(toggle 时初始化 ECharts)success=绿色验证通过、warning=橙色需关注、danger=红色需行动设计原则:读者看完 Section 1 就能掌握全貌(做什么 → 什么结论 → 下一步)。Section 2+ 是对 Section 1 的展开和深入。
生成 HTML 应达到"专业内部产品文档"水准:
详细代码示例见 ARCHITECTURE.md。
| # | 问题 | 一行修复 |
|---|------|---------|
| 1 | 图表顶部被标题遮挡 | grid.top 从 20 改为 45 |
| 2 | 页面内容偏左不居中 | 改用 margin-left: max(260px, calc((100vw - 1200px) / 2)) |
| 3 | 微小值精度丢失(CVR 全显示 0.0) | 对极小值改用 to_js_array(series * 100, 4) |
| 4 | f-string 中 NameError | 所有变量在 f-string 之前预计算,不在 f-string 内调用函数 |
| 5 | 中文乱码(U+FFFD) | grep "?" file.py 逐一替换为正确中文 |
| 6 | KeyError: 'month' | 用 get_month_col(df) 兼容 month / date_month 两种字段名 |
| 7 | 折叠侧栏后图表不自适应 | toggleSidebar() 末尾加 setTimeout(() => window.dispatchEvent(new Event('resize')), 350) |
| 8 | 图表与结论精度矛盾 | 统一所有百分比/比率数据输出为 2 位小数 |
| 9 | JS 选择器与 HTML class 不匹配 | HTML class 重命名时全局搜索 JS/CSS 同步更新 |
| 10 | 死代码 — JS 引用不存在的 DOM | HTML 结构变更后 grep 清理所有孤立 getElementById 引用 |
| 11 | Mermaid 图表不渲染 | 确认 CDN mermaid@10、startOnLoad: true、检查语法缩进 |
| 12 | Mermaid 主题与页面风格不一致 | 用 theme: 'base' + 自定义 themeVariables 匹配 CSS :root 变量 |
完整参考模板见 resources/golden-template.html,包含所有组件的实际使用示例:
/monthly-report-html-generator - 月报 HTML 专用生成器/dp-explorer - Dataphin 数据探索/document-skills:xlsx - Excel 数据处理/document-skills:frontend-design - 前端设计优化encoding="utf-8" 写入,避免 GBK 终端乱码ARCHITECTURE.mdtools
SQL 分段验证、自我修复、结果导出与智能分析。流程:解析SQL → Dataphin MCP 验证元数据 → 自动修复 → 分段执行验证 → 导出 CSV → 智能分析(漏斗解读、异常识别、预判用户问题)。适用场景:"跑一下这个SQL"、"验证这个查询"、"帮我执行并导出"、"分析一下结果"等。
testing
Security-first vetting for OpenClaw skills. Use before installing any skill from ClawHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.
development
A universal self-improving agent that learns from ALL skill experiences. Uses multi-memory architecture (semantic + episodic + working) to continuously evolve the codebase. Auto-triggers on skill completion/error with hooks-based self-correction.
data-ai
Standardize Jupyter notebooks (.ipynb) for interactive data analysis workflows. Enforces a mandatory cell manifest (M1-M8 + archetype chapters) with tags ([CONFIG]/[SETUP]/[FUNC]/[RUN]/[VIZ]/[EXPORT]), structured markdown sections, and output prefixes ([OK]/[WARN]/[SKIP]). Use when the user wants to standardize, clean up, or create a notebook from scratch. Two archetypes: problem-driven (question-answer analysis) and monitoring (dimension-based periodic reporting).