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

Function buildMagicDocsUpdatePrompt

src/services/MagicDocs/prompts.ts:98–127  ·  view source on GitHub ↗
(
  docContents: string,
  docPath: string,
  docTitle: string,
  instructions?: string,
)

Source from the content-addressed store, hash-verified

96 * Build the Magic Docs update prompt with variable substitution
97 */
98export async function buildMagicDocsUpdatePrompt(
99 docContents: string,
100 docPath: string,
101 docTitle: string,
102 instructions?: string,
103): Promise<string> {
104 const promptTemplate = await loadMagicDocsPrompt()
105
106 // Build custom instructions section if provided
107 const customInstructions = instructions
108 ? `
109
110DOCUMENT-SPECIFIC UPDATE INSTRUCTIONS:
111The document author has provided specific instructions for how this file should be updated. Pay extra attention to these instructions and follow them carefully:
112
113"${instructions}"
114
115These instructions take priority over the general rules below. Make sure your updates align with these specific guidelines.`
116 : ''
117
118 // Substitute variables in the prompt
119 const variables = {
120 docContents,
121 docPath,
122 docTitle,
123 customInstructions,
124 }
125
126 return substituteVariables(promptTemplate, variables)
127}
128

Callers 1

updateMagicDocFunction · 0.85

Calls 2

loadMagicDocsPromptFunction · 0.85
substituteVariablesFunction · 0.70

Tested by

no test coverage detected