skills/code-audit/SKILL.md
Perform a comprehensive security and code quality audit on web-based projects (React, Next.js, NestJS). Uses the OWASP Top 10:2025 standard as the primary security framework. Generates a detailed Markdown report with findings categorized by severity (CRITICAL, HIGH, MEDIUM, LOW). Use this skill whenever the user asks to audit, review, scan, or analyze their codebase for vulnerabilities, security issues, code quality problems, bad patterns, or potential bugs. Also trigger when the user mentions "OWASP", "security review", "vulnerability scan", "code audit", "pentest review", "security assessment", "code health check", or asks "is my code secure?" or "find bugs in my project". Trigger even if the user just says "audit this" or "check my code" pointing at a web project. This skill supports React, Next.js, and NestJS projects, including monorepos containing multiple project types.
npx skillsauth add cmglezpdev/custom-skills code-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.
This skill performs a structured security and code quality audit against the OWASP Top 10:2025 standard. It produces a severity-classified Markdown report with actionable remediation guidance.
Follow these steps in order. Do not skip steps. Read the relevant reference files before scanning.
Run these commands to understand the project:
# Find the project root and understand structure
ls -la <project_root>
cat <project_root>/package.json
find <project_root> -name "tsconfig*.json" -maxdepth 2 | head -5
find <project_root> -name "next.config*" -maxdepth 2 | head -3
find <project_root> -name "nest-cli.json" -maxdepth 2 | head -3
Determine the project type(s):
next in dependencies and next.config.*react in dependencies, no next@nestjs/core in dependencies, or nest-cli.jsonworkspaces in package.json, or lerna.json, nx.json, turbo.jsonBased on the detected project type, read the corresponding reference files:
references/owasp-2025-checks.md (the OWASP Top 10:2025 mapping)references/frontend-checks.mdreferences/nestjs-checks.mdThese files contain the specific patterns, anti-patterns, and code signatures to look for.
Gather these files for analysis (adapt paths to the project structure):
Configuration & Dependencies (always):
package.json and package-lock.json / yarn.lock / pnpm-lock.yaml.env* files (check if they exist, flag if committed)tsconfig.json.eslintrc*, .prettierrc*Dockerfile, docker-compose.yml if present.github/workflows/, .gitlab-ci.yml, etc.)Next.js specific:
next.config.* (rewrites, headers, CSP, image domains)middleware.ts / middleware.jsapp/layout.tsx or pages/_app.tsxapp/api/**/route.ts or pages/api/**React specific:
src/index.tsx, src/main.tsx)NestJS specific:
main.ts (bootstrap, CORS, helmet, validation pipe)app.module.ts*.guard.ts, *.interceptor.ts, *.filter.ts, *.middleware.ts*.controller.ts and *.service.tsSystematically analyze each OWASP Top 10:2025 category. For each category:
Use grep -rn and find commands to search for patterns efficiently:
# Examples of useful searches
grep -rn "dangerouslySetInnerHTML" <project_root>/src/ --include="*.tsx" --include="*.jsx"
grep -rn "eval(" <project_root>/src/ --include="*.ts" --include="*.js"
grep -rn "@Public()" <project_root>/src/ --include="*.ts"
grep -rn "createQueryBuilder" <project_root>/src/ --include="*.ts"
grep -rn "innerHTML" <project_root>/src/ --include="*.ts" --include="*.tsx"
grep -rn "CORS" <project_root>/src/ --include="*.ts"
grep -rn "helmet" <project_root>/src/ --include="*.ts"
grep -rn "class-validator" <project_root>/package.json
grep -rn "rate" <project_root>/src/ --include="*.ts" -i
grep -rn "\.env" <project_root>/.gitignore
find <project_root> -name "*.env" -not -path "*/node_modules/*"
find <project_root> -name "*.pem" -o -name "*.key" -not -path "*/node_modules/*"
Beyond pattern matching, READ the actual source files for logic-level issues that grep cannot catch:
Each finding gets one severity level:
CRITICAL — Exploitable now with high impact:
eval(), Function() with user input)HIGH — Exploitable with moderate effort or significant impact:
MEDIUM — Requires specific conditions to exploit or moderate impact:
LOW — Best practice violations, defense-in-depth gaps:
rel="noopener noreferrer" on external linksUse the template in scripts/report-template.md as the base structure. The report must include:
Each finding in the detailed section must contain:
AUDIT-001)<project_root>/AUDIT-REPORT.md/mnt/user-data/outputs/AUDIT-REPORT.md so the user can download itreq.query.search rendered via dangerouslySetInnerHTML in SearchResults.tsx:42" is actionable.development
Implement structured, wide-event logging in NestJS applications following the canonical log line / wide event pattern. Use this skill whenever the user asks about logging, observability, debugging, or tracing in a NestJS app. Also trigger when the user mentions log lines, structured logging, canonical log lines, wide events, request context, observability, or asks how to improve their NestJS logging setup. Use this even if the user just says "add logging" to a NestJS project, since the wide event pattern should be the default, not scattered console.log calls.
development
Add application-level Prometheus metrics to a NestJS app using the OpenTelemetry SDK and an OTel Collector. Covers HTTP RED metrics, Node.js runtime metrics, business metrics, and advanced observability patterns. Use this skill whenever the user wants to add metrics, dashboards, or monitoring to a NestJS application, mentions Prometheus, Grafana metrics, OpenTelemetry metrics, OTel Collector, or asks about SLIs/SLOs, or application-level monitoring in a NestJS context. Also trigger when the user wants custom counters, histograms, gauges, or summaries in NestJS. This skill focuses exclusively on metrics the APPLICATION must emit. It does not cover logging, tracing, infra-level metrics from cAdvisor, node-exporter, postgres-exporter, or redis-exporter.
development
How to create, update, and manage documentation for any software project. Use this skill whenever asked to add documentation, update docs, create a runbook, write an ADR, document a feature, add a product spec, write onboarding guides, or any documentation-related task. Also trigger when making behavior-changing code changes (features, fixes, refactors, integrations, infra changes) that require accompanying documentation updates — even if the user doesn't explicitly mention "docs".
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.