Agent skill

Routine Dead Code Removal

by bex-co in bex-co/beancount-io

Autonomous maintenance routine that deletes provably unreachable code from one monorepo package using the repo's own detectors (yarn lint:deadcode / make deadcode / scripts/lint-deadcode.sh)…

MITAuto-check passedDevelopment

Install Routine Dead Code Removal

skills CLI
$ npx skills add bex-co/beancount-io --skill routine-dead-code-removal -a claude-code

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

GitHub CLI
$ gh skill install bex-co/beancount-io routine-dead-code-removal --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/bex-co/beancount-io.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/routine-dead-code-removal .claude/skills/routine-dead-code-removal && 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
routine-dead-code-removal
GitHub stars
295
Token cost
~1.1k tokens
SKILL.md length
455 words
Files
1
Skills in repo
27
Repo updated
First seen
Licence
MIT

At a glance

Autonomous maintenance routine that deletes provably unreachable code from one monorepo package using the repo's own detectors (yarn lint:deadcode / make deadcode / scripts/lint-deadcode.sh)…

  • Works in 6 steps: Scope → Discover → Prove it → …
  • Explicitly invokes /routine-dead-code-removal
  • SKILL.md covers Contract, Workflow, What NOT to do and Arguments
  • Calls yarn and make

What it does

Routine Dead Code Removal is an agent skill from bex-co/beancount-io. Autonomous maintenance routine that deletes provably unreachable code from one monorepo package using the repo's own detectors (yarn lint:deadcode / make deadcode / scripts/lint-deadcode.sh), verifies every hit against dynamic references before deleting, and ships each removal via /ship. Use only when the user explicitly invokes /routine-dead-code-removal or asks to find and delete dead or unused code. SKIP for dead branches behind a feature flag (routine-shipped-feature-inliner), live duplicates whose callers…

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.

It sits in Development, covering Code simplification, Linting and formatting and Monorepo tooling. The repository describes itself as: 💰 Double-entry bookkeeping made easy — plain-text accounting for humans and AI agents. Polished iOS & Android app built with React Native + Expo. The licence is MIT.

When your agent uses it

  • Explicitly invokes /routine-dead-code-removal
  • Asks to find and delete dead
  • Is find and delete code nothing can reach

Example prompts

  • “find and delete code nothing can reach”
  • “/routine-dead-code-removal”

Workflow steps

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

  1. Scope
  2. Discover
  3. Prove it
  4. Fix
  5. Verify
  6. Ship

What it can do on your machine

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

    • yarn
    • make

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

  • Network

    No URLs in SKILL.md. Its commands use yarn, 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

Routine Dead Code Removal loads about 1.1k tokens when it runs. Until then it costs about 196 tokens; SKILL.md has 455 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~196
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 bex-co/beancount-io at commit 2103ca1, republished under its MIT licence (© bex-co). 455 words, ~1,050 tokens.

Download SKILL.mdSave it as .claude/skills/routine-dead-code-removal/SKILL.md (or your agent's skills folder).
name
routine-dead-code-removal
description
Autonomous maintenance routine that deletes provably unreachable code from one monorepo package using the repo's own detectors (yarn lint:deadcode / make deadcode / scripts/lint-deadcode.sh), verifies every hit against dynamic references before deleting, and ships each removal via /ship. Use only when the user explicitly invokes /routine-dead-code-removal or asks to find and delete dead or unused code. SKIP for dead branches behind a feature flag (routine-shipped-feature-inliner), live duplicates whose callers need repointing (routine-dup-unifier), tests that pass but assert nothing (routine-useless-test-pruner), or live single-implementation indirection (routine-abstraction-improver). The core trigger is "find and delete code nothing can reach".

Task: Delete provably unreachable code

Usage: /routine-dead-code-removal [package-or-path]

Run the target package's dead-code detector, prove each hit is truly unreachable, delete it (with the tests and fixtures that only existed for it), make the package's checks pass, and ship each removal via /ship.

Contract

Read .agents/skills/routine-shared/contract.md first — it defines preconditions, scope resolution, verify gates, the ship protocol, the budget, and universal STOPs. This file adds only what is specific to dead code. Floor even without it: never ship red; one finding per ship; anything in a DO_NOT_DO.md is a hard STOP.

Workflow

1. Scope

Resolve scope per the contract. With no argument, prefer running scripts/lint-deadcode.sh from the repo root once as a survey, then pick the one package with the most promising hits.

2. Discover

cd into the package, then run its detector:

  • JS/TS packages (mobile, dashboard, backend-cluster/backend-v2, backend-cluster/ledger, backend-cluster/agent-box) → yarn lint:deadcode (Knip; config in the package's knip.jsonc)
  • cli/ → make deadcode (Vulture; high-confidence only)

Also legitimate finds while reading nearby code: commented-out blocks, if (false)-style branches, early-return shadowed code. A detector hit is a candidate, not proof.

3. Prove it

For every candidate, sweep for references the detector can't see before touching anything:

  • Grep the whole package for the symbol/file name as a string — dynamic imports, registries, config-referenced entries, test fixtures.
  • Expo Router is file-based: files under mobile/app/ are routes reachable by navigation and deep links even with zero imports — never a dead-code finding.
  • Codegen inputs (GraphQL documents, codegen.ts, apollo.config.json) and build/tooling entry points (babel.config.js, scripts referenced from package.json) count as reachable.

A confirmed false positive is its own legitimate finding: add a scoped ignore to the package's knip.jsonc (with a short reason) instead of deleting, so the detector stays trustworthy.

Show full SKILL.md (174 more words)Show less
4. Fix
  • Prefer the safe fixers where they apply: yarn lint:deadcode:fix / make deadcode-fix — then review the resulting diff before keeping it (root AGENTS.md rule). Discard anything the proof step didn't cover.
  • Delete manually what the fixers can't reach (commented-out blocks, unreachable branches).
  • Delete tests and fixtures whose only purpose was exercising the removed code — they travel with it.
5. Verify

Run the owning package's full gate from the contract's table, plus a clean re-run of the detector to confirm nothing was orphaned by the deletion.

6. Ship

Compose /ship for this one removal. Loop back to step 2 while candidates and budget remain.

What NOT to do

  • Never delete a branch that is dead only because a feature flag holds one value — that is routine-shipped-feature-inliner's job.
  • Never delete one of two live duplicate implementations — that is routine-dup-unifier's job (it repoints callers first).
  • Never touch the CLI's vendored fava code, codegen output, or lockfiles.
  • Never trust a Knip/Vulture hit without the reference sweep — file-based routes and dynamic lookups are exactly where detectors lie.

Arguments

$ARGUMENTS

© bex-co, 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/routine-dead-code-removal of bex-co/beancount-io.

Open the folder on GitHubat commit 2103ca1

Compare with similar skills

Routine Dead Code Removal 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.

Routine Dead Code Removal compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Routine Dead Code Removal this skillbex-co/beancount-io295—~1.1kAutomated safety check: PassMIT
Local CIpenpot/penpot61k—~822Automated safety check: PassMPL-2.0
Unslop CodeJCarterJohnson/vibecoded-design-tells511—~2.5kAutomated safety check: PassCustom licence
Create Saleor Packagesaleor/apps162—~608Automated safety check: PassCustom licence
Leanspec Developmentcodervisor/leanspec296—~2.5kAutomated safety check: PassMIT
Lintcnremorses/lintcn101—~6.5kAutomated safety check: PassNone

Similar skills

  • Local CI

    penpot/penpot

    Run local CI-style checks with ./scripts/ci (lint, tests, format) per monorepo module.

    61k GitHub stars~822 tokensUpdated today
    DevelopmentAuto-check passed
  • Unslop Code

    JCarterJohnson/vibecoded-design-tells

    Strips the tells that make source code read as AI-generated and forces code that fits the project instead of the model's default average.

    511 GitHub stars~2.5k tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Scaffold a new shared package in the saleor-apps monorepo under ./packages/.

    162 GitHub stars~608 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Leanspec Development

    codervisor/leanspec

    Development workflows, commands, publishing, CI/CD, changelog management, and contribution guidelines for LeanSpec.

    296 GitHub stars~2.5k tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • Lintcn

    remorses/lintcn

    Type-aware TypeScript lint rules in .lintcn/ Go files. An agent skill from remorses/lintcn.

    101 GitHub stars~6.5k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Absolute Simplify

    maddhruv/absolute

    A skill your agent uses when the user wants to simplify, clean up, refactor, tidy, or refine code — their staged/unstaged git changes or a target file/path.

    218 GitHub stars~6.1k tokensUpdated 3 mo ago
    DevelopmentAuto-check passed

More from bex-co/beancount-io

All 27 skills in this repo
  • Beancount Close

    bex-co/beancount-io

    Close an accounting period in a Beancount ledger by reconciling each active account through beancount-reconcile, checking assertions and recurring gaps, reviewing flags, then proposing a commit with…

    295 GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • Beancount Import

    bex-co/beancount-io

    Import a bank or card CSV, OFX/QFX, or QIF export into an existing Beancount ledger.

    295 GitHub stars~3k tokensUpdated yesterday
    Auto-check passed
  • Beancount Importer Author

    bex-co/beancount-io

    Write or repair a reusable Beangulp importer from a sample bank export, with reviewed golden files and a passing test harness.

    295 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Beancount Init

    bex-co/beancount-io

    Scaffold a new Beancount ledger with bea init and validation, with optional Fava browser setup when requested.

    295 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check: notes
  • Beancount Options

    bex-co/beancount-io

    Record a described options trade or lifecycle event as validated Beancount transactions through bea, after review and confirmation.

    295 GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Beancount Reconcile

    bex-co/beancount-io

    Reconcile one Beancount account against a CSV statement or pasted PDF text.

    295 GitHub stars~4.1k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Routine Dead Code Removal

What does Routine Dead Code Removal do?

Autonomous maintenance routine that deletes provably unreachable code from one monorepo package using the repo's own detectors (yarn lint:deadcode / make deadcode / scripts/lint-deadcode.sh)…. Routine Dead Code Removal is an agent skill from bex-co/beancount-io.sh), verifies every hit against dynamic references before deleting, and ships each removal via /ship.

When should I use Routine Dead Code Removal?

Routine Dead Code Removal fits situations like: explicitly invokes /routine-dead-code-removal; asks to find and delete dead; is find and delete code nothing can reach.

How do I install Routine Dead Code Removal in Claude Code?

Run `npx skills add bex-co/beancount-io --skill routine-dead-code-removal -a claude-code`. Or copy the skill folder (.agents/skills/routine-dead-code-removal in bex-co/beancount-io) into .claude/skills/routine-dead-code-removal in your project. Claude Code loads it when a task matches its description.

How do I install Routine Dead Code Removal in Codex?

Run `npx skills add bex-co/beancount-io --skill routine-dead-code-removal -a codex`. Or copy the skill folder (.agents/skills/routine-dead-code-removal in bex-co/beancount-io) into .agents/skills/routine-dead-code-removal in your project. Codex loads it when a task matches its description.

Can I use Routine Dead Code Removal 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 bex-co/beancount-io --skill routine-dead-code-removal -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/routine-dead-code-removal, .gemini/skills/routine-dead-code-removal, .github/skills/routine-dead-code-removal and .opencode/skills/routine-dead-code-removal in your project.

What does Routine Dead Code Removal need to run?

Going by SKILL.md and its folder, Routine Dead Code Removal needs the command-line tools its instructions call (yarn and make).

Does Routine Dead Code Removal 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 Routine Dead Code Removal 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 Routine Dead Code Removal use?

Routine Dead Code Removal 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 Routine Dead Code Removal use?

About 1.1k tokens (SKILL.md is roughly 4.2k 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 Routine Dead Code Removal?

Skills that share tags, products or a category with Routine Dead Code Removal: Local CI (penpot/penpot, 61k stars), Unslop Code (JCarterJohnson/vibecoded-design-tells, 511 stars), Create Saleor Package (saleor/apps, 162 stars) and Leanspec Development (codervisor/leanspec, 296 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Routine Dead Code Removal?

bex-co (a GitHub organization) maintains it in bex-co/beancount-io, which has 295 GitHub stars. The repository holds 27 skills in this directory. The repository was last updated on October 7, 2026.

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