Agent skill

Agents Md Compress

by LuckyKuang in LuckyKuang/codex-tokens-compress

将 AGENTS.md 压缩为高密度索引格式(每行以 | 开头),并固化可复用规则;适用于 AGENTS.md 创建、压缩、规则更新场景。

MITAuto-check passedAgent Workflows

Install Agents Md Compress

skills CLI
$ npx skills add LuckyKuang/codex-tokens-compress --skill agents-md-compress -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install LuckyKuang/codex-tokens-compress agents-md-compress --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/LuckyKuang/codex-tokens-compress.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/agents-md-compress .claude/skills/agents-md-compress && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
agents-md-compress
GitHub stars
101
Token cost
~558 tokens
SKILL.md length
150 words
Files
6 (incl. scripts, references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

将 AGENTS.md 压缩为高密度索引格式(每行以 | 开头),并固化可复用规则;适用于 AGENTS.md 创建、压缩、规则更新场景。

  • Works in 5 steps: 读取当前 AGENTS.md,提取最高优先级事实(结构、命令、约束、校验方式)。 → 校验关键路径是否真实存在,避免无效索引。 → 按索引格式压缩重写,仅保留可执行信息。 → …
  • Tasks that involve Agent instruction files
  • SKILL.md covers Core Objective, Core Thinking, Hard Format Constraints and Language Policy (Mandatory), plus 4 more sections
  • Runs Python scripts from its folder; calls python

What it does

Agents Md Compress is an agent skill from LuckyKuang/codex-tokens-compress. 将 AGENTS.md 压缩为高密度索引格式(每行以 | 开头),并固化可复用规则;适用于 AGENTS.md 创建、压缩、规则更新场景。

Its SKILL.md is about 560 tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `references/api_reference.md`, `references/checklists_and_antipatterns.md` and `references/compression_principles.md`).

It sits in Agent Workflows, covering Agent instruction files. The repository describes itself as: 面向 AI 协作场景的 AGENTS.md 压缩实验仓库:用统一规约格式提升指令命中率、降低幻觉风险,并量化 token 压缩收益。 The licence is MIT.

When your agent uses it

  • Tasks that involve Agent instruction files

Example prompts

  • “/agents-md-compress”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 读取当前 AGENTS.md,提取最高优先级事实(结构、命令、约束、校验方式)。
  2. 校验关键路径是否真实存在,避免无效索引。
  3. 按索引格式压缩重写,仅保留可执行信息。
  4. 涉及自动触发时,按当前项目实际技能名与路径补充以下行(禁止硬编码)
  5. 运行校验脚本并修正失败项。

What it can do on your machine

Read from SKILL.md and the folder at commit 472f991. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Agents Md Compress loads about 558 tokens when it runs, and up to ~1.8k if it reads all its reference files. Until then it costs about 23 tokens; SKILL.md has 150 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~558
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from LuckyKuang/codex-tokens-compress at commit 472f991, republished under its MIT licence (© LuckyKuang). 150 words, ~558 tokens.

Download SKILL.mdSave it as .claude/skills/agents-md-compress/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
agents-md-compress
description
将 AGENTS.md 压缩为高密度索引格式(每行以 `|` 开头),并固化可复用规则;适用于 AGENTS.md 创建、压缩、规则更新场景。

Agents Md Compress

Core Objective

将冗长 AGENTS 文档压缩为高密度、可检索、可执行的索引文档,提升规则命中率与一致性。

Core Thinking

  • 优先“检索导向推理”,避免仅依赖预训练记忆。
  • 用“被动上下文”降低决策成本:关键规则直接放在 AGENTS 顶部,减少额外检索动作。
  • 用“结构化索引行”替代解释性段落,提升解析稳定性。

必须保留关键指令行:

  • |IMPORTANT: Prefer retrieval-led reasoning over pre-training-led reasoning for any project tasks.

Hard Format Constraints

  • 第一行必须是 # AGENTS.md。
  • 除标题外,所有非空行必须以 | 开头。
  • 优先使用以下两种表达:
    • 文件索引:|Category:path:{file1,file2,file3}
    • 命令/规则:|Category:value1|value2|value3
  • 删除长段落、代码块、深层标题(##/###)。
  • 目标文档通常控制在 15-35 行;超长时拆分到 references/。

Language Policy (Mandatory)

  • 规则说明文本默认使用目标项目主要语言(中文或英文);若仓库已有语言规则,优先遵循仓库规则。
  • 路径、命令、文件名、目录名、代码标识(类名/方法名/注解/配置键)保留英文。
  • 不修改 mandatory |IMPORTANT: 行英文原文。

Meta Directory Policy (Mandatory)

  • 官方目录事实必须准确表述:repo skills 位于 .agents/skills,user skills 位于 $HOME/.agents/skills,admin skills 位于 /etc/codex/skills(或企业约定系统目录),system skills 由 Codex 内置。
  • 官方目录事实必须准确表述:project subagents 位于 .codex/agents,user subagents 位于 ~/.codex/agents。
  • 官方目录事实必须准确表述:mcp/config 位于 ~/.codex/config.toml 或 .codex/config.toml;trusted project 下可沿 repo root -> cwd 逐级加载多个 .codex/config.toml,且近目录覆盖远目录。
  • 项目可在官方事实之上增加更严格目录约束(例如“本仓库 .codex 仅保留 agents/ 与 config.toml”),但必须显式标注为“项目约束”,不得写成官方硬性规则。

Execution Workflow

  1. 读取当前 AGENTS.md,提取最高优先级事实(结构、命令、约束、校验方式)。
  2. 校验关键路径是否真实存在,避免无效索引。
  3. 按索引格式压缩重写,仅保留可执行信息。
  4. 涉及自动触发时,按当前项目实际技能名与路径补充以下行(禁止硬编码):
    • |Local Skills:<skills-dir>:{<skill-name>[,<other-skill-name>]}
    • |Skill Trigger:Use <skill-name> when request mentions AGENTS.md creation, compression, or rule updates.
  5. 运行校验脚本并修正失败项。

Quality Gate

运行:

  • python <skill-root>/scripts/example.py AGENTS.md
  • 若 python 不可用,执行等价静态校验:标题行、|IMPORTANT:、标题后行前缀、禁用 ##/###/code fence。

通过标准:

  • 标题行正确。
  • 存在 |IMPORTANT: 行。
  • 标题后非空行全部以 | 开头。
  • 不含 ##/###/代码围栏。
  • 语言策略满足:说明遵循目标项目语言,命令类元素英文。

Reference Loading Guide

按需加载,不要一次性全读:

  • 压缩模板与示例:references/api_reference.md
  • 原则、符号、格式边界:references/compression_principles.md
  • 检查清单与反例:references/checklists_and_antipatterns.md
  • 定期维护策略:references/maintenance.md

© LuckyKuang, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in .agents/skills/agents-md-compress of LuckyKuang/codex-tokens-compress.

  • SKILL.md
  • references/api_reference.md
  • references/checklists_and_antipatterns.md
  • references/compression_principles.md
  • references/maintenance.md
  • scripts/example.py

Open the folder on GitHubat commit 472f991

Compare with similar skills

Agents Md Compress next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Agents Md Compress compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agents Md Compress this skillLuckyKuang/codex-tokens-compress101—~558Automated safety check: PassMIT
Using Agent Skillsaddyosmani/agent-skills105k4 repos~2.4kAutomated safety check: PassMIT
Claude ReflectBayramAnnakov/claude-reflect1.8k2 repos~627Automated safety check: PassMIT
Writing For Agentsbestofjs/bestofjs3.1k20 repos~2.7kAutomated safety check: PassMIT
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
Task Observerrebelytics/one-skill-to-rule-them-all3.2k1 repos~11kAutomated safety check: PassCC-BY-4.0

Similar skills

  • Using Agent Skills

    addyosmani/agent-skills

    Meta-skill for choosing which workflow skill fits the task at hand, plus always-on habits: surface assumptions, stop on confusion, push back, keep it simple and stay in scope.

    105k GitHub starsUsed in 4 repos~2.4k tokens
    Agent WorkflowsAuto-check passed
  • Claude Reflect

    BayramAnnakov/claude-reflect

    Self-learning system that captures corrections during sessions and reminds users to run /reflect to update CLAUDE.md.

    1.8k GitHub starsUsed in 2 repos~627 tokens
    Agent WorkflowsAuto-check passed
  • Writing For Agents

    bestofjs/bestofjs

    Writing documents for agents. An agent skill from bestofjs/bestofjs.

    3.1k GitHub starsUsed in 20 repos~2.7k tokens
    Agent WorkflowsAuto-check passed
  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 10 days ago
    Agent WorkflowsAuto-check passed
  • Task Observer

    rebelytics/one-skill-to-rule-them-all

    Monitors task execution for skill improvement opportunities.

    3.2k GitHub starsUsed in 1 repo~11k tokens
    Agent WorkflowsAuto-check passed
  • SkillOpt Sleep Cycle

    microsoft/SkillOpt

    Official

    Runs an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills.

    18k GitHub stars~2.3k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check passed

Categories

Questions about Agents Md Compress

What does Agents Md Compress do?

将 AGENTS.md 压缩为高密度索引格式(每行以 | 开头),并固化可复用规则;适用于 AGENTS.md 创建、压缩、规则更新场景。. Agents Md Compress is an agent skill from LuckyKuang/codex-tokens-compress.

When should I use Agents Md Compress?

Agents Md Compress fits situations like: tasks that involve Agent instruction files.

How do I install Agents Md Compress in Claude Code?

Run `npx skills add LuckyKuang/codex-tokens-compress --skill agents-md-compress -a claude-code`. Or copy the skill folder (.agents/skills/agents-md-compress in LuckyKuang/codex-tokens-compress) into .claude/skills/agents-md-compress in your project. Claude Code loads it when a task matches its description.

How do I install Agents Md Compress in Codex?

Run `npx skills add LuckyKuang/codex-tokens-compress --skill agents-md-compress -a codex`. Or copy the skill folder (.agents/skills/agents-md-compress in LuckyKuang/codex-tokens-compress) into .agents/skills/agents-md-compress in your project. Codex loads it when a task matches its description.

Can I use Agents Md Compress in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LuckyKuang/codex-tokens-compress --skill agents-md-compress -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agents-md-compress, .gemini/skills/agents-md-compress, .github/skills/agents-md-compress and .opencode/skills/agents-md-compress in your project.

What does Agents Md Compress need to run?

Going by SKILL.md and its folder, Agents Md Compress needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Agents Md Compress access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Agents Md Compress safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Agents Md Compress use?

Agents Md Compress is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Agents Md Compress use?

About 558 tokens (SKILL.md is roughly 2.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Agents Md Compress?

Skills that share tags, products or a category with Agents Md Compress: Using Agent Skills (addyosmani/agent-skills, 105k stars), Claude Reflect (BayramAnnakov/claude-reflect, 1.8k stars), Writing For Agents (bestofjs/bestofjs, 3.1k stars) and Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agents Md Compress?

LuckyKuang (a GitHub user) maintains it in LuckyKuang/codex-tokens-compress, which has 101 GitHub stars. The repository was last updated on April 10, 2026.

Source: LuckyKuang/codex-tokens-compress on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.