- Home
- Skills
- Agents & Orchestration
- commit guard
Works with the AI Agents you already use
commit guard
An uncompromising pre-commit auditor that enforces architectural integrity, security hygiene, and compliance.
$10
commit guard
Example session with this skill installed
"Review my uncommitted changes with commit-guard." or
"Is my code ready to commit?" or
"Run a pre-commit audit on branch feature/auth against main." or
"Check for dead code and security flaws in my diff."
- Read your context and instructions
- Compiled the commit guard
I have completed the pre-commit audit of your uncommitted changes. The scan identified one critical security blocker and two warnings regarding code bloat and performance.
Commit Guard Audit Report
Verdict: 🛑 BLOCK
🛑 Critical Findings
| File | Line | Pillar | Issue |
|---|---|---|---|
src/auth/provider.py | 42 | Security | Hardcoded API secret detected in constructor. |
src/utils/logger.py | 12 | Dead Code | Leftover print(token) statement used for debugging. |
⚠️ Warnings
| File | Line | Pillar | Issue |
|---|---|---|---|
src/db/queries.py | 88 | Efficiency | Potential N+1 query in get_user_posts loop. |
src/api/v1.ts | 104 | Documentation | Missing docstring for exported endpoint. |
Recommended Fixes
# src/auth/provider.py
# BEFORE: self.key = "sk-test-55512345"
# AFTER:
import os
self.key = os.getenv("PROVIDER_API_KEY")
# src/db/queries.py
# BEFORE: [get_post(id) for id in user_post_ids]
# AFTER:
posts = db.session.query(Post).filter(Post.id.in_(user_post_ids)).all()
Next steps
- Move the API secret to an environment variable or
.envfile. - Remove the debug print statement in
logger.py. - Refactor the list comprehension in
queries.pyto use a single batch query.
Connects securely to your tools. The creator never sees your data.
About this skill
Catching architectural leaks and security flaws manually is a bottleneck. This skill acts as a deterministic pre-commit auditor that hunts down dead code, hardcoded secrets, and compliance violations before they hit your git history.
What it does
- Dead code elimination: Identifies unused imports, orphaned helpers, and leftover debug statements like
console.logorprint(). - Security hygiene: Flags hardcoded credentials, injection vulnerabilities, and weak cryptographic primitives.
- Architectural enforcement: Detects layer violations, circular dependencies, and boundary leaks.
- Performance auditing: Spots $O(N^2)$ loops, N+1 query patterns, and unclosed resources.
- Compliance checking: Validates changes against SemVer, OWASP Top 10, NIST, GDPR, and SOC 2 standards.
- Context-aware scans: Specialized checks for AI/LLM systems, infrastructure/Docker, and accessibility (WCAG).
How it works
- Scope selection: You trigger a scan for uncommitted changes, staged files, a specific branch, or the full codebase.
- Deterministic scan: The internal
inspect_diff.pyscript extracts a unified diff and runs heuristic regex checks. - Multi-pillar audit: The agent evaluates changes against a massive matrix of security, efficiency, and design rules.
- Structured verdict: You receive a
BLOCK,WARN, orPASSreport with line-specific fixes.
Frameworks & tools
Works with any Git-based workflow. Includes specific auditing logic for Python, TypeScript/JavaScript, Rust, Go, Docker, GitHub Actions, and OpenAPI/GraphQL schemas.
Why this beats prompting it yourself
Generic prompts often miss "silent" issues like N+1 queries or specific regulatory compliance requirements (PII in logs). This skill uses a structured 3-phase workflow and dedicated scripts to ensure no part of the diff is overlooked.
Use cases
- Pre-commit cleanup: Strip out debuggers and unused variables before staging.
- PR readiness: Audit a feature branch against the main branch to ensure architectural integrity.
- Security sweep: Scan the full codebase for hardcoded secrets or unpinned Docker tags.
- Documentation sync: Verify that API changes match the OpenAPI schema and ADRs.
Known limitations
Requires a local Python3 environment to run the included inspection scripts. Scan depth is limited by the provided git diff context.
Public repository available at github.com/h45sh/commit-guard.
Requires Python3 for deterministic diff extraction. Effectiveness is tied to Git history availability. Does not perform runtime dynamic analysis.
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 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
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 7 days ago
Requires
Permissions
Requires local shell access to execute `git diff` / `git status` and run the local diff inspection script. Performs zero external network calls, zero telemetry, and never transmits code outside your machine.