Analyzes Java project structure and generates comprehensive documentation including tech stack, architecture, modules, configuration, internal SDKs, and development guidelines. Use this skill when you need to understand a Java/Spring Boot codebase, onboard new developers, generate project documentat
npx playbooks add skill quqi-ai/project-analyzer-skill --skill project-analyzer
Analyzes Java project structure and generates comprehensive documentation to help developers and AI agents understand the codebase.
Start by identifying the project type and structure:
pom.xml with <modules> section@SpringBootApplication)pom.xml or build.gradle for dependenciesAnalyze dependencies and configurations to identify:
Frameworks:
pom.xml for spring-boot-starter-parent)Middleware & Infrastructure:
application.yml for datasource configurations)Development Tools:
Search patterns:
# Find Spring Boot version
grep -r "spring-boot-starter-parent" --include="pom.xml"
# Find middleware dependencies
grep -r "spring-boot-starter-data-redis\|rabbitmq\|kafka\|nacos" --include="pom.xml"
# Find database configurations
grep -r "url:\|driver-class-name:" --include="*.yml" --include="*.yaml" --include="*.properties"
Map out the module and package organization:
For multi-module projects:
pom.xml to list all modules*-api: API definitions, DTOs, interfaces*-service: Business logic implementation*-web: Web controllers, REST APIs-dao / -mapper: Data access layer*-common: Shared utilities, constants-model / -entity: Domain modelsPackage structure analysis:
# Find main package structure
find . -type d -name "java" -o -name "com" -o -name "cn" | head -20
# Identify common layers
find . -name "controller" -o -name "service" -o -name "dao" -o -name "mapper" -o -name "config"
Identify critical components in order of importance:
Application Entry Points:
@SpringBootApplicationConfiguration Classes:
@Configurationconfig/ packagesapplication.yml, application.properties, bootstrap.ymlCore Business Modules:
Infrastructure Components:
@Scheduled)Search patterns:
# Find application entry points
grep -r "@SpringBootApplication" --include="*.java"
# Find configuration classes
grep -r "@Configuration" --include="*.java"
# Find scheduled tasks
grep -r "@Scheduled" --include="*.java"
# Find MQ consumers
grep -r "@RabbitListener\|@KafkaListener" --include="*.java"
Document all configuration sources:
Spring configuration files:
application.yml / application.properties (default profile)application-{profile}.yml (environment-specific)bootstrap.yml (for Spring Cloud Config)External configuration:
${ENV_VAR} patterns)Configuration hierarchy:
Identify internal/custom libraries:
Search for internal artifacts:
# Find internal dependencies (usually from company groupId)
grep -r "<groupId>com\.company\|<groupId>cn\.company" --include="pom.xml"
# Find local JAR references
grep -r "systemPath\|scope>system" --include="pom.xml"
# Check lib directories
find . -type d -name "lib" -o -name "libs"
Document for each internal SDK:
Search for usage:
# Find imports from internal packages
grep -r "import com\.company" --include="*.java" | cut -d: -f2 | sort | uniq
Extract rules and patterns from the codebase:
Architectural patterns:
Common utilities:
Infer restrictions:
Local development requirements:
README.md or docs/ for setup instructionsSearch patterns:
# Find README files
find . -name "README*" -o -name "readme*"
# Find Docker Compose
find . -name "docker-compose*.yml"
# Find documentation
find . -type d -name "doc" -o -name "docs"
Generate a Markdown document with the following structure:
# {Project Name} - Project Structure Documentation
> Generated on {date} | Analysis Type: Static Code Analysis
## 📋 Project Overview
- **Project Name**: {name}
- **Type**: {Single Module / Multi-Module}
- **Primary Language**: Java {version}
- **Build Tool**: Maven / Gradle
- **Main Framework**: Spring Boot {version}
## 🛠️ Technology Stack
### Core Frameworks
- Spring Boot {version}
- Spring Cloud {components if present}
- {Other frameworks}
### Middleware & Infrastructure
- **Service Discovery**: {Nacos / Eureka / None}
- **Configuration Center**: {Nacos / Config Server / None}
- **Cache**: {Redis / Caffeine / None}
- **Message Queue**: {RabbitMQ / Kafka / None}
- **Database**: {MySQL / PostgreSQL / etc.}
### Development Tools
- {Lombok, MapStruct, Swagger, etc.}
## 🏗️ Project Architecture
### Module Structure
{For multi-module projects, list modules}
project-root/
├── module-api/ - {Purpose}
├── module-service/ - {Purpose}
├── module-web/ - {Purpose}
└── module-common/ - {Purpose}
### Package Structure
{Describe package organization}
com.company.project/
├── controller/ - REST API endpoints
├── service/ - Business logic
│ ├── impl/
│ └── {domain}/
├── dao/mapper/ - Data access
├── model/entity/ - Domain models
├── config/ - Configuration classes
└── util/ - Utility classes
### Layered Architecture
┌─────────────────────────────────┐
│ Controller Layer │ ← HTTP requests
├─────────────────────────────────┤
│ Service Layer │ ← Business logic
├─────────────────────────────────┤
│ DAO/Mapper Layer │ ← Data access
├─────────────────────────────────┤
│ Infrastructure Layer │ ← Redis, MQ, External APIs
└─────────────────────────────────┘
## 🔑 Key Components
### Application Entry Point
- `{path/to/Application.java}` - Main application class
### Core Business Modules
- **{Feature 1}**: {path} - {Description}
- **{Feature 2}**: {path} - {Description}
### Configuration Files
- `{path/to/application.yml}` - Main configuration
- `{path/to/application-dev.yml}` - Dev environment
- `{path/to/application-prod.yml}` - Production environment
### Infrastructure Components
- **Database Mappers**: `{path}` - {Count} mapper interfaces
- **Scheduled Tasks**: `{path}` - {Description}
- **Message Consumers**: `{path}` - {Description}
## 📦 Internal SDKs & Dependencies
### Internal Dependencies
1. **{artifact-name}** (`{groupId}:{artifactId}:{version}`)
- **Purpose**: {Inferred purpose}
- **Key Classes**: {List main classes/interfaces}
- **Used In**: {Where it's imported}
2. **{another-sdk}**
- ...
### External Key Dependencies
- {List critical 3rd party libraries}
## ⚙️ Configuration & Environment
### Configuration Sources
1. **Spring Configuration**: `application.yml`, `application-{profile}.yml`
2. **Nacos Configuration**: {If applicable}
- Namespace: {value}
- Group: {value}
- DataId: {value}
3. **Environment Variables**: {List if found}
### Key Configurations
- **Server Port**: {port}
- **Database**: {connection details location}
- **Redis**: {configuration location}
- **Nacos**: {server address}
## 📐 Development Guidelines
### Architectural Rules
{Rules observed from code patterns}
- **Layer Separation**: Controllers must not directly access DAO layer
- **Service Interfaces**: All services implement interfaces in {package}
- **{Other patterns}**
### Conventions
- **Naming**: {Observed naming patterns}
- **Response Format**: All APIs return `Result<T>` wrapper (see `{path}`)
- **Exception Handling**: Unified exception handler at `{path}`
### Recommended Extension Points
- **Add New Feature**: Create service in `{package}`, controller in `{package}`
- **Add New Entity**: Place in `{package}`, create mapper in `{package}`
- **Add Configuration**: Add to `{config class}` or `application.yml`
### Prohibited Practices
{Inferred from codebase patterns}
- Do not bypass {XxxClient} for {external service} calls
- Do not use direct JDBC; use {MyBatis/JPA}
- Do not put business logic in Controller layer
### Local Development Requirements
**Required Services:**
- {Service 1} (e.g., MySQL 5.7+)
- {Service 2} (e.g., Redis 6.0+)
- {Service 3} (e.g., Nacos 2.0+)
**Setup Steps:**
{If found in README or docs}
**Startup Order:**
1. {Step 1}
2. {Step 2}
## 📚 Additional Resources
- **Documentation**: `{path to docs folder}`
- **API Documentation**: {Swagger URL if configured}
- **README**: `{path to README}`
---
*Note: This documentation was generated through static code analysis. For runtime behavior or deployment specifics, consult the team or deployment documentation.*
Trigger this skill when:
mvn clean install, gradle build)Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.