一键导入
squid-clean-harness
Shrink an agent harness (.agents/ skills + resources) to the minimum tokens that keep the exact same logic. Never touches resources/datasets/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Shrink an agent harness (.agents/ skills + resources) to the minimum tokens that keep the exact same logic. Never touches resources/datasets/.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Bootstrap a new repo or component from the opinionated spec library (mode=create), or audit an existing scaffolded repo for drift against the scaffold rules (mode=evaluate, report-only).
Periodic architectural sweep — reads existing ADRs, maps modules/dependencies/layering, and reports up to 10 prioritised findings shaped as refactor proposals `/squid-refactor` can consume directly.
Plan a refactor as an ordered, commit-grain Tasks Plan with structural acceptance criteria (suite green at every step, no behaviour diff) that `/squid-implement-night` can execute end-to-end.
Bug intake — localise the suspected code, capture a deterministic reproducer, and emit a groomed bug task with a regression-test acceptance criterion, ready for /squid-implement-task or the full pipeline.
Run the full agent-team pipeline end-to-end for one feature whose Tasks Plan is already approved by /squid-plan, handing the human a validated, ready-to-squash-merge PR. Trigger after /squid-plan, or when the user says "/squid-implement-night".
Implement one task — or a whole list / an approved Tasks Plan — via the inner SWE↔Tester loop, committing each task on PASS. Use when one or more GROOMED tasks are ready to build, or the user says "/squid-implement-task". To plan a feature first use /squid-plan; for the full end-to-end pipeline use /squid-implement-night.
| name | squid-clean-harness |
| disable-model-invocation | true |
| argument-hint | [.agents-path] (default: ./.agents) |
| description | Shrink an agent harness (.agents/ skills + resources) to the minimum tokens that keep the exact same logic. Never touches resources/datasets/. |
You are the cleaner. You shrink the skills and resources a harness loads; you do not change what they make the agent do. Zero logic diff is the contract — every capability, step, and rule that holds before must hold after; only tokens die.
Output is a plan table, approved by the user, then applied as one commit per category.
$ARGUMENTS is an optional .agents/ path (e.g. ~/Vaults/Second-Brain/.agents). Empty means the
repo's ./.agents.
| Excluded | Why |
|---|---|
resources/datasets/ | Data the skills operate on, not logic. Never in scope. |
Memory files (AGENTS.md, CLAUDE.md) | → /squid-clean-memory. |
| Docs, READMEs, comments, docstrings | → /squid-clean-docs. |
| Skill names and argument shapes | The name is the API — a rename is an edit, not a cleanup. |
Inventory skills/*/SKILL.md and resources/** minus resources/datasets/ under the target
.agents/. Everything must be revertible: clean in git, or snapshot first
(cp -R .agents .agents.bak) when the tree isn't tracked.
Two questions per skill:
disable-model-invocation: true, keeping its description out of the always-loaded skill list.
Flipping also cuts reach from other skills — grep the set for the skill's name first (Step 4's
proof); one referrer means it stays model-invoked.Done only when every skill in the set has both answers recorded — no sampling.
An instruction survives only if deleting it would change what the agent does. The cuts apply to
every file in the set — skill bodies and resources/ docs alike, datasets/ never. Five cuts:
Duplicates — the same rule twice in one skill, repeated across skills, or restating a
resources/ doc the skill already points at (a skill body repeating glossary.md definitions) —
the resource is the home, the skill keeps the pointer. Two resources repeating each other collapse
to one home the same way, as does a block ≥2 skills share — Disclosure below says where it goes.
Baked-in claims — would the agent already behave this way with the line deleted (harness default,
system-prompt rule)? Dead weight. "Read the file before editing it" dies; "write posts in the voice
defined in resources/branding/" stays. The test is harness-relative — .agents/ serves non-Claude
agents too: delete only defaults universal to whatever loads the skill; flag the Claude Code-specific
ones. Test sentence by sentence; a failing sentence dies whole — never trim words from it.
Verbose logic — the exact same logic in the minimum words: collapse restatements, prefer a table
row to a paragraph, caveman-terse wording. Collapse a restated quality into one pretrained leading
word ("fast, deterministic, low-overhead" → a tight loop) — fewer tokens and a sharper hook. If
the caveman plugin is installed, /caveman-compress per file is a good first draft — re-check
afterwards that the frontmatter is still parseable YAML.
Merges — steps or sections nobody reads apart become one; reorder so each idea appears once, at the point the agent needs it.
Disclosure — a skill body is paid for on every invocation, including the branches that never
read it. Inline what every branch needs; push what only some branches reach — a lookup table, a
per-platform appendix, a rare edge-case procedure — into a resources/ doc loaded on demand. Same
home for a block ≥2 skills share. Size decides: ~20+ lines earns its own file, below that
indirection costs a Read for less than it saves. Per-invocation tokens fall even when total words
don't. The pointer's wording, not its target, decides whether the agent reaches the material — say
when to load it, not just where it lives ("for the Slack variants, read platforms.md", not "see
platforms.md"). Theory: /squid-write-skill.
Done only when every file in the set is read whole and judged against all five cuts.
A reference, script, agent, or resources/ doc is dead only with zero references outside its
own definition:
grep -rn "helper.py" <harness-root> <project-root> # prove it, don't assume
.agents/
(cron, vault automation) is invisible to grep — when unsure, flag, never auto-delete.Done only when every artifact is proven dead, alive, or flagged.
Print one table in chat. Do not write it to disk unless the user asks.
| File | Cut (Step 2–4) | Why | ~Words |
|---|---|---|---|
skills/search/SKILL.md | frontmatter | user-only; trigger prose serves no router | −130 |
skills/post/ ∩ skills/thread/ | duplicate | shared hook rules → one home in resources/ | −200 |
skills/article/SKILL.md | verbose | Step 2 restated three ways | −90 |
skills/publish/SKILL.md | disclosure | per-platform appendix; 1 of 4 branches | −240 |
resources/glossary.md | verbose | each term defined twice, prose + table | −150 |
Stop and wait for explicit approval. Do not edit before it.
Apply the approved plan, one commit per category (frontmatter, cuts, dangling) so any revert is
surgical.
Logic must be provably unchanged before hand-off:
SKILL.md frontmatter still parses as YAML with name + description — unparseable YAML
loads the skill with every field silently dropped.Anything off: revert that commit (or restore the snapshot), do not "fix forward".
Report wc -w before → after per file, what moved into resources/, and every flagged dangling
item. Point the user at /squid-write-skill for flagged items that need rewriting rather than
cutting — an edit is theirs to make, and only they can invoke it.
resources/; skills reference, never transclude.resources/datasets/ is what skills operate on, not how they work — never
in scope.