Skill

Trace code execution step-by-step for any input scenario

A Logic-Lens skill producing a step-by-step interprocedural execution trace of what code does for a given input.


71
Spark score
out of 100
Updated last month
Version 0.6.7

Add to Favorites

Why it matters

Help developers understand exactly what a piece of code does for a specific input by producing a detailed, interprocedural execution trace that resolves names, tracks type transitions, and highlights non-obvious behavior that explains unexpected results.

Outcomes

What it gets done

01

Resolve every non-obvious name and establish variable types at function entry

02

Generate numbered step-by-step traces that cross function boundaries when relevant

03

Identify hidden gotchas like implicit coercions, name resolutions, and side effects

04

Summarize the gap between what the code actually does versus what was assumed

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-logic-explain | bash

Overview

Logic-Lens - Execution Explain

This Logic-Lens skill produces a descriptive, step-by-step interprocedural execution trace of code behavior for one function and one input scenario, without Logic Score or L-code findings. Use it when a user is confused about why code produces a specific result for a specific input. Hands off to logic-review or logic-locate if a bug surfaces during tracing.

What it does

A Logic-Lens skill for execution explain: producing a step-by-step, interprocedural execution trace of what a specific piece of code actually does for a given input, including name resolution and type transitions. It uses lazy loading of shared reference docs (common.md for language, report header variants, scope routing, and loading budget; logic-explain-guide.md loaded step by step; semiformal-guide.md, semiformal-checklist.md, and report-template.md loaded on demand). Notably, logic-risks.md is intentionally skipped - this skill does not produce L-code findings and Remedy is explicitly out of scope. If the trace reveals a bug, the skill stops and recommends logic-review or logic-locate instead, and when handing off it preserves the premises already established and trace steps already completed under a "Partial trace context (carry into next skill):" heading so the user can pass that work directly into the follow-on skill rather than losing it. The process runs six steps: Step 0 detects language and confirms a single function plus a single input scenario is in scope, handing off to logic-review if the user wants bug-finding without a concrete scenario. Step 1 names the entry point function, the input scenario, and what the user is trying to understand. Step 2 builds premises by resolving every non-obvious name, stating the types of key variables at entry, and noting any global or module state accessed. Step 3 produces a numbered, interprocedural, active-voice trace, crossing function boundaries whenever relevant to the user's scenario while staying scenario-bound - it does not branch into alternative paths unless they explain the user's confusion. Step 4 highlights non-obvious behavior: name resolutions, implicit coercions, and hidden side effects - the gotchas a casual reader would miss. Step 5 summarizes actual behavior versus assumed behavior in one sentence each, which is described as the core value delivered to the user. The mode line in the report reads "Execution Explain" (执行解释 in Chinese), and because the mode is descriptive rather than evaluative, the report omits the Logic Score, Fault Confidence, and Verdict lines entirely.

When to use - and when NOT to

Use it when a user is confused about what code does for a specific input and asks to be walked through it - "walk me through this", or similar - for a single function and a single scenario. Hand off to logic-review instead if the user wants bug-finding without naming a concrete input scenario; hand off to logic-review or logic-locate if the trace itself surfaces a bug, since Remedy is out of scope here.

Inputs and outputs

Input is one function plus one concrete input scenario. Output is a numbered, interprocedural execution trace with resolved premises, a highlighted-gotchas section, and a one-sentence-each actual-versus-assumed summary - with no Logic Score, Fault Confidence, or Verdict line, and no L-code findings.

Integrations

Part of the Logic-Lens skill family, sharing ../_shared/common.md, ../_shared/semiformal-guide.md, ../_shared/semiformal-checklist.md, and ../_shared/report-template.md with sibling skills logic-review, logic-locate, and logic-diff, deliberately not loading logic-risks.md, and handing off partial trace context to logic-review or logic-locate when a bug surfaces mid-trace.

Who it's for

Developers who are confused about why code behaves a certain way for a specific input and need a descriptive, step-by-step walkthrough rather than a bug hunt or equivalence check.

Source README

Logic-Lens - Execution Explain

When to Use

Use this skill when you need explain what a specific piece of code actually does for a given input by producing a step-by-step execution trace (interprocedural, with name resolution and type transitions). Trigger when the user is confused about behavior or asks why code produces X instead of Y - "walk me through...

Setup

Use lazy loading per ../_shared/common.md §13:

  1. Read ../_shared/common.md only for language, report header variants, scope routing, and loading budget.
  2. Read only the relevant step in logic-explain-guide.md as you reach it.
  3. Load ../_shared/semiformal-guide.md, ../_shared/semiformal-checklist.md, and ../_shared/report-template.md on demand when the current step needs them.

Note: logic-risks.md is intentionally skipped - logic-explain does not produce L-code findings, and Remedy is intentionally out of scope for this mode. If the trace reveals a bug, stop and recommend logic-review or logic-locate. When handing off, do not discard work already done - present the premises established and trace steps completed under a "Partial trace context (carry into next skill):" heading so the user can pass them directly to the follow-on skill.

Process

Step 0. Language + scope routing. Detect language per common.md §1. Confirm a single function + a single input scenario. If the user wants bug-finding without a scenario, hand off to logic-review.

Step 1. Entry point and scenario (guide Step 1) - name the function, the input scenario, and what the user is trying to understand.

Step 2. Build premises (guide Step 2) - resolve every non-obvious name, state the types of key variables at entry, note global/module state accessed.

Step 3. Produce step-by-step trace (guide Step 3) - numbered, interprocedural, active voice; cross function boundaries whenever relevant to the user's scenario. Keep the trace scenario-bound; do not branch into alternative paths unless they explain the user's confusion.

Step 4. Highlight non-obvious behavior (guide Step 4) - name resolutions, implicit coercions, hidden side effects; the "gotchas" the casual reader would miss.

Step 5. Summarize actual vs. assumed (guide Step 5) - one sentence each; this is the core value for the user.

Mode line in report: Execution Explain (Chinese: 执行解释).

Note: Execution Explain is descriptive, not evaluative. Omit the Logic Score / Fault Confidence / Verdict line from the report header.

Limitations

  • Use this skill only when the task clearly matches its upstream source and local project context.
  • Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
  • Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.