- Home
- Skills
- Code Quality & Review
- sec code refactoring linter
sec code refactoring linter
Automated security linter and refactoring tool for Python and TypeScript codebases.
Free
Works with the AI Agents you already use
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
- Run
python scripts/linter.py --target ./src --language python --fixto apply these changes to the source files. - Review the
SEC-001warning insrc/config.pyregarding the hardcoded API key, as this requires manual migration to environment variables. - Generate a full report using
--format json --output security_report.jsonfor 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
- Targeting involves pointing the linter at a specific file or directory using the
--targetflag. - Analysis runs the audit rules against Python, TypeScript, or JavaScript source code to identify SEC-series violations.
- Review uses the
--diffand--dry-runflags to inspect proposed code changes without modifying the disk. - Remediation applies automatic fixes with the
--fixflag 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.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.
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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
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 to use
No account required to browse
Trust & safety
Security scan
Security scan passed 4 days ago
- Free with an Agensi account
- Software
Python