Claude-skill-registry feature-investigation
Use when the user asks to investigate, explore, understand, explain, or analyze how an existing feature or logic works. Triggers on keywords like "how does", "explain", "what is the logic", "investigate", "understand", "where is", "trace", "walk through", "show me how".
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/feature-investigation-congdon1207-agents-md" ~/.claude/skills/majiayu000-claude-skill-registry-feature-investigation && rm -rf "$T"
skills/data/feature-investigation-congdon1207-agents-md/SKILL.mdSkill 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
. For debugging, usefeature-implementation.bug-diagnosis
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
section## Metadata - Verify the current operation aligns with answering the question
- Check if we're investigating the right thing
- Update the
bullet point within theCurrent Focus
section## Progress
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
section## Progress
Emergency:
- Context Drift → Re-read
section## Metadata - 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:
heading with original question in markdown box## Metadata
- clearly state what we're trying to understand## Investigation Question- Create headings:
,## Progress
,## Assumptions
,## File List
,## Knowledge Graph
,## Data Flow## Findings
-
Populate
with:## Progress- 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:
: Full pathfilePath
: Component classificationtype
: Design pattern usedarchitecturalPattern
: Purpose and logic summarycontent
: Classes, interfaces, methodssymbols
: Imports/using statementsdependencies
: Business logic contributionbusinessContext
: Files using this file's symbolsreferenceFiles
: 1-10 (to the investigation question)relevanceScore
: "verified" or "inferred"evidenceLevel
: Platform base classesplatformAbstractions
: Microservice ownershipserviceContext
Investigation-Specific Fields:
: How this code is triggered/calledentryPoints
: What this code produces/returnsoutputPoints
: How data is modifieddataTransformations
: External services, APIs, databases accessedexternalDependencies
: Config values, feature flags, settingsconfigurationDependencies
: Key decision points and branchesconditionalLogic
: What can go wrong, error handlingerrorScenarios
For Consumers/Message Bus:
: Message type consumedmessageBusMessage
: Who sends this message (grep across all services)messageBusProducers
: Cross-service data flowcrossServiceIntegration
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
- CQRS entry pointsPlatformCqrsQuery
- Side effectsPlatformCqrsEntityEventApplicationHandler
- Cross-service consumersPlatformApplicationMessageBusConsumer
/IPlatformQueryableRootRepository
- Data accessIPlatformQueryableRootRepository
- Validation logicPlatformValidationResult
- Authorization[PlatformAuthorize]
Frontend Patterns to Look For
- State management componentsAppBaseVmStoreComponent
- Store implementationsPlatformVmStore
/effectSimple
- Effect handlingtapResponse
- Loading/error statesobserverLoadingErrorState- API services extending
PlatformApiService
See Also
skill - For implementing new features (code changes)feature-implementation
skill - For debugging and fixing issuesbug-diagnosis
skill - Autonomous feature implementation varianttasks-feature-implementation
- Platform patterns and context.ai/prompts/context.md
- Codebase instructionsCLAUDE.md