Agent skill
logic-flow
Explain a function's logic step-by-step by analyzing its implementation and call graph. Use when the user asks "how does this work", "walk me through this", or wants to understand control flow and decision points.
Install this agent skill to your Project
npx add-skill https://github.com/anortham/julie/tree/main/.claude/skills/logic-flow
SKILL.md
Logic Flow
Explain the logic flow of a function by examining its implementation, control flow, and callees.
Process
Step 0: Orient (Optional)
If the function is in an unfamiliar area, get context first:
get_context(query="<function_name or related concept>")
This shows the function's neighbors and where it fits in the broader architecture.
Step 1: Deep Dive with Full Depth
deep_dive(symbol="<function>", depth="full")
This returns the function's code body, callers, callees, and type information.
If deep_dive returns the wrong symbol (common names), use context_file to disambiguate:
deep_dive(symbol="<function>", depth="full", context_file="<partial_file_path>")
Step 2: Analyze the Code
Read through the function body and identify:
- Entry: Function signature, parameters, what they represent
- Guard clauses: Early returns, validation, error checks at the top
- Setup: Variable initialization, resource acquisition
- Core logic: The main processing — what does this function actually DO?
- Control flow: Branches (if/else, match), loops, error handling (? operator, try/catch)
- Callees: What other functions are called and why
- Return: What value is produced and what it means
Step 3: Write Step-by-Step Explanation
Function: <name> (<file>:<line>)
Purpose: <1-sentence summary of what this function does>
Parameters:
- param1: Type — what it represents
- param2: Type — what it represents
Logic Flow:
1. Validates input: checks X and Y, returns early with error if invalid
2. Acquires database lock via get_connection()
3. Fetches matching symbols from database (calls fetch_symbols)
4. If query is provided:
a. Builds Tantivy search query
b. Searches index for matches (calls search_index)
c. Ranks results by BM25 score
5. Otherwise: returns all symbols sorted by name
6. Formats results into CallToolResult and returns
Key Callees:
- fetch_symbols(): Retrieves symbols from SQLite by workspace ID
- search_index(): Runs Tantivy full-text search with code tokenizer
Error Handling:
- Returns Err if workspace not initialized
- Logs warning and continues if individual file parsing fails
Returns: Result<CallToolResult> — MCP response with formatted search results
Important Notes
- Don't just repeat the code — explain the WHY, not just the WHAT
- Focus on the interesting parts — skip boilerplate, highlight decisions
- For large functions (>100 lines): Summarize sections rather than explaining every line
- For trait methods: Note which implementations exist and which is being analyzed
- Reference workspaces: Pass
workspace: "<workspace_id>"to all tool calls when analyzing a non-primary workspace
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
metrics
Show Julie operational metrics -- session stats, tool usage, context efficiency, and historical trends. Use when the user asks about Julie's performance, how it's doing, how much context was saved, or wants a metrics/stats report.
architecture
Generate an architecture overview — key entry points, module map, dependency flow, and suggested reading order. Use when the user is new to a codebase, asks "how does this work?", wants an architecture overview, or needs onboarding documentation.
dependency-graph
Show module dependencies by analyzing imports, exports, and cross-references. Use when the user asks what a file imports, what depends on a module, or wants to see dependency structure.
search-debug
Diagnose why a search returns unexpected results — analyze scoring factors, tokenization, and index health for dogfooding Julie's search quality. Use when a Julie search misses an expected symbol, returns wrong results, ranks something surprisingly low, or when investigating search quality issues during development.
impact-analysis
call-trace
Trace the call path between two functions by following callers/callees. Use when the user asks how function A reaches function B, wants to see connections between symbols, or asks "what calls what."
Didn't find tool you were looking for?