Skip to content
Back to skills

Audit Vestigial Contracts

ASecurity

Audits code changes and diffs for removed features, configs, or tokens to identify residual passthroughs, orphaned parameters, and vestigial test scaffolding for human-approved pruning.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 19, 2026
code-qualityrefactoringapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 19, 2026

npx -y skills add sirius-cc-wu/sirius-skills --skill audit-vestigial-contracts --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Audit Vestigial Contracts?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Audit Vestigial Contracts
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sirius-cc-wu-audit-vestigial-contracts/badge)](https://www.skillsdirectory.com/skills/sirius-cc-wu-audit-vestigial-contracts)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: audit-vestigial-contracts
description: Audits code changes and diffs for removed features, configs, or tokens to identify residual passthroughs, orphaned parameters, and vestigial test scaffolding for human-approved pruning.
---

# Audit Vestigial Contracts

Audits codebases and diffs for dead contracts, wrappers, and test residue left behind after a feature, configuration, or environment variable is removed.

> **Safety Invariant:** Never modify or delete tests autonomously. Pruning requires explicit human approval and belongs in a dedicated cleanup PR.

## When to Use

- When reviewing a PR or commit range where a configuration, token, or feature was removed or deprecated.
- When evaluating if an interface parameter or wrapper is still necessary.
- Do not use for routine refactoring without feature deprecation or removal.

## Workflow

1. **Extract Deleted Tokens:** Scan diffs (and commit messages) for removed environment variables (`os.environ`), config keys, CLI flags, or API arguments.
2. **Inspect Enclosing Helpers:** Check if functions touching those deletions degraded into trivial passthroughs, redundant wrappers around static constants, or private helpers with no external callers.
3. **Trace Parameter Propagation:** Check all call sites of the degraded helper and its arguments across the codebase. If an argument (e.g., `candidate_ips`) is never varied by production callers, flag it as an **orphaned parameter**.
4. **Audit Test & Mock Coupling:** Inspect existing AND newly added/modified tests for:
   - *Ignored-Token Tests:* Assertions verifying that a removed token is ignored (e.g., `setenv("LEGACY_VAR")`). Flag even when bundled inside compound tests.
   - *Private Helper Coupling:* Unit tests targeting private resolution helpers rather than public entrypoint contracts.
   - *Tautological Tests:* Asserting standard library behavior on hardcoded constants.
   - *Plumbing Mocks:* Mocking internal parameter forwarding instead of domain behavior.
5. **Present Proposal for Human Approval:** Report deleted tokens, degraded helpers, orphaned parameters, affected tests/assertions, and blast radius.
6. **Execute in Dedicated PR:** Upon human approval, create a separate cleanup branch/PR to prune dead wrappers, parameters, and obsolete assertions, verifying the suite passes cleanly.

## Report Format

Present findings succinctly:
- **Removed Token:** `<token>` (`<commit/PR>`)
- **Degraded Helpers:** `function()` in `file:line` (trivial wrapper / private coupling)
- **Orphaned Parameters:** `param` across call chain (never varied)
- **Vestigial Tests:** `test_name` in `file:line` (ignored-token assertion / private helper coupling / plumbing mock)
- **Blast Radius & Plan:** Proposed files to edit and tests/assertions to prune

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.