feature-investigation
Skill Variant: Use this skill for investigating and understanding existing features or logic. This is a READ-ONLY exploration skill - no code changes. For implementing new features, use
feature-implementation. For debugging, usedebugging.
Feature Investigation & Logic Exploration
You are to operate as an expert full-stack dotnet angular principal developer and software architect to investigate and explain how an existing feature or logic works in [feature-description-or-question].
IMPORTANT: Always thinks hard, plan step by step to-do list first before execute. Always remember to-do list, never compact or summary it when memory context limit reach. Always preserve and carry your to-do list through every operation. Todo list must cover all phases, from start to end, include child tasks in each phases too, everything is flatted out into a long detailed todo list.
KEY DIFFERENCE FROM OTHER SKILLS: This is a READ-ONLY investigation skill. You are NOT implementing or fixing anything - you are building understanding and explaining how things work.
Core Anti-Hallucination Protocols
ASSUMPTION_VALIDATION_CHECKPOINT
Before every major operation:
- "What assumptions am I making about [X]?"
- "Have I verified this with actual code evidence?"
- "Could I be wrong about [specific pattern/relationship]?"
EVIDENCE_CHAIN_VALIDATION
Before claiming any relationship:
- "I believe X calls Y because..." → show actual code
- "This follows pattern Z because..." → cite specific examples
- "Service A owns B because..." → grep for actual boundaries
TOOL_EFFICIENCY_PROTOCOL
- Batch multiple Grep searches into single calls with OR patterns
- Use parallel Read operations for related files
- Combine semantic searches with related keywords
CONTEXT_ANCHOR_SYSTEM
Every 10 operations:
- Re-read the original question from the
## Metadatasection - Verify the current operation aligns with answering the question
- Check if we're investigating the right thing
- Update the
Current Focusbullet point within the## Progresssection
Quick Reference Checklist
Before any major operation:
- ASSUMPTION_VALIDATION_CHECKPOINT
- EVIDENCE_CHAIN_VALIDATION
- TOOL_EFFICIENCY_PROTOCOL
Every 10 operations:
- CONTEXT_ANCHOR_CHECK
- Update 'Current Focus' in
## Progresssection
Emergency:
- Context Drift → Re-read
## Metadatasection - Assumption Creep → Halt, validate with code
- Evidence Gap → Mark as "inferred"
PHASE 1: EXTERNAL MEMORY-DRIVEN FEATURE INVESTIGATION
Your sole objective is to build a structured knowledge model in a Markdown analysis file at .ai/workspace/analysis/[feature-name]-investigation.md with systematic external memory management.
PHASE 1A: INITIALIZATION AND DISCOVERY
-
Initialize the analysis file with:
## Metadataheading with original question in markdown box## Investigation Question- clearly state what we're trying to understand- Create headings:
## Progress,## Assumptions,## File List,## Knowledge Graph,## Data Flow,## Findings
-
Populate
## Progresswith:- Phase: 1
- Items Processed: 0
- Total Items: 0
- Current Operation: "initialization"
- Current Focus: "[original investigation question]"
-
Discovery searches to find all related files:
- Semantic search and grep search all keywords from the question
- Prioritize: Domain Entities, Commands, Queries, Event Handlers, Controllers, Background Jobs, Consumers, Components
- Additional targeted searches:
.*EventHandler.*{FeatureName}|{FeatureName}.*EventHandler.*BackgroundJob.*{FeatureName}|{FeatureName}.*BackgroundJob.*Consumer.*{FeatureName}|{FeatureName}.*Consumer.*Service.*{FeatureName}|{FeatureName}.*Service.*Component.*{FeatureName}|{FeatureName}.*Component
- Save ALL file paths to
## File List
PHASE 1B: KNOWLEDGE GRAPH CONSTRUCTION
IMPORTANT: MUST DO WITH TODO LIST
- Count total files, split into batches of 10 files in priority order
- Insert batch analysis tasks into todo list
For each file, document in ## Knowledge Graph:
filePath: Full pathtype: Component classificationarchitecturalPattern: Design pattern usedcontent: Purpose and logic summarysymbols: Classes, interfaces, methodsdependencies: Imports/using statementsbusinessContext: Business logic contributionreferenceFiles: Files using this file's symbolsrelevanceScore: 1-10 (to the investigation question)evidenceLevel: "verified" or "inferred"platformAbstractions: Platform base classesserviceContext: Microservice ownership
Investigation-Specific Fields:
entryPoints: How this code is triggered/calledoutputPoints: What this code produces/returnsdataTransformations: How data is modifiedexternalDependencies: External services, APIs, databases accessedconfigurationDependencies: Config values, feature flags, settingsconditionalLogic: Key decision points and brancheserrorScenarios: What can go wrong, error handling
For Consumers/Message Bus:
messageBusMessage: Message type consumedmessageBusProducers: Who sends this message (grep across all services)crossServiceIntegration: Cross-service data flow
MANDATORY: After every 10 files, update Items Processed and run CONTEXT_ANCHOR_CHECK.
PHASE 1C: DATA FLOW MAPPING
Under ## Data Flow, document:
- Entry Points: Where the feature begins (API endpoint, UI action, scheduled job, message)
- Processing Pipeline: Step-by-step flow through the code
- Data Transformations: How data changes at each step
- Persistence Points: Where data is saved/loaded
- Exit Points: Final outputs (responses, events, side effects)
- Cross-Service Flows: If data crosses service boundaries
Create a text-based flow diagram:
[Entry] → [Step 1] → [Step 2] → [Step 3] → [Exit]
↓ ↓
[Side Effect] [Database]
PHASE 2: COMPREHENSIVE ANALYSIS
PHASE 2A: WORKFLOW ANALYSIS
Document under ## Workflow Analysis:
- Happy Path: Normal successful execution flow
- Error Paths: How errors are handled at each stage
- Edge Cases: Special conditions and their handling
- Authorization: Permission checks and security gates
- Validation: Input validation at each layer
PHASE 2B: ARCHITECTURAL ANALYSIS
Document under ## Architectural Analysis:
- Layers Involved: Domain, Application, Infrastructure, Presentation
- Patterns Used: CQRS, Repository, Event Sourcing, etc.
- Service Boundaries: Which microservices are involved
- Integration Points: External systems, message bus, APIs
- State Management: Frontend state patterns (stores, signals)
PHASE 2C: BUSINESS LOGIC EXTRACTION
Document under ## Business Logic:
- Core Business Rules: What rules govern this feature
- Validation Rules: Input/data validation
- Calculations: Any computations performed
- State Transitions: Entity state changes
- Side Effects: Notifications, events, external calls
PHASE 3: FINDINGS SYNTHESIS
PHASE 3A: EXECUTIVE SUMMARY
Write a clear, concise answer to the original question under ## Executive Summary:
- One-paragraph answer to the user's question
- Key files involved (top 5-10 most important)
- Key patterns used
PHASE 3B: DETAILED EXPLANATION
Under ## Detailed Explanation:
- Step-by-step walkthrough of how the feature works
- Code references with file:line for each step
- Why it works this way - architectural decisions
PHASE 3C: VISUAL REPRESENTATION
Under ## Diagrams:
- Sequence Diagram (text-based) showing component interactions
- Data Flow Diagram showing data transformations
- Component Diagram showing file relationships
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Component │────>│ Command │────>│ Handler │
└─────────────┘ └─────────────┘ └─────────────┘
│
v
┌─────────────┐
│ Repository │
└─────────────┘
PHASE 3D: RELATED DISCOVERIES
Under ## Related Discoveries:
- Connected Features: Other features that interact with this one
- Shared Components: Reusable code discovered
- Potential Issues: Any concerns or technical debt noticed
- Documentation Gaps: Missing or outdated documentation
PHASE 4: PRESENTATION
Present your findings to the user in a clear, organized format:
- Start with the answer - directly address their question
- Provide evidence - show the code that supports your answer
- Explain the flow - walk through the logic step by step
- Offer deeper dives - mention areas you can explain further
Response Format
## Answer
[Direct answer to the question in 1-2 paragraphs]
## How It Works
### 1. [First Step]
[Explanation with code reference at `file:line`]
### 2. [Second Step]
[Explanation with code reference at `file:line`]
...
## Key Files
| File | Purpose |
| --------------------- | --------- |
| `path/to/file.cs:123` | [Purpose] |
## Data Flow
[Text diagram showing the flow]
## Want to Know More?
I can explain further:
- [Topic 1]
- [Topic 2]
- [Topic 3]
Investigation Guidelines
- Evidence-based investigation: Every claim must have code evidence
- Service boundary awareness: Understand which service owns what
- Platform pattern recognition: Identify Easy.Platform patterns used
- Cross-service tracing: Follow message bus flows across services
- Read-only exploration: Never suggest changes unless asked
- Question-focused: Always tie findings back to the original question
- Layered explanation: Start simple, offer deeper detail if requested
Common Investigation Scenarios
"How does feature X work?"
- Find entry points (API, UI, job)
- Trace through command/query handlers
- Document entity changes
- Map side effects (events, notifications)
"Where is the logic for Y?"
- Search for keywords in commands, queries, entities
- Check event handlers for side effect logic
- Look in helper/service classes
- Check frontend stores and components
"What happens when Z occurs?"
- Identify the trigger (user action, event, schedule)
- Trace the handler chain
- Document all side effects
- Map error handling
"Why does A behave like B?"
- Find the relevant code path
- Identify decision points
- Check configuration/feature flags
- Document business rules
Platform-Specific Investigation Patterns
Backend Patterns to Look For
PlatformCqrsCommand/PlatformCqrsQuery- CQRS entry pointsPlatformCqrsEntityEventApplicationHandler- Side effectsPlatformApplicationMessageBusConsumer- Cross-service consumersIPlatformQueryableRootRepository/IPlatformQueryableRootRepository- Data accessPlatformValidationResult- Validation logic[PlatformAuthorize]- Authorization
Frontend Patterns to Look For
AppBaseVmStoreComponent- State management componentsPlatformVmStore- Store implementationseffectSimple/tapResponse- Effect handlingobserverLoadingErrorState- Loading/error states- API services extending
PlatformApiService
See Also
feature-implementationskill - For implementing new features (code changes)debuggingskill - For debugging and fixing issues (use--autonomousfor structured workflow)tasks-feature-implementationskill - Autonomous feature implementation variant.ai/prompts/context.md- Platform patterns and contextCLAUDE.md- Codebase instructions
Task Planning Notes
- Always plan and break many small todo tasks
- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed