https://github.com/alienzhou/project-context-engine
AI-powered tool for codebase analysis, documentation generation, and Markdown rendering with multi-language support and repository structure visualization.
https://github.com/alienzhou/project-context-engine
ai-code-analysis documentation-generator repository-map
Last synced: 9 months ago
JSON representation
AI-powered tool for codebase analysis, documentation generation, and Markdown rendering with multi-language support and repository structure visualization.
- Host: GitHub
- URL: https://github.com/alienzhou/project-context-engine
- Owner: alienzhou
- Created: 2025-06-26T16:43:42.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-08-20T14:47:42.000Z (10 months ago)
- Last Synced: 2025-08-20T16:37:00.648Z (10 months ago)
- Topics: ai-code-analysis, documentation-generator, repository-map
- Language: TypeScript
- Homepage:
- Size: 426 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Project Context Engine
An AI-powered project context analysis engine for codebase analysis, documentation generation, and Markdown rendering.
> π¨ **Special Note**: This project is entirely built using the **Vibe Coding** approach
## π Languages / θ―θ¨ζ―ζ
- **English** (Default): This README
- **δΈζ**: [README.zh.md](README.zh.md)
## π Features
### π Code Analyzer
- **Intelligent Code Analysis**: Analyze codebase structure and functionality using AI technology
- **Automatic Documentation Generation**: Generate project summaries, API documentation, and code explanations
- **Repository Map**: Create symbol mapping diagrams of codebases for easy project structure understanding
- **Language Filtering**: Support specifying particular languages for analysis, improving analysis efficiency and precision
- **Multi-language Support**: Support TypeScript, JavaScript, Python, Java, Go, C++, and other programming languages
- **Tree-sitter Parsing**: Use Tree-sitter for precise syntax analysis
### π¨ Markdown Renderer
- **High-quality Rendering**: Render Markdown files into beautiful HTML
- **Mermaid Chart Support**: Support flowcharts, sequence diagrams, class diagrams, and other chart types
- **Theme Switching**: Support both dark and light theme modes
- **Batch Processing**: Support batch rendering of multiple files
- **Code Highlighting**: Built-in syntax highlighting functionality
## π Tech Stack
- **TypeScript**: Type-safe JavaScript development
- **pnpm**: Efficient package management and monorepo support
- **Tree-sitter**: Precise code syntax analysis
- **AI SDK**: Integration with multiple AI services (Amazon Bedrock, Azure)
- **Mermaid**: Chart and flowchart rendering
- **Winston**: Logging management
## π¦ Project Structure
```
project-context-engine/
βββ apps/
β βββ analyzer/ # π Code Analyzer
β β βββ src/
β β β βββ code-analyzer/
β β β β βββ agent/ # AI agent functionality
β β β β βββ parser/ # Code parser
β β β β βββ reading/ # Code reading analysis
β β β β βββ repomap/ # Repository mapping generation
β β β β βββ structure/ # Project structure analysis
β β β β βββ summary/ # Code summarization functionality
β β β βββ utils/ # Utility functions
β β βββ processed/ # Analysis result output
β βββ render/ # π¨ Markdown Renderer
β βββ src/
β βββ data/ # Markdown source files
β βββ scripts/ # Rendering scripts
βββ packages/
β βββ common/ # π Shared codebase
βββ test-multilang/ # π§ͺ Multi-language test cases
βββ docs/ # π Documentation
β βββ en/ # English documentation
β βββ zh/ # Chinese documentation
βββ ...
```
## π Quick Start
### Install Dependencies
```bash
pnpm install
```
### Build Project
```bash
# Build entire project
pnpm build
# Build specific packages separately
pnpm build:common # Build shared package
pnpm build:analyzer # Build code analyzer
```
### Run Code Analyzer
```bash
# Start code analyzer
pnpm start
# Development mode
pnpm dev
```
### Use Markdown Renderer
```bash
# Enter renderer directory
cd apps/render
# Render single file
npm run render
# Render all files
npm run render:all
# Render with light theme
npm run render:all:light
```
## π Available Scripts
### Global Scripts
```bash
pnpm build # Build all packages
pnpm dev # Development mode
pnpm start # Start analyzer application
pnpm test # Run tests
pnpm typecheck # TypeScript type checking
pnpm lint # Code linting
pnpm format # Code formatting
pnpm clean # Clean build files
```
### Code Analyzer Specific
```bash
pnpm start # Start analyzer
cd apps/analyzer && pnpm test-repomap # Test repository mapping functionality
# Repository Map language filtering functionality
cd apps/analyzer
node dist/code-analyzer/repomap/cli.js --language python # Analyze only Python files
node dist/code-analyzer/repomap/cli.js -l typescript # Analyze only TypeScript files
node test-repomap.js --language java # Test specific language
```
## π§ Development Guide
### Add Dependencies
Use pnpm workspace to add dependencies for specific packages:
```bash
# Add dependency for analyzer
pnpm --filter @project-context-engine/analyzer add
# Add dependency for renderer
pnpm --filter @project/render add
# Add dependency for shared package
pnpm --filter @project-context-engine/common add
```
### Run Package-specific Scripts
```bash
pnpm --filter
```
### Dependencies
The project uses workspace protocol to manage internal dependencies:
```json
{
"dependencies": {
"@project-context-engine/common": "workspace:*"
}
}
```
## π Key Features
### Intelligent Code Analysis
- Automatically identify project architecture and design patterns
- Generate detailed code documentation and explanations
- Create project structure trees and dependency relationship diagrams
### AI-driven Documentation Generation
- Leverage large language models to understand code logic
- Automatically generate README, API documentation
- Provide code improvement suggestions
### Multi-format Output
- Markdown format analysis reports
- HTML format visualization documentation
- JSON format structured data
## π Documentation
The project supports bilingual documentation in Chinese and English:
- **English Documentation**: [docs/en/README.md](docs/en/README.md)
- **δΈζζζ‘£**: [docs/zh/README.md](docs/zh/README.md)
### Detailed Documentation
- **Code Analyzer Documentation**: [docs/en/analyzer/](docs/en/analyzer/)
- [Repo Map User Guide](docs/en/analyzer/repo-map.md)
- [Technical Manual](docs/en/analyzer/repo-map-technical.md)
- [Test Guide](docs/en/analyzer/repo-map-test-guide.md)
- **Markdown Renderer Documentation**: [docs/en/render/README.md](docs/en/render/README.md)
- **Multi-language Test Cases**: [docs/en/test-multilang/README.md](docs/en/test-multilang/README.md)
## π License
ISC License
## π€ Contributing
Welcome to submit Issues and Pull Requests to help improve the project.
---
**Project Context Engine** - Making code analysis and documentation generation simple and efficient π