prompts

Module: prompts Cohesion: 0.80 Members: 0

prompts

The prompts module serves as the central repository for defining the various operational modes and personas of the "Code Buddy" AI assistant. It contains a collection of Markdown files, each representing a distinct system prompt or a significant part of one, which guides the AI's behavior, identity, and constraints when interacting with users.

Purpose

The primary purpose of the prompts module is to:

  1. Define AI Personas: Establish specific roles for Code Buddy (e.g., Architect, Code Reviewer) with tailored guidelines and focus areas.
  2. Enforce Behavioral Rules: Implement critical security guidelines, tool usage protocols, and response styles that govern Code Buddy's interactions.
  3. Modularize Prompt Engineering: Allow for easy management, modification, and extension of Code Buddy's core instructions without embedding them directly into application logic.

These prompt files are static assets that are loaded and provided to a Large Language Model (LLM) as part of its system prompt, effectively "programming" its behavior for a given session or task.

Module Structure and Key Components

The prompts module consists of several Markdown files, each designed for a specific purpose:

prompts/
├── architect.md
├── code-reviewer.md
├── default.md
├── minimal.md
└── secure.md

default.md - The Base Persona

This file defines the standard, general-purpose "Code Buddy" persona. It includes:

This prompt serves as the foundation for most Code Buddy operations unless a more specialized mode is explicitly activated.

secure.md - Enhanced Security Persona

This prompt provides an even stricter set of security guidelines compared to default.md. It reiterates and expands upon the critical security rules, emphasizing:

This persona is intended for environments or tasks where maximum security vigilance is paramount.

minimal.md - Simplified Persona

This file defines a stripped-down version of Code Buddy's identity and capabilities. It focuses on:

It omits the detailed security and tool usage rules found in default.md and secure.md, making it suitable for scenarios where a lighter, less constrained AI behavior is desired, perhaps for internal testing or specific, controlled tasks.

architect.md - Specialized Architect Persona

This prompt configures Code Buddy to act as a software architect. It includes:

This persona is activated when Code Buddy needs to provide architectural insights and design recommendations.

code-reviewer.md - Specialized Code Reviewer Persona

This prompt configures Code Buddy to act as a meticulous code reviewer. It includes:

This persona is activated when Code Buddy is tasked with analyzing and providing feedback on code changes.

How Prompts are Used

These Markdown files are not executed directly. Instead, they are loaded by a higher-level component (e.g., a PromptManager or Agent class within the Code Buddy application). This component is responsible for:

  1. Selecting the appropriate prompt(s): Based on the user's request or the current operational mode.
  2. Loading content: Reading the Markdown content from the selected files.
  3. Constructing the final system prompt: Combining the loaded content with any dynamic context or user input to form the complete system prompt that is sent to the LLM.

This modular approach allows the Code Buddy application to dynamically switch between different AI behaviors and enforce varying levels of security and guidance.

graph TD
    subgraph Prompts Module
        A[default.md]
        B[secure.md]
        C[minimal.md]
        D[architect.md]
        E[code-reviewer.md]
    end

    F[Code Buddy Application Logic] --> G{Select Prompt(s)}
    G --> A
    G --> B
    G --> C
    G --> D
    G --> E

    A -- Load Content --> H[Construct System Prompt]
    B -- Load Content --> H
    C -- Load Content --> H
    D -- Load Content --> H
    E -- Load Content --> H

    H -- Send to --> I[Large Language Model (LLM)]
    I -- Generates Response --> F

Contribution Guidelines

When contributing to the prompts module: