pr-mindmap
Build an interactive mind map of a GitHub PR or a stack of PRs from its link — the essence of the stack and of each PR, the functions grouped by meaning with a ≤50-char purpose, key/standard/unique marks, colors by kind of work, similar-function links, search, pinch zoom, depth and density controls, filters and foldable chrome — published as an HTML artifact plus a Markdown list. Use when the user gives one or more PR or stack links and asks for a mind map, a map, an overview or a function breakdown of the PR(s) ("ммап", "построй майнд мап пр-а", "карта PR", "карта стека", "mind map this PR").
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/makhnatkin--pr-mindmap)HTML
<a href="/listings/makhnatkin--pr-mindmap"><img src="/api/listings/makhnatkin--pr-mindmap/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
Requires Python 3.9+ and [gh](https://cli.github.com) signed in with `gh auth login`.
git clone https://github.com/makhnatkin/pr-mindmap.git cd pr-mindmap ./install.sh # the Claude Code skill and the prmap command in ~/.local/bin prmap example # build and open the example
Without installing, `./prmap` from the repository folder does the same.
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
SKILL.md · Manifest · 97 lines
- ---
- name: pr-mindmap
- description: Build an interactive mind map of a GitHub PR or a stack of PRs from its link — the essence of the stack and of each PR, the functions grouped by meaning with a ≤50-char purpose, key/standard/unique marks, colors by kind of work, similar-function links, search, pinch zoom, depth and density controls, filters and foldable chrome — published as an HTML artifact plus a Markdown list. Use when the user gives one or more PR or stack links and asks for a mind map, a map, an overview or a function breakdown of the PR(s) ("ммап", "построй майнд мап пр-а", "карта PR", "карта стека", "mind map this PR").
- argument-hint: <PR or stack URL> [more URLs] [only this PR]
- context: fork
- agent: general-purpose
- ---
- # PR mind map
- Build the map for: $ARGUMENTS
- Work unattended: never ask questions; take the safe option and say what you chose in the final report.
- Write the map text in the language of the request: Russian for a request in Russian, English otherwise. Set `lang` of the data to it (`"ru"` or `"en"`): the page and the Markdown list speak that language. Code names stay as they are.
- The skill folder is `~/.claude/skills/pr-mindmap/`; `prmap` in it runs every step (`prmap --help`):
- - `prmap extract` — PR metadata, the stack chain and the names each diff defines (gh CLI) → `raw.json`;
- - `prmap draft` — a mechanical `data.json` from `raw.json`: the structure without the meaning;
- - `prmap build` — checks `data.json` and builds the map from `template.html`: `map.html` (a complete file to open
- from disk), `map.artifact.html` (the same page in the form the Artifact tool publishes) and `map.md`;
- the docstring of `build.py` is the data schema;
- - `template.html` — the page: a tree that grows to both sides of the root, search, zoom, depth and density controls,
- filters, inspector, minimap, and five skins the reader picks in the bar (GitHub by default); do not edit it for one map;
- - `example/banner.json` — a complete real map (15 PRs, 166 functions) to copy the style and the level of detail from.
- ## 1. Collect
- Pick a work folder: the session scratchpad if there is one, otherwise `/tmp/pr-mindmap-<first PR number>`.
- ```bash
- ~/.claude/skills/pr-mindmap/prmap extract <PR and stack URLs> --out <work>/raw.json
- ~/.claude/skills/pr-mindmap/prmap draft <work>/raw.json --out <work>/data.json
- ```
- A stack link (`github.com/<owner>/<repo>/stack/<n>`) brings the PRs of that GitHub stack. A stacked PR brings its whole chain (PRs below down to the default branch and open PRs above). Add `--no-chain`
- when the user says "only this PR" or lists exact PRs that do not form one chain.
- `raw.json` lists per PR: title, body, base/head, GitHub stack, commits and files; each file has `added` (names its added lines
- define), `exported`, `touched` (existing definitions whose body changed) and `types`.
- The names are a starting point, not the answer: open the diff (`gh pr diff <n> -R <repo>`) of every PR and read it.
- Drop false positives (hooks called inside components, local variables, CSS class constants) and add what the regex
- missed (methods of object literals; for changed behavior of an existing function say what changed in `why`).
- The draft `data.json` is valid and already has every PR with its number, link and branch, so keep its skeleton.
- Everything that carries meaning in it is a placeholder to rewrite: stacks named after branches, groups named after
- folders, `why` holding a file name, colors standing for packages, `key` guessed from the PR text, similar groups
- found by name endings.
- ## 2. Model the map
- Levels: root → stacks → PRs → groups → functions. Read `example/banner.json` before rewriting the draft.
- - **Root**: `title` of the page is a 2–4 word name ("Banner stack map"); `root.essence` ≤150 chars.
- - **Stacks**: GitHub stacks or runs of the chain that build one feature (2–4 PRs each); a PR on its own is a stack of one.
- `essence` ≤150 chars, `gh` names the stack ("stack 1491", or "no stack"); with "stack N" the card links to the
- GitHub stack, a card of one PR links to the PR.
- - **A lone PR**: make the branches from its areas instead — stacks are areas of the change (packages or features), and
- each area has 1–4 PR-level cards for its parts, all with the same `n` and `url`. A map with one branch shows no structure.
- - **PR**: `title` short and in the map language, `essence` ≤200 chars: what the PR gives the user or the code.
- `state` (open, draft, merged, closed) comes from the draft and sets the PR icon; keep it.
- - **Groups**: 2–5 per PR by meaning ("Commands", "Schema", "Settings dialog"), not by file.
- - **Functions**: every function, component, class or method that matters to a reviewer; skip trivial constants.
- - `why` ≤50 chars, what it is for, not how it works.
- - `key: true` for the ones the PR is built around (entry points, main commands, non-obvious logic): about a quarter.
- - `kind`: `"s"` standard — a usual pattern of the framework (specs, parser/serializer, plugin factory, getters,
- plain UI); `"u"` unique — logic specific to this project.
- - Names are unique across the map; when two PRs touch the same name, add a short suffix: `SettingsFields (alignment)`.
- - **Colors** (`cats`, 3–10, legend order): kinds of work across the whole map (Markdown, schema, commands, cursor and
- keys, guards, text input, DOM, UI, upload, model…). `desc` explains the color in one sentence:
- "Functions that work with …". Every function gets exactly one color.
- - **Similar** (`sims`): groups of 2+ functions that do the same job for different parts (the `*Values` of each part,
- the `*ParserSpecs`, the Backspace/Delete selectors…). Label says what they share. Only real look-alikes.
- ## 3. Build and check
- ```bash
- ~/.claude/skills/pr-mindmap/prmap build <work>/data.json
- ```
- It writes `map.html`, `map.artifact.html` and `map.md` next to the data. Fix every error it prints (lengths, unknown
- colors, duplicate names) and build again until it prints `ok`; a warning about a color without functions means the
- color should go.
- If Google Chrome is installed, take one look:
- `"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless=new --disable-gpu --hide-scrollbars --user-data-dir=<work>/chrome --window-size=1600,1000 --virtual-time-budget=6000 --screenshot=<work>/map.png file://<work>/map.html`
- and read the PNG once. Fix only what is visibly broken; no second look.
- ## 4. Publish and report
- Publish `map.artifact.html` as an Artifact (icon `map`, description: one sentence naming the PRs); `map.html` is the
- standalone copy for opening from disk. Copy `map.html` and `map.md` to the folder the user named, if any; otherwise
- leave them in the work folder.
- Final report, short, in the user's language:
- - the artifact link and the paths of `map.html`, `map.md`, `data.json`;
- - the PRs covered and how they were grouped into stacks;
- - counts: PRs, functions, key, standard/unique, colors, similarity groups;
- - anything chosen without asking (chain included or not, a lone PR split into areas).
README.md · README · 133 lines
- # pr-mindmap
- An interactive map of a GitHub pull request or a stack of PRs: stacks → PRs → groups → functions. One HTML page
- with no server and no dependencies.
- 
- The map shows:
- - the essence of the stack and of each PR;
- - functions grouped by meaning, each with a short phrase on what it is for;
- - which functions are key (★), which follow a usual pattern and which carry the project's own logic;
- - a color for the kind of work (commands, schema, interface…); a click on a color or a function keeps only them bright;
- - similar functions from different PRs: the ≈ mark and dashed links.
- 
- ## Install
- Requires Python 3.9+ and [gh](https://cli.github.com) signed in with `gh auth login`.
- ```sh
- git clone https://github.com/makhnatkin/pr-mindmap.git
- cd pr-mindmap
- ./install.sh # the Claude Code skill and the prmap command in ~/.local/bin
- prmap example # build and open the example
- ```
- Without installing, `./prmap` from the repository folder does the same.
- ## Make a map
- **With a model: the full map.** In Claude Code:
- ```
- /pr-mindmap https://github.com/owner/repo/pull/123
- ```
- The skill collects the stack, reads the diffs, writes the essence of each PR, groups the functions by meaning, assigns
- colors and finds similar functions. The result is `map.html`, `map.md` and a published artifact. The map speaks the
- language of the request: English, or Russian for a request in Russian.
- **Without a model: a draft in a few seconds.**
- ```sh
- prmap new https://github.com/owner/repo/pull/123
- ```
- The draft comes from the diffs alone: stacks from branch names, groups from folders, colors from packages, key
- functions are exported ones named in the PR description, similar ones share a name ending. It carries no meaning:
- the purpose of a function is its file name. Edit `data.json` by hand or hand it to the skill, then rebuild:
- ```sh
- prmap build prmap-out/owner-repo-123/data.json --open
- ```
- A GitHub stack link (`github.com/<owner>/<repo>/stack/<n>`) gives the PRs of that stack. When a PR is part of a stack, the map gets the whole chain: the PRs below it down to the main branch and the open PRs above it. A stack card links to its GitHub page, a PR card links to the PR. `--no-chain` keeps only the named PRs.
- ## Commands
- | Command | What it does |
- | --- | --- |
- | `prmap new <PR or stack URL>…` | extract + draft + build: a draft map, opened in the browser |
- | `prmap extract <PR or stack URL>… [--out raw.json]` | PR metadata, the stack chain, names from the diffs |
- | `prmap draft raw.json [--out data.json]` | a mechanical `data.json` from `raw.json` |
- | `prmap build data.json [--open]` | `map.html`, `map.artifact.html`, `map.md` next to the data |
- | `prmap example` | the example: 15 PRs, 166 functions |
- | `prmap dev` | `template.html` with the example data, for editing the template |
- `map.html` is a complete document that opens from disk. `map.artifact.html` is the same page without the document
- skeleton: the form Claude publishes as an artifact.
- ## data.json
- The full schema is at the top of [build.py](build.py), a working example is [example/banner.json](example/banner.json).
- ```json
- {
- "title": "Banner stack map",
- "lang": "en",
- "root": {"title": "Banner in markdown-editor", "essence": "≤ 150 chars"},
- "cats": [{"id": "cmd", "name": "Commands", "desc": "ProseMirror commands that change the document."}],
- "sims": [{"id": "values", "label": "Values that differ from the defaults", "members": ["fnA", "fnB"]}],
- "stacks": [{
- "name": "Background", "gh": "stack 1492", "essence": "≤ 150 chars",
- "prs": [{
- "n": 1478, "url": "https://github.com/o/r/pull/1478", "branch": "feat/x", "state": "draft",
- "title": "Background rendering", "essence": "≤ 200 chars",
- "groups": [{"name": "Commands", "fns": [
- {"name": "setHeaderBackground", "why": "≤ 50 chars", "key": true, "kind": "u", "cat": "cmd"}
- ]}]
- }]
- }]
- }
- ```
- `lang` is the language of the page and of the Markdown list: `en` by default, `ru` for Russian. `kind`: `s` is a
- usual pattern, `u` is the project's own logic. Function names are unique across the map. There are 1 to 10 colors.
- The builder checks lengths, color references and similar groups, and writes no files while there are errors.
- ## Controls
- - **Canvas:** pinch or ⌘ + wheel zooms; two fingers or a drag moves; a double click zooms in.
- - **Depth:** Stacks / PRs / Groups / Functions (`[` and `]`), the Expand all / Collapse all button (`E`); “−” and “+N” on the edges fold one branch.
- - **Density:** S shows names only, M functions with their purpose, L also the essence of stacks and PRs (`D`).
- - **Filters:** key functions only (`K`), hide other colors (`F`).
- - **Search:** `/`, arrows and Enter.
- - **View:** layout to both sides or to one (`L`), theme (`T`), skin (`S`), minimap (`M`), hide the interface (`H`).
- - **The selection panel** moves by its header and changes width by its edge; position and width are remembered, the button in the header and a double click dock it in the corner.
- - `0` fits the whole map, `1` sets 100%, `Esc` clears the selection, `?` shows the hints.
- Five skins, each with a light and a dark theme. GitHub is the default: colors and shadows from the Primer tokens,
- github.com fonts, counters, labels and cards as in the GitHub interface. The other four:
- 
- ## Development
- ```sh
- prmap dev # the template with the example data: edit template.html and reload
- python3 -m unittest discover -s tests -v # tests; the browser one runs when Chrome is present, the syntax one when node is
- ```
- - [template.html](template.html) is the whole page: styles, markup and script. A new skin is a block of `-l`/`-d`
- colors and shapes next to the others plus a line in `SKINS`.
- - [extract.py](extract.py), [draft.py](draft.py), [build.py](build.py) collect, draft and build; `prmap` calls them.
- - [SKILL.md](SKILL.md) is the skill for Claude Code.
- The page loads its fonts from Google Fonts; offline, system fonts take their place.
- ## License
- [MIT](LICENSE). The GitHub skin embeds icons from [Octicons](https://github.com/primer/octicons) (MIT).
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.