plugins/dev/skills/audit/SKILL.md
On-demand security and code quality audit. Use when checking for vulnerabilities, security issues, code smells, or compliance problems.
npx skillsauth add madappgang/magus auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The audit skill provides comprehensive on-demand security and code quality audits for your codebase. It identifies vulnerabilities, security issues, code smells, outdated dependencies, exposed secrets, and compliance problems across all supported technology stacks.
When to Use:
Technology Coverage:
What Gets Checked:
Detection Methods:
What Gets Checked:
Package Managers Supported:
Tools Used:
npm audit / yarn audit / pnpm auditgo mod verify + vulnerability databasescargo auditpip-audit / safetyWhat Gets Detected:
Detection Patterns:
False Positive Reduction:
.gitignore patterns.env.example templatesWhat Gets Analyzed:
Metrics Calculated:
Run all audit categories:
Please run a full security and quality audit of this codebase
The audit will:
Security Only:
Run a security audit focusing on OWASP top 10 vulnerabilities
Dependencies Only:
Audit all dependencies for vulnerabilities and outdated packages
Secrets Only:
Scan for exposed secrets and credentials
Code Quality Only:
Analyze code quality and identify code smells
Specific Directory:
Audit the /src/auth directory for security issues
Specific Files:
Audit UserController.ts and AuthService.ts for vulnerabilities
Pre-Deployment:
Run pre-deployment audit checklist
Reports classify findings by severity:
# Security and Quality Audit Report
**Generated**: 2026-01-28 14:32:00
**Scope**: Full codebase audit
**Files Scanned**: 247
**Duration**: 8.3 seconds
## Executive Summary
- CRITICAL: 2 findings
- HIGH: 5 findings
- MEDIUM: 12 findings
- LOW: 23 findings
- INFO: 8 findings
**Risk Score**: 7.2/10 (HIGH)
## Critical Findings
### [CRITICAL-001] SQL Injection Vulnerability
**File**: src/database/queries.ts:42
**Severity**: CRITICAL
**Category**: Security - SQL Injection
**Issue**: User input concatenated directly into SQL query without sanitization.
**Code**:
```typescript
const query = `SELECT * FROM users WHERE email = '${email}'`;
Impact: Attacker can execute arbitrary SQL commands.
Recommendation: Use parameterized queries or ORM.
Fix:
const query = db.prepare('SELECT * FROM users WHERE email = ?').bind(email);
File: src/config/api.ts:15 Severity: CRITICAL Category: Security - Exposed Secret
Issue: Hardcoded API key found in source code.
Code:
const STRIPE_SECRET_KEY = "sk_live_abc123xyz789";
Impact: Unauthorized access to Stripe account.
Recommendation: Move to environment variable.
Fix:
const STRIPE_SECRET_KEY = process.env.STRIPE_SECRET_KEY;
File: package.json:23 Severity: HIGH Category: Dependencies
Issue: [email protected] has known vulnerability (CVE-2021-23337)
CVE Details:
Recommendation: Upgrade to [email protected] or higher
Fix:
npm install lodash@latest
[... additional findings ...]
Overall: 6/10 passing (60%)
Immediate Actions (CRITICAL/HIGH):
Short Term (MEDIUM):
Long Term (LOW/INFO):
## Integration with Dev Plugin
### With Code Analysis Agent
Use code-analysis enrichment before audit:
First enrich the codebase with mnemex, then run security audit
This provides:
- Context-aware vulnerability detection
- Better false positive filtering
- Dependency graph analysis
### With Test Architect Agent
Combine audit with test coverage:
Run audit and identify untested critical code paths
### With Optimize Skill
Security-performance trade-offs:
Audit security implications of performance optimizations
## Best Practices
### 1. Regular Audits
**Recommended Schedule**:
- Daily: Dependency vulnerability scans (CI/CD)
- Weekly: Full security audit
- Pre-deployment: Comprehensive audit
- Post-incident: Targeted security review
### 2. Incremental Audits
For large codebases:
Audit files changed in the last 7 days
This focuses on recent changes and reduces noise.
### 3. Baseline and Track
**First Audit**:
Run full audit and establish security baseline
**Subsequent Audits**:
Run audit and compare against baseline
Track improvements over time.
### 4. Prioritize by Risk
Focus on:
1. User-facing authentication code
2. Payment processing
3. Data storage and retrieval
4. API endpoints with PII
5. Third-party integrations
### 5. Automate in CI/CD
**GitHub Actions Example**:
```yaml
- name: Security Audit
run: |
npm audit --audit-level=high
# Run custom audit script
Pre-commit Hook:
#!/bin/bash
# Scan staged files for secrets
git diff --cached --name-only | xargs grep -E "(api_key|secret|password)"
Request:
We're deploying to production tomorrow. Run a comprehensive security audit.
Audit Process:
Report Highlights:
Outcome: Deployment blocked until CRITICAL/HIGH fixed
Request:
Check all npm dependencies for known vulnerabilities
Process:
npm audit --jsonReport:
Found 3 vulnerabilities (1 high, 2 moderate)
HIGH: [email protected] (CVE-2021-3749)
- Fix available: [email protected]
- Breaking: No
- Run: npm install [email protected]
MODERATE: [email protected] (CVE-2020-28469)
- Fix available: [email protected]
- Breaking: Yes (ESM only)
- Review: Migration guide needed
Request:
Audit for GDPR compliance issues
Checks:
Report:
GDPR Compliance Audit
[PASS] Data encryption at rest
[FAIL] Missing data retention policy
[FAIL] No user data export endpoint
[PASS] Consent management implemented
[WARN] Privacy policy link outdated
[PASS] TLS 1.3 enforced
Request:
Identify code quality issues and technical debt
Analysis:
Top Issues:
1. UserService.ts - Complexity 28 (threshold: 15)
Recommendation: Extract validation logic
2. utils/helpers.ts - 234 lines duplicated in 3 files
Recommendation: Create shared utility module
3. api/routes.ts - 847 lines (threshold: 500)
Recommendation: Split into feature-based modules
Security Focus:
Quality Focus:
Security Focus:
Quality Focus:
Security Focus:
Quality Focus:
[Developer] → Request audit
↓
[Audit Skill] → Scan codebase
↓
[Generate Report] → Categorize findings
↓
[Prioritize] → CRITICAL → HIGH → MEDIUM → LOW
↓
[Fix Critical] → Apply fixes
↓
[Re-audit] → Verify fixes
↓
[Update Baseline] → Track progress
The audit skill provides comprehensive security and quality analysis on-demand. Use it regularly to maintain code health, catch vulnerabilities early, and ensure compliance with industry standards.
Key Takeaways:
For performance analysis, see the optimize skill. For test coverage gaps, see the test-coverage skill.
testing
A test skill for validation testing. Use when testing skill parsing and validation logic.
tools
--- name: bad-skill description: This skill has invalid YAML in frontmatter allowed-tools: [invalid, array, syntax prerequisites: not-an-array --- # Bad Skill This skill has malformed frontmatter that should fail parsing. The YAML has: - Unclosed array bracket - Wrong type for prerequisites (should be array, not string)
development
Sync model aliases from the curated Firebase database. Fetches default model assignments, short aliases, team compositions, and known model metadata from the claudish API. Run this to get fresh model recommendations.
tools
Release one or more Magus plugins to the distribution repos (magus, magus-alpha, magus-marketing). Handles version inference from git history, marketplace.json updates, tagging, and force-push to lean dist repos. Use whenever the user says "release kanban", "release the dev plugin", "cut a new version of gtd", "bump kanban to 1.7", or hands you a batch like "release kanban and gtd". Also use for multi-plugin releases and for checking what a release would contain before committing.