project-analyzer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseReferences (archive): SCAFFOLD_SKILLS_ARCHIVE_MAP.md — ProjectAnalyzer monorepo/service detection from Auto-Claude-develop analysis/analyzers.
<identity>
Project Analyzer - Automated brownfield codebase analysis for rapid project onboarding and understanding.
</identity>
<capabilities>
- Detecting project type (frontend, backend, fullstack, library, cli, mobile, monorepo)
- Identifying frameworks and libraries from manifests and structure
- Generating file statistics and language breakdown
- Mapping component relationships and module structure
- Detecting architecture patterns (MVC, layered, microservices, etc.)
- Analyzing dependency health and outdated packages
- Identifying code quality indicators (linting, testing, type safety)
- Detecting technical debt and anti-patterns
- Generating prioritized improvement recommendations
</capabilities>
<instructions>
<execution_process>参考资料(归档): SCAFFOLD_SKILLS_ARCHIVE_MAP.md — 来自Auto-Claude-develop analysis/analyzers的ProjectAnalyzer单体仓库/服务检测功能。
<identity>
项目分析器 - 用于快速项目接入和理解的自动化遗留代码库分析工具。
</identity>
<capabilities>
- 检测项目类型(前端、后端、全栈、库、CLI、移动应用、单体仓库)
- 从清单文件和结构中识别框架与库
- 生成文件统计数据和语言占比
- 映射组件关系和模块结构
- 检测架构模式(MVC、分层、微服务等)
- 分析依赖健康状况和过时包
- 识别代码质量指标(代码检查、测试、类型安全)
- 检测技术债务和反模式
- 生成优先级排序的改进建议
</capabilities>
<instructions>
<execution_process>Step 1: Identify Project Root
步骤1:确定项目根目录
Locate project root by finding manifest files:
-
Search for package manager files:
- (Node.js/JavaScript/TypeScript)
package.json - ,
requirements.txt,pyproject.toml(Python)setup.py - (Go)
go.mod - (Rust)
Cargo.toml - ,
pom.xml(Java/Maven/Gradle)build.gradle - (PHP)
composer.json
-
Identify project root:
- Directory containing primary package manager file
- Handle monorepos (multiple package.json files)
- Detect workspace configuration
-
Validate project root:
- Check for directory
.git - Verify source code directories exist
- Ensure manifest files are parsable
- Check for
通过查找清单文件定位项目根目录:
-
搜索包管理文件:
- (Node.js/JavaScript/TypeScript)
package.json - 、
requirements.txt、pyproject.toml(Python)setup.py - (Go)
go.mod - (Rust)
Cargo.toml - 、
pom.xml(Java/Maven/Gradle)build.gradle - (PHP)
composer.json
-
确定项目根目录:
- 包含主包管理文件的目录
- 处理单体仓库(多个package.json文件)
- 检测工作区配置
-
验证项目根目录:
- 检查是否存在目录
.git - 验证源代码目录是否存在
- 确保清单文件可解析
- 检查是否存在
Step 2: Detect Project Type
步骤2:检测项目类型
Classify project based on manifest files and directory structure:
-
Frontend Projects:
- Indicators: React, Vue, Angular, Svelte dependencies
- Directory: ,
src/components/,public/assets/ - Frameworks: Next.js, Nuxt.js, Gatsby, Vite
-
Backend Projects:
- Indicators: Express, FastAPI, Django, Flask, Gin dependencies
- Directory: ,
routes/,controllers/,models/api/ - Frameworks: Next.js API routes, FastAPI, Express
-
Fullstack Projects:
- Indicators: Both frontend and backend frameworks
- Directory: Combined frontend + backend structure
- Frameworks: Next.js, Remix, SvelteKit, Nuxt.js
-
Library/Package Projects:
- Indicators: No application-specific directories
- Files: ,
index.ts,lib/,dist/build/ - Manifests: field in package.json
library
-
CLI Projects:
- Indicators: field in package.json
bin - Files: CLI entry points, command parsers
- Dependencies: Commander, Yargs, Inquirer
- Indicators:
-
Mobile Projects:
- Indicators: React Native, Flutter, Ionic dependencies
- Files: ,
android/,ios/mobile/ - Frameworks: React Native, Expo, Flutter
-
Monorepo Projects:
- Indicators: in package.json,
workspacespnpm-workspace.yaml - Structure: Multiple packages in subdirectories
- Tools: Turborepo, Nx, Lerna
- Indicators:
-
Microservices Projects:
- Indicators: Multiple service directories
- Files: , service configs
docker-compose.yml - Structure: Service-based organization
根据清单文件和目录结构对项目进行分类:
-
前端项目:
- 标识:React、Vue、Angular、Svelte依赖
- 目录:、
src/components/、public/assets/ - 框架:Next.js、Nuxt.js、Gatsby、Vite
-
后端项目:
- 标识:Express、FastAPI、Django、Flask、Gin依赖
- 目录:、
routes/、controllers/、models/api/ - 框架:Next.js API路由、FastAPI、Express
-
全栈项目:
- 标识:同时包含前端和后端框架
- 目录:前端+后端组合结构
- 框架:Next.js、Remix、SvelteKit、Nuxt.js
-
库/包项目:
- 标识:无应用特定目录
- 文件:、
index.ts、lib/、dist/build/ - 清单:package.json中的字段
library
-
CLI项目:
- 标识:package.json中的字段
bin - 文件:CLI入口点、命令解析器
- 依赖:Commander、Yargs、Inquirer
- 标识:package.json中的
-
移动项目:
- 标识:React Native、Flutter、Ionic依赖
- 文件:、
android/、ios/mobile/ - 框架:React Native、Expo、Flutter
-
单体仓库项目:
- 标识:package.json中的、
workspacespnpm-workspace.yaml - 结构:子目录中包含多个包
- 工具:Turborepo、Nx、Lerna
- 标识:package.json中的
-
微服务项目:
- 标识:多个服务目录
- 文件:、服务配置
docker-compose.yml - 结构:基于服务的组织方式
Step 3: Framework Detection
步骤3:框架检测
Identify frameworks from manifest files and imports:
-
Read package.json dependencies (Node.js):
- Parse and
dependenciesdevDependencies - Detect framework versions
- Categorize by type (framework, ui-library, testing, etc.)
- Parse
-
Read requirements.txt (Python):
- Parse Python dependencies
- Detect FastAPI, Django, Flask
- Identify version constraints
-
Analyze imports (optional deep scan):
- Scan source files for import statements
- Detect used vs declared dependencies
- Identify framework-specific patterns
-
Framework Categories:
- Framework: React, Next.js, FastAPI, Express
- UI Library: Material-UI, Ant Design, Chakra UI
- State Management: Redux, Zustand, Pinia
- Testing: Jest, Vitest, Cypress, Playwright
- Build Tool: Vite, Webpack, Rollup, esbuild
- Database: Prisma, TypeORM, SQLAlchemy
- ORM: Prisma, Sequelize, Mongoose
- API: tRPC, GraphQL, REST
- Auth: NextAuth, Auth0, Clerk
- Logging: Winston, Pino, Bunyan
- Monitoring: Sentry, Datadog, New Relic
-
Confidence Scoring:
- 1.0: Framework listed in dependencies
- 0.8: Framework detected from imports
- 0.6: Framework inferred from structure
从清单文件和导入语句中识别框架:
-
读取package.json依赖项(Node.js):
- 解析和
dependenciesdevDependencies - 检测框架版本
- 按类型分类(框架、UI库、测试等)
- 解析
-
读取requirements.txt(Python):
- 解析Python依赖项
- 检测FastAPI、Django、Flask
- 识别版本约束
-
分析导入语句(可选深度扫描):
- 扫描源文件中的导入语句
- 检测已使用vs已声明的依赖项
- 识别框架特定模式
-
框架分类:
- 框架:React、Next.js、FastAPI、Express
- UI库:Material-UI、Ant Design、Chakra UI
- 状态管理:Redux、Zustand、Pinia
- 测试:Jest、Vitest、Cypress、Playwright
- 构建工具:Vite、Webpack、Rollup、esbuild
- 数据库:Prisma、TypeORM、SQLAlchemy
- ORM:Prisma、Sequelize、Mongoose
- API:tRPC、GraphQL、REST
- 认证:NextAuth、Auth0、Clerk
- 日志:Winston、Pino、Bunyan
- 监控:Sentry、Datadog、New Relic
-
置信度评分:
- 1.0:框架在依赖项中列出
- 0.8:从导入语句中检测到框架
- 0.6:从结构中推断出框架
Step 4: File Statistics
步骤4:文件统计
Generate quantitative project statistics:
-
Count files by type:
- Use glob patterns for common extensions
- Exclude: ,
node_modules/,.git/,dist/build/ - Group by language/file type
-
Count lines of code:
- Read source files and count lines
- Exclude empty lines and comments (optional)
- Calculate total LOC per language
-
Identify largest files:
- Track file sizes (line count)
- Report top 10 largest files
- Flag files > 1000 lines (violates micro-service principle)
-
Calculate averages:
- Average file size (lines)
- Average directory depth
- Files per directory
-
Language Detection:
- Map extensions to languages:
- ,
.ts→ TypeScript.tsx - ,
.js→ JavaScript.jsx - → Python
.py - → Go
.go - → Rust
.rs - → Java
.java - → Markdown
.md - → JSON
.json - ,
.yaml→ YAML.yml
- Map extensions to languages:
生成量化的项目统计数据:
-
按类型统计文件数量:
- 使用glob模式匹配常见扩展名
- 排除:、
node_modules/、.git/、dist/build/ - 按语言/文件类型分组
-
统计代码行数:
- 读取源文件并统计行数
- 排除空行和注释(可选)
- 计算每种语言的总行数
-
识别最大文件:
- 跟踪文件大小(行数)
- 报告前10个最大文件
- 标记超过1000行的文件(违反微服务原则)
-
计算平均值:
- 平均文件大小(行数)
- 平均目录深度
- 每个目录的文件数
-
语言检测:
- 将扩展名映射到语言:
- 、
.ts→ TypeScript.tsx - 、
.js→ JavaScript.jsx - → Python
.py - → Go
.go - → Rust
.rs - → Java
.java - → Markdown
.md - → JSON
.json - 、
.yaml→ YAML.yml
- 将扩展名映射到语言:
Step 5: Structure Analysis
步骤5:结构分析
Analyze project structure and architecture:
-
Identify root directories:
- Classify directories by purpose:
- source: ,
src/,app/lib/ - tests: ,
test/,__tests__/cypress/ - config: ,
config/.config/ - docs: ,
docs/documentation/ - build: ,
dist/,build/out/ - scripts: ,
scripts/bin/ - assets: ,
assets/,static/public/
- source:
- Classify directories by purpose:
-
Detect entry points:
- Main entry: ,
index.ts,main.pyapp.py - App entry: ,
app.ts,server.tsapp/page.tsx - Handler: ,
handler.tslambda.ts - CLI: ,
cli.tsbin/
- Main entry:
-
Detect architecture pattern:
- MVC: ,
models/,views/controllers/ - Layered: ,
presentation/,business/data/ - Hexagonal: ,
domain/,application/infrastructure/ - Microservices: Multiple service directories
- Modular: Feature-based organization
- Flat: All files in src/
- MVC:
-
Detect module system:
- Check for
package.json(ESM)"type": "module" - Scan for /
import(ESM) vsexport(CommonJS)require - Identify mixed module systems
- Check
分析项目结构和架构:
-
识别根目录:
- 按用途分类目录:
- 源代码:、
src/、app/lib/ - 测试:、
test/、__tests__/cypress/ - 配置:、
config/.config/ - 文档:、
docs/documentation/ - 构建产物:、
dist/、build/out/ - 脚本:、
scripts/bin/ - 资源:、
assets/、static/public/
- 源代码:
- 按用途分类目录:
-
检测入口点:
- 主入口:、
index.ts、main.pyapp.py - 应用入口:、
app.ts、server.tsapp/page.tsx - 处理器:、
handler.tslambda.ts - CLI:、
cli.tsbin/
- 主入口:
-
检测架构模式:
- MVC:、
models/、views/controllers/ - 分层:、
presentation/、business/data/ - 六边形架构:、
domain/、application/infrastructure/ - 微服务:多个服务目录
- 模块化:基于功能的组织方式
- 扁平化:所有文件都在src/中
- MVC:
-
检测模块系统:
- 检查package.json中的(ESM)
"type": "module" - 扫描/
import(ESM)与export(CommonJS)require - 识别混合模块系统
- 检查package.json中的
Step 6: Dependency Analysis
步骤6:依赖分析
Analyze dependency health:
-
Count dependencies:
- Production dependencies
- Development dependencies
- Total dependency count
-
Check for outdated packages (optional):
- Run or equivalent
npm outdated - Parse output for outdated packages
- Identify major version updates (breaking changes)
- Run
-
Security scan (optional):
- Run or equivalent
npm audit - Identify vulnerabilities by severity
- Flag critical security issues
- Run
分析依赖健康状况:
-
统计依赖数量:
- 生产依赖
- 开发依赖
- 总依赖数
-
检查过时包(可选):
- 运行或等效命令
npm outdated - 解析输出以获取过时包信息
- 识别主版本更新(破坏性变更)
- 运行
-
安全扫描(可选):
- 运行或等效命令
npm audit - 按严重性识别漏洞
- 标记严重安全问题
- 运行
Step 7: Code Quality Indicators
步骤7:代码质量指标
Detect code quality tooling:
-
Linting Configuration:
- Detect: ,
.eslintrc.json,eslint.config.jsruff.toml - Tool: ESLint, Ruff, Flake8, Pylint
- Run linter if configured (optional)
- Detect:
-
Formatting Configuration:
- Detect: ,
.prettierrc(Black/Ruff)pyproject.toml - Tool: Prettier, Black, Ruff
- Detect:
-
Testing Framework:
- Detect: Jest, Vitest, Pytest, Cypress
- Count test files
- Check for coverage configuration
-
Type Safety:
- Detect TypeScript:
tsconfig.json - Check strict mode:
"strict": true - Detect Python typing: mypy, pyright
- Detect TypeScript:
检测代码质量工具:
-
代码检查配置:
- 检测:、
.eslintrc.json、eslint.config.jsruff.toml - 工具:ESLint、Ruff、Flake8、Pylint
- 若已配置则运行代码检查(可选)
- 检测:
-
格式化配置:
- 检测:、
.prettierrc(Black/Ruff)pyproject.toml - 工具:Prettier、Black、Ruff
- 检测:
-
测试框架:
- 检测:Jest、Vitest、Pytest、Cypress
- 统计测试文件数量
- 检查是否存在覆盖率配置
-
类型安全:
- 检测TypeScript:
tsconfig.json - 检查严格模式:
"strict": true - 检测Python类型检查:mypy、pyright
- 检测TypeScript:
Step 8: Pattern Detection
步骤8:模式检测
Identify common patterns and anti-patterns:
-
Good Practices:
- Modular component structure
- Comprehensive test coverage
- TypeScript strict mode enabled
- CI/CD configuration present
-
Anti-Patterns:
- Large files (> 1000 lines)
- Missing tests
- Outdated dependencies
- No linting configuration
-
Neutral Patterns:
- Specific architecture choices
- Framework-specific patterns
识别常见模式和反模式:
-
最佳实践:
- 模块化组件结构
- 全面的测试覆盖率
- 启用TypeScript严格模式
- 存在CI/CD配置
-
反模式:
- 大文件(超过1000行)
- 缺少测试
- 过时依赖
- 无代码检查配置
-
中性模式:
- 特定架构选择
- 框架特定模式
Step 9: Technical Debt Analysis
步骤9:技术债务分析
Calculate technical debt score:
-
Debt Indicators:
- Outdated Dependencies: Count outdated packages
- Missing Tests: Low test file ratio
- Dead Code: Unused imports/exports (optional)
- Complexity: Large files, deep nesting
- Documentation: Missing README, docs
- Security: Known vulnerabilities
- Performance: Bundle size, load time
-
Debt Score (0-100):
- 0-20: Excellent health
- 21-40: Good health, minor issues
- 41-60: Moderate debt, needs attention
- 61-80: High debt, refactoring recommended
- 81-100: Critical debt, major overhaul needed
-
Remediation Effort:
- Trivial: < 1 hour
- Minor: 1-4 hours
- Moderate: 1-3 days
- Major: 1-2 weeks
- Massive: > 2 weeks
计算技术债务得分:
-
债务指标:
- 过时依赖:过时包数量
- 缺少测试:测试文件占比低
- 死代码:未使用的导入/导出(可选)
- 复杂度:大文件、深层嵌套
- 文档:缺少README、文档
- 安全:已知漏洞
- 性能:包大小、加载时间
-
债务得分(0-100):
- 0-20:健康状况极佳
- 21-40:健康状况良好,存在小问题
- 41-60:中等债务,需要关注
- 61-80:高债务,建议重构
- 81-100:严重债务,需要重大整改
-
修复工作量:
- 极小:<1小时
- 小:1-4小时
- 中等:1-3天
- 大:1-2周
- 极大:>2周
Step 10: Generate Recommendations
步骤10:生成建议
Create prioritized improvement recommendations:
-
Categorize Recommendations:
- Security: Critical vulnerabilities, outdated auth
- Performance: Bundle optimization, lazy loading
- Maintainability: Refactor large files, add tests
- Testing: Increase coverage, add E2E tests
- Documentation: Add README, API docs
- Architecture: Improve modularity, separation of concerns
- Dependencies: Update packages, remove unused
-
Prioritize by Impact:
- P0: Critical security, blocking production
- P1: High impact, affects reliability
- P2: Medium impact, improves quality
- P3: Low impact, nice-to-have
-
Estimate Effort and Impact:
- Effort: trivial, minor, moderate, major, massive
- Impact: low, medium, high, critical
创建优先级排序的改进建议:
-
建议分类:
- 安全:严重漏洞、过时认证
- 性能:包优化、懒加载
- 可维护性:重构大文件、添加测试
- 测试:提高覆盖率、添加端到端测试
- 文档:添加README、API文档
- 架构:提高模块化程度、关注点分离
- 依赖:更新包、移除未使用的依赖
-
按影响优先级排序:
- P0:严重安全问题,阻碍生产
- P1:高影响,影响可靠性
- P2:中等影响,提高质量
- P3:低影响,锦上添花
-
估算工作量和影响:
- 工作量:极小、小、中等、大、极大
- 影响:低、中、高、严重
Step 11: Validate Output
步骤11:验证输出
Validate analysis output against schema:
-
Schema Validation:
- Validate against
project-analysis.schema.json - Ensure all required fields present
- Check data types and formats
- Validate against
-
Output Metadata:
- Analyzer version
- Analysis duration (ms)
- Files analyzed count
- Files skipped count
- Errors encountered
</execution_process>
<performance>
**Performance Requirements**:
- Target: < 30 seconds for typical projects (< 10k files)
- Optimization:
- Skip large directories: ,
node_modules/,.git/dist/ - Use parallel file processing
- Cache results for incremental analysis
- Limit deep scans to essential files
- Use streaming for large file counts </performance>
- Skip large directories:
Integration with Other Skills:
- rule-selector: Auto-select rules based on detected frameworks
- repo-rag: Semantic search for architectural patterns
- dependency-analyzer: Deep dependency analysis </integration>
<best_practices>
- Progressive Disclosure: Start with manifest analysis, add deep scans if needed
- Performance First: Skip expensive operations for large projects
- Fail Gracefully: Handle missing files, parse errors
- Validate Output: Always validate against schema
- Cache Results: Store analysis output for reuse
- Incremental Updates: Re-analyze only changed files </best_practices> </instructions>
bash
undefined根据架构验证分析输出:
-
架构验证:
- 根据进行验证
project-analysis.schema.json - 确保所有必填字段存在
- 检查数据类型和格式
- 根据
-
输出元数据:
- 分析器版本
- 分析时长(毫秒)
- 已分析文件数
- 已跳过文件数
- 遇到的错误
</execution_process>
<performance>
**性能要求**:
- 目标:典型项目(<10000个文件)分析时间<30秒
- 优化措施:
- 跳过大型目录:、
node_modules/、.git/dist/ - 采用并行文件处理
- 为增量分析缓存结果
- 仅对必要文件进行深度扫描
- 针对大量文件使用流式处理 </performance>
- 跳过大型目录:
与其他工具集成:
- rule-selector:根据检测到的框架自动选择规则
- repo-rag:针对架构模式的语义搜索
- dependency-analyzer:深度依赖分析 </integration>
<best_practices>
- 渐进式披露:从清单分析开始,必要时添加深度扫描
- 性能优先:对大型项目跳过昂贵的操作
- 优雅降级:处理缺失文件、解析错误
- 验证输出:始终根据架构进行验证
- 缓存结果:存储分析输出以便复用
- 增量更新:仅重新分析已更改的文件 </best_practices> </instructions>
bash
undefinedAnalyze current project
分析当前项目
node .claude/tools/analysis/project-analyzer/analyzer.mjs
node .claude/tools/analysis/project-analyzer/analyzer.mjs
Analyze specific directory
分析特定目录
node .claude/tools/analysis/project-analyzer/analyzer.mjs /path/to/project
node .claude/tools/analysis/project-analyzer/analyzer.mjs /path/to/project
Output to file
输出到文件
node .claude/tools/analysis/project-analyzer/analyzer.mjs --output .claude/context/artifacts/project-analysis.json
**Agent Invocation**:
node .claude/tools/analysis/project-analyzer/analyzer.mjs --output .claude/context/artifacts/project-analysis.json
**Agent调用**:
Analyze current project
分析当前项目
Analyze this project
Analyze this project
Generate comprehensive analysis
生成全面分析报告
Perform full project analysis and save to artifacts
Perform full project analysis and save to artifacts
Quick analysis (manifest only)
快速分析(仅清单)
Quick project type detection
</usage_example>
<formatting_example>
**Sample Output** (`.claude/context/artifacts/project-analysis.json`):
```json
{
"analysis_id": "analysis-llm-rules-20250115",
"project_type": "fullstack",
"analyzed_at": "2025-01-15T10:30:00.000Z",
"project_root": "C:\\dev\\projects\\LLM-RULES",
"stats": {
"total_files": 1243,
"total_lines": 125430,
"languages": {
"JavaScript": 45230,
"TypeScript": 38120,
"Markdown": 25680,
"JSON": 12400,
"YAML": 4000
},
"file_types": {
".js": 234,
".mjs": 156,
".ts": 89,
".md": 312,
".json": 145
},
"directories": 87,
"avg_file_size_lines": 101,
"largest_files": [
{
"path": ".claude/tools/enforcement-gate.mjs",
"lines": 1520
}
]
},
"frameworks": [
{
"name": "nextjs",
"version": "14.0.0",
"category": "framework",
"confidence": 1.0,
"source": "package.json"
},
{
"name": "react",
"version": "18.2.0",
"category": "framework",
"confidence": 1.0,
"source": "package.json"
}
],
"structure": {
"root_directories": [
{
"name": ".claude",
"purpose": "config",
"file_count": 543
},
{
"name": "conductor-main",
"purpose": "source",
"file_count": 234
}
],
"entry_points": [
{
"path": "conductor-main/src/index.ts",
"type": "main"
}
],
"architecture_pattern": "modular",
"module_system": "esm"
},
"dependencies": {
"production": 45,
"development": 23
},
"code_quality": {
"linting": {
"configured": true,
"tool": "eslint"
},
"formatting": {
"configured": true,
"tool": "prettier"
},
"testing": {
"framework": "vitest",
"test_files": 89,
"coverage_configured": true
},
"type_safety": {
"typescript": true,
"strict_mode": true
}
},
"tech_debt": {
"score": 35,
"indicators": [
{
"category": "complexity",
"severity": "medium",
"description": "3 files exceed 1000 lines",
"remediation_effort": "moderate"
}
]
},
"recommendations": [
{
"priority": "P1",
"category": "maintainability",
"title": "Refactor large files",
"description": "Break down files > 1000 lines into smaller modules",
"effort": "moderate",
"impact": "high"
}
],
"metadata": {
"analyzer_version": "1.0.0",
"analysis_duration_ms": 2340,
"files_analyzed": 1243,
"files_skipped": 3420,
"errors": []
}
}</formatting_example>
</examples>
Quick project type detection
</usage_example>
<formatting_example>
**示例输出**(`.claude/context/artifacts/project-analysis.json`):
```json
{
"analysis_id": "analysis-llm-rules-20250115",
"project_type": "fullstack",
"analyzed_at": "2025-01-15T10:30:00.000Z",
"project_root": "C:\\dev\\projects\\LLM-RULES",
"stats": {
"total_files": 1243,
"total_lines": 125430,
"languages": {
"JavaScript": 45230,
"TypeScript": 38120,
"Markdown": 25680,
"JSON": 12400,
"YAML": 4000
},
"file_types": {
".js": 234,
".mjs": 156,
".ts": 89,
".md": 312,
".json": 145
},
"directories": 87,
"avg_file_size_lines": 101,
"largest_files": [
{
"path": ".claude/tools/enforcement-gate.mjs",
"lines": 1520
}
]
},
"frameworks": [
{
"name": "nextjs",
"version": "14.0.0",
"category": "framework",
"confidence": 1.0,
"source": "package.json"
},
{
"name": "react",
"version": "18.2.0",
"category": "framework",
"confidence": 1.0,
"source": "package.json"
}
],
"structure": {
"root_directories": [
{
"name": ".claude",
"purpose": "config",
"file_count": 543
},
{
"name": "conductor-main",
"purpose": "source",
"file_count": 234
}
],
"entry_points": [
{
"path": "conductor-main/src/index.ts",
"type": "main"
}
],
"architecture_pattern": "modular",
"module_system": "esm"
},
"dependencies": {
"production": 45,
"development": 23
},
"code_quality": {
"linting": {
"configured": true,
"tool": "eslint"
},
"formatting": {
"configured": true,
"tool": "prettier"
},
"testing": {
"framework": "vitest",
"test_files": 89,
"coverage_configured": true
},
"type_safety": {
"typescript": true,
"strict_mode": true
}
},
"tech_debt": {
"score": 35,
"indicators": [
{
"category": "complexity",
"severity": "medium",
"description": "3 files exceed 1000 lines",
"remediation_effort": "moderate"
}
]
},
"recommendations": [
{
"priority": "P1",
"category": "maintainability",
"title": "Refactor large files",
"description": "Break down files > 1000 lines into smaller modules",
"effort": "moderate",
"impact": "high"
}
],
"metadata": {
"analyzer_version": "1.0.0",
"analysis_duration_ms": 2340,
"files_analyzed": 1243,
"files_skipped": 3420,
"errors": []
}
}</formatting_example>
</examples>
References
参考资料
For additional detection patterns extracted from the Auto-Claude analysis framework, see:
- - Monorepo indicators, SERVICE_INDICATORS, SERVICE_ROOT_FILES, infrastructure detection, convention detection
references/auto-claude-patterns.md - - Service type detection (frontend, backend, library), framework-specific patterns, entry point detection
references/service-patterns.md - - Database configuration file patterns, ORM detection (Prisma, SQLAlchemy, TypeORM, Drizzle, Mongoose), connection string patterns
references/database-patterns.md - - Express, FastAPI, Flask, Django, Next.js, Go, Rust API route detection patterns
references/route-patterns.md
These references provide comprehensive regex patterns and detection logic for brownfield codebase analysis.
有关从Auto-Claude分析框架提取的其他检测模式,请参阅:
- - 单体仓库标识、SERVICE_INDICATORS、SERVICE_ROOT_FILES、基础设施检测、约定检测
references/auto-claude-patterns.md - - 服务类型检测(前端、后端、库)、框架特定模式、入口点检测
references/service-patterns.md - - 数据库配置文件模式、ORM检测(Prisma、SQLAlchemy、TypeORM、Drizzle、Mongoose)、连接字符串模式
references/database-patterns.md - - Express、FastAPI、Flask、Django、Next.js、Go、Rust API路由检测模式
references/route-patterns.md
这些参考资料提供了遗留代码库分析所需的全面正则表达式模式和检测逻辑。
Memory Protocol (MANDATORY)
内存协议(强制要求)
Before starting:
Read
.claude/context/memory/learnings.mdAfter completing:
- New pattern ->
.claude/context/memory/learnings.md - Issue found ->
.claude/context/memory/issues.md - Decision made ->
.claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.
开始前:
读取
.claude/context/memory/learnings.md完成后:
- 新模式 ->
.claude/context/memory/learnings.md - 发现的问题 ->
.claude/context/memory/issues.md - 做出的决策 ->
.claude/context/memory/decisions.md
假设中断:如果未记录在内存中,则视为未发生。