brokkai/brokk-skills/brokk-flow-graph
Claude Code and agent skill by brokkai/brokk-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when asked to map, visualize, or understand how a codebase flows from entry points to outcomes - generates a Mermaid flowchart per entry point showing branches, calls, and terminal states
Install
npx vskill@latest install brokkai/brokk-skills/brokk-flow-graphSKILL.md
brokk-flow-graph
Overview
Systematically locate every entry point in a codebase, trace its execution paths using ripgrep, and emit one Mermaid flowchart TD diagram per entry point showing branches, function calls, and terminal outcomes (return, error, exit).
Prerequisites
Check for ripgrep before starting:
If missing: pip install ripgrep or cargo install ripgrep or winget install BurntSushi.ripgrep (Windows). Offer to install before proceeding.
Step 1 — Detect Language(s)
Note all significant languages — a polyglot repo needs language-specific entry point patterns applied to the right directories.
Step 2 — Find Entry Points
Run the patterns for each detected language:
| Language | Entry Point Patterns | |||||
|---|---|---|---|---|---|---|
| Python | if __name__ == .?__main__, def main\(, @app.route, `@router.(get\ | post\ | put\ | delete\ | patch), @click.command` | |
| JS/TS | app\.listen\(, server\.listen\(, `app\.(get\ | post\ | put\ | delete\ | patch)\(, export default function, addEventListener\(` | |
| Java | public static void main\(String, `@(Get\ | Post\ | Put\ | Delete\ | Request)Mapping` | |
| Go | func main\(\), http\.Handle(Func)?\( | |||||
| Ruby | get ['"], post ['"], put ['"] (Sinatra/Rails routes) | |||||
| PHP | check index.php and route files | |||||
| C# | static (async )?Task Main\(, `app\.Map(Get\ | Post\ | Put\ | Delete)` | ||
| Rust | fn main\(\), #\[tokio::main\] |
List all found entry points. Each becomes one Mermaid diagram.
Step 3 — Trace Execution Per Entry Point
For each entry point, trace 3 levels deep:
- Read the entry function — note every function call, conditional branch, and terminal (return/raise/exit/throw)
- For each called function, use ripgrep to find its definition and read it
- Repeat one more level — 3 levels is enough for most legacy codebases; note if paths go deeper
Track a node list and edge list as you read:
Mark terminal nodes:
[success]— normal return/response[error]— exception/error response[exit]— process exit
Step 4 — Emit Mermaid Diagram
One flowchart TD per entry point. Use subgraphs to group layers.
Naming rules:
- Node IDs: short alphanumeric, no spaces (
createUser,E1,DB1) - Node labels: use quotes for spaces/special chars
- Edge labels: use
|condition|to name branches - Keep diagrams to ~20 nodes max; split deeply nested paths into a linked sub-diagram
Step 5 — Output
For each entry point emit:
flowchart TD ...
After all diagrams, emit a summary table:
| Entry Point | File | Terminal Outcomes | Depth | |
|---|---|---|---|---|
| POST /api/users | routes/users.py:14 | 201, 400, 500 | 4 |
Windows Notes
- Use
rg(ripgrep) — works natively on Windows - Path separators in output:
rgreturns OS-native paths; normalise with forward slashes in diagrams for readability - Avoid
grep,find,wc— userg --countandrg --filesinstead
Common Mistakes
| Mistake | Fix | |
|---|---|---|
| One giant diagram for whole codebase | One diagram per entry point | |
| Tracing only happy path | Always trace error branches | |
| Ignoring async/callback flows | Mark async edges with -.-> (dashed) | |
| Node IDs with spaces/slashes | Use short alphanumeric IDs, put display name in label | |
| Stopping at function name | Actually read the called function's body |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingbrokk-flow-graph/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/brokkai/brokk-skills/brokk-flow-graph)