summaryrefslogtreecommitdiff
path: root/internal/promptstore
AgeCommit message (Collapse)Author
2026-03-16Refactor oversized functions and split large test filesPaul Buetow
Split DefaultPrompts (201L), loadFromFile (83L), and Update (74L) into focused helper functions under 50 lines each. Split handlers_test.go (1650L) and config_test.go (1419L) into logical sub-files under 1000L. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12feat: add design_prompt meta-prompt for implementation planningPaul Buetow
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11fix: simplify meta-prompts to not require programmatic prompt fetchingPaul Buetow
Update update_prompt and delete_prompt meta-prompts to work without requiring Claude to programmatically fetch prompts via prompts/get (which isn't available as a callable tool in the MCP client). Changes: - delete_prompt: Simplified to just ask for confirmation without fetching - update_prompt: Ask what changes to make without fetching current version - Removed duplicate/confusing instructions - More direct workflow: confirm → execute tool This fixes the issue where Claude would try to use listMcpResources or other incorrect APIs when trying to follow the meta-prompt instructions. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11fix: clarify prompt retrieval method in meta-promptsPaul Buetow
Update update_prompt and delete_prompt meta-prompts to explicitly instruct Claude to use "prompts/get" instead of vague "access via prompts capability". This prevents Claude from incorrectly trying to use the resources API. Changes: - update_prompt: "use prompts/get to retrieve the current prompt" - delete_prompt: "use prompts/get to retrieve the prompt and show details" Fixes issue where Claude would try to access "plugin:hexai-prompts" resources instead of using the correct prompts/get method on the hexai-prompts server. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11feat: add delete_prompt built-in meta-promptPaul Buetow
Adds a third built-in meta-prompt for interactively deleting custom prompts with confirmation. This completes the prompt management trilogy (save, update, delete). Changes: - Add delete_prompt meta-prompt with prompt_name argument - Interactive workflow: show prompt → confirm → delete via delete_prompt tool - Update test to expect 3 built-in prompts (was 2) - Includes safety notes about built-in prompts and backups The meta-prompt ensures users see what they're deleting and must explicitly confirm before the delete_prompt tool is called. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11feat: add MCP Tools support for prompt managementPaul Buetow
Implements tools/list and tools/call endpoints to expose prompt management operations (create, update, delete) as callable MCP tools. This enables Claude to use the meta-prompts (save_prompt, update_prompt) to actually create and modify prompts. Key changes: - Add Tool type definitions (Tool, ListToolsRequest, CallToolRequest, etc.) - Implement handleToolsList() returning 3 tools with JSON Schemas - Implement handleToolsCall() with tool wrappers for create/update/delete - Add 17 comprehensive unit tests (82.8% coverage maintained) - Update meta-prompts to reference tools instead of JSON-RPC methods - Enable listChanged notifications for immediate prompt availability - Refactor large functions into helpers to stay under 50-line limit Tools advertised alongside Prompts capability. All functions under 50 lines. Backward compatible - existing prompts/* JSON-RPC methods unchanged. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11refactor: compile built-in prompts into binary instead of external filesPaul Buetow
This change moves built-in meta-prompts (save_prompt, update_prompt) from external JSONL files into compiled Go code, making them always available and version-controlled with the binary. Changes: - Add default_prompts.go with built-in meta-prompt definitions - Update store to load built-ins from code, not files - Add protection: built-ins cannot be updated/deleted - Handle name conflicts: built-ins take precedence with warnings - Update docs to reflect new architecture (no default.jsonl needed) - Add comprehensive tests for built-in protection - Add hexai-mcp-server binary to .gitignore Benefits: - Built-ins always in sync with binary version - No setup required (no default.jsonl to manage) - Clear separation between built-in and user prompts - Protection prevents accidental modification of meta-prompts Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10Refactor MCP server to meet project standards and remove built-in promptsPaul Buetow
Ensures all code complies with AGENTS.md standards: - Refactored functions to be under 50 lines each - Removed built-in prompts - all prompts now served from database only - Split handlePromptsCreate (72→37 lines) with helper functions - Split handlePromptsUpdate (76→44 lines) with helper function - Deleted internal/promptstore/builtin.go (no longer needed) - Updated tests to create prompts dynamically instead of relying on built-ins All tests pass with 81.5% coverage maintained. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10Add MCP server implementation with comprehensive test coveragePaul Buetow
Implements a full Model Context Protocol (MCP) server for managing and serving prompts to LLM applications. The server provides CRUD operations for prompts with automatic backups and template rendering support. Key additions: - cmd/hexai-mcp-server: Main MCP server binary entrypoint - internal/hexaimcp: Server orchestrator with configuration and setup - internal/mcp: Core MCP protocol implementation (JSON-RPC 2.0) - internal/promptstore: Prompt storage with JSONL backend and automatic backups - Comprehensive test suites achieving 80%+ coverage for all MCP packages - Magefile targets for building and installing the MCP server - Complete documentation for setup, API, prompts, and backups Test coverage: - internal/hexaimcp: 84.3% - internal/mcp: 80.3% - internal/promptstore: 81.2% - Overall project: 81.5% Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>