🤖 Prompt Generation Metadata
- Model: qwen3.5-plus
- Target Repository: https://github.com/Sucotasch/Repo-Prompt-Generator
- Auto-generated RAG Query: "entry point,main function,public API,exported modules,core architecture,package manifest,initialization"
Task Instructions
You are an expert technical writer and software architect. Analyze the provided GitHub repository data to create comprehensive technical documentation in Markdown format (suitable for a Wiki or a detailed README.md). Make the code understandable. Include: 1. Real capabilities of the program. 2. Algorithm of operation and architecture. 3. Installation and configuration process. 4. Examples of using the main functions.Additional Context
Создай подробный README соответствующий современным стандартам и требованиям, мультиязычный - сначала на английском, затем на русском языках.
- About the Project
- Capabilities
- Architecture (Monorepo)
- Web vs Desktop (Tauri)
- Algorithm of Operation
- Installation and Setup
- Configuration
- Usage Examples
- Analysis Templates
- AI Providers
- Technology Stack
- Troubleshooting
Repo-Prompt-Generator is an intelligent developer tool that leverages artificial intelligence to analyze codebases and generate structured prompts, technical documentation, and security audits.
The application supports both GitHub repositories and local files, utilizing advanced RAG (Retrieval-Augmented Generation) technologies and hybrid search for precise code analysis.
| Feature | Benefit |
|---|---|
| Multi-provider AI Support | Choose between cloud (Gemini, Qwen) or local (Ollama) AI models |
| RAG-Powered Analysis | Context-aware code understanding with semantic search |
| Template System | Pre-built prompts for documentation, audits, and integration |
| Cross-Platform | Web application and native desktop app (Tauri) |
| Code Graph Visualization | Dependency mapping for better architectural understanding |
Generate optimized system prompts for AI assistants (Gemini CLI, Cursor, Claude, etc.) based on your codebase structure and patterns.
Deep analysis of your codebase including:
- Algorithm and data flow documentation
- Defect identification (bugs, race conditions, dead code)
- Performance bottleneck analysis
- Actionable recommendations with minimal intervention
Automatic generation of:
- README.md files
- Wiki-style documentation
- API documentation
- Mermaid diagrams for architecture visualization
Compare two repositories and generate:
- Architectural pattern recommendations
- Migration plans
- Code implementation snippets
- Conflict identification
Build code dependency graphs for enhanced context understanding:
- Import/export relationship mapping
- Module dependency visualization
- Semantic chunking for efficient retrieval
| Provider | Type | Use Case |
|---|---|---|
| Gemini | Cloud | High-quality analysis, large context |
| Ollama | Local | Privacy-focused, offline capable |
| Qwen | Cloud | Alternative cloud provider |
| OpenAI-Compatible | Custom | Azure, LocalAI, vLLM, etc. |
repo-prompt-generator/
├── apps/
│ ├── web/ # Web application (React + Vite)
│ │ ├── src/
│ │ ├── index.html
│ │ ├── package.json
│ │ └── vite.config.ts
│ │
│ └── desktop/ # Desktop application (Tauri + React)
│ ├── src/
│ ├── src-tauri/ # Rust backend
│ │ ├── src/
│ │ │ ├── main.rs # Tauri entry point
│ │ │ └── lib.rs # Core Rust logic
│ │ ├── Cargo.toml
│ │ └── tauri.conf.json
│ └── package.json
│
├── packages/
│ ├── core/ # Shared business logic
│ │ └── src/
│ │ ├── services/ # AI & data services
│ │ │ ├── aiAdapter.ts
│ │ │ ├── geminiService.ts
│ │ │ ├── ollamaService.ts
│ │ │ ├── qwenService.ts
│ │ │ ├── githubService.ts
│ │ │ ├── localFileService.ts
│ │ │ └── ragService.ts
│ │ │
│ │ ├── templates/ # Prompt templates
│ │ │ ├── default.ts
│ │ │ ├── docs.ts
│ │ │ ├── audit.ts
│ │ │ ├── integration.ts
│ │ │ ├── security.ts
│ │ │ ├── architecture.ts
│ │ │ └── eli5.ts
│ │ │
│ │ ├── utils/ # Utility functions
│ │ │ ├── codeGraph.ts
│ │ │ ├── fileSystem.ts
│ │ │ ├── hybridSearch.ts
│ │ │ ├── semanticChunker.ts
│ │ │ └── tauriAdapter.ts
│ │ │
│ │ └── types/
│ │ └── template.ts
│ │
│ └── ui/ # Shared UI components
│ └── src/
│ ├── App.tsx
│ ├── index.ts
│ └── tailwind.css
│
├── package.json # Root workspace config
└── README.md
digraph Dependencies {
rankdir=TB;
subgraph cluster_apps {
label "Applications";
web [label="apps/web"];
desktop [label="apps/desktop"];
}
subgraph cluster_packages {
label "Packages";
core [label="packages/core"];
ui [label="packages/ui"];
}
web -> core;
web -> ui;
desktop -> core;
desktop -> ui;
core -> ui;
}| Feature | Web App | Desktop App (Tauri) |
|---|---|---|
| Local File Access | Limited (browser sandbox) | Full filesystem access |
| Ollama Integration | Requires CORS configuration | Native integration |
| OAuth (Qwen) | Web-based flow | Native device code flow |
| Portability | Browser-based | Standalone executable |
| System Resources | Browser limits | Direct system access |
| Installation | None (URL access) | Download & install |
Choose Web App when:
- Quick analysis without installation
- Working with GitHub repositories
- Sharing analysis results via URL
Choose Desktop App when:
- Analyzing local/private codebases
- Need full filesystem access
- Working offline with Ollama
- Require native OAuth flows
┌─────────────────────────────────────────────────────────────┐
│ Input Selection │
├─────────────────────────────────────────────────────────────┤
│ GitHub URL Local Folder │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ 1. Parse URL │ │ 1. File Pick │ │
│ │ 2. Auth API │ │ 2. Filter │ │
│ │ 3. Fetch │ │ 3. Score │ │
│ │ 4. Extract │ │ 4. Process │ │
│ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ File Scoring System │
├─────────────────────────────────────────────────────────────┤
│ Base Score: 0 │
│ +50: Entry points (main.ts, index.ts, app.tsx) │
│ +30: Configuration files (package.json, tsconfig.json) │
│ +20: Core services and utilities │
│ -30: Build/config files (webpack, vite, gulp) │
│ -50: Test files (*.test.*, __tests__, specs) │
│ -100: Ignored folders (node_modules, .git, dist) │
│ -100: Secret files (.env, .pem, .key, credentials) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ RAG Processing │
├─────────────────────────────────────────────────────────────┤
│ 1. Semantic Chunking → Split code into meaningful units │
│ 2. Embedding Generation → Vector representation │
│ 3. Cache Storage → Local embedding cache │
│ 4. Hybrid Search → Combine semantic + keyword matching │
│ 5. Re-ranking → Score results by relevance │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Code Graph Building │
├─────────────────────────────────────────────────────────────┤
│ Parse imports/exports → Build dependency graph → DOT format│
│ Example: │
│ digraph Codebase { │
│ rankdir=LR; │
│ "src/main.tsx" -> "src/App.tsx"; │
│ "src/services/api.ts" -> "src/utils/fetch.ts"; │
│ } │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ AI Prompt Generation │
├─────────────────────────────────────────────────────────────┤
│ 1. Select Template (docs/audit/integration/etc.) │
│ 2. Inject Repository Context │
│ 3. Add Code Graph (if available) │
│ 4. Apply RAG Results │
│ 5. Generate Final Prompt via AI Provider │
└─────────────────────────────────────────────────────────────┘
// Simplified flow representation
async function performRAG(query: string, repoData: RepoData): Promise<string[]> {
// Step 1: Rewrite query for better retrieval
const rewrittenQuery = await rewriteQueryWithAI(query);
// Step 2: Check embedding cache
const cachedEmbedding = await embeddingCache.get(rewrittenQuery);
// Step 3: Generate embedding if not cached
const embedding = cachedEmbedding || await generateEmbedding(rewrittenQuery);
// Step 4: Hybrid search (semantic + keyword)
const semanticResults = await semanticSearch(embedding, repoData.chunks);
const keywordResults = await keywordSearch(rewrittenQuery, repoData.files);
// Step 5: Re-rank and combine
const combined = hybridRank(semanticResults, keywordResults);
// Step 6: Return top results
return combined.slice(0, MAX_RESULTS);
}┌─────────────────────────────────────────────────────────────┐
│ Template Definition │
├─────────────────────────────────────────────────────────────┤
│ interface TemplateDefinition { │
│ metadata: { │
│ id: string; // Unique identifier │
│ name: string; // Display name │
│ description: string;// Purpose description │
│ color: string; // UI color code │
│ category: string; // Grouping category │
│ }; │
│ systemInstruction: string; // AI system prompt │
│ defaultSearchQuery: string; // Default RAG query │
│ deliverables: string[]; // Expected outputs │
│ successMetrics: string[]; // Quality criteria │
│ } │
└─────────────────────────────────────────────────────────────┘
| Requirement | Version | Purpose |
|---|---|---|
| Node.js | 18.x or higher | Runtime environment |
| npm | 9.x or higher | Package management |
| Git | 2.x or higher | Repository access |
| Rust (Desktop only) | 1.70+ | Tauri backend |
# 1. Clone the repository
git clone https://github.com/Sucotasch/Repo-Prompt-Generator.git
cd Repo-Prompt-Generator
# 2. Install dependencies
npm install
# 3. Start development server
npm run dev
# 4. Build for production
npm run build
# 5. Start production server
npm run start# 1. Clone the repository
git clone https://github.com/Sucotasch/Repo-Prompt-Generator.git
cd Repo-Prompt-Generator/apps/desktop
# 2. Install dependencies
npm install
# 3. Install Tauri CLI (if not installed)
npm install -g @tauri-apps/cli
# 4. Run in development mode
npm run tauri dev
# 5. Build for production
npm run tauri buildDownload the latest release from the Releases page:
| Platform | File |
|---|---|
| Windows | Repo-Prompt-Generator_x.x.x_x64_en-US.msi |
| macOS | Repo-Prompt-Generator_x.x.x_x64.dmg |
| Linux | Repo-Prompt-Generator_x.x.x_amd64.AppImage |
Create a .env file based on .env.example:
# GitHub API Token (optional, increases rate limits)
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
# Gemini API Key (for cloud AI)
GEMINI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
# Ollama Configuration (for local AI)
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=coder-model
# Qwen OAuth (for Alibaba Cloud AI)
QWEN_CLIENT_ID=f0304373b74a44d2b584a3fb70ca9e56
# Custom OpenAI-Compatible API
CUSTOM_API_BASE_URL=https://your-api.com/v1
CUSTOM_API_KEY=your-api-key
CUSTOM_MODEL=your-model-nameThe application stores user preferences in browser localStorage:
{
"githubToken": "ghp_xxx",
"maxFiles": 5,
"inputMode": "github",
"aiProvider": "gemini",
"ollamaUrl": "http://localhost:11434",
"ollamaModel": "coder-model",
"customApiUrl": "",
"customApiKey": "",
"customModel": ""
}# 1. Install Ollama
# macOS/Linux:
curl -fsSL https://ollama.com/install.sh | sh
# Windows: Download from https://ollama.com/download
# 2. Pull a coding model
ollama pull coder-model
# or
ollama pull llama2
# or
ollama pull codellama
# 3. Configure CORS (for web app)
export OLLAMA_ORIGINS="http://localhost:5173"
ollama serve
# 4. Verify connection
curl http://localhost:11434/api/tags- Go to GitHub Personal Access Tokens
- Click "Generate new token (classic)"
- Select scopes:
repo,read:user - Copy the token and paste into application settings
// 1. Select "Default" template
// 2. Enter GitHub repository URL or upload local files
// 3. Configure RAG query:
const ragQuery = "core logic, architecture, main components, tech stack";
// 4. Click "Generate Prompt"
// 5. Result will be a gemini.md file containing:
// - Project purpose and tech stack
// - Architectural patterns and conventions
// - AI assistance instructions
// - Contribution guidelinesOutput Example (gemini.md):
# Project Context: Repo-Prompt-Generator
## Purpose
AI-powered tool for generating prompts and code audits based on GitHub
or local repositories.
## Tech Stack
- Frontend: React 19, TypeScript 5.8, Vite 6.2
- Desktop: Tauri 2.0 (Rust backend)
- AI Providers: Gemini, Ollama, Qwen, OpenAI-compatible
## Architecture
Monorepo structure with shared core package containing:
- Services: AI adapters, GitHub/local file handlers, RAG engine
- Templates: Pre-built prompt definitions for various use cases
- Utils: Code graph builder, semantic chunker, hybrid search
## Development Guidelines
1. Always check existing templates before creating new ones
2. Use TypeScript strict mode
3. Follow the established service pattern for new AI providers// 1. Select "Audit" template
// 2. Load repository (GitHub or local)
// 3. RAG query:
const ragQuery = "core logic, complex algorithms, potential bugs, performance bottlenecks";
// 4. Generate audit report
// 5. Export as markdownAudit Report Structure:
# Code Architecture Audit Report
## 1. Algorithm & Architecture
[Detailed step-by-step description of core algorithms and data flow]
## 2. Defect Identification
| File | Issue | Severity | Description |
|------|-------|----------|-------------|
| src/service.ts | Race Condition | High | Async operation without proper locking |
| src/utils/cache.ts | Memory Leak | Medium | Cache entries never expire |
## 3. Performance Impact
- O(n²) loop detected in `processFiles()` - affects large repositories
- Unbounded cache growth in `embeddingCacheService`
## 4. Actionable Recommendations
### Fix 1: Add cache expiration
File: packages/core/src/services/embeddingCacheService.ts
[Code snippet with fix]
### Fix 2: Optimize file processing
File: packages/core/src/services/localFileService.ts
[Code snippet with fix]// 1. Select "Documentation" template
// 2. Upload local project files
// 3. RAG query:
const ragQuery = "exported functions, public API, configuration options";
// 4. Generate documentation
// 5. Export to markdown// 1. Select "Integration" template
// 2. Specify target repository (your codebase)
// 3. Specify reference repository (source of patterns)
// 4. RAG query:
const ragQuery = "API endpoints, data models, service layer";
// 5. Receive integration plan with code snippetsIntegration Plan Output:
# Integration Analysis Report
## Recommendation: PARTIALLY RECOMMENDED
### Patterns to Adopt from [REFERENCE_REPO]
1. **Error Handling Middleware** - Centralized error processing
2. **Request Validation** - Schema-based input validation
3. **Caching Layer** - Redis-based response caching
### Architectural Mapping
| Reference Component | Target Equivalent | Compatibility |
|--------------------|-------------------|---------------|
| AuthService | UserService | Partial - needs adaptation |
| CacheManager | (none) | New implementation required |
### Integration Steps
1. Add validation library to dependencies
2. Create middleware/wrapper files
3. Update API endpoint handlers
4. Add caching layer configuration
### Code Implementation
[Actual code snippets based on reference repository]# 1. Start Ollama server
ollama serve
# 2. In application settings:
# - AI Provider: Ollama
# - URL: http://localhost:11434
# - Model: coder-model
# 3. All requests processed locally (no API costs)// Configuration for compatible services:
const config = {
provider: 'custom',
customBaseUrl: 'https://your-api.com/v1',
customApiKey: 'your-key',
customModel: 'your-model-name'
};
// Supported services:
// - OpenAI
// - Azure OpenAI
// - LocalAI
// - vLLM
// - LM Studio
// - Any OpenAI-compatible API| Template | ID | Category | Use Case |
|---|---|---|---|
| Default | default |
default | General system prompt generation |
| Documentation | docs |
docs | Technical documentation & README |
| Audit | audit |
audit | Code architecture & defect analysis |
| Integration | integration |
integration | Cross-repository pattern adoption |
| Security | security |
security | Vulnerability assessment |
| Architecture | architecture |
architecture | System design documentation |
| ELI5 | eli5 |
education | Explain code simply (for beginners) |
┌─────────────────────────────────────────────────────────────┐
│ Template Decision Tree │
├─────────────────────────────────────────────────────────────┤
│ │
│ What is your goal? │
│ │ │
│ ├── Create AI assistant context → Default Template │
│ │ │
│ ├── Generate documentation → Documentation Template │
│ │ │
│ ├── Find bugs & issues → Audit Template │
│ │ │
│ ├── Compare repositories → Integration Template │
│ │ │
│ ├── Security review → Security Template │
│ │ │
│ └── Explain to beginners → ELI5 Template │
│ │
└─────────────────────────────────────────────────────────────┘
| Provider | Speed | Quality | Cost | Privacy |
|---|---|---|---|---|
| Gemini | Fast | High | Free tier available | Cloud |
| Ollama | Medium | Good | Free | Local |
| Qwen | Fast | High | Free tier available | Cloud |
| Custom API | Varies | Varies | Varies | Depends |
{
provider: "gemini",
apiKey: "YOUR_GEMINI_KEY",
model: "gemini-pro"
}{
provider: "ollama",
baseUrl: "http://localhost:11434",
model: "coder-model"
}{
provider: "qwen",
// Uses OAuth device flow for authentication
clientId: "f0304373b74a44d2b584a3fb70ca9e56"
}{
provider: "custom",
baseUrl: "https://api.example.com/v1",
apiKey: "YOUR_KEY",
model: "custom-model"
}| Technology | Version | Purpose |
|---|---|---|
| React | 19.0 | UI framework |
| TypeScript | 5.8 | Type safety |
| Vite | 6.2 | Build tool & dev server |
| Tailwind CSS | Latest | Styling |
| Lucide React | Latest | Icons |
| Technology | Version | Purpose |
|---|---|---|
| Tauri | 2.0 | Desktop framework |
| Rust | 1.70+ | System-level operations |
| @tauri-apps/api | 2.x | Tauri JavaScript API |
| Module | Purpose |
|---|---|
aiAdapter.ts |
Unified AI provider interface |
geminiService.ts |
Google Gemini integration |
ollamaService.ts |
Local Ollama integration |
qwenService.ts |
Alibaba Qwen integration |
githubService.ts |
GitHub API client |
localFileService.ts |
Local file system access |
ragService.ts |
RAG engine & hybrid search |
embeddingCacheService.ts |
Vector cache management |
codeGraph.ts |
Dependency graph builder |
semanticChunker.ts |
Code chunking for RAG |
hybridSearch.ts |
Combined semantic + keyword search |
Cause: Ollama model not loaded or server not running
Solution:
# Pull the model
ollama pull coder-model
# Or use alternative model
ollama pull llama2
# Restart Ollama server
ollama serveCause: Ollama blocking browser requests
Solution:
# Windows - use start-ollama.bat with proper origins
# Linux/Mac:
export OLLAMA_ORIGINS="http://localhost:5173"
ollama serveCause: GitHub API rate limit reached
Solution:
- Add GitHub token in settings (increases limit from 60 to 5000/hour)
- Wait for rate limit reset (usually 1 hour)
- Use local files instead of GitHub
Cause: Tauri-specific function called in web context
Solution:
- Use desktop app for filesystem operations
- Web app has limited file access via browser sandbox
Cause: Device code flow timeout or network issue
Solution:
- Ensure stable internet connection
- Complete OAuth flow within 10 minutes
- Try again with fresh device code
This project is open source and available under the MIT License.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Issues: GitHub Issues
- Discussions: GitHub Discussions
AI-инструмент для генерации промптов и аудита кода на основе репозиториев GitHub или локальных файлов
- О проекте
- Возможности
- Архитектура (Монорепозиторий)
- Web vs Desktop (Tauri)
- Алгоритм работы
- Установка и настройка
- Конфигурация
- Примеры использования
- Шаблоны анализа
- AI-провайдеры
- Технологический стек
- Решение проблем
Repo-Prompt-Generator — это интеллектуальный инструмент для разработчиков, который использует искусственный интеллект для анализа кодовых баз и генерации структурированных промптов, технической документации и аудитов безопасности.
Приложение поддерживает работу как с GitHub репозиториями, так и с локальными файлами, используя передовые технологии RAG (Retrieval-Augmented Generation) и гибридного поиска для точного анализа кода.
| Возможность | Преимущество |
|---|---|
| Поддержка нескольких AI-провайдеров | Выбор между облачными (Gemini, Qwen) или локальными (Ollama) моделями |
| RAG-анализ | Контекстно-зависимое понимание кода с семантическим поиском |
| Система шаблонов | Готовые промпты для документации, аудитов и интеграции |
| Кроссплатформенность | Веб-приложение и нативное десктопное приложение (Tauri) |
| Визуализация графа кода | Карта зависимостей для лучшего понимания архитектуры |
Создание оптимизированных системных промптов для AI-ассистентов (Gemini CLI, Cursor, Claude и др.) на основе структуры и паттернов вашей кодовой базы.
Глубокий анализ кодовой базы, включающий:
- Документирование алгоритмов и потоков данных
- Выявление дефектов (баги, состояния гонки, мёртвый код)
- Анализ узких мест производительности
- Практические рекомендации с минимальным вмешательством
Автоматическая генерация:
- Файлов README.md
- Документации в стиле Wiki
- API-документации
- Диаграмм Mermaid для визуализации архитектуры
Сравнение двух репозиториев и генерация:
- Рекомендаций по архитектурным паттернам
- Планов миграции
- Фрагментов кода для реализации
- Идентификации конфликтов
Построение графов зависимостей кода для улучшенного понимания контекста:
- Маппинг отношений импорт/экспорт
- Визуализация зависимостей модулей
- Семантическое чанкование для эффективного поиска
| Провайдер | Тип | Случай использования |
|---|---|---|
| Gemini | Облачный | Высококачественный анализ, большой контекст |
| Ollama | Локальный | Приватность, работа офлайн |
| Qwen | Облачный | Альтернативный облачный провайдер |
| OpenAI-совместимый | Кастомный | Azure, LocalAI, vLLM и др. |
repo-prompt-generator/
├── apps/
│ ├── web/ # Веб-приложение (React + Vite)
│ │ ├── src/
│ │ ├── index.html
│ │ ├── package.json
│ │ └── vite.config.ts
│ │
│ └── desktop/ # Десктопное приложение (Tauri + React)
│ ├── src/
│ ├── src-tauri/ # Rust бэкенд
│ │ ├── src/
│ │ │ ├── main.rs # Точка входа Tauri
│ │ │ └── lib.rs # Основная логика Rust
│ │ ├── Cargo.toml
│ │ └── tauri.conf.json
│ └── package.json
│
├── packages/
│ ├── core/ # Общая бизнес-логика
│ │ └── src/
│ │ ├── services/ # AI и дата-сервисы
│ │ │ ├── aiAdapter.ts
│ │ │ ├── geminiService.ts
│ │ │ ├── ollamaService.ts
│ │ │ ├── qwenService.ts
│ │ │ ├── githubService.ts
│ │ │ ├── localFileService.ts
│ │ │ └── ragService.ts
│ │ │
│ │ ├── templates/ # Шаблоны промптов
│ │ │ ├── default.ts
│ │ │ ├── docs.ts
│ │ │ ├── audit.ts
│ │ │ ├── integration.ts
│ │ │ ├── security.ts
│ │ │ ├── architecture.ts
│ │ │ └── eli5.ts
│ │ │
│ │ ├── utils/ # Утилиты
│ │ │ ├── codeGraph.ts
│ │ │ ├── fileSystem.ts
│ │ │ ├── hybridSearch.ts
│ │ │ ├── semanticChunker.ts
│ │ │ └── tauriAdapter.ts
│ │ │
│ │ └── types/
│ │ └── template.ts
│ │
│ └── ui/ # Общие UI компоненты
│ └── src/
│ ├── App.tsx
│ ├── index.ts
│ └── tailwind.css
│
├── package.json # Конфигурация рабочего пространства
└── README.md
| Функция | Веб-приложение | Десктопное приложение (Tauri) |
|---|---|---|
| Доступ к локальным файлам | Ограничен (песочница браузера) | Полный доступ к файловой системе |
| Интеграция с Ollama | Требует настройки CORS | Нативная интеграция |
| OAuth (Qwen) | Веб-поток | Нативный поток device code |
| Портативность | На основе браузера | Автономный исполняемый файл |
| Системные ресурсы | Ограничения браузера | Прямой доступ к системе |
| Установка | Не требуется (доступ по URL) | Скачать и установить |
Выбирайте Веб-приложение когда:
- Быстрый анализ без установки
- Работа с GitHub репозиториями
- Публикация результатов анализа через URL
Выбирайте Десктопное приложение когда:
- Анализ локальных/приватных кодовых баз
- Требуется полный доступ к файловой системе
- Работа офлайн с Ollama
- Требуются нативные OAuth потоки
┌─────────────────────────────────────────────────────────────┐
│ Выбор входа │
├─────────────────────────────────────────────────────────────┤
│ GitHub URL Локальная папка │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ 1. Парсинг │ │ 1. Выбор │ │
│ │ 2. Auth API │ │ 2. Фильтрация│ │
│ │ 3. Загрузка │ │ 3. Оценка │ │
│ │ 4. Извлечение│ │ 4. Обработка │ │
│ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Система оценки файлов │
├─────────────────────────────────────────────────────────────┤
│ Базовый балл: 0 │
│ +50: Точки входа (main.ts, index.ts, app.tsx) │
│ +30: Конфигурационные файлы (package.json, tsconfig.json) │
│ +20: Основные сервисы и утилиты │
│ -30: Файлы сборки/конфигурации (webpack, vite, gulp) │
│ -50: Тестовые файлы (*.test.*, __tests__, specs) │
│ -100: Игнорируемые папки (node_modules, .git, dist) │
│ -100: Секретные файлы (.env, .pem, .key, credentials) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ RAG обработка │
├─────────────────────────────────────────────────────────────┤
│ 1. Семантическое чанкование → Разбиение кода на единицы │
│ 2. Генерация эмбеддингов → Векторное представление │
│ 3. Кэширование → Локальный кэш эмбеддингов │
│ 4. Гибридный поиск → Комбинация семантического + ключевого │
│ 5. Переранжирование → Оценка релевантности │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Построение графа кода │
├─────────────────────────────────────────────────────────────┤
│ Парсинг импортов/экспортов → Граф зависимостей → DOT формат│
│ Пример: │
│ digraph Codebase { │
│ rankdir=LR; │
│ "src/main.tsx" -> "src/App.tsx"; │
│ "src/services/api.ts" -> "src/utils/fetch.ts"; │
│ } │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Генерация промпта │
├─────────────────────────────────────────────────────────────┤
│ 1. Выбор шаблона (docs/audit/integration и т.д.) │
│ 2. Инъекция контекста репозитория │
│ 3. Добавление графа кода (если доступен) │
│ 4. Применение результатов RAG │
│ 5. Генерация финального промпта через AI-провайдер │
└─────────────────────────────────────────────────────────────┘
// Упрощённое представление потока
async function performRAG(query: string, repoData: RepoData): Promise<string[]> {
// Шаг 1: Переписать запрос для лучшего поиска
const rewrittenQuery = await rewriteQueryWithAI(query);
// Шаг 2: Проверить кэш эмбеддингов
const cachedEmbedding = await embeddingCache.get(rewrittenQuery);
// Шаг 3: Сгенерировать эмбеддинг если нет в кэше
const embedding = cachedEmbedding || await generateEmbedding(rewrittenQuery);
// Шаг 4: Гибридный поиск (семантический + ключевые слова)
const semanticResults = await semanticSearch(embedding, repoData.chunks);
const keywordResults = await keywordSearch(rewrittenQuery, repoData.files);
// Шаг 5: Объединить и переранжировать
const combined = hybridRank(semanticResults, keywordResults);
// Шаг 6: Вернуть лучшие результаты
return combined.slice(0, MAX_RESULTS);
}| Требование | Версия | Назначение |
|---|---|---|
| Node.js | 18.x или выше | Среда выполнения |
| npm | 9.x или выше | Управление пакетами |
| Git | 2.x или выше | Доступ к репозиториям |
| Rust (только Desktop) | 1.70+ | Бэкенд Tauri |
# 1. Клонировать репозиторий
git clone https://github.com/Sucotasch/Repo-Prompt-Generator.git
cd Repo-Prompt-Generator
# 2. Установить зависимости
npm install
# 3. Запустить сервер разработки
npm run dev
# 4. Собрать для продакшена
npm run build
# 5. Запустить продакшен сервер
npm run start# 1. Клонировать репозиторий
git clone https://github.com/Sucotasch/Repo-Prompt-Generator.git
cd Repo-Prompt-Generator/apps/desktop
# 2. Установить зависимости
npm install
# 3. Установить Tauri CLI (если не установлен)
npm install -g @tauri-apps/cli
# 4. Запустить в режиме разработки
npm run tauri dev
# 5. Собрать для продакшена
npm run tauri buildСкачайте последнюю версию со страницы Releases:
| Платформа | Файл |
|---|---|
| Windows | Repo-Prompt-Generator_x.x.x_x64_en-US.msi |
| macOS | Repo-Prompt-Generator_x.x.x_x64.dmg |
| Linux | Repo-Prompt-Generator_x.x.x_amd64.AppImage |
Создайте файл .env на основе .env.example:
# GitHub API Token (опционально, увеличивает лимиты)
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
# Gemini API Key (для облачного AI)
GEMINI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
# Конфигурация Ollama (для локального AI)
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=coder-model
# Qwen OAuth (для Alibaba Cloud AI)
QWEN_CLIENT_ID=f0304373b74a44d2b584a3fb70ca9e56
# Кастомный OpenAI-совместимый API
CUSTOM_API_BASE_URL=https://your-api.com/v1
CUSTOM_API_KEY=your-api-key
CUSTOM_MODEL=your-model-nameПриложение хранит пользовательские предпочтения в localStorage браузера:
{
"githubToken": "ghp_xxx",
"maxFiles": 5,
"inputMode": "github",
"aiProvider": "gemini",
"ollamaUrl": "http://localhost:11434",
"ollamaModel": "coder-model",
"customApiUrl": "",
"customApiKey": "",
"customModel": ""
}# 1. Установить Ollama
# macOS/Linux:
curl -fsSL https://ollama.com/install.sh | sh
# Windows: Скачать с https://ollama.com/download
# 2. Загрузить модель для кодинга
ollama pull coder-model
# или
ollama pull llama2
# или
ollama pull codellama
# 3. Настроить CORS (для веб-приложения)
export OLLAMA_ORIGINS="http://localhost:5173"
ollama serve
# 4. Проверить подключение
curl http://localhost:11434/api/tags- Перейдите на GitHub Personal Access Tokens
- Нажмите "Generate new token (classic)"
- Выберите scope:
repo,read:user - Скопируйте токен и вставьте в настройки приложения
// 1. Выберите шаблон "Default"
// 2. Введите URL GitHub репозитория или загрузите локальные файлы
// 3. Настройте RAG запрос:
const ragQuery = "core logic, architecture, main components, tech stack";
// 4. Нажмите "Generate Prompt"
// 5. Результат будет содержать файл gemini.md:
// - Назначение проекта и стек технологий
// - Архитектурные паттерны и соглашения
// - Инструкции для AI по работе с кодовой базой
// - Правила внесения изменений// 1. Выберите шаблон "Audit"
// 2. Загрузите репозиторий (GitHub или локально)
// 3. RAG запрос:
const ragQuery = "core logic, complex algorithms, potential bugs, performance bottlenecks";
// 4. Сгенерируйте отчёт аудита
// 5. Экспортируйте в markdown// 1. Выберите шаблон "Documentation"
// 2. Загрузите файлы локального проекта
// 3. RAG запрос:
const ragQuery = "exported functions, public API, configuration options";
// 4. Сгенерируйте документацию
// 5. Экспортируйте в markdown// 1. Выберите шаблон "Integration"
// 2. Укажите целевой репозиторий (ваша кодовая база)
// 3. Укажите референсный репозиторий (источник паттернов)
// 4. RAG запрос:
const ragQuery = "API endpoints, data models, service layer";
// 5. Получите план интеграции с фрагментами кода# 1. Запустите сервер Ollama
ollama serve
# 2. В настройках приложения:
# - AI Provider: Ollama
# - URL: http://localhost:11434
# - Model: coder-model
# 3. Все запросы обрабатываются локально (без затрат на API)// Конфигурация для совместимых сервисов:
const config = {
provider: 'custom',
customBaseUrl: 'https://your-api.com/v1',
customApiKey: 'your-key',
customModel: 'your-model-name'
};
// Поддерживаемые сервисы:
// - OpenAI
// - Azure OpenAI
// - LocalAI
// - vLLM
// - LM Studio
// - Любой OpenAI-совместимый API| Шаблон | ID | Категория | Случай использования |
|---|---|---|---|
| Default | default |
default | Генерация общего системного промпта |
| Documentation | docs |
docs | Техническая документация и README |
| Audit | audit |
audit | Анализ архитектуры и дефектов кода |
| Integration | integration |
integration | Заимствование паттернов между репозиториями |
| Security | security |
security | Оценка уязвимостей |
| Architecture | architecture |
architecture | Документирование дизайна системы |
| ELI5 | eli5 |
education | Простое объяснение кода (для начинающих) |
| Провайдер | Скорость | Качество | Стоимость | Приватность |
|---|---|---|---|---|
| Gemini | Быстро | Высокое | Есть бесплатный тариф | Облако |
| Ollama | Средне | Хорошее | Бесплатно | Локально |
| Qwen | Быстро | Высокое | Есть бесплатный тариф | Облако |
| Кастомный API | Варьируется | Варьируется | Варьируется | Зависит |
| Технология | Версия | Назначение |
|---|---|---|
| React | 19.0 | UI фреймворк |
| TypeScript | 5.8 | Типобезопасность |
| Vite | 6.2 | Инструмент сборки и dev-сервер |
| Tailwind CSS | Latest | Стилизация |
| Lucide React | Latest | Иконки |
| Технология | Версия | Назначение |
|---|---|---|
| Tauri | 2.0 | Десктопный фреймворк |
| Rust | 1.70+ | Системные операции |
| @tauri-apps/api | 2.x | JavaScript API Tauri |
| Модуль | Назначение |
|---|---|
aiAdapter.ts |
Унифицированный интерфейс AI-провайдеров |
geminiService.ts |
Интеграция с Google Gemini |
ollamaService.ts |
Интеграция с локальным Ollama |
qwenService.ts |
Интеграция с Alibaba Qwen |
githubService.ts |
Клиент GitHub API |
localFileService.ts |
Доступ к локальной файловой системе |
ragService.ts |
RAG-движок и гибридный поиск |
embeddingCacheService.ts |
Управление кэшем векторов |
codeGraph.ts |
Построитель графа зависимостей |
semanticChunker.ts |
Чанкование кода для RAG |
hybridSearch.ts |
Комбинированный семантический + ключевой поиск |
Причина: Модель Ollama не загружена или сервер не запущен
Решение:
# Загрузить модель
ollama pull coder-model
# Или использовать альтернативную модель
ollama pull llama2
# Перезапустить сервер Ollama
ollama serveПричина: Ollama блокирует запросы из браузера
Решение:
# Windows - используйте start-ollama.bat с правильными origins
# Linux/Mac:
export OLLAMA_ORIGINS="http://localhost:5173"
ollama serveПричина: Достигнут лимит GitHub API
Решение:
- Добавьте GitHub токен в настройках (увеличивает лимит с 60 до 5000/час)
- Дождитесь сброса лимита (обычно 1 час)
- Используйте локальные файлы вместо GitHub
Причина: Tauri-специфичная функция вызвана в веб-контексте
Решение:
- Используйте десктопное приложение для операций с файловой системой
- Веб-приложение имеет ограниченный доступ к файлам через песочницу браузера
Причина: Таймаут потока device code или проблема с сетью
Решение:
- Убедитесь в стабильном интернет-соединении
- Завершите OAuth поток в течение 10 минут
- Попробуйте снова с новым device code
Этот проект с открытым исходным кодом доступен под лицензией MIT.
- Форкните репозиторий
- Создайте ветку для функции (
git checkout -b feature/amazing-feature) - Закоммитьте изменения (
git commit -m 'Add amazing feature') - Отправьте в ветку (
git push origin feature/amazing-feature) - Откройте Pull Request
- Issues: GitHub Issues
- Discussions: GitHub Discussions