Skip to content

Add custom prompt configuration for Issue Responder#22

Merged
cdnsteve merged 2 commits intodevelopfrom
feature/issue-responder-custom-prompt
Dec 22, 2025
Merged

Add custom prompt configuration for Issue Responder#22
cdnsteve merged 2 commits intodevelopfrom
feature/issue-responder-custom-prompt

Conversation

@cdnsteve
Copy link
Copy Markdown
Member

Summary

Adds the ability to customize Issue Responder behavior per-project using a JSON configuration file.

New file location: .sugar/prompts/issue_responder.json

Features

  • Custom instructions: Project-specific system prompt additions
  • Persona configuration: Define role, goal, and expertise
  • Guidelines: List of things Sugar SHOULD do
  • Constraints: List of things Sugar should NOT do

Example Configuration

{
  "name": "my-project-responder",
  "description": "Custom issue responder for my project",
  "persona": {
    "role": "Senior Developer",
    "goal": "Help users resolve issues quickly",
    "expertise": ["Python", "TypeScript", "REST APIs"]
  },
  "instructions": "You are a helpful assistant for this project...",
  "guidelines": [
    "Always search the codebase before responding",
    "Include relevant file paths"
  ],
  "constraints": [
    "Never share API keys or secrets",
    "Don't promise release dates"
  ]
}

Changes

  • sugar/config/prompt_config.py - New config loader with PromptConfig and PersonaConfig classes
  • sugar/profiles/issue_responder.py - Load and use custom prompts
  • examples/issue_responder_prompt.json - Example configuration
  • tests/test_prompt_config.py - 24 tests (96% coverage)
  • docs/issue-responder.md - Full documentation for custom prompts
  • README.md - Updated with custom prompt feature

How It Works

  1. If .sugar/prompts/issue_responder.json exists, it's loaded
  2. Config is validated (instructions field required)
  3. Custom prompt sections are appended to base system prompt
  4. If file missing or invalid, default behavior unchanged

- Add PromptConfig class to load custom prompts from .sugar/prompts/issue_responder.json
- Support persona (role, goal, expertise), instructions, guidelines, constraints
- Modify IssueResponderProfile to load and use custom prompts
- Add example configuration in examples/issue_responder_prompt.json
- Add 24 tests for prompt config (96% coverage)
@cdnsteve cdnsteve merged commit 0edb55a into develop Dec 22, 2025
3 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant