本文へ移動
cccskills
無料GitHub で公開

routine-dead-code-removal

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

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-ioスター 315(GitHub 315 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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.

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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Prepare supported accrual and reversal drafts for a period from an explicitly stated schedule — basis, service interval, day-count, recognized-to-date, already-booked, required adjustment — posted only through the suite's propose/confirm/check flow with stable schedule identity. Skip recording one-off entries the user describes (beancount-add), explaining how a balance moved (beancount-roll-forward), tax or depreciation advice, automatic reversals, and ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

Record one-off entries the user describes in a local Beancount ledger through bea — a purchase, bill, paycheck, or transfer between their own accounts (including splits and pasted receipt text), opening or closing an account, a price, or a note. Propose the exact entries from existing accounts, check whether one is already recorded, and write only after confirmation with a passing check; it never changes existing entries. Skip bank or card export files (beancount-import), statements (beancount-reconcile), finance-app migrations, options trades (beancount-options), investment trades, dividends, splits, and vests (beancount-trade), month-end close, edits to existing entries, and ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

Answer explicit requests for facts from a local Beancount ledger using shown, reproducible bea queries and reports for spending, trends, net worth, holdings, subscriptions and anomalies. Do not select this skill merely to gather preliminary inputs for buy/sell decisions or tax recommendations, even if ledger facts could help. Strictly read-only; figures come from executed queries. Skip ledgers hosted on Beancount.io, recording transactions (beancount-add), reconciliation, migration, ledger edits, option pricing or greeks, investment or tax advice, and general Beancount, BQL, or `bea` documentation questions (including what `bea ask` does).

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

Close an accounting period in a local Beancount ledger by reconciling each active account through beancount-reconcile, checking assertions and recurring gaps, reviewing flags, then proposing a commit with the period reports. Use for month-end close or wrapping up the books. Surface incomplete work and require a passing check before a confirmed commit; never push. Skip closing a single account (a `close` directive; beancount-add) and ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

Record bank/card transactions in an existing local Beancount ledger from CSV, OFX/QFX, QIF or PDF statements, including PDF-only banks with no CSV export. For a PDF ledger import, read this SKILL.md before the PDF helper's guide to establish account, deduplication and confirmation rules, then use the helper for extraction. Import broker activity CSVs or holdings/cost-basis exports as lot-carrying entries or opening lots. Read this guide before beancount-trade for these files; skip described trades (beancount-trade). Normalize signs, suggest categories from existing accounts, review duplicates and confirm before bea writes; PDF statements must tie out and end with a balance assertion. Skip standalone PDF extraction/OCR, summarization or editing without a ledger import; account-versus-statement comparisons (beancount-reconcile), full finance-app migrations, reusable importer authoring, individual options trades, single manual entries (beancount-add), ledger `option` settings, and ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

Write or repair a reusable Beangulp importer from a sample bank export for a local ledger, with reviewed golden files and a passing test harness. Use when a source needs a tested Python importer or its format changed, e.g. "write a beangulp importer for my bank's CSV" or "my importer broke after the bank renamed its columns". Wire the confirmed runner through bea ingest; keep generate/test in the authoring project. Skip one-off imports, reconciliation, finance-app migration, ledger writes, and ledgers hosted on Beancount.io.

日本語の概要は準備中です。原文の説明を表示しています。

bex-co/beancount-io3152026年10月26日 更新

bex-co のスキルをすべて見る

このスキルの問題を報告する