code-simplification
Use after implementing features, before claiming a phase is complete, when reviewing AI-generated code, or when code feels overly complex. Also use when you…
Use when working with any code that handles user input, authentication, authorization, or secrets. Also use when adding or updating dependencies, reviewing infrastructure-as-code, or before claiming security posture is adequate. Covers OWASP Top 10, secrets detection (API keys,
$ npx -y skills add lgbarn/shipyard --skill security-audit --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/security-auditContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when working with any code that handles user input, authentication, authorization, or secrets. Also use when adding or updating dependencies, reviewing infrastructure-as-code, or before claiming security posture is adequate. Covers OWASP Top 10, secrets detection (API keys,
name: security-audit description: Use when working with any code that handles user input, authentication, authorization, or secrets. Also use when adding or updating dependencies, reviewing infrastructure-as-code, or before claiming security posture is adequate. Covers OWASP Top 10, secrets detection (API keys, passwords, tokens in code), dependency vulnerabilities, IaC security, Docker hardening, and supply chain risks. If code touches a database query, HTTP endpoint, or config file with credentials, this skill applies.
<!-- TOKEN BUDGET: 110 lines / ~330 tokens -->
<activation>
</activation>
**Core principle:** Assume every change introduces risk until proven otherwise.
<instructions>
For every code change, verify:
Flag these patterns in ANY file (code, config, IaC, docs, tests):
| Pattern | What It Is | |---------|-----------| | `AKIA[0-9A-Z]{16}` | AWS Access Key | | `ghp_[0-9a-zA-Z]{36}` | GitHub Token | | `sk-[0-9a-zA-Z]{48}` | OpenAI/Stripe Secret Key | | `(postgres\|mysql\|mongodb)://[^:]+:[^@]+@` | DB credentials in URI | | `-----BEGIN.*PRIVATE KEY-----` | Private key | | `(password\|secret\|token\|api_key)\s*[:=]\s*['"][^'"]{8,}` | Generic secret |
**Where secrets hide:** `.env` files in git, Docker build args, Terraform `tfvars`, CI configs, test fixtures, comments.
**Prevention:** Environment variables or secret managers. Add `.env`, `*.tfvars`, `*.pem` to `.gitignore`.
1. Check for known CVEs: `npm audit` / `pip-audit` / `cargo audit` / `govulncheck` 2. Verify exact version pins (not ranges) and lock files committed 3. Minimize dependency footprint -- is this package necessary?
| Area | Check | |------|-------| | **Terraform** | No hardcoded secrets in `.tf`, remote state with encryption, IAM least privilege, no `*` in security groups, encryption on storage | | **Ansible** | Vault for secrets, SSH key auth, `become` only where needed | | **Docker** | Pinned base image (not `latest`), non-root `USER`, no secrets in ENV/ARG, `.dockerignore` configured, health check present, multi-stage build |
</instructions>
<rules>
| Severity | Definition | Action | |----------|-----------|--------| | **Security-Critical** | Exploitable vulnerability or data exposure | Must fix before merge | | **Security-Important** | Increases attack surface | Should fix | | **Security-Advisory** | Best practice not followed | Note for improvement |
</rules>
<examples>
**[C1] SQL Injection in user search endpoint**
- **Location:** src/routes/users.py:42
- **Description:** User-supplied `q` parameter is interpolated directly into a SQL query
via f-string: `cursor.execute(f"SELECT * FROM users WHERE name = '{request.args['q']}'")`
- **Impact:** Attacker can execute arbitrary SQL via the `q` query parameter, potentially
exfiltrating the entire user database or escalating privileges.
- **Remediation:** Use parameterized query:
`cursor.execute("SELECT * FROM users WHERE name = %s", (request.args['q'],))`
- **Evidence:** `cursor.execute(f"SELECT * FROM users WHERE name = '{request.args['q']}'")`- Missing rate limiting on `/api/login` (src/routes/auth.py:15) — add express-rate-limit middleware - Debug logging enabled in production config (config/prod.yml:8) — set `debug: false`
Two API endpoints accept user input directly in SQL queries, creating injection vulnerabilities that could expose the entire user database. An API key committed to test fixtures should be rotated immediately. The remaining findings are low-risk code quality improvements. Fix the SQL injection first — it's the most dangerous and affects the most-used endpoints.
**Security Issue: Possible injection** The code might have injection vulnerabilities. Consider reviewing input handling.
</examples>
**Referenced by:** `shipyard
A Claude Code plugin for structured project execution. Plan work in phases, build with parallel agents and TDD, review with security audits and quality gates, and ship with confidence.
Repo: lgbarn/shipyard
Use after implementing features, before claiming a phase is complete, when reviewing AI-generated code, or when code feels overly complex. Also use when you…
Use when shipping features with public interfaces that lack docs, generating documentation, updating README files, writing API docs, creating architecture…
Use when starting feature work that needs a branch, creating worktrees for isolation, making atomic commits during development, or completing a development…
Import a handwritten spec document into Shipyard, replacing brainstorming. Use when a freeform spec, requirements, or design document exists.
Import a spec-kit feature spec into Shipyard, replacing brainstorming. Use when a spec-kit feature directory exists with spec.md.
Use when working with Terraform (.tf, .tfvars), Ansible (playbooks, roles, inventory), Docker (Dockerfile, docker-compose.yml), Kubernetes (manifests, Helm…