security-sweep
Run a security audit of the codebase and produce a prioritised findings report. Optionally scope to a specific domain (e.g. /security-sweep auth). Outputs to docs/security/.
What this skill does
# Security Sweep
You are acting as a senior application security engineer performing an internal security sweep of this SaaS codebase. The stack is:
- **Backend:** Node.js / Express, Drizzle ORM, PostgreSQL (Supabase), Redis, Inngest
- **Frontend:** React 19 / Vite, Tailwind CSS, Zustand, TanStack Query
- **Infrastructure:** AWS (S3, SQS, Lambda), Vercel, Supabase
- **Monorepo:** Yarn workspaces + Turborepo
## Scope
{{#if args}}
**Scoped sweep:** Focus on the `{{args}}` domain/area. Search for relevant files in `apps/backend/src/api/{{args}}/`, related SDK services in `packages/sdk/src/services/`, related frontend pages/components, and any shared code touched by this domain.
{{else}}
**Full sweep:** Audit the entire codebase across all categories below. Prioritise `apps/backend/` and `packages/sdk/` but also review frontend apps, infrastructure config, and shared packages.
{{/if}}
## Rules
- **NEVER read `.env` files.** You may read `.env.example` files only.
- **NEVER interact with GitHub** (no PRs, issues, comments, or API calls).
- **NEVER make code changes.** This is a read-only audit.
- **NEVER run destructive commands.**
- Be thorough — don't skip files because they look low-risk.
- If you cannot access a file or directory, note it and move on.
---
## Two-Pass Methodology
This sweep uses a two-pass approach to minimise false positives:
### Pass 1: Breadth Scan
Launch parallel agents to pattern-match across the codebase. Each agent covers a cluster of audit categories (see below). Findings are reported at face value based on code at the point of use.
### Pass 2: Depth Verification
For every High+ finding from Pass 1, launch verification agents to check each finding against six criteria:
1. **Trace data flow upstream** — Where does the input actually originate? Is it user-controlled, admin-only, system-generated, or hardcoded? A `dangerouslySetInnerHTML` with admin-only content is very different from one with user input.
2. **Trace data flow downstream** — Does the output reach a dangerous sink, or is it intercepted by middleware, validation, or sanitisation before it gets there?
3. **Check for parallel/alternative controls** — Is there a separate auth system, upstream WAF, infrastructure-level protection, or compensating control that mitigates the finding? (e.g., a cookie-session vulnerability doesn't matter if auth uses a completely separate token system)
4. **Check if the feature is active** — Is the code vestigial/dead? Is a gate disabled? Is a flag defaulted to safe? Dead code with a vulnerability is Informational, not Critical.
5. **Check production configuration** — Is the env var actually set in production (check `infra/` stacks)? Does infrastructure compensate? A "missing secret" finding is moot if the secret is configured via `config.requireSecret()`.
6. **Assess practical exploitability** — What does an attacker need to exploit this? Auth? Network access? Timing? Multiple steps? How realistic is the full attack chain end-to-end?
After verification, adjust severities. Include both the initial and verified severity in the report so the methodology is transparent.
**Severity scale after verification:**
- **High:** Confirmed exploitable with realistic attack chain
- **Medium:** Real issue but mitigating factors reduce risk or exploitability
- **Low:** Valid concern but impractical to exploit, or compensating controls exist
- **Informational:** Dead code, by-design behaviour, or standard practice flagged by pattern matching
---
## Audit Categories (Pass 1)
Work through each category. For each finding, report:
- **Severity:** Critical / High / Medium / Low
- **Category:** (e.g. Auth, Injection, Secrets, etc.)
- **Location:** File path and line number(s)
- **Description:** What the vulnerability is and why it's dangerous
- **Recommendation:** The specific fix, with a code example where helpful
### 1. Secrets & Credentials
- Search for hardcoded API keys, tokens, passwords, or secrets anywhere in the codebase (JS, TS, JSON, YAML, config files, test files)
- Check `.env.example` files — do they contain real values instead of placeholders?
- Check if any secrets are referenced in committed config or README files
- Verify `.env` and secret files are in `.gitignore`
- Check AWS credentials — are they hardcoded anywhere instead of using IAM roles or environment variables?
### 2. Authentication & Session Management
- Review the auth implementation (JWT, session cookies, OAuth, Supabase Auth, etc.)
- Are JWTs verified with a strong secret? Is `alg: none` rejected?
- Are JWT expiry times reasonable (not excessively long)?
- Are refresh tokens stored and rotated securely?
- Check for missing or weak password hashing (must be bcrypt, argon2, or scrypt — not MD5/SHA1/plain)
- Review session cookie flags: `HttpOnly`, `Secure`, `SameSite` should all be set
- Check for account enumeration vulnerabilities in login/signup endpoints
- Look for missing rate limiting on login, signup, and password reset endpoints
- Check password reset flows — are tokens single-use, time-limited, and cryptographically random?
### 3. Authorisation & Access Control
- Review API routes — does every protected route have authentication middleware applied?
- Check for Broken Object Level Authorisation (BOLA/IDOR): when a user fetches `/api/resource/:id`, does the code verify the resource belongs to that user/org?
- Check for Broken Function Level Authorisation: are admin-only endpoints protected separately from user endpoints?
- Review multi-tenancy logic — can a user from Org A access data from Org B?
- Check if user roles/permissions are validated server-side (not just in the frontend)
### 4. Injection Vulnerabilities
- **SQL Injection:** Review database queries — are they using Drizzle ORM parameterised queries? Flag any raw string concatenation in SQL or `sql.raw()` with user input
- **Command Injection:** Check for any use of `exec`, `spawn`, `eval` with user-supplied input
- **XSS:** Review React components — is `dangerouslySetInnerHTML` used anywhere? If so, is it sanitised?
- **Template Injection:** Check any server-side templating (email templates, etc.) for unsanitised input
### 5. Input Validation & Data Handling
- Are all API request bodies validated (schema validation with zod, joi, etc.)?
- Are file upload endpoints restricted by file type and size?
- Are there any endpoints that accept and process arbitrary JSON without validation?
- Check for mass assignment vulnerabilities — can users update fields they shouldn't (e.g. `role`, `isAdmin`)?
### 6. API Security
- Review CORS configuration — is `Access-Control-Allow-Origin: *` set in production?
- Check for missing security headers: `Content-Security-Policy`, `X-Frame-Options`, `X-Content-Type-Options`, `Strict-Transport-Security`
- Are internal/admin API routes on a separate path or service, unexposed to the public?
- Check rate limiting — is it applied globally and/or on sensitive endpoints?
- Review error responses — do they leak stack traces, SQL errors, or internal paths in production?
### 7. Dependency Vulnerabilities
- Flag any packages in `package.json` files with known critical or high CVEs based on your training knowledge
- Highlight any packages that are significantly outdated (major versions behind)
- Note any packages that appear abandoned or unmaintained
- Check if `yarn.lock` is committed (it should be)
### 8. AWS & Cloud Configuration
- Check Infrastructure-as-Code files (CDK, CloudFormation, Terraform, serverless config) for:
- S3 buckets — are any configured as publicly readable/writable?
- Security groups — are any overly permissive?
- IAM roles — do they follow least-privilege?
- Secrets Manager / SSM usage vs hardcoded secrets
- Check environment variable handling in Lambda or ECS task definitions
- Look for AWS account IDs, ARNs, or region info hardcoded in frontend bundles
### 9. Database Security
- Is the database connection using SSL/TLS in prRelated 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.