agentleFS
ccomkhjccomkhj/skills/local-artifact/SKILL.md

local-artifact

Skill10 starsChanged 19 days agoMITView on GitHub

Build an HTML page (report, dashboard, explainer, small app) and keep it in a local gallery you can list, reopen, update and delete. Replacement for the built-in Artifact tool, with zero context cost until you type /local-artifact.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run python3 -I ${CLAUDE_SKILL_DIR}/scripts/gallery.py --help for flags.

    line 18
  2. Very specific:

    Update, don't fork: If the user means an existing page, run list and edit <gallery>/<slug>/index.html in place.

    line 22
  3. Very specific:

    Read references/page-contract.md, then write the page to the scratchpad (or wherever the user says).

    line 25
  4. Very specific:

    If the page's meta.json has artifact_url, suggest the update form instead (prompt: "Read the Artifact at <url>, then publish <page> to it …

    line 39
  5. Very specific:

    When the user pastes back a new URL, run link <slug> <url>.

    line 42
  6. Very specific:

    Keep the prompt first: --tools takes a list and would swallow a prompt placed after it.

    line 46
  7. Distinctive:

    Never run this command yourself.

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Local artifact

The built-in Artifact tool is denied in permissions.deny because its schema and companion tools cost thousands of tokens in every session. This skill does the same job but loads only when you invoke it. Pages go to a local gallery (~/.local/share/local-artifacts/<slug>/, override with LOCAL_ARTIFACTS_DIR) instead of claude.ai.

scripts/gallery.py keeps the gallery: publish, list, open, link, delete. Run python3 -I ${CLAUDE_SKILL_DIR}/scripts/gallery.py --help for flags.

Build or update a page

  1. Update, don't fork. If the user means an existing page, run list and edit <gallery>/<slug>/index.html in place. Its file:// link and history stay with the slug, the way republishing an artifact kept its URL.
  2. Read references/page-contract.md, then write the page to the scratchpad (or wherever the user says). The contract is what made artifact pages render the same everywhere, so keep it even for quick pages.
  3. publish <file-or-dir> --description "<one sentence>". Pass --slug to replace an existing page. Publish runs the contract checks and opens the page. Fix every ! warning and publish again until none are left.
  4. Reply with the slug, the file:// link, and one line on what the page shows. End with an optional copy-paste command for the user to run in another terminal if they want the page on claude.ai, with <page> set to the absolute gallery path:

    claude "Read <page> and publish it as an Artifact. Reply with only the artifact URL." --setting-sources project,local --tools Artifact,Read

    If the page's meta.json has artifact_url, suggest the update form instead (prompt: "Read the Artifact at <url>, then publish <page> to it with url=<url>. Reply with only the artifact URL."). A new session must pass url, or it creates a separate artifact, and it must read the artifact first, or the publish is refused. When the user pastes back a new URL, run link <slug> <url>.

    This is the only place the Artifact tool still exists. Skipping user settings drops the deny for that one session, and the user approves the publish there. Keep the prompt first: --tools takes a list and would swallow a prompt placed after it. Never run this command yourself. It gets around the user's deny, so the user runs it.

Things a local page can't do

claude.ai artifacts had a hosted runtime: shared database, comments, viewer identity, ask-Claude. A file:// page has none of these. What replaces each:

  • Input to collect from the user: a Copy as JSON button, and the user pastes the result back into chat, like the manage-context plan flow.
  • Live data: pull it when you build the page and print the timestamp on it.
  • Per-viewer state (tabs, filters, drafts): localStorage wrapped in try/catch.

Sharing

The gallery is private to this machine. Sending a page anywhere else (a Superset page via superset:page, a gist, Slack) publishes it, so ask the user first and read the whole file before it leaves the machine.

Delete

delete <slug> --yes removes the folder and can't be undone. Run it only when the user names the page, after they confirm.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.