Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Code Audit

ASecurity

Audit code for actual defects, including bugs, application security issues, error handling gaps, and correctness problems. Not for readability, architecture, test coverage, performance-only, or broad environment security reviews.

12 stars
0 votes
0 copies
0 views
Added 9/20/2026
securityrustgosqlrefactoringapisecurityperformance

Works with

cliapi

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add benthamite/dotfiles --skill code-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Audit?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Code Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/benthamite-code-audit/badge)](https://www.skillsdirectory.com/skills/benthamite-code-audit)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: code-audit
description: Audit code for actual defects, including bugs, application security issues, error handling gaps, and correctness problems. Not for readability, architecture, test coverage, performance-only, or broad environment security reviews.
argument-hint: "[--accept] [dir]"
argument-choices: "--accept"
---

# Code audit

Review the scope named in the user's request or actual invocation arguments for correctness, security, and robustness issues. Use `$ARGUMENTS` only when the active runtime supplies it; do not treat an unsubstituted placeholder as a path. Find defects with a concrete supported failure or threat model, not generic hardening opportunities.

If the user explicitly asks to fix confirmed findings, whether in natural language or with `--accept`, audit first, then fix all confirmed findings whose fix is clear and within the requested scope. Do not broaden into refactors, feature work, or speculative defensive rewrites. If a finding needs product judgment, credentials, or an externally visible action, report it as unresolved instead of guessing. Run the relevant verification for the project and commit only the accepted fixes.

## Workflow

1. **Resolve the scope**: use the explicit files, directories, diff, PR, or issue named in the user's request first, then any actual invocation scope; only when neither names a scope should you default to the current project. Read project instructions and inspect the working tree, including staged changes. Identify the reviewed revision and distinguish new regressions from pre-existing defects for diff/PR reviews. Follow relevant callers outside a named file to confirm behavior without silently broadening the deliverable.
2. **Identify verification**: inspect the project's docs and config for the right checks before changing code. Examples: byte-compile and ERT for Elisp, typecheck/lint/test commands for typed or compiled projects, dependency scanners when the audit includes package risk. Inspect commands and fixtures before running them: an audit does not authorize production probes, credential access, downloads/installs, migrations or externally visible writes merely because they occur in a test script. Use safe isolated reproductions and report inaccessible evidence.
3. **Read real code paths**: inspect the implementation, callers, inputs, and persistence boundaries. Use available subagents or parallel searches for broad codebases, but do not infer findings from filenames alone. Audit-only checks must not rewrite tracked files or update expected snapshots. Re-check the reviewed revision and affected edits before implementing a finding; concurrent changes may invalidate the diagnosis.
4. **Confirm each finding**: trace a concrete failure mode, bad input, race, leak, or attack path through actual callers and guarantees. State prerequisites, expected versus observed behavior, impact and confidence. Distinguish a reproduced failure from a well-supported static finding or an unresolved hypothesis. Verify unfamiliar API contracts and current vulnerability/version claims against authoritative sources; do not infer exploitability from a package name or advisory count alone. Deduplicate symptoms sharing one root cause.
5. **Report or fix**: for an audit-only request, report findings in the format below and offer to fix critical and bug-level issues. When the user asked for fixes in natural language or with `--accept`, apply the confirmed in-scope fixes, verify them, and commit the result.
6. **Verify fixes**: reproduce the supported failing behavior before changing it when safe, then check that exact behavior after the change. Add a focused regression where practical, check analogous paths affected by the same implementation, and run relevant project checks. A compile/lint pass alone is not evidence that the defect is gone. Preserve unrelated edits and staged work; commit each logical fix according to project policy, using only owned changes. Report partial outcomes and unmeasured runtime gaps without calling every finding resolved. Do not push or publish as an implicit audit step.

## What to look for

### Correctness

- **Logic errors**: off-by-one, wrong operator, inverted conditions, short-circuit evaluation that skips side effects
- **Race conditions**: shared mutable state accessed without synchronization, TOCTOU (time-of-check-to-time-of-use) bugs
- **Unhandled edge cases**: empty inputs, None/null where not expected, division by zero, integer overflow, empty collections passed to min/max
- **Silent data loss**: exceptions caught and swallowed, truncation without warning, overwrites without backup
- **Incorrect assumptions**: hardcoded values that could drift from reality, stale caches that are never invalidated, assumptions about file encoding or line endings

### Security

- **Injection**: SQL injection, command injection, XSS, template injection, path traversal
- **Authentication/authorization gaps**: missing auth checks on endpoints, privilege escalation, insecure token handling
- **Secrets exposure**: credentials in code or logs, API keys in client-side bundles, verbose error messages leaking internals
- **Input validation**: missing or insufficient validation at system boundaries (API endpoints, file uploads, URL parameters)
- **Dependency risks**: installed/resolved vulnerable versions with applicable exposure, or dependency drift that demonstrably breaks a supported contract. Lack of an exact pin alone is not a defect; inspect lockfiles and the project's update policy.

### Error handling

- **Lost failures**: catches that incorrectly swallow or misreport an error the caller must handle. A broad catch is valid when its boundary and recovery contract justify it.
- **Missing error paths**: failure, cancellation or timeout cases that violate a supported contract. Missing retries or preflight existence checks are not defects by themselves: blind retries can duplicate effects, and existence checks do not remove filesystem races. Prefer handling the operation's result; reconcile uncertain side effects before a safe idempotent retry.
- **Incorrect error signaling**: callers demonstrably misinterpret a return, exception or status. Different signaling styles alone are a design concern, not a correctness finding.
- **Resource leaks**: files, connections, or browser contexts opened but not reliably closed (missing `finally`, `with`, or `try/catch`)

### Data integrity

- **Non-atomic operations**: multi-step writes that leave corrupt state if interrupted (no transactions, no atomic file writes)
- **Missing validation on imports/loads**: malformed or untrusted data can cross a boundary and violate a required invariant. Account for existing upstream validation and trusted internal contracts before adding duplicate checks.
- **Idempotency violations**: operations that claim to be idempotent but produce different results on re-run
- **Encoding issues**: mixing bytes and strings, assuming UTF-8 without handling BOM or other encodings

## What NOT to flag

- Style, formatting, or naming issues (use `/interpretability-audit` for that)
- Architecture, abstraction, duplication, or refactoring opportunities where behavior is already correct (use `/design-audit` for that)
- Missing features or enhancements
- Performance issues that don't affect correctness (unless they could cause timeouts or OOM)
- Test coverage gaps (mention if a critical path is untested, but don't audit test quality)
- Broad machine, secrets, dependency, or agent-configuration posture issues outside the application code under review
- Code that is correct and handles errors properly — don't suggest defensive code for impossible conditions

## Output format

Use the host/project's required review schema when one exists. Otherwise organize confirmed findings by impact, omitting empty categories:

1. **Critical**: issues that could cause data loss, security breaches, or silent corruption in production
2. **Bugs**: things that are demonstrably wrong or will fail under specific conditions
3. **Fragile**: code that works now but will fail under a concrete supported input, configuration, dependency, or environment transition
4. **Minor**: low-impact confirmed defects, not style or speculative cleanup

For each finding, include:

- File path and line number(s)
- What's wrong (be specific — "this crashes when X is empty", not "error handling could be improved")
- The concrete input, call path, data state, or threat model that makes it fail
- Evidence and confidence; distinguish reproduced behavior from static reasoning
- A concrete fix or approach

Then include:

- **Verification**: checks run, results, and any checks that were relevant but could not be run
- **No findings**: if no confirmed defects were found, say that clearly and describe the reviewed scope and material evidence gaps. This is not a guarantee of defect-free code. Keep unresolved hypotheses separate from confirmed findings.

At the end of an audit-only request, offer to fix the critical and bug-level issues. When the user asked for fixes in natural language or with `--accept`, summarize the fixes, verification, unresolved findings, and commit hash.

Attribution

benthamitebenthamite
View sourceMore from benthamite →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Springboot Security

Java Spring Boot 服务中关于身份验证/授权、验证、CSRF、密钥、标头、速率限制和依赖安全的 Spring Security 最佳实践。

2456590 votes

Security Review

Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.

2456590 votes

Paperclip Task Bridge

Create, comment on, update, and list Paperclip tasks from Hermes using scoped Paperclip API credentials.

805540 votes

Summarize Status

Write a short, colloquial summary for a Paperclip summary slot: open with the 1–3 specific, concrete actions the reader needs to take right now to unblock the work, then a brief plain-language status, streaming progress as it works.

805540 votes

Paperclip Evals

Choose, inspect, validate, and report Paperclip Runner or Product E2E evaluations while preserving evidence, provenance, cost, and failure classification.

805540 votes
View all in security →