‹ 首页

md

@georgekhananaev · 收录于 1 周前

Write clean, error-free markdown that IDEs and linters can parse without warnings. Use when writing documentation, README files, or skill files with code examples.

适合你,如果经常写 Markdown 文档或 README 文件

/ 下载安装
md.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add georgekhananaev/claude-skills-vault/md
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- georgekhananaev/claude-skills-vault/md
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify georgekhananaev/claude-skills-vault/md
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
25GitHub stars
~1.5K最小装载
~3.4K含声明引用
~3.4K文本包总量
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · 3d1c537

Markdown Clean Skill

Write clean, error-free markdown that IDEs and linters can parse without warnings.

When to Use

Invoke this skill when:

  • Writing markdown documentation
  • Creating README files
  • Writing skill files with code examples
  • Commands: /md-clean, /markdown
Common IDE Errors & Fixes
1. Nested Code Blocks

Problem: Code blocks inside code blocks cause parsing errors.

Error: Newline or semicolon expected

Wrong:


Here is example:

const x = 1;

Fix: Use different fence lengths (4 backticks for outer):


Here is example:

const x = 1;

Or use indentation for inner blocks:


Here is example:

const x = 1;


2. Unclosed Code Blocks

Problem: Missing closing fence.

Error: Statement expected, Expression expected

Wrong:


const x = 1; // forgot to close

**Fix:** Always close with matching fence:
const x = 1;
### 3. Mismatched Fence Characters

**Problem:** Opening with backticks, closing with tildes (or vice versa).

**Error:** `Newline or semicolon expected`

**Wrong:**
const x = 1;
~~~

Fix: Match opening and closing:


const x = 1;


4. Special Characters in Code Blocks

Problem: Unescaped backticks inside code blocks.

Error: Unexpected token

Wrong:


Use code for inline.


Fix: Use more backticks for outer fence:


Use code for inline.


5. Pipe Characters in Tables

Problem: Unescaped | in table cells.

Error: Column count mismatch

Wrong:

| Command | Description |
|---------|-------------|
| a | b | Creates a|b |

Fix: Escape with backslash:

| Command | Description |
|---------|-------------|
| a \| b | Creates a\|b |
6. HTML in Markdown

Problem: Unclosed HTML tags.

Error: Tag not closed

Wrong:

<details>
<summary>Click</summary>
Content here

Fix: Close all tags:

<details>
<summary>Click</summary>
Content here
</details>
7. Link Syntax Errors

Problem: Malformed links.

Error: ) expected, ] expected

Wrong:

[Link(https://example.com)
[Link][ref

Fix: Proper syntax:

[Link](https://example.com)
[Link][ref]

[ref]: https://example.com
8. List Indentation

Problem: Inconsistent indentation in nested lists.

Error: Unexpected indent

Wrong:

- Item 1
   - Nested (3 spaces - inconsistent)
  - Another (2 spaces)

Fix: Consistent indentation (2 or 4 spaces):

- Item 1
  - Nested (2 spaces)
  - Another (2 spaces)
9. Heading Syntax

Problem: No space after #.

Error: May not render as heading

Wrong:

#Heading
##Another

Fix: Space after #:

# Heading
## Another
10. Empty Lines Around Blocks

Problem: Missing blank lines before/after code blocks.

Error: Unexpected token

Wrong:

Some text

code

More text

Fix: Add blank lines:

Some text

code

More text
Fence Level Guide

Use increasing backticks for nesting:

| Level | Fence | Use For | |-------|-------|---------| | 1 | `` | Normal code | | 2 | `` | Code containing ` | | 3 | ``` | Code containing `` | | 4 | ```` | Code containing ```` |

Safe Markdown Template
# Title

Brief description.

## Section 1

Regular paragraph text.

### Subsection

- List item 1
- List item 2
  - Nested item

## Code Example

code here

## Table

| Col 1 | Col 2 |
|-------|-------|
| A | B |

## Links

- [Text](https://url.com)
- [Reference][ref]

[ref]: https://url.com
Validation Checklist

Before saving markdown:

  • [ ] All code blocks have closing fences
  • [ ] Fence characters match (`` with ``)
  • [ ] Nested blocks use longer fences
  • [ ] Tables have equal column counts
  • [ ] All pipes in tables are escaped
  • [ ] HTML tags are closed
  • [ ] Links have proper syntax
  • [ ] Lists use consistent indentation
  • [ ] Headings have space after #
  • [ ] Blank lines around code blocks
Quick Fixes

| Error | Likely Cause | Fix | |-------|--------------|-----| | Semicolon expected | Unclosed fence | Add closing `` | | Statement expected | Nested fence conflict | Use ``` for outer | | ) expected | Malformed link | Check [text](url) | | Expression expected | Code in paragraph | Add blank lines | | Column mismatch | Table pipe issue | Escape \| or fix columns |

Escaping Reference

Characters to escape in specific contexts:

| Char | Context | Escape | |------|---------|--------| | | Inline code | Use for outer | | ` | Code block | Use ``` for outer | | \| | Tables | \\\| | | [ ] | Not a link | \[ \] | | * _ | Not emphasis | \* \_ | | # | Not heading | \# | | < > | Not HTML | \< \> or &lt; &gt; |

IDE-Specific Tips
VS Code
  • Install "markdownlint" extension
  • Enable "Format on Save"
  • Use preview pane to verify
JetBrains (WebStorm, IntelliJ)
  • Enable Markdown plugin
  • Check "Problems" panel
  • Use "Reformat Code" (Cmd/Ctrl+Alt+L)
Vim/Neovim
  • Use vim-markdown plugin
  • Enable conceallevel for preview
  • Run :MarkdownPreview
Validation Script

Use the included validation script to check markdown files:

# Validate single file
python scripts/validate.py README.md

# Validate directory
python scripts/validate.py ./docs

# Sample output
README.md:15:1: error [MD001] Unclosed code block
    Suggestion: Add closing ``` fence
README.md:42:1: warning [MD003] No space after heading hashes
    Suggestion: Add space: ## Heading...
Error Codes

| Code | Severity | Description | |------|----------|-------------| | MD001 | error | Unclosed code block | | MD002 | warning | Nested fence conflict | | MD003 | warning | No space after heading # | | MD004 | warning | Inconsistent list indent | | MD005 | error | Table column mismatch | | MD006 | error | Malformed link syntax | | MD007 | warning | Unclosed HTML tag | | MD008 | info | Trailing whitespace | | MD009 | info | No blank line around block |

按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。