mcpField
S
security-checklist

security-checklist

github.com/loxosceles-devSecurity137 installs
Repository

About security-checklist

security-checklist is a code security guide for AI coding assistants and development workflows. It focuses on credential storage, environment validation, frontend token handling, and pre-commit review.

Key features

  1. 01Lists environment files to exclude and ignore rules
  2. 02Prohibits hardcoding secrets in code
  3. 03Guides storage of sensitive values with AWS Secrets Manager and SSM
  4. 04Covers frontend token use and environment validation
  5. 05Provides a pre-commit security review checklist

Use cases

  1. 01Write or modify code that handles credentials
  2. 02Check for secrets and environment files before committing
  3. 03Validate required environment variables at startup
  4. 04Review frontend code for exposed sensitive tokens

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/loxosceles-dev/dev-skills --skill security-checklist

After installing, type/security-checklistin Claude Code to confirm it loaded.

Details

From the project README

Security Checklist for AI Coding Assistants

This is a strict guideline. Follow these rules exactly.

Critical security rules to follow when generating or modifying code.

Never Commit These Files

Environment files with actual values:

.env
.env.local
.env.development
.env.production
.env.test
.env.*

Always commit templates (no actual values):

.env_TEMPLATE
.env.example

Required gitignore patterns:

# Environment files
.env
.env.*
!.env_TEMPLATE
!.env.example

# AWS credentials
.aws/credentials
.aws/config

# SSH keys
*.pem
id_rsa
id_ed25519

Never Hardcode Secrets

❌ Never do this:

const apiKey = 'sk-1234567890abcdef';
const dbPassword = 'mypassword123';
const awsAccessKey = 'AKIAIOSFODNN7EXAMPLE';

✅ Always do this:

// Runtime: Load from environment
const apiKey = process.env.API_KEY;
if (!apiKey) throw new Error('API_KEY not set');

// Infrastructure: Reference from Secrets Manager/SSM
const secret = secretsmanager.Secret.fromSecretNameV2(
  this, 'ApiKey', 
  '/project/prod/api-key'
);

Secret Storage

Use appropriate AWS services:

  • Secrets Manager: Passwords, API keys, database credentials, tokens
  • SSM Parameter Store (SecureString): Sensitive configuration values
  • SSM Parameter Store (String): Non-sensitive configuration

Never:

  • Hardcode secrets in code
  • Commit secrets to git
  • Log secrets to console/CloudWatch
  • Pass secrets in URLs or query parameters

Token Handling in Frontend

❌ Never expose sensitive tokens:

// Don't put backend API keys in frontend code
const token = 'secret-backend-token';

✅ Use appropriate auth methods:

// Use public API keys or user-specific tokens
const publicKey = process.env.NEXT_PUBLIC_API_KEY; // Public, safe to expose
const userToken = cookies.get('auth-token'); // User-specific, from auth flow

Environment Variable Validation

Always validate required secrets exist:

// At application startup
const required = ['DATABASE_URL', 'API_KEY', 'JWT_SECRET'];
const missing = required.filter(key => !process.env[key]);

if (missing.length > 0) {
  throw new Error(`Missing required secrets: ${missing.join(', ')}`);
}

Code Review Checklist

Before committing, verify:

  • No hardcoded passwords, API keys, or tokens
  • No .env files with actual values
  • Gitignore includes all secret file patterns
  • Environment variables validated at startup
  • Secrets loaded from Secrets Manager/SSM in infrastructure
  • No secrets in console.log or error messages
  • Frontend only uses public API keys or user-specific tokens

When in Doubt

Stop and ask if:

  • You're about to commit a file with "key", "secret", "password", or "token" in the content
  • You're hardcoding any credential or sensitive value
  • You're unsure if a value should be in git or environment variables

Default to secure: If uncertain whether something is sensitive, treat it as a secret.


Related:


Progressive Improvement

If the developer corrects a behavior that this skill should have prevented, suggest a specific amendment to this skill to prevent the same correction in the future.

Comments

Markdown supported