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

@arkatom/ai-instructions

v0.6.0

Published

๐Ÿค– CLI tool to scaffold AI development instructions for ClaudeCode, Cursor, GitHub Copilot and more

Readme

ai-instructions

๐Ÿค– Professional CLI tool to scaffold AI development instructions for ClaudeCode, Cursor, GitHub Copilot and more

English | ๆ—ฅๆœฌ่ชž

NPM Version Tests TypeScript License: MIT Semantic Versioning

๐Ÿ“‹ Overview

ai-instructions streamlines the setup of AI-driven development environments by generating comprehensive instruction templates and configuration files. Perfect for teams and individual developers who want to standardize their AI assistant interactions across projects.

โœจ Key Benefits

  • ๐Ÿš€ Instant Setup: Generate instruction templates in seconds
  • ๐Ÿ› ๏ธ Multi-Tool Support: Claude Code, GitHub Copilot, Cursor AI IDE, and Cline AI support
  • ๐Ÿ“š Development Templates: Essential development methodology guides (TDD, Git workflow, Scrum)
  • ๐ŸŒ Multilingual Core: Main instructions available in English, Japanese, and Chinese
  • ๐Ÿ›ก๏ธ Advanced File Safety: 5 intelligent conflict resolution strategies with smart merging
  • โš™๏ธ Highly Configurable: Customizable project names and output directories
  • ๐Ÿ”’ Validated Input: Built-in validation for project names and paths
  • ๐Ÿงช Battle-tested: Comprehensive test suite ensuring reliability
  • ๐ŸŽฏ Agent Templates: 70+ specialized agent templates (CLI integration pending - see Issue #93)

๐Ÿ›ก๏ธ Advanced File Safety System (v0.5.0)

๐Ÿš€ NEW: Intelligent conflict resolution with 5 resolution strategies

๐Ÿ”’ Safe Usage Patterns

# โœ… RECOMMENDED: Interactive conflict resolution (default)
ai-instructions init --project-name "My Project"

# โœ… SAFE: Automatic backup creation
ai-instructions init --conflict-resolution backup --project-name "My Project"

# โœ… SMART: Merge existing + template content intelligently
ai-instructions init --conflict-resolution merge --project-name "My Project"

# โœ… PREVIEW: See what files would be created/modified
ai-instructions init --preview

# โš ๏ธ SKIP: Skip conflicting files (non-destructive)
ai-instructions init --conflict-resolution skip --project-name "My Project"

# ๐Ÿšจ DANGEROUS: Force overwrite (use with extreme caution)
ai-instructions init --force --conflict-resolution overwrite

๐Ÿ›ก๏ธ Conflict Resolution Strategies

When existing files are detected, you can choose from 5 intelligent strategies:

| Strategy | Behavior | Use Case | Data Safety | |----------|----------|----------|-------------| | backup | Creates timestamped backup, writes new file | Default - Safest option | ๐ŸŸข High | | merge | Intelligently merges existing + template content | Update existing instructions | ๐ŸŸข High | | interactive | Prompts for choice per conflict | Full control over each file | ๐ŸŸข High | | skip | Skips conflicting files, creates non-conflicting ones | Partial update scenarios | ๐ŸŸข High | | overwrite | Overwrites without backup | Dangerous - Only with --force | ๐Ÿ”ด None |

๐Ÿ”ง Advanced CLI Options (v0.5.0)

# Conflict resolution strategy
ai-instructions init --conflict-resolution <backup|merge|interactive|skip|overwrite>

# Disable interactive prompts (batch mode)
ai-instructions init --no-interactive

# Disable automatic backups (use with caution)
ai-instructions init --no-backup

# Preview mode - see what would happen
ai-instructions init --preview

๐Ÿง  Intelligent Content Merging

For markdown files, the merge strategy uses smart content analysis:

  • Headers: Preserves unique sections from both files
  • Content blocks: Avoids duplication
  • Metadata: Maintains existing project-specific content
  • Templates: Integrates new template content seamlessly

๐Ÿ“ Backup System

When using backup or merge strategies:

  • Creates timestamped backups: filename.backup.YYYYMMDD_HHMMSS.ext
  • Handles multiple backups automatically
  • Never overwrites existing backups

๐Ÿ’ก Pro Tip: Use --conflict-resolution merge to update existing instruction files while preserving your customizations!

๐Ÿ—๏ธ Architecture & Dependency Management

System Architecture

graph TB
    subgraph "CLI Layer"
        CLI[cli.ts]
    end

    subgraph "Generator Layer"
        Factory[GeneratorFactory]
        Base[BaseGenerator]
        Claude[ClaudeGenerator]
        Cursor[CursorGenerator]
        Copilot[CopilotGenerator]
        Cline[ClineGenerator]
        Windsurf[WindsurfGenerator]
    end

    subgraph "Core Services"
        Config[ConfigurationManager]
        SharedProc[SharedTemplateProcessor]
        Parallel[ParallelGeneratorOperations]
        Errors[Error Classes]
        Types[Type Definitions]
    end

    subgraph "Converter Layer"
        ConvFactory[ConverterFactory]
        FormatConv[Format Converters]
    end

    subgraph "Utilities"
        FileUtils[FileUtils]
        ConflictHandler[FileConflictHandler]
        MergeHandler[SmartMergeHandler]
    end

    CLI --> Factory
    Factory --> Base
    Base --> Claude
    Base --> Cursor
    Base --> Copilot
    Base --> Cline
    Base --> Windsurf

    Base --> Config
    Base --> SharedProc
    Base --> Errors

    SharedProc --> Config
    SharedProc --> Parallel
    SharedProc --> Types

    Config --> Types
    Config --> Errors

    Parallel --> FileUtils

    Claude --> ConvFactory
    ConvFactory --> FormatConv

    FileUtils --> ConflictHandler
    ConflictHandler --> MergeHandler

Dependency Flow

graph LR
    subgraph "No Dependencies"
        Types[types.ts]
        Errors[errors.ts]
    end

    subgraph "Low-Level Dependencies"
        FileUtils[file-utils.ts]
        MergeHandler[smart-merge-handler.ts]
    end

    subgraph "Mid-Level Dependencies"
        Config[config-manager.ts]
        ConflictHandler[file-conflict-handler.ts]
        Parallel[parallel-generator.ts]
    end

    subgraph "High-Level Dependencies"
        SharedProc[shared-processor.ts]
        Base[base.ts]
    end

    subgraph "Top-Level Components"
        Generators[Specific Generators]
        Converters[Format Converters]
        CLI[cli.ts]
    end

    Types --> Config
    Types --> SharedProc
    Types --> Base

    Errors --> Config
    Errors --> SharedProc
    Errors --> Base
    Errors --> Parallel

    FileUtils --> ConflictHandler
    FileUtils --> Parallel

    MergeHandler --> ConflictHandler

    Config --> SharedProc
    Config --> Base

    ConflictHandler --> Base

    Parallel --> SharedProc

    SharedProc --> Base

    Base --> Generators
    Base --> Converters

    Generators --> CLI
    Converters --> CLI

Module Responsibilities

| Module | Purpose | Dependencies | Dependents | |--------|---------|--------------|------------| | types.ts | Type definitions & guards | None | All modules | | errors.ts | Error class hierarchy | None | Core services | | config-manager.ts | Configuration loading & caching | types, errors | Generators, SharedProc | | parallel-generator.ts | Parallel file operations | errors, FileUtils | SharedProc | | shared-processor.ts | Template processing logic | types, config, parallel | Generators | | base.ts | Abstract generator base | All core services | Specific generators | | file-utils.ts | File operations | None | Multiple modules | | file-conflict-handler.ts | Conflict resolution | FileUtils, MergeHandler | Base generator |

Circular Dependency Prevention

This project uses ESLint with eslint-plugin-import to automatically detect and prevent circular dependencies:

// eslint.config.js
'import/no-cycle': ['error', {
  maxDepth: Infinity,
  ignoreExternal: true
}]

Benefits:

  • โœ… Build-time detection of circular imports
  • โœ… Prevents runtime errors from dependency cycles
  • โœ… Enforces clean architecture principles
  • โœ… Integrated into CI/CD pipeline

Directory Structure

src/
โ”œโ”€โ”€ generators/           # Generator implementations
โ”‚   โ”œโ”€โ”€ base.ts          # Abstract base class
โ”‚   โ”œโ”€โ”€ claude.ts        # Claude-specific generator
โ”‚   โ”œโ”€โ”€ cursor.ts        # Cursor-specific generator
โ”‚   โ”œโ”€โ”€ cline.ts         # Cline-specific generator
โ”‚   โ”œโ”€โ”€ copilot.ts       # GitHub Copilot generator
โ”‚   โ”œโ”€โ”€ windsurf.ts      # Windsurf generator
โ”‚   โ”œโ”€โ”€ factory.ts       # Generator factory
โ”‚   โ”œโ”€โ”€ config-manager.ts    # Configuration management
โ”‚   โ”œโ”€โ”€ errors.ts        # Error definitions
โ”‚   โ”œโ”€โ”€ parallel-generator.ts # Parallel operations
โ”‚   โ”œโ”€โ”€ shared-processor.ts   # Shared processing
โ”‚   โ””โ”€โ”€ types.ts         # Type definitions
โ”œโ”€โ”€ converters/          # Format converters
โ”‚   โ”œโ”€โ”€ index.ts         # Converter exports
โ”‚   โ”œโ”€โ”€ format-converter.ts   # Base converter
โ”‚   โ”œโ”€โ”€ cursor-converter.ts   # Cursor format
โ”‚   โ”œโ”€โ”€ copilot-converter.ts  # Copilot format
โ”‚   โ””โ”€โ”€ windsurf-converter.ts # Windsurf format
โ”œโ”€โ”€ utils/               # Utility functions
โ”‚   โ”œโ”€โ”€ file-utils.ts    # File operations
โ”‚   โ”œโ”€โ”€ file-conflict-handler.ts # Conflict resolution
โ”‚   โ””โ”€โ”€ smart-merge-handler.ts   # Content merging
โ””โ”€โ”€ cli.ts               # CLI entry point

๐Ÿ“ฆ Installation

Global Installation (Recommended)

npm install -g @arkatom/ai-instructions

Local Project Installation

npm install --save-dev @arkatom/ai-instructions

Usage without Installation

npx @arkatom/ai-instructions init

๐Ÿš€ Quick Start

Basic Usage

ai-instructions init

This creates a complete set of AI development instructions in your current directory.

Check Current Status

# Check AI instruction files in current directory
ai-instructions status

# Check specific directory
ai-instructions status --directory ./my-project

Interactive Help Guide

# Launch interactive setup guide with examples
ai-instructions help-interactive

Custom Project Setup

ai-instructions init --project-name "my-awesome-project" --output ./my-project

Multi-Tool Support

Generate instructions for different AI development tools:

# Generate Claude Code instructions (default)
ai-instructions init --tool claude

# Generate GitHub Copilot instructions
ai-instructions init --tool github-copilot --project-name "my-project"

# Generate Cursor AI IDE instructions
ai-instructions init --tool cursor --project-name "my-project"

# Generate Cline AI instructions
ai-instructions init --tool cline --project-name "my-project"

Format Conversion (New in v0.3.0)

Generate Claude templates and convert to other formats:

# Convert to Cursor MDC format with short option
ai-instructions init -f cursor --project-name "my-project"

# Convert to GitHub Copilot 2024 standard
ai-instructions init --output-format copilot --project-name "my-project"

# Convert to Windsurf pair programming rules
ai-instructions init --output-format windsurf --project-name "my-project"

# Maintain original Claude format (default)
ai-instructions init --output-format claude --project-name "my-project"

Language Options

The main instruction file is available in multiple languages:

# English (default)
ai-instructions init --lang en --project-name "my-project"

# Japanese (main instruction file)
ai-instructions init --lang ja --project-name "ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๅ"

# Chinese (main instruction file)
ai-instructions init --lang ch --project-name "้กน็›ฎๅ็งฐ"

# Combined: Japanese main file with Cursor format
ai-instructions init -f cursor --lang ja --project-name "ใ‚ซใƒผใ‚ฝใƒซใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆ"

Note: Currently, only the main instruction file (CLAUDE.md/core) supports multiple languages. Other templates are in English.

Safe Updates and Migrations (v0.5.0)

# Update existing project instructions with intelligent merging
ai-instructions init --conflict-resolution merge --project-name "existing-project"

# Backup existing files before updating
ai-instructions init --conflict-resolution backup --project-name "existing-project"

# Interactive updates - choose per file
ai-instructions init --conflict-resolution interactive --project-name "existing-project"

# Non-destructive partial update
ai-instructions init --conflict-resolution skip --project-name "existing-project"

# Batch mode without prompts (CI/CD safe)
ai-instructions init --no-interactive --conflict-resolution backup

Real-world Examples

# Setup for a React project
ai-instructions init --project-name "react-dashboard" --output ./projects/dashboard

# Setup for a Japanese project
ai-instructions init --project-name "ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๅ" --output ./ๆ—ฅๆœฌ่ชžใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆ

# Setup with spaces in name
ai-instructions init --project-name "My Enterprise App" --output ./enterprise

๐Ÿ“ Generated File Structure

The file structure varies depending on the AI tool you select:

Claude Code (Default)

your-project/
โ”œโ”€โ”€ CLAUDE.md                    # Main ClaudeCode instructions
โ””โ”€โ”€ instructions/                # Development methodology guides
    โ”œโ”€โ”€ base.md                  # Core development rules (MUST READ)
    โ”œโ”€โ”€ deep-think.md           # Deep thinking methodology
    โ”œโ”€โ”€ KentBeck-tdd-rules.md   # Test-Driven Development rules
    โ”œโ”€โ”€ commit-rules.md         # Git commit conventions
    โ”œโ”€โ”€ pr-rules.md             # Pull request guidelines
    โ”œโ”€โ”€ git.md                  # Git workflow instructions
    โ”œโ”€โ”€ develop.md              # Development process guide
    โ”œโ”€โ”€ command.md              # Shell command execution rules
    โ””โ”€โ”€ memo/
        โ””โ”€โ”€ index.md            # Project memo template

GitHub Copilot (--tool github-copilot or --output-format copilot)

your-project/
โ””โ”€โ”€ .github/
    โ””โ”€โ”€ copilot-instructions.md  # GitHub Copilot 2024 standard format

Cursor AI IDE (--tool cursor or --output-format cursor)

your-project/
โ””โ”€โ”€ .cursor/
    โ””โ”€โ”€ rules/
        โ””โ”€โ”€ main.mdc            # Cursor AI rules with YAML front matter

Windsurf AI (--output-format windsurf)

your-project/
โ””โ”€โ”€ .windsurfrules              # Windsurf pair programming rules

Cline AI (--tool cline)

your-project/
โ”œโ”€โ”€ .clinerules/                # Cline AI rule directory
โ”‚   โ”œโ”€โ”€ 01-coding.md           # Core development rules
โ”‚   โ””โ”€โ”€ 02-documentation.md    # Documentation standards
โ””โ”€โ”€ instructions/              # Comprehensive development guides
    โ”œโ”€โ”€ base.md                # Core development rules (MUST READ)
    โ”œโ”€โ”€ deep-think.md         # Deep thinking methodology
    โ”œโ”€โ”€ note.md               # Work documentation guidelines
    โ””โ”€โ”€ ... (additional methodology and workflow files)

File Descriptions

| File | Purpose | Key Content | |------|---------|-------------| | CLAUDE.md | Main entry point for AI assistants | Project-specific instructions with {{projectName}} replaced | | base.md | Core development principles | Fundamental rules that must be followed | | deep-think.md | Thinking methodology | Quality-first approach and analytical thinking | | KentBeck-tdd-rules.md | TDD methodology | Kent Beck's Test-Driven Development principles | | commit-rules.md | Git commit standards | Semantic commit message format with domain tags | | pr-rules.md | Pull request rules | PR creation guidelines and review process |

โš™๏ธ Configuration Options

Available Commands

| Command | Description | Example | |---------|-------------|---------| | init | Initialize AI development instructions | ai-instructions init | | status | Show current configuration status | ai-instructions status | | help-interactive | Launch interactive help guide | ai-instructions help-interactive | | help | Display help for a command | ai-instructions help init |

Command Line Options

| Option | Alias | Description | Default | Example | |--------|-------|-------------|---------|---------| | --lang | -l | Template language (en, ja, ch) | en | --lang ja | | --output-format | -f | Output format (claude, cursor, copilot, windsurf) | claude | -f cursor | | --output | -o | Output directory | Current directory | --output ./my-project | | --project-name | -n | Project name for templates | my-project | --project-name "My App" | | --tool | -t | AI tool type (legacy, use --output-format) | claude | --tool cursor | | --conflict-resolution | | ๐Ÿ›ก๏ธ Conflict resolution strategy (backup, merge, interactive, skip, overwrite) | backup | --conflict-resolution merge | | --no-interactive | | ๐Ÿค– Disable interactive conflict resolution | false | --no-interactive | | --no-backup | | ๐Ÿšจ Disable automatic backups (use with caution) | false | --no-backup | | --force | | โš ๏ธ Force overwrite existing files (DANGEROUS) | false | --force | | --preview | | ๐Ÿ” Preview files that would be created/modified | false | --preview | | --version | | Show version number | | | | --help | | Display help information | | |

Project Name Validation

The CLI validates project names to ensure filesystem compatibility:

  • โœ… Allowed: Letters, numbers, spaces, hyphens, underscores, Unicode characters
  • โŒ Forbidden: <, >, | characters
  • โŒ Invalid: Empty strings or whitespace-only names

Examples of Valid Project Names

ai-instructions init --project-name "My Project"           # โœ… Spaces
ai-instructions init --project-name "my-awesome_project-v2" # โœ… Hyphens & underscores
ai-instructions init --project-name "ใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๅ"          # โœ… Unicode/Japanese
ai-instructions init --project-name "Project123"           # โœ… Numbers

Output Format Validation

The CLI validates output formats to ensure compatibility:

  • โœ… Supported Formats: claude, cursor, copilot, windsurf
  • โœ… Case Sensitive: Format names must be lowercase
  • โŒ Invalid: CLAUDE, Cursor, GitHub-Copilot

Language Code Validation

  • โœ… Supported Languages: en (English), ja (Japanese), ch (Chinese)
  • โœ… Case Sensitive: Language codes must be lowercase
  • โŒ Invalid: EN, JA, fr, es

๐Ÿ”„ Format Conversion Benefits

Why Use Format Conversion?

  1. ๐ŸŽ† Single Source of Truth: Maintain comprehensive Claude templates
  2. ๐Ÿ”ง Tool-Specific Optimization: Each format optimized for its AI tool
  3. ๐Ÿ— Multi-Tool Workflows: Switch between AI tools seamlessly
  4. ๐ŸŒ Consistent Standards: Apply same development practices across tools

Format-Specific Features

| Format | File Extension | Key Features | |--------|----------------|---------------| | claude | .md | Full instruction hierarchy, TDD rules, comprehensive guides | | cursor | .mdc | YAML front matter, MDC format, Cursor-optimized prompts | | copilot | .md | GitHub 2024 standard, repository-focused instructions | | windsurf | .windsurfrules | Pair programming focus, collaborative development rules | | cline | .md | Multiple specialized files in .clinerules directory |

๐Ÿ› ๏ธ Development

Prerequisites

  • Node.js 16+
  • npm 7+
  • TypeScript 5.0+

Setup Development Environment

# Clone the repository
git clone https://github.com/arkatom/ai-instructions.git
cd ai-instructions

# Install dependencies
npm install

# Run tests
npm test

# Build the project
npm run build

# Test CLI locally
npm run cli init --help

Running Tests

# Run all tests (8 test suites, 110 tests)
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

Test Coverage

Our comprehensive test suite includes:

  • Basic CLI functionality (version, help, commands) - 41 tests
  • Format conversion system (Claude โ†’ Cursor/Copilot/Windsurf) - 16 tests
  • Multi-language support (English, Japanese, Chinese templates) - 21 tests
  • Multi-tool generators (Claude, GitHub Copilot, Cursor) - 17 tests
  • Error handling (invalid inputs, filesystem errors, validation) - 8 tests
  • Edge cases (Unicode names, very long names, empty strings) - 7 tests

Key Test Categories:

  • CLI Output Format Support: 12 comprehensive tests for --output-format/-f option
  • Multi-Language Templates: Tests for en/ja/ch language generation
  • GitHub Copilot 2024 Standard: Tests for new .github/copilot-instructions.md path
  • Content verification: Generated file structure and content validation
  • Integration testing: End-to-end CLI workflows with format conversion

Build and Distribution

# Build TypeScript to JavaScript
npm run build

# Create distribution package
npm pack

# Publish to npm (maintainers only)
npm publish

๐Ÿ“Œ Versioning

This project adheres to Semantic Versioning (SemVer). Version numbers follow the format MAJOR.MINOR.PATCH:

  • MAJOR: Incompatible API changes or breaking changes
  • MINOR: New functionality in a backwards compatible manner
  • PATCH: Backwards compatible bug fixes

For example:

  • 0.3.0 โ†’ 0.3.1: Bug fixes or minor improvements
  • 0.3.1 โ†’ 0.4.0: New features or enhancements
  • 0.4.0 โ†’ 1.0.0: Breaking changes or major redesign

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Follow TDD principles - write tests first
  4. Implement your changes with proper TypeScript types
  5. Test thoroughly (npm test)
  6. Commit using our commit conventions
  7. Submit a pull request

Code Quality Standards

  • TDD Required: All new features must have tests
  • TypeScript: Strict type checking enabled
  • ESLint: Code style enforcement
  • 100% Test Coverage: For new features
  • Documentation: Update README for new features

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“ž Support

  • Issues: GitHub Issues
  • Documentation: This README and generated instruction files
  • Examples: See the examples directory

๐Ÿ™ Acknowledgments

  • Kent Beck for the foundational Test-Driven Development methodology
    • "Test-Driven Development: By Example" (2003) - The seminal work that defined TDD
    • "Tidy First?" (2023) - Modern approach to structural vs behavioral changes
    • The three rules of TDD that guide our development process
  • Martin Fowler for documenting and evangelizing TDD practices
  • ClaudeCode team for inspiration on AI-assisted development workflows
  • Open source community for the excellent tools and libraries that make this possible

Made with โค๏ธ for AI-assisted development workflows