Files
grimoire/src
Claude f6eee5661e feat: add dynamic system prompt builder for LLM assistant
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
2026-01-30 22:46:12 +00:00
..
2026-01-30 17:34:33 +01:00