security
Use when writing or reviewing API endpoints, database access, auth, or user input handling, for validation, sanitization, and secret-handling standards.
Skill by ioncache
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ioncache-security
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, security, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/security
What's inside
- Skill name
security- Description
- Use when writing or reviewing API endpoints, database access, auth, or user input handling, for validation, sanitization, and secret-handling standards. Examples assume Fastify/MongoDB but the principles are general.
- License
- MIT
- Instructions
- 298 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Security Guidelines
## CRITICAL PRINCIPLES
1. **Validate at the edge**, JSON Schema validation on all API endpoints
2. **Sanitize HTML fields**, validate other input without rewriting it as HTML
3. **Verify webhook signatures**, always verify Stripe, Slack, Terra webhooks
4. **Use secure ObjectId conversion**, always use
`ObjectId.createFromHexString()` with try/catch
5. **Fail securely**, never expose internal errors to clients, log details,
return generic messages
6. **Least privilege**, use RBAC permissions to restrict protected routes
7. **Secrets in env only**, all secrets MUST be validated at startup
## Example Patterns (Fastify + JSON Schema + MongoDB)
### API Validation
```javascript
// Good: Fastify route with schema validation
fastify.post('/api/users', {
schema: {
body: {
type: 'object',
required: ['email', 'password'],
properties: {
email: { type: 'string', format: 'email' },
password: { type: 'string', minLength: 8 }
}
}
},
handler: async (request, reply) => {
// Data is already validated
const { email, password } = request.body
}
})
// Bad: No validation
fastify.post('/api/users', async (request, reply) => {
const { email, password } = request.body // Unsafe!
})
```
### Security Headers
**Use @fastify/helmet for security headers:**
```javascript
import helmet from '@fastify/helmet'
// Fastify with @fastify/helmet
fastify.register(helmet, {
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
connectSrc: ["'self'", 'https://api.example.com']
}
}
})
```
### Safe MongoDB ObjectId Conversion
Catch ObjectId conversion failures separately from database failures. Let
operational errors reach the application's logging and server-error handler.
```javascript
// Good: Safe ObjectId conversion
let objectId
try {
objectId = ObjectId.createFromHexString(id)
} catch (err) {
return reply.code(400).send({ error: 'Invalid ID format' })
}
const doc = await mongo.collection('files').findOne({ _id: objectId })
// Bad: Unsafe conversion (can crash server)
const uncheckedObjectId = ObjectId.createFromHexString(untrustedId)
```
### Webhook Signature Verification
**Always verify webhook signatures for Stripe, Slack, Terra:**
```javascript
import config from '../../config.js'
// Good: Verify Stripe webhook signature
function verifyWebhook(req, secret, stripe, fastify) {
if (!req.rawBody) {
throw new fastify.httpErrors.badRequest('No body supplied')
}
try {
const signature = req.headers['stripe-signature']
return stripe.webhooks.constructEvent(req.rawBody, signature, secret)
} catch (err) {
req.log.error('Webhook signature verification failed', err.message)
throw new fastify.httpErrors.unauthorized('Invalid signature')
}
}
// Use in route
fastify.post('/stripe/webhook', async (req, reply) => {
const event = fastify.stripe.verifyWebhook(
req,
config.STRIPE_EVENTS_SIGNING_SECRET,
fastify.stripe.api,
fastify
)
// Process verified event
})
```
## Authentication & Authorization
Register `@fastify/jwt` and use `await request.jwtVerify()` in an async
authentication hook, or return its promise. Verification must finish
successfully before the protected handler runs; rejection must stop the
request. Registration alone does not protect routes. Follow the
[JWT verification examples](https://github.com/fastify/fastify-jwt#usage).From ioncache/ioncache-ai-tools, MIT.
More from ioncache/ioncache-ai-tools
- 0.565score
review-validate-fix-loop
ioncache
Autonomously reviews, validates, fixes, and re-reviews code within finite nested loops, preserving decisions in a per-run ledger.
SkillAFreshness: AClaude Code +9 - 0.565score
triage-errors
ioncache
Groups and fixes errors by root cause after a large change.
SkillAFreshness: AClaude Code +9 - 0.565score
verify-unresolved-pr-comments
ioncache
Analyzes unresolved review comments and PR-level feedback on the active PR without making changes.
SkillAFreshness: AClaude Code +9 - 0.565score
investigate
ioncache
Traces how a feature, workflow, or system works without changing files.
SkillAFreshness: AClaude Code +9 - 0.565score
review-code
ioncache
Reviews code for correctness, security, performance, and project standards using independent review passes.
SkillAFreshness: AClaude Code +9 - 0.559score
create-worktree
ioncache
Creates a git worktree and applies the repo's .worktree-setup.json.
SkillAFreshness: AClaude Code +9 - 0.524score
unit-tests
ioncache
Use when writing or reviewing JavaScript/TypeScript unit tests with Vitest, for BDD structure, AAAR comments, and coverage/mocking conventions.
SkillBFreshness: BClaude Code +9 - 0.524score
documentation-writing
ioncache
Use when writing or updating documentation, READMEs, commit messages, or code comments, for sentence style, punctuation, and emphasis rules.
SkillBFreshness: BClaude Code +9 - 0.524score
code-complexity
ioncache
Use when writing or reviewing functions, for guidance on parameter counts, nesting depth, function length, and single-responsibility structure.
SkillBFreshness: BClaude Code +9 - 0.524score
jsdoc
ioncache
Use when writing or reviewing JSDoc on JavaScript/TypeScript functions, for required tags, typedef rules, and formatting.
SkillBFreshness: BClaude Code +9 - 0.521score
answer-questions
ioncache
Invoke before responding whenever the user asks a direct question.
SkillBFreshness: BClaude Code +9 - 0.521score
prompt-output
ioncache
Use whenever the task is to produce a prompt file (a .prompt.md file, or any "write me a prompt" request), for the required output format.
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 3
- Last commit (this folder)
- Jul 29, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/ioncache/ioncache-ai-tools
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from ioncache
- 0.565score
triage-errors
ioncache
Groups and fixes errors by root cause after a large change.
SkillAFreshness: AClaude Code +9 - 0.565score
verify-unresolved-pr-comments
ioncache
Analyzes unresolved review comments and PR-level feedback on the active PR without making changes.
SkillAFreshness: AClaude Code +9 - 0.565score
review-validate-fix-loop
ioncache
Autonomously reviews, validates, fixes, and re-reviews code within finite nested loops, preserving decisions in a per-run ledger.
SkillAFreshness: AClaude Code +9 - 0.565score
investigate
ioncache
Traces how a feature, workflow, or system works without changing files.
SkillAFreshness: AClaude Code +9 - 0.565score
review-code
ioncache
Reviews code for correctness, security, performance, and project standards using independent review passes.
SkillAFreshness: AClaude Code +9 - 0.559score
create-worktree
ioncache
Creates a git worktree and applies the repo's .worktree-setup.json.
SkillAFreshness: AClaude Code +9
Cite this page
security skill. Agent Mart. https://agentmart.dev/skills/ioncache-security (last updated 2026-10-24)