- Home
- Skills
- Code Quality & Review
- consensus code repair
consensus code repair
A multi-agent auditing and remediation pipeline that uses adversarial debate to find and fix codebase vulnerabilities.
$10
Works with the AI Agents you already use
consensus code repair
Example session with this skill installed
Audit the current directory for security vulnerabilities and dead code, then generate a remediation report with fix proposals for any high-severity issues found.
- Read your context and instructions
- Compiled the consensus code repair
- Generated the document
I have completed the multi-phase audit of the codebase. The scanner identified 12 issues: 8 instances of dead code (FAST_PATH) and 4 logic/security vulnerabilities (FULL_DEBATE). Proposer Alpha and Beta have generated competing remediation strategies for the high-priority defects.
Audit Summary & Remediation Proposals
| Issue ID | Severity | Category | Status | Winner | Score |
|---|---|---|---|---|---|
| SEC-001 | Critical | Insecure API | Arbitrated | Hybrid | 94/100 |
| BUG-004 | High | Race Condition | Debating | TBD | -- |
| CLN-002 | Low | Dead Code | Applied | Alpha | 100/100 |
Top Proposal: SEC-001 (Broken Access Control)
Alpha Proposal (Conservative):
Wraps the existing endpoint in a permission check decorator. Minimal change to function signature.
Beta Proposal (Structural):
Refactors the Auth middleware to use a centralized RBAC provider and context managers for session cleanup.
Arbiter Decision:
Selected Hybrid. Combined Alpha's decorator for immediate closure with Beta's session management hardening.
# Refined Implementation for /api/v1/resource
@validated_permissions("admin")
def update_resource(resource_id: str, payload: dict):
with db_session_scope() as session:
# Beta's structural fix for resource lifecycle
resource = session.query(Resource).filter_by(id=resource_id).first()
if not resource:
raise ResourceNotFoundError(resource_id)
resource.update(payload)
return {"status": "success"}
Next steps
- Review the interactive dashboard at
AUDIT_REPORT.htmlfor full diffs. - Run
python3 scripts/report_manager.py apply SEC-001to commit the hybrid fix. - Execute the test suite to confirm zero regressions in the auth flow.
AUDIT_REPORT.html
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual patch cycles often leave behind systemic vulnerabilities, orphaned code, and structural regressions. Single-pass AI debugging frequently hallucinates or introduces breaking changes in coupled modules. This skill replaces ad-hoc fixing with a phase-gated, multi-agent pipeline that audits, triages, and resolves code defects using competitive debate and execution guardrails.
What it does
- Automated Auditing: Scans codebases using AST and call-graph analysis to find security leaks, logic bugs, and dead code.
- Blast-Radius Triage: Categorizes issues into fast-path cleanups or full-debate queues based on severity and dependency depth.
- Dual-Proposal Generation: Spawns two independent agent personas to develop competing fixes—one conservative minimal-diff and one structural refactor.
- Adversarial Red-Teaming: Subjects every proposed fix to cross-examination to catch hidden edge cases or new regression paths.
- Web-Verified Arbitration: Scores fixes against live CVE data and framework documentation using a weighted 100-point rubric.
- Safe Remediation: Implements verified patches with automatic rollback triggers if test suites or linters fail post-patch.
How it works
- Initialize Audit: Run the scanner script to generate a call-graph map and identify candidate vulnerabilities.
- Execute Triage: Use the report manager to import findings and partition them by risk level and confidence score.
- Conduct Debate: Generate Alpha and Beta proposals for complex issues, then trigger a cross-critique between agents.
- Arbitrate and Apply: Select the winning remediation based on security closure and compatibility, then apply the patch.
- Verify and Finalize: Run post-patch scans and tests; render the final interactive HTML dashboard and Markdown ledger.
Frameworks & tools
This skill utilizes Python-based AST analysis and call-graph mapping. It integrates with Git for version control snapshots and leverages Chart.js for rendering the interactive visual audit dashboard.
Why this beats prompting it yourself
Generic prompts lack the adversarial "check and balance" required for production code. This skill forces two agents to compete, preventing the "anchoring bias" where an AI sticks to its first (often flawed) idea. The built-in rollback guardrail ensures that a failed fix is automatically reverted before it can pollute your repository.
Use cases
- Auditing a repository for security vulnerabilities before a major production release.
- Cleaning up technical debt and dead code following a large-scale project migration.
- Resolving complex concurrency or architectural bugs that single-pass AI prompts cannot solve.
- Generating documented audit reports with CWE/CVE citations for compliance requirements.
Known limitations
Static analysis may flag false positives in dynamic frameworks like Django or FastAPI where routes are decorated. Requires a functional local Python environment to run the bundled CLI utilities.
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.
May flag false positives in dynamic frameworks (e.g. FastAPI/Django) where call sites are hidden. Requires local Python 3 for AST scanning and report management scripts.
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
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 today
- Software
Node.js
Python
Git