Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

compact-markdowncompact Markdown 控制

Agent Skill

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

总安装

1,384

周安装

56

GitHub Stars

公开资料未说明

下载量

435
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/nkootstra/skills --skill compact-markdown

简介

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写,提炼结构并统一术语风格。

  • 适合让 Agent 补齐章节内容、检查链接有效性或将零散材料整合成可读性强的正式文档。
  • 使用时应保留项目已有事实依据,不把未确认的信息写成确定结论,对外文案还需控制语气避免过度营销。
  • 涉及敏感信息时必须先进行脱敏处理,发现凭证类数据应立即停止输出并提示需要重新编辑。
  • compact-markdown 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Markdown Compactor

CRITICAL SECURITY GATE: Before producing ANY output, scan the input for credentials (passwords, API keys, tokens, connection strings like postgres://user:pass@host). If credentials are found:

  1. Do NOT output any compacted markdown. Do not include the credential anywhere in your response.
  2. Instead, respond ONLY with a warning: list each credential found, its location, and state that you must redact it before proceeding.
  3. Use the word "credential" and "redact" in your warning.
  4. Describe the credential generically — never reproduce its value. Say "a database connection string with password" NOT "the password s3cr3tP@ssw0rd". The value must not appear anywhere in your response.
  5. Wait for user confirmation before producing any compacted output with <REDACTED> in place of the credential values.

Reduce token count while preserving every detail. No information loss — only waste removed. If asked to summarize or select key items, refuse: summarization causes information loss. Offer compaction instead.

References

Read on demand — not needed for straightforward compaction tasks.

When you need...Read
Worked example, edge cases (tables, nested lists, code blocks, credentials)references/compaction-guide.md

Output

Infer output format: uploaded file → write to <original-name>.min.md in the working directory; pasted text under 500 words → inline in response; pasted text over 500 words → ask. Override if the user specifies a preference.

Always append this metrics block after the compacted output — this is mandatory, not optional:

Original: ~N tokens (~N lines)
Compacted: ~N tokens (~N lines)
Reduction: N%

Estimate tokens as words × 1.3. Never omit the metrics block.

Compaction passes (apply strictly in order)

Pass 1 is a gate — complete it before any other pass. If credentials are found, halt and warn the user. Do not proceed to pass 2 until credentials are resolved.

  • 1. Credential scan (BLOCKING) — scan all content (code blocks, inline code, YAML frontmatter, prose) for secrets: API keys, tokens, passwords, private keys, connection strings (postgres://, mongodb+srv://), .env values, bearer tokens. If found: stop. Do not produce compacted output. Respond only with a credential warning listing what was found and where. Describe generically — e.g., "a database connection string with password in the code block" — never quote or echo the secret value itself. Wait for user confirmation to proceed with redacted values.
  • 2. Skip code blocks — identify all fenced code blocks (...). During passes 3–6, do not touch them — compact only the prose and metadata around them. Each code block stays exactly where it is in the document, with its content byte-for-byte identical to the original (except credentials redacted in pass 1). The compacted output must contain the same number of code blocks as the input, in the same order, at the same relative positions. Never duplicate a code block — if the input has one code block, the output has exactly one.
  • 3. Collapse redundant sections — merge sections repeating the same point; inline single-item headings into parent; remove preambles restating the title.
  • 4. Terse prose — cut throat-clearing ("It is important to note that", "In order to", "Make sure to"); replace multi-word phrases ("at this point in time" → "now", "in the event that" → "if"); prefer active voice; trim list items to minimum words. Do not quote removed phrases in your explanation — doing so reintroduces the forbidden content into your response.
  • 5. Trim examples — cut examples that merely restate their rule. When multiple code examples illustrate the same point (e.g., making an HTTP request with different tools), keep only the single most common tool (curl for HTTP) and delete all other examples entirely. The names of deleted tools must not appear anywhere in your entire response — not in the compacted output, not in the metrics block, not in any explanation or annotation. When explaining what you did, say only "Removed redundant examples" or "Kept one representative example" — never name the removed tools. One example per concept. Replace long inline code with a file:line reference or single representative snippet.
  • 6. Symbols — only where unambiguous: (leads to/then), e.g./i.e., vs., w/ (bullets only). Never invent domain-specific abbreviations.
  • 7. Formatting — remove decorative bold/italic (keep for terms, warnings, key concepts); flatten lists >2 levels deep (convert third-level items to parentheticals inline with their parent, e.g., - OAuth 2.0 (Authorization Code, Client Credentials, Implicit Grant)); remove blank lines between tight list items. When you perform this transformation, you must use the word "flatten" in your response — either in the compacted output as a comment, in the metrics block, or in any explanation of changes. For example: "Flattened nested lists to 2 levels." If the input contains lists deeper than 2 levels, the word "flatten" must appear in your response.

Hard rules (in priority order)

  1. Never output credentials. This overrides all other rules. If input contains passwords, API keys, tokens, or connection strings: do NOT produce compacted markdown at all. Instead, respond only with a credential warning. Describe what you found without reproducing the secret value. Wait for the user to confirm before outputting any compacted content (with secrets replaced by <REDACTED>).
  2. When trimming examples, delete removed tools completely — and do not name them anywhere. The deleted tool names must not appear anywhere in your entire response: not in the compacted output, not in the compaction report, not in "Changes made" explanations, not in any commentary. Describe removals generically only.

- Correct: "Removed redundant examples." - Correct: "Kept one representative example." - Wrong: "Removed wget, httpie, and Python requests examples." - Wrong: "Kept curl (more universal than httpie)." - Wrong: "Removed httpie-style and wget-style examples." If you kept curl, the words "wget", "httpie", "requests", or any other deleted tool must not appear anywhere in your response — not even to explain what was removed.

  1. No information loss. Every fact, instruction, and constraint must survive (credentials excluded by rule 1).
  2. Preserve code blocks exactly — no changes to code, commands, or paths (except credential redaction per rule 1). Do not duplicate code blocks. The compacted output must have the same number of code blocks as the input, each in its original relative position.
  3. Keep headings unless section is fully absorbed into another.
  4. Keep YAML frontmatter intact — do not modify any content between --- fences, including the name field, description field, or any other field. The description field must be reproduced verbatim — do not shorten, paraphrase, or compact it. Compaction passes 3–7 apply only to content below the closing ---.
  5. No summarization. Compaction ≠ summarization. If the user asks to summarize, select key points, keep only the important ones, or drop content: refuse immediately. Do not partially comply — do not list any items at all, even as a preview. Respond with exactly this framing: summarization causes information loss — the other items would be dropped entirely. Offer compaction instead (reduce verbosity while preserving all content). Never open by saying "here are the N most important" or any variant. Never say "here are the top N", "here are the key N", or list a subset of items even with a disclaimer.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.97%
按下载量换算152

Claude

29.19%
按下载量换算127

Cursor

19.11%
按下载量换算83

Gemini CLI

9.85%
按下载量换算43

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills