code-slice-explainer
Code Slice Explainer
Use this skill when the user wants one bounded walkthrough of how part of a system works from start to finish. The canonical term is slice.
Purpose
- Explain one slice end to end without dropping meaningful steps.
- Start with the incoming data shape, what it represents, who sends it, and why it enters the flow.
- Walk the execution path in order, including boundaries, branch points, shared versus specialized steps, and data transformations.
- End with the final output shape, who receives it, and what purpose it serves.
- Let the user control explanation density with a detail level, not by silently skipping steps.
Canonical vocabulary
slice: one bounded end-to-end walkthrough of a request, event, feature action, job, or data item.data shape: the meaningful structure of the data at a point in the slice, what it represents, and why it has that shape.boundary: a meaningful crossing such as caller/callee, module, package, process, service, client/server, queue, storage, or external API.branch point: any step that can route execution down different paths.
Treat pipeline, execution flow, request lifecycle, data flow, trace, and walkthrough as compatibility language for the same underlying workflow unless the user clearly means something else.
Inputs
- The slice subject:
- a feature
- a request or event
- a job or workflow
- a specific datum moving through code
- a code entrypoint or path to follow
- Optional detail level:
quickstandardthorough
- Optional focus:
- branch-heavy
- data-shape-heavy
- boundary-heavy
- debugging-oriented
- Optional comparison target for
compare slices
Use standard when no detail level is specified.
Primary workflow: explain a slice
- Identify the slice trigger or entrypoint.
- Explain the incoming data first:
- what shape it has
- what it represents
- who is sending or constructing it
- why it is entering the slice
- Walk the slice in strict execution order from start to finish.
- For each meaningful step, explain:
- where it happens
- what responsibility it has
- whether it is shared or specialized
- whether it crosses a boundary
- whether it branches
- whether the data shape changes
- why any transformation exists
- End with the output or return path:
- final shape
- final destination
- why that result is consumed there
- Include a simple step diagram with markers for branch points and data-shape changes.
- Add short notes for those markers so the diagram stays readable.
Variant workflow: compare slices
Use this when the user wants to compare:
- two related slices
- two implementations of the same slice
- old versus new behavior
- two branches within one slice
First explain each slice clearly enough to stand on its own. Then compare:
- trigger differences
- data-shape differences
- execution-order differences
- boundary differences
- branch differences
- output differences
- why the two paths diverge
Treat comparison requests as first-class trigger cases, not as an advanced follow-up.
Detail levels
quick: keep each step brief, but still include every meaningful step in order.standard: default density for most walkthroughs.thorough: add fuller commentary for branch behavior, boundaries, contracts, and why each transformation exists.
The detail level changes explanation density only. It must not remove meaningful steps from the slice.
Output contract
Return a structured narrative in this order:
Slice summaryWalkthroughDiagramNotes
The writing should stay conversational and narrative-first. Avoid sterile dumps, but do not skip steps for brevity.
Guardrails
- Never silently collapse or omit meaningful steps in the requested slice.
- Do not replace the end-to-end walkthrough with only a component map or only a high-level summary.
- If the path is ambiguous, say where the ambiguity starts and explain the most likely path plus the alternate branch.
- If a step cannot be proven from the code, say that plainly instead of guessing.
- Prefer concrete file/function references when available.
- Keep branch and data-shape notes short and move clutter out of the main narrative when a marker note will do.
Validation
- Validate the skill with
uv run --group dev python /Users/galew/.codex/skills/.system/skill-creator/scripts/quick_validate.py skills/code-slice-explainer. - Keep
agents/openai.yamlaligned with the final trigger wording in this skill. - Use
references/trigger-eval.mdto audit whether the description is broad enough to catch natural phrasing and comparison requests.
References
- Output contract:
references/output-contract.md - Detail levels:
references/detail-levels.md - Diagram rules:
references/diagram-format.md - Comparison workflow:
references/comparison-workflow.md - Example prompts:
references/example-prompts.md - Trigger evaluation prompts:
references/trigger-eval.md
More from gaelic-ghost/productivity-skills
project-workspace-cleaner
Scan workspace repositories for cleanup opportunities using a read-only hygiene audit. Use when users ask to detect build/cache artifact buildup, stale large transient files, and prioritized cleanup chores by repository and directory.
161project-docs-maintainer
Maintain `*-skills` README standards and checklist-style roadmap docs through one canonical maintenance entrypoint. Use when a repo needs profile-aware README maintenance, checklist roadmap validation or migration, or a bounded audit-first doc workflow with Markdown and JSON reporting.
66things-digest-generator
Generate a week-ahead Things planning digest with recent activity, upcoming deadlines, and concrete next actions. Use when users request Things check-ins, weekly planning summaries, or prioritized planning recommendations.
28things-reminders-manager
Manage Things reminders and todo create/update requests with a deterministic MCP workflow that prevents duplicate tasks and date mistakes. Use when users ask to add, reschedule, or correct Things reminders, especially with relative dates or potential update-vs-create ambiguity.
13speak-with-profile
Profile-aware speech workflow for narrated notes, spoken drafts, audio summaries, accessibility reads, and other text-to-speech tasks. Use when one front-door workflow should resolve voice profiles, enforce disclosure, and apply manifest tracking before delegating to built-in `$speech` or a deterministic local CLI path.
12project-roadmap-manager
Create and maintain a repository-root ROADMAP.md as the single source of truth for project milestones and accepted plans. Use when bootstrapping any new project, accepting/completing a plan, defining or updating milestone/version roadmaps, marking milestones as reached/changed/de-scoped, or answering where roadmap and milestone status should be referenced.
12