ASCII Flow
Create readable ASCII tree diagrams from real code flow — terminal-friendly, plain-text, scannable top to bottom.
Goal
Help the reader understand the full flow of a function, method, handler, or endpoint:
- what starts the flow
- what validation or checks happen
- what important data lookups happen
- what meaningful decisions happen
- what external or persistent interactions happen
- what side effects happen
- what success or failure outcomes matter
When to Use
Use this skill when the user asks to:
- explain a function or method as a tree diagram
- document an endpoint or handler flow
- map controller, service, repository, or workflow logic
- get a terminal-friendly code flow overview
- understand the end-to-end flow of a request or process
This skill is language-agnostic.
Core Rules
- Read the real code first.
- Read important helpers that materially affect the flow.
- Show the full meaningful flow — simplified but faithful.
- Prefer readability over literal code structure.
- Prefer plain-English action labels over implementation names.
- Keep the diagram useful to technical and non-technical readers alike.
- Avoid low-level implementation noise unless it changes the story.
Tree Format Rules
Each line has: indicator + step + description.
UploadFunctionName
│
├── 1. Step name Description of what happens
│ └── error → return 4xx
│
├── 2. Group step Parent grouping
│ ├── 2a. Sub-step → External service
│ ├── 2b. Sub-step
│ └── 2c. Sub-step
│ └── error → return 5xx
│
└── 3. Final step Side effect or return
├── for non-final siblings, └── for last item
│ for continuation lines inside groups
- Sequential numbering (1., 2., 3.) — easy to reference
- Number sub-steps as 2a, 2b, 2c when grouping
- Comments inline: function name on left, plain intent on right
- Error paths:
└── error → return <status> indented under the step that can fail
- Inline
→ to show targets: Validate HS codes → MDM
- Use blank lines between major phases for readability
Flow Extraction Rules
Keep these:
- validation and authentication checks
- important data loads and lookups
- meaningful grouping or decision points
- external service calls (MDM, API, etc.)
- persistence (DB transactions, bulk inserts)
- side effects that matter (Redis updates, events)
- final success and failure outcomes
Omit these:
- local variable setup
- formatting and tiny conversions
- cache writes not important to the reader
- repeated loops unless they change understanding
- helper nesting that does not change the story
Workflow
- Identify the function, method, handler, or endpoint.
- Read the full main function body.
- Read helpers that materially affect: validation, branching, lookup, persistence, external calls, side effects.
- Extract the real flow — responsibilities, not line numbers.
- Reduce technical noise — keep only what changes the story.
- Write the tree top to bottom — linear, scannable, with grouped sub-steps.
- Return a short preface, then the fenced ASCII tree.
Output Format
Before the diagram, briefly state:
- function or method found (file:line)
- important helpers read
- participants or external services in the flow
Then return one fenced text code block containing the final ASCII tree.
Preferred Writing Style
Good lines:
Bind and parse JSON payload
Load account configuration
Check shipment count against limit
Run struct-level validation
Insert shipment records → returns IDs
Bulk insert senders
Update Redis shipment summary
Return 200 with shipment IDs and count
Avoid:
- code-shaped lines with raw variable names
- stack-trace style listing
- internal framework context manipulation
Final Check
Before returning, confirm:
- the target function was read
- important helpers were inspected
- the full meaningful flow is present
- readable for technical and non-technical readers
- tree format follows the conventions above
- simplified but still faithful to the real code
- wording is plain and clear
1---2name: ascii-flow3description: Creates terminal-friendly ASCII tree diagrams from real code flow for functions, methods, handlers, and endpoints. Use when the user asks to explain, visualize, map, or document code flow, or mentions "tree diagram", "flow tree", "ascii flow", or wants a simpler alternative to sequence diagrams.4---56# ASCII Flow78Create readable ASCII tree diagrams from real code flow — terminal-friendly, plain-text, scannable top to bottom.910## Goal1112Help the reader understand the full flow of a function, method, handler, or endpoint:1314- what starts the flow15- what validation or checks happen16- what important data lookups happen17- what meaningful decisions happen18- what external or persistent interactions happen19- what side effects happen20- what success or failure outcomes matter2122## When to Use2324Use this skill when the user asks to:2526- explain a function or method as a tree diagram27- document an endpoint or handler flow28- map controller, service, repository, or workflow logic29- get a terminal-friendly code flow overview30- understand the end-to-end flow of a request or process3132This skill is language-agnostic.3334## Core Rules3536- Read the real code first.37- Read important helpers that materially affect the flow.38- Show the full meaningful flow — simplified but faithful.39- Prefer readability over literal code structure.40- Prefer plain-English action labels over implementation names.41- Keep the diagram useful to technical and non-technical readers alike.42- Avoid low-level implementation noise unless it changes the story.4344## Tree Format Rules4546Each line has: `indicator + step + description`.4748```49UploadFunctionName50│51├── 1. Step name Description of what happens52│ └── error → return 4xx53│54├── 2. Group step Parent grouping55│ ├── 2a. Sub-step → External service56│ ├── 2b. Sub-step57│ └── 2c. Sub-step58│ └── error → return 5xx59│60└── 3. Final step Side effect or return61```6263- `├──` for non-final siblings, `└──` for last item64- `│` for continuation lines inside groups65- Sequential numbering (1., 2., 3.) — easy to reference66- Number sub-steps as 2a, 2b, 2c when grouping67- Comments inline: function name on left, plain intent on right68- Error paths: `└── error → return <status>` indented under the step that can fail69- Inline `→` to show targets: `Validate HS codes → MDM`70- Use blank lines between major phases for readability7172## Flow Extraction Rules7374Keep these:7576- validation and authentication checks77- important data loads and lookups78- meaningful grouping or decision points79- external service calls (MDM, API, etc.)80- persistence (DB transactions, bulk inserts)81- side effects that matter (Redis updates, events)82- final success and failure outcomes8384Omit these:8586- local variable setup87- formatting and tiny conversions88- cache writes not important to the reader89- repeated loops unless they change understanding90- helper nesting that does not change the story9192## Workflow93941. Identify the function, method, handler, or endpoint.952. Read the full main function body.963. Read helpers that materially affect: validation, branching, lookup, persistence, external calls, side effects.974. Extract the real flow — responsibilities, not line numbers.985. Reduce technical noise — keep only what changes the story.996. Write the tree top to bottom — linear, scannable, with grouped sub-steps.1007. Return a short preface, then the fenced ASCII tree.101102## Output Format103104Before the diagram, briefly state:105106- function or method found (file:line)107- important helpers read108- participants or external services in the flow109110Then return one fenced `text` code block containing the final ASCII tree.111112## Preferred Writing Style113114Good lines:115116- `Bind and parse JSON payload`117- `Load account configuration`118- `Check shipment count against limit`119- `Run struct-level validation`120- `Insert shipment records → returns IDs`121- `Bulk insert senders`122- `Update Redis shipment summary`123- `Return 200 with shipment IDs and count`124125Avoid:126127- code-shaped lines with raw variable names128- stack-trace style listing129- internal framework context manipulation130131## Final Check132133Before returning, confirm:134135- the target function was read136- important helpers were inspected137- the full meaningful flow is present138- readable for technical and non-technical readers139- tree format follows the conventions above140- simplified but still faithful to the real code141- wording is plain and clear