Skip to content

Commit 5a33a7f

Browse files
authored
Merge pull request #6 from replicate/zeke/split-into-four-skills
docs: split monolithic skill into five focused skills
2 parents 8c871d6 + ed88370 commit 5a33a7f

12 files changed

Lines changed: 778 additions & 92 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,29 @@
77
},
88
"plugins": [
99
{
10-
"name": "replicate",
11-
"source": "./",
12-
"description": "Skills for building AI-powered apps with Replicate"
10+
"name": "find-models",
11+
"source": "skills/find-models",
12+
"description": "Find AI models on Replicate using search and curated collections."
13+
},
14+
{
15+
"name": "compare-models",
16+
"source": "skills/compare-models",
17+
"description": "Compare Replicate models by cost, speed, quality, and capabilities."
18+
},
19+
{
20+
"name": "run-models",
21+
"source": "skills/run-models",
22+
"description": "Run AI models on Replicate via predictions, webhooks, and streaming."
23+
},
24+
{
25+
"name": "prompt-images",
26+
"source": "skills/prompt-images",
27+
"description": "Prompting techniques for AI image generation and editing models on Replicate."
28+
},
29+
{
30+
"name": "prompt-videos",
31+
"source": "skills/prompt-videos",
32+
"description": "Prompting techniques for AI video generation models on Replicate."
1333
}
1434
]
1535
}

.claude-plugin/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "replicate",
3-
"description": "Skills for building AI-powered apps with Replicate",
4-
"version": "1.0.0",
3+
"description": "Skills for finding, comparing, running, and prompting AI models on Replicate",
4+
"version": "2.0.0",
55
"author": {
66
"name": "Replicate"
77
}

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ jobs:
3333
CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }}
3434
run: |
3535
npx clawhub@latest login --token "$CLAWHUB_TOKEN"
36-
npx clawhub@latest publish skills/replicate --slug replicate --name "Replicate"
36+
npx clawhub@latest publish skills/find-models --slug replicate-find-models --name "Replicate: Find Models"
37+
npx clawhub@latest publish skills/compare-models --slug replicate-compare-models --name "Replicate: Compare Models"
38+
npx clawhub@latest publish skills/run-models --slug replicate-run-models --name "Replicate: Run Models"
39+
npx clawhub@latest publish skills/prompt-images --slug replicate-prompt-images --name "Replicate: Prompt Images"
40+
npx clawhub@latest publish skills/prompt-videos --slug replicate-prompt-videos --name "Replicate: Prompt Videos"

AGENTS.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,32 @@
22

33
## Purpose
44

5-
This repo publishes a single Agent Skills document for Replicate.
6-
7-
Keep it short and focused: a human- and agent-readable guide to discovering models, inspecting schemas, running predictions, and handling outputs.
5+
This repo publishes Agent Skills for Replicate: focused guides for finding, comparing, running, and prompting AI models.
86

97
## Files that matter
108

11-
- `skills/replicate/SKILL.md` is the canonical skill.
12-
- `.mcp.json` points to the remote MCP server.
13-
- `.claude-plugin/` contains marketplace metadata for Claude Code.
9+
- `skills/find-models/SKILL.md` — search, collections, schemas, picking the right model.
10+
- `skills/compare-models/SKILL.md` — evaluating models by cost, speed, quality, and capabilities.
11+
- `skills/run-models/SKILL.md` — predictions, polling, webhooks, streaming, file I/O, concurrency, multi-model workflows.
12+
- `skills/prompt-images/SKILL.md` — prompting techniques for image generation and editing models.
13+
- `skills/prompt-videos/SKILL.md` — prompting techniques for video generation models.
14+
- `script/lint` — validates the skills.
15+
- `.mcp.json` — points to the remote MCP server.
16+
- `.claude-plugin/` — marketplace metadata for Claude Code.
1417

1518
## Editing guidelines
1619

17-
- Keep `SKILL.md` concise and practical. Prefer bullet lists over long prose.
18-
- Treat `https://api.replicate.com/openapi.json` as the source of truth.
19-
- Keep mentions of deprecated or unofficial endpoints out of the skill.
20+
- Keep each `SKILL.md` concise and practical. Prefer bullet lists over long prose.
21+
- Every code snippet must be runnable. The test runner executes them all.
22+
- Treat `https://api.replicate.com/openapi.json` as the source of truth for API details.
2023
- Do not add language-specific client guidance unless explicitly requested.
2124

2225
## Linting
2326

24-
Lint before committing changes:
25-
2627
```
27-
script/lint
28+
script/lint skills/find-models
29+
script/lint skills/compare-models
30+
script/lint skills/run-models
31+
script/lint skills/prompt-images
32+
script/lint skills/prompt-videos
2833
```

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Replicate Skills
22

3+
A collection of [Agent Skills](https://agentskills.io) for building AI-powered apps with [Replicate](https://replicate.com).
34

4-
A collection of [Agent Skills](https://agentskills.io) for building AI-powered apps with [Replicate](https://replicate.com).
5+
Skills included:
56

6-
Discover, compare, and run AI models using Replicate's API.
7+
- **find-models** — search for models, browse collections, read schemas, pick the right model
8+
- **compare-models** — evaluate models by cost, speed, quality, and capabilities
9+
- **run-models** — create predictions, poll, use webhooks, stream, handle files, run concurrently
10+
- **prompt-images** — prompting techniques for image generation and editing models
711

812
## Installing
913

script/lint

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,35 @@ cd "$(dirname "$0")/.."
1212

1313
[ -z "$DEBUG" ] || set -x
1414

15-
SKILL_PATH="${1:-skills/replicate}"
16-
17-
echo "==> Validating Agent Skills in $SKILL_PATH"
18-
19-
if command -v uv >/dev/null 2>&1; then
20-
uvx --from skills-ref agentskills validate "$SKILL_PATH"
21-
exit 0
15+
if [ $# -gt 0 ]; then
16+
SKILL_PATHS="$*"
17+
else
18+
SKILL_PATHS=""
19+
for d in skills/*/; do
20+
[ -f "$d/SKILL.md" ] && SKILL_PATHS="$SKILL_PATHS $d"
21+
done
2222
fi
2323

24-
PYTHON_BIN="${PYTHON_BIN:-python3}"
25-
if ! command -v "$PYTHON_BIN" >/dev/null 2>&1; then
26-
if command -v python >/dev/null 2>&1; then
27-
PYTHON_BIN=python
28-
else
29-
echo "python not found. Install Python 3 or uv to run skills-ref." >&2
30-
exit 1
24+
validate() {
25+
if command -v uv >/dev/null 2>&1; then
26+
uvx --from skills-ref agentskills validate "$1"
27+
return
3128
fi
32-
fi
3329

34-
"$PYTHON_BIN" -m skills_ref validate "$SKILL_PATH"
30+
PYTHON_BIN="${PYTHON_BIN:-python3}"
31+
if ! command -v "$PYTHON_BIN" >/dev/null 2>&1; then
32+
if command -v python >/dev/null 2>&1; then
33+
PYTHON_BIN=python
34+
else
35+
echo "python not found. Install Python 3 or uv to run skills-ref." >&2
36+
exit 1
37+
fi
38+
fi
39+
40+
"$PYTHON_BIN" -m skills_ref validate "$1"
41+
}
42+
43+
for SKILL_PATH in $SKILL_PATHS; do
44+
echo "==> Validating Agent Skills in $SKILL_PATH"
45+
validate "$SKILL_PATH"
46+
done

skills/compare-models/SKILL.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: compare-models
3+
description: Compare Replicate models by cost, speed, quality, and capabilities.
4+
---
5+
6+
## Docs
7+
8+
- Reference: <https://replicate.com/docs/llms.txt>
9+
- OpenAPI schema: <https://api.replicate.com/openapi.json>
10+
- MCP server: <https://mcp.replicate.com>
11+
- Per-model docs: `https://replicate.com/{owner}/{model}/llms.txt`
12+
- Set `Accept: text/markdown` when requesting docs pages for Markdown responses.
13+
14+
## Workflow
15+
16+
1. Search or browse collections to build a shortlist of candidate models.
17+
2. Fetch each model's schema to compare inputs, outputs, and capabilities.
18+
3. Check pricing from model metadata or the Replicate website.
19+
4. Run a small batch of test predictions to compare output quality.
20+
5. Pick the model that best fits your constraints (cost, latency, quality).
21+
22+
## What to compare
23+
24+
- **Speed**: Check `metrics.predict_time` on completed predictions for actual inference time. Official models are always warm. Community models can cold-boot.
25+
- **Cost**: Official models have predictable per-run pricing. Community models charge by compute time (GPU-seconds). Run a few predictions and check the `metrics` field for actual cost.
26+
- **Quality**: Run the same prompts through each model and compare outputs. Quality is subjective. Match it to your use case, not a leaderboard.
27+
- **Capabilities**: Compare input schemas for supported features (reference images, masks, aspect ratios, streaming, multi-image input). Check output formats.
28+
29+
## Key tradeoffs
30+
31+
- Lowest cost: smaller/distilled models. Accept slower inference and lower quality.
32+
- Lowest latency: official models or schnell/turbo variants. Accept higher cost per run.
33+
- Highest quality: pro/max/quality variants. Accept slower inference and higher cost.
34+
- Most control: models with ControlNet, masks, or reference images. Accept more complex input setup.
35+
36+
## Official vs community models
37+
38+
- Official models: always warm, stable APIs, predictable pricing, maintained by Replicate.
39+
- Community models: may cold-boot, require version pinning, maintained by the author.
40+
- If a community model meets your needs and an official model doesn't, consider creating a deployment for consistent uptime.
41+
42+
## Prompting guidance
43+
44+
For prompting techniques and task-specific guidance:
45+
46+
- Image generation and editing: see the [prompt-images](../prompt-images/SKILL.md) skill.
47+
- Video generation: see the [prompt-videos](../prompt-videos/SKILL.md) skill.

skills/find-models/SKILL.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: find-models
3+
description: Find AI models on Replicate using search and curated collections.
4+
---
5+
6+
## Docs
7+
8+
- Reference: <https://replicate.com/docs/llms.txt>
9+
- OpenAPI schema: <https://api.replicate.com/openapi.json>
10+
- MCP server: <https://mcp.replicate.com>
11+
- Per-model docs: `https://replicate.com/{owner}/{model}/llms.txt`
12+
- Set `Accept: text/markdown` when requesting docs pages for Markdown responses.
13+
14+
## Search
15+
16+
- Use the search API (`GET /v1/search?query=...`) to find models by task. Returns models, collections, and docs.
17+
- Search returns metadata for each model including `tags`, `generated_description`, and `run_count`.
18+
- The search API also returns matching collections alongside model results.
19+
- Avoid listing all models via API. It's a firehose. Use targeted queries.
20+
21+
## Collections
22+
23+
- Collections are curated groups of models maintained by Replicate staff.
24+
- The `official` collection contains always-warm models with stable APIs and predictable pricing.
25+
- Use collections to narrow a shortlist before deep comparison.
26+
- List collections with `GET /v1/collections`. Get one by slug with `GET /v1/collections/{slug}`.
27+
28+
## Reading model schemas
29+
30+
- Every model exposes its input/output schema via the models API (`GET /v1/models/{owner}/{name}`).
31+
- Schema path: `model.latest_version.openapi_schema.components.schemas.Input.properties`
32+
- Each property may include: `type`, `description`, `default`, `minimum`/`maximum`, `enum`, `format` (e.g. `uri` for file inputs).
33+
- Always fetch the schema before running a model. Schemas change.
34+
35+
## Picking the right model
36+
37+
- Prefer official models. They're always warm (no cold boot), have stable APIs, and predictable pricing.
38+
- Prefer the latest version. If search returns v2.5 and v3.0, use v3.
39+
- Run count can be misleading. Old models accumulate runs over time but may be outdated. A model with 10M runs from 2023 is likely worse than a model with 100K runs from 2025.
40+
- Prefer recently released models. The AI space moves fast.
41+
- Check model tags to help filter by task (`image-generation`, `video`, `audio`, etc.).
42+
43+
## Model identifiers
44+
45+
- **Official models** use `owner/name` format (e.g. `black-forest-labs/flux-2-klein-9b`). Routes to the latest version automatically.
46+
- **Community models** require `owner/name:version_id`. You must pin a specific version. Community models can cold-boot and take time to start.
47+
- If you must use a community model, be aware that it can take a long time to boot. You can create always-on deployments, but you pay for model uptime.

0 commit comments

Comments
 (0)