code-flow
Skill0 starsChanged 3 months agoMITView on GitHub
Turn real code into a compact, code-level text flow that aligns calls, states, ownership, branches, and causal propagation inside one `text` code block. Use this skill whenever the user asks how code flows, requests a lifecycle or dependency/data/event propagation explanation, wants a call chain or state transition mapped, asks for a compact architecture/workflow summary grounded in a repository, or says the explanation is too fragmented and wants the key lines arranged vertically. Prefer it even when the user does not say “diagram.” Do not use it for branch diff summaries or graphical HTML/SVG diagrams.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- HeTPort/skillstheir own version, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- HeTPort/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 14 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
When a repository is available:
- Distinctive: line 32
Verify important claims against code or discriminating tests.
- Very specific: line 34
Use actual symbol names such as Load, refresh, epoch, or Dispose.
- Very specific: line 36
If code is unavailable, say // inferred or // assumption on the uncertain line instead of presenting it as verified.
- Distinctive: line 52
Do not create one section per function.
- Distinctive: line 79
Put a consequence below its trigger.
- Distinctive: line 83
Use this shape unless the user explicitly asks for another format:
- Distinctive: line 142
Prefer concrete names over generic narration.
- Distinctive: line 143
Keep one line to one important action or consequence.
- Very specific: line 144
Use short inline comments only when timing is crucial: // notify after active.
- Distinctive: line 145
Put paired contrasts together: active/inactive, owner/child, snapshot/live, success/error.
- Distinctive: line 147
Keep branches shallow; split into another phase when indentation becomes hard to scan.
- Distinctive: line 156
When code derives a child context, group, or scope, state explicitly whether that also changes service lookup or isolation.
- Distinctive: line 158
Before finalizing, check every contrast named by the user and give each one an explicit line in the flow.
- Distinctive: line 159
Call out synchronous versus queued/concurrent transitions.
- Distinctive: line 174
When asked to persist the result:
- Very specific: line 176
create a focused Markdown file such as docs/<topic>-flow.md.
- Very specific: line 177
keep the title outside and the complete explanation in one text block.
- Distinctive: line 178
add it to an existing documentation index if one exists.
- Very specific: line 181
when the bundled script is available, run python scripts/validate_output.py <file>.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Flow
Explain code as one compact causal map rather than scattered prose.
Goal
Make a reader able to trace, at a glance:
- where the flow enters;
- which concrete functions or modules run next;
- which state or ownership changes occur;
- what triggers each branch;
- how effects propagate downstream;
- how cleanup, failure, or concurrency changes the path.
The output is not merely an ASCII restatement of prose. It is a compressed model of the implementation.
Evidence first
When a repository is available:
- Locate the public entry point and the internal implementation it delegates to.
- Trace calls until the flow reaches a stable outcome, boundary, or cleanup path.
- Inspect the data structures carrying state, identity, ownership, or dependencies.
- Inspect error, disposal, retry, and concurrency paths when they affect semantics.
- Verify important claims against code or discriminating tests.
Use actual symbol names such as Load, refresh, epoch, or Dispose. Do not invent steps to make the diagram look complete.
If code is unavailable, say // inferred or // assumption on the uncertain line instead of presenting it as verified.
Choose the axes
Most requests need only two to five sections. Select the axes that explain causality:
- entry and registration;
- main execution path;
- state machine;
- ownership and lifetime;
- dependency, event, or data propagation;
- failure and retry;
- concurrency and convergence;
- cleanup and terminal state;
- core invariants and implementation files.
Do not create one section per function. Combine adjacent calls that serve one phase.
Build the causal chain
Arrange the happy path vertically first:
entry()
↓
resolve()
↓
apply()
↓
stable stateThen add branches exactly where their conditions diverge:
resolve()
├─ dependency missing → pending
└─ dependency ready
└─ run()
├─ error → cleanup → failed
└─ success → activePut a consequence below its trigger. Avoid placing related facts in separate paragraphs where the reader must reconnect them.
Output contract
Use this shape unless the user explicitly asks for another format:
- An optional short Markdown title.
- Exactly one fenced
textcode block containing all substantive explanation. - Phase headings written as
【阶段名称】. - Aligned
│,├─,└─,↓, and→connectors. - Important calls, states, identities, and consequences on their own vertical lines.
- A final
【核心关系】or【核心不变量】section when it clarifies the model. - A compact
核心实现list when repository files were inspected.
Example skeleton:
【入口与装配】
PublicEntry()
└─ internalEntry()
├─ 建立 state
├─ 固定 owner
└─ start()
↓
【主流程】
start()
└─ resolve()
├─ 条件 A → pending
└─ 条件 B
└─ apply()
├─ error → rollback
└─ success → active
【传播与回收】
state change
└─ notify()
└─ dependent.refresh()
└─ re-resolve → reload
owner.Dispose()
└─ effects newest-first
└─ child.Dispose()
【核心不变量】
identity
└─ 决定是否复用
generation
└─ 决定是否重载
核心实现
├─ entry.go → 入口与装配
├─ runtime.go → 状态与迁移
└─ cleanup.go → 所有权与回收Compression rules
- Prefer concrete names over generic narration.
- Keep one line to one important action or consequence.
- Use short inline comments only when timing is crucial:
// notify after active. - Put paired contrasts together: active/inactive, owner/child, snapshot/live, success/error.
- State what does not happen when it prevents a common misunderstanding.
- Keep branches shallow; split into another phase when indentation becomes hard to scan.
- End after the reader can reconstruct the lifecycle. Do not repeat the whole diagram in prose.
Accuracy rules
- Distinguish notification from the state change that actually drives propagation.
- Distinguish structural parent/child ownership from dependency edges.
- Distinguish registration identity from the mutable value stored in a registration.
- Distinguish per-instance state from shared runtime/module state.
- When code derives a child context, group, or scope, state explicitly whether that also changes service lookup or isolation; never infer isolation from structural nesting.
- Preserve exact ordering when it changes visibility or cleanup behavior.
- Before finalizing, check every contrast named by the user and give each one an explicit line in the flow.
- Call out synchronous versus queued/concurrent transitions.
- Show rollback before failure when partial effects are cleaned up.
Avoid
- Multiple small code blocks separated by prose.
- Mermaid or graphical artifacts unless the user asks for them.
- A flat bullet list pretending to be a flow.
- Exhaustive function catalogs without causal structure.
- Unsupported claims based only on names or comments.
- Stable ordering claims when the implementation iterates maps or concurrent tasks.
- Large paragraphs outside the diagram that duplicate it.
Saving as documentation
When asked to persist the result:
- create a focused Markdown file such as
docs/<topic>-flow.md; - keep the title outside and the complete explanation in one
textblock; - add it to an existing documentation index if one exists;
- preserve the repository's language and documentation conventions;
- validate balanced fences and
git diff --check; - when the bundled script is available, run
python scripts/validate_output.py <file>.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

