Prompt Library

This directory contains reusable prompts for working with LLMs on software projects. Each prompt is designed to invoke a specific mode or perspective from the LLM.


Available Prompts

πŸ†• Customizable Templates

  • llm-coding-templates.md - Battle-tested, customizable prompt templates
    • Safe Engineering - Default prompt for production-safe coding
    • Bug Discovery - Read-only, adversarial bug hunting
    • Bug Fixing - Surgical, minimal fixes for specific bugs
    • Confidence Sweep - Post-fix stability validation
    • UX Bug Discovery - UI/UX-focused bug hunting
    • UX Confidence Sweep - UX stability validation
    • Product Tester - Role-based product evaluation
    • Systematic Bug Scan - Comprehensive checklist-based detection

    Each template has [CUSTOMIZE] sections to fill in for your specific codebase.

πŸ€– Agent Workflows

  • project-bootstrap.md - Bootstrap a new project with Safe Vibe Coding infrastructure
    • Use when: Starting a new project or onboarding an agent to a repository
    • Focus: Documentation foundation, directory structure, prompt library, CI setup
    • Creates: README, ARCHITECTURE.md, INVARIANTS.md, ROADMAP.md, prompts/
  • feature-implementation.md - Autonomous feature implementation with verification loops
    • Use when: Implementing features from roadmap/plan documents
    • Focus: Gap analysis, structured implementation, mandatory verification, progress tracking

Engineering & Development

  • engineering-prompt.md - Production-grade code with conservative, proven patterns
    • Use when: Building new features, writing production code
    • Focus: Maintainability, modularity, security, respecting architecture
  • architecture-aware-feature.md - Add features safely while respecting architecture
    • Use when: Extending existing systems with new functionality
    • Focus: Architecture alignment, invariant compliance, minimal surface area
  • modularity-review.md - Review code for modularity issues and recommend restructuring
    • Use when: Files are growing large (> 1,500 lines) or becoming hard to understand
    • Focus: File size, single responsibility, interface clarity, AI-compatibility
  • refactor-for-clarity.md - Improve code readability without changing behavior
    • Use when: Code works but is hard to understand
    • Focus: Clarity, simplicity, maintainability

Quality & Testing

  • bug-hunt.md - General proactive bug detection after changes
    • Use when: After implementing features or significant changes
    • Focus: Logic errors, edge cases, security, invariant violations
  • backend-bug-hunt.md - Backend-specific bug detection
    • Use when: After backend/API changes
    • Focus: Data integrity, auth, SQL injection, race conditions, API contracts
  • frontend-bug-hunt.md - Frontend-specific bug detection
    • Use when: After UI/client-side changes
    • Focus: State management, forms, async operations, accessibility, UX
  • bug-fixing.md - Surgical bug fixes without scope creep
    • Use when: Fixing specific bugs
    • Focus: Minimal changes, root cause fixes, no refactoring
  • root-cause-isolation.md - Debug elusive bugs that evade normal fixes
    • Use when: Same error appears in multiple locations, defensive fixes aren’t working
    • Focus: Stack trace analysis, data flow tracing, complexity layer isolation
    • Key technique: Remove optimization layers (virtualization, memoization, caching) to isolate
  • invariant-check.md - Verify changes against system invariants
    • Use when: Before merging significant changes
    • Focus: Contract compliance, detecting violations, maintaining guarantees
  • performance-review.md - Identify performance bottlenecks and optimization opportunities
    • Use when: Performance issues suspected or pre-launch optimization
    • Focus: Database, algorithms, caching, memory usage

User Experience

  • user-feedback-simulation.md - Simulate user testing to find UX issues
    • Use when: Testing new features or flows
    • Focus: Usability, confusion, friction, accessibility

How to Use These Prompts

  1. Copy the entire prompt (including context and instructions)
  2. Fill in the placeholders (marked with [brackets])
  3. Paste into your LLM conversation
  4. Provide the code/context the LLM needs to review

Creating Your Own Prompts

When creating project-specific prompts:

  1. Be explicit about the role: β€œYou are a [role] doing [task]”
  2. Provide constraints: What should/shouldn’t be changed
  3. List specific checks: Concrete things to look for
  4. Define output format: How results should be structured
  5. Include examples: Show what good output looks like

Prompt Naming Convention

Use descriptive, action-oriented names:

  • [action]-[target].md (e.g., review-api-contracts.md)
  • [role]-prompt.md (e.g., frontend-engineer-prompt.md)
  • [mode]-mode.md (e.g., debug-mode.md)

Contributing New Prompts

Found a prompt pattern that works well? Add it here:

  1. Create a new .md file with a clear name
  2. Follow the structure of existing prompts
  3. Update this README with a brief description
  4. Test it on your project first

Best Practices

  • Be specific: Vague prompts get vague results
  • Iterate on prompts: Refine based on what works
  • Version your prompts: Track what changes you make
  • Share what works: If a prompt is effective, document why

Language-Specific Prompts

As your project grows, consider creating:

  • python-engineering.md (Python-specific patterns)
  • react-bug-hunt.md (React-specific issues)
  • sql-performance.md (Database-specific optimization)

Keep them in subdirectories if you have many:

prompts/
β”œβ”€β”€ general/
β”œβ”€β”€ python/
β”œβ”€β”€ javascript/
└── sql/

Table of contents


Back to top

Released into the public domain. Use it however helps you build better software.