plotleaf 0.3.0 → 0.3.1

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.
Files changed (3) hide show
  1. package/README.md +29 -0
  2. package/dist/cli.js +9 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,6 +8,33 @@ Beautiful, interactive reports from Markdown and prepared JSON. Built for coding
8
8
 
9
9
  A report is one Markdown file, optionally accompanied by local JSON datasets. No application, configuration file, account, database or hosted service. Export one HTML file that keeps working offline.
10
10
 
11
+ ## Start with your coding agent
12
+
13
+ Copy this into your agent and replace the report brief:
14
+
15
+ ```text
16
+ Create a polished, interactive report with plotleaf.
17
+
18
+ Report brief: [Describe the report and point to the data you want to use.]
19
+
20
+ Use Node 22+ and npx; no app scaffolding, Bun or account is needed.
21
+ First run `npx --yes plotleaf --help`. If it lists `guide`, read
22
+ `npx --yes plotleaf guide`. Otherwise read the authoring guide at:
23
+ https://raw.githubusercontent.com/LoueeD/plotleaf/v0.3.0/skills/plotleaf/SKILL.md
24
+ Then run `npx --yes plotleaf schema` for the installed component API.
25
+
26
+ Use the data I provide; don't invent values or findings. If the brief or
27
+ data is missing, ask for what's needed. Prepare one report.md and any local
28
+ JSON/assets it needs, following the guide and installed schema.
29
+
30
+ Run `npx --yes plotleaf validate report.md --json` and fix all errors.
31
+ Start `npx --yes plotleaf dev report.md --no-open` and give me the preview URL.
32
+ Build `npx --yes plotleaf build report.md --out report.html` and give me
33
+ the source and portable HTML paths, with any data limitations.
34
+ ```
35
+
36
+ The `guide` command is available in **0.3.1 or newer**. The prompt also works with 0.3.0 through the linked authoring guide.
37
+
11
38
  ## Status
12
39
 
13
40
  The initial MVP includes validation, live preview/reload, self-contained HTML export and a generated component specification. All bundled examples use fictional data.
@@ -30,6 +57,8 @@ npx plotleaf schema
30
57
 
31
58
  `plotleaf report.md` is an alias for `dev`. `build` defaults to `report.html` beside the source. Relative dataset paths resolve from the Markdown file's directory; an explicit `--out` resolves from the caller's working directory. Exports contain no preview connection and need no source files at viewing time.
32
59
 
60
+ For agent discovery, `npx plotleaf guide` (0.3.1+) prints the bundled report-authoring guide as Markdown, and `npx plotleaf schema` prints the component specification as JSON. The guide is the same `skills/plotleaf/SKILL.md` shipped with the package. These commands print documentation without creating files, changing project configuration or starting a server; once installed, they read local package content.
61
+
33
62
  ## A report
34
63
 
35
64
  ```markdown
package/dist/cli.js CHANGED
@@ -1892,7 +1892,7 @@ data: ${revision}
1892
1892
  // package.json
1893
1893
  var package_default = {
1894
1894
  name: "plotleaf",
1895
- version: "0.3.0",
1895
+ version: "0.3.1",
1896
1896
  description: "Beautiful, interactive reports from Markdown and JSON. Built for agents.",
1897
1897
  type: "module",
1898
1898
  license: "MIT",
@@ -1988,6 +1988,7 @@ Usage:
1988
1988
  npx plotleaf dev <report.md> [--no-open] [--port 3000]
1989
1989
  npx plotleaf validate <report.md> [--json] Validate syntax and local data
1990
1990
  npx plotleaf build <report.md> [--out report.html]
1991
+ npx plotleaf guide Read the report-authoring guide
1991
1992
  npx plotleaf schema Print component specifications
1992
1993
 
1993
1994
  Options:
@@ -2028,14 +2029,17 @@ async function main() {
2028
2029
  return;
2029
2030
  }
2030
2031
  const first = positionals[0];
2031
- const known = ["dev", "validate", "build", "schema"];
2032
+ const known = ["dev", "validate", "build", "schema", "guide"];
2032
2033
  const command = known.includes(first) ? first : "dev";
2033
2034
  const filename = known.includes(first) ? positionals[1] : first;
2034
2035
  const extras = positionals.slice(known.includes(first) ? 2 : 1);
2035
- if (command === "schema") {
2036
+ if (command === "schema" || command === "guide") {
2036
2037
  if (positionals.length !== 1 || Object.keys(values).length)
2037
- throw new Error("schema does not accept a report or options. Use plotleaf schema.");
2038
- console.log(JSON.stringify(componentSpec(), null, 2));
2038
+ throw new Error(`${command} does not accept a report or options. Use plotleaf ${command}.`);
2039
+ if (command === "guide")
2040
+ process.stdout.write(await readFile(new URL("../skills/plotleaf/SKILL.md", import.meta.url), "utf8"));
2041
+ else
2042
+ console.log(JSON.stringify(componentSpec(), null, 2));
2039
2043
  return;
2040
2044
  }
2041
2045
  if (!filename || extras.length)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plotleaf",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Beautiful, interactive reports from Markdown and JSON. Built for agents.",
5
5
  "type": "module",
6
6
  "license": "MIT",