Agent skill
af-audit-security
Audit security posture and configure vulnerability scanning for projects. Use when running OWASP compliance checks, managing secrets, or adding dependency scanning to CI pipelines.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/af-audit-security
SKILL.md
Security Expertise
Directive knowledge for configuring and using security tooling in AgentFlow projects.
When to Use This Skill
Load this skill when you need to:
- Configure Dependabot for dependency updates
- Add security scanning to CI workflows
- Audit a project's security posture
- Set up secret detection
- Understand security best practices
Quick Reference
| Tool | Purpose | Setup Location |
|---|---|---|
| Dependabot | Auto-PRs for vulnerable deps | .github/dependabot.yml |
| npm audit | Check for known vulnerabilities | CI workflow step |
| GitHub Secret Scanning | Detect leaked secrets | Repo settings (manual) |
| gitleaks | Pre-commit secret detection | Optional hook |
Rules
Security Configuration Rules (MUST)
-
MUST add Dependabot to all new projects - it's zero-maintenance security.
-
MUST add npm audit to CI workflows - fail builds on high/critical vulnerabilities.
-
MUST NOT commit secrets - use Doppler for all credentials.
-
MUST document manual steps - GitHub secret scanning requires UI enablement.
Security Configuration Rules (SHOULD)
-
SHOULD enable GitHub secret scanning on all repositories.
-
SHOULD review Dependabot PRs weekly - don't let them pile up.
-
SHOULD use
npm audit --audit-level=high- moderate issues can wait.
Workflows
Workflow: Add Security to New Project
When: Setting up greenfield or brownfield project.
Steps:
-
Create Dependabot config:
bashcp .claude/templates/github/dependabot.yml .github/dependabot.yml -
Add npm audit to CI (if GitHub Actions exist):
yaml- name: Security audit run: npm audit --audit-level=high -
Enable secret scanning (manual):
- Go to repo Settings → Security → Secret scanning
- Enable "Secret scanning"
- Enable "Push protection" (blocks commits with secrets)
-
Verify setup:
bash# Check Dependabot config exists test -f .github/dependabot.yml && echo "✅ Dependabot configured" # Check for npm audit in CI grep -r "npm audit" .github/workflows/ && echo "✅ npm audit in CI"
Workflow: Security Audit
When: Running /security:audit command or checking project security posture.
Checks to perform:
| Check | How | Pass Criteria |
|---|---|---|
| Dependabot config | test -f .github/dependabot.yml |
File exists |
| npm audit in CI | grep "npm audit" .github/workflows/*.yml |
Found in workflow |
| No high vulnerabilities | npm audit --audit-level=high |
Exit code 0 |
| No secrets in code | grep -rE "(password|secret|api_key)\s*=\s*['\"][^'\"]+['\"]" src/ |
No matches |
Output format:
Security Audit Results:
✅ Dependabot configured (.github/dependabot.yml)
✅ npm audit in CI workflow
⚠️ GitHub secret scanning - check manually: [repo settings link]
❌ npm audit found 2 high vulnerabilities
Run `npm audit fix` to resolve vulnerabilities.
Workflow: Fix Vulnerabilities
When: npm audit reports issues.
Steps:
-
Try automatic fix:
bashnpm audit fix -
If breaking changes required:
bashnpm audit fix --force # Use with caution -
If fix unavailable:
- Check if vulnerability is exploitable in your context
- Consider alternative packages
- Document accepted risk if proceeding
Templates
Dependabot Configuration
Location: .claude/templates/github/dependabot.yml
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
labels:
- "dependencies"
- "security"
CI Security Step
Add to GitHub Actions workflow:
- name: Security audit
run: npm audit --audit-level=high
For GainInsight Standard projects, add after install step in workflow.
Integration Points
With Setup Process
- Greenfield: Creates
.github/dependabot.ymlduring initial setup - Brownfield: Adds security phase to setup process
With GainInsight Standard
- Layer 4 (CI/CD): npm audit step in GitHub Actions workflows
- Templates: Security workflow snippet in templates
With af:sync
- Checks for missing security configs
- Offers to create if missing
With Hook
git-commit-reminderincludes security awareness prompt
Common Pitfalls
| Problem | Cause | Solution |
|---|---|---|
| Dependabot PRs piling up | Not reviewing weekly | Schedule weekly review |
| npm audit false positives | Dev dependencies flagged | Use --omit=dev for production |
| CI failing on moderate issues | audit-level too strict | Use --audit-level=high |
| Secret scanning not working | Not enabled in settings | Manual UI enablement required |
Future Expansion
This skill can be extended to cover:
- SonarQube - Code quality and security analysis
- Snyk - Advanced vulnerability scanning
- OWASP ZAP - Dynamic application security testing
- License compliance - Dependency license checking
- Container scanning - Docker image vulnerabilities
Related Documentation
- GainInsight Layer 4: CI/CD
- Setup Process
- Dependabot Template
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?