docs: unify skills install path
This commit is contained in:
parent
a8b3c261fc
commit
302ea5592a
@ -75,8 +75,8 @@ If you update any file in this repo, commit and push right away so other develop
|
|||||||
## Skills Sync
|
## Skills Sync
|
||||||
This repo uses a skills manifest to standardize skills across developers.
|
This repo uses a skills manifest to standardize skills across developers.
|
||||||
|
|
||||||
1. Review skills.yaml for required skills.
|
1. Review skills.yaml for the approved install list.
|
||||||
2. Run ./scripts/sync-skills.sh to sync skills locally.
|
2. Run ./scripts/sync-skills.sh (uses the `npx skills` CLI).
|
||||||
3. Restart your editor if needed.
|
3. Restart your editor if needed.
|
||||||
|
|
||||||
## Suggested Agent Request Template
|
## Suggested Agent Request Template
|
||||||
|
|||||||
@ -5,8 +5,7 @@ You are here: [AI Docs Home](index.md) > Skills Library
|
|||||||
## Contents
|
## Contents
|
||||||
- Skills vs Agents vs Instructions
|
- Skills vs Agents vs Instructions
|
||||||
- Skills Governance And Sync
|
- Skills Governance And Sync
|
||||||
- skills.sh (Optional Skills Installer)
|
- Skills CLI (Single Path)
|
||||||
- skills CLI Commands
|
|
||||||
- How To Connect Skills
|
- How To Connect Skills
|
||||||
- Central Assets Repo
|
- Central Assets Repo
|
||||||
- Next Steps
|
- Next Steps
|
||||||
@ -39,7 +38,7 @@ To keep skills consistent across teams, use a central skills registry plus a per
|
|||||||
### Recommended Pattern
|
### Recommended Pattern
|
||||||
- Central skills registry repo (single source of truth)
|
- Central skills registry repo (single source of truth)
|
||||||
- Project-level manifest that pins required skills and versions
|
- Project-level manifest that pins required skills and versions
|
||||||
- Sync script that pulls the approved set to each developer's laptop
|
- Sync script that installs the approved set to each developer's laptop
|
||||||
- Agents.md points to the manifest and sync command
|
- Agents.md points to the manifest and sync command
|
||||||
|
|
||||||
### Proposed Curated Repo Structure
|
### Proposed Curated Repo Structure
|
||||||
@ -60,17 +59,16 @@ Use a small manifest to declare the approved skills and versions for the project
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: 1
|
version: 1
|
||||||
registry: git@<host>:org/mobile-ai-skills.git
|
|
||||||
skills:
|
skills:
|
||||||
- name: swiftui-expert-skill
|
- name: swiftui-expert-skill
|
||||||
version: 1.2.0
|
install: "https://github.com/avdlee/swiftui-agent-skill --skill swiftui-expert-skill"
|
||||||
- name: onboarding-cro
|
- name: onboarding-cro
|
||||||
version: 1.0.0
|
install: "vercel-labs/agent-skills"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Sync Workflow
|
### Sync Workflow
|
||||||
1. Run the sync script.
|
1. Run the sync script.
|
||||||
2. The script pulls the registry and copies required skills to your local skills directory.
|
2. The script installs each skill using the `npx skills` CLI.
|
||||||
3. Restart your editor if required.
|
3. Restart your editor if required.
|
||||||
|
|
||||||
### Example Sync Command
|
### Example Sync Command
|
||||||
@ -78,10 +76,8 @@ skills:
|
|||||||
./scripts/sync-skills.sh
|
./scripts/sync-skills.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
## skills.sh (Optional Skills Installer)
|
## Skills CLI (Single Path)
|
||||||
skills.sh provides a public skills catalog and a CLI to install skills by name. Use this only if your team allows it and you understand the source of the skills you install.
|
We use a single, approved path: update skills.yaml and run the sync script. The sync script calls `npx skills add` for each entry.
|
||||||
|
|
||||||
If you have a curated repo, treat skills.sh as a discovery tool only. The source of truth should remain your curated lists.
|
|
||||||
|
|
||||||
### Where To Find Skills
|
### Where To Find Skills
|
||||||
- Homepage: https://skills.sh/
|
- Homepage: https://skills.sh/
|
||||||
@ -89,21 +85,18 @@ If you have a curated repo, treat skills.sh as a discovery tool only. The source
|
|||||||
- CLI reference: https://skills.sh/docs/cli
|
- CLI reference: https://skills.sh/docs/cli
|
||||||
|
|
||||||
### How It Works (High-Level)
|
### How It Works (High-Level)
|
||||||
1. You run the `skills` CLI via `npx`.
|
1. You update skills.yaml with the approved install entries.
|
||||||
2. The CLI downloads the skill and configures it for your agent environment.
|
2. Run ./scripts/sync-skills.sh.
|
||||||
3. The skill becomes available to your AI agent.
|
3. The script uses `npx skills` to install each skill.
|
||||||
|
|
||||||
### Install The CLI (No Global Install Required)
|
### Install The CLI (No Global Install Required)
|
||||||
The CLI runs via `npx`, so you do not need a global install.
|
The CLI runs via `npx`, so you do not need a global install.
|
||||||
|
|
||||||
### Example Install Command
|
### Example Install Entry
|
||||||
```bash
|
```yaml
|
||||||
npx skills add vercel-labs/agent-skills
|
skills:
|
||||||
```
|
- name: swiftui-expert-skill
|
||||||
|
install: "https://github.com/avdlee/swiftui-agent-skill --skill swiftui-expert-skill"
|
||||||
### Example Install From A Repo URL
|
|
||||||
```bash
|
|
||||||
npx skills add https://github.com/avdlee/swiftui-agent-skill --skill swiftui-expert-skill
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
|
|||||||
@ -3,42 +3,23 @@ set -euo pipefail
|
|||||||
|
|
||||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
MANIFEST="$ROOT_DIR/skills.yaml"
|
MANIFEST="$ROOT_DIR/skills.yaml"
|
||||||
CACHE_DIR="$HOME/.ai-skills/registry"
|
|
||||||
LOCAL_SKILLS_DIR="$HOME/.ai-skills/skills"
|
|
||||||
|
|
||||||
if [[ ! -f "$MANIFEST" ]]; then
|
if [[ ! -f "$MANIFEST" ]]; then
|
||||||
echo "Missing skills manifest: $MANIFEST" >&2
|
echo "Missing skills manifest: $MANIFEST" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
REGISTRY_URL="$(grep -E '^registry:' "$MANIFEST" | awk '{print $2}')"
|
INSTALLS=$(sed -n 's/^[[:space:]]*install:[[:space:]]*//p' "$MANIFEST" | sed 's/^"//;s/"$//')
|
||||||
if [[ -z "$REGISTRY_URL" ]]; then
|
|
||||||
echo "Missing registry in skills.yaml" >&2
|
if [[ -z "$INSTALLS" ]]; then
|
||||||
|
echo "No install entries found in skills.yaml" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$CACHE_DIR" "$LOCAL_SKILLS_DIR"
|
while IFS= read -r INSTALL; do
|
||||||
|
[[ -z "$INSTALL" ]] && continue
|
||||||
if [[ -d "$CACHE_DIR/.git" ]]; then
|
read -r -a ARGS <<< "$INSTALL"
|
||||||
git -C "$CACHE_DIR" pull --ff-only
|
npx skills add "${ARGS[@]}"
|
||||||
else
|
done <<< "$INSTALLS"
|
||||||
git clone "$REGISTRY_URL" "$CACHE_DIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
SKILL_NAMES=$(awk '/^- name:/{print $2}' "$MANIFEST")
|
|
||||||
|
|
||||||
for SKILL in $SKILL_NAMES; do
|
|
||||||
SRC="$CACHE_DIR/skills/$SKILL"
|
|
||||||
DEST="$LOCAL_SKILLS_DIR/$SKILL"
|
|
||||||
|
|
||||||
if [[ ! -d "$SRC" ]]; then
|
|
||||||
echo "Missing skill in registry: $SKILL" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf "$DEST"
|
|
||||||
cp -R "$SRC" "$DEST"
|
|
||||||
echo "Synced skill: $SKILL"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Done. Restart your editor if skills do not appear."
|
echo "Done. Restart your editor if skills do not appear."
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
version: 1
|
version: 1
|
||||||
registry: git@<host>:org/mobile-ai-skills.git
|
|
||||||
skills:
|
skills:
|
||||||
- name: swiftui-expert-skill
|
- name: swiftui-expert-skill
|
||||||
version: 1.2.0
|
install: "https://github.com/avdlee/swiftui-agent-skill --skill swiftui-expert-skill"
|
||||||
- name: onboarding-cro
|
- name: onboarding-cro
|
||||||
version: 1.0.0
|
install: "vercel-labs/agent-skills"
|
||||||
- name: webapp-testing
|
- name: webapp-testing
|
||||||
version: 1.0.0
|
install: "vercel-labs/agent-skills"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user