AGENT SKILL

Markdown 审查报告转 HTML

md-review

将 markdown PR 撰写文档或代码审查(带有 ```diff 围栏代码块和严重性标记的 > [!BLOCKER]/[!MAJOR]/[!MINOR]/[!NIT] 标注)转换为单文件 2 列 HTML 审查文档——左侧为统一 diff,右侧为带严重性标记的注释卡片,顶部为列出所有发现的跳转导航,并强制要求具名审查者页脚。当 markdown-html-orchestrator 将输入分类为 REVIEW,或通过 /cs:md-review 直接调用时触发。若未提供显式 --reviewer 则拒绝(代码审查必须指明真人),若没有 diff 区块则拒绝(改为转至 md-document),并拒绝仅用颜色编码严重性(每个徽章须同时包含颜色+图标+aria-label,符合 WCAG 1.4.1)。在 orchestrator 路由之后使用。

License 许可
MIT
最近更新
2026-10-28
Stars
★ 0
Forks
0

01 前言 Front Matter

name
md-review
tags
[ "markdown", "html", "code-review", "diff", "severity", "annotations", "single-file", "design-system", "wcag-1.4.1" ]
author
Alireza Rezvani
license
MIT
version
2.10.2
description
Converts a markdown PR writeup or code review (one with ```diff fenced blocks and severity-tagged > [!BLOCKER]/[!MAJOR]/[!MINOR]/[!NIT] callouts) into a single-file 2-column HTML review — unified-diff on the left, severity-tagged annotation cards on the right, top jump-nav listing every finding, mandatory named reviewer footer. Triggers when the markdown-html-orchestrator classifies an input as REVIEW, or when invoked directly via /cs:md-review. Refuses without explicit --reviewer (a code review must name a human), refuses if no diff hunks present (route to md-document instead), and refuses to encode severity in color only (every badge ships color + icon + aria-label per WCAG 1.4.1). Use after orchestrator routing.
compatible_tools
[ "claude-code", "codex-cli", "cursor", "antigravity", "opencode", "gemini-cli" ]

02 资源文件 7

03 SKILL.md 正文

md-review — Code-review markdown → 2-column HTML

The code-review converter from Tier 2 of Shihipar's essay ("Code Review and PR Writeups"). Takes a markdown PR writeup with diff blocks + severity callouts and produces a single-file HTML review with a jump-nav, 2-column diff + annotation layout, and a named reviewer footer.

Three stdlib tools pipeline together:

diff_parser.py  →  annotation_extractor.py  →  review_html_renderer.py
   (md → diff hunks)   (md → severity-tagged    (hunks + annotations
                        annotations attached     + tokens → 2-col HTML)
                        to nearest hunk)

When to invoke

Symptom Action
markdown-html-orchestrator routes input as REVIEW Invoke this skill
User runs /cs:md-review <path>.md directly Invoke this skill
Input contains ```diff fenced blocks + > [!MAJOR]/> [!BLOCKER]/etc. callouts Invoke this skill
Input is a long-form spec / report (no diff blocks) Route to md-document instead
Input is a slide deck Route to md-slides instead
Input < 100 lines Refuse (Shihipar threshold)
Design-system not onboarded Refuse; surface /cs:design-system

Pipeline

# 1. Parse markdown → diff hunks JSON
python3 markdown-html/skills/md-review/scripts/diff_parser.py \
    --input <path>.md --output hunks.json

# 2. Extract severity-tagged annotations, attach to nearest preceding hunk
python3 markdown-html/skills/md-review/scripts/annotation_extractor.py \
    --input <path>.md --diff-blocks hunks.json --output annotations.json

# 3. Render 2-col HTML (--reviewer is mandatory — refuses without)
python3 markdown-html/skills/md-review/scripts/review_html_renderer.py \
    --diff-blocks hunks.json --annotations annotations.json \
    --reviewer "Jane Doe" --title "PR #123: Add retry logic" \
    --output review.html

What gets rendered

  • Top jump-nav — every annotation with severity badge + 80-char preview + jump link; severity counts in the heading ("3 BLOCKER · 2 MAJOR · 1 NIT")
  • 2-column hunk rows — unified diff on the left (per-line old/new line numbers, +/− marks, addition/deletion background tint from design-system tokens), annotation cards on the right (color + icon + aria-label per WCAG 1.4.1)
  • Approval bar — if LGTM markers are present and no severity annotations, a success-tinted "LGTM — no findings flagged" bar
  • General comments — annotations not attached to any hunk render at the bottom in their own section
  • Reviewer footer — mandatory; refuses to render without --reviewer
  • Responsive — 2-col collapses to stacked on viewports < 900px

Hard rules

  1. --reviewer is mandatory. A code review must name a human reviewer. Refuses with exit 3 otherwise. Mirrors research-ops's "named owner" discipline.
  2. Refuses if no hunks present. No --- a/file + @@ ... @@ blocks means this isn't a code review — refuses with exit 4 and recommends md-document.
  3. Refuses input < 100 lines. Markdown wins below the threshold (Shihipar).
  4. Refuses without onboarding. Same gate as every converter.
  5. Severity is never color-only. Each badge ships color + icon + aria-label + text. WCAG 1.4.1 enforced at the renderer level.
  6. Single-file output. All CSS inline. Only external is Google Fonts CSS. No Prism in md-review (diff coloring conflicts with syntax highlighting).
  7. Custom severity convention. --severity-convention "critical,important,suggestion,nit" swaps tier names; position 0 is most severe. Default is BLOCKER / MAJOR / MINOR / NIT (Google Code Review Developer Guide).

Forcing-question library (Matt Pocock grill discipline)

  1. Who is the named reviewer? Recommended: the user signing off on the review. Canon: research-ops named-owner pattern; SWE at Google ch. 9.
  2. Which severity convention applies — default (BLOCKER/MAJOR/MINOR/NIT) or custom? Recommended: default unless your team has a documented alternative. Canon: Google Code Review Developer Guide.
  3. Are annotations anchored to specific hunks, or are some general? Recommended: anchor everything you can; general goes to the unanchored section. Canon: SWE at Google ch. 9 — "Comments must reference a specific line".
  4. What's the PR title for the <title> and header? Recommended: the actual PR / commit title. Canon: docs-as-context-for-readers.
  5. Should LGTM markers ship as the approval bar? Recommended: yes if there are no severity annotations; otherwise the findings take precedence.

Distinct from

  • md-document — that converter renders prose + tables + code + callouts. This one renders diff hunks + margin annotations.
  • md-slides — that converter splits on --- boundaries. This one is a single-page artifact.
  • GitHub PR comments — those are a thread. This is a single-author snapshot artifact.

Output artifact

{default_output_dir}/review-{slug}.html (path resolved by orchestrator's output_path_resolver.py; collision suffix -2, -3, … by default).

References

  • Shihipar — Claude Code HTML output (Medium, 2026), Tier 2 use case
  • Software Engineering at Google (Manshreck & Wright, O'Reilly 2020), ch. 9 "Code Review"
  • Google Code Review Developer Guide — severity convention source
  • WCAG 2.2 §1.4.1 — color-not-sole-signal enforcement
  • See references/ for full citations (diff_rendering_canon, severity_coding, pr_annotation_ux)

04 同仓库更多 Skills

mne20114-hash
mne20114-hash/gest35bi

课程大纲阅读清单生成

syllabus

使用 Consensus 学术搜索从任意课程大纲生成精选的补充阅读清单。在任何搜索运行之前,进行'拷问式'信息收集(syllabus 输入格式 + 课程受众 + 年份范围)以及分组强制选项检查点——以确保阅读清单匹配课程的层次和时效性需求。解析大纲以提取主题和学习成果,针对每个主题在 Consensus 中搜索近期同行评审论文,并生成专业排版的 .docx 文档,包含可点击的 Consensus 链接、按受众层次校准的通俗语言摘要,以及与课程学习目标关联的布鲁姆(Bloom)高阶层次讨论问题。当用户上传课程大纲、课程概要或课程文档并希望获得补充阅读材料时使用(例如'create a reading list from this syllabus'、'find recent papers for my course')——即使是附带大纲的随意提及也应触发此技能。

教师学习引导
★ 0
mne20114-hash
mne20114-hash/gest35bi

话题动态多源调研

pulse

多源近期研究技能,可在可配置的近期时间窗口(默认 30 天)内,跨 Reddit、Hacker News、开放网络以及可选的 X/Twitter 把握任意话题的动态。强制信息收集(intake)会在搜索前明确话题的具体性、角度(趋势/情绪/问题/机会/对比)、时间窗口和平台范围。返回一份综合简报,包含引用来源、互动指标和跨平台模式分析。当用户请求对某话题进行多源近期情报调研时使用(例如'pulse on [topic]'、'what's happening with [topic]'、'what are people saying about [topic]'、'current conversation about [topic]'、'take the pulse of [topic]'、'trending: [topic]'、'find me info on [topic]'),也适用于竞品研究、趋势发现、工具对比和受众情绪分析。

营销专员网页搜索与信息研究
★ 0
mne20114-hash
mne20114-hash/gest35bi

专利现有技术检索分析

patent

专利现有技术检索与专利景观情报技能——并非通用专利助手。在任何检索运行之前,通过强制问询确定五种子用例之一(新颖性检索 / 自由实施 FTO / 竞争景观 / 收购尽调 / 诉讼现有技术)。检索 Google Patents、Espacenet、USPTO,并可选检索 Lens.org 以获取引文图谱信号。输出为可编辑的 Word 文档(.docx),包含结论、按相关度排序的最接近现有技术(附提取的权利要求文本)、考虑 CPC 分类的景观分析、经家族解析的命中结果、地域覆盖、适用时的 FTO 标记、策略建议以及完整审计日志。当用户要求进行专利检索或分析时使用(例如“针对 [invention] 的现有技术检索”“针对 [product] 的自由实施分析”)。产出的是检索信号而非法律建议——在提交申请或许可决策前始终建议咨询专利律师。商标、版权和商业秘密问题不在范围内。

法务专员网页搜索与信息研究
★ 0
mne20114-hash
mne20114-hash/gest35bi

NotebookLM 笔记本自动化管理

notebooklm

用于控制 Google NotebookLM 的浏览器自动化技能。当用户希望在 NotebookLM 中完成任何操作时使用(例如“打开 NotebookLM”“查看我的 [name] 笔记本”“向我的笔记本询问 X”“将 [source] 添加到 NotebookLM”“从我的笔记本生成视频概览”“使用 NotebookLM Studio”)。可处理读取与查询笔记本、添加来源(URL、文本、文件、YouTube 链接、合成内容)、生成 Studio 输出(音频/视频概览、思维导图、报告,包括简报文档/学习指南/FAQ、抽认卡、测验、幻灯片、信息图——需从实时 Studio 面板发现确切的输出集合;其 UI 迭代很快),以及创建新笔记本。需要浏览器自动化环境——不可用时优雅降级。

知识工作者浏览器自动化与网页交互
★ 0
mne20114-hash
mne20114-hash/gest35bi

学术文献综述指南

litreview

学术文献导向技能,默认通过免费、无需密钥的API(PubMed E-utilities + OpenAlex)检索论文——连接后可将Consensus MCP作为可选的增强通道——使用PICO(默认)或SPIDER / Decomposition / hybrid作为后备来构建战略检索计划,并将发现综合成格式化的Word(.docx)研究指南。在侦察性检索(recon search)前进行Grill-me式信息收集(研究问题的具体程度+框架提示+初步深度);在Phase 2之后设置第二个强制检查点,先确认框架+子领域+深度,再让检索消耗预算。可配置的深度(5/10/20次查询)用于控制覆盖面与速度。输出是一个'起点'(launching pad)——让研究者能自信地深入展开的方向性指南,而非已完成的综述。当用户开始文献导向的研究时使用(例如'litreview on [topic]'、'literature review on [topic]'、'I'm starting a literature review on X'、'I'm writing a paper on X'、'help me research X'、'I'm doing research on X'、'can you help me research X')。不要用于只想快速获得列表的单个一次性论文检索——那属于普通的PubMed/OpenAlex(或Consensus)查询。

学术研究员科研论文写作
★ 0
mne20114-hash
mne20114-hash/gest35bi

NIH科研基金申请

grants

面向临床研究人员的NIH科研基金申请技能。Grill-me式信息收集(研究想法+职业阶段+初步数据+研究环境+提交姿态+已知的目标研究所)会在任何检索开始前锁定资助策略。运行5个维度的Consensus定位分析(含起草的Significance/Innovation措辞),通过RePORTER将研究映射到合适的NIH研究所(institutes)与研究部门(study sections),查找NOSIs及已获资助的重叠项目,并生成可编辑的Word文档(.docx),包含考虑预算与范围的机制推荐、提交时间线以及必须给出的项目官员(program officer)推荐。当用户询问研究资助或提出任何与基金申请相关的请求时使用(例如'[某主题]的基金'、'为我的研究想法找基金'、'哪些基金与我的研究匹配'、'帮我找NIH资助'、'我研究的基金机会')。仅限NIH范围——非NIH资助方(PCORI、DOD CDMRP、VA、基金会)不在范围内,并会在信息收集(intake)时予以提示。

生物医学研究员科研基金申请撰写
★ 0