Skip to content

mkaczkowski/ai-command-library

πŸš€ AI Command Library

Stop writing the same AI prompts over and over. Get a library of proven commands for code reviews, PR management, and development workflows that work seamlessly across Claude, Cursor, Copilot, and Codex.

βœ… One install β†’ Works everywhere ⚑ Ready-to-use PR workflows πŸ”„ Auto-sync across tools πŸ“š Battle-tested commands

πŸ’‘ Why This Matters

Every developer faces the same challenges:

  • πŸ”„ Repetitive AI interactions - Writing similar prompts for code reviews, documentation, and PR management
  • 🎯 Inconsistent results - Different team members get different quality from AI tools
  • ⏰ Time waste - Recreating prompts and workflows across projects
  • 🀝 No collaboration - Can't easily share effective AI commands with your team

This library solves all of that. You get:

  • πŸ“¦ Pre-built workflows for common development tasks
  • πŸ”§ Consistent setup across all your favorite AI tools
  • πŸ‘₯ Team collaboration with shared command libraries
  • ⚑ Instant productivity - no more prompt engineering from scratch

⚑ Quick Start

Get your first AI command working in under 2 minutes:

Option 1: Direct Usage (No Installation)

# For Claude Desktop/Code
npx @mkaczkowski/ai-command-library -p claude

# For Cursor IDE
npx @mkaczkowski/ai-command-library -p cursor

# For GitHub Copilot Workspace
npx @mkaczkowski/ai-command-library -p copilot

# For Codex CLI
npx @mkaczkowski/ai-command-library -p codex-global

Option 2: Install & Link

# 1. Install
npm install -D @mkaczkowski/ai-command-library

# 2. Link to your AI tool
npx link-ai-commands --provider claude

Try your first workflow

Now you have powerful PR review commands in your AI tool! Try asking Claude:

"Use the PR review enhancement workflow to improve my code review comments"

πŸŽ‰ Success! Your AI tools now have access to professional-grade command workflows.

πŸ›  How It Works

Think of this as a shared library for AI prompts. Instead of each developer writing their own prompts, you get:

library/commands/         ← Proven command templates
       ↓
  link-ai-commands        ← Smart sync tool
       ↓
    .claude/commands/     ← Ready to use in Claude
    .cursor/commands/     ← Ready to use in Cursor
    .github/prompts/      ← Ready to use in Copilot
    ~/.codex/prompts/     ← Ready to use in Codex

Key concepts:

  • πŸ“ Commands - Markdown files with step-by-step AI instructions
  • πŸ”§ Providers - Your AI tools (Claude, Cursor, Copilot, Codex)
  • πŸ”— Linking - Copying commands to where your tools can find them
  • πŸ€– Scripts - Helper utilities for GitHub API integration

🎯 Choose Your AI Tool

The library works with all major AI development tools. Pick your setup:

🧠 Claude Desktop / Claude Code

Best for: Individual developers, project-specific commands

npx link-ai-commands --provider claude
  • Result: Commands appear in .claude/commands/
  • What you get: PR workflows accessible via Claude's command palette

πŸ’» Cursor IDE

Best for: Teams using Cursor, integrated development

npx link-ai-commands --provider cursor
  • Result: Commands appear in .cursor/commands/
  • What you get: AI commands directly in your IDE

πŸ€– GitHub Copilot Workspace

Best for: Developers using GitHub Copilot with shared project workflows

npx link-ai-commands --provider copilot
  • Result: Commands appear in .github/prompts/
  • What you get: Flattened .prompt.md files ready for Copilot Workspace

βš™οΈ Codex CLI

Best for: Terminal workflows, automation scripts

npx link-ai-commands --provider codex-global
  • Result: Commands appear in ~/.codex/prompts/
  • What you get: Command-line AI automation

πŸ”§ Advanced Options

Link to custom location:

npx link-ai-commands --provider claude --destination ./my-commands

Use symlinks (live updates):

npx link-ai-commands --provider claude --mode symlink

Preview before linking:

npx link-ai-commands --provider claude --dry-run

See all available providers:

npx link-ai-commands --list-providers

πŸ“‹ Prerequisites

  • Node.js 22+ and npm 10+
  • GitHub CLI for PR workflows
    • Run gh auth login and ensure repo scope is granted
    • Enterprise users: set GH_HOST or use --repo flags

⚑ Alternative Installation

Install directly from GitHub:

npm install -D git+https://github.com/mkaczkowski/ai-command-library.git

πŸ“‹ Provider Reference Table

Provider Destination Best For
claude .claude/commands Project-specific Claude commands
claude-global ~/.claude/commands User-wide Claude setup
cursor .cursor/commands Project-specific Cursor commands
cursor-global ~/.cursor/commands User-wide Cursor setup
copilot .github/prompts Project-specific Copilot prompts
codex-global ~/.codex/prompts Terminal-based AI workflows

πŸ“ Special note for Codex: Commands are flattened to single filenames (e.g., pr__enhance-review.md) while scripts stay in folders. The linker prevents naming conflicts. πŸ“ Special note for Copilot: Prompts are flattened to hyphenated names ending in .prompt.md, while scripts/ keep their directory structure.

πŸ”„ Script Integration

Commands can reference helper scripts using placeholder syntax that works across all providers:

# This works everywhere:
node {{script:pr/scripts/fetch-pr-comments.js}} --pr=123

# Resolves to:
# Claude: .claude/commands/pr/scripts/fetch-pr-comments.js
# Cursor: .cursor/commands/pr/scripts/fetch-pr-comments.js
# Copilot: .github/prompts/pr/scripts/fetch-pr-comments.js
# Codex: ~/.codex/prompts/pr/scripts/fetch-pr-comments.js

Path placeholders:

  • {{script:path/to/script.js}} - References helper scripts
  • {{path:commandsRoot}} - References the commands directory

πŸ“‹ Common Workflows

Ready-to-use workflows that solve real development problems. Each workflow includes commands plus helper scripts for GitHub integration.

πŸ’‘ How to use: After linking commands to your AI tool, reference these workflows in your conversations. Helper scripts gather the data your AI needs to provide accurate, actionable guidance.

πŸ”§ Enhance Existing Comments

Problem: Your code review comments are technically accurate but sound harsh or overly critical.

Solution: Transform blunt feedback into collaborative, constructive guidance while preserving all technical requirements.

What you get:

  • ✨ Professional, collaborative tone
  • 🎯 Same technical accuracy
  • πŸ‘₯ Better team relationships
  • ⚑ Consistent review quality

Step 1: Rewrite Comments (pr/enhance-review.md β€” Step 1)

When to use: After writing initial review comments but before posting them.

# First, gather existing comments
node {{script:pr/scripts/fetch-pr-comments.js}} --pr=123

# Then ask your AI:
# "Use the comment enhancement workflow to improve my review tone"

What happens: Your AI reads your draft comments and rewrites them to sound more collaborative while keeping all technical points intact.

Output: Polished comments ready for posting (tmp/pr-[PR_NUMBER]-comments.md)

Step 2: Update Comments (pr/enhance-review.md β€” Step 2)

When to use: After reviewing and approving your enhanced comments.

# Generate update instructions for GitHub
# (Your AI will guide you through this)

# Apply the updates
node {{script:pr/scripts/edit-pr-comments.js}} --pr=123

What happens: Your enhanced comments replace the original ones on GitHub, automatically maintaining the same technical accuracy with better tone.

πŸ“Š Workflow Diagram
flowchart TD
    Fetch[Fetch PR comments]
    Fetch --> Context[Review diff and project standards for tone and accuracy]
    Context --> Rewrite[Rewrite each comment in a collaborative voice]
    Rewrite --> Output[Save improved feedback]
    Output --> Decide{Ready to push updates to GitHub?}
    Decide -->|Yes| Update[Update comments]
    Decide -->|No| Share[Manual review or async feedback]
Loading

✍️ Create New Review Comments

Problem: You need to provide a thorough code review but don't want to miss important issues or spend hours crafting detailed feedback.

Solution: AI-powered systematic review that catches issues you might miss and generates professional, actionable comments.

What you get:

  • πŸ” Comprehensive issue detection
  • πŸ“ Professional, helpful comment text
  • ⚑ Faster review process
  • 🎯 Consistent review quality across your team

Step 1: Prepare Review (pr/draft-review.md β€” Step 1)

When to use: When you need to review a new PR thoroughly.

# Gather PR context and changes
node {{script:pr/scripts/fetch-pr-context.js}} --pr=123

# Then ask your AI:
# "Use the review preparation workflow to analyze this PR"

What happens: Your AI systematically reviews the entire PR, cataloging potential issues, improvements, and positive points.

Output: Structured findings ready to convert into GitHub comments (tmp/pr-[PR_NUMBER]-findings.md)

Step 2: Create Review (pr/draft-review.md β€” Step 2)

When to use: After preparing your review findings.

# Generate GitHub-ready comments
# (Your AI will guide you through this)

# Post the review to GitHub
node {{script:pr/scripts/create-pr-review.js}} --input=tmp/pr-123-review-comments.json --pr=123

What happens: Your AI converts findings into polished GitHub comments with proper file/line mappings.

Output: Professional review comments posted to GitHub

πŸ“Š Workflow Diagram
flowchart TD
    Context[Fetch PR context]
    Context --> Inspect[Study patches, docs, and neighbouring code]
    Inspect --> Analyze[Assess risks, gaps, and strengths across files]
    Analyze --> Output[Generate structured plan]
    Output --> Craft[Compose concise, inline comments]
    Craft --> Map[Align paths and line numbers with PR diffs]
    Map --> Export[Export comments to JSON]
    Export --> RunScript[Create pending PR review]
Loading

πŸ”„ Address Review Feedback

Problem: You have review feedback to address but need to ensure you handle every comment systematically and respond appropriately.

Solution: Structured approach to analyzing, implementing, and tracking resolution of all review feedback.

What you get:

  • πŸ“‹ Systematic tracking of all feedback
  • βœ… Nothing gets missed or forgotten
  • 🎯 Appropriate responses to reviewers
  • ⚑ Faster resolution cycles

Step 1: Plan Resolutions (pr/address-review.md β€” Step 1)

When to use: When you have unresolved review comments to address.

# Get latest feedback with reactions
node {{script:pr/scripts/fetch-pr-comments.js}} --reaction=+1 --ignore-outdated --include-diff-hunk --pr=123

# Then ask your AI:
# "Use the resolution planning workflow to address this feedback"

What happens: Your AI creates a systematic plan for addressing each piece of feedback.

Output: Implementation plan with validation steps (tmp/pr-[PR_NUMBER]-address-plan.md)

Step 2: Implement Changes (pr/address-review.md β€” Step 2)

When to use: After your resolution plan is approved.

# Follow your AI-generated plan to implement changes
# (Your AI will guide you through each step)

What happens: Your AI helps you implement each planned change and validates the results.

Output: Detailed resolution report with commit references (tmp/pr-[PR_NUMBER]-address-report.md)

Step 3: Reply to Comments (pr/address-review.md β€” Step 3)

When to use: After implementing fixes to close the feedback loop.

# Reply to resolved comments with commit references
node {{script:pr/scripts/reply-to-comments.js}} --pr=123 --dry-run

# When ready, apply the replies
node {{script:pr/scripts/reply-to-comments.js}} --pr=123

What happens: Courteous acknowledgments are posted to each resolved comment thread with links to the implementing commits.

πŸ“Š Complete Address Workflow
flowchart TD
    Gather[Fetch unresolved threads + PR context]
    Gather --> Study[Review diffs, standards, and previous discussion]
    Study --> Strategize[Define fixes, validation, and sequencing per comment]
    Strategize --> Document[Write implementation plan]
    Document --> Implement[Apply fixes, docs, and tests per planned steps]
    Implement --> Validate[Run targeted checks]
    Validate --> Report[Generate final report]
    Report --> Reply[Reply to comments with commit references]
    Reply --> Wrap{Everything resolved?}
    Wrap -->|Yes| Share[Push commits and close feedback loop]
    Wrap -->|No| Loop[Return to implement remaining feedback]
Loading

πŸ€– Helper Scripts Reference

The workflows above use helper scripts to integrate with GitHub. These scripts handle API calls, data processing, and file management automatically.

πŸ“₯ Data Fetching Scripts
  • fetch-pr-comments.js - Get review comments with filtering options
  • fetch-pr-context.js - Gather PR metadata, files, commits, and participants
# Examples
node {{script:pr/scripts/fetch-pr-comments.js}} --pr=123 --reaction=+1
node {{script:pr/scripts/fetch-pr-context.js}} --pr=123
πŸ“€ GitHub Integration Scripts
  • create-pr-review.js - Submit comment JSON as GitHub review
  • edit-pr-comments.js - Update existing comments with enhanced versions
  • reply-to-comments.js - Post resolution acknowledgments to comment threads
# Examples
node {{script:pr/scripts/create-pr-review.js}} --input=tmp/pr-123-review-comments.json --pr=123
node {{script:pr/scripts/edit-pr-comments.js}} --input=tmp/pr-123-comments.json
node {{script:pr/scripts/reply-to-comments.js}} --input=tmp/pr-123-address-resolved.json --dry-run

πŸ’‘ Tip: All scripts support --help to show available options and usage examples.

πŸ”„ Automation & Integration

Keep Commands Updated

Add automatic syncing to your project workflow:

{
  "scripts": {
    "postinstall": "link-ai-commands --provider claude"
  }
}

Multi-Tool Setup

Using multiple AI tools? Run once per provider:

npx link-ai-commands --provider claude    # For Claude
npx link-ai-commands --provider cursor    # For Cursor

πŸ›  Development & Contributing

Want to contribute or customize the library? Here's how to get started:

Setup

git clone https://github.com/mkaczkowski/ai-command-library.git
cd ai-command-library
npm install

Code Quality

Run checks before committing:

npm run lint           # Check code style
npm run format:check   # Verify formatting

Auto-fix issues:

npm run lint:fix       # Fix linting issues
npm run format         # Apply consistent formatting

πŸ“ Repository Structure

ai-command-library/
β”œβ”€β”€ library/commands/      # πŸ“ Canonical command source (your templates)
β”œβ”€β”€ providers/             # βš™οΈ Provider configurations (claude.json, cursor.json)
β”œβ”€β”€ scripts/               # πŸ”§ Core linking logic
└── bin/                   # πŸ“¦ CLI entry point

πŸš€ Release Process

  1. Update: Bump version in package.json and update CHANGELOG.md
  2. Verify: Run npm run release to check linting and formatting
  3. Publish: npm publish --access public (requires NPM_TOKEN env var)
  4. Tag: Push the release commit and tag to GitHub

🀝 Support & Community

πŸ› Found an Issue?

πŸ’‘ Need Help?

  • Check the workflows above for common use cases
  • Review script help with --help flag
  • Search existing issues for solutions

🎯 Contributing

  • Add new command workflows
  • Improve existing templates
  • Enhance provider support
  • Update documentation

πŸ“„ License

Released under the MIT License.

Happy coding! πŸš€

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •