一键导入
trim-md
Trim markdown for LLM consumption — remove token waste, normalize structure
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Trim markdown for LLM consumption — remove token waste, normalize structure
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when checking Paperclip org health, reviewing agent efficiency, diagnosing token waste, verifying governance compliance, or before and after making org changes. Also use when agents seem idle or unproductive, costs spike, tasks stall, heartbeats fail silently, you see 409 conflicts, stale locks, blocked deadlocks, or suspect agents burning tokens with no progress.
This skill should be used when the user asks to "show dev-setup config", "change the worktrees directory", "update the port pattern", "configure dev-setup settings", or wants to view or update settings in .claude/dev-setup.json.
Generate dev server lifecycle scripts (start/stop/status/ports) from detected project structure
This skill should be used when the user asks to "create a worktree", "set up an isolated workspace", "create a branch for a feature", "start working on a new branch", or before executing an implementation plan that needs an isolated git workspace.
Scan a codebase and auto-generate relevant diagrams from its structure
Generate a D2 diagram from a text description
| name | trim-md |
| description | Trim markdown for LLM consumption — remove token waste, normalize structure |
User request: "$ARGUMENTS"
Trim and optimize markdown files for LLM/agent consumption. Run the trim-md script on the given paths, then present the output.
Files containing <!-- trim-md:disable --> on its own line are excluded. The comment must be a standalone line — inline mentions in prose or code blocks are ignored.
SKILL_DIR="$(find "$HOME/.claude/plugins/cache" -type d -name "trim-md" -path "*/skills/trim-md" 2>/dev/null | head -1)"
[[ -z "$SKILL_DIR" ]] && SKILL_DIR="$(find "$HOME" -maxdepth 8 -type d -name "trim-md" -path "*/skills/trim-md" 2>/dev/null | head -1)"
echo "SKILL_DIR=$SKILL_DIR"
If SKILL_DIR is empty, stop with: "Could not locate the trim-md skill directory. Ensure the plugin is installed."
bash "$SKILL_DIR/scripts/ensure-deps.sh"
If the script exits with an error, show the missing dependency message to the user and stop.
Parse $ARGUMENTS for paths and the dry-run flag.
Dry-run detection: If $ARGUMENTS contains any of these tokens (case-insensitive): dry, dry-run, --dry-run, dryrun — pass --dry-run to the script. Remove the token from the path list.
Remaining arguments are the target paths. If no paths remain, use . (current directory).
bash "$SKILL_DIR/scripts/trim-md.sh" [--dry-run] <paths>
Show the script output to the user as-is. No additional commentary needed unless there were errors.