Secure Coding
Comprehensive secure coding practices covering input validation, authentication, authorization, cryptography, secrets management, and error handling. Provides actionable code examples and checklists for building security into every stage of development.
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill secure-codinggit clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skills.git /tmp/mercury-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/mercury-agent-skills/categories/security/secure-coding ~/.claude/skills/secure-codingPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Secure Coding Skill Writing code that is resistant to attack requires intentional practices at every layer. This skill covers the fundamental security patterns every developer should implement: input validation, authentication, authorization, cryptography, secrets management, and error handling. --- ## Core Principles ### 1. **Never Trust User Input** All input is guilty until proven innocent. Validate, sanitize, and parameterize every piece of data that crosses a trust boundary — HTTP requests, file uploads, database queries, API calls, message queue payloads. ### 2. **Fail Securely** When something goes wrong, the default behavior should be denial, not access. An error should reject the request, log the event, and return minimal information to the user. ### 3. **Defense in Depth** No single control is sufficient. If input validation fails, parameterized queries should prevent injection. If authentication is bypassed, authorization should block access. Layer your defenses. ### 4. **Keep Security Simple** Complex cryptography, custom authentication schemes, and convoluted permission models are more likely to have bugs. Use well-vetted libraries. Do not roll your own crypto. ### 5. **Least Privilege** Every component, function, and user should have the minimum permissions required to do its job. Apply this to database accounts, API keys, file permissions, and cloud IAM roles. ### 6. **Secure by Default**
Details
- Skill name
secure-coding- Repository
- cosmicstack-labs/mercury-agent-skills
- Path
categories/security/secure-coding/SKILL.md- License
- MIT
- Repo updated
- 25 August 2026
FAQ
What does the Secure Coding skill do?
Comprehensive secure coding practices covering input validation, authentication, authorization, cryptography, secrets management, and error handling. Provides actionable code examples and checklists for building security into every stage of development.
How do I install the Secure Coding skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add cosmicstack-labs/mercury-agent-skills --skill secure-coding. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Secure Coding popular?
It lives in cosmicstack-labs/mercury-agent-skills, which has 492 GitHub stars and 68 forks.
Related skills
Accessibility
492cosmicstack-labs/mercury-agent-skills
Achieve and maintain WCAG compliance through inclusive design practices, proper ARIA usage, and comprehensive testing methodologies.
Accessibility Testing
492cosmicstack-labs/mercury-agent-skills
WCAG 2.1/2.2 audit, axe, Lighthouse, manual testing, screen reader testing, and remediation
Agent Audit Logging
492cosmicstack-labs/mercury-agent-skills
Implement comprehensive audit logging and reporting for multi-agent systems. Covers event capture, structured logging, traceability, compliance reporting, forensic analysis, and real-time monitoring dashboards for agent actions and decisions.
Time Blocking Scheduler
492cosmicstack-labs/mercury-agent-skills
A structured time management coach that designs deep work schedules, energy-aligned routines, and priority-focused blocks for freelancers, solopreneurs, and creative professionals who need to protect their focus from the chaos of unstructured days.
Refactoring Patterns
492cosmicstack-labs/mercury-agent-skills
Systematic refactoring techniques, code smell elimination, pattern extraction, and legacy modernization
Accelerator Application
393shawnpang/startup-founder-skills
When the user wants to apply to startup accelerators, incubators, or fellowship programs. Also use when the user mentions "YC application", "Techstars", "accelerator", or "apply to programs".
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.