Skip to content
Back to search

pr-mindmap

SkillWorks with Claude CodeGitHub

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.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/makhnatkin--pr-mindmap/badge.svg)](/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

i

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
  1. ---
  2. name: pr-mindmap
  3. 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").
  4. argument-hint: <PR or stack URL> [more URLs] [only this PR]
  5. context: fork
  6. agent: general-purpose
  7. ---
  8. # PR mind map
  9. Build the map for: $ARGUMENTS
  10. Work unattended: never ask questions; take the safe option and say what you chose in the final report.
  11. 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.
  12. The skill folder is `~/.claude/skills/pr-mindmap/`; `prmap` in it runs every step (`prmap --help`):
  13. - `prmap extract` — PR metadata, the stack chain and the names each diff defines (gh CLI) → `raw.json`;
  14. - `prmap draft` — a mechanical `data.json` from `raw.json`: the structure without the meaning;
  15. - `prmap build` — checks `data.json` and builds the map from `template.html`: `map.html` (a complete file to open
  16. from disk), `map.artifact.html` (the same page in the form the Artifact tool publishes) and `map.md`;
  17. the docstring of `build.py` is the data schema;
  18. - `template.html` — the page: a tree that grows to both sides of the root, search, zoom, depth and density controls,
  19. filters, inspector, minimap, and five skins the reader picks in the bar (GitHub by default); do not edit it for one map;
  20. - `example/banner.json` — a complete real map (15 PRs, 166 functions) to copy the style and the level of detail from.
  21. ## 1. Collect
  22. Pick a work folder: the session scratchpad if there is one, otherwise `/tmp/pr-mindmap-<first PR number>`.
  23. ```bash
  24. ~/.claude/skills/pr-mindmap/prmap extract <PR and stack URLs> --out <work>/raw.json
  25. ~/.claude/skills/pr-mindmap/prmap draft <work>/raw.json --out <work>/data.json
  26. ```
  27. 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`
  28. when the user says "only this PR" or lists exact PRs that do not form one chain.
  29. `raw.json` lists per PR: title, body, base/head, GitHub stack, commits and files; each file has `added` (names its added lines
  30. define), `exported`, `touched` (existing definitions whose body changed) and `types`.
  31. The names are a starting point, not the answer: open the diff (`gh pr diff <n> -R <repo>`) of every PR and read it.
  32. Drop false positives (hooks called inside components, local variables, CSS class constants) and add what the regex
  33. missed (methods of object literals; for changed behavior of an existing function say what changed in `why`).
  34. The draft `data.json` is valid and already has every PR with its number, link and branch, so keep its skeleton.
  35. Everything that carries meaning in it is a placeholder to rewrite: stacks named after branches, groups named after
  36. folders, `why` holding a file name, colors standing for packages, `key` guessed from the PR text, similar groups
  37. found by name endings.
  38. ## 2. Model the map
  39. Levels: root → stacks → PRs → groups → functions. Read `example/banner.json` before rewriting the draft.
  40. - **Root**: `title` of the page is a 2–4 word name ("Banner stack map"); `root.essence` ≤150 chars.
  41. - **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.
  42. `essence` ≤150 chars, `gh` names the stack ("stack 1491", or "no stack"); with "stack N" the card links to the
  43. GitHub stack, a card of one PR links to the PR.
  44. - **A lone PR**: make the branches from its areas instead — stacks are areas of the change (packages or features), and
  45. 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.
  46. - **PR**: `title` short and in the map language, `essence` ≤200 chars: what the PR gives the user or the code.
  47. `state` (open, draft, merged, closed) comes from the draft and sets the PR icon; keep it.
  48. - **Groups**: 2–5 per PR by meaning ("Commands", "Schema", "Settings dialog"), not by file.
  49. - **Functions**: every function, component, class or method that matters to a reviewer; skip trivial constants.
  50. - `why` ≤50 chars, what it is for, not how it works.
  51. - `key: true` for the ones the PR is built around (entry points, main commands, non-obvious logic): about a quarter.
  52. - `kind`: `"s"` standard — a usual pattern of the framework (specs, parser/serializer, plugin factory, getters,
  53. plain UI); `"u"` unique — logic specific to this project.
  54. - Names are unique across the map; when two PRs touch the same name, add a short suffix: `SettingsFields (alignment)`.
  55. - **Colors** (`cats`, 3–10, legend order): kinds of work across the whole map (Markdown, schema, commands, cursor and
  56. keys, guards, text input, DOM, UI, upload, model…). `desc` explains the color in one sentence:
  57. "Functions that work with …". Every function gets exactly one color.
  58. - **Similar** (`sims`): groups of 2+ functions that do the same job for different parts (the `*Values` of each part,
  59. the `*ParserSpecs`, the Backspace/Delete selectors…). Label says what they share. Only real look-alikes.
  60. ## 3. Build and check
  61. ```bash
  62. ~/.claude/skills/pr-mindmap/prmap build <work>/data.json
  63. ```
  64. It writes `map.html`, `map.artifact.html` and `map.md` next to the data. Fix every error it prints (lengths, unknown
  65. colors, duplicate names) and build again until it prints `ok`; a warning about a color without functions means the
  66. color should go.
  67. If Google Chrome is installed, take one look:
  68. `"/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`
  69. and read the PNG once. Fix only what is visibly broken; no second look.
  70. ## 4. Publish and report
  71. Publish `map.artifact.html` as an Artifact (icon `map`, description: one sentence naming the PRs); `map.html` is the
  72. standalone copy for opening from disk. Copy `map.html` and `map.md` to the folder the user named, if any; otherwise
  73. leave them in the work folder.
  74. Final report, short, in the user's language:
  75. - the artifact link and the paths of `map.html`, `map.md`, `data.json`;
  76. - the PRs covered and how they were grouped into stacks;
  77. - counts: PRs, functions, key, standard/unique, colors, similarity groups;
  78. - anything chosen without asking (chain included or not, a lone PR split into areas).
README.md · README · 133 lines
  1. # pr-mindmap
  2. An interactive map of a GitHub pull request or a stack of PRs: stacks → PRs → groups → functions. One HTML page
  3. with no server and no dependencies.
  4. ![A map of a stack of 15 PRs](docs/map.png)
  5. The map shows:
  6. - the essence of the stack and of each PR;
  7. - functions grouped by meaning, each with a short phrase on what it is for;
  8. - which functions are key (★), which follow a usual pattern and which carry the project's own logic;
  9. - a color for the kind of work (commands, schema, interface…); a click on a color or a function keeps only them bright;
  10. - similar functions from different PRs: the ≈ mark and dashed links.
  11. ![A selected function and the ones similar to it](docs/detail.png)
  12. ## Install
  13. Requires Python 3.9+ and [gh](https://cli.github.com) signed in with `gh auth login`.
  14. ```sh
  15. git clone https://github.com/makhnatkin/pr-mindmap.git
  16. cd pr-mindmap
  17. ./install.sh # the Claude Code skill and the prmap command in ~/.local/bin
  18. prmap example # build and open the example
  19. ```
  20. Without installing, `./prmap` from the repository folder does the same.
  21. ## Make a map
  22. **With a model: the full map.** In Claude Code:
  23. ```
  24. /pr-mindmap https://github.com/owner/repo/pull/123
  25. ```
  26. The skill collects the stack, reads the diffs, writes the essence of each PR, groups the functions by meaning, assigns
  27. colors and finds similar functions. The result is `map.html`, `map.md` and a published artifact. The map speaks the
  28. language of the request: English, or Russian for a request in Russian.
  29. **Without a model: a draft in a few seconds.**
  30. ```sh
  31. prmap new https://github.com/owner/repo/pull/123
  32. ```
  33. The draft comes from the diffs alone: stacks from branch names, groups from folders, colors from packages, key
  34. functions are exported ones named in the PR description, similar ones share a name ending. It carries no meaning:
  35. the purpose of a function is its file name. Edit `data.json` by hand or hand it to the skill, then rebuild:
  36. ```sh
  37. prmap build prmap-out/owner-repo-123/data.json --open
  38. ```
  39. 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.
  40. ## Commands
  41. | Command | What it does |
  42. | --- | --- |
  43. | `prmap new <PR or stack URL>…` | extract + draft + build: a draft map, opened in the browser |
  44. | `prmap extract <PR or stack URL>… [--out raw.json]` | PR metadata, the stack chain, names from the diffs |
  45. | `prmap draft raw.json [--out data.json]` | a mechanical `data.json` from `raw.json` |
  46. | `prmap build data.json [--open]` | `map.html`, `map.artifact.html`, `map.md` next to the data |
  47. | `prmap example` | the example: 15 PRs, 166 functions |
  48. | `prmap dev` | `template.html` with the example data, for editing the template |
  49. `map.html` is a complete document that opens from disk. `map.artifact.html` is the same page without the document
  50. skeleton: the form Claude publishes as an artifact.
  51. ## data.json
  52. The full schema is at the top of [build.py](build.py), a working example is [example/banner.json](example/banner.json).
  53. ```json
  54. {
  55. "title": "Banner stack map",
  56. "lang": "en",
  57. "root": {"title": "Banner in markdown-editor", "essence": "≤ 150 chars"},
  58. "cats": [{"id": "cmd", "name": "Commands", "desc": "ProseMirror commands that change the document."}],
  59. "sims": [{"id": "values", "label": "Values that differ from the defaults", "members": ["fnA", "fnB"]}],
  60. "stacks": [{
  61. "name": "Background", "gh": "stack 1492", "essence": "≤ 150 chars",
  62. "prs": [{
  63. "n": 1478, "url": "https://github.com/o/r/pull/1478", "branch": "feat/x", "state": "draft",
  64. "title": "Background rendering", "essence": "≤ 200 chars",
  65. "groups": [{"name": "Commands", "fns": [
  66. {"name": "setHeaderBackground", "why": "≤ 50 chars", "key": true, "kind": "u", "cat": "cmd"}
  67. ]}]
  68. }]
  69. }]
  70. }
  71. ```
  72. `lang` is the language of the page and of the Markdown list: `en` by default, `ru` for Russian. `kind`: `s` is a
  73. usual pattern, `u` is the project's own logic. Function names are unique across the map. There are 1 to 10 colors.
  74. The builder checks lengths, color references and similar groups, and writes no files while there are errors.
  75. ## Controls
  76. - **Canvas:** pinch or ⌘ + wheel zooms; two fingers or a drag moves; a double click zooms in.
  77. - **Depth:** Stacks / PRs / Groups / Functions (`[` and `]`), the Expand all / Collapse all button (`E`); “−” and “+N” on the edges fold one branch.
  78. - **Density:** S shows names only, M functions with their purpose, L also the essence of stacks and PRs (`D`).
  79. - **Filters:** key functions only (`K`), hide other colors (`F`).
  80. - **Search:** `/`, arrows and Enter.
  81. - **View:** layout to both sides or to one (`L`), theme (`T`), skin (`S`), minimap (`M`), hide the interface (`H`).
  82. - **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.
  83. - `0` fits the whole map, `1` sets 100%, `Esc` clears the selection, `?` shows the hints.
  84. Five skins, each with a light and a dark theme. GitHub is the default: colors and shadows from the Primer tokens,
  85. github.com fonts, counters, labels and cards as in the GitHub interface. The other four:
  86. ![Skins: Studio, Strict, macOS, Blueprint](docs/skins.png)
  87. ## Development
  88. ```sh
  89. prmap dev # the template with the example data: edit template.html and reload
  90. python3 -m unittest discover -s tests -v # tests; the browser one runs when Chrome is present, the syntax one when node is
  91. ```
  92. - [template.html](template.html) is the whole page: styles, markup and script. A new skin is a block of `-l`/`-d`
  93. colors and shapes next to the others plus a line in `SKINS`.
  94. - [extract.py](extract.py), [draft.py](draft.py), [build.py](build.py) collect, draft and build; `prmap` calls them.
  95. - [SKILL.md](SKILL.md) is the skill for Claude Code.
  96. The page loads its fonts from Google Fonts; offline, system fonts take their place.
  97. ## License
  98. [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 in

Free to use. If it’s helped, pass it on.