design-system
它能做什么
这个技能为 Markdown 转 HTML 工具运行一个简短的品牌设置流程。适合希望转换后的文档与其品牌保持一致的人。
适用场景
- ✓当你第一次把 Markdown 文件转换为 HTML,并希望它采用你的品牌风格时。
- ✓当你想更改品牌颜色、字体或风格设置时。
- ✓当你想为某个代码仓库设置仅限该项目的品牌覆盖时。
技能链接
https://github.com/alirezarezvani/claude-skills/blob/main/markdown-html/skills/design-system/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请设置我的品牌颜色和字体,让我转换后的文档符合公司风格。”
每周 5 个新技能,1 分钟读完。
工作原理
它会就颜色、字体、风格和目录提出一组简短问题,检查调色板的文字对比度是否清晰可读,然后把设置保存下来,供转换工具使用。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Design System — Onboarding + Shared Brand Tokens
The design-system skill is the shared brand owner for the markdown-html plugin. Run its onboarding once. Every converter (md-document, md-review, md-slides) reads the resulting config via config_loader.py and applies the same 12 CSS custom properties to its output. Without this, conversions render with placeholder defaults — technically functional but unbranded.
This skill ships exactly three Python tools:
onboard.py— interactive (or--defaults/--set/--show/--reset) wizard.config_loader.py— importable customization loader with project > global > defaults precedence andMARKDOWN_HTML_NO_CONFIG=1bypass.brand_palette_validator.py— WCAG-AA contrast checker + HSL palette deriver.
All three are stdlib-only and contain no LLM calls (deterministic per Path-B discipline).
When to invoke
| Symptom | Action |
|---|---|
| User says "convert this markdown to HTML" for the first time in this workspace | Run python3 markdown-html/skills/design-system/scripts/onboard.py |
~/.config/markdown-html/design-system.json doesn't exist OR setup_completed_at is null |
Refuse conversion, surface onboarding |
| User wants per-repo brand override | python3 .../onboard.py --scope project |
| User wants to change a single field non-interactively | python3 .../onboard.py --set brand.primary=#FF6B35 |
| User wants to reset and re-onboard | python3 .../onboard.py --reset then re-run |
| User wants zero-touch defaults (CI, ephemeral session) | python3 .../onboard.py --defaults |
| Headless / containerized run that should ignore saved config | MARKDOWN_HTML_NO_CONFIG=1 ... |
Onboarding question set (10 questions)
| # | Key | Choices / Validator | Default |
|---|---|---|---|
| 1 | default_output_dir |
path; os.access(parent, os.W_OK) |
./markdown-html-out/ |
| 2 | brand.primary |
HEX ^#?[0-9a-fA-F]{6}$ |
#0A1628 |
| 3 | brand.accent |
HEX or blank (auto-derive) | derive from primary |
| 4 | typography.heading_font |
Google Font name (12 safe defaults) | Inter |
| 5 | typography.body_font |
Google Font name | Inter |
| 6 | design_style |
editorial / technical / minimal / playful |
technical |
| 7 | code_theme |
light / dark / auto |
auto |
| 8 | toc.behavior |
sticky-sidebar / collapsible-top / inline / none |
sticky-sidebar |
| 9 | company_name |
string (may be empty) | "" |
| 10 | logo_url |
URL or empty (base64-embedded at render) | "" |
Hard rules
- WCAG AA body-text contrast must pass.
brand_palette_validator.validate()runs after every change. Body text on bg must reach 4.5:1; link on bg must reach 4.5:1. If either fails,onboard.pyrefuses to save (exit code 4) and tells the user to pick a darker primary, blankbrand.bg/brand.textto let derivation pick a safe pair, or overridebrand.textdirectly. Canon: WCAG 2.2 §1.4.3. - Output directory must be writable.
onboard.pywalks up the path to find an existing ancestor and checksos.W_OK. Empty or unwritable path → exit code 3. The orchestrator'soutput_path_resolver.pyhonors the same rule per-conversion. - Customization must change behavior, not sit as decoration. Every consumer (md-document, md-review, md-slides) must read the config and render differently when the user changes
design_style,brand.primary,code_theme, ortoc.behavior. Decorative-only fields fail the design discipline. - Precedence is fixed. Project > global > defaults. The deep-merge preserves nested keys (e.g. you can override
brand.primaryin a project config without losingtypography.heading_fontfrom global). - Bypass env exists for a reason.
MARKDOWN_HTML_NO_CONFIG=1is for headless CI, ephemeral test containers, and the autoresearch-style evaluator loops. Never set it silently for an interactive user.
Derived 12-token palette
Once the user's brand is captured, brand_palette_validator.derive_palette() produces 12 CSS custom properties stored under derived_palette in the same config file. Every converter inlines these into its <style> block.
| Token | Purpose | Derivation |
|---|---|---|
--md-bg |
Document background | Primary if dark, near-neutral if vibrant |
--md-surface |
Card / callout / blockquote background | Bg ± 4-6% luminance |
--md-border |
Hairline dividers, table borders | Bg ± 8-12% luminance |
--md-text |
Body text | Off-white on dark bg |
常见问题
它会拒绝对比度低的颜色吗?
会。它会拒绝未通过 WCAG AA 对比度标准的调色板。
我可以不回答每个问题就完成设置吗?
可以。设置工具提供了使用默认值的选项,也可以一次只修改一个字段。
设置保存在哪里?
它们保存在全局配置文件中;如果你选择项目级设置,则保存在项目文件夹中。
详情
作者的原始描述
Use when setting up brand settings before the first markdown-to-HTML conversion, or changing them. Runs a 10-question onboarding with onboard.py (colors, fonts, style, TOC) and refuses palettes that fail WCAG AA via brand_palette_validator.py.
热度
- GitHub 星标
- 29k
- 排名
- #9625
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-launcher-orchestrator
29k帮你的智能体从一个清晰的目标出发,逐步规划、构建、测试并定时运行你自己账户中的 Claude 托管智能体。
grade-iterate
29k让你的智能体按评分标准为托管 AI 智能体的工作打分,并在固定的轮次内改进,因此它永远不会无限循环。
interview
29k让你的智能体就一个 AI 智能体的想法对你进行访谈,并在任何上线之前,把你的回答整理成一份简单的构建计划。
run-without-you
29k帮你的智能体设置托管 AI 智能体,使其按计划或在某个事件发生时运行,并在启动前检查定时设置。