Skip to content

steipete/agent-rules

Repository files navigation

Agent Rules

A collection of reusable rules and knowledge documents for AI coding assistants like Claude Code and Cursor.

Repository Structure

📁 project-rules/

Actionable rules for AI assistants to follow during development:

Development Workflows (Credit: @vincenthopf)

Code Quality & Analysis

  • check.mdc - Comprehensive code quality checks across different languages
  • clean.mdc - Fix all formatting and linting issues
  • code-analysis.mdc - Advanced multi-faceted code analysis options

Problem Solving & Implementation

Documentation & Visualization

Project Setup & Meta

Automation & Integration

Language-Specific

📁 docs/

Reference documentation and knowledge bases:

📁 global-rules/

Global Claude Code configuration and automation scripts (place in ~/.claude/CLAUDE.md):

Usage

For Cursor Users

  1. Copy any .mdc file from project-rules/ to your project's .cursor/rules/ directory
  2. Cursor will automatically apply rules based on the glob patterns in the frontmatter
  3. Rules with alwaysApply: true will be active for all files
  4. Documentation from docs/ can be referenced or imported as needed

For Claude Code Users

  1. Copy the content of any .mdc file (excluding the frontmatter) into your CLAUDE.md file
  2. Or reference the entire file using the @import syntax in your CLAUDE.md
  3. Place in your project root or ~/.claude/CLAUDE.md for global rules
  4. Both project rules and documentation can be included

Global Claude Code Rules

These are powerful global rules that can be placed in ~/.claude/CLAUDE.md to enhance Claude Code's capabilities across all projects. Based on strategies from "Commanding Your Claude Code Army".

Available Global Rules

1. GitHub Issue Creation

Transforms feature descriptions into well-structured GitHub issues following best practices.

  • Credit: @nityeshaga
  • Features: Repository research, convention analysis, automatic gh issue create integration
  • Usage: Provide a feature description and repository URL

2. MCP Server Setup - Peekaboo

Automated setup for the Peekaboo vision-enabled MCP server.

  • Features: Screenshot capture with AI analysis, dual provider support (OpenAI/Ollama)
  • Security: Secure API key extraction from ~/.zshrc
  • Requirements: Node.js 20.0+, macOS 14.0+

3. Terminal Title Management

Dynamic terminal titles for better multi-instance organization.

  • Features: Shows ~/path/to/project — Claude format
  • Implementation: ZSH wrapper function (cly) with background title persistence
  • Benefits: Easy identification of multiple Claude instances

Installation

  1. Create Claude configuration directory:

    mkdir -p ~/.claude
  2. Set up global rules:

    # Create or edit global CLAUDE.md
    nano ~/.claude/CLAUDE.md
    # Add desired rules from this repository
  3. For terminal title management:

    # Copy wrapper script
    cp global-rules/terminal-title-wrapper.zsh ~/.config/zsh/claude-wrapper.zsh
    mkdir -p ~/.config/zsh
    # Add claude-wrapper.zsh content
    
    # Source in ~/.zshrc
    echo '[[ -f ~/.config/zsh/claude-wrapper.zsh ]] && source ~/.config/zsh/claude-wrapper.zsh' >> ~/.zshrc

Contributing

Feel free to contribute your own rules! Please ensure they:

  1. Use the .mdc extension
  2. Include proper YAML frontmatter with description, globs, and alwaysApply fields
  3. Contain clear, actionable instructions
  4. Are generic enough to be reused across projects
  5. Are placed in the appropriate directory:
    • project-rules/ for actionable AI assistant rules
    • docs/ for reference documentation

Why This Format?

This repository uses the .mdc (Markdown with Configuration) format, which provides a unified approach that works seamlessly with both Claude Code and Cursor:

  • Cursor natively supports .mdc files with YAML frontmatter for rule configuration
  • Claude Code reads the markdown content, ignoring the frontmatter metadata
  • The YAML frontmatter provides optional metadata (description, file globs, alwaysApply) that Cursor uses for intelligent rule application
  • Standard markdown content ensures compatibility across different AI assistants

This unified format means you can use the same rule files in both tools without modification.

License

MIT License - See LICENSE for details

About

Rules and Knowledge to work better with agents such as Claude Code or Cursor

Topics

Resources

License

Stars

Watchers

Forks

Languages