Expand description
Prompt template storage and management service.
Provides CRUD operations for user-defined prompt templates using
domain-scoped storage backends via PromptStorageFactory.
ยงDomain Hierarchy
Prompts are searched in priority order:
- Project - Repository-specific prompts (faceted by repo/branch)
- User - User-wide prompts (
~/.config/subcog/prompts.db) - Org - Organization-wide prompts (deferred)
ยงStorage Backends
| Domain | Backend | Location |
|---|---|---|
| Project | SQLite | ~/.config/subcog/prompts.db (with repo/branch facets) |
| User | SQLite | ~/.config/subcog/prompts.db |
| User | Filesystem | ~/.config/subcog/_prompts/ (fallback) |
| Org | Deferred | Not yet implemented |
Structsยง
- Prompt
Filter - Filter for listing prompts.
- Prompt
Service - Service for prompt template CRUD operations.
- Save
Options - Options for saving a prompt with enrichment.
- Save
Result - Result of a save operation with enrichment.
Constantsยง
- SCORE_
CONTENT_ ๐MATCH - Score boost for content match.
- SCORE_
DESCRIPTION_ ๐MATCH - Score boost for description match.
- SCORE_
EXACT_ ๐NAME_ MATCH - Score boost for exact name match.
- SCORE_
PARTIAL_ ๐NAME_ MATCH - Score boost for partial name match.
- SCORE_
TAG_ ๐MATCH - Score boost for tag match.
- USAGE_
BOOST_ ๐DIVISOR - Divisor for usage count boost calculation.
- USAGE_
BOOST_ ๐MAX - Maximum usage boost multiplier.
Functionsยง
- matches_
glob ๐ - Simple glob pattern matching (* only).
- validate_
prompt_ name - Validates a prompt name.