@marshalliqiu/loupe 0.1.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 Kun Chen
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 ADDED
@@ -0,0 +1,116 @@
1
+ # 🔍 Loupe
2
+
3
+ **Inspect a change before you build it.**
4
+
5
+ Loupe is a spec-phase tool that turns a proposed change into a structured, interactive review
6
+ surface — so you grasp it by _looking_ and _clicking_ instead of reading walls of text. It is a
7
+ fork of [lavish-axi](https://github.com/kunchenguid/lavish-axi): it keeps lavish's transport
8
+ (local server, browser review, annotate, long-poll feedback) and adds a guaranteed structure on top.
9
+
10
+ Every Loupe artifact has the same three sections:
11
+
12
+ | Section | What it shows |
13
+ | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
14
+ | **§A Current World** | A map of the relevant use cases as they are today, with the **blast radius** (the parts this change touches) highlighted. |
15
+ | **§B Grill** | Interactive cards you answer by **clicking** — single/multi choice, with an open field on every card for nuance. Your answers shape the vision. |
16
+ | **§C Goal Vision** | The **before → after** of the agreed change, re-drawn from your grill answers so the delta is visible at a glance. |
17
+
18
+ The structure is guaranteed by code (a scaffold), not by asking the agent nicely — so artifacts
19
+ can't decay into a bullet list of nouns. Diagrams default to **mermaid**: clarity over polish.
20
+
21
+ ## Two lenses, one gate
22
+
23
+ A change has two truths to review, so every artifact has two **lenses**, with a hard **gate** between:
24
+
25
+ ```
26
+ Product Lens §A use cases + blast radius · §B grill · §C UX before→after
27
+ │ you click "Lock product intent" ← the gate (a soft signal)
28
+
29
+ Code Lens (filled after lock) §A architecture + blast radius · §B grill · §C interface/arch before→after
30
+ ```
31
+
32
+ The agent fills the Code Lens only after you agree the product change — then it reads the **real
33
+ codebase** (greenfield projects are designed from scratch). The gate is a _soft signal_: the Code
34
+ Lens is never locked or blurred, so the whole artifact stays freely editable and annotatable (the
35
+ HTML is the source of truth). Reopening the product intent from the Code Lens is an explicit click,
36
+ so a code note can't silently overturn the agreed product change. Use `loupe new --product-only` to
37
+ skip the Code Lens for small changes, or `loupe new --greenfield` when there is no codebase yet — the
38
+ Code Lens then becomes a from-scratch architecture proposal (§A proposed architecture, §C interfaces
39
+ to build) instead of a current → after.
40
+
41
+ ## Flow
42
+
43
+ ```
44
+ loupe new <file> → agent fills the Product Lens (§A + blast radius, Grill Cards)
45
+
46
+ loupe <file> → you review, answer the Grill Cards by clicking, see §C before → after
47
+
48
+ [Lock product intent] → agent reads the codebase, fills the Code Lens (§A/§B/§C)
49
+
50
+ [Execute] → agent runs `loupe spec`, persists the decisions, starts building
51
+ ```
52
+
53
+ Your annotations are **triaged**: a _tweak_ (wording, a wrong arrow) is patched in place; a
54
+ _follow-up_ (a question) is answered in the relevant section; _directional_ feedback (challenging the
55
+ agreed change) is never silently applied — the agent asks you to confirm reopening the product intent
56
+ first. The artifact ends with a **Decision** — Execute / Adjust / Cancel. Execute persists a companion
57
+ spec (`loupe spec <file>` → `<file>.spec.md`: the decisions + a link to the HTML) and hands the
58
+ change back to the agent to implement; it does not make you copy-paste a plan.
59
+
60
+ ## Usage
61
+
62
+ ```sh
63
+ loupe new spec/guest-checkout.html # scaffold the §A/§B/§C structure
64
+ # (the agent fills the `LOUPE — fill:` slots: draws §A in mermaid, writes real Grill Cards)
65
+ loupe spec/guest-checkout.html # open the review in your browser
66
+ loupe poll spec/guest-checkout.html # long-poll for your grill answers and annotations
67
+ loupe spec spec/guest-checkout.html # on Execute: write the companion spec (guest-checkout.spec.md)
68
+ ```
69
+
70
+ `loupe new` also accepts `--title "..."`, `--problem "..."`, `--product-only`, `--greenfield`, and `--force`.
71
+
72
+ ## Install
73
+
74
+ **Zero setup.** Loupe is an AXI — any capable agent can run the CLI with nothing installed. Just tell your agent:
75
+
76
+ > Use `npx @marshalliqiu/loupe new <file>` to map out what we discussed before building it.
77
+
78
+ **Session hook.** Want Loupe's ambient context — including your live open sessions — fed into every agent session instead of loading on demand? Install globally and opt into the hook:
79
+
80
+ ```sh
81
+ npm install -g @marshalliqiu/loupe
82
+ loupe setup hooks
83
+ ```
84
+
85
+ This installs a `SessionStart` hook for Claude Code, Codex, and OpenCode that surfaces open sessions, playbooks, and usage guidance at the start of each session. Restart your agent session afterward so the hook takes effect.
86
+
87
+ **From source.**
88
+
89
+ ```sh
90
+ git clone https://github.com/jerry5789k1/loupe.git
91
+ cd loupe
92
+ pnpm install --frozen-lockfile
93
+ pnpm run build
94
+ npm link # puts `loupe` on your PATH (or: pnpm link --global)
95
+ ```
96
+
97
+ ## Develop
98
+
99
+ ```sh
100
+ pnpm install
101
+ pnpm run check # build + lint + format + typecheck + tests + skill freshness
102
+ ```
103
+
104
+ See [`CONTEXT.md`](CONTEXT.md) for the domain model, [`docs/adr/`](docs/adr) for the foundational
105
+ decisions, and [`docs/v1-build-decisions.md`](docs/v1-build-decisions.md) for how v1 was built.
106
+
107
+ ## Status
108
+
109
+ Both lenses with the soft gate (Product → lock → Code, grounded in the real codebase), each with
110
+ §A Current World / §B Grill / §C Goal Vision, plus the Decision step: Execute persists a companion
111
+ spec and hands off to implementation. Deferred: the annotation-grading loop and richer greenfield
112
+ support.
113
+
114
+ ---
115
+
116
+ Forked from [lavish-axi](https://github.com/kunchenguid/lavish-axi) by Kun Chen (MIT).