Skip to content

stark-ai-de/agent-skills / plugins/stark-ai-developer/skills/visual-reports

visual-reports

Verified

Create and update visual reports with optional native interaction, one guided topic at a time, useful diagrams, concise points, joint comparisons and complete offline HTML/Markdown/JSON exports. Use when richer output helps an authorized answer or the user asks for a visual report; keep small answers in chat. Not production application UI or clinical advice.

FileKindSize
SKILL.mdskill md11.5 KB
agents/openai.yamlconfig779 B
assets/completion-example.mdmarkdown3.2 KB
assets/graphite-grain/configurator.htmlother17.7 KB
assets/graphite-grain/configurator.mjsscript6.9 KB
assets/graphite-grain/relaxed.cssother4.2 KB
assets/openai-icon.pngbinary10.3 KB
assets/openai-icon.svgother318 B
assets/preview.jsscript3.4 KB
assets/report-recipes.mjsscript19.2 KB
assets/report-runtime.cssother16.4 KB
assets/report-runtime.jsscript23.9 KB
assets/report-shell.htmlother14.1 KB
references/comparisons.mdmarkdown4.8 KB
references/filesystem-handoff.mdmarkdown4.7 KB
references/managed-reports.mdmarkdown5.2 KB
references/markdown-input.mdmarkdown3.9 KB
references/model-v2.mdmarkdown10.1 KB
references/renderer.mdmarkdown24.5 KB
references/report-contract.mdmarkdown33.1 KB
references/selection.mdmarkdown4.8 KB
scripts/benchmark.mjsscript2.2 KB
scripts/cache_icon.pyscript9.2 KB
scripts/export-assets.mjsscript4.1 KB
scripts/lib/blocks-v2.mjsscript21.7 KB
scripts/lib/cli.mjsscript3.7 KB
scripts/lib/export-path.mjsscript1.6 KB
scripts/lib/generator-entry.mjsscript472 B
scripts/lib/markdown-input.mjsscript9.8 KB
scripts/lib/preview.mjsscript4.9 KB
scripts/lib/report-state.mjsscript13.4 KB
scripts/lib/report-store.mjsscript7.0 KB
scripts/lib/templates.mjsscript4.7 KB
scripts/render-report.mjsscript40.0 KB
tests/browser-delivery.mjsscript25.4 KB
tests/browser-smoke.pyscript15.5 KB
tests/browser-topics.mjsscript21.1 KB
tests/cache-icon.test.mjsscript5.0 KB
tests/export-assets.test.mjsscript5.5 KB
tests/render-report.test.mjsscript14.3 KB
tests/report-state.test.mjsscript11.7 KB
tests/topics.test.mjsscript6.4 KB
tests/v2.test.mjsscript21.1 KB

tests/export-assets.test.mjs

View on GitHub
// Hermetic Git fixtures only; no staging or user-repository mutation.
// SPDX-License-Identifier: Apache-2.0
import test from "node:test";
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import { execFileSync } from "node:child_process";
import {
  cp,
  mkdtemp,
  mkdir,
  readFile,
  writeFile,
  readdir,
  rm,
  symlink,
  rename,
} from "node:fs/promises";
import { tmpdir } from "node:os";
import path from "node:path";
import { fileURLToPath } from "node:url";
const source = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
async function fixture() {
  const temp = await mkdtemp(path.join(tmpdir(), "visual-report-export-"));
  const repo = path.join(temp, "repo"),
    skill = path.join(repo, "incubator/skills/engineering-workflows/visual-reports");
  await mkdir(skill, { recursive: true });
  await cp(source, skill, { recursive: true });
  // Compatibility aliases are unrelated to renderer behavior. Fill absent legacy files
  // only in this synthetic fixture; real repository exports use their committed bytes.
  for (const relative of [
    "assets/graphite-grain/configurator.mjs",
    "assets/graphite-grain/configurator.html",
    "assets/graphite-grain/relaxed.css",
    "scripts/cache_icon.py",
  ]) {
    const target = path.join(skill, relative);
    await mkdir(path.dirname(target), { recursive: true });
    try {
      await readFile(target);
    } catch (error) {
      if (error.code !== "ENOENT") throw error;
      await writeFile(target, "Synthetic fixture only\n");
    }
  }
  await writeFile(
    path.join(repo, "LICENSE"),
    "Synthetic test license, not a distributable bundle\n",
  );
  const git = (args, input) =>
    execFileSync("git", ["-C", repo, ...args], { input, encoding: "utf8" }).trim();
  git(["init", "-q"]);
  async function tree(dir) {
    const entries = [];
    for (const entry of await readdir(dir, { withFileTypes: true })) {
      if (entry.name === ".git") continue;
      const absolute = path.join(dir, entry.name);
      if (entry.isDirectory()) entries.push(`040000 tree ${await tree(absolute)}\t${entry.name}`);
      else
        entries.push(
          `100644 blob ${git(["hash-object", "-w", "--stdin"], await readFile(absolute))}\t${entry.name}`,
        );
    }
    return git(["mktree"], entries.sort().join("\n") + "\n");
  }
  const revision = git([
    "-c",
    "user.name=Fixture",
    "-c",
    "user.email=fixture@example.invalid",
    "commit-tree",
    await tree(repo),
    "-m",
    "Synthetic export fixture",
  ]);
  git(["update-ref", "HEAD", revision]);
  // Populate the fixture working tree/index by clone, never stage a user's files.
  // A clone has a normal index; no index is touched in the original source workspace.
  const clean = path.join(temp, "clean");
  execFileSync("git", ["clone", "--quiet", "--no-local", repo, clean]);
  const run = (destination, check = false) =>
    execFileSync(
      process.execPath,
      [
        path.join(
          clean,
          "incubator/skills/engineering-workflows/visual-reports/scripts/export-assets.mjs",
        ),
        "--destination",
        destination,
        ...(check ? ["--check"] : []),
      ],
      { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] },
    );
  return { temp, repo: clean, run, revision };
}
test("committed portable bundle verifies digests and runs the renderer offline", async () => {
  const f = await fixture();
  try {
    const bundle = path.join(f.temp, "bundle");
    f.run(bundle);
    f.run(bundle, true);
    const manifest = JSON.parse(await readFile(path.join(bundle, "manifest.json"), "utf8"));
    assert.equal(manifest.source.revision, f.revision);
    for (const entry of manifest.files)
      assert.equal(
        createHash("sha256")
          .update(await readFile(path.join(bundle, entry.file)))
          .digest("hex"),
        entry.sha256,
      );
    assert.ok(manifest.files.some((entry) => entry.file === "configurator.mjs"));
    execFileSync(process.execPath, [
      path.join(bundle, "scripts/render-report.mjs"),
      "--gallery",
      path.join(f.temp, "gallery"),
    ]);
    assert.ok(
      (await readFile(path.join(f.temp, "gallery/r24/r24.html"), "utf8")).includes("Zeitplan"),
    );
    const outside = path.join(f.temp, "outside-assets");
    await rename(path.join(bundle, "assets"), outside);
    await symlink(outside, path.join(bundle, "assets"), "dir");
    assert.throws(() => f.run(bundle, true), /Unsafe bundle directory/);
    assert.throws(() => f.run(bundle), /Unsafe bundle directory/);
    await rm(path.join(bundle, "assets"), { force: true });
    await rename(outside, path.join(bundle, "assets"));
    const target = path.join(bundle, "assets/report-runtime.css");
    await writeFile(target, "tampered");
    assert.throws(() => f.run(bundle, true));
  } finally {
    await rm(f.temp, { recursive: true, force: true });
  }
});
test("export refuses source destinations, symlink redirects and dirty source", async () => {
  const f = await fixture();
  try {
    assert.throws(() => f.run(path.join(f.repo, "not-allowed")));
    const redirect = path.join(f.temp, "redirect");
    await symlink(f.repo, redirect, "dir");
    assert.throws(() => f.run(path.join(redirect, "not-allowed")));
    const skill = path.join(f.repo, "incubator/skills/engineering-workflows/visual-reports");
    await writeFile(path.join(skill, "uncommitted.txt"), "not reviewed");
    assert.throws(() => f.run(path.join(f.temp, "bundle")));
  } finally {
    await rm(f.temp, { recursive: true, force: true });
  }
});
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall