Skip to content

zach22-1999/generic-skills / skills/zach-md-html

zach-md-html

Verified

已降级的 Markdown→HTML 兼容转换器。仅当用户明确要求“使用 zach-md-html”、或明确说“不要重组内容,只把现成 Markdown 机械转换成 HTML/套用旧主题”时使用。不要因为用户只说“输出成 HTML”“生成 HTML 报告”“把日常报告做成 HTML”“数据报告/交付报告”而触发;这些任务应由模型从原始资料直接组织并生成自包含 HTML。此 Skill 不负责数据可视化、工作面、自由设计、万物转 md、html 转 md 或 md 转 docx。

references/js-interaction-allowlist.md

View on GitHub
# JS 交互白名单

> zach-md-html 的工作面档(Tier B)和自由设计师档(Tier C)允许使用的 JS 范围,以及明确禁止的范围。
> 目的:让交互"恰好够用",不引入不稳定性、网络依赖、复杂度爆炸。

---

## ✅ 允许的交互模式

### 1. `<details>` 折叠展开

```html
<details>
  <summary>点击展开日志摘要</summary>
  <pre>[14:02] INFO ...
[14:03] WARN ...</pre>
</details>
```

**纯 HTML,无 JS**。所有 incident-timeline / annotated-pr / status-weekly 的折叠都用这个。

---

### 2. Tab 切换(pure CSS 或 < 20 行 vanilla JS)

**纯 CSS 方案**(radio + label 技巧):

```html
<input type="radio" id="tab1" name="tabs" checked>
<input type="radio" id="tab2" name="tabs">
<label for="tab1">Python</label>
<label for="tab2">JavaScript</label>
<div class="tab-content">...</div>
```

**vanilla JS 方案**(无依赖,< 20 行):

```html
<script>
document.querySelectorAll('[data-tab]').forEach(btn => {
  btn.addEventListener('click', () => {
    const target = btn.dataset.tab;
    document.querySelectorAll('.tab-pane').forEach(p => p.hidden = p.dataset.pane !== target);
    document.querySelectorAll('[data-tab]').forEach(b => b.classList.toggle('active', b === btn));
  });
});
</script>
```

适合 feature-explainer 的多语言代码示例切换。

---

### 3. 简单 slider 调参(CSS 变量驱动)

```html
<input type="range" min="0" max="100" oninput="document.documentElement.style.setProperty('--demo', this.value)">
<div style="transform: scale(calc(var(--demo, 50) / 50))">target</div>
```

适合 concept-interactive 演示 easing / 比例 / 阈值等。

---

### 4. Copy-to-clipboard 按钮

```html
<button onclick="navigator.clipboard.writeText(this.previousElementSibling.textContent)">
  复制
</button>
```

**所有 workspace 和 free-design 产物的「复制为 markdown」按钮必须实现这个**。原生 API,无依赖。

---

### 5. 本地筛选 / 排序(无网络)

```html
<input placeholder="筛选" oninput="
  document.querySelectorAll('.row').forEach(r => {
    r.hidden = !r.textContent.toLowerCase().includes(this.value.toLowerCase());
  })
">
<table>...</table>
```

适合 triage-board / module-map 等列表型场景。

---

## ❌ 禁止的范围

### 禁止外部 CDN / 网络请求

- ❌ `<script src="https://cdn.tailwindcss.com">`
- ❌ `<script src="https://unpkg.com/react">`
- ❌ `<link rel="stylesheet" href="https://fonts.googleapis.com/...">`
- ❌ `fetch()` / `XMLHttpRequest` / `WebSocket`

**例外**:KaTeX 数学公式(已经在 default tier 通过 `--katex` 支持),需要用户显式开启。除此之外 zero network。

理由:HTML 必须**离线可用、可邮件发送、可作为附件**。

---

### 禁止框架

- ❌ React / Vue / Svelte / Solid
- ❌ jQuery(即使古老也不要)
- ❌ Alpine.js / Petite-vue(看似轻量,但每个 HTML 都引入依赖管理复杂度)

**例外**:仅 free-design 档在用户**明确要求** "做成 React 风" 时可以考虑用 web-artifacts-builder skill 而不是 zach-md-html。zach-md-html 的边界是单文件、无构建、无依赖。

---

### 禁止 JS 执行模式

- ❌ `eval()` / `Function()` 动态执行
- ❌ `innerHTML = userInput` 注入
- ❌ 任何 server-side 或后端调用
- ❌ Service Worker / IndexedDB / LocalStorage(除非内容性质明确要求且用户授权)

---

### 禁止视觉模式(继承自 anti-ai-slop.md)

- ❌ 紫渐变 / 赛博霓虹
- ❌ #0D1117 深蓝底
- ❌ emoji 作正式图标
- ❌ 圆角卡片 + 左 border accent(烂大街组合)

详见 `anti-ai-slop.md`。

---

## 决策树

```
要做交互?
  ├─ 折叠 / 展开 → <details>,0 JS
  ├─ tab 切换 → CSS radio 或 < 20 行 vanilla JS
  ├─ slider 调参 → <input type=range> + CSS 变量
  ├─ 复制内容 → navigator.clipboard.writeText
  ├─ 本地筛选 → 单行 oninput,无依赖
  ├─ 拖拽排序 → 暂不支持(Phase 2 triage-board 会引入受限实现)
  ├─ 网络请求 → 用错 skill,请走 web-artifacts-builder
  └─ React 组件 → 用错 skill,请走 web-artifacts-builder
```

---

## JS 代码量上限

每个 workspace / free-design HTML 的 `<script>` 总量**不超过 80 行**(不含模板字符串和注释)。超过这个量说明在做错的事——要么场景过于复杂应该拆,要么应该换 web-artifacts-builder。

---

## 一句话总结

**HTML 是工作面,不是 SPA。**
你需要的交互,原生 API 都能搞定。引入框架等于引入不稳定性。
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall