markdown-format

markdown-format is a skill for Claude Code, Codex from chengkj99/kj-skills. It costs 107 tokens per session (1,440 once invoked), scanned A, original, MIT.

A Markdown cleanup workflow for files exported from Pandoc, Word, or other tools, or for messy GitHub-Flavored Markdown. It adjusts headings, tables, quotes, code blocks, lists, and numbering for better use in Obsidian, a note-taking app.

In plain words
What is it for?
Use it to prepare Markdown for Obsidian, repair exported documents, and improve readability while preserving frontmatter, links, and images.
Why use it?
It fixes common formatting problems such as tables that do not render and code or lists with incorrect indentation, without removing the main text by default.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also agents/openai.yaml present. Also seen: mentions CLAUDE.md; mentions subagents.

Part of the kj-skills plugin — 34 skills, 1 command, 1 hook shipped together

Good fit Use it to prepare Markdown for Obsidian, repair exported documents, and improve readability while preserving frontmatter, links, and images.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chengkj99/kj-skills/markdown-format
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add chengkj99/kj-skills --skill markdown-format
Clone the repo
git clone --depth 1 https://github.com/chengkj99/kj-skills

Made for: Claude Code, Codex.

Or install kj-skills, the plugin that ships this one along with the rest of its 34 skills, 1 command, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for markdown-format

README.md
[![agentmods](https://agentmods.dev/badge/skills/chengkj99/kj-skills/markdown-format/github.svg)](https://agentmods.dev/skills/chengkj99/kj-skills/markdown-format)
Your own site
<a href="https://agentmods.dev/skills/chengkj99/kj-skills/markdown-format"><img src="https://agentmods.dev/badge/skills/chengkj99/kj-skills/markdown-format/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for markdown-format

Your own site · 80×15
<a href="https://agentmods.dev/skills/chengkj99/kj-skills/markdown-format"><img src="https://agentmods.dev/badge/skills/chengkj99/kj-skills/markdown-format.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,440 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00107 $0.01440
Opus 5 $0.00053 $0.00720
Sonnet 5 $0.00021 $0.00288
Haiku 4.5 $0.00011 $0.00144

Measured 9d ago against content hash a87f5a6e4a39, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

markdown-format scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/format_markdown.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/markdown-format/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Markdown 格式化(Obsidian / GFM)

适用场景

  • pandoc / Word / 语雀 导出的 .md(残留 HTML 表格、**伪标题**、逐行 > 代码)
  • Obsidian 中 | 列 | 未渲染为表格(缺分隔行)
  • 用户要求「格式化优化、更易阅读」,且明确不要随意删减内容

硬性约束

  1. 不擅自删减正文;若发现重复段落、冗余图片、过时章节,先列出建议,等用户确认后再删。
  2. 保留文首 YAML frontmatter(------)与原有 wikilink、相对路径图片。
  3. 用户指定只改某节时,仅改该范围。

推荐工作流

1. Read 通读目标文件,判断来源(Pandoc / 手写 / 混合)
2. 优先运行脚本(若可写盘):python scripts/format_markdown.py <file.md>
3. 人工扫一遍:提示框、编号、误标语言、需用户确认的重复内容
4. 在 Obsidian 预览中验证表格与代码块

有 Shell 权限时,在 skill 目录或仓库根执行:

python skills/markdown-format/scripts/format_markdown.py path/to/doc.md
# 预览不写盘:
python skills/markdown-format/scripts/format_markdown.py path/to/doc.md --check

脚本不覆盖所有语义问题;第 3 步人工检查不可省略

转换规则(核心)

1. 标题

原文模式 目标
**第X章 标题** # 第X章 标题
**N.M 小节** ## N.M 小节
**macOS / …** 等平台小标题 ### …
**❌ 错误名** ### ❌ 错误名

文档主标题:文首 # 主标题 + ## 副标题;避免全文仅用加粗当标题(Obsidian 大纲失效)。

2. GFM 表格(Obsidian 必检)

表头下一行必须是分隔行,列数与表头一致:

| **列 A** | **列 B** |
| --- | --- |
| 数据 1 | 数据 2 |

常见事故:清理 Pandoc 空行时误删 |----|----|。修复:在首个表头行后插入 | --- | --- |(列数 N 则 N 个 ---)。

宽表、提示性色块表:可改为 引用块 或保留 GFM,勿留裸 HTML <table>

3. 提示框(原 Word 色块 / 单列表格)

转为引用块,标题加粗:

> **核心认知**
>
> 正文段落。多段之间用 `>` 空行分隔。

目录式列表放在同一引用块内时,列表项之间不要插空行(否则 Obsidian 断块)。

4. 代码块

内容类型 围栏语言
Shell / claude / 安装命令 bash
settings.json / Hooks json(2 空格缩进)
CLAUDE.md / Subagent 模板 markdown
SKILL.md frontmatter 示例 yaml
目录树 text

操作要点:

  • 合并连续 > 引号为单个围栏块;去掉 \|\_ 等 Pandoc 转义(表内 \[ 除外时需还原为 [)。
  • 多行 Claude 提示(以 > 开头):续行若无 >,补上 > 前缀。
  • JSON 用 json.dumps(..., indent=2) 或等价格式化;不要把 JSON 标成 bash

5. 列表与编号

  • 去掉列表项之间的多余空行。
  • Word 遗留错误编号(如 7.1 节出现 5–8、特性循环 9–14):按阅读顺序改为 1–n,不改文字

6. 图片与页脚

  • 同一二维码/配图:HTML <img> + Markdown ![]() 重复时,保留一种(优先 Markdown 相对路径)。
  • 用户要求精简页脚(如仅保留公众号)时,只改指定区块,不动正文章节。

Read the full file on GitHub · 125 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 125 lines · 107 tokens per session scan A a87f5a6e4a39

Subscribe to this mod's changes

markdown-format is a skill published in the GitHub repository chengkj99/kj-skills (14 stars, last pushed 8d ago), licensed MIT. It adds 107 tokens to every session and 1,440 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

orbit-notion

Open Orbit briefing skill — selected by the Orbit pipeline when Notion is the user's only connected connector, or when the user explicitly scopes their daily digest to Notion. Pulls the past 24 hours of document edits, comments, mentions, and database row changes from the user's authenticated Notion connection and…

nexu-io/open-design · 117 tokens

instrument-data-to-allotrope

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…

anthropics/knowledge-work-plugins · 123 tokens

baoyu-youtube-transcript

A tool for downloading the written captions, subtitles, chapter information, speaker labels, and cover image from a YouTube video using its URL or ID.

JimLiu/baoyu-skills · 107 tokens

feishu

Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.

Hmbown/CodeWhale · 33 tokens

read

Reads URLs and PDFs by fetching source content, defaulting to concise summaries for plain read requests and clean Markdown when asked to convert, save, quote, cite, or feed downstream work. Use when users ask in any language to read, fetch, check, summarize, quote, cite, convert, or save a URL or PDF. Not for local…

tw93/Waza · 78 tokens

overleaf-sync

A two-way connection between a local paper folder and Overleaf, a web-based LaTeX editor for writing research papers. It lets you move changes between the local files and the shared Overleaf project.

wanshuiyin/Auto-claude-code-research-in-sleep · 97 tokens