Skip to content

AI Prompt Library: Curated prompts with metadata automation, documentation, and dynamic CLI. Execute AI prompts in CI pipelines or local workflows. Customizable toolkit for building AI-powered processes and personal assistants.

License

Notifications You must be signed in to change notification settings

thibaultyou/prompt-library

Repository files navigation

🧠 Prompt Library

🚧 Project Under Development - Evolving project, expect changes. Feedback welcome!

Prompt Library is your personal collection of AI agent prompts that transforms the way you interact with AI models. Store, organize, and execute sophisticated prompts through an intuitive CLI - supporting both Claude (Anthropic) and GPT (OpenAI) models.

πŸ“š Table of Contents

🎯 Purpose & Features

Treat AI prompts as reusable mini-applications that transform AI models into specialized agents. This approach promotes:

  • Modularity: Compose complex prompts from reusable components
  • Reusability: Apply successful prompts across multiple projects
  • Shareability: Exchange proven prompts with your team

In today's rapidly evolving AI landscape, maintaining a personal prompt library is becoming essential for individuals and organizations alike.

Key Features

βœ… Organized Prompt Storage - Categorized structure with rich metadata
βœ… Multi-Model Support - Works with both Claude and GPT family models
βœ… Intelligent CLI - Interactive prompt execution with variable support
βœ… Fragment System - Build prompts from reusable components
βœ… Automatic Metadata - GitHub Actions maintain documentation
βœ… Dev-Friendly - TypeScript codebase with comprehensive testing

⚑ Quick Start

# Clone repository
git clone https://github.com/YOUR_USERNAME/prompt-library.git

# Install dependencies
cd prompt-library && npm install

# Build and install CLI globally
npm run build && npm install -g .

# Launch interactive prompt menu
prompt-library-cli
πŸ“‹ Complete setup guide

See detailed instructions in Getting Started.

πŸ› οΈ How It Works

  1. Create Prompts: Write markdown prompt files in the prompts directory
  2. Generate Metadata: Commit to trigger automatic metadata generation
  3. Organize Automatically: README files update with categorized prompt listings
  4. Execute via CLI: Run prompts through the interactive CLI or command line
πŸ’‘ Pro Tip: Working with GitHub Actions

Create and commit prompt.md files individually to allow GitHub Actions to generate corresponding metadata.yml files. Both files are required for CLI prompt usage.

πŸ–₯️ CLI Usage

The CLI offers a complete prompt management and execution solution:

Command Overview

Command Description Example
prompt-library-cli Interactive menu prompt-library-cli
model Configure AI model settings prompt-library-cli model
prompts List and manage prompts prompt-library-cli prompts --list
execute Run a specific prompt prompt-library-cli execute -p 74
fragments List and view fragments prompt-library-cli fragments
config Manage CLI configuration prompt-library-cli config
env Manage environment variables prompt-library-cli env
sync Update your library prompt-library-cli sync
settings Manage CLI settings prompt-library-cli settings
flush Reset all data (preserves config) prompt-library-cli flush

Global Options

Usage: prompt-library-cli [options] [command]

Options:
  -V, --version               Output the version number
  -e, --execute <id_or_name>  Execute a prompt by ID or name
  -l, --list                  List all available prompts
  -s, --search <keyword>      Search prompts by keyword
  -h, --help                  Display help for command

πŸ”„ Switch AI Models

prompt-library-cli model

The streamlined model menu lets you:

  • πŸ€– Change AI provider: Switch between Anthropic (Claude) or OpenAI (GPT)
  • 🧠 Change model: Select from available models for your provider
  • πŸ”‹ Change max tokens: Adjust token limits for your responses

πŸš€ Execute Prompts

# List available prompts (to see IDs and names)
prompt-library-cli prompts --list

# Execute using prompt ID (most reliable)
prompt-library-cli execute -p 80  # ID for Software Architect Visionary

# Execute using prompt name (partial matches work too)
prompt-library-cli execute -p "git_commit_message_agent"
prompt-library-cli execute -p "commit message"

# With variables
prompt-library-cli execute -p 74 --description "Add user authentication" --files "auth.ts,users.ts"
# Or by name
prompt-library-cli execute -p "commit" --description "Add user authentication" --files "auth.ts,users.ts"

# Use file inputs
prompt-library-cli execute -p 81 -fi code=./my-code.ts

# Preview mode
prompt-library-cli execute -p "translator" -i

Tip: While both prompt IDs and names are supported, using IDs is more reliable. Directory names follow the pattern {function}_{domain}_agent and are matched using fuzzy search.

πŸ”Ž Managing Prompts

# List all prompts with their IDs and categories
prompt-library-cli prompts --list

# List all prompt categories
prompt-library-cli prompts --categories

# Search prompts by keyword (title, description, category)
prompt-library-cli prompts --search "git"

# Show favorite prompts
prompt-library-cli prompts --favorites

# Show recently executed prompts
prompt-library-cli prompts --recent
πŸ“š Advanced CLI Usage

Executing Prompts with Files

# Execute a prompt with file input
prompt-library-cli execute -p "translator" -fi input=./document.txt

# Execute with multiple file inputs
prompt-library-cli execute -p "code_review" -fi code=./src/app.js -fi tests=./tests/app.test.js

# Execute with both file inputs and regular variables
prompt-library-cli execute -p "document_generator" -fi template=./template.md --title "Project Overview" --author "Team"

Working with Fragments

# List all available fragments
prompt-library-cli fragments

# The interactive menu lets you browse and view fragment contents

Sync Options

# Fetch latest prompts from the default repository
prompt-library-cli sync

# Specify a custom repository URL
prompt-library-cli sync -u https://github.com/your-username/your-repo.git

# Force sync without confirmation
prompt-library-cli sync --force

Environment Management

# Set environment variables for API keys
prompt-library-cli env

# The interactive menu guides you through setting API keys and other environment variables

Note: For security, your API keys are stored securely and never logged or displayed in full.

πŸ“‚ Prompt Showcase

Your AI Agent Collection

Create custom agents for any task with our pre-built prompt templates

Note: These prompts are fully customizable examples. Build your own collection based on your unique needs.

πŸ”Ή Coding
Prompt Description
Git Branch Name Generator Generates optimized git branch names based on project context and user requirements
Git Commit Message Agent Generates precise and informative git commit messages following Conventional Commits specification
GitHub Issue Creator Creates comprehensive and actionable GitHub issues based on provided project information
Software Architect Code Reviewer Generates comprehensive pull requests with architectural analysis and optimization suggestions
Software Architect Specification Creator Creates comprehensive software specification documents based on user requirements
Software Architect Visionary Analyzes user requirements and creates comprehensive software specification documents
Software Development Expert Agent Provides expert, adaptive assistance across all aspects of the software development lifecycle.
πŸ”Ή Content Creation
Prompt Description
Documentation Specialist Agent Generates revolutionary software documentation using advanced AI techniques and industry best practices
πŸ”Ή Healthcare
Prompt Description
Health Optimization Agent Generates personalized, adaptive health optimization plans based on comprehensive user data analysis
Psychological Support and Therapy Agent Provides AI-driven psychological support and therapy through digital platforms
πŸ”Ή Problem Solving
Prompt Description
Problem Solving AI Agent Generates expert networks and strategies to solve complex problems and achieve goals
πŸ”Ή Prompt Engineering
Prompt Description
AI Assistant Architect Conceptualizes innovative and feasible AI assistant designs for various domains
Prompt Engineering God Crafts divine-tier prompts to maximize AI potential while adhering to ethical standards
πŸ”Ή Translation
Prompt Description
Universal Translator Agent Translates between any languages, modes of expression, or conceptual frameworks

πŸ’‘ Pro Tip: Check out the Prompt Engineering category for prompts that help you create high-quality prompts

πŸš€ Getting Started

Step 1: Set Up Your Repository

# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/prompt-library.git
cd prompt-library

# Install dependencies
npm install

Step 2: Configure API Access

Choose your preferred AI provider:

πŸ”΅ Anthropic Claude

  1. Get an API key from the Anthropic Console
  2. Set the environment variable: export ANTHROPIC_API_KEY=your_key_here

🟒 OpenAI GPT

  1. Get an API key from the OpenAI Platform
  2. Set the environment variable: export OPENAI_API_KEY=your_key_here

Step 3: Install and Run CLI

# Build TypeScript project
npm run build

# Install CLI globally
npm install -g .

# Launch interactive CLI
prompt-library-cli

# Configure your AI model
prompt-library-cli model

Note: On first run, you'll need to configure which AI model to use. The CLI will guide you through selecting a provider (Anthropic/OpenAI), model, and token settings.

Step 4: For GitHub Actions (Optional)

If you want automatic README generation, add your API key to repository secrets:

  • Go to your GitHub repository β†’ Settings β†’ Secrets β†’ New repository secret
  • Add ANTHROPIC_API_KEY or OPENAI_API_KEY

🧩 Prompt Composition with Fragments

Fragments are modular, reusable prompt components that help you build complex prompts efficiently:

# Example prompt using fragments
I need you to help me with {{TASK_TYPE}}.

{{BEHAVIOR_GUIDELINES}}

Context:
{{USER_CONTEXT}}

Now, please {{SPECIFIC_INSTRUCTION}}.

Creating Fragments

  1. Add .md files to the fragments/ directory (categorized by type)
  2. Reference them in your prompt files with {{FRAGMENT_NAME}}
  3. Browse and manage fragments with prompt-library-cli fragments
πŸ” Fragment Examples

Check the prompt_engineering directory for example fragments including:

  • Behavior attributes
  • Formatting guidelines
  • Safety guidelines
  • Output templates

βš™οΈ Customizing Metadata Generation

The system automatically analyzes prompts and generates metadata. To customize this process:

  1. Modify the system prompt at src/system_prompts/prompt_analysis_agent/prompt.md
  2. Test your changes with npm run update-metadata
  3. Commit to trigger automatic updates
⚠️ Important Notes

Changes to the metadata system affect all future prompt analyses. Test thoroughly before committing.

🀝 Contributing

Contributions are welcome! Here's how you can help:

  • Add New Prompts: Share your best prompt designs
  • Improve Templates: Enhance the prompt structure
  • Fix Bugs: Help improve the CLI functionality
  • Add Features: Extend the system's capabilities

Please submit issues or pull requests through GitHub.

πŸ“„ License

This project is licensed under the MIT License - feel free to use, modify, and distribute as needed.

About

AI Prompt Library: Curated prompts with metadata automation, documentation, and dynamic CLI. Execute AI prompts in CI pipelines or local workflows. Customizable toolkit for building AI-powered processes and personal assistants.

Topics

Resources

License

Stars

Watchers

Forks