# Publish to Hub — Skills

> Share your skill with the Aerostack community — versioning, metadata, and the publishing workflow.

The Aerostack Community Hub is where developers share Skills, MCP Servers, and Functions. Publishing a skill makes it installable by any Aerostack user with one command.

```mermaid
flowchart LR
    B["Build & Test"]
    P["Publish to Hub"]
    D["Discoverable\non Hub"]
    I["Others install\ninto workspaces"]

    B --> P --> D --> I

    style B fill:#3b82f6,stroke:#2563eb,color:#fff
    style P fill:#8b5cf6,stroke:#7c3aed,color:#fff
    style D fill:#10b981,stroke:#059669,color:#fff
    style I fill:#f59e0b,stroke:#d97706,color:#fff
```

## Before You Publish

Make sure your skill is ready:

- **Tested locally** — run `aerostack dev` and verify it works with test inputs
- **Deployed to your project** — run `aerostack deploy skill` and confirm it works in a workspace
- **Clear tool description** — the `tool.description` in `aerostack.json` should explain exactly when and how to use the skill
- **Error handling** — the skill should return structured JSON errors, not crash on bad input

---

## Publishing via CLI

1. **Prepare your aerostack.json**

   Add the optional publishing fields:

   ```json
   {
     "name": "send-email",
     "type": "skill",
     "version": "1.0.0",
     "description": "Send transactional emails via Resend. Supports HTML body, custom sender, and delivery confirmation.",
     "category": "communication",
     "tags": ["email", "notifications", "resend", "transactional"],
     "tool": {
       "name": "send_email",
       "description": "Sends an email to a recipient. Supports plain text and HTML body. Use this when a user or workflow needs to send an email notification, confirmation, or alert.",
       "input_schema": {
         "type": "object",
         "properties": {
           "to": {
             "type": "string",
             "description": "Recipient email address"
           },
           "subject": {
             "type": "string",
             "description": "Email subject line"
           },
           "body": {
             "type": "string",
             "description": "Email body content (plain text or HTML)"
           }
         },
         "required": ["to", "subject", "body"]
       }
     }
   }
   ```

   Publishing-specific fields:

   | Field | Required for publish | Description |
   |---|---|---|
   | `version` | Yes | Semantic version (e.g. `1.0.0`, `1.2.3`). Must increment on each publish. |
   | `category` | Recommended | One of: `communication`, `productivity`, `data`, `ai`, `developer-tools`, `analytics`, `security`, `storage`, `other`. |
   | `tags` | Recommended | Array of lowercase strings for search discoverability. |

1. **Publish**

   ```bash
   aerostack skill publish --name "Send Email" --function <function-id>
   ```

   The `--name` flag sets the display name shown on the Hub (can include spaces and capitalization). The `--function` flag links the skill to its backing function.

1. **Verify on the Hub**

   After publishing, your skill appears on [hub.aerostack.dev](https://hub.aerostack.dev). Visit your skill's page to confirm the description, tags, and version are correct.

---

## Publishing via Admin Dashboard

1. Go to [app.aerostack.dev](https://app.aerostack.dev) and sign in
2. Navigate to **Skills** in the sidebar
3. Select the skill you want to publish
4. Click **Publish to Hub**
5. Fill in the display name, description, category, and tags
6. Add a README (Markdown) — this is shown on the Hub listing page
7. Click **Publish**

  Publishing always starts as a **draft**. You can preview your Hub listing before making it public. Click **Go Live** when you are ready.

---

## Versioning

Every published version is a snapshot. Past versions are preserved and cannot be overwritten.

### Bumping versions

Update the `version` field in `aerostack.json` before publishing:

```json
{
  "version": "1.1.0"
}
```

Then publish again. The Hub will show the new version as the latest, while previous versions remain accessible.

### Semantic versioning guidelines

| Change type | Version bump | Example |
|---|---|---|
| Bug fix, no input/output changes | Patch (`1.0.0` to `1.0.1`) | Fixed error message typo |
| New optional parameter | Minor (`1.0.0` to `1.1.0`) | Added `from` parameter |
| Changed required parameters or behavior | Major (`1.0.0` to `2.0.0`) | Renamed `body` to `content` |

  Breaking changes to `tool.input_schema` (removing or renaming required fields) should always be a major version bump. Consumers relying on the previous schema will break otherwise.

---

## Writing a Good Hub Listing

Your skill competes for attention on the Hub. A clear listing gets more installs.

### Display name

- Short and descriptive: "Send Email", "Generate PDF", "Enrich Company"
- Avoid generic names like "Helper" or "Utility"

### Description

- First sentence should explain what the skill does in plain language
- Mention the external service if applicable ("via Resend", "using OpenAI")
- State what input it expects and what it returns

### Tags

- Use lowercase, specific tags: `email`, `resend`, `notifications`
- Include the category as a tag too
- 3-6 tags is ideal

### README

The README appears on the Hub listing page. Include:

1. **What it does** — one paragraph
2. **Required secrets** — what environment variables the installer needs to configure
3. **Example usage** — a sample input and output
4. **Limitations** — what it does not do

Example README:

```markdown
# Send Email Skill

Sends transactional emails via the Resend API. Supports HTML body, custom sender address, and returns a delivery confirmation ID.

## Required Secrets

After installing this skill, set the following secrets:

- `RESEND_API_KEY` — your Resend API key (get one at resend.com/api-keys)
- `DEFAULT_FROM_EMAIL` — default sender address (must be verified in Resend)

## Example

**Input:**
- to: "alice@example.com"
- subject: "Welcome!"
- body: "<h1>Welcome to our platform</h1>"

**Output:**
- success: true
- email_id: "abc123"

## Limitations

- Does not support attachments (yet)
- Requires a verified domain in Resend
- Rate limited to 100 emails/day on Resend's free tier
```

---

## How Others Install Your Skill

Once published, anyone can install your skill in one command:

```bash
aerostack skill install yourusername/send-email
```

Or from the Hub web interface by clicking **Install** on the skill's page.

The skill is installed into the user's active workspace. They will need to configure any required secrets (`aerostack secrets set RESEND_API_KEY ...`) before the skill will work.

---

## Updating a Published Skill

1. Make your code changes
2. Bump the `version` in `aerostack.json`
3. Deploy: `aerostack deploy skill`
4. Publish the new version: `aerostack skill publish --name "Send Email" --function <function-id>`

Users who have already installed your skill will get the latest version. The previous version snapshot is preserved in the Hub's version history.

---

## Unpublishing

To remove a skill from the Hub:

1. Go to the Admin Dashboard > **Skills** > select the skill
2. Click **Unpublish**

This removes the listing from the Hub but does not delete the skill from workspaces where it is already installed. Existing installations continue to work.

## Next Steps

- [**Hub documentation**](/hub/publishing-overview) — full publishing workflow for all resource types
- [**CLI skill commands**](/cli/skill-commands) — complete CLI reference for skill management
- [**Create a skill**](/skills/create-skill) — go back and build another skill
