xiaohongshu
xiaohongshu
analyze-yii2-project
Use this when user provides a Yii2 codebase for analysis or migration planning. Provides 6-phase workflow: scan, capability extraction, dependency analysis, requirements extraction, semantic indexing, and migration roadmap. Apply when user mentions Yii2, PHP legacy modernization, or framework mig...
Full skill instructions
Comprehensive workflow for analyzing legacy Yii2 projects to extract business logic, understand architecture, and plan modernization.
codecompass health
Verify:
vendor/ directory present (run composer install if missing)Step 1.1: Run Yii2 Analyzer
codecompass analyze:yii2 <path-to-yii2-project>
What this does:
Expected output:
Step 1.2: Validate Results Check for:
vendor/ → Run composer installdocs/YII2_QUICK_REFERENCE.mdStep 2.1: Extract Controllers → Capabilities
# Analyzer automatically extracts business capabilities from controllers
What this maps:
Controller → Business Capability
├── UserController → User Management
├── OrderController → Order Processing
├── PaymentController → Payment Handling
└── ReportController → Reporting & Analytics
Step 2.2: Extract Models → Domain Entities Identifies:
Step 2.3: Extract Migrations → Data Model Evolution Traces:
Step 3.1: Analyze Class Dependencies
Uses: AstAnalyzerService for PHP parsing
Maps:
Step 3.2: Identify Core vs Supporting Logic Categorizes:
Step 4.1: Run Requirements Extractor
codecompass requirements:extract --project-id <yii2-project-id>
Extracts:
Step 4.2: Generate Documentation Outputs:
Step 5.1: Index Codebase
codecompass batch:index <path-to-yii2-project>
Why:
Step 5.2: Verify Indexing
curl http://localhost:8081/v1/schema
# Check for CodeContext or AtlasCode collection
Step 5.3: Test Semantic Search
codecompass search:semantic "validation rules for customer registration"
Should return: User model validators, controller logic, related code
Step 6.1: Identify Migration Complexity Assess:
Step 6.2: Prioritize by Business Value Map:
Business Capability → Migration Priority
├── Core Revenue Generating → HIGH (do first, carefully)
├── Customer-Facing → MEDIUM (visible impact)
└── Internal Tools → LOW (can defer)
Step 6.3: Generate Migration Roadmap Structure:
// CRUD pattern
public function actionIndex() // → LIST endpoint
public function actionView($id) // → GET/:id endpoint
public function actionCreate() // → POST endpoint
public function actionUpdate($id) // → PUT/:id endpoint
public function actionDelete($id) // → DELETE/:id endpoint
Maps to NestJS:
@Controller('users')
export class UsersController {
@Get() findAll()
@Get(':id') findOne()
@Post() create()
@Put(':id') update()
@Delete(':id') remove()
}
// Validation rules
public function rules() {
return [
[['email'], 'required'],
[['email'], 'email'],
];
}
Maps to NestJS DTO:
export class CreateUserDto {
@IsNotEmpty()
@IsEmail()
email: string;
}
// ActiveRecord query
$users = User::find()
->where(['status' => User::STATUS_ACTIVE])
->orderBy('created_at DESC')
->all();
Maps to TypeORM:
const users = await this.userRepository.find({
where: { status: UserStatus.ACTIVE },
order: { createdAt: 'DESC' },
});
graph TD
Controller[Controllers] --> Service[Business Logic]
Service --> Model[ActiveRecord Models]
Model --> DB[(Database)]
Controller --> View[Views]
## Core Capabilities
- User Management (UserController, User model)
- Order Processing (OrderController, Order/OrderItem models)
- Payment Handling (PaymentController, Payment model)
## Supporting Capabilities
- Reporting (ReportController)
- Notifications (EmailService)
Symptom: Analyzer reports 0 controllers
Cause: Non-standard directory structure
Solution: Check @app alias configuration in Yii2, adjust paths
Symptom: Cannot extract models properly Cause: Database not accessible or migrations not run Solution: Ensure database connection configured, run pending migrations
Symptom: Dependency graph shows circular references Meaning: Code smell - tight coupling between modules Action: Plan refactoring to break cycles during migration
Symptom: Complex logic in controllers with no comments Action:
extract-requirements.md - For detailed requirements extractionsemantic-search.md - For code explorationsoftware-architect.md - For architecture perspectiveFrom .ai/capabilities.json:
yii2-analyzer - Main analysis moduleast-analyzer - PHP parsingdatabase-analyzer - Schema extractionrequirements - Business rules extractionbusiness-analyzer - Capability mappingRemember: The goal is not just to understand the code, but to preserve the business knowledge embedded in it.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience