MCPcopy Index your code
hub / github.com/codeaashu/claude-code / loadMagicDocsPrompt

Function loadMagicDocsPrompt

src/services/MagicDocs/prompts.ts:66–76  ·  view source on GitHub ↗

* 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}})

()

Source from the content-addressed store, hash-verified

64 * Use {{variableName}} syntax for variable substitution (e.g., {{docContents}}, {{docPath}}, {{docTitle}})
65 */
66async 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

Callers 1

Calls 3

getFsImplementationFunction · 0.85
getUpdatePromptTemplateFunction · 0.85
readFileMethod · 0.80

Tested by

no test coverage detected