sec code refactoring linter

    1

    Automated security linter and refactoring tool for Python and TypeScript codebases.

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    sec code refactoring linter

    Example session with this skill installed

    Scan the ./src directory for Python security issues, show me a diff of the proposed fixes for any bare exceptions or debug flags, but don't write to the files yet.

    • Read your context and instructions
    • Compiled the sec code refactoring

    I have scanned the ./src directory for Python-specific security vulnerabilities. I identified two instances of SEC-007 (Bare Except Clause) and one instance of SEC-009 (Insecure Debug Mode).

    Security Audit Diff Preview

    --- src/app.py
    +++ src/app.py
    @@ -12,5 +12,5 @@
    -    except:
    +    except Exception as err:
             print("An error occurred")
     
     if __name__ == "__main__":
    -    app.run(debug=True)
    +    app.run(debug=False)
    
    --- src/utils/db_connector.py
    +++ src/utils/db_connector.py
    @@ -45,3 +45,3 @@
         except ImportError:
             raise
    -    except:
    +    except Exception as err:
             logging.error(f"Database connection failed: {err}")
    

    Next steps

    1. Run python scripts/linter.py --target ./src --language python --fix to apply these changes to the source files.
    2. Review the SEC-001 warning in src/config.py regarding the hardcoded API key, as this requires manual migration to environment variables.
    3. Generate a full report using --format json --output security_report.json for your records.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Legacy codebases often harbor hidden security risks like hardcoded keys or unsafe dynamic execution. This skill automates the detection of these anti-patterns and refactors common hygiene issues in Python and TypeScript projects.

    What it does

    • Vulnerability scanning identifies high-severity risks including SQL injection, command injection, and insecure deserialization.
    • Secret detection flags hardcoded API keys, passwords, and private tokens before they reach version control.
    • Automated refactoring fixes bare exception clauses, empty catch blocks, and insecure debug flags without manual intervention.
    • Diff generation provides unified diff previews of proposed security changes for manual review.
    • CI/CD integration enforces strict security gates by returning non-zero exit codes when vulnerabilities are detected.

    How it works

    1. Targeting involves pointing the linter at a specific file or directory using the --target flag.
    2. Analysis runs the audit rules against Python, TypeScript, or JavaScript source code to identify SEC-series violations.
    3. Review uses the --diff and --dry-run flags to inspect proposed code changes without modifying the disk.
    4. Remediation applies automatic fixes with the --fix flag or generates a structured JSON report for manual triage.

    Frameworks & tools

    This tool runs on Python 3.8+ and targets Python, TypeScript, and JavaScript codebases. It operates as a standalone CLI utility with zero mandatory external dependencies, though it supports the rich library for enhanced terminal output.

    Why this beats prompting it yourself

    Generic prompts often miss subtle injection risks or fail to provide valid unified diffs for large files. This skill uses a structured rule engine (SEC-001 through SEC-010) to ensure consistent detection and refactoring that adheres to production standards every time.

    Use cases

    • Pre-commit audits to catch hardcoded secrets and debug flags before pushing code.
    • Legacy cleanup to automatically refactor silent exception swallowing in old TypeScript files.
    • CI/CD security gates to block builds containing raw SQL formatting or unsafe eval() calls.
    • Code reviews to generate structured JSON reports of security smells for team analysis.

    Known limitations

    Requires Python 3.8+ to execute the linter script. Auto-fixes are currently limited to specific rules like bare exceptions and debug flags; high-severity logic risks require manual remediation.

    Requires Python 3.8+ environment. Auto-fixes are restricted to rules SEC-007, SEC-008, and SEC-009; other vulnerabilities require manual refactoring based on tool suggestions.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    1 use

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 4 days ago

    • Free with an Agensi account

    Requires

    Python

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed4 days ago

    What's inside

    Frequently Asked Questions

    This skill supports Python (3.8+), TypeScript, and JavaScript codebases. It is designed to work as a standalone CLI tool or integrated into automated AI agent workflows that handle code maintenance and security auditing.

    While it detects high-severity risks like SQL injection, its automated refactoring is focused on "hygiene" issues like bare exceptions and insecure debug flags. Complex logic vulnerabilities will be flagged in a report for manual developer remediation to ensure system stability.

    Unlike generic AI prompts that can be inconsistent, this skill uses a structured SEC-series rule engine. This ensures precise detection of hardcoded secrets and produces valid unified diffs that can be reliably applied to large production files.

    The package includes the core linter script, the SEC-series rule engine, and documentation for CLI usage. You will also receive guidance on how to integrate the tool into your CI/CD pipelines for automated security gating.

    Yes, by using the `--diff` and `--dry-run` flags, you can preview every proposed change in a unified diff format. This allows you to verify the security improvements before any modifications are actually written to your source files.

    The skill operates with zero mandatory external dependencies (outside of Python 3.8+), making it highly portable. An optional dependency on the 'rich' library is supported if you prefer enhanced, color-coded terminal output.

    New in Code Quality & Review