Agent skill

Trim

by tola-rs in tola-rs/tola-ssg

Shrink code, tests, comments, and docs to what carries meaning — delete dead paths, redundant states, and refactor-dragging tests outright, then hold the survivors to the four bars.

MITAuto-check passedDevelopment

Install Trim

skills CLI
$ npx skills add tola-rs/tola-ssg --skill trim -a claude-code

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

GitHub CLI
$ gh skill install tola-rs/tola-ssg trim --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/tola-rs/tola-ssg.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/trim .claude/skills/trim && 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
trim
GitHub stars
178
Token cost
~2.9k tokens
SKILL.md length
1,538 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Shrink code, tests, comments, and docs to what carries meaning — delete dead paths, redundant states, and refactor-dragging tests outright, then hold the survivors to the four bars.

  • Reducing a change
  • SKILL.md covers The four bars, Code, Remove or consolidate and Name the one behaviour, plus 6 more sections
  • Calls just
  • Deleting a test

What it does

Trim is an agent skill from tola-rs/tola-ssg. Shrink code, tests, comments, and docs to what carries meaning — delete dead paths, redundant states, and refactor-dragging tests outright, then hold the survivors to the four bars. Use when reducing a change, a file, or a suite; before adding, changing, renaming, consolidating, or deleting a test; and when reviewing a diff for concision, clarity, rigor, and correctness.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: opencode

It sits in Development, covering Refactoring. The repository describes itself as: SSG for typst-based websites - keep your focus on the content. The licence is MIT.

When your agent uses it

  • Reducing a change
  • Deleting a test
  • When reviewing a diff for concision

Example prompts

  • “/trim”

Requirements

  • Compatibility (from SKILL.md): opencode

What it can do on your machine

Read from SKILL.md and the folder at commit fbb0506. 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

    Shell commands in SKILL.md call:

    • just

    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.

  • Compatibility

    opencode

    From compatibility in the SKILL.md frontmatter.

Context cost

Trim loads about 2.9k tokens when it runs. Until then it costs about 95 tokens; SKILL.md has 1,538 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~95
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from tola-rs/tola-ssg at commit fbb0506, republished under its MIT licence (© tola-rs). 1,538 words, ~2,903 tokens.

Download SKILL.mdSave it as .claude/skills/trim/SKILL.md (or your agent's skills folder).
name
trim
description
Shrink code, tests, comments, and docs to what carries meaning — delete dead paths, redundant states, and refactor-dragging tests outright, then hold the survivors to the four bars. Use when reducing a change, a file, or a suite; before adding, changing, renaming, consolidating, or deleting a test; and when reviewing a diff for concision, clarity, rigor, and correctness.
compatibility
opencode
metadata.scope
target-project
metadata.workflow
scope-identify-remove-extract-run-report

Trim

Delete by default; keep only what a reader of the site, a caller of the API, or the next maintainer would notice go missing. Losing coverage is fine when cost > value — a test that drags refactors, restates the implementation, or pins rendered output has already cost more than it protects the moment you read it. The bar is the same for code: a path, state, wrapper, or abstraction nobody's contract needs is weight the change added, not a safeguard.

Scope: user-provided; none → files touched on this branch; else the whole suite or subsystem.

The four bars

Every survivor — a function, a name, a comment, a diagnostic, a test — passes all four:

  • concise — as short as the thing allows: a failure line's worth, a sentence the author cannot shorten.
  • clear — one meaning, in the vocabulary the reader already holds.
  • rigorous — no mechanism, helper, count, hedge, or article filling space.
  • correct — states what the value is or does, and stays true after the next refactor.

Text a human reads — a diagnostic, a comment, a report — also reads friendly: skill://friendly-report.

Code

Delete on sight, in the change that exposes it:

  • dead paths and redundant states the change revealed;
  • obsolete indirection, and pass-through wrappers whose only remaining purpose is historical layering;
  • the optional field, feature flag, fallback, retry, second entry point, or abstraction for a call site that has not arrived;
  • a repeated check, defensive fallback, or error variant nothing produces — validate once, at the boundary that owns the invariant, and let every consumer downstream trust the type;
  • a second representation of one concept; a derived view needs an owner and an invalidation rule, or it goes.

Prefer one authoritative path over old/new, fast/slow, cached/uncached, compatibility forks claiming the same semantics; encode the real valid states instead of a boolean combination plus optional fields. Keep performance work subordinate to semantic equivalence and measurable ownership.

Remove or consolidate

Remove on sight, without waiting for the suite to break:

  • refactor drag — every design change moves it; the behaviour it pins is nobody's contract
  • brittle — exact formatting, rendered wording, markdown or link syntax, hashes, timing
  • redundant — same behaviour covered elsewhere → one table-driven test
  • trivial assertions, no real logic
  • mock-heavy, never hit code under test
  • one behaviour split across siblings each re-running same setup → one test or one table
  • several clauses of one behaviour welded into one test whose name needs "and" twice → clauses that matter, or nothing

An unclear owner is a delete: a test re-added after a real regression earns its place; one kept out of inertia never will.

Consolidation keeps each block's isolation: two tests each owning temp dir/config/input → merged body gives each its own. Shared temp root ⇒ second block fails "already exists" or silently asserts first block's state. Move assertions, never ownership.

Extract copy-paste setup into shared helpers where it pays off.

Deleting a test can orphan a helper, constant, or import → remove those with it. Worse reverse: NEVER delete a use because the file "looks self-contained" — traits arrive only through imports, dependent code looks fine until it runs. Before deleting an import, check every symbol it named for remaining refs.

Name the one behaviour

Test name = identifier for the one behaviour the test proves, not a sentence describing the code it runs.

Write the name before the body — it is the contract the body MUST prove; a name formed after the input describes whatever the input did. Holds for tests added mid-other-work: a feature's own new tests are not exempt.

  • No scaffolding prefixes: NEVER a_, an_, the_, test_, it_, should_, when_, letters, or order-marking numbers. Test order is not a contract; a name opening like a sentence describes the case, not the behaviour.
  • No filler article, leading or mid-name: a/an are prose an identifier drops — failed_command_reports_bounded_output not a_failed_command_reports_bounded_output_from_both_streams; absent_variant_misses not absent_variant_is_a_miss. the only where the verb acts on one specific thing (auto_encoding_follows_the_source).
  • One clause. and/or join two values of one domain — query_and_fragment_are_refused, base_href_decides_internal_or_external — NEVER two behaviours. A second connective, a connective introducing an article (..._or_a_background), or but is refused. A name welding two clauses (segment_settles_or_retracts) splits into two tests or drops the irrelevant clause.
  • State the observable result, not the mechanism: missing_package_names_each_directory not checks_package_resolution_tiers.
  • Short enough to read in a failure line: aim 3–5 words. Ceiling 56 chars — the longest the suite carries today; just scripts::test-names refuses longer.
  • Do not encode the body: no helper names, byte counts, file paths, or verdict endings (works, succeeds, is_ok, is_handled, passes, functions); no hedge in the outcome's place (correctly, properly, successfully, as_expected, fine, valid). handles/behaves stand in for an unstated behaviour; one word (parses) names a topic.
  • Rename every test you touch or review that violates this, even if the test stays.

Naming also shrinks the suite. Open the body before renaming: what does this test fail on that no sibling fails on? Sibling already fails on it → merge (one setup, surviving assertions, one name for what the merged test proves). Nothing fails on it → delete. Then cut the name to the shortest form still stating what the body proves, dropping qualifiers it never checks; a name shortened by losing a checked behaviour was cut wrong. Search the suite for the words the name carries before writing a new one.

Shortening the suite's longest name lowers the ceiling: 56 is what the suite carries today, not a budget to spend.

Show full SKILL.md (653 more words)Show less

Gate: audit every test name you write, before you report

Rules are not advice against finishing sooner: a name breaking them is unfinished work; shipping one is the failure this gate stops. Audit every file whose tests you added, changed, or reviewed before reporting anything:

sh
just scripts::test-names

Recipe is part of just check ⇒ a forbidden name fails the workspace gate, not a reviewer. Reads every test function the workspace declares (whichever attribute declares it) + case titles of e2e, VS Code, maintenance suites; a declaration it cannot read fails the gate rather than going unjudged.

Every hit is a rename you owe here, not a note for later. A case the audit keeps: file the name under the shape it broke in scripts/test-names.test.ts; add the shape to scripts/test-names.ts when no rule caught it. Then grep the identifier ban no test name carries:

sh
grep -rniE 'fixture|probe' --include='*.rs' --include='*.ts' <the files you touched>

Every hit = a type, function, or variable named after the technique that builds it → a rename you owe here. Then read the names the audit cannot judge — length, one clause, observable result, domain's words — and rename those too. Report audit output + renames together; "the tests pass" says nothing about whether names are finished.

Sweep the suite for names

A name defect is cheap to see, invisible to whoever opens only the files a change touched ⇒ sweep the suite before reporting the trim. Scope decides which tests you change; it never narrows this read. just scripts::test-names carries these patterns; each names a shape no correct test name has:

  • article or scaffold prefix — ^\s*(async )?fn (a|an|the|test|it|should|when)_
  • case position — ^\s*(async )?fn [a-z]_(first|second|third|fourth|fifth|last|next|other|another)_. A bare letter is not one: b_tree_splits_at_the_middle and k_means_clusters_points name their algorithm
  • connective chain — two connectives in one name, (?:_(and|or|but)_[a-z0-9_]*){2}
  • connective prose — connective introducing an article or then, or but: _(and|or)_(a|an|the|its|their|they|it|this|that|then)_, _but_
  • dangling article — _(a|an|the)$: article where a value belongs
  • indefinite article — _(a|an)_: a/an mark prose an identifier does not carry (absent_variant_misses not absent_variant_is_a_miss); the stays where it names the object the verb acts on (follows_the_source)
  • bare verdict — _(works|succeeds|is_ok|is_handled|passes|functions)$
  • hedge — _(correctly|properly|successfully|gracefully|cleanly|smoothly|as_expected|as_intended|fine|good|ok|valid)$
  • generic verb — (^|_)(handles|behaves|does_the_right_thing)$
  • single word — ^[a-z0-9]+$: a topic, not a behaviour
  • order marker — _\d+$, _part_\d+$
  • placeholder word — (^|_)(fixture|probe)(_|$) in a test name
  • ceiling — fn [a-z0-9_]{57,}\(: report it; rename one only when already in that file

Report the counts. A rename outside the files this change owns is separate scope: list old → new pairs, then wait for approval.

first_, second_, _2 break the rule only when marking test order. Correct when naming a real domain pair — two resampling passes (first_pass_window, second_axis), the earliest of several candidates (tree_conflict_names_first_foreign_owner) ⇒ read the body before renaming one.

fixture/probe are not identifiers: NEVER a type, function, variable, constant, module, or field. Name a helper for the value it returns (html_page, asset_route), not the technique that builds it; #[cfg(test)] already says where the code lives, so test_ there is a placeholder noun too.

A sentence title — test('vendor freezes a package for a pure build') in the maintenance suite — is prose, not an identifier: article, connector, ceiling rules do not reach it; the shapes above still do — scaffold prefix, bare verdict, hedge, placeholder word, single word. One-behaviour and observable-result rules reach a title by reading, not pattern.

Renames

Renames follow skill://naming; in a test they reach the input, its reads and writes, and expected values in assertions.

Comments

Comment rules: skill://comments; read before adding, merging, or keeping one.

Beside other agents

Working beside another agent — one owner per file, staying in your slice, collisions — is skill://scope-discipline; read before a shared-tree run.

Then

Run the changed tests and make them pass. A trimmed suite never executed is unverified: if the workspace cannot build, say which command you could not run and which merges/renames that leaves unproven — do not report the pass as complete.

Verify by search, not memory: grep case-insensitively for the old name/retired word across every path you touched; report the count. Zero, except spellings you deliberately kept — say why each stays.

Summarise what was dropped/consolidated and any coverage intentionally given up.

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

Files

Just SKILL.md in .agents/skills/trim of tola-rs/tola-ssg.

Open the folder on GitHubat commit fbb0506

Compare with similar skills

Trim 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.

Trim compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Trim this skilltola-rs/tola-ssg178—~2.9kAutomated safety check: PassMIT
Component Refactoringlangflow-ai/langflow155k—~3.5kAutomated safety check: PassMIT
Component RefactoringPageAI-Pro/ralph-loop315—~1.8kAutomated safety check: PassMIT
Expertreviewjtenniswood/esphome-media-player234—~1.9kAutomated safety check: PassCustom licence
Code Review And Qualityhylarucoder/hai-stack386—~934Automated safety check: PassMIT
Saleor App UIsaleor/apps162—~5.8kAutomated safety check: PassCustom licence

Similar skills

  • Component Refactoring

    langflow-ai/langflow

    Refactor high-complexity React components in Langflow frontend.

    155k GitHub stars~3.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Component Refactoring

    PageAI-Pro/ralph-loop

    Refactor high-complexity React components in frontend. An agent skill from PageAI-Pro/ralph-loop.

    315 GitHub stars~1.8k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Expertreview

    jtenniswood/esphome-media-player

    Provide an expert codebase review for this repository. An agent skill from jtenniswood/esphome-media-player.

    234 GitHub stars~1.9k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Code Review And Quality

    hylarucoder/hai-stack

    Reviews a code change for correctness, security, maintainability, architecture, performance, and verification gaps, or performs a local code-smell review.

    386 GitHub stars~934 tokensUpdated 5 days ago
    DevelopmentAuto-check passed
  • Saleor App UI

    saleor/apps

    Styling and layout guide for Saleor Apps using modern macaw-ui and @saleor/apps-ui-next.

    162 GitHub stars~5.8k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Proves that a refactor leaves every rendered preview page unchanged by comparing fresh HTML output against a baseline captured beforehand.

    42k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed

More from tola-rs/tola-ssg

All 10 skills in this repo
  • Tola

    tola-rs/tola-ssg

    Build and maintain Tola websites and documentation. An agent skill from tola-rs/tola-ssg.

    178 GitHub stars~6k tokensUpdated yesterday
    Auto-check passed
  • Concurrency And Failure

    tola-rs/tola-ssg

    Design and review work that runs concurrently, waits, retries, or owns resources.

    178 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Friendly Report

    tola-rs/tola-ssg

    Report progress to the human. An agent skill from tola-rs/tola-ssg.

    178 GitHub stars~634 tokensUpdated yesterday
    Auto-check passed
  • Refactoring

    tola-rs/tola-ssg

    Restructure code while keeping observable behavior identical, and prove it with difference testing.

    178 GitHub stars~659 tokensUpdated yesterday
    Auto-check passed
  • Subagent Delegation

    tola-rs/tola-ssg

    Run work through subagents instead of the main thread. An agent skill from tola-rs/tola-ssg.

    178 GitHub stars~924 tokensUpdated yesterday
    Auto-check passed
  • Scope Discipline

    tola-rs/tola-ssg

    Keep a change inside its requested scope. An agent skill from tola-rs/tola-ssg.

    178 GitHub stars~478 tokensUpdated yesterday
    Auto-check passed

Questions about Trim

What does Trim do?

Shrink code, tests, comments, and docs to what carries meaning — delete dead paths, redundant states, and refactor-dragging tests outright, then hold the survivors to the four bars. Trim is an agent skill from tola-rs/tola-ssg. Shrink code, tests, comments, and docs to what carries meaning — delete dead paths, redundant states, and refactor-dragging tests outright, then hold the survivors to the four bars.

When should I use Trim?

Trim fits situations like: reducing a change; deleting a test; when reviewing a diff for concision.

How do I install Trim in Claude Code?

Run `npx skills add tola-rs/tola-ssg --skill trim -a claude-code`. Or copy the skill folder (.agents/skills/trim in tola-rs/tola-ssg) into .claude/skills/trim in your project. Claude Code loads it when a task matches its description.

How do I install Trim in Codex?

Run `npx skills add tola-rs/tola-ssg --skill trim -a codex`. Or copy the skill folder (.agents/skills/trim in tola-rs/tola-ssg) into .agents/skills/trim in your project. Codex loads it when a task matches its description.

Can I use Trim 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 tola-rs/tola-ssg --skill trim -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/trim, .gemini/skills/trim, .github/skills/trim and .opencode/skills/trim in your project.

What does Trim need to run?

Going by SKILL.md and its folder, Trim needs the command-line tools its instructions call (just). Compatibility (from SKILL.md): opencode.

Does Trim 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 Trim 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. Review the folder before installing.

What licence does Trim use?

Trim 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 Trim use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Trim?

Skills that share tags, products or a category with Trim: Component Refactoring (langflow-ai/langflow, 155k stars), Component Refactoring (PageAI-Pro/ralph-loop, 315 stars), Expertreview (jtenniswood/esphome-media-player, 234 stars) and Code Review And Quality (hylarucoder/hai-stack, 386 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Trim?

tola-rs (a GitHub organization) maintains it in tola-rs/tola-ssg, which has 178 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 9, 2026.

Source: tola-rs/tola-ssg on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.