Implement comprehensive custom prompting system with template management#22
Merged
stephen-cox merged 5 commits intomainfrom Aug 7, 2025
Merged
Implement comprehensive custom prompting system with template management#22stephen-cox merged 5 commits intomainfrom
stephen-cox merged 5 commits intomainfrom
Conversation
This commit introduces a complete custom prompting system that allows users to create, manage, and apply reusable prompt templates with variable substitution and comprehensive validation. ## Features Added ### Core Prompt Management System - **PromptManager**: Central management system for templates with built-in and user-defined prompt support - **PromptTemplateEngine**: Safe variable substitution using Python's Template class with context variables - **PromptValidator**: Security validation for dangerous patterns, length limits, and variable validation - Template categories (WRITING, DEVELOPMENT, ANALYSIS, BUSINESS, EDUCATION, COMMUNICATION, GENERAL) - Built-in templates: email, code-review, summarize, explain, analyze ### Chat Integration - New chat commands: `/prompt <name>`, `/prompts`, `/prompts search <query>` - Interactive variable collection for template application - System prompt integration with profile-based template references - Template-based system prompts with context variable support ### Configuration & Storage - PromptConfig: Comprehensive prompt system configuration - User-defined templates stored in `~/.nova/prompts/user/custom/` - Template validation settings and security controls - Profile-based system prompts and prompt variables ### Security & Validation - Dangerous pattern detection (script tags, eval, exec, etc.) - Template length and variable count limits - Variable type validation (string, text, integer, boolean, list) - Path sanitization for user templates ### Models & Data Structures - PromptTemplate: Complete template definition with metadata - PromptVariable: Typed variables with required/optional support - ValidationResult: Structured validation feedback - PromptLibraryEntry: Library indexing support ### Comprehensive Testing - 16 new unit tests covering all core functionality - Test coverage for template engine, validator, and manager - Edge case testing (long templates, dangerous patterns, missing variables) - Integration tests for system prompt functionality ## Documentation Updates - Updated CLAUDE.md with prompt management commands - Added security validation guidelines - Updated project status to Phase 3 (Custom Prompting) - Documented template storage locations and usage 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/prompt,/prompts,/prompts search)Test plan
🤖 Generated with Claude Code