Agent skill
coding-security
Coding and security standards. Apply when writing code, handling comments, error handling, API keys, database connections, user input, or file uploads.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/coding-security
SKILL.md
Coding & Security Standards
General Principles
- Configuration separation: All mutable parameters (timeouts, retry counts, feature flags) must be extracted to file header or config file
- CLI support: If script has no GUI, must support command line argument parsing and provide
-hhelp - No temporary code: Never keep
// TODO: fix lateror temporary validation scripts. Code must be production-ready
Error Handling
- Never swallow errors: Empty try-catch is forbidden
- Contextual logging: Error messages must include context (variable values, operation intent), not just "Error occurred"
- Input validation: Default to assuming all inputs are malicious or incomplete
Comment Standards
Use only Better Comments style, keep explanations concise.
Format:
// *Important information (highlight)// !Alert/Warning// ?Question/Suggestion// TODO:Future work
Rules:
- Comments must be declarative (what the code does), not temporal
- Good comments explain Why, not How (the code itself is How)
Security Standards (Highest Priority)
-
Sensitive Data Isolation
- Absolutely forbidden to hardcode API Keys, passwords, Tokens, database connection strings in code
- Use environment variables (.env) or config files
- Use clear placeholders:
const API_KEY = process.env.API_KEY || "YOUR_API_KEY_HERE";
-
Placeholder Management
- If placeholders must be used, explicitly remind users to replace them
-
Common Vulnerability Defense
- SQL Injection: Must use parameterized queries
- XSS: Escape/sanitize all user inputs
- File Upload: Strictly validate file type and size (don't just check extension)
-
Dependency Management
- When introducing new packages, provide installation commands
- Must check for known malicious or deprecated packages
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?