
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
⚡ Lightning-fast CLI tool (written in Go) for managing AI assistant rules - generate configuration files for Claude, Cursor, Windsurf and more
Lightning-fast CLI tool (written in Go) for managing AI assistant rules
Generate configuration files for Claude, Cursor, Windsurf, and other AI assistants from a single, centralized configuration.
pip install ai-rulez
The Python package automatically downloads and manages the Go binary for your platform.
npm install -g ai-rulez
go install github.com/Goldziher/ai-rulez@latest
brew install goldziher/tap/ai-rulez
(coming soon)ai-rulez.yaml
):metadata:
name: "My AI Rules"
version: "1.0.0"
rules:
- name: "Code Style"
priority: 10
content: |
- Use TypeScript strict mode
- Prefer functional components
- Use meaningful variable names
- name: "Testing"
priority: 5
content: |
- Write unit tests for all functions
- Use describe/it pattern
- Aim for 80% code coverage
outputs:
- file: "CLAUDE.md"
template: "claude"
- file: ".cursorrules"
template: "cursor"
- file: ".windsurfrules"
template: "windsurf"
ai-rulez generate
This creates CLAUDE.md
, .cursorrules
, and .windsurfrules
with your rules properly formatted for each AI assistant.
# Generate all configuration files
ai-rulez generate
# Validate configuration
ai-rulez validate
# Generate recursively in subdirectories
ai-rulez generate --recursive
# Preview output without writing files
ai-rulez generate --dry-run
# Show help
ai-rulez --help
Add to your .pre-commit-config.yaml
:
repos:
- repo: https://github.com/Goldziher/ai-rulez
rev: v1.0.0
hooks:
- id: ai-rulez-generate
Add to your lefthook.yml
:
pre-commit:
commands:
ai-rulez:
run: ai-rulez generate
files: git diff --cached --name-only
glob: "*.{ai-rulez,ai_rulez}.{yml,yaml}"
The tool looks for configuration files in this order:
.ai-rulez.yaml
ai-rulez.yaml
.ai_rulez.yaml
ai_rulez.yaml
When creating AI rules, distinguish between two types of instructions:
Coding Rules: Technical guidelines about code quality, architecture, testing, etc.
User Rules: Personal preferences about communication style and interaction
.local.yaml
files (e.g., ai-rulez.local.yaml
) as they're personal and shouldn't affect the whole teamExample local config (ai-rulez.local.yaml
):
rules:
- name: "Communication Style"
content: "Be concise and direct. Address me as 'Boss'. Always ask for clarification before making assumptions."
- name: "Response Format"
content: "Provide code examples for every suggestion. Use bullet points for lists."
metadata:
name: string # Required: Project name
version: string # Required: Version
description: string # Optional: Description
rules:
- name: string # Required: Rule name
priority: number # Required: Priority (1-10)
content: string # Required: Rule content
sections: # Optional: Organize rules into sections
- title: string # Required: Section title
priority: number # Required: Section priority
content: string # Required: Section content
outputs: # Required: At least one output
- file: string # Required: Output filename
template: string # Required: Template name or path
includes: # Optional: Include other config files
- path/to/other.yaml
Built-in templates:
claude
- CLAUDE.md formatcursor
- .cursorrules formatwindsurf
- .windsurfrules formatdefault
- Generic formatCustom templates use Go template syntax with access to .Rules
, .Sections
, .Metadata
, etc.
AI_RULEZ_CONFIG
- Override config file pathAI_RULEZ_DEBUG
- Enable debug outputfrom ai_rulez.cli import main
import sys
# Run ai-rulez programmatically
sys.argv = ['ai-rulez', 'generate', '--dry-run']
main()
Contributions are welcome! Please see our Contributing Guide.
MIT License - see LICENSE
Note: This Python package is a wrapper around the Go binary. The actual tool is written in Go for maximum performance and cross-platform compatibility.
FAQs
⚡ Lightning-fast CLI tool (written in Go) for managing AI assistant rules - generate configuration files for Claude, Cursor, Windsurf and more
We found that ai-rulez demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.