修复Markdown

diegosouzapw2026-10-28查看 285复制 421

**`目标`**:使用 prettier 和 vale 修复 markdown 文件中的 lint、格式和行文问题。**`何时使用`**:当用户或 agent 需要修复 markdown 文件中的 lint、格式或改进行文时使用。**`注意`**:在撰写或修正行文时,严格遵循 E-Prime 指令(避免使用“`to be`”动词)。

Download (.md)

📘如何使用这个技能

  1. 1
    复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
  2. 2
    打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
  3. 3
    粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
  4. 4
    直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景

💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。

SKILL.md2733 chars
---
name: fix-markdown
description:
  Fix lint, formatting, and prose issues in markdown files using
  Prettier and Vale. Use when the user or agent needs to fix lint,
  formatting, and prose issues in markdown files.
---

# Agent protocol: Fix markdown file

**`GOAL`**: use prettier and vale to fix lint, formatting, and prose
issues in markdown files.

**`WHEN`**: use when the user or agent needs to fix lint, formatting, or
improve prose in markdown files.

**`NOTE`**: strictly follow E-Prime directive (avoid "`to be`" verbs)
when writing or correcting prose.

## References

The following reference files serve as strict guidelines when updating
prose.

Locate the reference files in the `references` folder.

- **`references/e-prime-directive.md`**: _The E-Prime Communication
  Protocol defining the rules for avoiding `to be` verbs._

## Primary directives

### Formatting and linting sequence

- **Format first & last**: Always run prettier before analysis and after
  edits
- **E-Prime compliance**: Strictly follow
  `references/e-prime-directive.md` when writing/correcting prose
- **Vale cycle**: Run vale iteratively (lint → fix → verify) until no
  issues remain
- **Research complex issues**: Use search tools or Perplexity for
  unfamiliar lint problems

### Tool commands

- Format: `prettier --write <file_path>`
- Sync rules: `vale sync`
- Lint: `vale --no-wrap --output=JSON <file_path>`

### Vale fixing guidelines

- **Path wrapping**: Wrap filenames, `URIs`, `URLs`, and paths in
  backticks
- **Context awareness**: Check line numbers - issues may appear as
  `substrings` in technical terms
- **False positives**: Wrap acronyms, names, and proper nouns in
  backticks
- **Headings**: Use sentence case (capitalize first character only)
- **Passive voice**: Follow E-Prime directive to remove "`to be`" verbs
- **Follow hints**: Use Vale's issue links when needed

## Efficiency directives

- Batch operations on file groups, avoid individual file processing
- Use parallel execution when possible
- Target only requested files
- Reduce token usage in all operations

## Task management

For complex tasks: use `todo` system to break down, plan, and optimize
workflow.

## Workflow

- Run `vale sync` to update lint rules
- Run `prettier --write` for baseline formatting
- Study file and apply Vale path directives (wrap all paths/filenames in
  backticks)
- Iteratively run `vale`, fix issues, and verify until no issues remain
- Run `prettier --write` for final formatting
- **`DONE`**

## Output

**Files modified:**

- Target markdown files - Formatted and lint-free

**Status communication:**

- Reports number of issues fixed
- Confirms Vale shows zero remaining issues
- Lists file paths processed
来源:skillsdirectory

评论0

登录后参与评论

还没有评论,来抢沙发吧