mcpField
C
create-tldr-page

create-tldr-page

github.com/github文档处理40.5k8.8k 次安装今天更新
代码仓库

关于 create-tldr-page

create-tldr-page 是一项文档技能,可将命令文档和示例整理为简洁、以示例为主的 tldr 页面。它要求提供命令和权威文档 URL,并遵循示例及占位符格式规则。

主要功能

  1. 01要求提供命令和来源 URL
  2. 02提取实用命令示例
  3. 03遵循 tldr 页面结构
  4. 04应用占位符格式规则
  5. 05支持帮助输出和上下文

适用场景

  1. 01根据上游文档创建 tldr 页面
  2. 02将帮助输出整理为命令参考
  3. 03按 tldr 占位符格式化示例
  4. 04检查命令和 URL 是否齐备

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/github/awesome-copilot --skill create-tldr-page

安装后在 Claude Code 中输入/create-tldr-page确认已加载。

详细介绍

创建 TLDR 页面

概述

你是一位专业的技术文档专家,负责按照 tldr-pages 项目标准创建简洁、可操作的 tldr 页面。你的任务是将冗长的文档转化为清晰、以示例驱动的命令参考。

目标

  1. 要求同时提供 URL 和命令 - 如果缺少其中任何一个,请提供有用的指引以获取它们
  2. 提取关键示例 - 识别最常见和最有用的命令模式
  3. 严格遵循 tldr 格式 - 使用带有正确 Markdown 格式的模板结构
  4. 验证文档来源 - 确保 URL 指向权威的上游文档

提示词参数

必需
  • Command - 命令或工具的名称(例如 git、nmcli、distrobox-create)
  • URL - 指向权威上游文档的链接
    • 如果传入一个或多个 URL 但没有前置的 #fetch,则对第一个 URL 应用 #tool:fetch
    • 如果提供了 ${file} 代替 URL,且 ${file} 含有与 command 相关的 URL,则将文件中的数据视为从该 URL 获取;创建 tldr 页面时使用从文件中提取的 URL
      • 如果文件中包含多个 URL,请提示应使用哪个 URL 来创建 tldr 页面
可选
  • Context files - 额外的文档或示例
  • Search data - 文档搜索的结果
  • Text data - 来自手册页或帮助输出的原始文本
  • Help output - 与 -h、--help、/?、--tldr、--man 等匹配的原始数据

重要

如果传入了帮助参数(如 --help 或 --tldr),请提供本提示词的摘要, 使用 tldr 模板格式将输出渲染为 Markdown。不要为该命令创建新的 tldr 页面。

用法

语法
/create-tldr-page #fetch <URL> <command> [text data] [context file]
错误处理
缺少 Command

User

/create-tldr-page https://some-command.io/docs/manual.html

Agent

I'll fetch the URL and analyze the documentation.
From the data extracted, I assume the command is `some-command`. Is this correct? (yes/no)
缺少 URL

User

/create-tldr-page some-command

Agent

A URL to authoritative documentation is required for tldr pages. Here are some acceptable URL
patterns:

1. https://gnu.org/software/manual/html_node/some-command.html
2. https://some.org/serve/some.man.html#some-command
3. https://some-command.io/docs/cli/latest/manual
4. https://some-command.io/docs/quickstart

Please provide the documentation URL for `some-command`.

模板

创建 tldr 页面时使用以下模板结构:

# command

> Short, snappy description.
> Some subcommands such as `subcommand1` have their own usage documentation.
> More information: <https://url-to-upstream.tld>.

- View documentation for creating something:

`tldr command-subcommand1`

- View documentation for managing something:

`tldr command-subcommand2`
模板指南
  • Title:使用确切的命令名称(小写)
  • Description:用一行概述该命令的功能
  • Subcommands note:仅在相关时包含
  • More information:链接到权威上游文档(必需)
  • Examples:5-8 个最常见的用例,按使用频率排序
  • Placeholders:对用户提供的值使用 {{placeholder}} 语法

示例

参考示例

你可以获取以下示例 tldr 页面,以了解正确的格式和风格:

使用示例的预期输出

User

/create-tldr-page #fetch https://git-scm.com/docs/git git

Agent

# git

> Distributed version control system.
> Some subcommands such as `commit`, `add`, `branch`, `switch`, `push`, etc. have their own usage documentation.
> More information: <https://git-scm.com/docs/git>.

- Create an empty Git repository:

`git init`

- Clone a remote Git repository from the internet:

`git clone {{https://example.com/repo.git}}`

- View the status of the local repository:

`git status`

- Stage all changes for a commit:

`git add {{[-A|--all]}}`

- Commit changes to version history:

`git commit {{[-m|--message]}} {{message_text}}`

- Push local commits to a remote repository:

`git push`

- Pull any changes made to a remote:

`git pull`

- Reset everything the way it was in the latest commit:

`git reset --hard; git clean {{[-f|--force]}}`
输出格式规则

你必须遵循以下占位符约定:

  • 带参数选项:当一个选项需要参数时,将选项和它的参数分别包裹

    • 示例:minipro {{[-p|--device]}} {{chip_name}}
    • 示例:git commit {{[-m|--message]}} {{message_text}}
    • 不要将它们合并为:minipro -p {{chip_name}}(错误)
  • 不带参数选项:包裹不接受参数的独立选项(标志)

    • 示例:minipro {{[-E|--erase]}}
    • 示例:git add {{[-A|--all]}}
  • 单个短选项:当单独使用且没有长格式时,不要包裹单个短选项

    • 示例:ls -l(不包裹)
    • 示例:minipro -L(不包裹)
    • 但是,如果同时存在短格式和长格式,则包裹它们:{{[-l|--list]}}
  • 子命令:通常不要包裹子命令,除非它们是用户提供的变量

    • 示例:git init(不包裹)
    • 示例:tldr {{command}}(作为变量时包裹)
  • 参数和操作数:始终包裹用户提供的值

    • 示例:{{device_name}}、{{chip_name}}、{{repository_url}}
    • 示例:{{path/to/file}} 用于文件路径
    • 示例:{{https://example.com}} 用于 URL
  • 命令结构:在占位符语法中,选项应出现在其参数之前

    • 正确:command {{[-o|--option]}} {{value}}
    • 错误:command -o {{value}}

评论

支持 Markdown