Agent skill
security-guidance
Security reminder hook that warns about potential security issues when editing files, including command injection, XSS, and unsafe code patterns
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/security-guidance
SKILL.md
Security Guidance Skill
Security best practices and vulnerability detection for code development.
What I Check
Command Injection
- OS command injection from user input
- Unsafe use of
exec,spawn,subprocess - Shell metacharacters in interpolated strings
Cross-Site Scripting (XSS)
- Unescaped user input in HTML/JSX
dangerouslySetInnerHTMLusage- User-controlled URLs in anchors/iframes
Authentication & Authorization
- Missing authentication checks
- Hardcoded credentials or API keys
- Session management issues
- Missing CSRF protection
Data Validation
- Missing input validation and sanitization
- Type coercion vulnerabilities
- Array/object confusion attacks
Cryptography
- Weak encryption algorithms
- Hardcoded encryption keys
- Missing signature verification
- Insecure random number generation
Dependency Security
- Outdated packages with known vulnerabilities
- Unused dependencies
- Unsafe source configurations
Security Checklist
Before Writing Code
- Validate and sanitize all user input
- Use parameterized queries for database access
- Implement proper authentication and authorization
- Never trust client-side validation
While Writing Code
- Use prepared statements for SQL
- Escape user-generated content
- Implement principle of least privilege
- Log security-relevant events
After Writing Code
- Review for hardcoded secrets
- Check for exposed sensitive data
- Verify error handling doesn't leak information
- Test with malicious input
Common Vulnerabilities
| Vulnerability | Description | Prevention |
|---|---|---|
| SQL Injection | Malicious SQL via user input | Use prepared statements |
| XSS | Script injection via user content | Escape/encode output |
| CSRF | Unauthorized actions on behalf of users | Use CSRF tokens |
| Path Traversal | Access to files outside intended directory | Validate and sanitize paths |
| SSRF | Server makes requests to attacker-controlled URLs | Allowlist and validate URLs |
When to Use Me
Invoke this skill whenever:
- Handling user input or data
- Implementing authentication/authorization
- Working with external systems/APIs
- Processing files or uploads
- Implementing cryptographic features
Part of SuperAI GitHub - Centralized OpenCode Configuration
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?