truemap-cli 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 truemap contributors
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,71 @@
1
- # Temporary Holding Version
1
+ <img src="docs/images/mark.svg" width="44" height="44" alt="">
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
+ # truemap
4
+
5
+ **A map of your codebase that your agent draws, and that stays true to the code.**
6
+
7
+ Your coding agent explains the project as HTML pages in your repo: a blueprint of the whole system, a page per module, the options when it needs your call. You read them in the browser, click any box to comment on it, and the agent answers right next to the page. Every box is pinned to real code, so when the code moves on, the map tells you.
8
+
9
+ ![The truemap workspace: a project blueprint with wires, a comment pinned to a box, and the agent's answer in the conversation panel](docs/images/workspace.png)
10
+
11
+ ## Why
12
+
13
+ Coding agents write code faster than anyone can read it. Their explanations come back as walls of text, and the diagrams they draw are gone after one chat.
14
+
15
+ - **Pages, not paragraphs.** The agent draws the architecture, a flow, or the options as a page and opens it for you.
16
+ - **Point at it.** Switch on Annotate, click a box or select a sentence, write a comment. Comments go out together, each with the code it points to. It is the agent session you already have open: no login, no extra app.
17
+ - **Click to decide.** When the agent needs your call, the page shows the options. One click and the answer is back with the agent.
18
+ - **Pages that stay true.** Every box carries a `data-src="path#name"` anchor. When that code changes or disappears, the box is marked and the agent fixes the page.
19
+ - **It stays in the repo.** Pages live in `.truemap/`, with `index.html` as the blueprint. Plain files you commit, diff and share.
20
+
21
+ ## Install
22
+
23
+ Install the skill once. That is the whole setup.
24
+
25
+ ```sh
26
+ npx skills add TaoMachina/truemap --skill truemap
27
+ ```
28
+
29
+ Then talk to your agent (Claude Code or Codex) as usual: *"How does payment work?"* or *"Show me the project."* The agent writes or updates a page and opens it. You can also ask directly: `/truemap draw the architecture`.
30
+
31
+ No skill installed? Tell the agent: *"use `npx -y truemap-cli --help`"*.
32
+
33
+ ## How it works
34
+
35
+ ```
36
+ your repo/
37
+ └── .truemap/
38
+ ├── index.html the blueprint: every module links to its page
39
+ ├── payments.html
40
+ ├── retry-decision.html
41
+ └── assets/theme.css optional: your brand colors and font
42
+ ```
43
+
44
+ | Command (run by the agent) | What it does |
45
+ |---|---|
46
+ | `npx -y truemap-cli [page] [--annotate]` | Opens the workspace in your browser, or switches the tab you already have open |
47
+ | `npx -y truemap-cli outline` | A compact map of the repo, so the first blueprint takes minutes, not an hour |
48
+ | `npx -y truemap-cli listen` | Waits for your next message or comments from the page |
49
+ | `npx -y truemap-cli reply "…" --listen` | Shows the answer in the conversation panel, then keeps listening |
50
+ | `npx -y truemap-cli check` | Checks every `data-src` anchor against the code |
51
+ | `npx -y truemap-cli guide` | The page-writing guide for agents: the map, anchors, decisions, design rules |
52
+
53
+ The checker works for any language. It uses git and a plain-text search:
54
+
55
+ - **No longer matches**: the path is gone, or `#name` no longer appears in the file (whole word, case-sensitive).
56
+ - **Changed in code**: the file changed after the page was last updated. The agent reviews it, then updates the page or runs `check --ok`.
57
+
58
+ Everything runs on your machine:
59
+
60
+ - The server listens on `127.0.0.1` only and needs a per-launch token.
61
+ - Pages render in a sandboxed frame on a separate origin, so page scripts can't reach the agent.
62
+ - Nothing leaves your machine. truemap keeps a local log of which commands ran (`~/.truemap/usage.jsonl`) and the chat history per repo (`~/.truemap/history/`); delete them any time.
63
+
64
+ ## Requirements
65
+
66
+ - Node.js 20 or newer
67
+ - git (optional; without it, only missing paths and names are checked)
68
+
69
+ ## License
70
+
71
+ MIT. Fonts: IBM Plex Sans and IBM Plex Mono, SIL Open Font License (`kit/fonts/OFL.txt`).
package/bin/truemap.js ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import { main } from '../src/cli.js';
3
+
4
+ // A reader that stops early (e.g. `| head`) is not an error.
5
+ process.stdout.on('error', (e) => { if (e.code === 'EPIPE') process.exit(0); throw e; });
6
+
7
+ main(process.argv.slice(2)).catch((err) => {
8
+ process.stdout.write(`status: error\nerror: ${JSON.stringify(String(err?.message || err))}\n`);
9
+ process.exit(1);
10
+ });
@@ -0,0 +1,93 @@
1
+ Copyright 2019 IBM Corp. All rights reserved. IBMPlexSans-Italic[wdth,wght].ttf: Copyright 2019 IBM Corp. All rights reserved.
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,290 @@
1
+ /* truemap page kit. truemap serves this file to every page in .truemap/ (assets/truemap.css).
2
+ To match a project's own look, put token overrides in .truemap/assets/theme.css – truemap appends it here. */
3
+
4
+ @font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("/__truemap/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
5
+ @font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("/__truemap/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
6
+ @font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("/__truemap/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
7
+ @font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/__truemap/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
8
+ @font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/__truemap/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
9
+
10
+ :root {
11
+ --tm-paper: #f6f7f4; /* page background */
12
+ --tm-sheet: #ffffff; /* boxes on the map */
13
+ --tm-wash: #eef0ec; /* quiet fills */
14
+ --tm-ink: #17202b; /* titles */
15
+ --tm-text: #2a3441; /* body text */
16
+ --tm-graphite: #5b6573; /* secondary text */
17
+ --tm-pencil: #8a939e; /* paths, hints */
18
+ --tm-rule: #dde1db;
19
+ --tm-rule-strong: #c2c8c1;
20
+ --tm-route: #2453c4; /* the one emphasis: the key path, links, decisions */
21
+ --tm-route-ink: #1b3f96;
22
+ --tm-route-wash: #e9eefb;
23
+ --tm-action: #2453c4; /* filled buttons */
24
+ --tm-changed: #a2690a;
25
+ --tm-changed-wash: #fbf2e0;
26
+ --tm-broken: #b03a2e;
27
+ --tm-broken-wash: #fbeae7;
28
+ --tm-fine: #2c7550;
29
+ --tm-fine-wash: #e5f1e9;
30
+ --tm-radius: 6px;
31
+ --tm-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
32
+ --tm-code: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
33
+ color-scheme: light dark;
34
+ }
35
+
36
+ @media (prefers-color-scheme: dark) {
37
+ :root {
38
+ --tm-paper: #121519;
39
+ --tm-sheet: #191d23;
40
+ --tm-wash: #1f242b;
41
+ --tm-ink: #edf0f3;
42
+ --tm-text: #d0d6dd;
43
+ --tm-graphite: #9ba4af;
44
+ --tm-pencil: #707a86;
45
+ --tm-rule: #2a3039;
46
+ --tm-rule-strong: #3d4651;
47
+ --tm-route: #7ea3ff;
48
+ --tm-route-ink: #a9c0ff;
49
+ --tm-route-wash: #1b2440;
50
+ --tm-action: #3a66d6;
51
+ --tm-changed: #d9a54a;
52
+ --tm-changed-wash: #2c2414;
53
+ --tm-broken: #ec8170;
54
+ --tm-broken-wash: #321b18;
55
+ --tm-fine: #73bd95;
56
+ --tm-fine-wash: #16271e;
57
+ }
58
+ }
59
+
60
+ /* ---------- base ---------- */
61
+ *, *::before, *::after { box-sizing: border-box; }
62
+ html { -webkit-text-size-adjust: 100%; }
63
+ body {
64
+ margin: 0;
65
+ overflow-x: clip;
66
+ background: var(--tm-paper);
67
+ color: var(--tm-text);
68
+ font: 16px/1.62 var(--tm-font);
69
+ font-feature-settings: "kern", "liga";
70
+ -webkit-font-smoothing: antialiased;
71
+ text-rendering: optimizeLegibility;
72
+ }
73
+ img, svg, video, canvas { max-width: 100%; }
74
+ p, li, td, th, h1, h2, h3, h4, dd { overflow-wrap: anywhere; }
75
+ p { margin: 0 0 1em; max-width: 68ch; }
76
+ strong, b { color: var(--tm-ink); font-weight: 600; }
77
+ a { color: var(--tm-route); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--tm-route) 40%, transparent); }
78
+ a:hover { text-decoration-color: var(--tm-route); }
79
+ :focus-visible { outline: 2px solid var(--tm-route); outline-offset: 2px; }
80
+ ::selection { background: var(--tm-route-wash); color: var(--tm-ink); }
81
+ h1, h2, h3, h4 { color: var(--tm-ink); font-weight: 600; text-wrap: balance; }
82
+ ul, ol { padding-left: 1.3em; max-width: 68ch; }
83
+ li { margin: 0.2em 0; }
84
+ li::marker { color: var(--tm-pencil); }
85
+ hr { border: 0; border-top: 1px solid var(--tm-rule); margin: 40px 0; }
86
+
87
+ /* ---------- page ---------- */
88
+ .tm-page { max-width: 960px; margin: 0 auto; padding: 48px 48px 112px; }
89
+ .tm-header { margin-bottom: 8px; }
90
+ .tm-crumb, .tm-eyebrow { font-size: 13.5px; color: var(--tm-graphite); margin: 0 0 14px; }
91
+ .tm-crumb a { color: var(--tm-graphite); text-decoration-color: var(--tm-rule-strong); }
92
+ .tm-crumb a:hover { color: var(--tm-route); }
93
+ .tm-title { font-size: 36px; line-height: 1.15; letter-spacing: -0.018em; margin: 0 0 14px; max-width: 22ch; }
94
+ .tm-lede { font-size: 18.5px; line-height: 1.55; color: var(--tm-graphite); margin: 0; max-width: 60ch; }
95
+ .tm-lede strong { color: var(--tm-text); font-weight: 500; }
96
+
97
+ .tm-section { margin-top: 64px; }
98
+ .tm-section > h2, .tm-h2 { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 8px; }
99
+ .tm-section > h2 + p { color: var(--tm-graphite); }
100
+ .tm-section h3 { font-size: 16.5px; line-height: 1.35; margin: 32px 0 8px; }
101
+ .tm-section > :last-child { margin-bottom: 0; }
102
+ .tm-muted { color: var(--tm-graphite); }
103
+ .tm-small { font-size: 13.5px; }
104
+
105
+ /* ---------- the map (blueprint) ---------- */
106
+ /* Rows are layers; boxes are real code. truemap draws the wires from data-to="id id". */
107
+ /* A map never wraps or stacks: when it is wider than the page it scrolls sideways, wires and all. */
108
+ /* The map may run wider than the text column, up to the right edge of the window. */
109
+ .tm-map, .tm-blueprint {
110
+ position: relative; margin: 20px 0 0; overflow-x: auto; overflow-y: hidden; padding: 10px 8px 14px 2px; scrollbar-width: thin;
111
+ width: 100%;
112
+ }
113
+ /* --tm-vw is the usable window width (without the scrollbar), set by truemap. */
114
+ html[style*="--tm-vw"] .tm-map, html[style*="--tm-vw"] .tm-blueprint { width: calc(var(--tm-vw) - max(48px, (var(--tm-vw) - 960px) / 2 + 48px) - 16px); min-width: 100%; }
115
+ .tm-map.tm-scrolls { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
116
+ .tm-layer { position: relative; display: grid; grid-template-columns: var(--tm-label-w, 112px) max-content; gap: 20px; align-items: start; width: max-content; min-width: 100%; }
117
+ .tm-layer + .tm-layer { margin-top: 44px; }
118
+ .tm-layer-label { font-size: 13px; color: var(--tm-pencil); padding-top: 12px; line-height: 1.35; }
119
+ .tm-layer-nodes { display: flex; flex-wrap: nowrap; gap: 18px 26px; }
120
+ .tm-layer-nodes > .tm-node { flex: 0 0 var(--tm-node-w, 216px); max-width: none; }
121
+ .tm-map > .tm-layer-nodes { margin-left: 132px; }
122
+
123
+ .tm-node, .tm-step {
124
+ position: relative; z-index: 1;
125
+ display: flex; flex-direction: column; flex: 0 1 216px; min-width: 156px; max-width: 280px;
126
+ padding: 11px 26px 12px 14px;
127
+ background: var(--tm-sheet); color: var(--tm-text);
128
+ border: 1px solid var(--tm-rule-strong); border-radius: var(--tm-radius);
129
+ text-decoration: none; line-height: 1.4;
130
+ transition: border-color 120ms ease, box-shadow 120ms ease;
131
+ }
132
+ a.tm-node:hover, a.tm-step:hover { border-color: var(--tm-graphite); }
133
+ .tm-node-title, .tm-step > b, .tm-step > strong { font-size: 15px; font-weight: 600; color: var(--tm-ink); }
134
+ .tm-node-sub { font-family: var(--tm-code); font-size: 12px; color: var(--tm-pencil); margin-top: 2px; overflow-wrap: anywhere; }
135
+ .tm-node-desc { font-size: 13.5px; line-height: 1.45; color: var(--tm-graphite); margin-top: 7px; }
136
+
137
+ /* The survey mark: a box pinned to real code (data-src) carries a small triangle. */
138
+ .tm-node[data-src]::after, .tm-step[data-src]::after, .tm-card[data-src]::after {
139
+ content: ""; position: absolute; top: 11px; right: 11px; width: 8px; height: 7px;
140
+ background: var(--tm-pencil); clip-path: polygon(50% 0, 100% 100%, 0 100%);
141
+ }
142
+ .tm-node.is-key, .tm-step.is-key { border-color: var(--tm-route); box-shadow: inset 0 0 0 1px var(--tm-route); }
143
+ .tm-node.is-key .tm-node-title, .tm-step.is-key > b, .tm-step.is-key > strong { color: var(--tm-route-ink); }
144
+ .tm-node.is-key::after, .tm-step.is-key::after { background: var(--tm-route); }
145
+ .tm-node.is-ext, .tm-step.is-ext { background: transparent; border-style: dashed; }
146
+ .tm-node.is-ext .tm-node-title, .tm-step.is-ext > b { color: var(--tm-graphite); font-weight: 500; }
147
+ .tm-node.is-new, .tm-step.is-new { border-color: var(--tm-fine); }
148
+ .tm-node.is-risk, .tm-step.is-risk { border-color: var(--tm-changed); }
149
+
150
+ /* Wires (drawn by truemap into svg.tm-wires) */
151
+ .tm-wires { position: absolute; top: 0; left: 0; max-width: none; pointer-events: none; overflow: visible; z-index: 0; }
152
+ .tm-wire { fill: none; stroke: var(--tm-rule-strong); stroke-width: 1.5; }
153
+ .tm-wire.is-key { stroke: var(--tm-route); stroke-width: 2; }
154
+ .tm-wire.is-ext { stroke-dasharray: 4 4; }
155
+ .tm-wire-head { fill: var(--tm-rule-strong); }
156
+ .tm-wire-head.is-key { fill: var(--tm-route); }
157
+ .tm-wire-label { font: 500 11.5px var(--tm-font); fill: var(--tm-graphite); paint-order: stroke; stroke: var(--tm-paper); stroke-width: 4px; stroke-linejoin: round; }
158
+
159
+ /* Legend under a map */
160
+ .tm-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 22px 0 0 132px; font-size: 13px; color: var(--tm-graphite); }
161
+ .tm-legend span { display: inline-flex; align-items: center; gap: 8px; }
162
+ .tm-legend i { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--tm-route); }
163
+ .tm-legend i.is-wire { border-top: 1.5px solid var(--tm-rule-strong); }
164
+ .tm-legend i.is-ext { border-top: 1.5px dashed var(--tm-rule-strong); }
165
+ .tm-legend i.is-mark { width: 8px; height: 7px; border: 0; background: var(--tm-pencil); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
166
+
167
+ /* ---------- flow: a real sequence ---------- */
168
+ .tm-flow { display: flex; align-items: stretch; gap: 30px; margin: 24px 0 8px; overflow-x: auto; padding: 2px 2px 6px; }
169
+ .tm-flow > .tm-step { flex: 1 1 0; min-width: 132px; max-width: none; }
170
+ .tm-flow > .tm-step + .tm-step::before {
171
+ content: ""; position: absolute; left: -26px; top: 50%; width: 21px; height: 0;
172
+ border-top: 1.5px solid var(--tm-rule-strong);
173
+ }
174
+ .tm-flow > .tm-step + .tm-step > :first-child::before {
175
+ content: ""; position: absolute; left: -8px; top: calc(50% - 4px); border: 4px solid transparent; border-left: 5px solid var(--tm-rule-strong); border-right: 0;
176
+ }
177
+ .tm-flow > .tm-step.is-key + .tm-step.is-key::before { border-top: 2px solid var(--tm-route); }
178
+ .tm-flow > .tm-step.is-key + .tm-step.is-key > :first-child::before { border-left-color: var(--tm-route); }
179
+ .tm-flow.is-vertical { flex-direction: column; gap: 26px; max-width: 420px; overflow: visible; }
180
+ .tm-flow.is-vertical > .tm-step { flex: none; }
181
+ .tm-flow.is-vertical > .tm-step + .tm-step::before { left: 50%; top: -22px; width: 0; height: 18px; border-top: 0; border-left: 1.5px solid var(--tm-rule-strong); }
182
+ .tm-flow.is-vertical > .tm-step + .tm-step > :first-child::before { left: calc(50% - 4px); top: -8px; border: 4px solid transparent; border-top: 5px solid var(--tm-rule-strong); border-bottom: 0; }
183
+
184
+ /* ---------- panels ---------- */
185
+ .tm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 20px 0; }
186
+ .tm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
187
+ .tm-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
188
+ .tm-card { position: relative; background: var(--tm-sheet); border: 1px solid var(--tm-rule); border-radius: var(--tm-radius); padding: 18px 20px; min-width: 0; }
189
+ .tm-card > h3 { margin: 0 0 6px; font-size: 15.5px; }
190
+ .tm-card > p { color: var(--tm-graphite); font-size: 14.5px; }
191
+ .tm-card > :last-child { margin-bottom: 0; }
192
+
193
+ .tm-callout { margin: 22px 0; padding: 14px 18px; border-radius: var(--tm-radius); background: var(--tm-wash); color: var(--tm-text); max-width: 72ch; }
194
+ .tm-callout > :last-child { margin-bottom: 0; }
195
+ .tm-callout > b:first-child, .tm-callout > strong:first-child { color: var(--tm-ink); }
196
+ .tm-callout.is-accent { background: var(--tm-route-wash); }
197
+ .tm-callout.is-accent > b:first-child, .tm-callout.is-accent > strong:first-child { color: var(--tm-route-ink); }
198
+ .tm-callout.is-ok { background: var(--tm-fine-wash); }
199
+ .tm-callout.is-ok > b:first-child, .tm-callout.is-ok > strong:first-child { color: var(--tm-fine); }
200
+ .tm-callout.is-warn { background: var(--tm-changed-wash); }
201
+ .tm-callout.is-warn > b:first-child, .tm-callout.is-warn > strong:first-child { color: var(--tm-changed); }
202
+ .tm-callout.is-bad { background: var(--tm-broken-wash); }
203
+ .tm-callout.is-bad > b:first-child, .tm-callout.is-bad > strong:first-child { color: var(--tm-broken); }
204
+
205
+ /* ---------- page links (on the blueprint) ---------- */
206
+ .tm-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 28px; margin: 18px 0; border-top: 1px solid var(--tm-rule); }
207
+ .tm-link { display: block; padding: 14px 0 15px; border-bottom: 1px solid var(--tm-rule); text-decoration: none; color: var(--tm-graphite); font-size: 14px; line-height: 1.45; }
208
+ .tm-link strong { display: block; font-size: 15.5px; color: var(--tm-ink); margin-bottom: 3px; }
209
+ .tm-link:hover strong { color: var(--tm-route); }
210
+
211
+ /* ---------- small things ---------- */
212
+ .tm-badge { display: inline-block; vertical-align: 0.1em; font: 500 11.5px/1.5 var(--tm-font); padding: 0 6px; border-radius: 4px; background: var(--tm-wash); color: var(--tm-graphite); white-space: nowrap; }
213
+ .tm-badge.is-accent { background: var(--tm-route-wash); color: var(--tm-route-ink); }
214
+ .tm-badge.is-ok { background: var(--tm-fine-wash); color: var(--tm-fine); }
215
+ .tm-badge.is-warn { background: var(--tm-changed-wash); color: var(--tm-changed); }
216
+ .tm-badge.is-bad { background: var(--tm-broken-wash); color: var(--tm-broken); }
217
+
218
+ code, kbd, samp { font-family: var(--tm-code); font-size: 0.88em; }
219
+ :not(pre) > code { background: var(--tm-wash); color: var(--tm-ink); padding: 1px 5px; border-radius: 4px; }
220
+ pre { font-family: var(--tm-code); font-size: 13px; line-height: 1.6; background: var(--tm-sheet); color: var(--tm-text); border: 1px solid var(--tm-rule); border-radius: var(--tm-radius); padding: 14px 16px; overflow-x: auto; margin: 18px 0; max-width: 100%; }
221
+ .tm-path { font-family: var(--tm-code); font-size: 12.5px; color: var(--tm-graphite); }
222
+
223
+ .tm-steps { list-style: none; counter-reset: tm-step; padding: 0; margin: 18px 0; max-width: 68ch; }
224
+ .tm-steps > li { counter-increment: tm-step; position: relative; padding: 0 0 14px 36px; margin: 0; }
225
+ .tm-steps > li::before {
226
+ content: counter(tm-step); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
227
+ border: 1px solid var(--tm-rule-strong); color: var(--tm-graphite); font: 500 12px/20px var(--tm-code); text-align: center; background: var(--tm-sheet);
228
+ }
229
+ .tm-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; border-left: 1px solid var(--tm-rule); }
230
+
231
+ .tm-table-wrap { overflow-x: auto; margin: 20px 0; }
232
+ .tm-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
233
+ .tm-table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--tm-graphite); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--tm-rule-strong); }
234
+ .tm-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--tm-rule); vertical-align: top; }
235
+ .tm-table tr:last-child td { border-bottom: 0; }
236
+
237
+ .tm-kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 8px 24px; margin: 18px 0; font-size: 14.5px; }
238
+ .tm-kv dt { color: var(--tm-graphite); }
239
+ .tm-kv dd { margin: 0; color: var(--tm-text); }
240
+
241
+ /* ---------- custom diagrams ---------- */
242
+ .tm-svg { display: block; width: 100%; height: auto; margin: 24px 0; font-family: var(--tm-font); }
243
+ .tm-svg .tm-box { fill: var(--tm-sheet); stroke: var(--tm-rule-strong); stroke-width: 1; }
244
+ .tm-svg .tm-box.is-key { stroke: var(--tm-route); stroke-width: 2; }
245
+ .tm-svg .tm-edge { fill: none; stroke: var(--tm-rule-strong); stroke-width: 1.5; }
246
+ .tm-svg .tm-edge.is-key { stroke: var(--tm-route); stroke-width: 2; }
247
+ .tm-svg .tm-label { fill: var(--tm-ink); font-size: 14px; font-weight: 600; }
248
+ .tm-svg .tm-sub { fill: var(--tm-pencil); font-size: 12px; font-family: var(--tm-code); }
249
+
250
+ /* ---------- decisions ---------- */
251
+ .tm-ask { margin: 28px 0; padding: 22px 24px 24px; background: var(--tm-sheet); border: 1px solid var(--tm-rule-strong); border-radius: calc(var(--tm-radius) + 2px); max-width: 720px; }
252
+ .tm-ask > h3 { margin: 0 0 6px; font-size: 18px; }
253
+ .tm-ask > p { color: var(--tm-graphite); font-size: 14.5px; }
254
+ .tm-options { display: grid; gap: 10px; margin: 16px 0; }
255
+ .tm-option { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 12px; padding: 13px 16px; border: 1px solid var(--tm-rule); border-radius: var(--tm-radius); cursor: pointer; background: var(--tm-sheet); transition: border-color 120ms ease, background-color 120ms ease; }
256
+ .tm-option:hover { border-color: var(--tm-rule-strong); }
257
+ .tm-option input { grid-row: 1 / span 2; margin: 3px 0 0; accent-color: var(--tm-route); width: 16px; height: 16px; }
258
+ .tm-option strong { font-size: 15px; }
259
+ .tm-option .tm-why { grid-column: 2; font-size: 13.5px; color: var(--tm-graphite); margin-top: 2px; }
260
+ .tm-option:has(input:checked) { border-color: var(--tm-route); background: var(--tm-route-wash); }
261
+ .tm-ask textarea { width: 100%; min-height: 64px; resize: vertical; font: 14.5px/1.5 var(--tm-font); color: var(--tm-text); background: var(--tm-paper); border: 1px solid var(--tm-rule); border-radius: var(--tm-radius); padding: 10px 12px; }
262
+ .tm-ask textarea:focus { outline: none; border-color: var(--tm-route); }
263
+ .tm-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font: 500 14.5px/1 var(--tm-font); padding: 11px 18px; border-radius: var(--tm-radius); border: 1px solid var(--tm-action); background: var(--tm-action); color: #fff; cursor: pointer; }
264
+ .tm-btn:hover { filter: brightness(0.92); }
265
+ .tm-btn.is-quiet { background: transparent; color: var(--tm-route); }
266
+ [data-tm-sent] .tm-btn { background: var(--tm-wash); border-color: var(--tm-rule); color: var(--tm-graphite); cursor: default; }
267
+ [data-tm-sent] .tm-option { cursor: default; }
268
+
269
+ /* ---------- small screens ---------- */
270
+ @media (max-width: 720px) {
271
+ .tm-page { padding: 28px 18px 80px; }
272
+ .tm-title { font-size: 28px; }
273
+ .tm-lede { font-size: 17px; }
274
+ .tm-section { margin-top: 48px; }
275
+ .tm-map { --tm-label-w: 72px; --tm-node-w: 184px; }
276
+ html[style*="--tm-vw"] .tm-map, html[style*="--tm-vw"] .tm-blueprint { width: calc(var(--tm-vw) - 26px); }
277
+ .tm-layer { gap: 12px; }
278
+ .tm-legend { margin-left: 0; }
279
+ .tm-node { flex: 1 1 100%; max-width: none; }
280
+ .tm-grid-2, .tm-grid-3 { grid-template-columns: minmax(0, 1fr); }
281
+ .tm-flow:not(.is-vertical) { flex-direction: column; gap: 26px; overflow: visible; }
282
+ .tm-flow:not(.is-vertical) > .tm-step { flex: none; }
283
+ .tm-flow:not(.is-vertical) > .tm-step + .tm-step::before { left: 50%; top: -22px; width: 0; height: 18px; border-top: 0; border-left: 1.5px solid var(--tm-rule-strong); }
284
+ .tm-flow:not(.is-vertical) > .tm-step + .tm-step > :first-child::before { left: calc(50% - 4px); top: -8px; border: 4px solid transparent; border-top: 5px solid var(--tm-rule-strong); border-bottom: 0; }
285
+ }
286
+
287
+ @media print {
288
+ body { background: #fff; }
289
+ .tm-page { padding: 0; }
290
+ }
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "truemap-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Agents explain your project with living HTML pages that stay true to the code. Click, ask, and decide right on the page.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/TaoMachina/truemap.git"
8
+ },
9
+ "homepage": "https://github.com/TaoMachina/truemap#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/TaoMachina/truemap/issues"
12
+ },
13
+ "type": "module",
14
+ "bin": {
15
+ "truemap": "bin/truemap.js"
16
+ },
17
+ "files": [
18
+ "bin/",
19
+ "src/",
20
+ "kit/",
21
+ "skills/",
22
+ "README.md",
23
+ "LICENSE"
24
+ ],
25
+ "engines": {
26
+ "node": ">=20"
27
+ },
28
+ "scripts": {
29
+ "test": "node --test"
30
+ },
31
+ "keywords": [
32
+ "agent",
33
+ "claude-code",
34
+ "codex",
35
+ "html",
36
+ "architecture",
37
+ "visualization",
38
+ "skill"
39
+ ],
40
+ "license": "MIT"
41
+ }
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: truemap
3
+ description: Explain a codebase with a living map in HTML that the user can comment on, ask about, and decide on. Use when explaining architecture, a module, a flow, or a data model; when comparing options or needing the user to decide; when asked "how does X work" or "show me the project"; and whenever a .truemap/ folder exists and you are about to explain something it may already cover. Not for one-line answers.
4
+ allowed-tools: Bash(npx -y truemap-cli:*), Bash(npx truemap-cli:*), Bash(truemap:*)
5
+ license: MIT
6
+ ---
7
+
8
+ # truemap
9
+
10
+ Pages live in `.truemap/` at the repo root (`index.html` is the project blueprint). They stay with the project and are checked against the code.
11
+
12
+ Current instructions live in the CLI – this file stays short so it never goes stale:
13
+
14
+ - `npx -y truemap-cli --help` – commands and the chat loop
15
+ - `npx -y truemap-cli outline` – a fast repo outline for the first blueprint
16
+ - `npx -y truemap-cli guide` – how to write pages: the map, `data-src` anchors, page kit, decision forms
17
+
18
+ Flow: look in `.truemap/` first, update or write the page, run `npx -y truemap-cli <page>` (add `--annotate` when you want the user's review), then follow the `next_step` it prints.
19
+ Always also give the user a 1–3 line answer in the terminal.
20
+
21
+ ## Request
22
+
23
+ $ARGUMENTS