# SkillSlap Skill Publisher

Give it a one-line skill idea and it writes the complete skill content then publishes it to SkillSlap via the MCP publish_skill tool. Meta-recursive: a skill that builds skills. Requires SKILLSLAP_TOKEN env var.

## Quick Reference

# SkillSlap Skill Publisher

> **Purpose:** Turn a one-line skill idea into a fully-written, published SkillSlap skill in one shot. This skill writes the content, chooses the right metadata, and calls `publish_skill` via the MCP server. A skill that builds skills.

---

## Invocation

```
/publish-skill <idea>
```

**Examples:**
- `/publish-skill A skill that writes Tailwind component variants from a design description`
- `/publish-skill An agent that reviews OpenAPI specs for REST conventions and breaking changes`
- `/publish-skill Context rules for writing Rust async code with Tokio`

**Prerequisite:** The MCP server must be running with `SKILLSLAP_TOKEN` set to the author's API token.

---

## Process

### Step 1: Analyze the idea

From the one-line description, determine:
- **What problem does this skill solve?** (be specific)
- **Who invokes it?** → sets `invocation_type`:
  - `agent` — a Claude Code agent calls it as a slash command or task
  - `context` — injected into the agent's context/CLAUDE.md as rules
  - `tool` — the agent calls it as a tool in a pipeline (reads input, returns output)
- **What does the user provide?** (inputs)
- **What does the skill produce?** (outputs)
- **What are the 3–5 best tags?**

### Step 2: Write the skill content

Follow this structure for `agent` and `tool` skills:
```markdown
# [Skill Title]

> **Purpose:** [One crisp sentence: what it does and why it's useful]

---

## Invocation

```
/[command] <required-arg> [optional-arg]
```

**Example:** `/[command] [concrete example]`

---

## Process

[2–5 phases, each with a clear heading and bullet points]
[Use code blocks for examples of inputs and outputs]
[Be specific — no "analyze the X" without saying HOW]

---

## Output Format

[Describe exactly what the skill produces: file, table, list, etc.]
[Include an example output snippet if useful]
```

For `context` skills (rules to inject):
```markdown
# [Title]

> **Purpose:** [What these rules enforce and why]

---

## Rules

### [Rule Category 1]
- [Specific rule]
- [Specific rule]

### [Rule Category 2]
- [Specific rule]
```

### Step 3: Choose metadata

| Field | Guidance |
|---|---|
| `title` | Title case, max 6 words, verb-noun pattern for agent skills (e.g. "Git Commit Formatter") |
| `description` | 1–2 sentences, under 200 chars, mentions what input → output |
| `tags` | 3–6 tags, lowercase, from: language name, framework, task type, skillslap |
| `invocation_type` | `agent` / `context` / `tool` |
| `version` | Start at `1.0.0` |
| `status` | `draft` — let the author review before activating |

### Step 4: Publish via MCP

Call the `publish_skill` tool:
```json
{
  "title": "[chosen title]",
  "content": "[full markdown content]",
  "description": "[short description]",
  "tags": ["tag1", "tag2", "tag3"],
  "invocation_type": "[agent|context|tool]",
  "version": "1.0.0",
  "status": "draft"
}
```

### Step 5: Confirm and share

After publishing, output:
- The skill's ID and URL: `https://skillslap.com/skill/[id]`
- A summary of what was written
- Next steps: "Review at the URL above, then set status to 'active' when ready"

---

## Quality Bar

Before calling publish_skill, verify:
- [ ] Invocation section has a real example (not `<placeholder>`)
- [ ] Process section says HOW, not just WHAT (no "review the code" without specifics)
- [ ] Output format is described with an example snippet
- [ ] Tags are lowercase and specific (no "code", use "typescript" or "python")
- [ ] Description fits in 200 chars
- [ ] Status is `draft` — never publish as `active` without review

---

## Error Handling

If `publish_skill` returns an auth error:
> "The SKILLSLAP_TOKEN env var is not set or is invalid. Add it to your MCP config: `SKILLSLAP_TOKEN=your-token-here`"

If the title already exists:
> "A skill with this title already exists in your account. Update the title or use `update_skill` with the existing skill's ID."

