populate_diataxis_content
Automatically populate Diataxis documentation with project-specific content using repository analysis to create tailored technical documentation.
Instructions
Intelligently populate Diataxis documentation with project-specific content
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| analysisId | Yes | Repository analysis ID from analyze_repository tool | |
| docsPath | Yes | Path to documentation directory | |
| populationLevel | No | comprehensive | |
| includeProjectSpecific | No | ||
| preserveExisting | No | ||
| technologyFocus | No | Specific technologies to emphasize |
Implementation Reference
- src/tools/populate-content.ts:116-211 (handler)Core handler logic in ContentPopulationEngine that orchestrates Diataxis content population: retrieves analysis, loads memory insights, generates content plan, creates content for each category (tutorials, how-tos, reference, explanation), writes files, updates navigation, and returns results.async populateContent( options: PopulationOptions, context?: any, ): Promise<PopulationResult> { // Report initial progress if (context?.meta?.progressToken) { await context.meta.reportProgress?.({ progress: 0, total: 100 }); } await context?.info?.("π Starting Diataxis content population..."); // 1. Retrieve and validate repository analysis await context?.info?.("π Retrieving repository analysis..."); const analysis = await this.getRepositoryAnalysis(options.analysisId); if (context?.meta?.progressToken) { await context.meta.reportProgress?.({ progress: 20, total: 100 }); } // 2. Get memory-enhanced insights for intelligent content generation await context?.info?.( "π§ Loading memory insights for intelligent generation...", ); await this.loadMemoryInsights(analysis, options); if (context?.meta?.progressToken) { await context.meta.reportProgress?.({ progress: 40, total: 100 }); } // 3. Generate content plan based on project characteristics AND memory insights await context?.info?.("πΊοΈ Generating intelligent content plan..."); const contentPlan = await this.generateIntelligentContentPlan( analysis, options.populationLevel, this.memoryInsights, ); // 4. Generate memory-informed content for each Diataxis category const tutorials = await this.generateMemoryInformedTutorialContent( contentPlan.tutorials, analysis, this.memoryInsights, ); const howTos = await this.generateMemoryInformedHowToContent( contentPlan.howToGuides, analysis, this.memoryInsights, ); const reference = await this.generateMemoryInformedReferenceContent( contentPlan.reference, analysis, this.memoryInsights, ); const explanation = await this.generateMemoryInformedExplanationContent( contentPlan.explanation, analysis, this.memoryInsights, ); // 5. Write content to documentation structure const filesCreated = await this.writeContentToStructure( options.docsPath, { tutorials, howTos, reference, explanation }, options.preserveExisting, ); // 6. Generate cross-references and navigation updates await context?.info?.("π Generating cross-references and navigation..."); await this.updateNavigationAndCrossReferences( options.docsPath, contentPlan, ); if (context?.meta?.progressToken) { await context.meta.reportProgress?.({ progress: 100, total: 100 }); } await context?.info?.( `β Content population complete! Generated ${filesCreated} file(s)`, ); return { success: true, filesCreated, contentPlan, populationMetrics: this.calculatePopulationMetrics( filesCreated, contentPlan, ), nextSteps: this.generateMemoryInformedNextSteps( analysis, contentPlan, this.memoryInsights, ), }; }
- src/tools/populate-content.ts:3553-3592 (registration)MCP Tool registration exporting the tool definition with name, description, input schema, and implicitly the handler.export const populateDiataxisContent: Tool = { name: "populate_diataxis_content", description: "Intelligently populate Diataxis documentation with project-specific content", inputSchema: { type: "object", properties: { analysisId: { type: "string", description: "Repository analysis ID from analyze_repository tool", }, docsPath: { type: "string", description: "Path to documentation directory", }, populationLevel: { type: "string", enum: ["basic", "comprehensive", "intelligent"], default: "comprehensive", description: "Level of content generation detail", }, includeProjectSpecific: { type: "boolean", default: true, description: "Generate project-specific examples and code", }, preserveExisting: { type: "boolean", default: true, description: "Preserve any existing content", }, technologyFocus: { type: "array", items: { type: "string" }, description: "Specific technologies to emphasize in content", }, }, required: ["analysisId", "docsPath"], }, };
- Input schema defining parameters for the tool: analysisId (required), docsPath (required), populationLevel, includeProjectSpecific, preserveExisting, technologyFocus.inputSchema: { type: "object", properties: { analysisId: { type: "string", description: "Repository analysis ID from analyze_repository tool", }, docsPath: { type: "string", description: "Path to documentation directory", }, populationLevel: { type: "string", enum: ["basic", "comprehensive", "intelligent"], default: "comprehensive", description: "Level of content generation detail", }, includeProjectSpecific: { type: "boolean", default: true, description: "Generate project-specific examples and code", }, preserveExisting: { type: "boolean", default: true, description: "Preserve any existing content", }, technologyFocus: { type: "array", items: { type: "string" }, description: "Specific technologies to emphasize in content", }, }, required: ["analysisId", "docsPath"], },
- src/tools/populate-content.ts:3594-3600 (handler)Top-level exported handler function that instantiates ContentPopulationEngine and delegates to its populateContent method.export async function handlePopulateDiataxisContent( args: any, context?: any, ): Promise<PopulationResult> { const engine = new ContentPopulationEngine(); return await engine.populateContent(args, context); }