一键导入
explain
Deep-dive explanation of how a specific file, feature, or data flow works. Triggers: "explain", "how does X work", "walk me through", "what does this do".
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Deep-dive explanation of how a specific file, feature, or data flow works. Triggers: "explain", "how does X work", "walk me through", "what does this do".
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Systematic UI workflow auditing for SwiftUI applications. Discovers entry points, traces user flows, detects dead ends and broken promises, audits data wiring, evaluates from user perspective. Triggers: "workflow audit", "audit flows", "find dead ends", "check navigation".
Mine for hidden bugs that pattern-based auditors miss. 7 analysis lenses: assumptions, state machines, boundary conditions, data lifecycle, error paths, time-dependent behavior, and platform divergence. Triggers: "prospect for bugs", "find hidden bugs", "assumption audit", "what could go wrong", "bug prospector".
Epic decomposition into trackable, right-sized tasks. Three modes — audit-aware (codebase-audit reports), workflow-audit-aware (handoff.yaml with pre-rated findings), standalone (from scratch). Light convention scanning for projects without CLAUDE.md.
Systematic UI workflow auditing for SwiftUI applications. Discovers entry points, traces user flows, detects dead ends and broken promises, evaluates from user perspective.
Sync website content with app codebase - features, changelog, FAQ, docs. Triggers: "update website", "sync website", "website sync".
Display list of all available custom commands for this project
| name | explain |
| description | Deep-dive explanation of how a specific file, feature, or data flow works. Triggers: "explain", "how does X work", "walk me through", "what does this do". |
| version | 2.1.0 |
| author | Terry Nyberg |
| license | MIT |
| allowed-tools | ["Read","Grep","Glob","LSP","Bash","Write","AskUserQuestion"] |
| metadata | {"tier":"reference","category":"analysis"} |
Quick Ref: Deep-dive explanation with code walkthrough. Output:
.agents/research/YYYY-MM-DD-explain-{topic}.md
YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it.
git status --short
If uncommitted changes exist:
AskUserQuestion with questions:
[
{
"question": "You have uncommitted changes. Commit before proceeding?",
"header": "Git",
"options": [
{"label": "Commit first (Recommended)", "description": "Save current work so you can revert if this skill modifies files"},
{"label": "Continue without committing", "description": "Proceed — I accept the risk"}
],
"multiSelect": false
}
]
If "Commit first": Ask for a commit message, stage changed files, and commit. Then proceed.
If the user provides a file path, read it directly. If they provide a feature or concept name, find the relevant code:
# Find files by name
Glob pattern="**/*FeatureName*.swift"
# Find files that mention the feature/concept
Grep pattern="FeatureKeyword" glob="**/*.swift" output_mode="files_with_matches"
# Find the entry point (view, view model, manager)
Grep pattern="struct.*FeatureName.*View|class.*FeatureName" glob="**/*.swift" output_mode="content"
Read every relevant file — don't explain code you haven't read.
After reading the code, document:
What it is: [One paragraph summary — what this code does]
Why it exists: [The problem it solves or user need it fulfills]
Where it lives: [File paths, module/directory]
Identify the main types, protocols, and functions:
# List types defined in the target directory
Grep pattern="^(class|struct|enum|protocol|actor)\s+\w+" glob="**/*.swift" output_mode="content"
Present as a table:
| Component | Purpose | Location |
|---|---|---|
ItemDetailViewModel | Manages item display and editing state | Sources/Features/ItemDetail/ItemDetailViewModel.swift |
ItemDetailView | SwiftUI view for displaying item details | Sources/Features/ItemDetail/ItemDetailView.swift |
Trace the execution flow step by step. For each step, reference the actual code:
1. User taps item in list → ItemListView.swift:45
NavigationLink triggers with selected item
2. ItemDetailView initializes → ItemDetailView.swift:12
Creates ItemDetailViewModel with the item
3. View model loads data → ItemDetailViewModel.swift:28
.task modifier calls loadItemDetails()
4. Details populated → ItemDetailViewModel.swift:35
@Published properties updated, view re-renders
Use LSP for tracing definitions and references when available:
LSP operation="goToDefinition" filePath="path/to/file.swift" line=45 character=12
LSP operation="findReferences" filePath="path/to/file.swift" line=28 character=10
Show how data moves between components:
[User Tap]
↓
ItemListView (NavigationLink)
↓ passes Item
ItemDetailView (creates view model)
↓ item reference
ItemDetailViewModel (@Published properties)
↓ async load
NetworkService.fetchDetails(item.id)
↓ returns DetailResponse
ItemDetailViewModel.details = response
↓ @Published triggers
ItemDetailView re-renders with details
# Find imports
Grep pattern="^import " path="<target_file>" output_mode="content"
# Find injected dependencies
Grep pattern="init\(" path="<target_file>" output_mode="content"
# Find all files that reference this type
Grep pattern="TypeName" glob="**/*.swift" output_mode="files_with_matches"
Depends on: [list with file paths]
Depended on by: [list with file paths]
Look for:
| Scenario | Behavior | Notes |
|---|---|---|
| Item has no category | Shows "Uncategorized" | Nil coalescing at ViewModel.swift:34 |
| Network timeout | Shows cached data | Falls back to SwiftData query |
| Empty search results | Shows empty state view | Handled by ContentUnavailableView |
# When was this code written/last changed?
git log --oneline -5 -- "path/to/file.swift"
# Who authored the key implementation?
git log --format="%h %ai %s" -3 -- "path/to/file.swift"
Display the full explanation inline (overview, components, flow, data flow, dependencies, edge cases) so the user sees results immediately.
Then write to .agents/research/YYYY-MM-DD-explain-{topic}.md for future reference.
Include a "Quick Reference" section at the end:
## Quick Reference
**To modify this feature:** Start at [primary file], the entry point is [function/view]
**To debug issues:** Check [key file:line] where [critical logic happens]
**To add tests:** Mock [protocol] and test [key methods]
AskUserQuestion with questions:
[
{
"question": "Would you like to explore further?",
"header": "Next",
"options": [
{"label": "Trace a specific path", "description": "Follow a particular code path in more detail"},
{"label": "Generate tests", "description": "Create tests for this feature based on the explanation"},
{"label": "Explanation is sufficient", "description": "No further questions"}
],
"multiSelect": false
}
]
| Problem | Solution |
|---|---|
| Can't find the feature | Try broader search: Grep pattern="keyword" glob="**/*.swift" |
| Feature spans many files | Start from the View, trace to ViewModel, then to Services |
| Code uses unfamiliar pattern | Explain the pattern inline — the user may not know it either |
| LSP not available | Fall back to Grep for finding references and definitions |