mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-11 16:07:15 +02:00
Add system-prompt.ts that dynamically generates a system prompt for an
LLM assistant that helps users:
- Learn about Nostr protocol (events, kinds, NIPs, identifiers)
- Build Grimoire commands from natural language descriptions
- Explain what any Grimoire command does
The prompt is built dynamically from the codebase documentation:
- Command docs from src/types/man.ts (manPages)
- NIP titles from src/constants/nips.ts
- Event kinds from src/constants/kinds.ts
- Kind ranges from src/lib/nostr-kinds.ts
Exported functions:
- buildSystemPrompt(options?) - Full prompt with all sections
- buildCompactSystemPrompt() - Smaller version for limited context
- getCommandsReference() - Just the commands section
- getNipsReference() - Just the NIPs section
- getKindsReference(maxKinds?) - Just the kinds section
- getNostrBasics() - Just the Nostr fundamentals
- getCommandQuickReference() - Array of {name, synopsis, description}
- getCommandDoc(name) - Single command documentation
- getNipTitles() - Map of NIP IDs to titles
- getEventKindsInfo() - Map of kind numbers to info
https://claude.ai/code/session_01V6ooJHnmnRgqBXdrrMpj1k