Awesome-omni-skill feature-investigation
[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/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/product/feature-investigation" ~/.claude/skills/diegosouzapw-awesome-omni-skill-feature-investigation && rm -rf "$T"
skills/product/feature-investigation/SKILL.md[IMPORTANT] Use
to break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI may ask user whether to skip.TaskCreate
Quick Summary
Goal: Investigate and explain how existing features or logic work through READ-ONLY code exploration -- no modifications.
MANDATORY IMPORTANT MUST Plan ToDo Task to READ the following project-specific reference doc:
-- project patterns and structureproject-structure-reference.mdIf file not found, search for: project documentation, coding standards, architecture docs.
Workflow:
- Setup — Create analysis file, define investigation scope and metadata
- Discovery (Phase 1A) — Glob/Grep to find all relevant files across backend and frontend
- Deep Analysis (Phase 1B) — Read each file, build knowledge graph of relationships
- Synthesis (Phase 2) — Map workflows, integration points, data flows, business logic
- Report — Present findings with evidence chains and code references
Key Rules:
- READ-ONLY: never modify code, only explore and explain
- Every claim must have code evidence (no speculation or hallucination)
- Use anti-hallucination protocols: validate assumptions, chain evidence, anchor to original question
- Re-read original question every 10 operations to prevent context drift
Skill Variant: READ-ONLY exploration - no code changes. For implementing features, use
. For debugging, usefeature-implementation.debug
Feature Investigation & Logic Exploration
Investigate and explain how existing features or logic work as an expert full-stack .NET/Angular architect.
KEY PRINCIPLE: READ-ONLY investigation. Build understanding and explain how things work.
Investigation Mindset (NON-NEGOTIABLE)
Be skeptical. Apply critical thinking. Every claim needs traced proof.
- Do NOT assume code works as named — verify by reading actual implementations
- Every finding must include
evidence (grep results, read confirmations)file:line - If you cannot prove a claim with a code trace, mark it as "inferred" with low confidence
- Question assumptions: "Does this actually do what I think?" → read the implementation, not just the signature
- Challenge completeness: "Is this all?" → grep for related usages, consumers, and cross-service references
- Verify relationships: "Does A really call B?" → trace the actual call path with evidence
- No "looks like it works" without proof — state what you verified and how
⚠️ MANDATORY: Confidence & Evidence Gate
MUST declare
Confidence: X% with evidence list + file:line proof for EVERY finding.
95%+ verified fact | 80-94% with caveats | 60-79% "partially verified" | <60% "inferred — needs verification", NOT fact.
IMPORTANT: Always use TaskCreate to plan step-by-step tasks.
Prerequisites
⚠️ CRITICAL: Read all protocol sections below before starting investigation.
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"
Analysis File Structure
Create at
.ai/workspace/analysis/[feature-name]-investigation.analysis.md:
## Metadata **Original Prompt:** [Full original question/prompt] **Task Description:** [Parsed investigation question] **Investigation Scope:** [What needs to be understood] **Source Code Structure:** - Backend: services directory/{ServiceA,ServiceB,ServiceC}/ - Frontend: frontend directory/apps/, frontend directory/libs/ - Platform: framework directory/ ## Progress - **Phase**: 1A - **Items Processed**: 0 - **Total Items**: 0 - **Current Operation**: "initialization" - **Current Focus**: "[original task summary]" ## Errors [Track all errors encountered during analysis] ## Assumption Validations [Document all assumptions and their validation status] ## Performance Metrics [Track operation times and efficiency] ## Memory Management [Track context usage and optimization strategies] ## Processed Files [Numbered list of processed files with status] ## File List [Complete numbered list of all discovered files - populated during discovery] ## Knowledge Graph [Detailed analysis of each file - populated during Phase 1B] ## Workflow Analysis [End-to-end workflow documentation] ## Integration Points [Cross-service and cross-component integration analysis] ## Business Logic Mapping [Complete business logic workflows and rules] ## Data Flow Analysis [How data flows through the system] ## Platform Pattern Usage [Documentation of platform patterns used]
File Discovery Search Patterns
# Domain Entities (HIGH PRIORITY) grep: "class.*{EntityName}.*:.*RootEntity|RootAuditedEntity" # Commands & Queries (HIGH PRIORITY) grep: ".*Command.*{EntityName}|{EntityName}.*Command" grep: ".*Query.*{EntityName}|{EntityName}.*Query" # Event Handlers (HIGH PRIORITY) grep: ".*EventHandler.*{EntityName}|{EntityName}.*EventHandler" # Controllers (HIGH PRIORITY) grep: ".*Controller.*{EntityName}|{EntityName}.*Controller" # Background Jobs (MEDIUM PRIORITY) grep: ".*BackgroundJob.*{EntityName}|{EntityName}.*BackgroundJob" # Message Bus Consumers (MEDIUM PRIORITY) grep: ".*Consumer.*{EntityName}|{EntityName}.*Consumer" grep: "PlatformApplicationMessageBusConsumer.*{EntityName}" # Services & Helpers (LOW PRIORITY) grep: ".*Service.*{EntityName}|{EntityName}.*Service" grep: ".*Helper.*{EntityName}|{EntityName}.*Helper" # Frontend Components & Stores (HIGH PRIORITY) grep: "{feature-name}" in **/*.{ts,html} grep: ".*Store.*{FeatureName}|{FeatureName}.*Store" grep: ".*Component.*{FeatureName}|{FeatureName}.*Component"
File List Organization
## File List ### High Priority - Core Logic (MUST ANALYZE FIRST) 1. [Domain Entity path] 2. [Command/Query Handler path] 3. [Event Handler path] 4. [Controller path] 5. [Frontend Component path] ... ### Medium Priority - Supporting Infrastructure 10. [Background Job path] 11. [Consumer path] 12. [API Service path] ... ### Low Priority - Configuration/Utilities 20. [Helper path] 21. [Utility path] ... **Total Files**: [count]
Knowledge Graph Entry Template
For each file, document:
### {ItemNumber}. {FilePath} **File Analysis:** - **filePath**: Full path to the file - **type**: Entity | Command | Query | EventHandler | Controller | BackgroundJob | Consumer | Component | Store | Service | Helper - **architecturalPattern**: CQRS | Repository | Event-Driven | Component-Store | etc. - **content**: Summary of purpose and logic - **symbols**: Important classes, interfaces, methods - **dependencies**: All imported modules or `using` statements - **businessContext**: What business problem, rules, contribution to feature - **referenceFiles**: Other files that use this file's symbols - **relevanceScore**: 1-10 for current investigation - **evidenceLevel**: "verified" or "inferred" - **uncertainties**: Aspects you are unsure about - **platformAbstractions**: Platform base classes used - **serviceContext**: Which microservice (ServiceB, ServiceA, ServiceC) - **dependencyInjection**: DI registrations - **genericTypeParameters**: Generic type relationships **Message Bus Analysis (FOR CONSUMERS ONLY):** - **messageBusMessage**: Message type consumed - **messageBusProducers**: Files that publish this message (MUST grep across ALL services) - **crossServiceIntegration**: Cross-service data flow description **Targeted Aspect Analysis:** **For Frontend Components:** - `componentHierarchy`, `routeConfig`, `routeGuards`, `stateManagementStores` - `dataBindingPatterns`, `validationStrategies`, `apiIntegration`, `userInteractionFlow` **For Backend Components:** - `authorizationPolicies`, `commands`, `queries`, `domainEntities` - `repositoryPatterns`, `businessRuleImplementations`, `eventHandlers`, `backgroundJobs` **For Consumer Components:** - `messageBusMessage`, `messageBusProducers`, `crossServiceIntegration` - `handleLogicWorkflow`, `dependencyWaiting` **Code Examples:** ```csharp // Include relevant code snippets that demonstrate key logic ```
Key Insights:
[Important observations about this file's role in the overall feature]
--- ## Overall Analysis Template ```markdown ## Overall Analysis ### 1. Complete End-to-End Workflows Discovered **Workflow: {Feature Name} - Main Flow**
[User Action] -> [Frontend Component] -> [API Service] -> [Controller] | [Command/Query Handler] | [Domain Entity] -> [Repository] | [Event Handler] -> [Side Effects]
**Detailed Flow:** 1. **Frontend Entry Point**: `Component.ts:line` - User interaction, validation, API call 2. **API Layer**: `Controller.cs:line` - Endpoint, authorization, command dispatch 3. **Application Layer**: `CommandHandler.cs:line` - Validation, business logic, repository ops 4. **Domain Layer**: `Entity.cs:line` - Business rules, state changes, domain events 5. **Event Handling**: `EventHandler.cs:line` - Events handled, side effects, integrations 6. **Cross-Service**: `Consumer.cs:line` - Message consumed, producer service, sync logic ### 2. Key Architectural Patterns and Relationships - **CQRS**: Commands, queries, separation of concerns - **Event-Driven**: Domain events, handlers, message bus - **Repository**: Repositories used, query builders, extensions - **Frontend**: Component hierarchy, state management, forms ### 3. Business Logic Workflows Frontend-to-backend flow tree and cross-service integration flow. ### 4. Integration Points and Dependencies API endpoints, message bus integration, database dependencies, external services. ### 5. Business Rules Discovered Validation rules, business constraints, authorization rules. ### 6. Platform Pattern Usage Backend: CQRS, repository, event handlers, message bus, background jobs, validation Frontend: Component hierarchy, stores, forms, API services, reactive patterns ### 7. Key Insights and Observations Critical findings, recommendations, uncertainties requiring clarification.
Presentation Template
## 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]
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
/service-specific repository
- Data accessservice-specific repository
- Validation logicPlatformValidationResult
- Authorization[PlatformAuthorize]
Frontend Patterns to Look For
- State management componentsproject store component base (search for: store component base class)
- Store implementationsproject store base (search for: store base class)
/effectSimple
- Effect handlingtapResponse
- Loading/error statesobserverLoadingErrorState- API services extending
PlatformApiService
Investigation Flow
Phase 1A: Initialize & Discover
- Create analysis file at
.ai/workspace/analysis/[feature-name]-investigation.analysis.md- Use the Analysis File Structure template above
- Search for all related files using grep patterns organized by priority
- Use the File Discovery Search Patterns above
- Save all discovered paths as numbered list under
, organized by priority## File List - Update
count inTotal Items## Progress
Phase 1B: Knowledge Graph Construction
- Count total files, split into batches of 10 (priority order)
- Insert batch analysis tasks into todo list
- For each file, document in
## Knowledge Graph- Use the Knowledge Graph Entry Template above
- Every 10 files: Update progress, run CONTEXT_ANCHOR_CHECK
Phase 1C: Overall Analysis
After ALL files analyzed, write comprehensive analysis:
- End-to-end workflows, architectural patterns, business logic
- Integration points, business rules, platform patterns, key insights
- Use the Overall Analysis Template above
Phase 2: Presentation
Present findings in clear format with: Answer, How It Works (with code refs), Key Files table, Data Flow diagram, "Want to Know More?" topics.
- Use the Presentation Template above
Anti-Hallucination Protocols (Investigation-Specific)
Prerequisites: MUST READ
.claude/skills/shared/understand-code-first-protocol.md and .claude/skills/shared/evidence-based-reasoning-protocol.md before executing.
Investigation Guidelines
- Evidence-based: Every claim must have code evidence
- Service boundary awareness: Understand which service owns what
- Platform pattern recognition: Identify platform framework 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
See Also
- For implementing new features (code changes)feature-implementation
- For debugging and fixing issuesdebug
- For creating implementation plansplanning
References
Note: All content from
references/investigation-protocols.md has been merged into this skill file above. The reference file is kept for historical purposes.
| File | Contents |
|---|---|
| (Archived - content merged into this skill file) |
Task Planning Notes
- Always plan and break work into many small todo tasks
- Always add a final review todo task to verify work quality and identify fixes/enhancements