---
name: Share A Library
slug: share-a-library-2
category: DevOps
description: Share A Library publishes a finished managed library to GitHub and returns the exact install command teammates can use. Use it after sanity-checking and building docs for a library that is ready to share.
github: "https://github.com/MoizIbnYousaf/ai-agent-skills/tree/main/skills/share-a-library"
language: JavaScript
stars: 1136
forks: 131
install: "npx degit https://github.com/MoizIbnYousaf/ai-agent-skills/tree/main/skills/share-a-library ~/.claude/skills/share-a-library"
installs_to: ~/.claude/skills/share-a-library
source_path: skills/share-a-library/SKILL.md
collection_size: 18
category_size: 868
collection_url: "https://dirskills.com/collections/MoizIbnYousaf/ai-agent-skills"
added: 2026-09-03T06:03:19.162Z
last_synced: 2026-09-03T06:03:19.162Z
canonical_url: "https://dirskills.com/skills/share-a-library-2"
---

# Share A Library

Share A Library publishes a finished managed library to GitHub and returns the exact install command teammates can use. Use it after sanity-checking and building docs for a library that is ready to share.

**Install:**

```bash
npx degit https://github.com/MoizIbnYousaf/ai-agent-skills/tree/main/skills/share-a-library ~/.claude/skills/share-a-library
```

## README

# Share A Library

## Goal

Turn a finished local library into a real shared artifact with a repo URL and an install command another agent can use.

## Preconditions

- You are already inside a managed library workspace.
- The library has been sanity-checked.
- `npx ai-agent-skills build-docs` has already run, or you run it now before publishing.

## Workflow

1. Regenerate docs if needed.

```bash
npx ai-agent-skills build-docs
```

2. Publish the workspace to GitHub.

```bash
git init
git add .
git commit -m "Initialize skills library"
gh repo create <owner>/<repo> --public --source=. --remote=origin --push
```

3. Return the exact shareable install command.

If the library has a `starter-pack` collection:

```bash
npx ai-agent-skills install <owner>/<repo> --collection starter-pack -p
```

Otherwise:

```bash
npx ai-agent-skills install <owner>/<repo> -p
```

## Guardrails

- Do not stop at `git init`. A shared library is not shared until the repo exists and the install command is ready.
- If the repo already exists, connect the existing remote and push instead of creating a duplicate.
- Prefer the collection install command when a curated starter pack exists.
- Return the actual repo coordinates you used, not placeholders.

## Done

Return:

- the repo URL
- whether you shared a collection or the whole library
- the exact install command to hand to teammates
