npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

secure-coding-rules

v2.0.3

Published

OWASP 2025 security rules for AI coding assistants. Auto-apply to CLAUDE.md, Cursor, Windsurf, Copilot, AGENTS.md with one command.

Readme

secure-coding-rules

npm version license node

Apply OWASP Top 10 2025 JavaScript/TypeScript security rules to your AI coding assistant with one command.

Auto-generates security guidelines for CLAUDE.md, .cursor/rules, .windsurf/rules, copilot-instructions.md, and AGENTS.md.


Quick Start

npx secure-coding-rules

Interactive prompts:

  1. Select AI tool (Claude Code / Cursor / Windsurf / Copilot / AGENTS.md)
  2. Select framework (React / Vue / Node.js / Vanilla) - auto-detected
  3. Select security categories (all or individual)

Auto Mode

Analyzes your project and applies optimal settings automatically:

npx secure-coding-rules --yes
  • Auto-detects existing AI tool config files and updates them
  • Auto-detects framework from package.json (React, Vue, Node.js, etc.)
  • Works in CI/CD and other non-interactive environments

Status Check

Check current project security rule status:

npx secure-coding-rules --check

Supported AI Tools

| AI Tool | Output | Existing files | |---------|--------|----------------| | Claude Code | CLAUDE.md | Auto-merge | | Cursor | .cursor/rules/*.mdc | Per-category files | | Windsurf | .windsurf/rules/*.md | Per-category files | | GitHub Copilot | .github/copilot-instructions.md | Auto-merge | | AGENTS.md | AGENTS.md | Auto-merge |

Security Categories (OWASP Top 10 2025)

| Code | Category | Description | |------|----------|-------------| | A01 | Broken Access Control | RBAC/ABAC, IDOR prevention, server-side authz | | A02 | Security Misconfiguration | Security headers, CORS, env vars | | A03 | Supply Chain Failures | npm audit, lockfile integrity, SRI (New in 2025) | | A04 | Cryptographic Failures | Secure hashing, encryption, key management | | A05 | Injection | XSS, SQLi, NoSQLi, Command Injection | | A06 | Insecure Design | Threat modeling, least privilege | | A07 | Authentication Failures | MFA, session management, password policy | | A08 | Data Integrity Failures | SRI, safe deserialization, CI/CD security | | A09 | Logging & Alerting | Security logging, sensitive data masking | | A10 | Error Handling | Fail-safe defaults, error info leakage (New in 2025) |

Frontend Modules

| Code | Category | Description | |------|----------|-------------| | FE-01 | XSS Prevention | Safe DOM manipulation, sanitization | | FE-02 | CSRF Protection | Token-based defense, SameSite cookies | | FE-03 | Content Security Policy | CSP headers, nonce, reporting | | FE-04 | Secure State | Safe state management, in-memory tokens |

How It Works

Rule Format

All security rules follow a consistent, AI-friendly structure:

### 1. Rule Title
- **DO**: What to do (specific instruction)
- **DON'T**: What to avoid
- **WHY**: Why it matters

## Code Examples
### Bad Practice / Good Practice

## Quick Checklist
- [ ] Checklist items

File Merging

If CLAUDE.md or other config files already exist, existing content is preserved and only the security section is added/updated:

<!-- js-secure-coding:start -->
(only this region is updated)
<!-- js-secure-coding:end -->

Re-running replaces only the marked region with the latest version.

Auto-Detection

secure-coding-rules analyzes your project at runtime:

  • AI tools: Checks for CLAUDE.md, .cursor/, .windsurf/, .github/
  • Framework: Reads package.json dependencies (React, Vue, Express, etc.)
  • Smart prompts: Detected items are highlighted and prioritized in interactive mode

Manual Usage

You can also copy markdown files from src/templates/ directly without the CLI:

src/templates/
├── core/           # OWASP Top 10 2025 (A01-A10)
│   ├── access-control.md
│   ├── authentication.md
│   ├── cryptographic.md
│   ├── data-integrity.md
│   ├── error-handling.md
│   ├── injection.md
│   ├── logging-alerting.md
│   ├── secure-design.md
│   ├── security-config.md
│   └── supply-chain.md
└── frontend/       # Frontend 특화 보안 룰
    ├── xss-prevention.md
    ├── csrf-protection.md
    ├── csp.md
    └── secure-state.md

CLI Options

npx secure-coding-rules              Interactive mode (auto-detect)
npx secure-coding-rules --yes        Smart defaults
npx secure-coding-rules --check      Project security status
npx secure-coding-rules --dry-run    Preview (no file writes)
npx secure-coding-rules --lang ko    Run in Korean (한국어)
npx secure-coding-rules --help       Help
npx secure-coding-rules --version    Version

Language / 다국어

Auto-detects system locale (LANG env). Override with --lang:

npx secure-coding-rules --lang en    # English (default)
npx secure-coding-rules --lang ko    # 한국어

Legacy Templates

Original v1.0 prompt templates are preserved in the legacy/ directory.

References

Contributing

PRs welcome! New security rules, AI tool adapters, or improvements to existing content.

License

MIT