Agent skill

Trim Comments

by finos in finos/legend-engine

Reviews every comment and Javadoc added by the current branch (vs.

Apache-2.0Auto-check passed

Install Trim Comments

skills CLI
$ npx skills add finos/legend-engine --skill trim-comments -a claude-code

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

GitHub CLI
$ gh skill install finos/legend-engine trim-comments --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/finos/legend-engine.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/pure-dev/skills/trim-comments .claude/skills/trim-comments && 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-comments
GitHub stars
112
Token cost
~1.1k tokens
SKILL.md length
618 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
Apache-2.0

At a glance

Reviews every comment and Javadoc added by the current branch (vs.

  • Works in 3 steps: Determine scope → Review, don't rewrite from scratch → Verify and commit
  • Asked to trim comments
  • SKILL.md covers The bar, 1. Determine scope, 2. Review, don't rewrite from… and 3. Verify and commit
  • Calls git

What it does

Trim Comments is an agent skill from finos/legend-engine. Reviews every comment and Javadoc added by the current branch (vs. its target/default branch) and trims them to intent-only: delete anything that narrates what the code does or rationalises why it was written, keep only the genuine surprise a reader would otherwise 'fix'. Use when asked to 'trim comments', 'clean up comments before pushing', 'make comments intent-focused', or before raising an MR.

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

The licence is Apache-2.0.

When your agent uses it

  • Asked to trim comments
  • Clean up comments before pushing
  • Make comments intent-focused
  • Before raising an MR

Example prompts

  • “. Use when asked to”
  • “clean up comments before pushing”
  • “make comments intent-focused”
  • “/trim-comments”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Determine scope
  2. Review, don't rewrite from scratch
  3. Verify and commit

What it can do on your machine

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

    • git

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Trim Comments loads about 1.1k tokens when it runs. Until then it costs about 104 tokens; SKILL.md has 618 words of instructions outside code blocks.

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

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 finos/legend-engine at commit 00108b7, republished under its Apache-2.0 licence (© finos). 618 words, ~1,125 tokens.

Download SKILL.mdSave it as .claude/skills/trim-comments/SKILL.md (or your agent's skills folder).
name
trim-comments
description
Reviews every comment and Javadoc added by the current branch (vs. its target/default branch) and trims them to intent-only: delete anything that narrates what the code does or rationalises why it was written, keep only the genuine surprise a reader would otherwise 'fix'. Use when asked to 'trim comments', 'clean up comments before pushing', 'make comments intent-focused', or before raising an MR.

Trim comments to intent-only

Scoped to one branch's diff — not a whole-file or whole-repo comment sweep.

The bar

Naming is the documentation. A function name and its body should read better than any comment you could put above them; if they don't, rename or restructure rather than explain. Do not narrate what the code does, and do not rationalise why you wrote it — both restate the code, and both go stale the moment it changes.

A comment earns its place only when the code is genuinely ambiguous, or when it looks like it contradicts the status quo and a reader would otherwise "fix" it:

  • a spec or dialect quirk being worked around,
  • a deliberate deviation from the surrounding pattern,
  • an ordering constraint that isn't visible locally,
  • a link to an issue.

Write the surprise, not the summary.

Tests are not an exception — they are the clearest case. A test's name and its assertions already state the intended behaviour; a comment above them almost always repeats it. Name the test so the comment becomes unnecessary. The only test comment worth keeping is one explaining why an assertion that looks wrong is correct.

Match the surrounding file's comment density. Most functions in this codebase have none.

1. Determine scope

Target branch, in order of preference:

  • args, if the caller passed one explicitly.
  • The branch named in the most recent push-mr.sh ... --target <branch> invocation this session, if visible in context.
  • Otherwise auto-detect: git symbolic-ref refs/remotes/origin/HEAD --short 2>/dev/null (strip the origin/ prefix), falling back to the first of finos-master, master, main that exists as origin/<name>.

Diff range: origin/<target>...HEAD — a merge-base diff, not a two-dot diff, since the branch may be rebased ahead of a stale local tracking ref.

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

2. Review, don't rewrite from scratch

For every file in that diff, look only at added comment and Javadoc lines (lines starting + for a //, /* */, /** */, #, or language equivalent). Pre-existing comments the branch didn't touch are out of scope.

Apply the bar above to each one. Concretely:

  • Delete comments that narrate what the following line or block does — the identifiers should already say that. If they don't, rename instead of commenting.
  • Delete comments that explain history or the current change: "previously X, now Y", "this used to be hardcoded", "added for the Z flow", benchmark numbers quoted only to justify a default. Git already has the history, and the narrative is wrong as soon as the next change lands.
  • Delete comments that rationalise the author's reasoning rather than warn the reader. "We do this because it's cleaner" tells the next person nothing they can act on.
  • Collapse multi-paragraph Javadoc to 1–3 sentences: the contract, plus the one non-obvious constraint. Keep @param/@return/@throws that document a real public API contract, but tighten the text.
  • Keep, tightened to as few clauses as possible, a comment that names a real constraint a reader could not derive locally — why a lock-free path is required, why a flag must be rechecked after registering, why a specific ordering prevents a race. If a reviewer would plausibly flag the code as wrong without the explanation, the explanation earns its place.
  • In tests, prefer renaming the test over keeping the comment. Delete comments restating the arrangement, the action, or the assertion.

Do not touch:

  • License headers.
  • Comments outside the diff's added lines.
  • Any code or logic — this pass is comments and Javadoc only.

3. Verify and commit

  1. Diff this pass's changes against the pre-edit state and confirm every changed line is a comment/Javadoc/whitespace change — no logic diffs. Spot-check a sample.
  2. Commit the trims as their own commit (don't amend an already-pushed commit), e.g. git commit -m "Trim comments to intent-only". If nothing needed trimming, there is nothing to commit — say so and stop.

© finos, Apache-2.0. 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 plugins/pure-dev/skills/trim-comments of finos/legend-engine.

Open the folder on GitHubat commit 00108b7

Compare with similar skills

Trim Comments 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 Comments compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Trim Comments this skillfinos/legend-engine112—~1.1kAutomated safety check: PassApache-2.0
Adscoreyhaines31/marketingskills54k1 repos~7.8kAutomated safety check: PassMIT
Ad Creativecoreyhaines31/marketingskills54k—~6.2kAutomated safety check: PassMIT
Ad Creativenexu-io/open-design100k—~305Automated safety check: PassApache-2.0
Ad Creativealirezarezvani/claude-skills28k1 repos~2.8kAutomated safety check: PassMIT
Ads LaunchAgriciDaniel/claude-ads9.8k—~326Automated safety check: PassMIT

Similar skills

  • Ads

    coreyhaines31/marketingskills

    When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms.

    54k GitHub starsUsed in 1 repo~7.8k tokens
    Marketing & SEOAuto-check passed
  • Ad Creative

    coreyhaines31/marketingskills

    When the user wants to generate, iterate, or scale ad creative — headlines, descriptions, primary text, or full ad variations — for any paid advertising platform.

    54k GitHub stars~6.2k tokensUpdated today
    Marketing & SEOAuto-check passed
  • Ad Creative

    nexu-io/open-design

    Generate and iterate ad creative including headlines, descriptions, and primary text.

    100k GitHub stars~305 tokensUpdated today
    Marketing & SEOAuto-check passed
  • Ad Creative

    alirezarezvani/claude-skills

    When the user needs to generate, iterate, or scale ad creative for paid advertising.

    28k GitHub starsUsed in 1 repo~2.8k tokens
    Marketing & SEOAuto-check passed
  • Ads Launch

    AgriciDaniel/claude-ads

    Draft or explicitly apply a paid-ad campaign launch through Claude Ads capability-gated adapters.

    9.8k GitHub stars~326 tokensUpdated today
    Marketing & SEOAuto-check passed
  • Ads Competitor

    AgriciDaniel/claude-ads

    Research competitor paid-ad presence, messaging, creative, formats, landing pages, keyword and auction signals, transparent ad libraries, and strategic gaps across supported platforms.

    9.8k GitHub stars~311 tokensUpdated today
    Marketing & SEOAuto-check passed

More from finos/legend-engine

All 15 skills in this repo
  • Pure Backend Start

    finos/legend-engine

    Starts (or confirms) the standalone legend-engine backend - engine Server + H2 + local metadata server on fixed ports 9095/9092 - so a Pure LSP started with -Dlegend.test.

    112 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Pure Chain Update

    finos/legend-engine

    Procedure for git-syncing and rebuilding a local legend-pure + legend-engine checkout, in dependency order, with pinned dependency versions resynced.

    112 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Pure Code Style

    finos/legend-engine

    Reformats a .pure file (or a block of Pure code) to a consistent house style: 2-space indentation with no column-aligned hanging indents, tight colons in type annotations, spaced pipes on…

    112 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Pure Lsp Check

    finos/legend-engine

    Compiles/checks a single .pure file against the already-running Legend Pure LSP bridge and reports diagnostics (errors/warnings) in under a second, as a fast alternative to a full mvn test/mvn…

    112 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Pure Lsp Connect

    finos/legend-engine

    Attaches the pure-lsp HTTP bridge to an LSP daemon that is ALREADY running (e.g.

    112 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Pure Lsp Execute

    finos/legend-engine

    Runs exactly ONE existing Pure function by path (signature, mangled id or bare path) through the running Legend Pure LSP bridge, without a go() wrapper, and returns its typed value in returnValue.

    112 GitHub stars~883 tokensUpdated today
    Auto-check passed

Questions about Trim Comments

What does Trim Comments do?

Reviews every comment and Javadoc added by the current branch (vs. Trim Comments is an agent skill from finos/legend-engine. Reviews every comment and Javadoc added by the current branch (vs.

When should I use Trim Comments?

Trim Comments fits situations like: asked to trim comments; clean up comments before pushing; make comments intent-focused; before raising an MR.

How do I install Trim Comments in Claude Code?

Run `npx skills add finos/legend-engine --skill trim-comments -a claude-code`. Or copy the skill folder (plugins/pure-dev/skills/trim-comments in finos/legend-engine) into .claude/skills/trim-comments in your project. Claude Code loads it when a task matches its description.

How do I install Trim Comments in Codex?

Run `npx skills add finos/legend-engine --skill trim-comments -a codex`. Or copy the skill folder (plugins/pure-dev/skills/trim-comments in finos/legend-engine) into .agents/skills/trim-comments in your project. Codex loads it when a task matches its description.

Can I use Trim Comments 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 finos/legend-engine --skill trim-comments -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-comments, .gemini/skills/trim-comments, .github/skills/trim-comments and .opencode/skills/trim-comments in your project.

What does Trim Comments need to run?

Going by SKILL.md and its folder, Trim Comments needs the command-line tools its instructions call (git).

Does Trim Comments access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

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

Trim Comments is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Trim Comments use?

About 1.1k tokens (SKILL.md is roughly 4.5k 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 Comments?

Skills that share tags, products or a category with Trim Comments: Ads (coreyhaines31/marketingskills, 54k stars), Ad Creative (coreyhaines31/marketingskills, 54k stars), Ad Creative (nexu-io/open-design, 100k stars) and Ad Creative (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Trim Comments?

finos (a GitHub organization) maintains it in finos/legend-engine, which has 112 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 7, 2026.

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