code-auditing
This skill should be used when the user asks to "audit code", "find technical debt", "perform a security review", "identify dead code", "analyze code quality", "check best practices", "run a code audit", or needs a systematic methodology for comprehensive codebase analysis.
What this skill does
# Code Auditing Skill Comprehensive methodology for systematic code quality audits. ## When to Use - Comprehensive code quality audits - Security vulnerability assessments - Technical debt identification - Pre-release code reviews - Best practices verification - Library and dependency audits ## Audit Phases ### Phase 0: Pre-Analysis Setup 1. Check for project configuration files (package.json, tsconfig.json, etc.) 2. Identify tech stack and main libraries 3. Check for linting/formatting configs 4. Run existing linting/testing commands as baseline 5. Load documentation for identified core libraries ### Phase 1: Discovery 1. Find all code files by type 2. Create tracking list for each file 3. Group files by module/feature for contextual analysis ### Phase 2: File-by-File Analysis For each file, analyze for: - Dead code (unused functions, variables, imports) - Code smells and anti-patterns - Custom implementations that could use established libraries - Security vulnerabilities - Performance issues - Outdated patterns or deprecated APIs - Missing error handling - Overly complex functions - Duplicate code ### Phase 3: Best Practices Verification For every library and framework: 1. Retrieve official documentation 2. Compare implementation against official patterns 3. Identify deviations from recommendations 4. Note outdated usage patterns 5. Flag discouraged anti-patterns ### Phase 4: Pattern Detection Look for recurring issues: - Common anti-patterns across files - Duplicated logic that could be abstracted - Inconsistent coding styles - Missing error handling patterns ### Phase 5: Library Recommendations For custom implementations: 1. Check if current libraries provide the functionality 2. Search for mature ecosystem packages 3. Verify library health (commits, issues, activity) 4. Check compatibility with project setup ### Phase 6: Comprehensive Report Generate detailed report with: - Executive summary - Critical issues requiring immediate attention - File-by-file findings - Prioritized action plan - Effort estimates - Library recommendations ## Issue Priority Levels - **Critical** - Security vulnerabilities, broken functionality - **High Priority** - Performance bottlenecks, unmaintainable code - **Medium Priority** - Code quality, best practices deviations - **Low Priority** - Style, minor improvements - **Quick Wins** - Less than 30 minutes to fix ## Analysis Categories ### Security - Hardcoded secrets - SQL injection risks - XSS vulnerabilities - Missing input validation - Exposed sensitive data ### Performance - Inefficient algorithms - Blocking operations - Memory leaks - Missing caching opportunities - N+1 query patterns ### TypeScript/Type Safety - Missing type annotations - Use of `any` type - Custom types duplicating official types - Missing @types packages ### Async/Promise Issues - Missing await keywords - Unhandled promise rejections - Callback hell ### Dead Code - Unused imports and exports - Unused functions, classes, and methods - Unused variables and types - Unreachable code blocks - Unused files (not imported anywhere) - Unused dependencies **Tools:** - JavaScript/TypeScript: `npx knip --reporter json` - Python: `deadcode . --dry` **Important:** Always verify tool findings before reporting. Check for: - Dynamic imports (`import(variable)`) - Framework patterns (React components, decorators) - Re-exports for public API - Entry points (CLI scripts, serverless handlers) ## Resources See the reference documents for complete methodologies: - `references/audit-methodology.md` - Full 6-phase audit process with detailed checklists - `references/dead-code-methodology.md` - Dead code detection tools, verification, and cleanup workflows ## Quick Reference ### Before Starting - [ ] Read project configuration files - [ ] Identify tech stack and libraries - [ ] Run existing linters as baseline - [ ] Create file tracking list ### During Audit - [ ] Mark files as in-progress - [ ] Analyze each category systematically - [ ] Note specific line numbers - [ ] Document before/after examples - [ ] Mark files as completed ### After Audit - [ ] Categorize all findings by priority - [ ] Generate comprehensive report - [ ] Save report to project root - [ ] Provide brief console summary
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.