Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计提醒

canghe-format-markdowncanghe format Markdown 搜索

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

3,006

周安装

124

GitHub Stars

218

下载量

982
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:canghe-format-markdown(canghe format Markdown 搜索)
来源仓库:https://github.com/freestylefly/canghe-skills
仓库路径:skills/canghe-format-markdown
安装命令:
npx skills add https://github.com/freestylefly/canghe-skills --skill canghe-format-markdown
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/freestylefly/canghe-skills --skill canghe-format-markdown

简介

用于辅助文档、Markdown 和内容稿件的整理与改写。

  • 适合让 Agent 提炼结构、补齐章节或统一术语。
  • 支持生成摘要、封面图片和格式化标题处理。canghe-format-markdown 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 使用时需保留原创内容,仅添加格式不修改文本。
  • 涉及对外发布时应控制语气,避免过度营销或夸大能力。

SKILL.md

Markdown Formatter

Transforms plain text or markdown files into well-structured markdown with proper frontmatter, formatting, and typography.

Script Directory

Scripts in scripts/ subdirectory. Replace ${SKILL_DIR} with this SKILL.md's directory path.

ScriptPurpose
scripts/main.tsMain entry point with CLI options (uses remark-cjk-friendly for CJK emphasis)
scripts/quotes.tsReplace ASCII quotes with fullwidth quotes
scripts/autocorrect.tsAdd CJK/English spacing via autocorrect

Preferences (EXTEND.md)

Use Bash to check EXTEND.md existence (priority order):

# Check project-level first
test -f .canghe-skills/canghe-format-markdown/EXTEND.md && echo "project"

# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.canghe-skills/canghe-format-markdown/EXTEND.md" && echo "user"

┌──────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────────────┼───────────────────┤ │.canghe-skills/canghe-format-markdown/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.canghe-skills/canghe-format-markdown/EXTEND.md │ User home │ └──────────────────────────────────────────────────────────┴───────────────────┘

┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘

EXTEND.md Supports: Default formatting options | Summary length preferences

Usage

Claude performs content analysis and formatting (Steps 1-6), then runs the script for typography fixes (Step 7).

Workflow

Step 1: Read Source File

Read the user-specified markdown or plain text file.

Step 1.5: Detect Content Type & Confirm

Content Type Detection:

IndicatorClassification
Has --- YAML frontmatterMarkdown
Has #, ##, ### headingsMarkdown
Has **bold**, *italic*Markdown
Has - or 1. listsMarkdown
Has ``` code blocksMarkdown
Has > blockquotesMarkdown
None of abovePlain text

Decision Flow:

┌─────────────────┬────────────────────────────────────────────────┐ │ Content Type │ Action │ ├─────────────────┼────────────────────────────────────────────────┤ │ Plain text │ Proceed to Step 2 (format to markdown) │ ├─────────────────┼────────────────────────────────────────────────┤ │ Markdown │ Use AskUserQuestion to confirm optimization │ └─────────────────┴────────────────────────────────────────────────┘

If Markdown detected, ask user:

Detected existing markdown formatting. What would you like to do?

1. Optimize formatting (Recommended)
   - Add/improve frontmatter, headings, bold, lists
   - Run typography script (spacing, emphasis fixes)
   - Output: {filename}-formatted.md

2. Keep original formatting
   - Preserve existing markdown structure
   - Run typography script (spacing, emphasis fixes)
   - Output: {filename}-formatted.md

3. Typography fixes only
   - Run typography script on original file in-place
   - No copy created, modifies original file directly

Based on user choice:

  • Optimize: Continue to Step 2-8 (full workflow)
  • Keep original: Skip Steps 2-5, copy file → Step 6-8 (run script on copy)
  • Typography only: Skip Steps 2-6, run Step 7 on original file directly

Step 2: Analyze Content Structure

Identify:

  • Existing title (H1 #)
  • Paragraph separations
  • Keywords suitable for bold
  • Parallel content convertible to lists
  • Code snippets
  • Quotations

Step 3: Check/Create Frontmatter

Check for YAML frontmatter (--- block). Create if missing.

Meta field handling:

FieldProcessing
titleSee Step 4
slugInfer from file path (e.g., posts/2026/01/10/vibe-coding/vibe-coding) or generate from title
summaryGenerate engaging summary (100-150 characters)
coverImageCheck if imgs/cover.png exists in same directory; if so, use relative path (also accepted: featureImage)

Step 4: Title Handling

Logic:

  1. If frontmatter already has title → use it, no H1 in body
  2. If first line is H1 → extract to frontmatter title, remove H1 from body
  3. If neither exists → generate candidate titles

Title generation flow:

  1. Generate 3 candidate titles based on content
  2. Use AskUserQuestion tool:
Select a title:

1. [Title A] (Recommended)
2. [Title B]
3. [Title C]
  1. If no selection within a few seconds, use recommended (option 1)

Title principles:

  • Concise, max 20 characters
  • Captures core message
  • Engaging, sparks reading interest
  • Accurate, avoids clickbait

Important: Once title is in frontmatter, body should NOT have H1 (avoid duplication)

Step 5: Format Processing

Formatting rules:

ElementFormat
TitlesUse #, ##, ### hierarchy
Key pointsUse **bold**
Parallel itemsConvert to - unordered or 1. ordered lists
Code/commandsUse ` inline or `` `block` ```
Quotes/sayingsUse > blockquote
SeparatorsUse --- where appropriate

Formatting principles:

  • Preserve original content and viewpoints
  • Add formatting only, do not modify text
  • Formatting serves readability
  • Avoid over-formatting

Step 6: Save Formatted File

Save as {original-filename}-formatted.md

Examples:

  • final.mdfinal-formatted.md
  • draft-v1.mddraft-v1-formatted.md

If user chose "Keep original formatting" (from Step 1.5):

  • Copy original file to {filename}-formatted.md without modifications
  • Proceed to Step 7 for typography fixes only

Backup existing file:

If {filename}-formatted.md already exists, backup before overwriting:

# Check if formatted file exists
if [ -f "{filename}-formatted.md" ]; then
  # Backup with timestamp
  mv "{filename}-formatted.md" "{filename}-formatted.backup-$(date +%Y%m%d-%H%M%S).md"
fi

Example:

  • final-formatted.md exists → backup to final-formatted.backup-20260128-143052.md

Step 7: Execute Text Formatting Script

After saving, must run the formatting script:

npx -y bun ${SKILL_DIR}/scripts/main.ts {output-file-path} [options]

Script Options:

OptionShortDescriptionDefault
--quotes-qReplace ASCII quotes with fullwidth quotes "..."false
--no-quotesDo not replace quotes
--spacing-sAdd CJK/English spacing via autocorrecttrue
--no-spacingDo not add CJK/English spacing
--emphasis-eFix CJK emphasis punctuation issuestrue
--no-emphasisDo not fix CJK emphasis issues
--help-hShow help message

Examples:

# Default: spacing + emphasis enabled, quotes disabled
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md

# Enable all features including quote replacement
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --quotes

# Only fix emphasis issues, skip spacing
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --no-spacing

# Disable all processing except frontmatter formatting
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --no-spacing --no-emphasis

Script performs (based on options):

  1. Fix CJK emphasis/bold punctuation issues (default: enabled)
  2. Add CJK/English mixed text spacing via autocorrect (default: enabled)
  3. Replace ASCII quotes "..." with fullwidth quotes "..." (default: disabled)
  4. Format frontmatter YAML (always enabled)

Step 8: Display Results

**Formatting complete**

File: posts/2026/01/09/example/final-formatted.md

Changes:
- Added title: [title content]
- Added X bold markers
- Added X lists
- Added X code blocks

Formatting Example

Before:

This is plain text. First point is efficiency improvement. Second point is cost reduction. Third point is experience optimization. Use npm install to install dependencies.

After:

---
title: Three Core Advantages
slug: three-core-advantages
summary: Discover the three key benefits that drive success in modern projects.
---

This is plain text.

**Main advantages:**
- Efficiency improvement
- Cost reduction
- Experience optimization

Use `npm install` to install dependencies.

Notes

  • Preserve original writing style and tone
  • Specify correct language for code blocks (e.g., python, javascript)
  • Maintain CJK/English spacing standards
  • Do not add content not present in original

Extension Support

Custom configurations via EXTEND.md. See Preferences section for paths and supported options.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.15%
按下载量换算375

Claude

30.32%
按下载量换算298

Cursor

20.7%
按下载量换算203

Gemini CLI

8.44%
按下载量换算83

安全审计

Gen Agent Trust Hub

可疑

Socket

可疑

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills