.cursor/skills/security-guidelines/SKILL.md
Security best practices covering authentication, input validation, API security, secrets management, data protection, and OWASP Top 10. Use when implementing auth flows, API endpoints, file uploads, or any feature touching passwords, tokens, PII, or sensitive data. Do NOT use for code style reviews or architecture decisions.
npx skillsauth add softmg/product-tracker security-guidelinesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Purpose: Define security standards and best practices for the project.
// ✅ Good
import bcrypt from 'bcrypt';
const hash = await bcrypt.hash(password, 10);
// ❌ Bad
import crypto from 'crypto';
const hash = crypto.createHash('md5').update(password).digest('hex');
eval() or Function() on user input// ✅ Good - Parameterized query
const user = await db.query(
'SELECT * FROM users WHERE email = $1',
[email]
);
// ❌ Bad - SQL injection risk
const user = await db.query(
`SELECT * FROM users WHERE email = '${email}'`
);
* in production)// ✅ Good - Generic error
res.status(401).json({ error: 'Invalid credentials' });
// ❌ Bad - Leaks information
res.status(401).json({ error: 'User exists but password is wrong' });
.env to .gitignore// ✅ Good
const apiKey = process.env.API_KEY;
// ❌ Bad
const apiKey = "sk_live_12345abcdef";
npm audit, yarn audit)npm install without reviewing what's being addeddangerouslySetInnerHTML without sanitizationunsafe-inline in production// ✅ Good - CSP header
res.setHeader('Content-Security-Policy',
"default-src 'self'; script-src 'self' https://trusted-cdn.com");
// ✅ Good - Sanitize before rendering
import DOMPurify from 'dompurify';
const clean = DOMPurify.sanitize(userInput);
// ❌ Bad - XSS risk
<div dangerouslySetInnerHTML={{ __html: userInput }} />
// ✅ Good - OAuth with PKCE
const { codeVerifier, codeChallenge } = generatePKCE();
const authUrl = `${provider}/authorize?code_challenge=${codeChallenge}`;
// ✅ Good - MFA check
if (user.mfaEnabled && !req.session.mfaVerified) {
return res.status(401).json({ error: 'MFA required' });
}
// ✅ Good - Query depth limit
const depthLimit = require('graphql-depth-limit');
const server = new ApolloServer({
validationRules: [depthLimit(5)]
});
// ✅ Good - WebSocket auth
wss.on('connection', (ws, req) => {
const token = new URL(req.url, 'wss://base').searchParams.get('token');
if (!verifyToken(token)) {
ws.close(4401, 'Unauthorized');
}
});
Use this checklist when implementing features:
Prevention: Use parameterized queries, input validation, ORMs
Prevention: Strong password policy, MFA, secure session management
Prevention: Encrypt at rest/transit, minimize data collection
Prevention: Disable XML external entity processing
Prevention: Deny by default, enforce on server, log access
Prevention: Minimal configuration, automated scanning, remove defaults
Prevention: Escape output, CSP headers, sanitize input
Prevention: Avoid deserializing untrusted data, integrity checks
Prevention: Regular updates, dependency scanning, monitoring
Prevention: Log security events, alerting, incident response
npm audit / yarn auditNote: This skill should be read by agents before implementing or reviewing security-sensitive features.
documentation
Task tracking and plan management. Used by planner to create plans and persist tasks, by orchestrator to read tasks and update progress, by documenter to create completion reports, and by any agent to log non-critical issues.
development
Create, edit, evaluate, and package agent skills. Use when building a new skill from scratch, improving an existing skill, running evals to test a skill, benchmarking skill performance, optimizing a skill's description for better triggering, reviewing third-party skills for quality, or packaging skills for distribution. Not for using skills or general coding tasks.
development
Simple implementation workflow - code, test, document. Use when user invokes /implement, wants to create code with automatic testing and documentation, or for simple single-purpose tasks that don't need planning.
development
Code review workflow - Review → (optional auto-fix) → Verify. Use when user invokes /review command, before committing, after finishing a feature and before creating a PR, or for a quick sanity check on a specific file or directory.