Index of every page on this site: llms.txt
All skills
h3xar0n avatar

/local-refactor-scanner

@b1b34c0
Run it yourself

Refactors code for quality and maintainability, executes full test suite regression passes, and runs local deterministic security and lint scans in Phase D REFACTOR. Use when cleaning up code structure and eliminating duplication after tests pass, running local linters and fast offline scanners for secrets or dependencies, executing full regression test suites, and performing guided code reviews. Do not use for implementing initial feature logic, writing failing test-first suites, or modifying architectural threat models.

  • 1 file
  • 2.2 KB
  • Updated 2 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/h3xar0n/secure-tdd-agent-framework/local-refactor-scanner

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈138 tokens for metadata: the name and description. ≈426 when used: this file.

Description uses 6.9% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈552 characters, or 6.9%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Code Refactoring, Quality & Local Scanner Skill (Phase D: REFACTOR Phase)

Overview

Refactor implementation for clean code structure, modularity, and maintainability while ensuring 100% passing test regressions and blocking pattern-based security flaws locally prior to commit.

Verification Guardrails

  1. Code Quality & Refactoring:
    • Clean up boilerplate, eliminate dead code, and centralize common utilities.
    • Improve variable naming, modularity, and type annotations without altering verified behavior.
  2. Deterministic Scans (Fast & Offline):
    • Secrets: Check diffs for plaintext credentials, tokens, or private keys.
    • Dependencies: Flag unpinned dependencies or known CVEs in new packages.
    • Rules-Based SAST: Run local SAST rules on modified files (semgrep scan --config auto --json or cm find).
  3. Guided AI Review:
    • Audit architecture and design issues that static tools miss.
    • Review business logic and edge cases for bypasses or regression risks.
  4. Small Diffs & Regression QA:
    • Run the complete project test suite to verify zero regressions across existing and new tests.
    • Ensure the diff contains only surgical changes directly related to the task scope.

Execution Sequence

  1. Review the git diff of modified files (git diff).
  2. Refactor code for clarity, maintainability, and helper reuse.
  3. Run local linters and security scanners on changed files.
  4. Run the full test suite to guarantee 100% passing tests.
  5. Continuous Evolution: Capture new conventions in CONTEXT.md and suggest/apply updates to SKILL.md instructions via skill-evolution-updater to permanently prevent recurrence of issues.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at b1b34c0. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 2 months ago

README badge

README badge for h3xar0n/secure-tdd-agent-framework/local-refactor-scanner