- Home
- Skills
- Code Quality & Review
- Code Quality Audit
Code Quality Audit
by Artak Kolyan
Execute internal code quality audits with local progress tracking and timestamped delta reports.
$15
Code Quality Audit
Example session with this skill installed
/han-code-quality-audit run modularity and complexity on the current repo
- Read your context and instructions
- Compiled the code quality audit
Audit started for 2 properties. **Progress URL:** http://localhost:8080/han-code-quality-audit/2025-05-20T101500 I have completed the audit for Modularity and Complexity. The reports are available in `han-code-quality-audit/2025-05-20T101500/`. ## 08.Complexity.2025-05-20T101500.md - Run: 2025-05-20T101500 - Kind: baseline - Previous: none - Evidence: source code and tool output only This report analyzes cyclomatic complexity and nesting depth across the `src/core` and `src/api` trees. The analysis focused on functions exceeding a 15-point complexity threshold as reported by internal tooling. ## Index | | Where | Hardness | Problem | | --- | --- | --- | --- | | 1 | `src/api/router.ts` `handleRequest` | Large | Deeply nested switch statement handles routing, auth, and validation in one block. | | 2 | `src/core/processor.ts` `transformData` | Moderate | Multiple interdependent loops process data streams without intermediate state. | ## 1. Deeply nested routing logic creates high maintenance risk - Id: `complexity | src/api/router.ts | handleRequest | baseline` - Status: new - Hardness: Large **Where.** `src/api/router.ts` `handleRequest` lines 45–180. **Excerpt.** ```typescript // src/api/router.ts lines 45-60 async function handleRequest(req: Request) { switch (req.method) { case 'POST': if (req.url.includes('/upload')) { // ... 120 more lines of nested logic ``` **Why it is bad.** The `handleRequest` function manages three distinct responsibilities: URL routing, payload validation, and authentication checks. A single change to the auth flow requires touching this critical path, risking total service downtime. The nesting depth (7 levels) makes it difficult to trace error propagation. **How to improve.** Extract the route matching into a dedicated `Router` class. Move payload validation for each method into separate middleware functions. The `handleRequest` symbol should only orchestrate calls to these units. **Done when.** `handleRequest` is under 30 lines and contains no nested `switch` or `if` statements related to payload structure. **Next steps** 1. Open the progress page at the URL provided to see the tool execution logs. 2. Review `07.Modularity.2025-05-20T101500.md` for related structural issues. 3. Address the `Large` hardness finding in `router.ts` before starting new feature work.
Connects securely to your tools. The creator never sees your data.
About this skill
Maintaining code quality in large repositories is difficult when architectural drift and technical debt go unmonitored. This skill executes a deep, internal code quality audit across nine specific properties, ranging from architectural consistency to observability, without modifying your source code. ## What it does - **Architectural Audit** verifies code adherence to in-repository architectural decisions and style guides. - **Deduplication Engine** identifies both exact and near-duplicate code blocks that increase maintenance burden. - **Concern Isolation** flags violations in separation of concerns and identifies non-pure functions. - **Literal Extraction** detects hardcoded domain values that should be modularized. - **Complexity Analysis** pinpointing units with high cognitive load or poor modularity. - **Live Monitoring** serves a local progress page to track the audit status without polluting chat history. ## How it works 1. **Initialization** starts a local Python-based progress server and resolves the workspace path. 2. **Environment Check** detects project languages and identifies missing linting or analysis tools. 3. **Automated Analysis** runs internal scripts to collect tool output and scan the source tree. 4. **Report Generation** produces timestamped Markdown reports for each property in a dedicated audit folder. ## Frameworks & tools The skill utilizes a suite of Python-based utility scripts including `progress.py`, `detect_languages.py`, `check_tools.py`, and `run_tools.py`. It integrates with standard language-specific static analysis tools and reads internal project guides for observability and architecture. ## Why this beats prompting it yourself Manual prompts often result in vague suggestions or missed edge cases in large files. This skill follows a strict nine-point inspection protocol, maintains a delta baseline between runs to track new vs. existing issues, and provides specific "Why it is bad" justifications rooted in actual code logic. ## Use cases - Auditing a legacy repository to prioritize refactoring efforts based on risk. - Checking architectural compliance after a large feature merge. - Finding near-duplicate logic that should be unified into a shared utility. - Validating observability coverage against internal logging standards. ## Known limitations Does not support creating tasks or tickets directly from reports. Requires user permission to install missing third-party analysis tools. Only reads source code and tool outputs, ignoring markdown documentation and comments.
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 10 days ago
- Software
Python
Permissions
What's inside
Frequently Asked Questions
New in Code Quality & Review
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.