markdown-lint
Markdown ファイル編集後のリント実行。Markdown を作成・編集したら必ず実行。
When & Why to Use This Skill
The markdown-lint skill automates the quality assurance process for Markdown documentation. It ensures structural integrity, consistent formatting, and linguistic accuracy by performing comprehensive checks including syntax validation (markdownlint), Japanese grammar review (textlint), and spell-checking (cspell). This tool is essential for maintaining professional documentation standards and catching errors early in the development workflow.
Use Cases
- Automated Syntax Validation: Automatically detect and fix common Markdown formatting issues such as missing top-level headers (MD041) or unlabelled code blocks (MD040) to ensure document consistency.
- Linguistic and Grammar Correction: Utilize integrated textlint to identify and correct Japanese grammatical errors, such as redundant particles, ensuring high-quality technical writing.
- Professional Spell-Checking: Use cspell to identify typos and manage project-specific terminology, preventing embarrassing spelling mistakes in public-facing READMEs or blog posts.
- Pre-publication Quality Gate: Implement a standardized 'just lint' workflow that ensures all documentation files (README, CHANGELOG, etc.) meet quality benchmarks before they are committed or published.
| name | markdown-lint |
|---|---|
| description | Markdown ファイル編集後のリント実行。Markdown を作成・編集したら必ず実行。 |
Markdown Lint
Markdown ファイルを作成・編集した後に lint を実行するスキル。
重要
Markdown ファイル (*.md) を作成・編集した場合は、必ずこのスキルに従って lint を実行すること。
実行コマンド
just lint
対象ファイル
*.md(すべての Markdown ファイル)- 例:
README.md,DEVELOPMENT.md,CHANGELOG.md - 例:
.claude/skills/**/SKILL.md - 例:
apps/blog/src/contents/*.md
手順
- Markdown ファイルを作成・編集
just lintを実行してエラーを確認- エラーがあれば修正
- 再度
just lintで確認(すべて Passed になるまで繰り返す)
よくあるエラーと修正方法
| エラー | 原因 | 修正方法 |
|---|---|---|
| MD041 | 最初の行が見出しでない | # タイトル を先頭に追加 |
| MD040 | コードブロックに言語指定がない | ```bash のように言語を指定 |
| textlint | 日本語の文法エラー | エラーメッセージに従って修正 |
| cspell | 不明な単語 | cspell.json の words に追加 |
注意事項
- YAML front-matter がある場合、見出しはその直後に記述
- コードブロックには必ず言語を指定(
textでも可) - 日本語の助詞の重複に注意(textlint が検出)