Skip to content
FunCoding

octocode-clean-agentic-code

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.

Star
972
License
MIT
Last commit
Dec 2, 2026

skills/octocode-clean-agentic-code/SKILL.md

View on GitHub

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: 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). 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.
CandidateDecision
Dead or duplicate code, checker suppressions, redundant types or dependenciesCheck the candidate's removal bar and preserve supported consumer behavior.
Comments, instructions or configurationKeep 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. If cleaner wording changes agent behavior, use octocode-agentic. For skill packaging or activation, use octocode-skills.
Agent leftovers or defectsReport error masking, reachable stubs and unverified dependencies as SBAR blockers. Keep these out of removal batches. Redact exposed credentials and report them for rotation.
Weak tests or grader gaming, test debt or replacement testsReport 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, 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 for requested HTML.

Similar Skills

ask-matt

MAmattpocock/skills337k4,978 new stars in the last 7 days

chief-of-staff

MAmattpocock/skills337k4,978 new stars in the last 7 days

setup-matt-pocock-skills

MAmattpocock/skills337k4,978 new stars in the last 7 days

subagent-driven-development

OBobra/superpowers331k4,772 new stars in the last 7 days

autonomous-loops

AFaffaan-m/ECC315k4,381 new stars in the last 7 days

autonomous-agent-harness

AFaffaan-m/ECC315k4,381 new stars in the last 7 days