Agent skill

Code Clean

by termio-sh in termio-sh/termio

Cut dead code and over-long comments from termio's Swift, verifying every deletion against a build.

MITAuto-check passedMobile

Install Code Clean

skills CLI
$ npx skills add termio-sh/termio --skill code-clean -a claude-code

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

GitHub CLI
$ gh skill install termio-sh/termio code-clean --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/termio-sh/termio.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/code-clean .claude/skills/code-clean && 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
code-clean
GitHub stars
540
Token cost
~1.7k tokens
SKILL.md length
884 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Cut dead code and over-long comments from termio's Swift, verifying every deletion against a build.

  • Works in 3 steps: Dead code → Over-long comments → Verify
  • Says clean dead code
  • SKILL.md covers Scope, 1. Dead code, 2. Over-long comments and 3. Verify, plus 1 more section
  • Calls swift and git

What it does

Code Clean is an agent skill from termio-sh/termio. Cut dead code and over-long comments from termio's Swift, verifying every deletion against a build. Knows this repo's real failure mode (essay-length doc comments, not restated-code slop) and periphery's four known false-positive shapes. Invoke when the user says 'clean dead code', 'clean up the comments', 'the comments are too long', 'remove unused code', 'tighten this file', '清理死代码', '注释太啰嗦', '精简一下注释'.

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

It sits in Mobile, covering iOS development. It works with iOS. The repository describes itself as: A terminal-first agentic development environment for agentic coding. Build for CLI/TUI agent. Runtime for Coding Agent, Tmux alternative. The licence is MIT.

When your agent uses it

  • Says clean dead code
  • Clean up the comments
  • The comments are too long
  • Remove unused code

Example prompts

  • “s Swift, verifying every deletion against a build. Knows this repo”
  • “s four known false-positive shapes. Invoke when the user says”
  • “clean up the comments”
  • “/code-clean”

Workflow steps

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

  1. Dead code
  2. Over-long comments
  3. Verify

What it can do on your machine

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

    • swift
    • 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

Code Clean loads about 1.7k tokens when it runs. Until then it costs about 105 tokens; SKILL.md has 884 words of instructions outside code blocks.

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

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 termio-sh/termio at commit 1a47d10, republished under its MIT licence (© termio-sh). 884 words, ~1,695 tokens.

Download SKILL.mdSave it as .claude/skills/code-clean/SKILL.md (or your agent's skills folder).
name
code-clean
description
Cut dead code and over-long comments from termio's Swift, verifying every deletion against a build. Knows this repo's real failure mode (essay-length doc comments, not restated-code slop) and periphery's four known false-positive shapes. Invoke when the user says 'clean dead code', 'clean up the comments', 'the comments are too long', 'remove unused code', 'tighten this file', '清理死代码', '注释太啰嗦', '精简一下注释'.

Code Clean

Two passes over termio's Swift: dead code (symbols nothing reaches) and over-long comments (prose that outgrew what it explains). Both end in a build. Neither is a refactor.

This is not a generic AI-slop sweep. Run one on this repo and it finds nothing: a 2026-08 survey of all 69k tracked Swift lines turned up 1 TODO (a false match on an mktemp template), 0 commented-out code blocks, and 1 deliberate debug print. Don't spend the pass hunting those. The bloat here is shaped differently, and §2 is where it lives.

Scope

Default to the current branch's diff against origin/main. A whole-tree pass is a standing request only — say so, and expect it to take real time.

Never touch:

  • Sources/termio/Editor/Highlightr/ — vendored; upstream API surface is kept intact on purpose (AGENTS.md).
  • Anything under skills/ recorded in skills-lock.json — re-pull from upstream instead of hand-editing.
  • ios/build/, ios/build-sim/ — Xcode artifacts, not tracked source. They hold ~100k lines of SPM checkouts that will swamp any tree-wide grep. Scope greps with git ls-files, never bare find ios.

1. Dead code

periphery scan --targets termio (SPM; no config file needed). It is installed at /opt/homebrew/bin/periphery.

Roughly three of every four hits are false. Four shapes account for nearly all of them — clear each before deleting anything:

  1. Retain-holders. private var toolbarDelegate / menuBar / hookListener / linkClickMonitor / scanTask / stream / source / window. Flagged assignOnlyProperty, but holding the reference is the job — drop the property and the object deallocates and the feature dies. App.swift says so in comments ("must be retained").
  2. Equatable / Hashable key-struct fields. Read only through the synthesized == / hash(into:), which periphery cannot see. BranchModel's GitState spells out why its field exists: so a same-HEAD refresh is recognized as a no-op.
  3. @objc selector-target sender: parameters. The AppKit selector signature requires them.
  4. Vendored code. See Scope.

Two more that are unused and must stay:

  • Documented extension points — the IssueProvider protocol is unused as a type but is the seam for Linear (docs/design/issue-tracker-integration.md).
  • Persisted fields — Session.createdAt is unread but lives in the state file. Deleting it is a schema change, not a cleanup.

Real finds cluster in fetch-and-cache paths whose views were never wired and utilities orphaned when their UI was removed. Before deleting, grep the symbol across Sources, Shared, ios/Sources, Tests, and scripts/. If only a test references it, the test is holding a corpse upright — delete both.

2. Over-long comments

The repo's actual bloat. Of 3,293 doc-comment blocks in Sources + Shared, 81% are 1–5 lines and healthy. The tail is not: 636 blocks run 6+ lines, 151 run 12+, and the longest is 44 lines — a design doc wearing a function header.

Find them:

sh
git ls-files 'Sources/*.swift' 'Shared/*.swift' 'ios/Sources/*.swift' | xargs awk '
  /^[[:space:]]*\/\/\//{if(n==0)start=FNR; n++; next}
  {if(n>=12){print n" "FILENAME":"start}; n=0}
  END{if(n>=12)print n" "FILENAME":"start}' | sort -rn
The test that matters

AGENTS.md says comments explain why, not what. These comments already do — that is exactly the trap. Length is not the defect; misfiling is. A 20-line block is wrong not because it is long but because a field's doc comment is the wrong home for a design argument.

Sort every long block into three piles:

  • Keep, verbatim. A foot-gun, an invariant, or a past bug that will be reintroduced without it. Workspace.isAutoCreated's note on why Bool? has three states, not two, is load-bearing: collapsing it to false is what made an earlier version wrong. Length is irrelevant here. Leave it.
  • Move to docs/design/, leave a one-line pointer. Architecture, alternatives considered, upstream asks, competitor comparisons. The 44-line block on makeStatusTap is three paragraphs of model plus a caveat with an upstream ask — that is a design doc. Use the doc skill to create or extend it, then leave /// … see docs/design/<file>.md. Move, never delete.
  • Cut. Restating the signature, narrating the body line by line, hedging ("this should probably"), and prose that repeats the paragraph above it.
Show full SKILL.md (269 more words)Show less
Tautological one-liners

~130 docs open /// Whether the … and many just respell the property name:

swift
/// Whether the "Projects" section is folded shut.
var isProjectsCollapsed: Bool

Delete that. But /// Whether the machine answered at all. false is what turns every agent row … earns its line — it says what the value causes. Read each one; do not pattern-match the opener.

Ceilings, once a block is in the "cut" pile

One line is the target. Three is the ceiling for a field or inline comment, five for a type or function. A block that cannot fit belongs in docs/design/.

Leave alone
  • // MARK: — all 602 of them. They are navigation, not narration, and they are spread thin (12 in the heaviest file). AGENTS.md's ban on "organizational comments" is about prose headers that summarize what the next block does.
  • Comments on code this branch did not touch, in a diff-scoped run.
  • An outdated comment: fix it, don't reword it to match wrong code. If the code is what's wrong, report that separately — it is a bug, not a comment.

3. Verify

sh
swift build          # required, every time
swift test           # if anything under a covered unit moved

Covered units: split-tree layout, OSC parsing, stall probing, Markdown/HTML rendering, git service, editor text, install feedback.

A comment pass that changes no code still needs swift build — a deleted line inside a multi-line string or a stray /// before an attribute breaks the parse.

Report

Per file: what was cut, what moved to docs/design/, and what was flagged but kept and why. Name the periphery hits you rejected and which of the four shapes each was — that list is how the next run gets faster.

Do not report a line count as the result. "Cut 400 lines" says nothing about whether the right 400 went.

© termio-sh, 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 skills/code-clean of termio-sh/termio.

Open the folder on GitHubat commit 1a47d10

Compare with similar skills

Code Clean 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.

Code Clean compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Clean this skilltermio-sh/termio540—~1.7kAutomated safety check: PassMIT
Hig Project Contextraintree-technology/hig-doctor1425 repos~1.2kAutomated safety check: PassMIT
Hig Components Contentraintree-technology/hig-doctor1425 repos~1.3kAutomated safety check: PassMIT
iOS Simulator Skilln0an/VivaDicta1261 repos~2.5kAutomated safety check: PassMIT
Inspector Implementationipedro/Inspector170—~729Automated safety check: PassMIT
Device InteractionInfomaniak/desktop-kDrive1201 repos~1.9kAutomated safety check: PassGPL-3.0

Similar skills

  • Hig Project Context

    raintree-technology/hig-doctor

    Create or update a shared Apple design context document that other HIG skills use to tailor guidance.

    142 GitHub starsUsed in 5 repos~1.2k tokens
    MobileAuto-check passed
  • Hig Components Content

    raintree-technology/hig-doctor

    Apple Human Interface Guidelines for content display components.

    142 GitHub starsUsed in 5 repos~1.3k tokens
    MobileAuto-check passed
  • iOS Simulator Skill

    n0an/VivaDicta

    21 production-ready scripts for iOS app testing, building, and automation.

    126 GitHub starsUsed in 1 repo~2.5k tokens
    MobileAuto-check passed
  • Inspector Implementation

    ipedro/Inspector

    A skill your agent uses when an agent needs to implement or modify the Inspector library itself — panel UI, hierarchy/runtime behavior, custom property models, macros, or Example-app dogfooding.

    170 GitHub stars~729 tokensUpdated 5 mo ago
    MobileAuto-check passed
  • Device Interaction

    Infomaniak/desktop-kDrive

    Verify iOS app behavior on device or simulator via screenshots, UI hierarchy, and touch interactions.

    120 GitHub starsUsed in 1 repo~1.9k tokens
    MobileAuto-check passed
  • Run iOS Simulator

    iPlug2/iPlug2OOS

    Build and run an iPlug2 iOS app in the iOS Simulator. An agent skill from iPlug2/iPlug2OOS.

    158 GitHub stars~711 tokensUpdated 22 days ago
    MobileAuto-check passed

More from termio-sh/termio

All 19 skills in this repo
  • Termio Bug Report

    termio-sh/termio

    Diagnose a termio hang, beachball, crash, or 'it froze again' from the evidence macOS and termio actually leave behind — live process samples, crash and CPU-burn reports, the unified log, the…

    540 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • App Screenshot Debug

    termio-sh/termio

    Drive the running termio app via AppleScript / System Events to reach a UI state (focus the window, click a sidebar project, a terminal pane, a control), capture a pixel-accurate screenshot of just…

    540 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Dia Source Analysis

    termio-sh/termio

    Analyze / reverse-engineer the locally installed Dia Browser mac app (The Browser Company; bundle id company.thebrowser.dia; shares ArcCore with Arc).

    540 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Asc

    termio-sh/termio

    Drive App Store Connect from the terminal with the asc CLI — TestFlight builds, groups, testers and What to Test notes; App Store versions, metadata, keywords, screenshots and release notes…

    540 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Issue Creator

    termio-sh/termio

    Turn vague customer or user feedback from pasted text, chat excerpts, or screenshots into a clear, evidence-backed GitHub issue without inventing requirements.

    540 GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Og Generation

    termio-sh/termio

    Regenerate the landing site's OG/social card (web/landing/public/og.webp) by rendering a temporary in-app route with the real hero WebGL aurora and screenshotting it with headless Chrome.

    540 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Code Clean

What does Code Clean do?

Cut dead code and over-long comments from termio's Swift, verifying every deletion against a build. Code Clean is an agent skill from termio-sh/termio. Cut dead code and over-long comments from termio's Swift, verifying every deletion against a build.

When should I use Code Clean?

Code Clean fits situations like: says clean dead code; clean up the comments; the comments are too long; remove unused code.

How do I install Code Clean in Claude Code?

Run `npx skills add termio-sh/termio --skill code-clean -a claude-code`. Or copy the skill folder (skills/code-clean in termio-sh/termio) into .claude/skills/code-clean in your project. Claude Code loads it when a task matches its description.

How do I install Code Clean in Codex?

Run `npx skills add termio-sh/termio --skill code-clean -a codex`. Or copy the skill folder (skills/code-clean in termio-sh/termio) into .agents/skills/code-clean in your project. Codex loads it when a task matches its description.

Can I use Code Clean 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 termio-sh/termio --skill code-clean -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-clean, .gemini/skills/code-clean, .github/skills/code-clean and .opencode/skills/code-clean in your project.

What does Code Clean need to run?

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

Does Code Clean 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 Code Clean 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 Code Clean use?

Code Clean 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 Code Clean use?

About 1.7k tokens (SKILL.md is roughly 6.8k 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 Code Clean?

Skills that share tags, products or a category with Code Clean: Hig Project Context (raintree-technology/hig-doctor, 142 stars), Hig Components Content (raintree-technology/hig-doctor, 142 stars), iOS Simulator Skill (n0an/VivaDicta, 126 stars) and Inspector Implementation (ipedro/Inspector, 170 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Clean?

termio-sh (a GitHub organization) maintains it in termio-sh/termio, which has 540 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 6, 2026.

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