security-audit
Security audit for code review and vulnerability analysis
What this skill does
# Security Audit Command (Wrapper) You perform security reviews of pull requests by invoking the security-analyst-specialist agent and posting the results. **PR Number:** $ARGUMENTS **Note:** This command is automatically run by `/work` after PR creation. For manual security audits, use: `/psd-coding-system:security-audit [pr_number]` ## Workflow ### Step 1: Invoke Security Analyst Agent Use the Task tool to invoke security analysis: - `subagent_type`: "psd-coding-system:review:security-analyst-specialist" - `description`: "Security audit for PR #$ARGUMENTS" - `prompt`: "Perform comprehensive security audit on PR #$ARGUMENTS. Analyze all changed files for: 1. **Security Vulnerabilities:** - SQL injection, XSS, authentication bypasses - Hardcoded secrets or sensitive data exposure - Input validation and sanitization issues 2. **Architecture Violations:** - Business logic in UI components - Improper layer separation - Direct database access outside patterns 3. **Best Practices:** - TypeScript quality and type safety - Error handling completeness - Test coverage for critical paths - Performance concerns Return structured findings in the specified format." ### Step 1.5: Data Integrity Scan Always invoke the data-integrity-guardian for PII and compliance scanning during security audits: Use the Task tool: - `subagent_type`: "psd-coding-system:review:data-integrity-guardian" - `description`: "Data integrity scan for PR #$ARGUMENTS" - `prompt`: "Perform comprehensive PII and compliance scan on PR #$ARGUMENTS. Check for: 1. **PII Exposure:** - Unencrypted sensitive data (SSN, email, phone, credit card) - Sensitive data in logs, URLs, or error messages - Plaintext password storage 2. **FERPA Compliance (Education):** - Student record protection (grades, IEP, attendance, disciplinary) - Parent/guardian data handling - Directory information opt-out support 3. **GDPR Compliance:** - Right to erasure support - Data portability capabilities - Consent management - Data retention policies 4. **Access Control:** - Role-based access on sensitive endpoints - Data scoping (users only see their own data) - Authentication on protected routes Return structured compliance findings." **Merge data integrity findings with security analysis** in the consolidated comment. ### Step 2: Post Consolidated Comment The agent will return structured findings. Format and post as a single consolidated PR comment: ```bash # Post the security review as a single comment gh pr comment $ARGUMENTS --body "## Automated Security & Best Practices Review [Format the agent's structured findings here] ### Summary - Critical Issues: [count from agent] - High Priority: [count from agent] - Low Priority: [count from agent] ### Critical Issues (Must Fix Before Merge) [Critical findings from agent with file:line, problem, fix, reference] ### High Priority (Should Fix Before Merge) [High priority findings from agent] ### Low Priority (Fix Before Merge) [Low priority findings from agent] ### Positive Practices Observed [Good practices noted by agent] ### Required Actions 1. Fix all critical issues 2. Fix all high priority issues 3. Fix all low priority issues 4. Run security checks: \`npm audit\`, \`npm run lint\`, \`npm run typecheck\` 5. Verify all tests pass after fixes --- *Automated security review by security-analyst-specialist agent*" echo "Security audit completed and posted to PR #$ARGUMENTS" ``` ### Step 3: Fix All Findings After posting the review comment, fix every finding. Do NOT create GitHub issues for any findings — every critical, high, and low priority finding gets a code fix in this session. If a finding cannot be fixed due to an external constraint outside this codebase, stop and use the AskUserQuestion tool to explain the constraint and ask the user how they want to handle it. Do not add TODOs. No issue creation. 1. **Critical issues** — Fix immediately, these block merge 2. **High priority** — Fix all of them 3. **Low priority** — Fix all of them Commit fixes and push: ```bash git add [specific changed files] git commit -m "fix: address security audit findings for PR #$ARGUMENTS - [List each finding fixed]" git push ``` ## Key Features - **Comprehensive Analysis**: Covers security, architecture, and best practices - **Single Comment**: All findings consolidated into one easy-to-review comment - **Actionable Feedback**: Includes specific fixes and code examples - **Severity Levels**: Critical, High, Suggestions - **Educational**: References to OWASP and project documentation ## When to Use **Automatic:** The `/work` command runs this automatically after creating a PR **Manual:** Use this command when: - You want to audit an existing PR - You need to re-run security analysis after fixes - You're reviewing someone else's PR ## Example Usage ```bash # Manual security audit of PR #123 /psd-coding-system:security-audit 123 ``` The agent will analyze all changes in the PR and post a consolidated security review comment.
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.