IMPLEMENTATION_PLAN.mdā¢29.5 kB
# Implementation Plan: DocuMCP Memory Knowledge Graph Enhancement
## Executive Summary
This plan outlines the implementation strategy for transforming DocuMCP from a stateless documentation tool into an intelligent, context-aware documentation assistant with persistent memory capabilities. The implementation is organized into three phases over 6 weeks, building incrementally from core knowledge graph functionality to advanced intelligence features.
**Current State**: DocuMCP has basic memory infrastructure (JSONL storage, MemoryManager, basic KnowledgeGraph class) but lacks:
- Comprehensive entity/relationship schema
- Integration with existing tools
- User preference management
- Code-to-documentation mapping
- Context-aware content generation
**Target State**: A fully intelligent documentation assistant that learns from user interactions, recognizes patterns, provides personalized recommendations, and maintains code-documentation synchronization.
---
## Phase 1: Core Knowledge Graph Integration (Weeks 1-2)
### Objective
Establish the foundational knowledge graph infrastructure with comprehensive entity/relationship management and integrate with core repository analysis functionality.
### 1.1 Enhanced Knowledge Graph Schema Implementation
**Priority**: Must Have
**Estimated Effort**: 3-4 days
**Dependencies**: Existing `src/memory/knowledge-graph.ts`
#### Tasks
1. **Extend GraphNode Types** (src/memory/knowledge-graph.ts:13-25)
- Add new entity types: `configuration`, `documentation`, `code_file`, `documentation_section`
- Define comprehensive property schemas for each entity type
- Implement validation using Zod schemas
2. **Extend GraphEdge Types** (src/memory/knowledge-graph.ts:27-42)
- Add relationships: `project_uses_technology`, `user_prefers_ssg`, `project_deployed_with`, `documents`, `references`, `outdated_for`
- Add confidence scoring mechanisms
- Implement relationship metadata (deployment success rate, usage frequency)
3. **Entity Schema Definitions**
```typescript
// New file: src/memory/schemas.ts
export const ProjectEntitySchema = z.object({
name: z.string(),
path: z.string(),
technologies: z.array(z.string()),
size: z.enum(["small", "medium", "large"]),
domain: z.string().optional(),
lastAnalyzed: z.string(),
analysisCount: z.number(),
});
export const ConfigurationEntitySchema = z.object({
ssg: z.enum(["jekyll", "hugo", "docusaurus", "mkdocs", "eleventy"]),
settings: z.record(z.any()),
deploymentSuccessRate: z.number(),
usageCount: z.number(),
lastUsed: z.string(),
});
export const CodeFileEntitySchema = z.object({
path: z.string(),
language: z.string(),
functions: z.array(z.string()),
classes: z.array(z.string()),
dependencies: z.array(z.string()),
lastModified: z.string(),
linesOfCode: z.number(),
});
export const DocumentationSectionEntitySchema = z.object({
filePath: z.string(),
sectionTitle: z.string(),
contentHash: z.string(),
referencedCodeFiles: z.array(z.string()),
lastUpdated: z.string(),
effectivenessScore: z.number().optional(),
});
```
4. **Storage Format Enhancement**
- Implement separate JSONL files for entities and relationships
- Add file markers for safety: `.documcp/knowledge-graph-entities.jsonl`, `.documcp/knowledge-graph-relationships.jsonl`
- Implement atomic write operations with rollback capability
#### Deliverables
- Enhanced `src/memory/knowledge-graph.ts` with full schema support
- New `src/memory/schemas.ts` with Zod validation schemas
- Updated storage format supporting separate entity/relationship files
- Unit tests: `tests/memory/knowledge-graph-enhanced.test.ts`
---
### 1.2 Context-Aware Repository Analysis Integration
**Priority**: Must Have
**Estimated Effort**: 3-4 days
**Dependencies**: 1.1, existing `src/tools/analyze-repository.ts`
#### Tasks
1. **Enhance analyze_repository Tool** (src/tools/analyze-repository.ts:1171-1198)
- Create Project entity in knowledge graph after analysis
- Store technology relationships (`project_uses_technology`)
- Track analysis history and frequency
- Retrieve historical context before analysis
2. **Project Memory Implementation**
```typescript
// Enhancement to src/tools/analyze-repository.ts
async function analyzeRepository(args: any): Promise<AnalysisResult> {
const kg = await getKnowledgeGraph();
// Check for existing project
const existingProject = await kg.findNode({
type: "project",
properties: { path: args.path },
});
if (existingProject) {
// Retrieve historical context
const history = await kg.getNodeHistory(existingProject.id);
const previousAnalyses = history.filter((h) => h.type === "analysis");
// Include context in analysis
result.context = {
previousAnalysisCount: previousAnalyses.length,
lastAnalyzed: existingProject.properties.lastAnalyzed,
knownTechnologies: existingProject.properties.technologies,
};
}
// Perform analysis
const result = await performAnalysis(args);
// Store/update project entity
const projectNode = await kg.addNode({
id: result.id,
type: "project",
label: result.projectName,
properties: {
name: result.projectName,
path: args.path,
technologies: result.languages,
size: categorizeSize(result.structure.totalFiles),
lastAnalyzed: result.timestamp,
analysisCount: existingProject
? existingProject.properties.analysisCount + 1
: 1,
},
weight: 1.0,
});
// Create technology relationships
for (const tech of result.languages) {
await kg.addEdge({
id: `${projectNode.id}-uses-${tech}`,
source: projectNode.id,
target: tech,
type: "uses",
weight: result.structure.languages[tech] / result.structure.totalFiles,
confidence: 1.0,
properties: { fileCount: result.structure.languages[tech] },
});
}
return result;
}
```
3. **Historical Context API**
- Add methods to KnowledgeGraph class for history retrieval
- Implement change detection (compare current vs. previous analysis)
- Add metrics for tracking project evolution
4. **Session Continuity**
- Store session state in knowledge graph
- Implement "resume project" functionality
- Track workflow progress (analysis ā recommendation ā deployment)
#### Deliverables
- Enhanced `src/tools/analyze-repository.ts` with KG integration
- New `src/memory/project-context.ts` helper module
- Integration tests: `tests/integration/knowledge-graph-analysis.test.ts`
- Updated CLAUDE.md documenting project memory features
---
### 1.3 Storage Safety and Integrity
**Priority**: Must Have
**Estimated Effort**: 2 days
**Dependencies**: 1.1
#### Tasks
1. **File Marker Implementation**
```typescript
// Add to src/memory/storage.ts
const KG_FILE_MARKER = "# DOCUMCP_KNOWLEDGE_GRAPH v1.0";
async function initializeKGFile(path: string): Promise<void> {
const dir = dirname(path);
await fs.mkdir(dir, { recursive: true });
// Check if file exists and has marker
if (await fileExists(path)) {
const firstLine = await readFirstLine(path);
if (!firstLine.startsWith("# DOCUMCP_KNOWLEDGE_GRAPH")) {
throw new Error(`File ${path} is not a DocuMCP knowledge graph file`);
}
} else {
await fs.writeFile(path, KG_FILE_MARKER + "\n");
}
}
```
2. **Atomic Operations**
- Implement write-ahead logging for all mutations
- Add transaction support for multi-entity operations
- Implement rollback on failure
3. **Data Integrity Checks**
- Validate entity references before creating relationships
- Implement orphan cleanup (relationships with missing entities)
- Add checksum validation for stored data
4. **Backup and Recovery**
- Implement automatic backup before mutations
- Add recovery mechanism for corrupted files
- Provide manual backup/restore tools
#### Deliverables
- Enhanced `src/memory/storage.ts` with safety mechanisms
- New `src/memory/integrity.ts` validation module
- Tests: `tests/memory/storage-safety.test.ts`
- Documentation: `docs/how-to/knowledge-graph-maintenance.md`
---
## Phase 2: Enhanced Intelligence (Weeks 3-4)
### Objective
Integrate knowledge graph with recommendation and deployment tools, implement user preferences, and enable intelligent, personalized recommendations.
### 2.1 Intelligent SSG Recommendations
**Priority**: Must Have
**Estimated Effort**: 3-4 days
**Dependencies**: Phase 1, existing `src/tools/recommend-ssg.ts`
#### Tasks
1. **Historical Data Integration** (src/tools/recommend-ssg.ts:1200-1226)
```typescript
// Enhancement to src/tools/recommend-ssg.ts
async function recommendSSG(args: any): Promise<RecommendationResult> {
const kg = await getKnowledgeGraph();
// Retrieve project context
const project = await kg.findNode({
type: "project",
properties: { id: args.analysisId },
});
// Find similar projects
const similarProjects = await kg.findPaths({
startNode: project.id,
edgeTypes: ["similar_to"],
maxDepth: 2,
});
// Get their successful configurations
const successfulConfigs = await Promise.all(
similarProjects.map((sp) =>
kg.findEdges({
source: sp.nodes[sp.nodes.length - 1].id,
type: "project_deployed_with",
}),
),
);
// Weight recommendations by success rate
const historicalWeights = calculateHistoricalWeights(successfulConfigs);
// Perform base recommendation
const baseRecommendation = await performBaseRecommendation(args);
// Adjust scores based on historical data
for (const rec of baseRecommendation.recommendations) {
const historicalBoost = historicalWeights[rec.ssg] || 0;
rec.score = rec.score * (1 + historicalBoost);
rec.reasoning.push(
`Historical data: ${
historicalBoost > 0 ? "positive" : "neutral"
} track record`,
);
}
return baseRecommendation;
}
```
2. **Community Pattern Recognition**
- Implement clustering algorithm for similar projects
- Detect common success patterns by technology stack
- Calculate confidence scores based on sample size
3. **Failure Pattern Detection**
- Track unsuccessful deployments
- Create `deployment_failed_with` relationships
- Warn users about known problematic configurations
4. **Recommendation Explanation**
- Generate human-readable reasoning paths
- Show historical success rates
- Display similar successful projects
#### Deliverables
- Enhanced `src/tools/recommend-ssg.ts` with KG integration
- New `src/recommendation/historical-analyzer.ts` module
- Tests: `tests/tools/recommend-ssg-enhanced.test.ts`
- Documentation: Updated tool reference
---
### 2.2 User Preferences Management
**Priority**: Should Have
**Estimated Effort**: 2-3 days
**Dependencies**: 1.1
#### Tasks
1. **User Entity Implementation**
```typescript
// New file: src/memory/user-preferences.ts
export interface UserPreferences {
userId: string;
preferredSSGs: string[];
preferredTechnologies: string[];
expertiseLevel: "beginner" | "intermediate" | "advanced";
documentationStyle: "minimal" | "comprehensive" | "tutorial-heavy";
preferredDiataxisCategories: string[];
deploymentPreferences: {
autoDeployOnSuccess: boolean;
requireManualReview: boolean;
preferredBranch: string;
};
}
export class UserPreferenceManager {
async setPreference(
userId: string,
prefs: Partial<UserPreferences>,
): Promise<void>;
async getPreferences(userId: string): Promise<UserPreferences>;
async recordChoice(
userId: string,
choiceType: string,
choice: any,
): Promise<void>;
async inferPreferences(userId: string): Promise<Partial<UserPreferences>>;
}
```
2. **Preference Learning**
- Track user choices across sessions
- Implement preference inference from behavior
- Create `user_prefers_ssg` relationships
- Weight preferences by recency and frequency
3. **New MCP Tool: manage_preferences**
```typescript
{
name: "manage_preferences",
description: "Manage user preferences for documentation generation",
inputSchema: z.object({
action: z.enum(['get', 'set', 'reset']),
preferences: z.object({
preferredSSGs: z.array(z.string()).optional(),
expertiseLevel: z.enum(['beginner', 'intermediate', 'advanced']).optional(),
// ... other preferences
}).optional(),
}),
}
```
4. **Preference Integration**
- Apply preferences in `recommend_ssg`
- Use preferences in `populate_diataxis_content`
- Respect preferences in `setup_structure`
#### Deliverables
- New `src/memory/user-preferences.ts` module
- New MCP tool in `src/index.ts`
- Tests: `tests/memory/user-preferences.test.ts`
- Documentation: `docs/how-to/manage-preferences.md`
---
### 2.3 Deployment Success Tracking
**Priority**: Should Have
**Estimated Effort**: 2-3 days
**Dependencies**: Phase 1, existing `src/tools/deploy-pages.ts`
#### Tasks
1. **Deployment Outcome Storage** (src/tools/deploy-pages.ts:1255-1266)
```typescript
// Enhancement to src/tools/deploy-pages.ts
async function deployPages(args: any): Promise<DeploymentResult> {
const kg = await getKnowledgeGraph();
// Perform deployment
const result = await performDeployment(args);
// Create configuration entity
const configNode = await kg.addNode({
id: `config-${Date.now()}`,
type: "configuration",
label: `${args.ssg} configuration`,
properties: {
ssg: args.ssg,
settings: extractSettings(args),
deploymentSuccessRate: 1.0,
usageCount: 1,
lastUsed: new Date().toISOString(),
},
weight: 1.0,
});
// Link project to configuration
await kg.addEdge({
id: `${args.repository}-deployed-with-${configNode.id}`,
source: args.repository,
target: configNode.id,
type: "project_deployed_with",
weight: 1.0,
confidence: result.success ? 1.0 : 0.0,
properties: {
success: result.success,
timestamp: result.timestamp,
buildTime: result.buildTime,
},
});
return result;
}
```
2. **Success Metrics**
- Track deployment outcomes (success/failure)
- Store build times and performance metrics
- Record error patterns for failed deployments
3. **Configuration Effectiveness Scoring**
- Calculate success rate per configuration
- Weight recent deployments more heavily
- Update configuration scores over time
4. **Failure Analysis**
- Store error messages and stack traces
- Create `deployment_failed_due_to` relationships
- Link failures to specific configuration settings
#### Deliverables
- Enhanced `src/tools/deploy-pages.ts` with outcome tracking
- New `src/memory/deployment-analytics.ts` module
- Tests: `tests/integration/deployment-tracking.test.ts`
- Documentation: Updated deployment guide
---
## Phase 3: Advanced Features (Weeks 5-6)
### Objective
Implement code-to-documentation mapping, context-aware content generation, and community insights capabilities.
### 3.1 Code-to-Documentation Relationship Tracking
**Priority**: Must Have (per PRD Section 8)
**Estimated Effort**: 4-5 days
**Dependencies**: Phase 1, existing `src/utils/code-scanner.ts`
#### Tasks
1. **AST-Based Code Analysis Enhancement**
```typescript
// Enhancement to src/utils/code-scanner.ts
export interface CodeStructure {
filePath: string;
language: string;
functions: FunctionDefinition[];
classes: ClassDefinition[];
imports: ImportStatement[];
exports: ExportStatement[];
dependencies: string[];
hash: string; // Content hash for change detection
}
export class ASTAnalyzer {
async analyzeFile(filePath: string): Promise<CodeStructure>;
async detectChanges(oldHash: string, newHash: string): Promise<ChangeSet>;
async extractSemanticInfo(ast: any): Promise<SemanticInfo>;
}
```
2. **CodeFile Entity Creation**
- Parse all code files during repository analysis
- Create CodeFile entities in knowledge graph
- Store function signatures, class hierarchies
- Track dependencies between code files
3. **Documentation Section Mapping**
```typescript
// New file: src/memory/doc-code-mapper.ts
export class DocumentationCodeMapper {
async mapCodeToDocumentation(
codeFiles: CodeFile[],
docFiles: DocumentationFile[],
): Promise<Mapping[]>;
async detectOutdatedDocumentation(
projectId: string,
): Promise<OutdatedSection[]>;
async suggestUpdates(
outdatedSection: OutdatedSection,
): Promise<UpdateSuggestion[]>;
}
```
4. **Documentation Drift Detection**
- Compare code hashes against stored values
- Identify changed functions/classes
- Find documentation sections referencing changed code
- Create `outdated_for` relationships
5. **New MCP Tool: check_documentation_sync**
```typescript
{
name: "check_documentation_sync",
description: "Check if documentation is synchronized with code",
inputSchema: z.object({
projectPath: z.string(),
documentationPath: z.string(),
autoFix: z.boolean().optional().default(false),
}),
}
```
#### Deliverables
- Enhanced `src/utils/code-scanner.ts` with AST analysis
- New `src/memory/doc-code-mapper.ts` module
- New MCP tool for sync checking
- Tests: `tests/integration/code-doc-sync.test.ts`
- Documentation: `docs/how-to/maintain-code-doc-sync.md`
---
### 3.2 Context-Aware Documentation Generation
**Priority**: Must Have (per PRD Section 9)
**Estimated Effort**: 4-5 days
**Dependencies**: 3.1, existing `src/tools/populate-content.ts`
#### Tasks
1. **Multi-Agent Architecture** (inspired by Facebook's DocAgent)
```typescript
// New file: src/generation/doc-agent.ts
export interface DocumentationAgent {
name: string;
role: "reader" | "searcher" | "writer" | "verifier";
execute(context: GenerationContext): Promise<AgentResult>;
}
export class ReaderAgent implements DocumentationAgent {
// Extract semantic information from code
async execute(context: GenerationContext): Promise<CodeSemantics>;
}
export class SearcherAgent implements DocumentationAgent {
// Find similar code patterns in knowledge graph
async execute(context: GenerationContext): Promise<SimilarPatterns>;
}
export class WriterAgent implements DocumentationAgent {
// Generate documentation content
async execute(context: GenerationContext): Promise<GeneratedContent>;
}
export class VerifierAgent implements DocumentationAgent {
// Verify accuracy and quality
async execute(context: GenerationContext): Promise<VerificationResult>;
}
```
2. **Hierarchical Processing**
- Repository level: Overall architecture documentation
- Module level: Module-specific guides
- Function level: Detailed API documentation
- Coordinate agents at each level
3. **Context Extraction**
- Use AST to extract function signatures
- Analyze function calls and dependencies
- Extract inline comments and docstrings
- Build semantic context from code structure
4. **Template Adaptation**
- Dynamically adjust templates based on code complexity
- Generate different styles for different code patterns
- Adapt to project-specific conventions
5. **Quality Verification**
- Check generated content against code
- Verify all parameters are documented
- Ensure examples are accurate
- Score documentation quality
#### Deliverables
- New `src/generation/doc-agent.ts` multi-agent system
- Enhanced `src/tools/populate-content.ts` using doc-agent
- New `src/generation/template-adapter.ts` module
- Tests: `tests/generation/doc-agent.test.ts`
- Documentation: `docs/explanation/context-aware-generation.md`
---
### 3.3 Community Insights and Analytics
**Priority**: Could Have
**Estimated Effort**: 3 days
**Dependencies**: Phase 2
#### Tasks
1. **Community Pattern Analysis**
```typescript
// New file: src/analytics/community-insights.ts
export class CommunityInsightsAnalyzer {
async getPopularSSGsByTechnology(tech: string): Promise<SSGStats>;
async getSuccessfulPatterns(projectType: string): Promise<Pattern[]>;
async getBestPractices(domain: string): Promise<BestPractice[]>;
async getCommonPitfalls(ssg: string): Promise<Pitfall[]>;
}
```
2. **New MCP Tool: query_community_insights**
```typescript
{
name: "query_community_insights",
description: "Query knowledge graph for community insights",
inputSchema: z.object({
queryType: z.enum([
'popular_ssgs',
'successful_patterns',
'best_practices',
'common_pitfalls'
]),
technology: z.string().optional(),
projectType: z.string().optional(),
}),
}
```
3. **Anonymized Data Aggregation**
- Aggregate statistics across all projects
- Calculate success rates by configuration
- Identify trending technologies
- Generate insight reports
4. **Visualization Data**
- Prepare data for graph visualization
- Generate success rate charts
- Create technology adoption trends
- Format for MCP resource consumption
#### Deliverables
- New `src/analytics/community-insights.ts` module
- New MCP tool for querying insights
- Tests: `tests/analytics/community-insights.test.ts`
- Documentation: `docs/reference/community-insights-api.md`
---
## Testing Strategy
### Unit Tests
- **Memory Layer**: Test each KG operation in isolation
- **Schema Validation**: Verify Zod schemas catch invalid data
- **Storage Safety**: Test file markers and atomic operations
- **Preference Management**: Test preference storage and retrieval
### Integration Tests
- **End-to-End Workflows**: Test complete analysis ā recommendation ā deployment flows
- **Cross-Tool Communication**: Verify KG data flows between tools
- **Code-Doc Sync**: Test drift detection and update suggestions
- **Agent Coordination**: Test multi-agent doc generation
### Performance Tests
- **KG Query Performance**: Ensure sub-100ms read operations
- **Large Graph Scalability**: Test with 10,000+ entities
- **Memory Usage**: Monitor memory consumption during heavy usage
- **Concurrent Operations**: Test thread safety and race conditions
### Coverage Targets
- Memory modules: 85%+
- Tool integrations: 80%+
- New features: 80%+
- Overall project: Maintain 80%+
---
## Migration and Backward Compatibility
### Data Migration
1. **Existing Memory Data**
- Convert existing JSONL memories to new schema
- Create Project entities from stored analyses
- Generate initial relationships from existing data
2. **Migration Script**
```bash
npm run migrate:knowledge-graph
```
3. **Version Markers**
- Add schema version to stored data
- Support automatic migration on version bump
### API Compatibility
- Existing MCP tools remain functional
- New features are additive (no breaking changes)
- Enhanced tools return backward-compatible responses
- New fields added with optional flags
---
## Documentation Updates
### New Documentation Required
1. **ADR-010**: Knowledge Graph Architecture and Schema Design
2. **ADR-011**: Code-to-Documentation Synchronization Strategy
3. **ADR-012**: Context-Aware Content Generation Architecture
### Updated Documentation
- CLAUDE.md: Add KG architecture overview
- Tool reference docs: Document enhanced capabilities
- How-to guides: Add KG-specific workflows
- Explanation docs: Document learning mechanisms
### User-Facing Documentation
- Getting started with intelligent recommendations
- Managing user preferences
- Understanding community insights
- Maintaining code-documentation synchronization
---
## Risk Assessment and Mitigation
### Technical Risks
| Risk | Probability | Impact | Mitigation |
| ----------------------------------------- | ----------- | ------ | --------------------------------------------------- |
| Performance degradation with large graphs | Medium | High | Implement indexing, caching, and query optimization |
| Data corruption in JSONL files | Low | High | Atomic writes, file markers, automatic backups |
| AST parsing failures for edge cases | Medium | Medium | Graceful degradation, fallback to simple analysis |
| Memory leaks in graph operations | Low | Medium | Rigorous testing, memory profiling |
### Product Risks
| Risk | Probability | Impact | Mitigation |
| ----------------------------- | ----------- | ------ | ----------------------------------------------------------- |
| User privacy concerns | Low | High | Clear documentation, opt-out mechanisms, local-only storage |
| Complexity overwhelming users | Medium | Medium | Progressive disclosure, sensible defaults |
| Inaccurate recommendations | Medium | Medium | Confidence scores, human review options |
---
## Success Metrics
### Phase 1 Success Criteria
- [ ] Repository analysis successfully creates Project entities
- [ ] Historical context retrieved in <100ms
- [ ] File markers prevent accidental overwrites
- [ ] 85%+ test coverage for memory layer
### Phase 2 Success Criteria
- [ ] SSG recommendations incorporate historical data
- [ ] User preferences persist and apply correctly
- [ ] Deployment outcomes tracked with 100% reliability
- [ ] Recommendation accuracy improves by 20%+ with historical data
### Phase 3 Success Criteria
- [ ] Code changes trigger documentation sync checks
- [ ] Context-aware generation produces project-specific content
- [ ] Community insights queries return in <200ms
- [ ] Documentation quality scores improve by 30%+
### Overall Success Metrics
- Recommendation accuracy: 80%+ (vs. baseline)
- User satisfaction: Net Promoter Score > 50
- Documentation quality: Average score > 8/10
- Performance: No >10% degradation in tool execution time
- Test coverage: Maintain 80%+ overall coverage
---
## Next Steps
### Immediate Actions (Week 1)
1. Review and approve this implementation plan
2. Create GitHub issues for each major task
3. Set up project board with phases and milestones
4. Begin Phase 1.1: Enhanced Knowledge Graph Schema
### Ongoing
- Weekly progress reviews
- Continuous testing and quality assurance
- Documentation updates with each feature
- User feedback collection and incorporation
---
## Appendix: File Structure
```
src/
āāā memory/
ā āāā knowledge-graph.ts # Enhanced with new schema
ā āāā schemas.ts # NEW: Zod schemas for entities
ā āāā manager.ts # Updated with KG integration
ā āāā storage.ts # Enhanced with safety features
ā āāā integrity.ts # NEW: Data integrity checks
ā āāā user-preferences.ts # NEW: User preference management
ā āāā doc-code-mapper.ts # NEW: Code-doc synchronization
ā āāā deployment-analytics.ts # NEW: Deployment outcome tracking
āāā generation/
ā āāā doc-agent.ts # NEW: Multi-agent system
ā āāā template-adapter.ts # NEW: Dynamic template adaptation
āāā analytics/
ā āāā community-insights.ts # NEW: Community pattern analysis
āāā tools/
ā āāā analyze-repository.ts # Enhanced with KG integration
ā āāā recommend-ssg.ts # Enhanced with historical data
ā āāā populate-content.ts # Enhanced with context-awareness
ā āāā deploy-pages.ts # Enhanced with outcome tracking
āāā utils/
āāā code-scanner.ts # Enhanced with AST analysis
tests/
āāā memory/
ā āāā knowledge-graph-enhanced.test.ts
ā āāā storage-safety.test.ts
ā āāā user-preferences.test.ts
āāā integration/
ā āāā knowledge-graph-analysis.test.ts
ā āāā deployment-tracking.test.ts
ā āāā code-doc-sync.test.ts
āāā generation/
āāā doc-agent.test.ts
docs/
āāā adrs/
ā āāā 010-knowledge-graph-architecture.md
ā āāā 011-code-doc-synchronization.md
ā āāā 012-context-aware-generation.md
āāā how-to/
ā āāā knowledge-graph-maintenance.md
ā āāā manage-preferences.md
ā āāā maintain-code-doc-sync.md
āāā explanation/
āāā context-aware-generation.md
```
---
**Document Version**: 1.0
**Last Updated**: 2025-10-01
**Next Review**: Start of each phase