@johnz4021/illuminate 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,41 +1,105 @@
1
1
  # illuminate
2
2
 
3
- Ask how your code works and get a map you can point at. Claude explores the repo and drafts the answer as a graph of
4
- areas, steps and labeled arrows. A plain program checks every box and arrow against the real code before you see it.
5
- Then you can take a walkthrough, select any part and ask about it, and fix a missing connection right from the map.
3
+ Ask Claude Code how your code works and get a map you can point at. Claude reads the repo and draws the answer as
4
+ boxes and arrows in your browser. A plain program then checks every box and arrow against the real code before you see
5
+ it, so the map can't show something that isn't there.
6
6
 
7
- Design: [Codemap v1 Design](https://claude.ai/artifact/55L8tokprGe61qtfpDXJ5h).
7
+ ![A map of what happens when a patient converts, with the missing connection marked in red](docs/images/arch.png)
8
8
 
9
- ## Use it in Claude Code (no API key)
9
+ Design: [Codemap v1 Design](https://claude.ai/artifact/55L8tokprGe61qtfpDXJ5h).
10
10
 
11
- illuminate runs as an MCP server in Claude Code: your own Claude Code session does the reading and writing on your own
12
- sign-in, and illuminate checks every claim and draws the map. Questions you ask on the map go to that same session,
13
- and the answers come back to the map.
11
+ ## Install
14
12
 
15
13
  In Claude Code (2.1.275 or later), in any repo:
16
14
 
17
15
  ```
18
- /plugin install illuminate --marketplace johnz4021/codemap
16
+ /plugin install illuminate --marketplace johnz4021/illuminate
19
17
  ```
20
18
 
21
- That installs the illuminate MCP server (`npx -y @johnz4021/illuminate`, Node 20.19 or later) and the `/illuminate`
22
- skill. Without the plugin: `claude mcp add --scope user illuminate -- npx -y @johnz4021/illuminate channel`.
19
+ Then restart Claude Code. That's all: illuminate uses your own Claude Code session and sign-in, so there is no API key
20
+ to set up. It needs Node 20.19 or later. If Node is missing or too old, ask for a map anyway: Claude checks, offers to
21
+ install or update it, and tells you what to restart.
22
+
23
+ ## What you can ask
24
+
25
+ Ask in plain words, or start with `/illuminate`. A map opens in your browser after about a minute. The screenshots
26
+ below are real maps of a small demo app (a clinic's patient system).
27
+
28
+ ### 1. How something works
29
+
30
+ > What happens when a patient converts? Does the welcome email go out?
31
+
32
+ Claude follows the flow from where it starts to where it ends, across files. If something on the way should connect
33
+ and doesn't, the map shows it as a red dashed arrow, with the search that proves nothing is there. That is the map at
34
+ the top of this page: the app announces the conversion, and nothing is listening.
35
+
36
+ ### 2. What a change did
37
+
38
+ > What did you just change?
39
+
40
+ The map shows the code as it is now, compared with a commit (the last one, unless you name another). What is new is
41
+ green, what is different is amber, and what was deleted is struck through in red. illuminate works those out itself
42
+ from the two versions. The switch at the top left shows the code before, after, or both.
43
+
44
+ ![A map of a change: a new listener in green, joined to the steps that were already there](docs/images/change.png)
45
+
46
+ Good for reading what an agent did after a long task. It compares with a commit, so work you hadn't committed before
47
+ the task counts as changed too.
48
+
49
+ ### 3. A user journey
23
50
 
24
- From a checkout of this repo instead (for working on illuminate):
51
+ > Show me the user journey: what does staff go through to convert a patient?
52
+
53
+ Asked what a person sees or does, Claude draws screens, actions and choices from left to right, with no code on the
54
+ boxes. Each screen can show a wireframe of its page, drawn from the code, with the part the step is about marked.
55
+ Nothing has to be running.
56
+
57
+ ![A user journey, with a wireframe of the patient page in the walkthrough](docs/images/journey.png)
58
+
59
+ ### 4. A change before it's made
60
+
61
+ > How would we send the welcome email right away when a patient converts? Show me a plan.
62
+
63
+ Claude draws the code as it is, checked, with the proposal on top in violet: new boxes and arrows dashed, and what
64
+ would change marked. Nothing is edited. After the change is built, reopen the map and illuminate marks which proposed
65
+ parts are now in the code.
66
+
67
+ ![A proposal drawn in violet on top of the code as it is](docs/images/plan.png)
68
+
69
+ ## On the map
70
+
71
+ - **Take the walkthrough.** A few stops, starting with the answer to your question.
72
+ - **Click any box or arrow** to see what it does and the code behind it: the function itself, with the lines the map
73
+ relies on marked and a link that opens the file in your editor at that line.
74
+ - **Ask a follow-up** in the box at the bottom, or select something first and ask about that. The answer lights up the
75
+ part of the map it's about. When the question is about the code itself ("what's in this payload?"), the answer comes
76
+ with the lines that show it, each with a note.
77
+ - **Ask for a fix.** Claude proposes one, drawn on the map next to the exact change. Nothing is edited until you
78
+ approve it.
79
+
80
+ The top bar says whether the map still matches the code ("Every part is in the code"). The check proves each part is
81
+ real; it doesn't prove the map covers everything.
82
+
83
+ ## How it runs in Claude Code
84
+
85
+ illuminate runs as an MCP server in Claude Code: your session does the reading and writing, and illuminate checks every
86
+ claim and draws the map. Questions you ask on the map go to that same session, and the answers come back to the map.
87
+
88
+ Without the plugin: `claude mcp add --scope user illuminate -- npx -y @johnz4021/illuminate channel`. From a checkout of
89
+ this repo instead (for working on illuminate):
25
90
 
26
91
  ```
27
92
  npm i && npm run build
28
93
  claude mcp add --scope user illuminate -- node "$PWD/packages/server/bin/illuminate.mjs" channel
29
94
  ```
30
95
 
31
- Ask something like "how does sign-up work? Draw me a map." Claude calls `illuminate_map`, the map opens in your
32
- browser, and Claude keeps working until it has passed the check. Then Claude keeps one `illuminate_listen` call open:
33
- after two minutes Claude Code moves it to the background and gives you your terminal back, and when you ask on the map
34
- it wakes the session with your question. The session has to stay open for that. Every 25 minutes or so the call
35
- returns and Claude quietly starts another (Claude Code drops a call that has been quiet for 30 minutes); after about
36
- two hours with no questions, illuminate stops listening. If a question on the map says Claude
37
- Code isn't listening, tell Claude "listen to illuminate". To skip approving each illuminate tool call, allow its
38
- tools when Claude Code asks (`mcp__plugin_illuminate_illuminate__*` from the plugin, `mcp__illuminate__*` otherwise).
96
+ Once a map is ready, Claude keeps one `illuminate_listen` call open: after two minutes Claude Code moves it to the
97
+ background and gives you your terminal back, and when you ask on the map it wakes the session with your question. The
98
+ session has to stay open for that. Every 25 minutes or so the call returns and Claude quietly starts another (Claude
99
+ Code drops a call that has been quiet for 30 minutes); after about two hours with no questions, illuminate stops
100
+ listening. If a question on the map says Claude Code isn't listening, tell Claude "listen to illuminate". To skip
101
+ approving each illuminate tool call, allow its tools when Claude Code asks (`mcp__plugin_illuminate_illuminate__*` from
102
+ the plugin, `mcp__illuminate__*` otherwise).
39
103
 
40
104
  Moving long tool calls to the background is on by default; if you've turned it off (`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS=0`),
41
105
  listening holds your terminal until you ask on the map. Starting Claude Code with
@@ -89,14 +153,18 @@ is sent anywhere. Useful for UI work and demos.
89
153
  ### Screens on the map
90
154
 
91
155
  When a flow starts from something you can see (a button, a form), Claude can put a picture of that screen on the box,
92
- with the button marked. It decides case by case; backend-only maps get none. If your app is already running on
93
- localhost, or the repo has an HTML file, illuminate screenshots it with the Chrome you already have, in a clean profile
94
- (pages behind a login show their login page, and Claude then falls back). Otherwise Claude can show an image file from
95
- the repo or a rough sketch of a component. illuminate never starts your app, and a screen is only shown if the checker
156
+ with the button marked. It decides case by case; backend-only maps get none. The usual picture is a wireframe of the
157
+ whole page, drawn from the code: its parts (top bar, sidebar, main area) with the one the step is about marked.
158
+ Nothing has to be running for that. illuminate checks that each part really belongs to the page and that its text is
159
+ in the code; where the parts sit is Claude's reading, so the wireframe says it is approximate. If your app is already
160
+ running on localhost, or the repo has an HTML file, illuminate can screenshot it instead with the Chrome you already
161
+ have, in a clean profile (pages behind a login show their login page, and Claude then falls back). illuminate never starts your app, and a screen is only shown if the checker
96
162
  can tie it to the code. Screenshots are saved under `.illuminate/screens/`.
97
163
 
98
164
  ## How it works
99
165
 
166
+ What happens behind the four kinds of map above:
167
+
100
168
  1. **Make a map.** A deterministic scan gives Claude a head start (entry points, routes, which requests hit which
101
169
  routes, which tables are written). Claude explores with Read/Grep/Glob only and returns the map in a fixed format.
102
170
  2. **Check every claim.** `check()` re-reads each cited line, verifies calls, requests and imports against code facts,
@@ -107,16 +175,7 @@ can tie it to the code. Screenshots are saved under `.illuminate/screens/`.
107
175
  anything and ask, as a conversation: replies are short and lead with the answer, and the map does the explaining (each reply
108
176
  lights up what it's about). Claude explores further when the map isn't enough; what it finds is drawn only if it
109
177
  passes the checker.
110
- 4. **See a change before it's made.** Ask how something would change ("how would we send this right away?") and the
111
- map shows the code as it is, checked, with the proposal on top in violet: new boxes and arrows dashed, what would
112
- go struck through. Nothing is edited. After the change is built, reopen the map: illuminate checks the code and
113
- marks which proposed parts are now there. Ask what someone sees or goes through, and the map is drawn as a
114
- user flow instead: screens, actions and choices from left to right, with the code behind each one a click away.
115
- 5. **See what a change did.** Ask "what did you just change?" or "what did the last commit do?" and the map shows
116
- the code as it is now, with what is new in green, what is different in amber and what was deleted struck through
117
- in red. illuminate works those out itself by comparing with a commit (the last one, unless you name another), and
118
- a changed box shows its lines. A switch on the map shows the before, the after (each with the other side faded to a shadow), or both. It compares with a commit, so work you hadn't committed before the task counts too.
119
- 6. **Fix from the map.** Ask for a change and Claude proposes a fix, drawn as a green dashed arrow next to the exact diff.
178
+ 4. **Fix from the map.** Ask for a change and Claude proposes a fix, drawn as a green dashed arrow next to the exact diff.
120
179
  Nothing changes until you approve. Then illuminate writes exactly that change (refusing if the files changed since),
121
180
  re-checks the map, and offers Undo.
122
181