* Load custom Magic Docs prompt from file if it exists * Custom prompts can be placed at ~/.claude/magic-docs/prompt.md * Use {{variableName}} syntax for variable substitution (e.g., {{docContents}}, {{docPath}}, {{docTitle}})
()
| 64 | * Use {{variableName}} syntax for variable substitution (e.g., {{docContents}}, {{docPath}}, {{docTitle}}) |
| 65 | */ |
| 66 | async function loadMagicDocsPrompt(): Promise<string> { |
| 67 | const fs = getFsImplementation() |
| 68 | const promptPath = join(getClaudeConfigHomeDir(), 'magic-docs', 'prompt.md') |
| 69 | |
| 70 | try { |
| 71 | return await fs.readFile(promptPath, { encoding: 'utf-8' }) |
| 72 | } catch { |
| 73 | // Silently fall back to default if custom prompt doesn't exist or fails to load |
| 74 | return getUpdatePromptTemplate() |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Substitute variables in the prompt template using {{variable}} syntax |
no test coverage detected