Project source code: https://github.com/sopaco/deepwiki-rs
Introduction: Context Dilemma and the Value of Litho
In the daily practice of AI-assisted programming, whether using ByteDance TRAE, Alibaba iFlow, or intelligent programming assistants like Codex and Claude Code, developers face a common challenge: the limitation of context understanding. While these AI tools are powerful, they primarily rely on two methods to obtain project information:
π Fundamental Limitations of Traditional AI Analysis Methods
Method 1: Real-time Tool Call Analysis
- AI tools need to read code files individually through file system tools each time
- Analysis takes extremely long, large projects may require several minutes or even tens of minutes
- Context window is limited, cannot analyze the entire project simultaneously
- High cost, each analysis consumes large amounts of Tokens
- Unstable results, same question may receive different answers
Method 2: Fragmented Context Piecing Together
- Can only see currently opened files or manually provided code snippets
- Difficult to understand complex dependencies between modules
- Lacks systematic understanding of overall project architecture
- Cannot identify cross-file business processes and design patterns
π Litho's Revolutionary Advantage
Litho (deepwiki-rs) adopts a completely different approach: one-time deep analysis, structured knowledge storage, instant context provision. It doesn't temporarily read code when AI tools need it, but instead:
- π Pre-emptive Deep Mining: Uses professional algorithms to analyze the entire codebase at once, extracting key information such as architecture, dependencies, and workflows
- π§ Structured Storage: Converts analysis results into AI-friendly structured documents, including C4 architecture diagrams, module relationship diagrams, and business process diagrams
- β‘ Instant Provision: AI tools directly obtain complete context information without real-time analysis, response speed increased by 10-100 times
This "analyze once, benefit everywhere" model completely solves the context acquisition problems of traditional AI tools.
Litho: The Intelligent Miner of Project Knowledge
Core Functions: One Investment, Continuous Benefits
Litho adopts a multi-engine workflow based on static code analysis and AI Multi-Agents, establishing permanent knowledge assets for projects through four key phases:
- Preprocessing Phase: Intelligently scans code structure, builds a comprehensive project map
- Research and Investigation Phase: Deeply analyzes module functions and design patterns, extracts implicit knowledge
- Document Organization Phase: Automatically generates C4 architecture diagrams, dependency relationship diagrams, and business process diagrams
- Output Phase: Creates structured documents that AI tools can directly consume
π― Comparison with Traditional AI Analysis Methods
| Comparison Dimension | Traditional Tool Call Analysis | Litho Preprocessing Analysis |
|---|---|---|
| Analysis Time | Requires re-analysis for each query (2-30 minutes) | One-time analysis (5-15 minutes), subsequent instant responses |
| Cost Consumption | Large Token consumption for each analysis, linear cost growth | Upfront investment, nearly zero cost subsequently, significant cost reduction |
| Analysis Depth | Limited by context window, only shallow analysis possible | Full project deep analysis, discovers hidden architectural patterns |
| Consistency | Same question may receive different answers | Deterministic analysis, stable and reliable results |
| Concurrency Capability | Cannot simultaneously serve multiple complex queries | Supports multiple AI tools accessing simultaneously |
| Knowledge Accumulation | Analysis results cannot be reused, starts from zero each time | Builds project knowledge base, continuously accumulates value |
Generated Content: Complete Project Knowledge Graph Understandable by AI
Litho's output is carefully designed specifically for the consumption needs of AI tools:
π System-Level Context (First-hand Information for AI Decision-Making)
- Project Panorama: Purpose, core functions, technology choices, business value
- System Boundaries: Clear internal and external system boundaries, preventing AI from over-designing
- Dependencies: Upstream and downstream system identification, helping AI correctly design integration solutions
- Architecture Constraints: Technology stack limitations, performance requirements, security specifications
ποΈ In-Depth Architecture Analysis (Core for AI to Understand Project Structure)
- Domain Division: DDD bounded contexts, microservice boundaries, module responsibilities
- Dependency Map: Dependencies between modules, circular dependency detection, coupling analysis
- Design Patterns: Identified architectural patterns, coding standards, best practices
- Technical Debt: Potential problem points, refactoring suggestions, optimization directions
π Business Process Graph (Navigation for AI to Understand Business Logic)
- Core Processes: User journeys, data flows, business rules
- Interaction Patterns: Inter-service communication, API design, event-driven mechanisms
- Exception Handling: Error propagation, fault tolerance mechanisms, recovery strategies
βοΈ Implementation Details (Precise Basis for AI Code Generation)
- Core Algorithms: Key business logic, data processing flows, performance optimization techniques
- Interface Specifications: API contracts, data formats, version compatibility
- Configuration Management: Environment variables, configuration items, deployment parameters
This content is not simple code copying, but structured knowledge after deep AI understanding, that can be directly consumed and inferred by other AI tools.
π₯ Litho vs Traditional AI Analysis: Deep Advantage Analysis
Fatal Defects of Traditional AI Real-time Analysis
πΈ Cost Explosion: Bottomless Token Consumption
Typical Scenario: Analyzing medium-sized project (500+ files)
Traditional AI Tool Call Mode:
1. List file structure: ~2K Token
2. Read core files: ~15K Token (50 Γ 300 characters)
3. Analyze dependencies: ~10K Token (requires repeated questioning)
4. Understand business processes: ~12K Token (cross-file tracking)
5. Provide suggestions: ~3K Token
Cumulative per query: ~42K Token ($0.13)
And developers might query 50 complex questions per day...
Daily cost: $6.5, that's $195 per month!
Litho's Cost Advantage:
One-time Deep Analysis:
- Full project scan + AI analysis: ~80K Token ($0.24)
- Generate structured documents: nearly zero cost
- Subsequent queries: ~2K Token ($0.006)
β° Time Black Hole: Endless Waiting Loops
Developer's Real Experience:
Traditional AI Mode:
9:00 - "Help me refactor this module"
9:02 - AI: "Analyzing project structure..."
9:05 - AI: "Reading related files..."
9:08 - AI: "Understanding dependencies..."
9:12 - AI: "Context window full, need to simplify analysis..."
9:15 - AI: "Based on partial analysis, suggestions..."
9:30 - Developer finds suggestions incomplete, asks again...
9:45 - Repeat analysis process...
Actual effective work time: <10 minutes
Waiting time: >35 minutes
Litho Mode:
9:00 - "Help me refactor this module"
9:00:30 - AI: "Based on complete project analysis, here's the optimal solution..."
9:05 - Developer gets detailed, accurate refactoring suggestions
Effective work time: 100%
Waiting time: Approximately 0
π― Quality Gambling: Unreliable Analysis Results
Traditional AI Quality Issues:
- Incomplete Information: Can only see partial code, easily misses key dependencies
- Understanding Deviation: Lacks overall architectural awareness, suggestions may violate design principles
- Strong Randomness: Same question may get different answers at different times
- Context Forgetting: Forgets previous analysis results in long conversations
Litho's Quality Assurance:
- Completeness: Analyzes all code at once, no omissions
- Consistency: Same input always gets same output
- Accuracy: Precise analysis based on complete dependency relationships
- Structure: Standardized output format, easy for AI to understand
iflow + Litho: Context Enhancement for Intelligent Workflows
iflow's Typical Use Cases
iflow as an intelligent workflow orchestration tool is typically used for:
- Automated CI/CD pipeline design
- Microservice architecture planning
- Data pipeline construction
- API gateway configuration
Context Value Provided by Litho for iflow
When Alibaba iFlow needs to design or optimize workflows for existing projects, the project documentation generated by Litho can provide:
π Performance Revolution: From "Minute-level Waiting" to "Second-level Response"
Painful Experience of Traditional AI Real-time Analysis:
User: Design CI/CD pipeline for this project
AI: Analyzing project structure... (2 minutes later)
AI: Reading code files... (5 minutes later)
AI: Analyzing dependencies... (8 minutes later)
AI: Sorry, context window full, cannot continue analysis...
[User waits helplessly, or gives up using AI]
Actual experience:
- Waiting time: 10-30 minutes
- Success rate: 60-70%
Smooth Experience Empowered by Litho:
User: Design CI/CD pipeline for this project
AI: Based on Litho analysis, immediately providing complete solution...
(Response time: <1 second)
Actual experience:
- Waiting time: <1 second
- Success rate: 95%+
Key difference:
π― Instant response + quality suggestions = ultimate user experience
π Deep Performance Comparison Data
| Metric | Traditional Tool Call | Litho Preprocessing Analysis | Improvement Factor |
|---|---|---|---|
| First Response Time | 5-30 minutes | 5-15 minutes (one-time) | Infinitely fast thereafter |
| Subsequent Query Response | 5-30 minutes/time | <1 second (instant) | 300-1800x improvement |
| Token Consumption | 10K-50K/time | 2K-5K/time | 5-25x savings |
| Concurrency Support | β Cannot support complex concurrency | β Supports unlimited concurrency | Breakthrough from 0 to β |
| Result Consistency | 60-70% | 95%+ | 36%+ quality improvement |
| Analysis Completeness | 30-50% (window limited) | 90-95% (full project analysis) | 2-3x completeness |
| Knowledge Reuse Rate | 0% (recalculated each time) | 95% (one investment, continuous benefits) | Leap from 0 to 95% |
ποΈ Architecture Panorama: From Fragmented Information to Complete Understanding
π‘ Practical Comparison: From "Exploratory Q&A" to "Precision Design"
Scenario: Designing CI/CD Pipeline for Microservice Project
Traditional iflow's Exploratory Pain:
User: "Design CI/CD pipeline for this project"
iflow: "I need to understand the project structure first. How many services does the project contain?"
User: "About 4-5 microservices"
iflow: "What technology stack does each microservice use?"
User: "Auth uses Node.js, Order uses Java, I don't quite remember the others..."
iflow: "What about databases? Any Redis, MongoDB?"
User: "Yes, but I need to check the code for the specific combination..."
iflow: "Please provide dependency relationships, I need to know the build order..."
(20 minutes later, information still incomplete, low-quality analysis results)
One-stop Precision Design Empowered by Litho:
User: "Design CI/CD pipeline for this project"
iflow: "Based on Litho analysis, immediately providing complete solution:
π Project Architecture Overview:
- auth-service (Node.js 18 + Redis 7.0)
- order-service (Java 17 + PostgreSQL 14)
- payment-service (Python 3.11 + MongoDB 6.0)
- notification-service (Go 1.21 + RabbitMQ 3.12)
π§ Technology Stack Analysis:
- Build tools: npm, Maven, pip, Go modules
- Containerization: Docker + Kubernetes
- Dependencies: order β auth β payment β notification
π CI/CD Solution:
[Immediately generates complete GitLab CI configuration]
Response time: <2 seconds"
Effect Comparison:
- β° Time Saving: From 20 minutes exploration β 2 seconds precision solution
- π° Cost Reduction: From 15K Token β 1K Token
- π― Accuracy: From 60% dependency guessing β 95% architectural precision
- π Experience: From frustrating β delightful
Practical Case: iflow Uses Litho Documentation to Refactor Deployment Process
- Litho Analysis Output: Identifies project adopts DDD architecture, contains 6 bounded contexts
- iflow Understanding: Designs independent deployment strategy based on architecture documentation
- Process Optimization: Optimizes build order based on dependency relationship diagram
- Monitoring Integration: Uses component diagram to design monitoring and alerting solutions
Codex + Litho: Intelligent Upgrade for Code Completion
Codex's Capability Boundaries
GitHub Copilot (based on Codex) performs excellently in code completion but has limitations:
- Lacks overall project concept
- Doesn't understand business domain rules
- Cannot perceive architectural constraints
- Limited understanding of design patterns
Deep Context Provided by Litho
1. Project-Level Code Completion
Traditional Codex Completion:
// User input: interface User {
// Codex suggestion:
interface User {
id: number;
name: string;
email: string;
}
Codex Completion Empowered by Litho:
// User input: interface User {
// Based on project architecture and domain model analyzed by Litho:
interface User {
id: UserId; // Project uses value object types
profile: UserProfile; // Aggregate root design
permissions: Permission[]; // RBAC permission model
createdAt: DateTime;
updatedAt: DateTime;
// Based on domain rules identified by Litho:
validate(): ValidationResult;
hasPermission(action: PermissionType): boolean;
}
2. Architecture-Aware Code Generation
Litho enables Codex to understand the project's architectural patterns and design constraints:
// Litho discovers project uses Clean Architecture
// Codex-generated code automatically follows this pattern
// Controller Layer
class UserController {
constructor(userUseCase) {
this.userUseCase = userUseCase;
}
// Based on API specifications identified by Litho
async createUser(req, res) {
const userData = req.body;
// Automatically applies dependency injection and error handling patterns
const result = await this.userUseCase.execute(userData);
res.status(201).json(result);
}
}
Practical Effect Comparison
| Scenario | Traditional Codex | Litho-Empowered Codex |
|---|---|---|
| API Interface Design | Generic REST style | Follows project API specifications |
| Data Model Definition | Basic CRUD fields | Conforms to domain model design |
| Error Handling | Generic exception catching | Project unified error mechanism |
| Test Writing | Basic unit tests | Architecture-aware integration tests |
Claude + Litho: Context Foundation for Deep Conversations
Claude's Conversational Advantages
Claude has unique advantages in complex conversations, architectural design, and code refactoring, but it also requires sufficient context information to maximize its effectiveness.
Context Foundation Provided by Litho for Claude
1. Architecture Refactoring Conversations
Traditional Claude's Exploratory Refactoring:
Developer: "Help me refactor PaymentService"
Claude: "I need to understand the current structure of PaymentService first. Can you show me this file?"
[Tool call: read_file payment_service.rs]
Claude: "Now I see the code, let me analyze the dependencies..."
[Tool call: search "PaymentService" --include="*.rs"]
Claude: "I also need to understand the functionality of these dependent modules..."
[Tool call: read_file order_service.rs]
Claude: "Let me also check the test cases..."
[Tool call: read_file payment_service_test.rs]
Claude: "Hmm... this class has mixed responsibilities, but I need more information to determine the best refactoring approach..."
(5-10 minutes pass, analysis still incomplete, inconsistent suggestion quality)
Expert-level Refactoring Empowered by Litho:
Developer: "Help me refactor PaymentService"
Claude: "Based on Litho architecture analysis, I have complete project understanding:
π PaymentService Current Status Analysis:
- **Current Responsibilities**: Payment processing (45%), order validation (30%), notification sending (25%)
- **Code Lines**: 342 lines, high complexity
- **Direct Dependencies**: OrderService, NotificationService, PaymentGateway
- **Dependent Modules**: 8 other services calling it
ποΈ Refactoring Plan (based on unified project architecture patterns):
1. **PaymentCore**: Core payment logic (maintain existing interface)
2. **OrderValidator**: Move to independent validation service
3. **PaymentNotifier**: Integrate into NotificationService
π§ Detailed Refactoring Steps:
1. Keep PaymentCore's external contract unchanged
2. Extract order validation logic into independent Validator microservice
3. Use event pattern to replace direct notifications
β‘ Risk Control: Zero-downtime refactoring, 3-week phased completion
Response time: <3 seconds (Litho provides complete context)"
Refactoring Effect:
- β° Analysis Speed: From 5-10 minutes β 3 seconds
- π― Solution Quality: From 70% feasible β 95% optimal
- π Risk Control: From experience-based judgment β Data-supported
- π Success Probability: From uncertain β High reliability
2. Technical Decision Support
Technical documentation generated by Litho provides decision-making basis for Claude:
Developer: "Should I introduce GraphQL?"
Claude: "Based on Litho analysis, your project characteristics:
- Currently using REST APIs (17 endpoints)
- Frontend needs frequent complex data queries
- Team familiar with JavaScript ecosystem
Recommend introducing GraphQL, reasons:
1. Reduce network request count
2. Avoid over-fetching data
3. Better type safety
Implementation strategy: Start with new features, gradually migrate..."
Complex Scene Context Enhancement
New Team Member Onboarding Guidance
Litho + Claude combination can provide intelligent guidance for new team members:
Newcomer: "I want to understand the user authentication process"
Claude: "Based on documentation generated by Litho, the authentication process includes:
1. Authentication Context (Auth Context)
- LoginController: Receives login requests
- AuthService: Core authentication logic
- TokenProvider: JWT Token generation
2. Specific Process Diagram:
[Mermaid diagram showing complete authentication process]
3. Key code locations:
- src/auth/service.rs#L45-89
- src/auth/controller.rs#L23-41
Do you need me to explain a specific part in detail?"
Implementation Strategy: Integrating Litho into AI Programming Workflow
Specific Usage: From Document Generation to AI Empowerment
β‘ Step 1: 15 Minute Investment for Unlimited Returns
Litho's core value proposition: Use a one-time deep analysis investment to exchange for instant intelligent support throughout the entire project lifecycle.
# π Install Litho (one-time investment, permanent use)
cargo install deepwiki-rs
# π Generate project knowledge assets (15 minute one-time investment)
deepwiki-rs -p ./your-project -o ./litho.docs
# βοΈ Advanced configuration (optional, for large complex projects)
deepwiki-rs \
-p ./your-project \
-o ./litho.docs \
--llm_provider openai \
--model_efficient gpt-3.5-turbo \
--model_powerful gpt-4 \
--target_language en \
--verbose
# 4. Generate documentation for specific phases only (quick mode)
deepwiki-rs \
-p ./your-project \
-o ./litho.docs \
--skip_preprocessing \
--skip_research
After execution, Litho will generate the following structure in the specified directory:
litho.docs/
βββ __Litho_Summary_Brief__.md # Project overview summary
βββ __Litho_Summary_Detail__.md # Detailed analysis report
βββ 1_Project_Overview.md # System context, technology choices, boundary analysis
βββ 2_Architecture_Overview.md # Domain division, core modules, architectural design
βββ 3_Workflow.md # Core business processes, interaction workflows
βββ 4_Deep_Exploration/ # Detailed technical analysis of each module
βββ Module_Component_Research_Report_Preprocessing_Domain.md
βββ Module_Component_Research_Report_Research_Domain.md
βββ Module_Component_Research_Report_Document_Orchestration_Domain.md
βββ ...
Step 2: Configure RULES for AI Tools
1. iflow CLI Configuration
Create .iflow/rules.md file to guide iflow in using Litho documentation:
# iFlow Litho Integration Rules
## π Project Context Priority
Before executing any task, must consult Litho documentation in the following order:
### 1. Quick Overview (Must read for first analysis)
- File: `litho.docs/__Litho_Summary_Brief__.md`
- Purpose: Quickly understand project overview, technology stack, core modules
### 2. Deep Analysis (Select based on task type)
- **Architecture design tasks** β `litho.docs/2_Architecture_Overview.md`
- **Process optimization tasks** β `litho.docs/3_Workflow.md`
- **Module refactoring tasks** β `litho.docs/4_Deep_Exploration/` corresponding module
## π§ iflow Workflow Design Specifications
### CI/CD Process Design
bash
iflow prompt example
"Design CI/CD pipeline for this project, please based on the following Litho analysis results:
-
Project architecture: [Consult litho.docs/2_Architecture_Overview.md]
- Service quantity and boundaries
- Technology stack combination
- Dependencies
-
Build requirements: [Consult litho.docs/3_Workflow.md]
- Build order
- Testing strategy
- Deployment dependencies
-
Constraint conditions: [Consult litho.docs/1_Project_Overview.md]
- External dependency services
- Environment requirements
- Compliance limitations
Please generate complete CI/CD configuration files..."
### Microservice Split Design
bash
iflow prompt example
"Based on module boundaries identified by Litho analysis, design microservice splitting solution:
Reference documents:
- litho.docs/2_Architecture_Overview.md (Domain module division)
- litho.docs/4_Deep_Exploration/ (Module responsibilities)
Output requirements:
- Service boundary definitions
- API interface designs
- Data consistency solutions
- Inter-service communication strategies"
## β‘ Practical Operation Process
### Scenario 1: New Project Onboarding Analysis
bash
1. Start iflow
iflow
2. Execute project initialization analysis
/init
3. iflow automatically references Litho documentation for analysis
iflow> π Reading litho.docs/Litho_Summary_Brief.md...
iflow> β
Project overview: DDD architecture e-commerce system, contains 4 core domains
iflow> π Technology stack: Spring Boot + MySQL + Redis + RabbitMQ
iflow> ποΈ Core modules: User service, Product service, Order service, Payment service
4. Deep Q&A based on Litho documentation
iflow> Please explain the core business process of the order service
iflow> π Consulting litho.docs/3_Workflow.md...
iflow> π Order process includes: Create order β Inventory check β Payment processing β Logistics delivery
### Scenario 2: CI/CD Pipeline Design
bash
iflow> Configure complete CI/CD process for this project
Analysis steps automatically executed by iflow:
1οΈβ£ Read litho.docs/1_Project_Overview.md β Identify technology stack and dependencies
2οΈβ£ Analyze litho.docs/2_Architecture_Overview.md β Determine service boundaries and build order
3οΈβ£ Refer to litho.docs/3_Workflow.md β Understand deployment dependency relationships
4οΈβ£ Combine litho.docs/4_Deep_Exploration/ β Understand specific build requirements of each module
Generate targeted configurations:
π§ GitLab CI configuration (.gitlab-ci.yml)
π Kubernetes deployment configuration
π¦ Dockerfile optimization suggestions
π Monitoring and logging solutions
#### 2. Claude Code Configuration
Create `.claude/rules.md` in project root directory:
markdown
Claude Code Litho Integration Rules
π Project Context Rules
Mandatory requirement: Before providing any code suggestions, you must first consult the litho.docs folder.
Document Consultation Order
-
__Litho_Summary_Brief__.md- Quick project overview - Select detailed documents based on task type:
- Architecture related β
2_Architecture_Overview.md - Process related β
3_Workflow.md - Specific modules β
4_Deep_Exploration/
- Architecture related β
π‘ Response Format Requirements
Cite Sources
When providing suggestions, you must clearly cite Litho documentation:
According to analysis in litho.docs/2_Architecture_Overview.md...
Based on design in litho.docs/4_Deep_Exploration/User Service.md...
Architecture Consistency Check
- β Suggestions conform to identified architectural patterns
- β Follow existing design principles
- β Maintain technology stack consistency
- β Do not break existing dependency relationships
π« Prohibited Behaviors
- Ignore architectural constraints in Litho documentation
- Recommend solutions that conflict with project technology stack
- Provide major architecture change suggestions without consulting documentation
#### 3. GitHub Copilot Configuration
Create `.github/copilot-instructions.md`:
markdown
GitHub Copilot Litho Integration Instructions
π― Code Generation Rules
Pre-check
Before generating any code, please check:
-
litho.docs/2_Architecture_Overview.md- Ensure compliance with module design -
litho.docs/4_Deep_Exploration/- Follow existing code patterns
Code Template Requirements
// Based on modular design analyzed by Litho
class [ComponentName] {
// Dependency injection pattern (refer to design in Litho docs)
constructor(dependencies: DependencyInjection) {}
// Business logic implementation (conforms to workflow definitions)
async process(data: DataType): Promise {
// Implementation must comply with project architecture specifications
}
}
Technology Stack Consistency
- Use frameworks and libraries identified by Litho
- Follow project's existing naming conventions
- Maintain compatibility with existing code
### Step 3: Practical Application Cases
#### Case 1: iflow + Litho Implements Intelligent CI/CD Design
**Scenario Background**: An e-commerce project containing multiple microservices needs complete CI/CD pipeline design
**Operation Process**:
bash
1. Generate Litho documentation
deepwiki-rs -p ./ecommerce-project -o ./litho.docs --verbose
2. Start iflow and initialize project analysis
iflow
/iflow> /init
iflow automatically executes Litho documentation analysis:
π Reading litho.docs/Litho_Summary_Brief.md...
ποΈ Project architecture: Microservices architecture, 4 core services
π§ Technology stack: Spring Boot + MySQL + Redis + RabbitMQ
π¦ Build tools: Maven + Docker
**iflow's Intelligent Dialogue Based on Litho Documentation**:
bash
User question
/iflow> Design complete CI/CD pipeline for this project
Analysis steps executed by iflow:
1οΈβ£ π Read litho.docs/1_Project_Overview.md
β
Identify technology stack: Spring Boot, MySQL, Redis, RabbitMQ
β
Determine build tools: Maven, Docker
β
Understand external dependencies: MySQL service, Redis service, message queue
2οΈβ£ ποΈ Analyze litho.docs/2_Architecture_Overview.md
β
Service boundaries: user-service, product-service, order-service, payment-service
β
Dependencies: order β user, order β product, order β payment
β
Deployment order: user β product β payment β order
3οΈβ£ π Refer to litho.docs/3_Workflow.md
β
Build dependencies: user independent, product depends on user, payment independent, order depends on other three
β
Testing strategy: Unit tests + integration tests + end-to-end tests
β
Deployment requirements: Deploy in dependency order, need service registry
iflow-generated CI/CD configuration:
**iflow Output GitLab CI Configuration**:
yaml
.gitlab-ci.yml - Generated based on Litho analysis
stages:
- test
- build
- deploy-infrastructure
- deploy-services
- integration-test
variables:
DOCKER_REGISTRY: "registry.company.com"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
Cache configuration
cache:
paths:
- .m2/repository/
- node_modules/
Infrastructure deployment (MySQL, Redis, RabbitMQ)
deploy-infrastructure:
stage: deploy-infrastructure
script:
- docker-compose up -d mysql redis rabbitmq
tags:
- infrastructure
User service (independent, deployed first)
user-service:
stage: build
script:
- cd user-service
- mvn clean test
- mvn package
- docker build -t $DOCKER_REGISTRY/user-service:$CI_COMMIT_SHA .
- docker push $DOCKER_REGISTRY/user-service:$CI_COMMIT_SHA
needs: []
dependencies: []
Product service (depends on user service)
product-service:
stage: build
script:
- cd product-service
- mvn clean test
- mvn package
- docker build -t $DOCKER_REGISTRY/product-service:$CI_COMMIT_SHA .
- docker push $DOCKER_REGISTRY/product-service:$CI_COMMIT_SHA
needs: [user-service]
Payment service (independent)
payment-service:
stage: build
script:
- cd payment-service
- mvn clean test
- mvn package
- docker build -t $DOCKER_REGISTRY/payment-service:$CI_COMMIT_SHA .
- docker push $DOCKER_REGISTRY/payment-service:$CI_COMMIT_SHA
needs: []
dependencies: []
Order service (depends on all other services)
order-service:
stage: build
script:
- cd order-service
- mvn clean test
- mvn package
- docker build -t $DOCKER_REGISTRY/order-service:$CI_COMMIT_SHA .
- docker push $DOCKER_REGISTRY/order-service:$CI_COMMIT_SHA
needs: [user-service, product-service, payment-service]
Integration testing
integration-test:
stage: integration-test
script:
- cd integration-tests
- npm install
- npm run test:all-services
needs: [user-service, product-service, payment-service, order-service]
**Effect Comparison**:
| Comparison Item | Traditional iflow | Litho-empowered iflow |
|-----------------|------------------|----------------------|
| Service Boundary Recognition | β Need manual inquiry | β
Automatically identify 4 microservices |
| Dependency Analysis | β Unclear dependency relationships | β
Clear order β user|product|payment |
| Build Order Design | β Random configuration | β
Optimize build order based on dependencies |
| Deployment Strategy | β Generic solution | β
Customized for project architecture |
| Configuration Accuracy | β οΈ Around 60% | β
95%+ accuracy |
---
## Best Practices and Troubleshooting
### π Document Update Strategy
1. **Trigger Timing**
- After major functionality iterations
- After architecture refactoring completed
- Before new team members join
- Regular reviews (recommended monthly)
2. **Incremental Update Tips**
bash
# Update only specific modules (when only part of code has been modified)
deepwiki-rs -p ./my-project --skip-preprocessing
# Quick update (skip time-consuming research phase)
deepwiki-rs -p ./my-project --skip-research
3. **Version Control Recommendations**
bash
# Include generated documents in version control
git add litho.docs/
git commit -m "docs: update project documentation by Litho"
# If you need to exclude, add to .gitignore
# litho.docs/_Litho_Summary*.md
### π§ AI Tool Configuration Optimization
#### Claude Advanced Configuration
Context Priority Rules
- litho.docs/Litho_Summary_Brief.md (highest priority)
- Currently edited file content
- litho.docs/2_Architecture_Overview.md (for architecture-related questions)
- litho.docs/3_Workflow.md (for business logic questions)
- litho.docs/4_Deep_Exploration/ (for specific implementation questions)
Response Quality Checklist
β Recommendations conform to project architectural patterns?
β Technology constraints considered?
β Project coding standards followed?
β Impact scope of changes evaluated?
β Implementation steps provided?
#### iflow Workflow Integration
bash
Create iFlow workflow script (iflow-workflow.sh)
!/bin/bash
echo "π Starting iFlow + Litho enhanced workflow..."
1. Check if Litho documents exist
if [ ! -d "litho.docs" ]; then
echo "π First run detected, generating Litho documents..."
deepwiki-rs -p . --target_language en
fi
2. Start iFlow and load context rules
echo "π€ Starting iFlow and loading project context..."
iflow
echo "β
iFlow + Litho environment ready!"
## Common Issues and Solutions
### Litho Document Generation Problems
#### Issue 1: Litho analysis fails or hangs
**Symptom**:
$ deepwiki-rs -p .
Error: Analysis timeout after 300 seconds
**Solutions**:
bash
1. Check project size and complexity
find . -name ".rs" -o -name ".py" -o -name "*.js" | wc -l
2. For large projects use exclusion strategy
deepwiki-rs -p . --exclude "tests/,node_modules/,target/,dist/"
#### Issue 2: Generated documents are incomplete
**Symptom**: Missing part of document files in the generated `litho.docs` directory
### AI Tool Context Integration Problems
#### Issue 3: Claude ignores Litho documentation instructions
**Solution**: Enhance system prompt with mandatory rules
#### Issue 4: Copilot suggestions conflict with project architecture
**Solution**: Strengthen `.github/copilot-instructions.md` configuration
## Future Outlook: Collaborative Evolution of AI Programming Ecosystem
### Technology Trends
1. **Real-time Context Synchronization**: Real-time data exchange between Litho and AI assistants
2. **Multimodal Understanding**: Comprehensive understanding combining code, documentation, and diagrams
3. **Personalized Adaptation**: Context customization based on team habits
4. **Cross-project Knowledge Migration**: Reuse context patterns between similar projects
### Ecosystem Integration
As knowledge infrastructure, Litho is driving the collaborative evolution of the entire AI programming ecosystem:
Developers β AI Tools β Litho Knowledge Base
β β β
Code Changes Context Enhancement Documentation Updates
β β β
Project Evolution β Efficiency Improvement β Knowledge Accumulation
## Conclusion
**Litho is not just a documentation generation tool, but an important infrastructure for building intelligent software development ecosystem.** By structuring and making project knowledge accessible, it opens the door for AI programming assistants to understand complex software systems, marking the arrival of a new era of human-machine collaborative programming.
---
*About Litho: Litho is an open-source project developed based on Rust, dedicated to improving knowledge management and documentation maintenance issues in software development through AI technology. Project address: [https://github.com/sopaco/deepwiki-rs](https://github.com/sopaco/deepwiki-rs)*

Top comments (0)