## Code Analysis Plan
### 1. Objective
Understand PlayerQuest's progress update mechanism, including:
- How progress is stored and updated
- Task completion determination logic
- Interaction with the medal system
### 2. Deliverables
- `PlayerQuest-Progress-Analysis.md`
- Path: `repository/projects/BattleCore/docs/`
- Contains: Flowchart + Core code + Data flow
### 3. Content
1. PlayerQuest class structure
2. updateProgress() / accumulateProgress() implementation
3. Task completion determination logic
4. Coupling relationship with PlayerMedal
### 4. Token Estimation
- Code reading: ~5,000 tokens
- Documentation: ~3,000 tokens
- Total: ~8,000 tokens
- Estimated time: 15-20 minutes
Example 2: Complex System Analysis
User: "Understand the overall skill system architecture"
Plan Output:
## Code Analysis Plan
### 1. Objective
Fully understand the FAbility skill system architecture:
- Core class hierarchy
- State machine implementation
- Skill lifecycle
- Integration with the battle core
### 2. Deliverables
- `FAbility-Architecture.md`
- Path: `repository/projects/BattleCore/docs/`
- Contains: Architecture diagram + Class diagram + Real-world examples
- `Skill-Lifecycle-Flow.md`
- Complete skill lifecycle flow
### 3. Content
1. FAbility base class design
2. State machine (EAbilityState)
3. Concrete skill implementation examples
4. CD/Cost system
5. Event system
### 4. Token Estimation
- Code reading: ~30,000 tokens
- Documentation: ~15,000 tokens
- Total: ~45,000 tokens
- Estimated time: 60-80 minutes
Important Rules
Definition Location Confirmation Rule (Critical)
Rule: When definition locations are unclear during code analysis, must ask the requester to explicitly specify the location in advance
Execution Steps:
After receiving an analysis request, first attempt to locate the definition files of key classes/functions
If the location cannot be determined through file name or class name search, immediately stop analysis
Ask the requester: "Please provide the definition file path for [ClassName]"
After receiving a clear path, continue analysis
Example:
❌ Incorrect approach:
User: "Analyze NetMessage implementation"
AI: (Blindly search, can't find correct location, analyze based on assumptions)
✅ Correct approach:
User: "Analyze NetMessage implementation"
AI: "Please provide the definition file path for NetMessage,
Search found possible locations:
- Server/Network/NetMessage.h
- Server/Common/NetMessage.h
Please confirm which file?"
User: "In Server/Network/NetMessage.h"
AI: (Start analysis based on explicit path)
Best Practices
Do's
✅ Define clear scope boundaries, avoid over-analysis
✅ Provide specific file paths and line numbers
✅ Include actual code snippets
✅ Use diagrams to aid understanding (text descriptions)
✅ Estimates should be conservative, leave buffer
Don'ts
❌ Don't use vague scopes ("analyze the entire project")
❌ Don't omit key deliverable information
❌ Don't underestimate token consumption for complex systems
❌ Don't mix multiple unrelated objectives
❌ Don't blindly guess when definition locations are unclear (must ask the requester to explicitly specify file paths)
Integration with Other Skills
knowledge-base-cache: Store analysis results in knowledge base
git-workflow: Commit analysis documents
skill-creator: Create specialized analysis skills from patterns