name: explain-code-working description: Analyze and explain why a specific part of the code worked, tracing execution flow and dependencies. argument-hint: Provide the code snippet or describe the functionality that worked. agent: Explore
Workflow for Explaining Why Code Worked
Step 1: Identify the Code Component
- Locate the specific code snippet or feature in question.
- Understand the user's selection or description of what "worked".
Step 2: Gather Context
- Read the relevant source files to understand the codebase structure.
- Identify dependencies, imports, and related functions.
Step 3: Trace Execution Flow
- Follow the code path from user interaction to backend processing.
- Analyze state management, event handling, and data flow.
Step 4: Explain the Logic
- Break down how the code achieves its functionality.
- Highlight key design decisions that made it work.
- Note any assumptions or conditions required for success.
Step 5: Validate with Testing
- Run the code or check for existing tests to confirm behavior.
- Identify edge cases or potential failure points.
Quality Checks
- Ensure explanation covers all relevant files and functions.
- Verify that the explanation is accurate and complete.
- Suggest improvements if the code has limitations.