# Set up shareit.fast in Claude Code

This setup adds one personal `/share` skill. It does not change the current project, `CLAUDE.md`, or Claude Code settings.

## Install

Create this file:

`~/.claude/skills/share/SKILL.md`

Save the following skill definition in it:

```markdown
---
name: share
description: Publish a specific artifact as a shareable self-contained HTML page through shareit.fast. Use only when the user asks to share or publish an artifact.
disable-model-invocation: true
---

Publish a specific artifact through shareit.fast. The artifact may be a report, prototype, diagram, presentation, dashboard, document, or any other result that can be represented as HTML. Do not summarize or publish the entire coding session.

Use any arguments after /share to identify the artifact. If there are none and the intended artifact is ambiguous, ask the user which artifact to publish.

1. Create a complete, self-contained HTML representation of that artifact. Preserve its existing design by default.
2. Start with `<!doctype html>` and include complete `<html>`, `<head>`, and `<body>` elements.
3. Include all CSS and JavaScript inline. Embed required images, fonts, and other assets as data URLs. Do not depend on local paths, external scripts, external stylesheets, CSS imports, or network-loaded media.
4. Check that the artifact does not contain secrets, credentials, environment variables, private source code, or unrelated files. Ask before publishing if it appears sensitive.
5. Write the HTML document to a temporary file outside the project.
6. Run:

   curl --fail-with-body --silent --show-error -X POST -H "Content-Type: text/html" -H "X-Shareit-Agent: claude-code" -H "X-Shareit-Version: 1" --data-binary @PATH_TO_TEMP_FILE https://shareit.fast/api/artifacts

7. If the server returns validation issues, use each issue's `code` and `message` to repair the HTML and retry once. Do not ignore or hide validation failures.
8. Remove the temporary file.
9. Return the URL from the successful JSON response. If publishing still fails, show the server response instead of claiming the artifact was published.
```

Successful links use a compact eight-character ID, for example `https://shareit.fast/a/K7mQ2xVp`.

Claude Code normally discovers the skill immediately. Restart it once if `/share` is not visible.

## Use it

Run `/share`, optionally followed by the name or path of the artifact to publish.

## Remove it

Delete `~/.claude/skills/share`.
