Skip to content
Agentmart
Submit a tool

compact-bensz-skills

当用户明确要求压缩、瘦身或精简 Agent Skill 文档、降低上下文开销且不改变功能时使用。⚠️ 不适用:新增功能、修复脚本逻辑、批量改代码或压缩普通文档。

Skill by Bensz Conan

IndexedMIT★ 50
Write a review

Chalk Labs

Need help deploying compact-bensz-skills?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/huangwb8-compact-bensz-skills

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

当用户明确要求压缩、瘦身或精简 Agent Skill 文档、降低上下文开销且不改变功能时使用。⚠️ 不适用:新增功能、修复脚本逻辑、批量改代码或压缩普通文档。

Use cases: agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/compact-bensz-skills

What's inside

Skill name
compact-bensz-skills
Description
当用户明确要求压缩、瘦身或精简 Agent Skill 文档、降低上下文开销且不改变功能时使用。⚠️ 不适用:新增功能、修复脚本逻辑、批量改代码或压缩普通文档。
License
MIT
Metadata
author: Bensz Conan · short-description: 在不改变功能的前提下压缩 Agent Skill 的 Markdown 上下文
Instructions
195 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (11)

  • CHANGELOG.md
  • README.md
  • SKILL.md
  • config.yaml
  • compaction-playbook.md · references/
  • preservation-checklist.md · references/
  • validation-checklist.md · references/
  • common.py · scripts/
  • init_workspace.py · scripts/
  • measure_markdown.py · scripts/
  • validate_compaction.py · scripts/

SKILL.md (first lines)

# compact-bensz-skills

## 目标

当用户明确要求“压缩/瘦身/精简某个 Agent Skill 的 Markdown 文档”“在不改变功能前提下降低 skill 上下文开销”时使用。先理解目标 skill 的真实能力与安全边界,再在忽略 `tests/`、`plans/` 以及目标 skill 的 `README.md`、`CHANGELOG.md` 的前提下,压缩 `SKILL.md`、`references/*.md` 等工作型 Markdown,并把中间产物隔离到 `.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/compact-bensz-skills/`。⚠️ 不适用:用户主要想新增功能、修复脚本逻辑、批量改代码、或只想压缩非 skill 文档。

## 流程

### 输入

#### 输入

1. `skill_root`(必需)
   - 目标 Agent Skill 根目录
2. `workspace_dir`(可选)
   - 默认把本轮工作区建在 `<skill_root>/.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/compact-bensz-skills/{yyyy-mm-dd-hh-mm}/`
   - 如果用户显式指定其它目录,则把它视为“run 容器根目录”,本轮仍落到其中的 `{yyyy-mm-dd-hh-mm}/`
3. `run_id`(可选)
   - 用于在 `init -> measure -> validate` 间显式复用同一轮工作区
4. `test_dir`(可选)
   - 默认 `<skill_root>/tests/compact-bensz-skills/`

### 执行步骤

#### 核心原则

- **先理解,再压缩**:先读 `SKILL.md`、`config.yaml`、`scripts/` 和必要的 `references/`,再判断哪些 Markdown 可以缩短。
- **不改行为,只改表达**:压缩的是文档体积,不是功能边界;不得擅自新增、删除或扭曲目标 skill 的能力。
- **保护触发语义**:`SKILL.md` frontmatter 的 `name` 必须保持不变;`description` 只能等价压缩,不能丢失关键触发条件。
- **保护硬约束**:输入、输出、默认路径、安全限制、必跑脚本、失败条件、与其它 skill 的协作约定都必须保留。
- **只动源工作文件**:忽略目标 skill 的 `tests/`、`plans/` 及其内容,不把它们视为待压缩源文件。
- **默认不动说明文档**:目标 skill 根目录下的 `README.md`、`CHANGELOG.md` 一般属于面向人类的说明或发布记录,不视为默认压缩目标。
- **中间文件隔离**:分析、快照、统计、验证结果都写到隐藏目录 `.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/compact-bensz-skills/`;除非用户另有指定,不向外泄露中间文件。
- **按轮次隔离**:每次运行都应在 `.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/compact-bensz-skills/{yyyy-mm-dd-hh-mm}/` 内工作,避免多次压缩会话互相覆盖。
- **链接不能越界**:压缩后保留的本地 Markdown 链接必须仍位于目标 skill 根目录内,不能借相对路径跳到 skill 外部。

#### 标准工作流

##### 1. 初始化隐藏工作区

优先使用确定性脚本创建工作区、快照和 Markdown 清单:

```bash
python3 compact-bensz-skills/scripts/init_workspace.py --skill-root /path/to/target-skill
```

脚本会:
- 创建 `<skill_root>/.bensz-api/task-{yyyymmdd-hhmm}-{简短描述}/compact-bensz-skills/{yyyy-mm-dd-hh-mm}/`
- 在隐藏根目录写入 `latest-run.txt`
- 扫描待压缩 Markdown(忽略 `tests/`、`plans/`、`README.md`、`CHANGELOG.md`)
- 生成 `analysis/file-inventory.json`
- 备份原文到 `snapshots/before/`
- 生成 `analysis/compaction-plan.md`
- 记录压缩前统计到 `reports/size-before.json`

##### 2. 理解目标 skill 的真实功能

最低阅读范围:
- `SKILL.md`
- `config.yaml`(如存在)
- `scripts/`(如存在)
- `references/` 中与核心流程直接相关的文档
- 仅当 `README.md`、`CHANGELOG.md` 与核心行为边界强相关时才辅助阅读;默认不把它们纳入压缩目标

理解时重点确认:
- 技能触发条件与不适用范围
- 输入输出契约
- 默认工作区 / 测试区 / 中间文件路径
- 安全边界与只读/只写限制
- 任何“必须执行”“不得省略”的步骤

##### 3. 执行 Markdown 压缩

优先顺序:
1. 删重复:移除跨文件、跨章节重复解释
2. 缩长句:把啰嗦描述改成短句、表格或清单
3. 主从分离:`SKILL.md` 只保留触发逻辑、主流程、硬约束;细节下沉到 `references/`
4. 压示例:保留最小可用命令和最关键示例,删除低价值变体

默认优先处理:
- `SKILL.md`
- `references/` 中真正承载执行细则的 Markdown

默认不处理:
- 目标 skill 根目录下的 `README.md`
- 目标 skill 根目录下的 `CHANGELOG.md`

压缩时必须保留:
- `SKILL.md` frontmatter 与关键词可发现性
- 关键命令、路径、文件名、配置键
- 输入/输出、默认目录、安全限制
- 会改变行为的条件分支
- 与 `bensz-collect-bugs` 等跨 skill 约定

压缩时禁止:
- 把“必需”改成“可选”
- 删除失败条件、边界条件、路径约束
- 删除唯一的命令示例或唯一的输出说明
- 只为了省字而制造歧义

##### 4. 复测压缩收益

完成文档修改后重新统计:

```bash
python3 compact-bensz-skills/scripts/measure_markdown.py --skill-root /path/to/target-skill --phase after
```

如需显式复用某一轮:

```bash
python3 compact-bensz-skills/scripts/measure_markdown.py \
  --skill-root /path/to/target-skill \
  --run-id 2026-03-28-15-52 \
  --phase after
```

该脚本会输出:
- `reports/size-after.json`

From huangwb8/skills, MIT.

More from huangwb8/skills

Signals

Stars
50
Forks
8
Open issues
0
Last commit (this folder)
Sep 6, 2026 (2 months ago)
Last release
Oct 17, 2026 (19 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Bensz Conan

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get compact-bensz-skills running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying compact-bensz-skills?

CallGet help
Cite this page

compact-bensz-skills. Agent Mart. https://agentmart.dev/skills/huangwb8-compact-bensz-skills (last updated 2026-10-24)