api-security-best-practices — Claude Code skill: install & guide
Guides API hardening across REST, GraphQL, and WebSockets. Sets up token authentication, input validation schemas, and rate throttling.
npx claude-code-templates@latest --skill security/api-security-best-practicesWhat api-security-best-practices does
This skill guides developers through securing endpoints across REST, GraphQL, and WebSocket architectures. It structures safeguards around five stages: credential handling, request sanitization, traffic throttling, data encryption, and vulnerability verification based on the OWASP API Top 10.
During code generation, Claude sets up token workflows such as JWT with refresh tokens, session stores, or role-based access control. Input schemas and parameterized statements prevent injection flaws like SQLi or cross-site scripting. Without environment variables configured for token signing secrets, the generated authentication middleware will fail at startup.
What it helps with
- implement JWT authentication with role-based access controls
- sanitize request payloads to block injection flaws
- throttle incoming traffic per IP address to prevent abuse
- prevent sensitive field leaks in server error payloads
Example prompts for the agent
- Audit the endpoints in
routes/api.jsagainst the OWASP API Top 10 - Create an Express middleware for JWT validation with token refresh
- Configure rate limits and request quotas on the authentication routes
How to install api-security-best-practices
1claude-code-templates
npx claude-code-templates@latest --skill security/api-security-best-practices2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill api-security-best-practices -a claude-code3Manually: put the files in place
~/.claude/skills/api-security-best-practices/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/api-security-best-practices/
Manually: put the files in place
.agents/skills/api-security-best-practices/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/api-security-best-practices/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates api-security-best-practices2Manually: put the files in place
.github/skills/api-security-best-practices/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/security/api-security-best-practicesManually: put the files in place
.devin/skills/api-security-best-practices/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about api-security-best-practices
How do I install api-security-best-practices in Claude Code?
Run npx claude-code-templates@latest --skill security/api-security-best-practices in your project terminal.
What does api-security-best-practices do?
It directs Claude Code to apply security standards across API endpoints, covering authentication flows, schema validation, rate throttling, and vulnerability checks.
Which API architectures does this skill cover?
The skill provides security patterns tailored for REST, GraphQL, and WebSocket endpoints.