Skip to content
Back to skills

Octocode Clean Agentic Code

ASecurity

Load this skill first when asked to remove dead code, duplicate helpers, debug leftovers and unused agent instructions or config. Check consumers and verify that behavior survives each removal.

  • 971 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 1, 2026
ai-agentsnodegitapi

Works with

  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add bgauryy/octocode --skill octocode-clean-agentic-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Octocode Clean Agentic Code?

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

Security grade badge for Octocode Clean Agentic Code
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bgauryy-octocode-clean-agentic-code/badge)](https://www.skillsdirectory.com/skills/bgauryy-octocode-clean-agentic-code)

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: octocode-clean-agentic-code
description: "Load this skill first when asked to remove dead code, duplicate helpers, debug leftovers and unused agent instructions or config. Check consumers and verify that behavior survives each removal."
---

# Octocode clean agentic code

1. Record the requested scope, existing edits and affected checks before cleanup. Save each affected check's baseline report (JUnit XML, TAP, JSON, or a list of failing check names) and coverage report under `<workspace>/.octocode/tmp/octocode-clean-agentic-code/`; mark a blocked baseline. Skip the baselines when the request is report-only (no edits).
2. List literal candidates with [scan-signals](scripts/scan-signals.mjs): `node <skill-folder>/scripts/scan-signals.mjs [paths] --diff <base>` for the change (omit `--diff` to audit whole paths). Judge each JSON-line candidate with the reference below that names its `signal`; exit 1 only means rows were printed.
3. For each candidate, check semantic references, public entry points, configuration, dynamic loading and external consumers. Use Octocode `lspSearch` references and exact `localSearch` reads. An empty search alone cannot justify deletion.
4. Keep live contracts. Defer uncertain removals with the check that would settle them. Group proven removals into reversible batches, update their callers and regenerate derived files at their source. Flag authentication, authorization, deletion, billing and public API changes for human review. Explain any rewrite beyond the candidates, or a file where `git diff --numstat` shows more added than deleted lines (an untracked file counts as all added).
5. Replay the affected checks and inspect the diff, then compare with the baseline: `node <skill-folder>/scripts/check-diff.mjs <baseline> <after>` ([check-diff](scripts/check-diff.mjs)). Exit 1 means `introduced` holds failures your batch caused: revise the diagnosis or undo only your batch and report the blocker. Report `missing` checks as unverified; other fields: `--help`. Preserve existing edits and coverage floors.

| Candidate | Decision |
|---|---|
| [Dead or duplicate code](references/code-smells.md), [checker suppressions](references/checker-suppressions.md), [redundant types or dependencies](references/types-dependencies.md) | Check the candidate's removal bar and preserve supported consumer behavior. |
| [Comments, instructions or configuration](references/text-config-hygiene.md) | Keep text and configuration with a parser, runtime or external consumer until its contract deliberately changes. For AI-writing tells, chat residue and placeholders, use [writing tells](references/writing-tells.md). If cleaner wording changes agent behavior, use `octocode-agentic`. For skill packaging or activation, use `octocode-skills`. |
| [Agent leftovers or defects](references/agent-defects.md) | Report [error masking, reachable stubs and unverified dependencies](references/agent-blockers.md) as [SBAR blockers](references/agent-blockers.md#escalation-protocol). Keep these out of removal batches. Redact exposed credentials and report them for rotation. |
| [Weak tests or grader gaming](references/tests.md), [test debt or replacement tests](references/test-debt.md) | Report confirmed gaming as an SBAR blocker. Preserve the behavioral oracle and coverage floors. Never hide a failure by weakening a check or widening a mask. |

Keep defects requiring behavior changes separate from the cleanup. Use `octocode-engineer` for unresolved design choices.

Report [removals, deferrals and checks](output.md), including baseline failures and unrun checks. Finish when the diff contains only authorized changes and the affected checks support preserved behavior, or identify what blocked verification. Run the [renderer](scripts/render-report.mjs) for requested HTML.

Files in this skill

  • README.md5.8 KB
  • SKILL.md3.7 KB
  • output.md1.9 KB
  • references/agent-blockers.md2.8 KB
  • references/agent-defects.md3.9 KB
  • references/checker-suppressions.md1.8 KB
  • references/code-smells.md4.9 KB
  • references/configuration.md3.6 KB
  • references/evidence.md2.9 KB
  • references/presentation.md1.4 KB
  • references/protocol-catalog.md3.1 KB
  • references/report-mermaid.md4.5 KB
  • references/report-output.md5.8 KB
  • references/report-render.md2.6 KB
  • references/report-widgets.md1.4 KB
  • references/test-debt.md3.1 KB
  • references/tests.md2.8 KB
  • references/text-config-hygiene.md3.4 KB
  • references/types-dependencies.md2.5 KB
  • references/writing-tells.md5.4 KB

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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