Claude-skill-registry feature-investigation
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
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" ~/.claude/skills/majiayu000-claude-skill-registry-feature-investigation-aacb3c && rm -rf "$T"
manifest:
skills/data/feature-investigation/SKILL.mdsource content
Feature Investigation
READ-ONLY exploration skill for understanding existing features. No code changes.
Mode Selection
| Mode | Use When | Workflow |
|---|---|---|
| Interactive | User available, exploratory question | Real-time collaboration, iterative tracing |
| Autonomous | Deep analysis, complex cross-service tracing | Structured 4-phase workflow with analysis artifact |
Workflow
- Discovery - Search codebase for all files related to the feature/question. Prioritize: Entities > Commands/Queries > EventHandlers > Controllers > Consumers > Components.
- Knowledge Graph - Read and analyze each file. Document purpose, symbols, dependencies, data flow. Batch in groups of 10, update progress after each batch.
- Flow Mapping - Trace entry points through processing pipeline to exit points. Map data transformations, persistence, side effects, cross-service boundaries.
- Analysis - Extract business rules, validation logic, authorization, error handling. Document happy path and edge cases.
- Synthesis - Write executive summary answering the original question. Include key files, patterns used, and text-based flow diagrams.
- Present - Deliver findings using the structured output format. Offer deeper dives on subtopics.
⚠️ MUST READ Before Investigation
IMPORTANT: You MUST read these files before starting. Do NOT skip.
- ⚠️ MUST READ
— Assumption validation, evidence chains, context anchoring.claude/skills/shared/anti-hallucination-protocol.md - ⚠️ MUST READ
— Per-file analysis structure.claude/skills/shared/knowledge-graph-template.md
If preceded by
: Use Scout's numbered file list as analysis targets. Skip redundant discovery. Prioritize HIGH PRIORITY files first./scout
Investigation Techniques
Discovery Search Patterns
File Discovery by Feature Name
.*EventHandler.*{FeatureName}|{FeatureName}.*EventHandler .*BackgroundJob.*{FeatureName}|{FeatureName}.*BackgroundJob .*Consumer.*{FeatureName}|{FeatureName}.*Consumer .*Service.*{FeatureName}|{FeatureName}.*Service .*Component.*{FeatureName}|{FeatureName}.*Component
Priority Order for Analysis
- Domain Entities - Core business objects
- Commands/Queries - CQRS entry points (
,UseCaseCommands/
)UseCaseQueries/ - Event Handlers - Side effects (
,UseCaseEvents/
)*EventHandler.cs - Controllers - API endpoints (
,Controllers/
)*Controller.cs - Consumers - Cross-service (
,*Consumer.cs
)*BusMessage.cs - Background Jobs - Scheduled processing (
,*BackgroundJob*.cs
)*Job.cs - Components/Stores - Frontend (
,*.component.ts
)*.store.ts - Services/Helpers - Supporting logic (
,*Service.cs
)*Helper.cs
Dependency Tracing
Backend (C#)
| Looking for | Search pattern |
|---|---|
| Who calls this method | Grep method name across |
| Who injects this service | Grep interface name in constructors |
| What events this entity raises | Grep |
| Cross-service consumers | Grep type across all services |
| Repository usage | Grep or |
Frontend (TypeScript)
| Looking for | Search pattern |
|---|---|
| Who uses this component | Grep selector in |
| Who imports this service | Grep service class name in |
| Store effects chain | Trace -> API call -> -> state update |
| Route entry | Grep component name in |
Data Flow Mapping
Document flow as text diagram:
[Entry Point] --> [Step 1: Validation] --> [Step 2: Processing] --> [Step 3: Persistence] | v [Side Effect: Event]
Flow Documentation Checklist
- Entry Points - API endpoint, UI action, scheduled job, message bus
- Processing Pipeline - Step-by-step through handlers
- Data Transformations - How data changes at each step
- Persistence Points - Where data is saved/loaded
- Exit Points - Responses, events, side effects
- Cross-Service Flows - Message bus boundaries
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 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 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 Pattern Recognition
Backend Patterns
/PlatformCqrsCommand
- CQRS entry pointsPlatformCqrsQuery
- Side effectsPlatformCqrsEntityEventApplicationHandler
- Cross-service consumersPlatformApplicationMessageBusConsumer
- Data accessIPlatformQueryableRootRepository
- Validation logicPlatformValidationResult
- Authorization[PlatformAuthorize]
Frontend Patterns
- State management componentsAppBaseVmStoreComponent
- Store implementationsPlatformVmStore
/effectSimple
- Effect handlingtapResponse
- Loading/error statesobserverLoadingErrorState- API services extending
PlatformApiService
Evidence Collection
Analysis File Setup
Autonomous mode writes analysis to
.ai/workspace/analysis/[feature-name]-investigation.md with:
## Metadata > Original question: [user's exact question] ## Investigation Question [Clearly stated investigation goal] ## Progress - **Phase**: 1 - **Items Processed**: 0 / [total] - **Current Focus**: [original question] ## File List [All discovered files, grouped by priority] ## Knowledge Graph [Per-file analysis entries - see template below] ## Data Flow [Flow diagrams and pipeline documentation] ## Findings [Populated in Phase 2+]
Per-File Analysis Entry
For each file, document in
## Knowledge Graph:
Core Fields
: Full pathfilePath
: Component classification (Entity, Command, Handler, Controller, Component, Store, etc.)type
: Design pattern usedarchitecturalPattern
: Purpose and logic summarycontent
: Key classes, interfaces, methodssymbols
: Imports/injectionsdependencies
: 1-10 (to investigation question)relevanceScore
: "verified" or "inferred"evidenceLevel
Investigation-Specific Fields
: How this code is triggered/calledentryPoints
: What this code produces/returnsoutputPoints
: How data is modifieddataTransformations
: Key decision points and branchesconditionalLogic
: What can go wrong, error handlingerrorScenarios
: External services, APIs, databasesexternalDependencies
Cross-Service Fields (if applicable)
: Message type consumed/producedmessageBusMessage
: Who sends this messagemessageBusProducers
: Cross-service data flowcrossServiceIntegration
Rule: After every 10 files, update progress and re-check alignment with original question.
Structured Findings Format
Phase 2: Comprehensive Analysis
Workflow Analysis
- Happy Path - Normal successful execution flow
- Error Paths - How errors are handled at each stage
- Edge Cases - Special conditions
- Authorization - Permission checks
- Validation - Input validation at each layer
Business Logic Extraction
- Core Business Rules - What rules govern this feature
- State Transitions - Entity state changes
- Side Effects - Notifications, events, external calls
Phase 3: Synthesis
Executive Summary
- One-paragraph answer to user's question
- Top 5-10 key files
- Key patterns used
Detailed Explanation
- Step-by-step walkthrough with
referencesfile:line - Architectural decisions explained
Diagrams
+-----------+ +-----------+ +-----------+ | Component |---->| Command |---->| Handler | +-----------+ +-----------+ +-----------+ | v +-----------+ |Repository | +-----------+
Output Format
## Answer [Direct answer in 1-2 paragraphs] ## How It Works ### 1. [Step] - [Explanation with `file:line` reference] ### 2. [Step] - [Explanation with `file:line` reference] ## Key Files | File | Purpose | | ---- | ------- | ## Data Flow [Text diagram: Entry -> Processing -> Persistence -> Side Effects] ## Want to Know More? - [Subtopic 1] - [Subtopic 2]
Guidelines
- Evidence-based: Every claim needs code evidence. Mark unverified claims as "inferred".
- Question-focused: Tie all findings back to the original question.
- Read-only: Never suggest changes unless explicitly asked.
- Layered explanation: Start simple, offer deeper detail on request.
Related Skills
- Implementing new features (code changes)feature-implementation
- Debugging and fixing issuesdebugging
- Quick codebase discovery (run before investigation)scout
IMPORTANT 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