lavish-axi 0.1.28 → 0.1.29

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
@@ -61,7 +61,7 @@ Then, in agents that expose skills as slash commands (Claude Code, for example),
61
61
  /lavish let's discuss our plan here
62
62
  ```
63
63
 
64
- Or just ask for anything that is easier to grasp visually - a plan, comparison, diagram, table, diff, or report - and the agent loads the skill on its own when it recognizes the task.
64
+ Or just ask for anything that is easier to grasp visually - a plan, comparison, diagram, table, code view, or report - and the agent loads the skill on its own when it recognizes the task.
65
65
 
66
66
  By default the skill lands in the current project's skills directory (`.claude/skills/`, for example); add `-g` to install it for all projects (`~/.claude/skills/`).
67
67
 
@@ -160,7 +160,7 @@ pnpm link
160
160
  | `lavish-axi setup hooks` | Install or repair optional SessionStart hooks for Claude Code, Codex, and OpenCode; restart the agent session afterward. |
161
161
  | `lavish-axi server` | Run the local Lavish Editor server. |
162
162
 
163
- Known playbook IDs: `diagram`, `table`, `comparison`, `plan`, `diff`, `input`, `slides`.
163
+ Known playbook IDs: `diagram`, `table`, `comparison`, `plan`, `code`, `input`, `slides`.
164
164
  One artifact often combines several playbooks, such as a plan that includes a comparison and a diagram, so read every playbook relevant to the artifact for the best quality.
165
165
 
166
166
  ### Flags
package/dist/cli.mjs CHANGED
@@ -621,31 +621,64 @@ var PLAYBOOKS = [
621
621
  lavish_notes: ["A Lavish plan should make a plan and its uncertainties easy to annotate before code exists."]
622
622
  },
623
623
  {
624
- id: "diff",
625
- use_when: "Present code or PR changes with evidence and findings",
624
+ id: "code",
625
+ use_when: "Render source code, code files, patches, PR diffs, and before/after code inside Lavish artifacts",
626
626
  choose: [
627
- "Use this when the artifact is meant to help a human inspect a diff, PR, or local change set.",
628
- "Use findings as the primary shape when bugs or regressions are possible.",
629
- "Use architecture and file maps when the change is broad enough that text diffs lose the thread."
627
+ "Use this whenever an artifact shows source code: a snippet, full file, patch, PR diff, local change set, or before/after code.",
628
+ "Use File for one code file, FileDiff for old/new versions or parsed patch metadata, and CodeView only when several files or diffs need coordinated navigation.",
629
+ "Choose split layout for careful side-by-side review when width allows; choose unified layout when space is tight, changes are mostly additive, or mobile readability matters."
630
630
  ],
631
631
  structure: [
632
- "Start with the review scope and the most important findings.",
633
- "Show changed areas, tests, docs implications, and any behavioral deltas.",
634
- "Keep evidence close to each claim with file paths, line references, or command outputs."
632
+ "Place the path, language, and reason to inspect the code immediately before each rendered file or diff.",
633
+ "Keep evidence close to each claim with file paths, line references, or annotations next to the relevant code.",
634
+ "For multi-file changes, group files by user-facing area or task instead of dumping a raw patch in repository order."
635
635
  ],
636
636
  design_rules: [
637
- "Order findings by severity before summaries or praise.",
638
- "Separate observed facts from inferred rationale.",
639
- "Use severity, confidence, and affected file references consistently."
637
+ `Rendering MUST use @pierre/diffs, not hand-rolled <pre> blocks or another diff library. This verified no-build standalone HTML snippet renders one file and one split diff from esm.sh:
638
+ \`\`\`html
639
+ <div id="file"></div>
640
+ <div id="diff"></div>
641
+ <script type="module">
642
+ import { File, FileDiff } from "https://esm.sh/@pierre/diffs@1.2.10?bundle";
643
+
644
+ const theme = { light: "github-light", dark: "github-dark" };
645
+ const options = { theme, themeType: "dark", overflow: "wrap" };
646
+ const oldFile = {
647
+ name: "src/greeting.ts",
648
+ contents: "export function greet(name: string) {\\n return \\"Hello \\" + name;\\n}\\n\\nconsole.log(greet(\\"Lavish\\"));\\n",
649
+ };
650
+ const newFile = {
651
+ name: "src/greeting.ts",
652
+ contents: "export function greet(name: string) {\\n return \\"Hello, \\" + name + \\"!\\";\\n}\\n\\nconsole.log(greet(\\"Lavish\\"));\\n",
653
+ };
654
+
655
+ new File(options).render({
656
+ containerWrapper: document.querySelector("#file"),
657
+ file: newFile,
658
+ });
659
+
660
+ new FileDiff({ ...options, diffStyle: "split" }).render({
661
+ containerWrapper: document.querySelector("#diff"),
662
+ oldFile,
663
+ newFile,
664
+ });
665
+
666
+ </script>
667
+ \`\`\``,
668
+ "Pick a Shiki theme pair that matches the artifact's DaisyUI or Tailwind direction and light or dark mode; replace the GitHub pair above when the page is not GitHub-like.",
669
+ 'Use FileDiff diffStyle: "split" for side-by-side review and diffStyle: "unified" for stacked reading; keep overflow: "wrap" unless horizontal alignment is essential.',
670
+ "Use @pierre/diffs line annotations, selections, and headers when calling out specific lines so notes stay attached to code."
640
671
  ],
641
672
  pitfalls: [
642
- "Do not make a review artifact that is only a pretty changelog.",
643
- "Do not state decision rationale as fact when it was inferred from code shape.",
644
- "Do not skip tests and docs impact when public behavior changes."
673
+ "Do not render code as static screenshots, plain <pre> blocks, or markdown pasted into HTML.",
674
+ "Do not choose an arbitrary default Shiki theme that clashes with the page palette or dark mode.",
675
+ "Do not show huge unrelated files when a focused render range, parsed patch file, or grouped summary would be clearer.",
676
+ "Do not separate a claim from the code lines that prove it."
645
677
  ],
646
678
  lavish_notes: [
647
- "A Lavish review should let the user click a finding and ask for the exact fix or clarification.",
648
- "If no issue is found in a category, say so explicitly rather than leaving ambiguity."
679
+ "A Lavish code artifact should make each file, hunk, and relevant line easy to annotate precisely.",
680
+ "When a user action should trigger a fix, queue prompts that name the file path, line range, and desired change.",
681
+ "If the artifact combines code with a plan, table, or comparison, read those playbooks too and keep @pierre/diffs responsible for the code surface."
649
682
  ]
650
683
  },
651
684
  {
@@ -1971,7 +2004,7 @@ function normalizePagePath(path5) {
1971
2004
  // src/cli.js
1972
2005
  var COMMANDS = /* @__PURE__ */ new Set(["open", "poll", "end", "stop", "server", "playbook", "design", "setup"]);
1973
2006
  var DESCRIPTION = "Lavish Editor helps agents turn rich HTML artifacts into collaborative human review surfaces. Whenever you are about to give user a complex response that will be easier to understand via a rich / interactive page, consider using Lavish Editor. First generate an interactive HTML artifact according to user request, then run `lavish-axi <html-file>` so the user can visually review it, annotate elements or selected text, queue prompts, and send feedback back through `lavish-axi poll`.";
1974
- var VERSION = "0.1.28";
2007
+ var VERSION = "0.1.29";
1975
2008
  async function run(argv) {
1976
2009
  await ensureStateDir();
1977
2010
  const normalizedArgv = normalizeArgv(argv);
@@ -2547,7 +2580,7 @@ Shut down the background Lavish Editor server. The server also stops itself when
2547
2580
  `,
2548
2581
  playbook: `Usage: lavish-axi playbook [playbook_id]
2549
2582
 
2550
- List focused artifact guidance playbooks, or show one playbook by ID. Known IDs: diagram, table, comparison, plan, diff, input, slides.
2583
+ List focused artifact guidance playbooks, or show one playbook by ID. Known IDs: diagram, table, comparison, plan, code, input, slides.
2551
2584
 
2552
2585
  One artifact often combines several playbooks (for example a plan that includes a comparison and a diagram), so read every playbook relevant to the artifact, not just one, for the best quality.
2553
2586
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lavish-axi",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "packageManager": "pnpm@11.1.1",
5
5
  "description": "HTML is the new markdown. Lavish is the new editor for your HTML artifacts.",
6
6
  "type": "module",
@@ -53,7 +53,7 @@ One artifact often combines several playbooks (for example a plan that includes
53
53
  - `table` - Turn dense records into scan-friendly review surfaces
54
54
  - `comparison` - Show options, tradeoffs, and current vs target behavior
55
55
  - `plan` - Explain a product or technical plan before implementation
56
- - `diff` - Present code or PR changes with evidence and findings
56
+ - `code` - Render source code, code files, patches, PR diffs, and before/after code inside Lavish artifacts
57
57
  - `input` - Must be used when the agent needs to collect user input on decisions, choices, preferences, triage, scope, or other structured feedback from within the artifact
58
58
  - `slides` - Create a deliberate presentation when slides are requested
59
59