Preview Md logo

Preview Md

Community
312362115
preview-md

MD 文件浏览器预览:GitHub 风格渲染 + 左侧自动目录。 在完成方案设计(specs)或开发计划(plans)的 MD 文件后触发。 询问用户是否要在浏览器中打开预览,确认后执行。 触发词:方案写完、计划写完、review MD、预览文档。 工作流位置:task-start 方案产出后 / 任意 MD 文档完成后

Overview

Publisher312362115
Repositoryclaude
Skill namepreview-md
Stars
107
Forks
17
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by 312362115 on GitHub. Read the source before you install it.

Installation

Install the Preview Md AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/312362115/claude/tree/main/skills/preview-md
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/312362115/claude.git /tmp/claude
mkdir -p .claude/skills
cp -r /tmp/claude/skills/preview-md .claude/skills/preview-md
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Preview Md in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Preview Md on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Preview Md is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

MD 文件浏览器预览

写完方案/计划等需要 review 的 MD 文件后,用浏览器打开 GitHub 风格预览。


触发条件

当你(Claude)完成以下类型的 MD 文件创建或大幅修改时,必须触发此 skill:

  1. 方案设计文档(docs/specs/**/*.md)
  2. 开发计划文档(docs/plans/**/*.md)
  3. 用户明确要求预览的任何 MD 文件

不可跳过原则:满足上述触发条件时,必须执行 Step 1 询问用户是否预览。Claude 不得以任何理由(如"纯后端文档"、"内容简单"、"不涉及 UI"等)自行判断跳过。是否预览由用户决定,不由 Claude 决定。

不触发 的场景:

  • 非 .md 文件:HTML、JSON、YAML 等其他格式文件不走此 skill(HTML 原型直接用 open 命令打开)
  • memory 文件、CLAUDE.md、README.md 等非 review 类文件
  • 对 MD 文件的小幅修改(如修错别字、更新状态标记)

执行流程

Step 1: 询问用户

MD 文件写完后,向用户提问:

文件已创建:<文件路径>
要在浏览器中打开预览吗?

Step 2: 用户确认后打开预览

用户确认后,执行:

bash
node ~/.claude/skills/preview-md/scripts/preview-md.mjs <md-file-absolute-path>

Step 3: 等待反馈

预览打开后,等待用户 review 反馈,根据反馈修改文档内容。


注意事项

  • 脚本位置在 ~/.claude/skills/preview-md/scripts/preview-md.mjs
  • 脚本会生成临时 HTML 文件并用默认浏览器打开
  • 渲染特性:GitHub Markdown CSS + 左侧固定目录(h1-h4)+ 滚动高亮 + 平滑跳转

扩展语法:terminal / flow 代码块

preview-md 在标准 Markdown 之上提供两种轻量图示代码块,专为"不想调 diagram skill 但又想比纯文字更有画面感"的场景设计。生产端(writing / deep-research 等)应按本节约定输出。

```terminal — 终端窗口

展示命令行操作、CLI 输出、安装/启动步骤时使用。渲染为 macOS 风格的终端窗口(红黄绿圆点 + 标题栏)。

何时用:

  • 展示一段命令执行(单条或多条)
  • 展示命令的输出示例
  • 开发指南/快速开始中的 setup 步骤

何时别用:

  • 单条命令且没有特殊格式 → 用普通 ```bash 即可
  • 纯代码片段(非 shell 语境)→ 用对应语言的代码块

语法:首行可选 $ title 作为窗口标题,其余为内容。

markdown
```terminal
$ 快速开始
npm install
npm run dev
# 服务启动在 http://localhost:3000
```

```flow — 轻量流程图

展示流程、决策树、步骤串联时使用。比调 diagram skill 更快、更贴近正文,适合简单到中等复杂度的线性/分叉流程。

何时用:

  • 方案中的"执行步骤"示意
  • 决策树(含 ?/? 的节点自动高亮为决策样式)
  • 工作流阶段串联

何时别用:

  • 复杂的多分叉合流、有向图 → 调 diagram skill 画真正的流程图
  • 时序交互(多角色)→ 调 diagram skill 画时序图

语法:

形态写法渲染
竖向主干每行一个节点,↓ 单独一行作为连接符主干 pill 居中列,↓ 对齐主干
横向流一行内用 → 分隔多个节点平铺横向 pill 链
横竖混合主干竖向,某一行内嵌 → 分支主干走中间列,分支向右延伸
决策节点节点文本含 ? 或 ?黄底带边框 pill
注释节点后追加 (xxx)灰色注释文字挂在节点右侧

示例:

markdown
```flow
task-manager
↓
task-start(对焦 + 方案)
↓
task-execute → 编码 → 调试
↓
需求完成?→ task-finish → 标 done
```

设计原则:

  • flow 块中不要写长句,每个节点控制在 10 字内,超长的信息放正文说明
  • → 扩展只用于挂 1-3 个分支节点;再多就该拆成多行或改调 diagram
  • 一个 flow 块表达一个完整小流程,别把多个无关流程塞进同一个块

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Preview Md AI skill do?

MD 文件浏览器预览:GitHub 风格渲染 + 左侧自动目录。 在完成方案设计(specs)或开发计划(plans)的 MD 文件后触发。 询问用户是否要在浏览器中打开预览,确认后执行。 触发词:方案写完、计划写完、review MD、预览文档。 工作流位置:task-start 方案产出后 / 任意 MD 文档完成后

Why use Preview Md on TypingMind?

Because you install it once and use it with any model. Preview Md is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Preview Md in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/312362115/claude/tree/main/skills/preview-md. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Preview Md?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Preview Md?

As many as you like. As long as a model supports skills, you can use Preview Md with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Preview Md AI skill free?

Yes. It is published on GitHub by 312362115 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇