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

ln-512-tech-debt-cleaner

Applies safe auto-fixes for low-risk audit findings (unused imports, dead code, commented-out code). Confidence >=90% only. Creates single commit with summary.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md7.4 KB

SKILL.md(原文)

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

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

Tech Debt Cleaner (L3 Worker)

Automated cleanup of safe, low-risk tech debt findings from codebase audits.

Purpose & Scope

  • Consume audit findings from docs/project/codebase_audit.md (ln-620 output) or ln-511 code quality output
  • Filter to auto-fixable findings with confidence >=90%
  • Apply safe fixes: remove unused imports, delete dead code, clean commented-out blocks, remove deprecated aliases
  • Never touch business logic, complex refactoring, or architectural changes
  • Create single commit with structured summary of all changes
  • Invocable from ln-510 quality coordinator pipeline or standalone

Auto-Fixable Categories

CategorySource PrefixRiskAuto-Fix Action
Unused importsMNT-DC-LOWDelete import line
Unused variablesMNT-DC-LOWDelete declaration
Unused functions (unexported)MNT-DC-LOWDelete function block
Commented-out code (>5 lines)MNT-DC-LOWDelete comment block
Backward-compat shims (>6 months)MNT-DC-MEDIUMDelete shim + update re-exports
Deprecated aliasesMNT-DC-LOWDelete alias line
Trailing whitespace / empty linesMNT-LOWTrim / collapse

NOT Auto-Fixable (skip always)

CategoryReason
DRY violations (MNT-DRY-)Requires architectural decision on where to extract
God classes (MNT-GOD-)Requires domain knowledge for splitting
Security issues (SEC-)Requires context-specific fix
Architecture violations (ARCH-*)Requires design decision
Performance issues (PERF-*)Requires benchmarking
Any finding with effort M or LToo complex for auto-fix

When to Use

  • Invoked by ln-510-quality-coordinator Phase 3 (after ln-511 code quality check)
  • Standalone: After ln-620 codebase audit completes (user triggers manually)
  • Scheduled: As periodic "garbage collection" for codebase hygiene

Inputs

  • Pipeline mode (ln-510): findings from ln-511 code quality output (passed via coordinator context)
  • Standalone mode: docs/project/codebase_audit.md (ln-620 output)

Workflow

  1. Load findings: Read docs/project/codebase_audit.md. Parse findings from Dead Code section (ln-626 results) and Code Quality section (ln-624 results).

  2. Filter to auto-fixable:

    • Category must be in Auto-Fixable table above
    • Severity must be LOW or MEDIUM (no HIGH/CRITICAL)
    • Effort must be S (small)
    • Skip files in: node_modules/, vendor/, dist/, build/, *.min.*, generated code, test fixtures
  3. Verify each finding (confidence check): MANDATORY READ: shared/references/clean_code_checklist.md For each candidate fix: a) Read the target file at specified location b) Confirm the finding still exists (file may have changed since audit) c) Confirm removal is safe:

    • For unused imports: grep codebase for usage (must have 0 references)
    • For unused functions: grep for function name (must have 0 call sites)
    • For commented-out code: verify block is code, not documentation
    • For deprecated aliases: verify no consumers remain d) Assign confidence score (0-100). Only proceed if confidence >=90
  4. Apply fixes with per-fix keep/discard (autoresearch pattern): MANDATORY READ: Load shared/references/ci_tool_detection.md for discovery hierarchy. Detect lint + typecheck commands once (reuse for all fixes).

    Group verified fixes by file. For each file (process files independently):

    • Sort fixes within file by line number descending (bottom-up prevents line shift)
    • Apply ALL fixes for this file using Edit tool
    • Run lint/typecheck on the modified file
    • IF passes → git add {file} (status: keep)
    • IF fails → git checkout -- {file} (status: discard), log discarded fixes
    • Track per fix: file, lines removed, category, finding ID, status (keep/discard)

    If no lint/type commands detected: apply all fixes, skip per-file verification with warning, git add all modified files.

  5. Create commit (kept fixes only):

    • All kept files already staged via git add in step 4
    • If zero files kept (all discarded): skip commit, report all failures
    • Commit message format:
      chore: automated tech debt cleanup
      
      Removed {N} auto-fixable findings from codebase audit:
      - {count} unused imports
      - {count} dead functions
      - {count} commented-out code blocks
      - {count} deprecated aliases
      
      Source: docs/project/codebase_audit.md
      Confidence threshold: >=90%
      
  6. Update audit report:

    • Add "Last Cleanup" section to docs/project/codebase_audit.md:
      ## Last Automated Cleanup
      **Date:** YYYY-MM-DD
      **Findings fixed:** N of M auto-fixable
      **Skipped:** K (confidence <90% or verification failed)
      **Build check:** PASSED / SKIPPED
      

Output Format

verdict: CLEANED | NOTHING_TO_CLEAN | ALL_DISCARDED
stats:
  total_findings: {from audit}
  auto_fixable: {filtered count}
  kept: {files that passed lint/typecheck}
  discarded: {files that failed lint/typecheck}
  skipped: {confidence <90 or stale}
fixes:
  - file: "src/utils/helpers.ts"
    line: 45
    category: "unused_function"
    removed: "formatDate()"
    finding_id: "MNT-DC-003"
    status: "keep"
  - file: "src/api/v1/auth.ts"
    line: 12
    category: "deprecated_alias"
    removed: "export { newAuth as oldAuth }"
    finding_id: "MNT-DC-007"
    status: "discard"
    discard_reason: "typecheck failed: Type error in auth.ts:15"
commit_sha: "abc1234" | null

Critical Rules

  • Safety first: Never fix if confidence <90%. When in doubt, skip.
  • Bottom-up editing: Always apply fixes from bottom to top of file to avoid line number shifts.
  • Per-file keep/discard: If linter/type-checker fails for a file, revert only that file (git checkout -- {file}), keep other successful files.
  • No business logic: Never modify function bodies, conditionals, or control flow.
  • Explicit staging: Stage files by name, never git add . or git add -A.
  • Idempotent: Running twice produces no changes if audit report unchanged.
  • Git-aware: Only operate on tracked files. Skip untracked or ignored files.
  • Exclusions: Skip generated code, vendor directories, minified files, test fixtures.

Definition of Done

  • Audit report loaded and parsed
  • Findings filtered to auto-fixable categories
  • Each finding verified with confidence >=90%
  • Fixes applied bottom-up per file
  • Build integrity verified (lint + type check) or skipped with warning
  • Single commit created with structured message (or all reverted on build failure)
  • Audit report updated with "Last Automated Cleanup" section
  • Output YAML returned to caller

Reference Files

  • Clean code checklist: shared/references/clean_code_checklist.md
  • Audit output schema: shared/references/audit_output_schema.md
  • Audit report template: shared/templates/codebase_audit_template.md

Version: 1.0.0 Last Updated: 2026-02-15

レビュー

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

同じリポジトリのスキル

概要と使いどころ

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA standards. Use this skill to generate semantic ARIA for Web and accessibility traits for Web and Native platforms (iOS/Android).

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

tensology/decisionsai172026年10月13日 更新

Whole site or product — a full web accessibility (a11y) audit against WCAG 2.2, following the WCAG-EM methodology. Defines scope, samples representative pages and flows, runs the automated tier (`accessibility-scan`) and the hands-on manual tier (`accessibility-inspect`), and produces one conformance report. Grades each finding by severity and evidence basis, and states per-criterion conformance as pass, fail, or undetermined (needs a human). Use it for 'audit my site for accessibility', 'is this product accessible', 'a11y audit', 'WCAG or Section 508 conformance report', or any multi-page assessment. Assesses; does not fix (use `accessibility-fix`) or diff (use `accessibility-diff`). For a single page use `accessibility-scan`; for hands-on keyboard and screen-reader checks use `accessibility-inspect`.

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

tensology/decisionsai172026年10月13日 更新

Regression check — diff a live page's web accessibility (a11y) violations against a baseline. By default it compares your uncommitted changes (stash-based); pass `--branch [<name>]` to compare against a branch. Reports the new WCAG violations introduced, the ones fixed, and the count of pre-existing ones. Use it for 'did my change break accessibility', 'what a11y issues did this PR add', or as a CI gate. For a full scan of one page use `accessibility-scan`; for a whole site use `accessibility-audit`.

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

tensology/decisionsai172026年10月13日 更新

Remediation only — repair web accessibility (a11y) violations against WCAG 2.2 with a baseline, edit, and verify loop. Takes a target (URL, files, directory) or a findings worklist from `accessibility-scan`/`accessibility-inspect`/`accessibility-audit`, applies mechanical fixes as given, leaves TODOs for visual or contextual judgment, and verifies by re-running the baseline check. It only fixes. To find issues use `accessibility-scan` (one page, automated), `accessibility-inspect` (one page, manual), or `accessibility-audit` (whole site, WCAG-EM); to check for regressions use `accessibility-diff`. Use it for 'fix the a11y issues in X', 'make this accessible', 'add missing alt text and labels', 'apply these accessibility fixes', 'remediate these violations'.

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

tensology/decisionsai172026年10月13日 更新

One page, hands-on manual tier — drive a live page through the web accessibility (a11y) checks a rule engine can't decide: keyboard operation and focus order, screen-reader names, roles and states from the accessibility tree, reflow and zoom, reduced motion, form errors, and target size. Grades each finding by evidence basis (verified / confirm-with-a-human / human-required) and severity, and closes every criterion in a ledger: verified, flagged, not exercised, or N/A. Locates and assesses; does not fix (use `accessibility-fix`). Use it for keyboard testing, focus-order checks, screen-reader or a11y-tree review, reflow and zoom at 200%, or 'is this operable, not just lint-clean'. The automated tier is `accessibility-scan`; `accessibility-audit` runs both across a sampled site.

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

tensology/decisionsai172026年10月13日 更新

One page, automated tier — run the web accessibility (a11y) rule engine against a live page and locate every violation it can detect mechanically. Pass a URL, a config target name (e.g. `accesslint:accessibility-scan dev`), or nothing to use the default target from `accesslint.config.json`. Ensures a debuggable Chrome, runs the @accesslint/core engine over CDP, and returns a worklist of live-DOM WCAG 2.2 violations, each grounded to its DOM selector and source `file:line`. Locates; doesn't edit. Use it for 'is this page accessible', 'check a11y on this URL', 'find contrast and alt-text issues', or to verify a UI change. For hands-on keyboard and screen-reader checks use `accessibility-inspect`; for a whole site or product use `accessibility-audit`; to diff against uncommitted changes or a branch use `accessibility-diff`.

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

tensology/decisionsai172026年10月13日 更新

tensology のスキルをすべて見る

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