lavish-axi 0.1.28 → 0.1.30
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 +5 -3
- package/dist/cli.mjs +54 -21
- package/package.json +1 -1
- package/skills/lavish/SKILL.md +2 -2
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,
|
|
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
|
|
|
@@ -130,7 +130,9 @@ pnpm link
|
|
|
130
130
|
- **File-path identity** - Sessions are keyed by the canonical HTML file path, so agents do not need opaque IDs.
|
|
131
131
|
- **Portable artifacts** - The artifact runs in an iframe while Lavish injects a small SDK for annotations, snapshots, and feedback controls.
|
|
132
132
|
Lavish does not inject any design system, so the saved HTML file renders identically whether you open it through `lavish-axi` or directly in a browser.
|
|
133
|
-
Before writing HTML, choose a design system in strict priority order: follow a user-requested look first; otherwise inspect the
|
|
133
|
+
Before writing HTML, choose a design system in strict priority order: follow a user-requested look first; otherwise inspect the project the artifact is about - the subject or product whose content or UI it represents, which may differ from your current working directory - and match that project's Tailwind or theme config, CSS variables or design tokens, component library, brand assets, or existing styled pages.
|
|
134
|
+
If the artifact previews, proposes, or mocks a specific app's UI, render it in that app's own design system so it faithfully shows the product, even when you are running in a different repo.
|
|
135
|
+
Only when both come up empty, run `lavish-axi design` for a copy-pasteable Tailwind CSS v4 + DaisyUI v5 CDN fallback.
|
|
134
136
|
That fallback guidance recommends DaisyUI's `luxury` theme by default and warns not to `@apply` DaisyUI classes inside Tailwind browser-runtime style blocks.
|
|
135
137
|
- **Local assets** - Copy local images, CSS, fonts, and scripts next to the HTML artifact and reference them with relative paths from that directory; root-prefixed paths such as `/assets/logo.png` will not resolve through Lavish's artifact route.
|
|
136
138
|
- **Live reload** - Lavish watches the HTML artifact file by default and preserves the artifact iframe scroll position across reloads. To also reload on sibling asset changes, add `data-lavish-live-reload-root` to the root element or `<meta name="lavish-live-reload" content="root">`.
|
|
@@ -160,7 +162,7 @@ pnpm link
|
|
|
160
162
|
| `lavish-axi setup hooks` | Install or repair optional SessionStart hooks for Claude Code, Codex, and OpenCode; restart the agent session afterward. |
|
|
161
163
|
| `lavish-axi server` | Run the local Lavish Editor server. |
|
|
162
164
|
|
|
163
|
-
Known playbook IDs: `diagram`, `table`, `comparison`, `plan`, `
|
|
165
|
+
Known playbook IDs: `diagram`, `table`, `comparison`, `plan`, `code`, `input`, `slides`.
|
|
164
166
|
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
167
|
|
|
166
168
|
### Flags
|
package/dist/cli.mjs
CHANGED
|
@@ -20,7 +20,7 @@ var DESIGN_CDN_URLS = {
|
|
|
20
20
|
var DESIGN_CDN_SNIPPET = `<link rel="stylesheet" href="${DESIGN_CDN_URLS.daisyui}">
|
|
21
21
|
<link rel="stylesheet" href="${DESIGN_CDN_URLS.daisyuiThemes}">
|
|
22
22
|
<script src="${DESIGN_CDN_URLS.tailwind}"></script>`;
|
|
23
|
-
var DESIGN_SYSTEM_HINT = "Lavish does not auto-inject any design system - artifacts stay portable so they render identically when opened directly without lavish-axi running. Before writing any HTML, decide the design direction in this strict priority order, and only move to the next step when the current one truly yields nothing: (1) if the user asked for a specific look or named design system, use that; (2) otherwise you must first inspect the
|
|
23
|
+
var DESIGN_SYSTEM_HINT = "Lavish does not auto-inject any design system - artifacts stay portable so they render identically when opened directly without lavish-axi running. Before writing any HTML, decide the design direction in this strict priority order, and only move to the next step when the current one truly yields nothing: (1) if the user asked for a specific look or named design system, use that; (2) otherwise you must first inspect the project the artifact is about - the subject or product whose content or UI it represents, which may differ from your current working directory - and match that project's design system: Tailwind or theme config, shared CSS variables or design tokens, component library, brand assets, or existing styled pages. If the artifact previews, proposes, or mocks a specific app's UI, render it in that app's own design system so it faithfully shows the product, even when you are running in a different repo; (3) only when both steps come up empty, use the Lavish-recommended Tailwind CSS browser runtime v4 + DaisyUI v5, available via CDN - run `lavish-axi design` for a copy-pasteable CDN snippet plus component reference, and prefer that CDN snippet over hand-writing styles unless explicitly instructed otherwise by the user. When you deliver the artifact, state which of the three design sources you used and why.";
|
|
24
24
|
var DAISYUI_THEMES = [
|
|
25
25
|
"light",
|
|
26
26
|
"dark",
|
|
@@ -61,7 +61,7 @@ var DAISYUI_THEMES = [
|
|
|
61
61
|
function createDesignOutput() {
|
|
62
62
|
return {
|
|
63
63
|
design: {
|
|
64
|
-
summary: "Use this Lavish CDN fallback only if (1) the user gave no design direction and (2) you already inspected the current
|
|
64
|
+
summary: "Use this Lavish CDN fallback only if (1) the user gave no design direction and (2) you already inspected the project the artifact is about - the subject or product whose content or UI it represents, which may differ from your current working directory - and found no design system or style conventions to match. If you have not checked the subject project yet, check first. Lavish does not auto-inject any design system; artifacts stay portable HTML. The strict priority order is: (1) a look or named design system the user asked for; (2) the subject project's design system or style conventions - look for a Tailwind or theme config, shared CSS variables or design tokens, a component library, brand assets, or existing styled pages. If the artifact previews, proposes, or mocks a specific app's UI, render it in that app's own design system so it faithfully shows the product, even when you are running in a different repo; (3) this Tailwind CSS browser runtime v4 + DaisyUI v5 + themes snippet - paste the CDN snippet below into your `<head>` and prefer the CDN snippet over hand-writing styles unless explicitly instructed otherwise by the user.",
|
|
65
65
|
cdn_snippet: DESIGN_CDN_SNIPPET,
|
|
66
66
|
cdn_urls: DESIGN_CDN_URLS,
|
|
67
67
|
versions: { tailwind: TAILWIND_BROWSER_VERSION, daisyui: DAISYUI_VERSION },
|
|
@@ -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: "
|
|
625
|
-
use_when: "
|
|
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
|
|
628
|
-
"Use
|
|
629
|
-
"
|
|
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
|
-
"
|
|
633
|
-
"
|
|
634
|
-
"
|
|
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
|
-
|
|
638
|
-
|
|
639
|
-
|
|
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
|
|
643
|
-
"Do not
|
|
644
|
-
"Do not
|
|
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
|
|
648
|
-
"
|
|
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.
|
|
2007
|
+
var VERSION = "0.1.30";
|
|
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,
|
|
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
|
|
|
@@ -2558,7 +2591,7 @@ Examples:
|
|
|
2558
2591
|
`,
|
|
2559
2592
|
design: `Usage: lavish-axi design
|
|
2560
2593
|
|
|
2561
|
-
Show a copy-pasteable CDN snippet for Tailwind CSS browser runtime v4 + DaisyUI v5 + themes, plus technical reference for DaisyUI components. Lavish artifacts stay portable HTML. This CDN snippet is the design fallback, not the default: inspect the project before falling back. The strict priority order is: (1) if the user asked for a specific look or named design system, follow that; (2) otherwise,
|
|
2594
|
+
Show a copy-pasteable CDN snippet for Tailwind CSS browser runtime v4 + DaisyUI v5 + themes, plus technical reference for DaisyUI components. Lavish artifacts stay portable HTML. This CDN snippet is the design fallback, not the default: inspect the subject project before falling back. The strict priority order is: (1) if the user asked for a specific look or named design system, follow that; (2) otherwise, match the design system of the project the artifact is about, not necessarily your current working directory. If the artifact previews, proposes, or mocks a specific app's UI, use that app's own design system; (3) only when both come up empty, prefer the Lavish-recommended Tailwind + DaisyUI CDN snippet over hand-writing styles unless explicitly instructed otherwise by the user.
|
|
2562
2595
|
`,
|
|
2563
2596
|
setup: `Usage: lavish-axi setup hooks
|
|
2564
2597
|
|
package/package.json
CHANGED
package/skills/lavish/SKILL.md
CHANGED
|
@@ -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
|
-
- `
|
|
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
|
|
|
@@ -66,5 +66,5 @@ One artifact often combines several playbooks (for example a plan that includes
|
|
|
66
66
|
- Run `npx -y lavish-axi end <html-file>` to end a session
|
|
67
67
|
- Run `npx -y lavish-axi stop` to shut down the background server (it also self-stops when idle or after the last session ends with nothing connected)
|
|
68
68
|
- Run `npx -y lavish-axi playbook <playbook_id>` for focused artifact guidance. 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
|
|
69
|
-
- Lavish does not auto-inject any design system - artifacts stay portable so they render identically when opened directly without lavish-axi running. Before writing any HTML, decide the design direction in this strict priority order, and only move to the next step when the current one truly yields nothing: (1) if the user asked for a specific look or named design system, use that; (2) otherwise you must first inspect the
|
|
69
|
+
- Lavish does not auto-inject any design system - artifacts stay portable so they render identically when opened directly without lavish-axi running. Before writing any HTML, decide the design direction in this strict priority order, and only move to the next step when the current one truly yields nothing: (1) if the user asked for a specific look or named design system, use that; (2) otherwise you must first inspect the project the artifact is about - the subject or product whose content or UI it represents, which may differ from your current working directory - and match that project's design system: Tailwind or theme config, shared CSS variables or design tokens, component library, brand assets, or existing styled pages. If the artifact previews, proposes, or mocks a specific app's UI, render it in that app's own design system so it faithfully shows the product, even when you are running in a different repo; (3) only when both steps come up empty, use the Lavish-recommended Tailwind CSS browser runtime v4 + DaisyUI v5, available via CDN - run `npx -y lavish-axi design` for a copy-pasteable CDN snippet plus component reference, and prefer that CDN snippet over hand-writing styles unless explicitly instructed otherwise by the user. When you deliver the artifact, state which of the three design sources you used and why.
|
|
70
70
|
- Use lavish-axi when the user asks for a visual artifact, HTML explainer, interactive prototype, review surface, product or technical plan, comparison, report, or browser-based feedback loop
|