@johnz4021/illuminate 0.0.0-stage → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 johnz4021
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,141 @@
1
- # Temporary Holding Version
1
+ # illuminate
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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.
6
+
7
+ Design: [Codemap v1 Design](https://claude.ai/artifact/55L8tokprGe61qtfpDXJ5h).
8
+
9
+ ## Use it in Claude Code (no API key)
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.
14
+
15
+ In Claude Code (2.1.275 or later), in any repo:
16
+
17
+ ```
18
+ /plugin install illuminate --marketplace johnz4021/codemap
19
+ ```
20
+
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`.
23
+
24
+ From a checkout of this repo instead (for working on illuminate):
25
+
26
+ ```
27
+ npm i && npm run build
28
+ claude mcp add --scope user illuminate -- node "$PWD/packages/server/bin/illuminate.mjs" channel
29
+ ```
30
+
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).
39
+
40
+ 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
+ listening holds your terminal until you ask on the map. Starting Claude Code with
42
+ `--dangerously-load-development-channels server:illuminate` is optional: it also pushes questions into the session
43
+ when nothing is listening.
44
+
45
+ Differences from the CLI: Claude works with your session's own tools and permissions, so the read-only tools and the
46
+ secret-file guard of the Agent SDK session aren't enforced, only asked for. Everything shown still passes the checker,
47
+ and fixes are still applied by illuminate only after you approve them.
48
+
49
+ ## Use it from the command line (API key)
50
+
51
+ ```
52
+ npm i
53
+ npm run build # the viewer
54
+ npm run illume -- "What happens when a user signs up?" --repo /path/to/your/repo
55
+ ```
56
+
57
+ It prints a link (`http://127.0.0.1:4317/m/<id>?t=<token>`) and opens it. illuminate stops on its own about 30 seconds after
58
+ you close its last tab (never while Claude is working), or when you press Stop illuminate on the page. Maps are saved in the target repo under
59
+ `.illuminate/maps/`; commit them to share. Other commands:
60
+
61
+ ```
62
+ npm run illume -- open --repo <dir> # maps already made in that repo
63
+ npm run illume -- check <map-id> --repo <dir> # re-check a saved map against the code (exit 1 if a claim fails)
64
+ ```
65
+
66
+ Options: `--port <n>` (default 4317), `--no-open`, `--model <id>` (default `claude-opus-5-5`, or `ILLUMINATE_MODEL`).
67
+
68
+ Claude access: an `ANTHROPIC_API_KEY` (a logged-in Claude Code also works for your own use, but don't hand illuminate to
69
+ others that way: Anthropic doesn't allow products on the Agent SDK to use people's claude.ai sign-in). To keep the key in a file,
70
+ `cp .env.example .env` at the root of this checkout and fill it in; the CLI loads it, and your shell's variables win.
71
+
72
+ To put `illuminate` on your PATH: `npm link -w @illuminate/server`.
73
+
74
+ ### From a coding agent
75
+
76
+ `plugin/skills/illuminate/SKILL.md` is a skill in the standard `SKILL.md` format (the plugin installs it in Claude Code). Copy the `illuminate` folder into
77
+ `.claude/skills/` (Claude Code), `.agents/skills/` (Codex, Gemini CLI) or `.cursor/skills/` (Cursor). Your agent then
78
+ runs illuminate when you ask how something works, and hands you the link.
79
+
80
+ ### Try it without a model
81
+
82
+ ```
83
+ npm run preview
84
+ ```
85
+
86
+ The real server and viewer on a throwaway copy of the care-app fixture, with a scripted stand-in for Claude. Nothing
87
+ is sent anywhere. Useful for UI work and demos.
88
+
89
+ ### Screens on the map
90
+
91
+ 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
96
+ can tie it to the code. Screenshots are saved under `.illuminate/screens/`.
97
+
98
+ ## How it works
99
+
100
+ 1. **Make a map.** A deterministic scan gives Claude a head start (entry points, routes, which requests hit which
101
+ routes, which tables are written). Claude explores with Read/Grep/Glob only and returns the map in a fixed format.
102
+ 2. **Check every claim.** `check()` re-reads each cited line, verifies calls, requests and imports against code facts,
103
+ and re-runs the search behind every "nothing does X". Claude gets up to two rounds to fix what didn't hold. Anything
104
+ still unconfirmed is shown with a "?", never hidden. The check proves each part is real code; it doesn't prove the
105
+ map covers everything, and each gap shows the search behind it so you can judge that yourself.
106
+ 3. **Explore.** The viewer draws areas, steps, labeled arrows and red dashed gaps, with a walkthrough Claude wrote. Select
107
+ anything and ask, as a conversation: replies are short and lead with the answer, and the map does the explaining (each reply
108
+ lights up what it's about). Claude explores further when the map isn't enough; what it finds is drawn only if it
109
+ 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.
120
+ Nothing changes until you approve. Then illuminate writes exactly that change (refusing if the files changed since),
121
+ re-checks the map, and offers Undo.
122
+
123
+ ## Packages
124
+
125
+ | Package | What it does |
126
+ | --- | --- |
127
+ | `@illuminate/facts` | What the code says, read deterministically: imports, symbols, calls, routes, table reads and writes, fetch → route links. TS/JS via oxc, Python and Go via tree-sitter. Carried over from the hackathon harness with its tests. |
128
+ | `@illuminate/core` | The map format (`parseMap`), the checker (`check`), map edits, and read-only repo access that never reads secrets. |
129
+ | `@illuminate/server` | The Claude map maker and explainer (Agent SDK, read-only tools, secret guard), fixes, the local HTTP/WebSocket server, and the `illume` CLI. |
130
+ | `@illuminate/viewer` | The React Flow + ELK viewer: the map, walkthrough, answers, fixes and the input bar. |
131
+
132
+ ## Development
133
+
134
+ ```
135
+ npm test # every package (no model calls; Claude is scripted in tests)
136
+ npm run typecheck
137
+ npm run build # the viewer bundle the server serves
138
+ ```
139
+
140
+ `packages/core/test/fixtures/care-app` is the reference app: staff convert a patient, the app announces it, nothing
141
+ listens, so the welcome email never goes out. `care-app.map.json` is the map of that question.
package/bin/illume.mjs ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ // The published illuminate command: the bundled CLI (see scripts/release.mjs in the illuminate repo).
3
+ await import('../dist/cli.mjs');