Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.
Python aianthropicautomationclaude-codeclaude-skillscloudflaredevtoolsproductivityreactskillstailwindvite
refactor: teach patterns not ship scripts, drop skill-creator
Jeremy Dawesbce23b5e1489
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex 21465313..977b485c 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -39,7 +39,7 @@},{"name": "dev-tools",- "description": "Skill creation, project kickoff and permission management, project context, dev sessions, GitHub releases, Gemini peer review and API guide, capabilities reference, UX audits, and responsive layout testing.",+ "description": "Project health and permission management, dev sessions, GitHub releases, Gemini peer review and API guide, capabilities reference, UX audits, and responsive layout testing.","source": "./plugins/dev-tools","category": "development"},diff --git a/CLAUDE.md b/CLAUDE.mdindex 48e82fd9..a55d8247 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -9,13 +9,14 @@ Production workflow skills for Claude Code CLI. Each skill guides Claude through- Every skill must produce visible output (files, configurations, deployable projects)- "The context window is a public good" — only include what Claude doesn't already know+- **Teach patterns, not ship scripts** — skills teach Claude *what* to do, Claude generates scripts adapted to the user's environment. Pre-built scripts in `scripts/` are the rare exception, not the default. Put proven implementation patterns in `references/` for Claude to adapt.- Follows the official Claude Code plugin spec## Directory Structure```claude-skills/-├── plugins/ # 9 installable plugins (34 skills)+├── plugins/ # 9 installable plugins│ ├── cloudflare/ # Cloudflare Workers, Hono, D1/Drizzle, Vite, TanStack Start│ │ └── skills/│ │ ├── cloudflare-worker-builder/@@ -45,11 +46,9 @@ claude-skills/│ │ ├── google-apps-script/│ │ ├── elevenlabs-agents/│ │ └── mcp-builder/-│ ├── dev-tools/ # Skill creation, context, sessions, releases+│ ├── dev-tools/ # Context, sessions, releases, peer review│ │ └── skills/-│ │ ├── skill-creator/-│ │ ├── project-kickoff/-│ │ ├── context-manager/+│ │ ├── project-health/│ │ ├── dev-session/│ │ ├── github-release/│ │ ├── gemini-peer-review/@@ -89,8 +88,7 @@ plugin-name/└── skills/└── skill-name/├── SKILL.md # Frontmatter + instructions, under 500 lines- ├── scripts/ # Executable code (run directly)- ├── references/ # Docs loaded on demand by Claude+ ├── references/ # Docs and example code loaded on demand by Claude└── assets/ # Files used in output (templates, images)```@@ -123,15 +121,27 @@ plugin-name/## Creating a Skill-Use the skill-creator skill:+Use [Anthropic's official skill-creator](https://github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md) or ask Claude: "Create a new skill for [use case]"-```bash-python3 plugins/dev-tools/skills/skill-creator/scripts/init_skill.py my-skill --path plugins/my-plugin/skills/-```+Key principle: **every skill must produce something.** If it's just reference material Claude already knows, it doesn't earn a place here.-Or ask Claude: "Create a new skill for [use case]"+### Skill Design: Patterns Over Scripts-Key principle: **every skill must produce something.** If it's just reference material Claude already knows, it doesn't earn a place here.+Skills should teach Claude the pattern so it can generate scripts adapted to the user's environment. Don't ship pre-built scripts unless the operation is genuinely complex and error-prone.++| Content type | Where it goes | Example |+|-------------|--------------|---------|+| Workflow steps (what to do) | SKILL.md body | "Resize the image, then convert to WebP" |+| Implementation patterns with gotchas | `references/` | RGBA-to-JPG compositing, API response parsing |+| Templates copied into user projects | `assets/` | React boilerplate, config files |++**Rule of thumb**: If Claude could generate a script from a 20-line description faster than it can find, read, and run a pre-built one, the description wins.++### Frontmatter Validation++- `name`: kebab-case, lowercase letters/digits/hyphens, max 64 characters+- `description`: max 1024 characters, no angle brackets. Include trigger phrases.+- Optional: `license`, `compatibility`, `allowed-tools`, `metadata`## Installing Plugins@@ -153,11 +163,11 @@ After installing, restart Claude Code to load new plugins.## Quality BarBefore committing a skill:-- [ ] SKILL.md has valid YAML frontmatter (name + description)+- [ ] SKILL.md has valid YAML frontmatter (name: kebab-case max 64 chars, description: max 1024 chars)- [ ] Under 500 lines- [ ] Produces tangible output (not just reference material)-- [ ] Passes validation: `python3 plugins/dev-tools/skills/skill-creator/scripts/quick_validate.py plugins/category/skills/my-skill`- [ ] Tested by actually using it on a real task+- [ ] No pre-built scripts where a pattern description would suffice## Git Historydiff --git a/README.md b/README.mdindex 107e5986..ef6f5844 100644--- a/README.md+++ b/README.md@@ -13,7 +13,7 @@ Workflow skills for [Claude Code](https://claude.com/claude-code) that produce t| **frontend** | tailwind-theme-builder, shadcn-ui | Themed Tailwind v4 + shadcn/ui setup with dark mode || **design-assets** | color-palette, favicon-gen, icon-set-generator, gemini-image-gen, image-processing | Colour palettes, favicons, SVG icons, AI image generation, image processing || **integrations** | google-chat-messages, google-apps-script, elevenlabs-agents, mcp-builder | Google Chat webhooks, Apps Script, ElevenLabs agents, MCP servers |-| **dev-tools** | skill-creator, project-health, dev-session, github-release, gemini-peer-review, gemini-guide, claude-capabilities, ux-audit, responsiveness-check | Skill creation, project health audits, session tracking, releases, Gemini peer review, API guide, UX audits, responsive testing |+| **dev-tools** | project-health, dev-session, github-release, gemini-peer-review, gemini-guide, claude-capabilities, ux-audit, responsiveness-check | Project health audits, session tracking, releases, Gemini peer review, API guide, UX audits, responsive testing || **shopify** | shopify-setup, shopify-products, shopify-content | Shopify API setup, product management, content pages, blog posts || **wordpress** | wordpress-setup, wordpress-content, wordpress-elementor | WordPress WP-CLI access, content management, Elementor page editing || **writing** | aussie-business-english | Australian business English writing style |@@ -38,9 +38,7 @@ Workflow skills for [Claude Code](https://claude.com/claude-code) that produce t## Create Your Own-```bash-python3 plugins/dev-tools/skills/skill-creator/scripts/init_skill.py my-skill --path plugins/dev-tools/skills/-```+Use [Anthropic's official skill-creator](https://github.com/anthropics/skills) or ask Claude: "Create a new skill for [use case]"## Philosophydiff --git a/plugins/cloudflare/skills/vite-flare-starter/SKILL.md b/plugins/cloudflare/skills/vite-flare-starter/SKILL.mdindex 828ff568..30b508a7 100644--- a/plugins/cloudflare/skills/vite-flare-starter/SKILL.md+++ b/plugins/cloudflare/skills/vite-flare-starter/SKILL.md@@ -35,21 +35,20 @@ Ask for:| Description (1 sentence) | Google OAuth credentials || Cloudflare account | Custom domain |-### Step 2: Run Setup Script+### Step 2: Clone and Configure-```bash-bash plugins/cloudflare/skills/vite-flare-starter/scripts/setup.sh-```+Perform these operations to scaffold the project. See [references/setup-pattern.md](references/setup-pattern.md) for exact replacement targets and the `.dev.vars` template.-The script will:-1. Clone the repo and remove `.git`-2. Find-replace `vite-flare-starter` with project name (7 locations)-3. Generate `BETTER_AUTH_SECRET`-4. Create `.dev.vars` from template-5. Optionally create Cloudflare D1 + R2 resources-6. Run `pnpm install`-7. Run local database migration-8. Report remaining manual steps+1. **Clone** the repo and remove `.git`, init fresh repo+2. **Find-replace** `vite-flare-starter` with the project name in wrangler.jsonc (worker name, database name, R2 bucket names), package.json (name, database refs), and index.html (title, meta)+3. **Remove** hardcoded `account_id` and replace `database_id` with placeholder in wrangler.jsonc+4. **Reset** package.json version to `0.1.0`+5. **Generate** `BETTER_AUTH_SECRET` using `openssl rand -hex 32` (or Python `secrets.token_hex(32)`)+6. **Create** `.dev.vars` from template (convert kebab-case name to Title Case for display, underscore for ID)+7. **Optionally create** Cloudflare D1 database and R2 buckets, update wrangler.jsonc with database_id+8. **Install** dependencies with `pnpm install`+9. **Run** local database migration with `pnpm run db:migrate:local`+10. **Initial commit**### Step 3: Manual Configuration@@ -111,7 +110,7 @@ pnpm run build && pnpm run deploy## What Gets Rebranded-The setup script handles these automatically:+The setup process handles these automatically:| File | What Changes ||------|-------------|diff --git a/plugins/cloudflare/skills/vite-flare-starter/references/setup-pattern.md b/plugins/cloudflare/skills/vite-flare-starter/references/setup-pattern.mdnew file mode 100644index 00000000..5eac7228--- /dev/null+++ b/plugins/cloudflare/skills/vite-flare-starter/references/setup-pattern.md@@ -0,0 +1,107 @@+# Vite Flare Starter Setup Pattern++Reference for the operations Claude performs when scaffolding a new project from+vite-flare-starter. Adapt to the user's environment.++## Step 1: Clone and Clean++```bash+git clone https://github.com/jezweb/vite-flare-starter.git PROJECT_DIR --depth 1+cd PROJECT_DIR+rm -rf .git+git init+```++## Step 2: Find-Replace Targets++Replace `vite-flare-starter` with the project name in these locations:++| File | Target | Replace with | Notes |+|------|--------|-------------|-------|+| `wrangler.jsonc` | `"vite-flare-starter"` (worker name) | `"PROJECT_NAME"` | |+| `wrangler.jsonc` | `vite-flare-starter-db` | `PROJECT_NAME-db` | Database name |+| `wrangler.jsonc` | `vite-flare-starter-avatars` | `PROJECT_NAME-avatars` | R2 bucket |+| `wrangler.jsonc` | `vite-flare-starter-files` | `PROJECT_NAME-files` | R2 bucket |+| `package.json` | `"name": "vite-flare-starter"` | `"name": "PROJECT_NAME"` | |+| `package.json` | `vite-flare-starter-db` | `PROJECT_NAME-db` | In scripts |+| `index.html` | `<title>` content | App display name | Title Case |++Also in `wrangler.jsonc`:+- **Remove** hardcoded `account_id` line (let wrangler prompt or use env var)+- **Replace** `database_id` value with `REPLACE_WITH_YOUR_DATABASE_ID`+- **Reset** `package.json` version to `"0.1.0"`++## Step 3: Generate Auth Secret++```bash+# Prefer openssl, fall back to Python+BETTER_AUTH_SECRET=$(openssl rand -hex 32 2>/dev/null || python3 -c "import secrets; print(secrets.token_hex(32))")+```++## Step 4: Create .dev.vars++Convert kebab-case project name to display name and app ID:+- `my-cool-app` → Display: `My Cool App`, ID: `my_cool_app`++```+# Local Development Environment Variables+# DO NOT COMMIT THIS FILE TO GIT++# Authentication (better-auth)+BETTER_AUTH_SECRET=<generated>+BETTER_AUTH_URL=http://localhost:5173++# Google OAuth (optional)+GOOGLE_CLIENT_ID=+GOOGLE_CLIENT_SECRET=++# Email Auth Control (disabled by default)+# ENABLE_EMAIL_LOGIN=true+# ENABLE_EMAIL_SIGNUP=true++# Application Configuration+APP_NAME=<Display Name>+VITE_APP_NAME=<Display Name>+VITE_APP_ID=<app_id>+VITE_TOKEN_PREFIX=<app_id>_+VITE_GITHUB_URL=+VITE_FOOTER_TEXT=++NODE_ENV=development+```++## Step 5: Update index.html++Replace `<title>` and meta description content with the display name.++## Step 6: Create Cloudflare Resources (Optional)++```bash+# D1 database+npx wrangler d1 create PROJECT_NAME-db+# Extract database_id from output, update wrangler.jsonc++# R2 buckets+npx wrangler r2 bucket create PROJECT_NAME-avatars+npx wrangler r2 bucket create PROJECT_NAME-files+```++## Step 7: Install and Migrate++```bash+pnpm install+pnpm run db:migrate:local+```++## Step 8: Initial Commit++```bash+git add -A+git commit -m "Initial commit from vite-flare-starter"+```++## macOS sed Note++macOS `sed -i` requires an extension argument: `sed -i '' 's/old/new/g' file`.+GNU `sed -i` does not. Claude should detect the platform and adjust, or use+the Edit tool directly (preferred — avoids sed entirely).diff --git a/plugins/cloudflare/skills/vite-flare-starter/scripts/setup.sh b/plugins/cloudflare/skills/vite-flare-starter/scripts/setup.shdeleted file mode 100755index fe9d2aa1..00000000--- a/plugins/cloudflare/skills/vite-flare-starter/scripts/setup.sh+++ /dev/null@@ -1,232 +0,0 @@-#!/usr/bin/env bash-# vite-flare-starter setup script-# Clones, configures, and prepares a new project from the starter template.-#-# Usage:-# bash setup.sh-# bash setup.sh --name my-project --dir ~/Projects-# bash setup.sh --name my-project --skip-cloudflare--set -euo pipefail--# ── Defaults ──-REPO_URL="https://github.com/jezweb/vite-flare-starter.git"-PROJECT_NAME=""-PROJECT_DIR=""-SKIP_CLOUDFLARE=false-ADMIN_EMAIL=""--# ── Parse arguments ──-while [[ $# -gt 0 ]]; do- case "$1" in- --name) PROJECT_NAME="$2"; shift 2 ;;- --dir) PROJECT_DIR="$2"; shift 2 ;;- --skip-cloudflare) SKIP_CLOUDFLARE=true; shift ;;- --admin-email) ADMIN_EMAIL="$2"; shift 2 ;;- *) echo "Unknown option: $1"; exit 1 ;;- esac-done--# ── Interactive prompts if not provided ──-if [[ -z "$PROJECT_NAME" ]]; then- read -rp "Project name (kebab-case, e.g. my-app): " PROJECT_NAME-fi--if [[ -z "$PROJECT_DIR" ]]; then- PROJECT_DIR="$(pwd)/$PROJECT_NAME"-fi--# Validate project name (kebab-case)-if ! [[ "$PROJECT_NAME" =~ ^[a-z][a-z0-9-]*[a-z0-9]$ ]]; then- echo "Error: Project name must be kebab-case (lowercase letters, digits, hyphens)."- echo " Example: my-cool-app"- exit 1-fi--echo ""-echo "╔══════════════════════════════════════════╗"-echo "║ vite-flare-starter setup ║"-echo "╚══════════════════════════════════════════╝"-echo ""-echo " Project: $PROJECT_NAME"-echo " Location: $PROJECT_DIR"-echo ""--# ── Step 1: Clone ──-echo "→ Cloning vite-flare-starter..."-if [[ -d "$PROJECT_DIR" ]]; then- echo "Error: Directory $PROJECT_DIR already exists."- exit 1-fi--git clone "$REPO_URL" "$PROJECT_DIR" --depth 1-cd "$PROJECT_DIR"--# Remove original git history-rm -rf .git-git init-echo " ✓ Cloned and initialised fresh git repo"--# ── Step 2: Find-replace project name ──-echo ""-echo "→ Rebranding to '$PROJECT_NAME'..."--# wrangler.jsonc — worker name-sed -i "s/\"vite-flare-starter\"/\"$PROJECT_NAME\"/g" wrangler.jsonc--# wrangler.jsonc — database name-sed -i "s/vite-flare-starter-db/${PROJECT_NAME}-db/g" wrangler.jsonc--# wrangler.jsonc — R2 bucket names-sed -i "s/vite-flare-starter-avatars/${PROJECT_NAME}-avatars/g" wrangler.jsonc-sed -i "s/vite-flare-starter-files/${PROJECT_NAME}-files/g" wrangler.jsonc--# Remove hardcoded account_id (let wrangler prompt or use env var)-sed -i '/"account_id":/d' wrangler.jsonc--# Remove hardcoded database_id (will be set after creation)-sed -i 's/"database_id": "[^"]*"/"database_id": "REPLACE_WITH_YOUR_DATABASE_ID"/g' wrangler.jsonc--# package.json — package name-sed -i "s/\"name\": \"vite-flare-starter\"/\"name\": \"$PROJECT_NAME\"/g" package.json--# package.json — database references in scripts-sed -i "s/vite-flare-starter-db/${PROJECT_NAME}-db/g" package.json--# package.json — reset version-sed -i 's/"version": "[^"]*"/"version": "0.1.0"/g' package.json--echo " ✓ Replaced vite-flare-starter → $PROJECT_NAME in config files"--# ── Step 3: Generate auth secret ──-BETTER_AUTH_SECRET=$(openssl rand -hex 32 2>/dev/null || python3 -c "import secrets; print(secrets.token_hex(32))")-echo " ✓ Generated BETTER_AUTH_SECRET"--# ── Step 4: Create .dev.vars ──-# Convert kebab-case to Title Case for display name-APP_DISPLAY_NAME=$(echo "$PROJECT_NAME" | sed 's/-/ /g' | sed 's/\b\(.\)/\u\1/g')-APP_ID=$(echo "$PROJECT_NAME" | tr '-' '_')--cat > .dev.vars << DEVVARS-# Local Development Environment Variables-# DO NOT COMMIT THIS FILE TO GIT--# Authentication (better-auth)-BETTER_AUTH_SECRET=$BETTER_AUTH_SECRET-BETTER_AUTH_URL=http://localhost:5173--# Google OAuth (optional — get from https://console.cloud.google.com/)-GOOGLE_CLIENT_ID=-GOOGLE_CLIENT_SECRET=--# Email Auth Control (disabled by default — OAuth-only)-# ENABLE_EMAIL_LOGIN=true-# ENABLE_EMAIL_SIGNUP=true--# Email Configuration (optional — for verification/password reset)-# EMAIL_API_KEY=re_...--# Application Configuration-APP_NAME=$APP_DISPLAY_NAME-VITE_APP_NAME=$APP_DISPLAY_NAME-VITE_APP_ID=$APP_ID-VITE_TOKEN_PREFIX=${APP_ID}_-VITE_GITHUB_URL=-VITE_FOOTER_TEXT=--NODE_ENV=development-DEVVARS--echo " ✓ Created .dev.vars"--# ── Step 5: Update index.html ──-sed -i "s/<title>.*<\/title>/<title>$APP_DISPLAY_NAME<\/title>/" index.html-sed -i "s/content=\"Vite Flare Starter[^\"]*\"/content=\"$APP_DISPLAY_NAME\"/g" index.html-echo " ✓ Updated index.html title"--# ── Step 6: Optionally create Cloudflare resources ──-if [[ "$SKIP_CLOUDFLARE" == false ]]; then- echo ""- echo "→ Creating Cloudflare resources..."-- # Check if wrangler is available- if ! command -v npx &>/dev/null; then- echo " ⚠ npx not found — skipping Cloudflare resource creation"- echo " Run manually: npx wrangler d1 create ${PROJECT_NAME}-db"- SKIP_CLOUDFLARE=true- else- # Create D1 database- echo " Creating D1 database: ${PROJECT_NAME}-db"- D1_OUTPUT=$(npx wrangler d1 create "${PROJECT_NAME}-db" 2>&1) || true- echo "$D1_OUTPUT"-- # Extract database_id from output- DB_ID=$(echo "$D1_OUTPUT" | grep -oP 'database_id = "\K[^"]+' || true)- if [[ -n "$DB_ID" ]]; then- sed -i "s/REPLACE_WITH_YOUR_DATABASE_ID/$DB_ID/" wrangler.jsonc- echo " ✓ D1 database created (ID: $DB_ID)"- else- echo " ⚠ Could not extract database_id — update wrangler.jsonc manually"- fi-- # Create R2 buckets- echo " Creating R2 bucket: ${PROJECT_NAME}-avatars"- npx wrangler r2 bucket create "${PROJECT_NAME}-avatars" 2>&1 || true-- echo " Creating R2 bucket: ${PROJECT_NAME}-files"- npx wrangler r2 bucket create "${PROJECT_NAME}-files" 2>&1 || true-- echo " ✓ R2 buckets created"- fi-fi--# ── Step 7: Install dependencies ──-echo ""-echo "→ Installing dependencies..."-pnpm install-echo " ✓ Dependencies installed"--# ── Step 8: Run local database migration ──-echo ""-echo "→ Running local database migration..."-pnpm run db:migrate:local 2>&1 || echo " ⚠ Migration failed — run manually: pnpm run db:migrate:local"-echo " ✓ Local database migrated"--# ── Step 9: Initial git commit ──-git add -A-git commit -m "Initial commit from vite-flare-starter" --no-verify 2>/dev/null || true--# ── Summary ──-echo ""-echo "╔══════════════════════════════════════════╗"-echo "║ Setup complete! ║"-echo "╚══════════════════════════════════════════╝"-echo ""-echo " Project: $PROJECT_DIR"-echo ""-echo " Remaining manual steps:"-echo " ─────────────────────────────────────────"--if [[ "$SKIP_CLOUDFLARE" == true ]]; then- echo " 1. Create Cloudflare resources:"- echo " npx wrangler d1 create ${PROJECT_NAME}-db"- echo " npx wrangler r2 bucket create ${PROJECT_NAME}-avatars"- echo " npx wrangler r2 bucket create ${PROJECT_NAME}-files"- echo " Then update wrangler.jsonc with your database_id"- echo ""-fi--echo " • Google OAuth (optional):"-echo " - Create OAuth client at console.cloud.google.com"-echo " - Add redirect: http://localhost:5173/api/auth/callback/google"-echo " - Copy credentials to .dev.vars"-echo ""-echo " • Replace public/favicon.svg with your favicon"-echo ""-echo " • Update CLAUDE.md with your project description"-echo ""-echo " Start developing:"-echo " cd $PROJECT_DIR"-echo " pnpm dev"-echo ""diff --git a/plugins/design-assets/skills/gemini-image-gen/SKILL.md b/plugins/design-assets/skills/gemini-image-gen/SKILL.mdindex 0cccf98b..f121d6a0 100644--- a/plugins/design-assets/skills/gemini-image-gen/SKILL.md+++ b/plugins/design-assets/skills/gemini-image-gen/SKILL.md@@ -39,38 +39,24 @@ Use concrete photography parameters, not abstract adjectives. Read [references/p### Step 3: Generate-```bash-python3 plugins/design-assets/skills/gemini-image-gen/scripts/generate-image.py \- --prompt "Soft-focus atmospheric background, warm gold and cream botanical elements, luxury spa aesthetic, wide landscape" \- --output public/images/hero.png \- --model gemini-2.5-flash-image-```+Generate a Python script (no dependencies beyond stdlib) that calls the Gemini API. The script should:-Multiple variants:+1. Read `GEMINI_API_KEY` from environment+2. POST to `https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent`+3. Include `"responseModalities": ["TEXT", "IMAGE"]` in generationConfig+4. Parse the response: extract `inlineData.data` (base64) from candidate parts+5. Decode base64 and save as PNG+6. Support multiple variants (generate N times, save as `name-1.png`, `name-2.png`)-```bash-python3 .../generate-image.py --prompt "..." --output public/images/hero.png --count 3-# Produces hero-1.png, hero-2.png, hero-3.png-```+For style matching with a reference image, include the reference as an `inlineData` part before the text prompt, and use temperature 0.7 (instead of 1.0).-Style matching from a reference image:+See [references/api-pattern.md](references/api-pattern.md) for the full implementation pattern including error handling and response parsing.-```bash-python3 .../generate-image.py \- --prompt "Same warm lighting and colour palette, but showing a massage treatment room" \- --reference public/images/existing-hero.jpg \- --output public/images/services-bg.png \- --model gemini-3-pro-image-preview-```+**Critical**: Never pass prompts via curl + bash arguments — shell escaping breaks on apostrophes. Always use Python's `json.dumps()` or write the prompt to a file first.### Step 4: Post-Process (Optional)-Use the **image-processing** skill for resizing, format conversion, or optimisation:--```bash-python3 plugins/design-assets/skills/image-processing/scripts/process-image.py \- optimise public/images/hero.png --output public/images/hero.webp --width 1920-```+Use the **image-processing** skill for resizing, format conversion, or optimisation.### Step 5: Present to User@@ -94,7 +80,7 @@ Starting prompts — enhance with project-specific context (colours, mood, subje|----------|-------|------|| Drafts, quick placeholders | `gemini-2.5-flash-image` | Free (~500/day) || Final client assets | `gemini-3-pro-image-preview` | ~$0.04/image |-| Style-matched variants | `gemini-3-pro-image-preview` + `--reference` | ~$0.04/image |+| Style-matched variants | `gemini-3-pro-image-preview` + reference image | ~$0.04/image |Verify current model IDs if errors occur — they change frequently.@@ -103,3 +89,4 @@ Verify current model IDs if errors occur — they change frequently.| When | Read ||------|------|| Building effective prompts | [references/prompting-guide.md](references/prompting-guide.md) |+| API implementation details | [references/api-pattern.md](references/api-pattern.md) |diff --git a/plugins/design-assets/skills/gemini-image-gen/references/api-pattern.md b/plugins/design-assets/skills/gemini-image-gen/references/api-pattern.mdnew file mode 100644index 00000000..8bb8bbfc--- /dev/null+++ b/plugins/design-assets/skills/gemini-image-gen/references/api-pattern.md@@ -0,0 +1,95 @@+# Gemini Image Generation API Pattern++Reference implementation for calling the Gemini image generation API. Claude should generate+a tailored script based on the user's needs rather than using this as-is.++## Core Pattern: Text-to-Image++```python+import base64, json, os, urllib.request, urllib.error++def generate_image(model, prompt, api_key, reference_path=None):+ """Generate an image via Gemini API. Returns raw image bytes."""+ url = f"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={api_key}"++ parts = []++ # Optional: style reference image+ if reference_path:+ with open(reference_path, "rb") as f:+ img_data = base64.b64encode(f.read()).decode()+ ext = reference_path.rsplit(".", 1)[-1].lower()+ mime = {"jpg": "image/jpeg", "jpeg": "image/jpeg", "png": "image/png",+ "webp": "image/webp"}.get(ext, "image/jpeg")+ parts.append({"inlineData": {"mimeType": mime, "data": img_data}})++ parts.append({"text": prompt})++ payload = json.dumps({+ "contents": [{"parts": parts}],+ "generationConfig": {+ "responseModalities": ["TEXT", "IMAGE"],+ "temperature": 0.7 if reference_path else 1.0,+ },+ }).encode()++ req = urllib.request.Request(url, data=payload,+ headers={"Content-Type": "application/json"}, method="POST")++ with urllib.request.urlopen(req, timeout=120) as resp:+ data = json.loads(resp.read().decode())++ # Extract image from response candidates+ for candidate in data.get("candidates", []):+ for part in candidate.get("content", {}).get("parts", []):+ if "inlineData" in part:+ return base64.b64decode(part["inlineData"]["data"])++ # No image — check for text response (model may have refused)+ try:+ text = data["candidates"][0]["content"]["parts"][0].get("text", "")+ raise RuntimeError(f"Gemini returned text instead of image: {text}")+ except (KeyError, IndexError):+ raise RuntimeError(f"Unexpected response: {json.dumps(data)[:500]}")+```++## Key Details++**Response structure**: Gemini returns `candidates[].content.parts[]`. Each part is either+`{"text": "..."}` or `{"inlineData": {"mimeType": "image/png", "data": "<base64>"}}`.++**Temperature**: Use 0.7 with reference images (closer style match), 1.0 without (more creative).++**responseModalities**: Must include `"IMAGE"` to get image output. `["TEXT", "IMAGE"]` allows+the model to include both text and image parts.++## Multiple Variants++Generate N variants by calling the API N times:++```python+for i in range(count):+ img_bytes = generate_image(model, prompt, api_key, reference_path)+ if count > 1:+ base, ext = output_path.rsplit(".", 1)+ path = f"{base}-{i+1}.{ext}"+ else:+ path = output_path+ os.makedirs(os.path.dirname(path) or ".", exist_ok=True)+ with open(path, "wb") as f:+ f.write(img_bytes)+```++## Shell Escaping Warning++Never pass prompts via curl + bash — apostrophes and special characters break JSON.+Always use Python's `json.dumps()` for serialisation, or write the prompt to a file first.++## Model IDs++| Use case | Model | Cost |+|----------|-------|------|+| Drafts | `gemini-2.5-flash-image` | Free (~500/day) |+| Final assets | `gemini-3-pro-image-preview` | ~$0.04/image |++Verify model IDs if errors occur — they change frequently.diff --git a/plugins/design-assets/skills/gemini-image-gen/scripts/generate-image.py b/plugins/design-assets/skills/gemini-image-gen/scripts/generate-image.pydeleted file mode 100644index 2e6a27ef..00000000--- a/plugins/design-assets/skills/gemini-image-gen/scripts/generate-image.py+++ /dev/null@@ -1,111 +0,0 @@-#!/usr/bin/env python3-"""Generate images via Gemini API. No dependencies beyond Python 3 stdlib.--Usage:- # Text-to-image- python3 generate-image.py --prompt "A warm hero background for a spa website" --output hero.png-- # With style reference image- python3 generate-image.py --prompt "Same style, different subject" --reference ref.jpg --output out.png-- # Multiple variants- python3 generate-image.py --prompt "..." --output variant.png --count 3-- # Use pro model for final assets- python3 generate-image.py --prompt "..." --output final.png --model gemini-3-pro-image-preview--Reads GEMINI_API_KEY from environment.-"""--import argparse-import base64-import json-import os-import sys-import urllib.request-import urllib.error---def generate(model: str, prompt: str, api_key: str, reference_path: str = None) -> bytes:- url = f"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={api_key}"-- parts = []-- if reference_path:- with open(reference_path, "rb") as f:- img_data = base64.b64encode(f.read()).decode()- ext = reference_path.rsplit(".", 1)[-1].lower()- mime = {"jpg": "image/jpeg", "jpeg": "image/jpeg", "png": "image/png", "webp": "image/webp"}.get(ext, "image/jpeg")- parts.append({"inlineData": {"mimeType": mime, "data": img_data}})-- parts.append({"text": prompt})-- payload = json.dumps({- "contents": [{"parts": parts}],- "generationConfig": {- "responseModalities": ["TEXT", "IMAGE"],- "temperature": 0.7 if reference_path else 1.0,- },- }).encode()-- req = urllib.request.Request(url, data=payload, headers={"Content-Type": "application/json"}, method="POST")-- try:- with urllib.request.urlopen(req, timeout=120) as resp:- data = json.loads(resp.read().decode())- except urllib.error.HTTPError as e:- body = e.read().decode() if e.fp else ""- print(f"Gemini API error {e.code}: {body}", file=sys.stderr)- sys.exit(1)-- # Extract image from response- try:- for candidate in data.get("candidates", []):- for part in candidate.get("content", {}).get("parts", []):- if "inlineData" in part:- return base64.b64decode(part["inlineData"]["data"])- except (KeyError, IndexError):- pass-- # No image in response — print text response for debugging- try:- text = data["candidates"][0]["content"]["parts"][0].get("text", "")- if text:- print(f"Gemini returned text instead of image: {text}", file=sys.stderr)- except (KeyError, IndexError):- print(f"Unexpected response: {json.dumps(data, indent=2)[:500]}", file=sys.stderr)- sys.exit(1)---def main():- parser = argparse.ArgumentParser(description="Generate images via Gemini API")- parser.add_argument("--prompt", required=True, help="Image generation prompt")- parser.add_argument("--output", required=True, help="Output file path (e.g. hero.png)")- parser.add_argument("--model", default="gemini-2.5-flash-image", help="Gemini model ID")- parser.add_argument("--reference", help="Reference image for style matching")- parser.add_argument("--count", type=int, default=1, help="Number of variants to generate")- args = parser.parse_args()-- api_key = os.environ.get("GEMINI_API_KEY")- if not api_key:- print("GEMINI_API_KEY not set. Get a key from https://aistudio.google.com/apikey", file=sys.stderr)- sys.exit(1)-- for i in range(args.count):- if args.count > 1:- base, ext = args.output.rsplit(".", 1)- output_path = f"{base}-{i+1}.{ext}"- else:- output_path = args.output-- print(f"Generating {output_path}...", file=sys.stderr)- img_bytes = generate(args.model, args.prompt, api_key, args.reference)-- os.makedirs(os.path.dirname(output_path) or ".", exist_ok=True)- with open(output_path, "wb") as f:- f.write(img_bytes)- print(f"Saved {output_path} ({len(img_bytes):,} bytes)", file=sys.stderr)---if __name__ == "__main__":- main()diff --git a/plugins/design-assets/skills/image-processing/SKILL.md b/plugins/design-assets/skills/image-processing/SKILL.mdindex 5389f3f2..a38e2cea 100644--- a/plugins/design-assets/skills/image-processing/SKILL.md+++ b/plugins/design-assets/skills/image-processing/SKILL.md@@ -6,7 +6,7 @@ compatibility: claude-code-only# Image Processing-Process images for web development using Pillow (Python). Resize, convert, trim, optimise, and composite — no ImageMagick or native dependencies required.+Process images for web development. Generate a Pillow script adapted to the user's environment and specific needs.## Prerequisites@@ -16,122 +16,65 @@ Pillow is usually pre-installed. If not:pip install Pillow```-## Commands+If Pillow is unavailable, adapt using alternatives:-All commands use `scripts/process-image.py`. Each takes `--output` (`-o`) and optional `--quality` (`-q`).+| Alternative | Platform | Install | Capabilities |+|-------------|----------|---------|-------------|+| `sips` | macOS (built-in) | None | Resize, convert (no trim/OG) |+| `sharp` | Node.js | `npm install sharp` | Full feature set |+| `ffmpeg` | Cross-platform | `brew install ffmpeg` | Resize, convert |-### Resize+## Capabilities-Scale an image to specific dimensions or by width/height (maintains aspect ratio if only one given).+Generate a Python script using Pillow for any of these operations. See `references/pillow-patterns.md` for implementation patterns, especially RGBA-to-JPG compositing and cross-platform font discovery.-```bash-python3 plugins/design-assets/skills/image-processing/scripts/process-image.py \- resize input.png -o resized.png --width 1920 --height 1080+### Resize-# Width only — height calculated from aspect ratio-python3 .../process-image.py resize input.png -o resized.png -w 800-```+Scale to specific dimensions or by width/height (maintain aspect ratio if only one given). Use `Image.LANCZOS` for high-quality downscaling.### Convert Format-Convert between PNG, JPG, WebP. RGBA→JPG automatically composites onto white background.--```bash-python3 .../process-image.py convert logo.png -o logo.webp-python3 .../process-image.py convert photo.webp -o photo.jpg -q 90-```+Convert between PNG, JPG, WebP. Handle RGBA-to-JPG by compositing onto white background. Apply format-specific quality settings (WebP: 85, JPG: 90, PNG: optimize).### Trim Whitespace-Auto-crop surrounding whitespace from logos and icons.--```bash-python3 .../process-image.py trim logo-with-padding.png -o logo-trimmed.png-```+Auto-crop surrounding whitespace from logos and icons. Convert to RGBA first, then use `getbbox()` to find content bounds.### Thumbnail-Create a thumbnail fitting within a max dimension (maintains aspect ratio).--```bash-python3 .../process-image.py thumbnail product.jpg -o thumb.jpg --size 300-```+Fit within max dimensions while maintaining aspect ratio. Use `img.thumbnail((size, size), Image.LANCZOS)`.### Optimise for Web-Resize + compress in one step. Ideal for preparing uploaded images for production.+Resize + compress in one step. Convert to WebP for best compression. Typical settings: width 1920, quality 85.-```bash-python3 .../process-image.py optimise hero.jpg -o hero.webp -w 1920 -q 85-```+### OG Card (1200x630)-### OG Card--Generate a 1200x630 Open Graph card image with title and subtitle overlay.--```bash-# With background image-python3 .../process-image.py og-card \- --background hero.jpg \- --title "My Page Title" \- --subtitle "A brief description" \- -o og-image.png--# Solid colour background-python3 .../process-image.py og-card \- --bg-color "#1a1a2e" \- --title "My Page Title" \- -o og-image.png-```+Generate Open Graph card with title/subtitle overlay on a background image or solid colour. Apply semi-transparent overlay for text readability. Centre text horizontally.## Common Workflows### Logo Cleanup (client-supplied JPG with white background)-```bash-# 1. Trim whitespace-python3 .../process-image.py trim client-logo.jpg -o logo-trimmed.png--# 2. Convert to PNG (for transparency on non-white backgrounds)-python3 .../process-image.py convert logo-trimmed.png -o logo.png--# 3. Create favicon-sized version-python3 .../process-image.py thumbnail logo.png -o favicon-source.png --size 512-```+1. Trim whitespace+2. Convert to PNG (for transparency)+3. Create favicon-sized version (thumbnail at 512px)### Prepare Hero Image for Production-```bash-# Resize to max width, convert to WebP, compress-python3 .../process-image.py optimise uploaded-hero.jpg -o public/images/hero.webp -w 1920 -q 85-```--### Batch Process (Multiple Images)+Resize to max width 1920, convert to WebP, compress at quality 85.-For batch operations, write a quick script rather than running commands one by one:+### Batch Process-```python-import subprocess, glob-for img in glob.glob("uploads/*.jpg"):- name = img.rsplit("/", 1)[-1].replace(".jpg", ".webp")- subprocess.run(["python3", ".../process-image.py", "optimise", img, "-o", f"public/images/{name}", "-w", "1200", "-q", "85"])-```+For multiple images, generate a single script that loops over all files rather than processing one at a time.## Pipeline with Gemini Image Gen-Generate → Process → Deploy:--```bash-# 1. Generate with Gemini-python3 plugins/design-assets/skills/gemini-image-gen/scripts/generate-image.py \- --prompt "..." --output raw-hero.png --count 3--# 2. User picks favourite (e.g. raw-hero-2.png)+Generate images with the gemini-image-gen skill, then process them:-# 3. Optimise for web-python3 plugins/design-assets/skills/image-processing/scripts/process-image.py \- optimise raw-hero-2.png -o public/images/hero.webp -w 1920 -q 85-```+1. Generate with Gemini (raw PNG output)+2. User picks favourite+3. Optimise: resize to target width, convert to WebP, compress## Output Format Guide@@ -142,3 +85,9 @@ python3 plugins/design-assets/skills/image-processing/scripts/process-image.py \| Fallback for older browsers | JPG | Universal support || Thumbnails | WebP or JPG | Small file size priority || OG cards | PNG | Social platforms handle PNG best |++## Reference Files++| When | Read |+|------|------|+| Implementing any Pillow operation | [references/pillow-patterns.md](references/pillow-patterns.md) |diff --git a/plugins/design-assets/skills/image-processing/references/pillow-patterns.md b/plugins/design-assets/skills/image-processing/references/pillow-patterns.mdnew file mode 100644index 00000000..a6d890ec--- /dev/null+++ b/plugins/design-assets/skills/image-processing/references/pillow-patterns.md@@ -0,0 +1,151 @@+# Pillow Image Processing Patterns++Reference patterns for common web image operations. Claude should adapt these to the user's+specific needs rather than running them as-is.++## RGBA-to-JPG Compositing++JPG does not support transparency. When converting RGBA images to JPG, composite onto a white background first:++```python+from PIL import Image++img = Image.open(input_path)+if output_path.lower().endswith((".jpg", ".jpeg")) and img.mode == "RGBA":+ bg = Image.new("RGB", img.size, (255, 255, 255))+ bg.paste(img, mask=img.split()[3]) # Use alpha channel as mask+ img = bg+```++This also applies inside the save function — always check before saving as JPG.++## Save with Format-Specific Quality++Different formats need different save parameters:++```python+def save_image(img, output_path, quality=None):+ os.makedirs(os.path.dirname(output_path) or ".", exist_ok=True)+ kwargs = {}+ ext = output_path.lower().rsplit(".", 1)[-1]++ if ext == "webp":+ kwargs = {"quality": quality or 85, "method": 6}+ elif ext in ("jpg", "jpeg"):+ kwargs = {"quality": quality or 90, "optimize": True}+ # Handle RGBA → RGB conversion+ if img.mode == "RGBA":+ bg = Image.new("RGB", img.size, (255, 255, 255))+ bg.paste(img, mask=img.split()[3])+ img = bg+ elif ext == "png":+ kwargs = {"optimize": True}++ img.save(output_path, **kwargs)+```++## Resize with Aspect Ratio++When only width or height is given, calculate the other from aspect ratio:++```python+def resize_image(img, width=None, height=None):+ if width and height:+ return img.resize((width, height), Image.LANCZOS)+ elif width:+ ratio = width / img.width+ return img.resize((width, int(img.height * ratio)), Image.LANCZOS)+ elif height:+ ratio = height / img.height+ return img.resize((int(img.width * ratio), height), Image.LANCZOS)+ return img+```++## Trim Whitespace (Auto-Crop)++Remove surrounding whitespace from logos and icons:++```python+img = Image.open(input_path)+if img.mode != "RGBA":+ img = img.convert("RGBA")+bbox = img.getbbox() # Returns bounding box of non-zero pixels+if bbox:+ img = img.crop(bbox)+```++## OG Card Generation (1200x630)++Composite text on a background image or solid colour:++```python+from PIL import Image, ImageDraw, ImageFont++width, height = 1200, 630++# Background: image or solid colour+if background_path:+ img = Image.open(background_path).resize((width, height), Image.LANCZOS)+else:+ img = Image.new("RGB", (width, height), bg_color or "#1a1a2e")++# Semi-transparent overlay for text readability+overlay = Image.new("RGBA", (width, height), (0, 0, 0, 128))+img = img.convert("RGBA")+img = Image.alpha_composite(img, overlay)++draw = ImageDraw.Draw(img)+font_title = get_font(48)+font_sub = get_font(24)++# Centre title+if title:+ bbox = draw.textbbox((0, 0), title, font=font_title)+ tw = bbox[2] - bbox[0]+ draw.text(((width - tw) // 2, height // 2 - 60), title, fill="white", font=font_title)++img = img.convert("RGB")+```++## Cross-Platform Font Discovery++System font paths differ by OS. Try multiple paths, fall back to Pillow's default:++```python+def get_font(size):+ font_paths = [+ # macOS+ "/System/Library/Fonts/Helvetica.ttc",+ "/System/Library/Fonts/SFNSText.ttf",+ # Linux+ "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",+ "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf",+ # Windows+ "C:/Windows/Fonts/arial.ttf",+ ]+ for path in font_paths:+ if os.path.exists(path):+ try:+ return ImageFont.truetype(path, size)+ except Exception:+ continue+ return ImageFont.load_default()+```++**Tip**: On Linux, `fc-list` shows available fonts. Claude can discover fonts dynamically rather than hardcoding paths.++## Environment Alternatives++If Pillow is not available:++| Alternative | Platform | Install | Best for |+|-------------|----------|---------|----------|+| `sips` | macOS (built-in) | None | Resize, convert (no trim/OG) |+| `sharp` | Node.js | `npm install sharp` | Full feature set, high performance |+| `ffmpeg` | Cross-platform | `brew install ffmpeg` | Resize, convert |++```bash+# macOS sips examples+sips --resampleWidth 1920 input.jpg --out resized.jpg+sips --setProperty format webp input.jpg --out output.webp+```diff --git a/plugins/design-assets/skills/image-processing/scripts/process-image.py b/plugins/design-assets/skills/image-processing/scripts/process-image.pydeleted file mode 100644index 1360236b..00000000--- a/plugins/design-assets/skills/image-processing/scripts/process-image.py+++ /dev/null@@ -1,212 +0,0 @@-#!/usr/bin/env python3-"""Image processing with Pillow. Handles common web dev image tasks.--Usage:- # Resize- python3 process-image.py resize input.png --output resized.png --width 1920 --height 1080-- # Convert format (PNG→WebP, JPG→PNG with transparency, etc.)- python3 process-image.py convert input.png --output output.webp-- # Trim whitespace (auto-crop)- python3 process-image.py trim logo.png --output trimmed.png-- # Create thumbnail- python3 process-image.py thumbnail input.jpg --output thumb.jpg --size 300-- # Optimise for web (resize + WebP + quality)- python3 process-image.py optimise input.jpg --output optimised.webp --width 1200 --quality 85-- # Composite text on image (for OG cards)- python3 process-image.py og-card --background bg.png --output og.png --title "Page Title" --subtitle "Description"--Requires: pip install Pillow (usually pre-installed)-"""--import argparse-import os-import sys--try:- from PIL import Image, ImageDraw, ImageFont, ImageFilter-except ImportError:- print("Pillow not installed. Run: pip install Pillow", file=sys.stderr)- sys.exit(1)---def cmd_resize(args):- img = Image.open(args.input)- if args.width and args.height:- img = img.resize((args.width, args.height), Image.LANCZOS)- elif args.width:- ratio = args.width / img.width- img = img.resize((args.width, int(img.height * ratio)), Image.LANCZOS)- elif args.height:- ratio = args.height / img.height- img = img.resize((int(img.width * ratio), args.height), Image.LANCZOS)- save_image(img, args.output, args.quality)---def cmd_convert(args):- img = Image.open(args.input)- if args.output.lower().endswith((".jpg", ".jpeg")) and img.mode == "RGBA":- bg = Image.new("RGB", img.size, (255, 255, 255))- bg.paste(img, mask=img.split()[3])- img = bg- save_image(img, args.output, args.quality)---def cmd_trim(args):- img = Image.open(args.input)- if img.mode != "RGBA":- img = img.convert("RGBA")- # Use alpha channel or detect background colour from corners- bbox = img.getbbox()- if bbox:- img = img.crop(bbox)- save_image(img, args.output, args.quality)---def cmd_thumbnail(args):- img = Image.open(args.input)- size = args.size or 300- img.thumbnail((size, size), Image.LANCZOS)- save_image(img, args.output, args.quality)---def cmd_optimise(args):- img = Image.open(args.input)- if args.width:- ratio = args.width / img.width- img = img.resize((args.width, int(img.height * ratio)), Image.LANCZOS)- save_image(img, args.output, args.quality or 85)---def cmd_og_card(args):- width, height = 1200, 630- if args.background:- img = Image.open(args.background).resize((width, height), Image.LANCZOS)- else:- img = Image.new("RGB", (width, height), args.bg_color or "#1a1a2e")-- # Semi-transparent overlay for text readability- overlay = Image.new("RGBA", (width, height), (0, 0, 0, 128))- img = img.convert("RGBA")- img = Image.alpha_composite(img, overlay)-- draw = ImageDraw.Draw(img)-- # Try to find a good font, fall back to default- font_title = _get_font(48)- font_sub = _get_font(24)-- # Title- if args.title:- bbox = draw.textbbox((0, 0), args.title, font=font_title)- tw = bbox[2] - bbox[0]- x = (width - tw) // 2- draw.text((x, height // 2 - 60), args.title, fill="white", font=font_title)-- # Subtitle- if args.subtitle:- bbox = draw.textbbox((0, 0), args.subtitle, font=font_sub)- tw = bbox[2] - bbox[0]- x = (width - tw) // 2- draw.text((x, height // 2 + 20), args.subtitle, fill="#cccccc", font=font_sub)-- img = img.convert("RGB")- save_image(img, args.output, args.quality)---def _get_font(size):- """Try system fonts, fall back to Pillow default."""- font_paths = [- "/System/Library/Fonts/Helvetica.ttc",- "/System/Library/Fonts/SFNSText.ttf",- "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",- ]- for path in font_paths:- if os.path.exists(path):- try:- return ImageFont.truetype(path, size)- except Exception:- continue- return ImageFont.load_default()---def save_image(img, output, quality=None):- os.makedirs(os.path.dirname(output) or ".", exist_ok=True)- kwargs = {}- ext = output.lower().rsplit(".", 1)[-1]- if ext == "webp":- kwargs = {"quality": quality or 85, "method": 6}- elif ext in ("jpg", "jpeg"):- kwargs = {"quality": quality or 90, "optimize": True}- if img.mode == "RGBA":- bg = Image.new("RGB", img.size, (255, 255, 255))- bg.paste(img, mask=img.split()[3])- img = bg- elif ext == "png":- kwargs = {"optimize": True}-- img.save(output, **kwargs)- size = os.path.getsize(output)- print(f"Saved {output} ({img.width}x{img.height}, {size:,} bytes)")---def main():- parser = argparse.ArgumentParser(description="Image processing for web development")- sub = parser.add_subparsers(dest="command", required=True)-- # Shared args- def add_common(p):- p.add_argument("--output", "-o", required=True, help="Output file path")- p.add_argument("--quality", "-q", type=int, help="Output quality (1-100)")-- # resize- p = sub.add_parser("resize", help="Resize image")- p.add_argument("input", help="Input file")- p.add_argument("--width", "-w", type=int)- p.add_argument("--height", type=int)- add_common(p)-- # convert- p = sub.add_parser("convert", help="Convert format")- p.add_argument("input", help="Input file")- add_common(p)-- # trim- p = sub.add_parser("trim", help="Auto-crop whitespace")- p.add_argument("input", help="Input file")- add_common(p)-- # thumbnail- p = sub.add_parser("thumbnail", help="Create thumbnail")- p.add_argument("input", help="Input file")- p.add_argument("--size", "-s", type=int, default=300, help="Max dimension")- add_common(p)-- # optimise- p = sub.add_parser("optimise", help="Optimise for web")- p.add_argument("input", help="Input file")- p.add_argument("--width", "-w", type=int, help="Max width (maintains aspect)")- add_common(p)-- # og-card- p = sub.add_parser("og-card", help="Generate OG card image")- p.add_argument("--background", help="Background image (optional)")- p.add_argument("--bg-color", default="#1a1a2e", help="Background colour if no image")- p.add_argument("--title", required=True, help="Card title")- p.add_argument("--subtitle", help="Card subtitle")- add_common(p)-- args = parser.parse_args()- commands = {- "resize": cmd_resize, "convert": cmd_convert, "trim": cmd_trim,- "thumbnail": cmd_thumbnail, "optimise": cmd_optimise, "og-card": cmd_og_card,- }- commands[args.command](args)---if __name__ == "__main__":- main()diff --git a/plugins/dev-tools/skills/gemini-peer-review/SKILL.md b/plugins/dev-tools/skills/gemini-peer-review/SKILL.mdindex b07f4759..2e406713 100644--- a/plugins/dev-tools/skills/gemini-peer-review/SKILL.md+++ b/plugins/dev-tools/skills/gemini-peer-review/SKILL.md@@ -22,15 +22,15 @@ export GEMINI_API_KEY="your-key-here"2. **Read target files** into context3. **Build prompt** using the AI-to-AI template from [references/prompt-templates.md](references/prompt-templates.md)4. **Write prompt to file** at `.claude/artifacts/gemini-prompt.txt` (avoids shell escaping issues)-5. **Call the API** via the review script:+5. **Call the API** — generate a Python script that:+ - Reads `GEMINI_API_KEY` from environment+ - Reads the prompt from `.claude/artifacts/gemini-prompt.txt`+ - POSTs to `https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent`+ - Payload: `{"contents": [{"parts": [{"text": prompt}]}], "generationConfig": {"temperature": 0.3, "maxOutputTokens": 8192}}`+ - Extracts text from `candidates[0].content.parts[0].text`+ - Prints result to stdout-```bash-mkdir -p .claude/artifacts-# Write prompt to file first (step 4), then:-GEMINI_API_KEY="$KEY" python3 plugins/dev-tools/skills/gemini-peer-review/scripts/gemini-review.py \- --model gemini-2.5-flash \- --prompt-file .claude/artifacts/gemini-prompt.txt-```+ Write the script to `.claude/scripts/gemini-review.py` and run it.6. **Synthesize** — present Gemini's findings, add your own perspective (agree/disagree), let the user decide what to implement@@ -62,13 +62,7 @@ Read the target directory's source files, build a prompt using the Security temp### Quick Question-Fast question without file context. Build prompt inline and call with `gemini-2.5-flash`.--```bash-GEMINI_API_KEY="$KEY" python3 plugins/dev-tools/skills/gemini-peer-review/scripts/gemini-review.py \- --model gemini-2.5-flash \- --prompt "[Claude Code consulting Gemini] Quick question: What's the best way to handle WebSockets in Workers?"-```+Fast question without file context. Build prompt inline, write to file, call with `gemini-2.5-flash`.## Model Selection@@ -77,7 +71,7 @@ GEMINI_API_KEY="$KEY" python3 plugins/dev-tools/skills/gemini-peer-review/script| review, debug, quick | `gemini-2.5-flash` | Fast, good for straightforward analysis || architect, security-scan | `gemini-2.5-pro` | Better reasoning for complex trade-offs |-Override by changing the `--model` argument. Check current model IDs if errors occur — they change frequently:+Check current model IDs if errors occur — they change frequently:```bashcurl -s "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY" | python3 -c "import sys,json; [print(m['name']) for m in json.load(sys.stdin)['models'] if 'gemini' in m['name']]"@@ -105,7 +99,7 @@ When building the prompt:2. Append the mode-specific template3. Append the file contents with clear `--- filename ---` separators4. Write to `.claude/artifacts/gemini-prompt.txt`-5. Call the script with `--prompt-file`+5. Generate and run the API call script## Reference Filesdiff --git a/plugins/dev-tools/skills/gemini-peer-review/scripts/gemini-review.py b/plugins/dev-tools/skills/gemini-peer-review/scripts/gemini-review.pydeleted file mode 100644index b9f1f301..00000000--- a/plugins/dev-tools/skills/gemini-peer-review/scripts/gemini-review.py+++ /dev/null@@ -1,81 +0,0 @@-#!/usr/bin/env python3-"""Call Gemini API for peer review. No CLI dependencies — just urllib.--Usage:- python3 gemini-review.py --model gemini-2.5-flash --prompt-file /tmp/prompt.txt- python3 gemini-review.py --model gemini-2.5-pro --prompt "Review this code..."--Reads GEMINI_API_KEY from environment. Exit 1 on error with message to stderr.-"""--import argparse-import json-import os-import sys-import urllib.request-import urllib.error---def call_gemini(model: str, prompt: str, api_key: str) -> str:- url = f"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={api_key}"-- payload = json.dumps({- "contents": [{"parts": [{"text": prompt}]}],- "generationConfig": {- "temperature": 0.3,- "maxOutputTokens": 8192,- },- }).encode()-- req = urllib.request.Request(- url,- data=payload,- headers={"Content-Type": "application/json"},- method="POST",- )-- try:- with urllib.request.urlopen(req, timeout=120) as resp:- data = json.loads(resp.read().decode())- except urllib.error.HTTPError as e:- body = e.read().decode() if e.fp else ""- print(f"Gemini API error {e.code}: {body}", file=sys.stderr)- sys.exit(1)- except urllib.error.URLError as e:- print(f"Network error: {e.reason}", file=sys.stderr)- sys.exit(1)-- try:- return data["candidates"][0]["content"]["parts"][0]["text"]- except (KeyError, IndexError):- print(f"Unexpected response structure: {json.dumps(data, indent=2)}", file=sys.stderr)- sys.exit(1)---def main():- parser = argparse.ArgumentParser(description="Call Gemini API for peer review")- parser.add_argument("--model", default="gemini-2.5-flash", help="Gemini model ID")- parser.add_argument("--prompt", help="Prompt text (inline)")- parser.add_argument("--prompt-file", help="Path to file containing the prompt")- args = parser.parse_args()-- api_key = os.environ.get("GEMINI_API_KEY")- if not api_key:- print("GEMINI_API_KEY not set. Get a key from https://aistudio.google.com/apikey", file=sys.stderr)- sys.exit(1)-- if args.prompt_file:- with open(args.prompt_file) as f:- prompt = f.read()- elif args.prompt:- prompt = args.prompt- else:- print("Provide --prompt or --prompt-file", file=sys.stderr)- sys.exit(1)-- result = call_gemini(args.model, prompt, api_key)- print(result)---if __name__ == "__main__":- main()diff --git a/plugins/dev-tools/skills/skill-creator/SKILL.md b/plugins/dev-tools/skills/skill-creator/SKILL.mddeleted file mode 100644index 0f0618d8..00000000--- a/plugins/dev-tools/skills/skill-creator/SKILL.md+++ /dev/null@@ -1,430 +0,0 @@-----name: skill-creator-description: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.-compatibility: claude-code-only------# Skill Creator--This skill provides guidance for creating effective skills.--## About Skills--Skills are modular, self-contained packages that extend Claude's capabilities by providing-specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific-domains or tasks—they transform Claude from a general-purpose agent into a specialized agent-equipped with procedural knowledge that no model can fully possess.--### What Skills Provide--1. Specialized workflows - Multi-step procedures for specific domains-2. Tool integrations - Instructions for working with specific file formats or APIs-3. Domain expertise - Company-specific knowledge, schemas, business logic-4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks--## Core Principles--### Concise is Key--The context window is a public good. Skills share the context window with everything else Claude needs: system prompt, conversation history, other Skills' metadata, and the actual user request.--**Default assumption: Claude is already very smart.** Only add context Claude doesn't already have. Challenge each piece of information: "Does Claude really need this explanation?" and "Does this paragraph justify its token cost?"--Prefer concise examples over verbose explanations.--### Set Appropriate Degrees of Freedom--Match the level of specificity to the task's fragility and variability:--**High freedom (text-based instructions)**: Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.--**Medium freedom (pseudocode or scripts with parameters)**: Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.--**Low freedom (specific scripts, few parameters)**: Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.--Think of Claude as exploring a path: a narrow bridge with cliffs needs specific guardrails (low freedom), while an open field allows many routes (high freedom).--### Anatomy of a Skill--Every skill consists of a required SKILL.md file and optional bundled resources:--```-skill-name/-├── SKILL.md (required)-│ ├── YAML frontmatter metadata (required)-│ │ ├── name: (required)-│ │ ├── description: (required)-│ │ └── compatibility: (optional, rarely needed)-│ └── Markdown instructions (required)-└── Bundled Resources (optional)- ├── scripts/ - Executable code (Python/Bash/etc.)- ├── references/ - Documentation intended to be loaded into context as needed- └── assets/ - Files used in output (templates, icons, fonts, etc.)-```--#### SKILL.md (required)--Every SKILL.md consists of:--- **Frontmatter** (YAML): Contains `name` and `description` fields (required), plus optional fields like `license`, `metadata`, and `compatibility`. Only `name` and `description` are read by Claude to determine when the skill triggers, so be clear and comprehensive about what the skill is and when it should be used. The `compatibility` field is for noting environment requirements (target product, system packages, etc.) but most skills don't need it.-- **Body** (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers (if at all).--#### Bundled Resources (optional)--##### Scripts (`scripts/`)--Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.--- **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed-- **Example**: `scripts/rotate_pdf.py` for PDF rotation tasks-- **Benefits**: Token efficient, deterministic, may be executed without loading into context-- **Note**: Scripts may still need to be read by Claude for patching or environment-specific adjustments--##### References (`references/`)--Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.--- **When to include**: For documentation that Claude should reference while working-- **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications-- **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides-- **Benefits**: Keeps SKILL.md lean, loaded only when Claude determines it's needed-- **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md-- **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.--##### Assets (`assets/`)--Files not intended to be loaded into context, but rather used within the output Claude produces.--- **When to include**: When the skill needs files that will be used in the final output-- **Examples**: `assets/logo.png` for brand assets, `assets/slides.pptx` for PowerPoint templates, `assets/frontend-template/` for HTML/React boilerplate, `assets/font.ttf` for typography-- **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified-- **Benefits**: Separates output resources from documentation, enables Claude to use files without loading them into context--#### What to Not Include in a Skill--A skill should only contain essential files that directly support its functionality. Do NOT create extraneous documentation or auxiliary files, including:--- README.md-- INSTALLATION_GUIDE.md-- QUICK_REFERENCE.md-- CHANGELOG.md-- etc.--The skill should only contain the information needed for an AI agent to do the job at hand. It should not contain auxiliary context about the process that went into creating it, setup and testing procedures, user-facing documentation, etc. Creating additional documentation files just adds clutter and confusion.--### Progressive Disclosure Design Principle--Skills use a three-level loading system to manage context efficiently:--1. **Metadata (name + description)** - Always in context (~100 words)-2. **SKILL.md body** - When skill triggers (<5k words)-3. **Bundled resources** - As needed by Claude (Unlimited because scripts can be executed without reading into context window)--#### Progressive Disclosure Patterns--Keep SKILL.md body to the essentials and under 500 lines to minimize context bloat. Split content into separate files when approaching this limit. When splitting out content into other files, it is very important to reference them from SKILL.md and describe clearly when to read them, to ensure the reader of the skill knows they exist and when to use them.--**Key principle:** When a skill supports multiple variations, frameworks, or options, keep only the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configuration) into separate reference files.--**Pattern 1: High-level guide with references**--```markdown-# PDF Processing--## Quick start--Extract text with pdfplumber:-[code example]--## Advanced features--- **Form filling**: See [FORMS.md](FORMS.md) for complete guide-- **API reference**: See [REFERENCE.md](REFERENCE.md) for all methods-- **Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns-```--Claude loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed.--**Pattern 2: Domain-specific organization**--For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:--```-bigquery-skill/-├── SKILL.md (overview and navigation)-└── reference/- ├── finance.md (revenue, billing metrics)- ├── sales.md (opportunities, pipeline)- ├── product.md (API usage, features)- └── marketing.md (campaigns, attribution)-```--When a user asks about sales metrics, Claude only reads sales.md.--**Pattern 3: Conditional details**--Show basic content, link to advanced content:--```markdown-# DOCX Processing--## Creating documents--Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).--## Editing documents--For simple edits, modify the XML directly.--**For tracked changes**: See [REDLINING.md](REDLINING.md)-**For OOXML details**: See [OOXML.md](OOXML.md)-```--Claude reads REDLINING.md or OOXML.md only when the user needs those features.--**Important guidelines:**--- **Avoid deeply nested references** - Keep references one level deep from SKILL.md. All reference files should link directly from SKILL.md.-- **Structure longer reference files** - For files longer than 100 lines, include a table of contents at the top so Claude can see the full scope when previewing.--## Skill Creation Process--Skill creation involves these steps:--1. Understand the skill with concrete examples-2. Plan reusable skill contents (scripts, references, assets)-3. Initialize the skill (run init_skill.py)-4. Edit the skill (implement resources and write SKILL.md)-5. Package the skill (run package_skill.py)-6. Iterate based on real usage--Follow these steps in order, skipping only if there is a clear reason why they are not applicable.--### Step 1: Understanding the Skill with Concrete Examples--Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.--To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.--For example, when building an image-editor skill, relevant questions include:--- "What functionality should the image-editor skill support? Editing, rotating, anything else?"-- "Can you give some examples of how this skill would be used?"-- "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"-- "What would a user say that should trigger this skill?"--To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.--Conclude this step when there is a clear sense of the functionality the skill should support.--### Step 2: Planning the Reusable Skill Contents--To turn concrete examples into an effective skill, analyze each example by:--1. Considering how to execute on the example from scratch-2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly--Example: When building a `pdf-editor` skill to handle queries like "Help me rotate this PDF," the analysis shows:--1. Rotating a PDF requires re-writing the same code each time-2. A `scripts/rotate_pdf.py` script would be helpful to store in the skill--Example: When designing a `frontend-webapp-builder` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:--1. Writing a frontend webapp requires the same boilerplate HTML/React each time-2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill--Example: When building a `big-query` skill to handle queries like "How many users have logged in today?" the analysis shows:--1. Querying BigQuery requires re-discovering the table schemas and relationships each time-2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill--To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.--### Step 3: Initializing the Skill--At this point, it is time to actually create the skill.--Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step.--When creating a new skill from scratch, always run the `init_skill.py` script. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable.--Usage:--```bash-python3 plugins/dev-tools/skills/skill-creator/scripts/init_skill.py <skill-name> --path plugins/<category>/skills/-```--The script:--- Creates the skill directory at the specified path-- Generates a SKILL.md template with proper frontmatter and TODO placeholders-- Creates example resource directories: `scripts/`, `references/`, and `assets/`-- Adds example files in each directory that can be customized or deleted--After initialization, customize or remove the generated SKILL.md and example files as needed.--### Step 4: Edit the Skill--When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Include information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.--#### Skills Must Be Self-Contained--Other users who install your skill will NOT have your `~/.claude/rules/`, your `CLAUDE.md`, your MCP servers, or your Vault. Everything the skill needs must be inside the skill itself:--| Don't rely on... | Instead... |-|-------------------|-----------|-| Your `~/.claude/rules/*.md` | Put the guidance in SKILL.md or `references/` |-| Your project/global CLAUDE.md | Include relevant context directly in the skill |-| Specific MCP servers (Brain, Vault, etc.) | Make MCP usage optional, or document what's needed |-| Your `settings.local.json` permissions | Document what permissions the skill needs so users can add them |-| Environment-specific paths or tools | Use detection logic or document prerequisites |--**Test**: Could someone with a fresh Claude Code install use this skill? If it would break without your personal config, it's not self-contained.--#### Learn Proven Design Patterns--Consult these helpful guides based on your skill's needs:--- **Multi-step processes**: See references/workflows.md for sequential workflows and conditional logic-- **Specific output formats or quality standards**: See references/output-patterns.md for template and example patterns--These files contain established best practices for effective skill design.--#### Prefer Scripts Over Bash Chains--If a skill step involves collecting data from multiple sources, scanning files, or bulk operations, instruct Claude to **write and run a script** rather than listing individual bash commands. Each bash command requires a separate user approval — a step that runs 10 commands creates 10 approval prompts.--| Instead of... | Instruct... |-|---------------|-------------|-| "Run `git log`, then `grep`, then `jq`..." | "Write a Python script that collects git history, extracts patterns, and outputs a summary. Run it from /tmp." |-| "For each file, run `cat` and check..." | "Write a script that scans all matching files and returns a structured report." |-| "Run these 5 curl commands..." | "Write a script that makes the API calls and aggregates results." |--**Rule of thumb**: If a step needs 3+ bash commands for one logical operation, it should be a script. One Write + one Bash run = 2 approvals instead of many.--**Where to save**: Write scripts to `.claude/scripts/` in the project — not `/tmp`. Project scripts are part of the project's evolution and available to future sessions. Only use `/tmp` for truly disposable one-shot operations.--#### Start with Reusable Skill Contents--To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`.--Added scripts must be tested by actually running them to ensure there are no bugs and that the output matches what is expected. If there are many similar scripts, only a representative sample needs to be tested to ensure confidence that they all work while balancing time to completion.--Any example files and directories not needed for the skill should be deleted. The initialization script creates example files in `scripts/`, `references/`, and `assets/` to demonstrate structure, but most skills won't need all of them.--#### Update SKILL.md--**Writing Guidelines:** Always use imperative/infinitive form.--##### Frontmatter--Write the YAML frontmatter with `name` and `description`:--- `name`: The skill name-- `description`: This is the primary triggering mechanism for your skill, and helps Claude understand when to use the skill.- - Include both what the Skill does and specific triggers/contexts for when to use it.- - Include all "when to use" information here - Not in the body. The body is only loaded after triggering, so "When to Use This Skill" sections in the body are not helpful to Claude.- - Example description for a `docx` skill: "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. Use when Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"--Do not include any other fields in YAML frontmatter.--##### Body--Write instructions for using the skill and its bundled resources.--### Step 5: Packaging a Skill--Once development of the skill is complete, it can be packaged for distribution:--**For claude.ai (web interface):**--```bash-python3 plugins/dev-tools/skills/skill-creator/scripts/package_skill.py <path/to/skill-folder>-```--This creates a `.skill` file (zip format) for uploading to claude.ai.--**For Claude Code (CLI):**--Skills work as directories — no packaging needed. Install directly:--```bash-# Install from this repo-/plugin install ./skills/<skill-name>--# Or add a repo as a marketplace-/plugin marketplace add owner/repo-name-/plugin install <bundle-name>-```--The packaging script will:--1. **Validate** the skill automatically, checking:- - YAML frontmatter format and required fields- - Skill naming conventions and directory structure- - Description completeness and quality- - File organization and resource references--2. **Package** the skill if validation passes, creating a .skill file named after the skill (e.g., `my-skill.skill`) that includes all files and maintains the proper directory structure for distribution.--If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again.--**Bulk packaging:**--```bash-# Package all Claude AI-compatible skills-python3 plugins/dev-tools/skills/skill-creator/scripts/package_all.py --claude-ai-only--# Package all skills-python3 plugins/dev-tools/skills/skill-creator/scripts/package_all.py--# List skills and compatibility-python3 plugins/dev-tools/skills/skill-creator/scripts/package_all.py --list-```--### Dual-Environment Skills--Skills can work in both Claude AI (web) and Claude Code (CLI). When building for both environments, be aware of these differences:--| Capability | Claude AI | Claude Code |-|-----------|-----------|-------------|-| File output | `/mnt/user-data/outputs/` | Local filesystem |-| User interaction | `ask_user_input` tool | Terminal prompts |-| Web search | Built-in `web_search` tool | WebSearch tool |-| Shell commands | Not available | Bash tool |-| Subagents | Not available | Task tool (Explore, Plan, etc.) |-| MCP tools | Same names if connected | Same names if connected |-| Artifacts | HTML, React render inline | Not available |--**Marking compatibility:** Add `compatibility: claude-code-only` to the frontmatter of skills that require local filesystem, bash, or CLI tools. Skills without this field are assumed to work in both environments.--```yaml-----name: my-cli-skill-description: "..."-compatibility: claude-code-only-----```--**Writing dual-environment skills:** If a skill should adapt its behaviour based on environment, add an "Environment Notes" section:--```markdown-## Environment Notes--- **Claude AI:** Save output files to `/mnt/user-data/outputs/`. Use `present_files` to share.-- **Claude Code:** Save output files to the project directory or path specified by the user.-```--**Trigger phrases in descriptions:** The `description` field is the primary trigger mechanism. Claude uses it to decide whether to activate the skill. Include specific phrases users might say, not just what the skill does. Example: "Use when the user says 'make a favicon', 'generate icons', 'create favicon package', or mentions missing favicons."--### Step 6: Iterate--After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.--**Iteration workflow:**--1. Use the skill on real tasks-2. Notice struggles or inefficiencies-3. Identify how SKILL.md or bundled resources should be updated-4. Implement changes and test againdiff --git a/plugins/dev-tools/skills/skill-creator/references/output-patterns.md b/plugins/dev-tools/skills/skill-creator/references/output-patterns.mddeleted file mode 100644index 7909f58c..00000000--- a/plugins/dev-tools/skills/skill-creator/references/output-patterns.md+++ /dev/null@@ -1,78 +0,0 @@-# Output Patterns--Use these patterns when skills need to produce consistent, high-quality output.--## Template Pattern--Provide templates for output format. Match the level of strictness to your needs.--**For strict requirements (like API responses or data formats):**--```markdown-## Report structure--ALWAYS use this exact template structure:--# [Analysis Title]--## Executive summary-[One-paragraph overview of key findings]--## Key findings-- Finding 1 with supporting data-- Finding 2 with supporting data-- Finding 3 with supporting data--## Recommendations-1. Specific actionable recommendation-2. Specific actionable recommendation-```--**For flexible guidance (when adaptation is useful):**--```markdown-## Report structure--Here is a sensible default format, but use your best judgment:--# [Analysis Title]--## Executive summary-[Overview]--## Key findings-[Adapt sections based on what you discover]--## Recommendations-[Tailor to the specific context]--Adjust sections as needed for the specific analysis type.-```--## Examples Pattern--For skills where output quality depends on seeing examples, provide input/output pairs:--```markdown-## Commit message format--Generate commit messages following these examples:--**Example 1:**-Input: Added user authentication with JWT tokens-Output:-feat(auth): implement JWT-based authentication--Add login endpoint and token validation middleware--**Example 2:**-Input: Fixed bug where dates displayed incorrectly in reports-Output:-fix(reports): correct date formatting in timezone conversion--Use UTC timestamps consistently across report generation--Follow this style: type(scope): brief description, then detailed explanation.-```--Examples help Claude understand the desired style and level of detail more clearly than descriptions alone.diff --git a/plugins/dev-tools/skills/skill-creator/references/workflows.md b/plugins/dev-tools/skills/skill-creator/references/workflows.mddeleted file mode 100644index 90655326..00000000--- a/plugins/dev-tools/skills/skill-creator/references/workflows.md+++ /dev/null@@ -1,28 +0,0 @@-# Workflow Patterns--## Sequential Workflows--For complex tasks, break operations into clear, sequential steps. It is often helpful to give Claude an overview of the process towards the beginning of SKILL.md:--```markdown-Filling a PDF form involves these steps:--1. Analyze the form (run analyze_form.py)-2. Create field mapping (edit fields.json)-3. Validate mapping (run validate_fields.py)-4. Fill the form (run fill_form.py)-5. Verify output (run verify_output.py)-```--## Conditional Workflows--For tasks with branching logic, guide Claude through decision points:--```markdown-1. Determine the modification type:- **Creating new content?** -> Follow "Creation workflow" below- **Editing existing content?** -> Follow "Editing workflow" below--2. Creation workflow: [steps]-3. Editing workflow: [steps]-```diff --git a/plugins/dev-tools/skills/skill-creator/scripts/init_skill.py b/plugins/dev-tools/skills/skill-creator/scripts/init_skill.pydeleted file mode 100755index 598c4586..00000000--- a/plugins/dev-tools/skills/skill-creator/scripts/init_skill.py+++ /dev/null@@ -1,226 +0,0 @@-#!/usr/bin/env python3-"""-Skill Initializer - Creates a new skill from template--Usage:- init_skill.py <skill-name> --path <path>--Examples:- init_skill.py my-new-skill --path skills/- init_skill.py my-api-helper --path skills/- init_skill.py custom-skill --path /custom/location-"""--import sys-from pathlib import Path---SKILL_TEMPLATE = """----name: {skill_name}-description: [TODO: Complete and informative explanation of what the skill does and when to use it. Include WHEN to use this skill - specific scenarios, file types, or tasks that trigger it.]------# {skill_title}--## Overview--[TODO: 1-2 sentences explaining what this skill enables]--## Structuring This Skill--[TODO: Choose the structure that best fits this skill's purpose. Common patterns:--**1. Workflow-Based** (best for sequential processes)-- Works well when there are clear step-by-step procedures-- Example: DOCX skill with "Workflow Decision Tree" -> "Reading" -> "Creating" -> "Editing"-- Structure: ## Overview -> ## Workflow Decision Tree -> ## Step 1 -> ## Step 2...--**2. Task-Based** (best for tool collections)-- Works well when the skill offers different operations/capabilities-- Example: PDF skill with "Quick Start" -> "Merge PDFs" -> "Split PDFs" -> "Extract Text"-- Structure: ## Overview -> ## Quick Start -> ## Task Category 1 -> ## Task Category 2...--**3. Reference/Guidelines** (best for standards or specifications)-- Works well for brand guidelines, coding standards, or requirements-- Example: Brand styling with "Brand Guidelines" -> "Colors" -> "Typography" -> "Features"-- Structure: ## Overview -> ## Guidelines -> ## Specifications -> ## Usage...--**4. Capabilities-Based** (best for integrated systems)-- Works well when the skill provides multiple interrelated features-- Example: Product Management with "Core Capabilities" -> numbered capability list-- Structure: ## Overview -> ## Core Capabilities -> ### 1. Feature -> ### 2. Feature...--Patterns can be mixed and matched as needed. Most skills combine patterns (e.g., start with task-based, add workflow for complex operations).--Delete this entire "Structuring This Skill" section when done - it's just guidance.]--## [TODO: Replace with the first main section based on chosen structure]--[TODO: Add content here. See examples in existing skills:-- Code samples for technical skills-- Decision trees for complex workflows-- Concrete examples with realistic user requests-- References to scripts/templates/references as needed]--## Resources--This skill includes example resource directories that demonstrate how to organise different types of bundled resources:--### scripts/-Executable code (Python/Bash/etc.) that can be run directly to perform specific operations.--### references/-Documentation and reference material intended to be loaded into context to inform Claude's process and thinking.--### assets/-Files not intended to be loaded into context, but rather used within the output Claude produces.-------**Any unneeded directories can be deleted.** Not every skill requires all three types of resources.-"""--EXAMPLE_SCRIPT = '''#!/usr/bin/env python3-"""-Example helper script for {skill_name}--This is a placeholder script that can be executed directly.-Replace with actual implementation or delete if not needed.-"""--def main():- print("This is an example script for {skill_name}")- # TODO: Add actual script logic here--if __name__ == "__main__":- main()-'''--EXAMPLE_REFERENCE = """# Reference Documentation for {skill_title}--This is a placeholder for detailed reference documentation.-Replace with actual reference content or delete if not needed.--Reference docs are ideal for:-- Comprehensive API documentation-- Detailed workflow guides-- Complex multi-step processes-- Information too lengthy for main SKILL.md-- Content that's only needed for specific use cases-"""--EXAMPLE_ASSET = """# Example Asset File--This placeholder represents where asset files would be stored.-Replace with actual asset files (templates, images, fonts, etc.) or delete if not needed.--Asset files are NOT intended to be loaded into context, but rather used within-the output Claude produces (templates, boilerplate code, images, icons, fonts, etc.).-"""---def title_case_skill_name(skill_name):- """Convert hyphenated skill name to Title Case for display."""- return ' '.join(word.capitalize() for word in skill_name.split('-'))---def init_skill(skill_name, path):- """- Initialize a new skill directory with template SKILL.md.-- Args:- skill_name: Name of the skill- path: Path where the skill directory should be created-- Returns:- Path to created skill directory, or None if error- """- skill_dir = Path(path).resolve() / skill_name-- if skill_dir.exists():- print(f"Error: Skill directory already exists: {skill_dir}")- return None-- try:- skill_dir.mkdir(parents=True, exist_ok=False)- print(f"Created skill directory: {skill_dir}")- except Exception as e:- print(f"Error creating directory: {e}")- return None-- skill_title = title_case_skill_name(skill_name)- skill_content = SKILL_TEMPLATE.format(- skill_name=skill_name,- skill_title=skill_title- )-- skill_md_path = skill_dir / 'SKILL.md'- try:- skill_md_path.write_text(skill_content)- print("Created SKILL.md")- except Exception as e:- print(f"Error creating SKILL.md: {e}")- return None-- try:- scripts_dir = skill_dir / 'scripts'- scripts_dir.mkdir(exist_ok=True)- example_script = scripts_dir / 'example.py'- example_script.write_text(EXAMPLE_SCRIPT.format(skill_name=skill_name))- example_script.chmod(0o755)- print("Created scripts/example.py")-- references_dir = skill_dir / 'references'- references_dir.mkdir(exist_ok=True)- example_reference = references_dir / 'api_reference.md'- example_reference.write_text(EXAMPLE_REFERENCE.format(skill_title=skill_title))- print("Created references/api_reference.md")-- assets_dir = skill_dir / 'assets'- assets_dir.mkdir(exist_ok=True)- example_asset = assets_dir / 'example_asset.txt'- example_asset.write_text(EXAMPLE_ASSET)- print("Created assets/example_asset.txt")- except Exception as e:- print(f"Error creating resource directories: {e}")- return None-- print(f"\nSkill '{skill_name}' initialised successfully at {skill_dir}")- print("\nNext steps:")- print("1. Edit SKILL.md to complete the TODO items and update the description")- print("2. Customise or delete the example files in scripts/, references/, and assets/")- print("3. Run the validator when ready to check the skill structure")-- return skill_dir---def main():- if len(sys.argv) < 4 or sys.argv[2] != '--path':- print("Usage: init_skill.py <skill-name> --path <path>")- print("\nSkill name requirements:")- print(" - Kebab-case identifier (e.g., 'my-data-analyzer')")- print(" - Lowercase letters, digits, and hyphens only")- print(" - Max 64 characters")- print(" - Must match directory name exactly")- print("\nExamples:")- print(" init_skill.py my-new-skill --path skills/")- print(" init_skill.py my-api-helper --path skills/")- sys.exit(1)-- skill_name = sys.argv[1]- path = sys.argv[3]-- print(f"Initialising skill: {skill_name}")- print(f" Location: {path}")- print()-- result = init_skill(skill_name, path)-- if result:- sys.exit(0)- else:- sys.exit(1)---if __name__ == "__main__":- main()diff --git a/plugins/dev-tools/skills/skill-creator/scripts/package_all.py b/plugins/dev-tools/skills/skill-creator/scripts/package_all.pydeleted file mode 100644index b79eb854..00000000--- a/plugins/dev-tools/skills/skill-creator/scripts/package_all.py+++ /dev/null@@ -1,150 +0,0 @@-#!/usr/bin/env python3-"""-Bulk Skill Packager - Creates .skill files for all skills in the repository.--Usage:- python package_all.py [options]--Options:- --skills NAMES Comma-separated list of skill names to package- --claude-ai-only Only package skills compatible with Claude AI- --output-dir DIR Output directory (default: dist/)- --list List skills and their compatibility, don't package--Example:- python package_all.py- python package_all.py --claude-ai-only- python package_all.py --skills color-palette,google-apps-script- python package_all.py --list-"""--import sys-import re-import argparse-from pathlib import Path--# Add scripts dir to path for imports-sys.path.insert(0, str(Path(__file__).parent))-from package_skill import package_skill---def parse_frontmatter(skill_path):- """Parse frontmatter from a skill's SKILL.md."""- skill_md = skill_path / "SKILL.md"- if not skill_md.exists():- return None-- content = skill_md.read_text()- match = re.match(r'^---\n(.*?)\n---', content, re.DOTALL)- if not match:- return None-- frontmatter = {}- for line in match.group(1).strip().split('\n'):- if ':' in line:- key, _, value = line.partition(':')- frontmatter[key.strip()] = value.strip().strip('"').strip("'")- return frontmatter---def is_claude_ai_compatible(frontmatter):- """Check if a skill is compatible with Claude AI."""- if not frontmatter:- return True # default: compatible- compatibility = frontmatter.get('compatibility', '')- return 'claude-code-only' not in compatibility.lower()---def find_skills(skills_dir):- """Find all skill directories."""- skills = []- for path in sorted(skills_dir.iterdir()):- if path.is_dir() and (path / "SKILL.md").exists():- skills.append(path)- return skills---def main():- parser = argparse.ArgumentParser(description="Package skills as .skill files")- parser.add_argument('--skills', help='Comma-separated skill names')- parser.add_argument('--claude-ai-only', action='store_true',- help='Only package Claude AI-compatible skills')- parser.add_argument('--output-dir', default='dist',- help='Output directory (default: dist/)')- parser.add_argument('--list', action='store_true',- help='List skills and compatibility, don\'t package')- args = parser.parse_args()-- # Find skills directory (relative to repo root)- script_dir = Path(__file__).parent- repo_root = script_dir.parent.parent.parent # scripts/ -> skill-creator/ -> skills/ -> repo- skills_dir = repo_root / "skills"-- if not skills_dir.exists():- print(f"Error: Skills directory not found at {skills_dir}")- sys.exit(1)-- all_skills = find_skills(skills_dir)-- if not all_skills:- print("No skills found.")- sys.exit(1)-- # Filter by name if specified- if args.skills:- requested = set(args.skills.split(','))- all_skills = [s for s in all_skills if s.name in requested]- missing = requested - {s.name for s in all_skills}- if missing:- print(f"Warning: Skills not found: {', '.join(sorted(missing))}")-- # List mode- if args.list:- print(f"{'Skill':<30} {'Claude AI':<12} {'Claude Code':<12}")- print("-" * 54)- for skill_path in all_skills:- fm = parse_frontmatter(skill_path)- ai_ok = is_claude_ai_compatible(fm)- print(f"{skill_path.name:<30} {'Yes' if ai_ok else 'No':<12} {'Yes':<12}")- total_ai = sum(1 for s in all_skills if is_claude_ai_compatible(parse_frontmatter(s)))- print(f"\n{len(all_skills)} skills total, {total_ai} Claude AI compatible")- sys.exit(0)-- # Filter by compatibility- if args.claude_ai_only:- all_skills = [s for s in all_skills- if is_claude_ai_compatible(parse_frontmatter(s))]-- if not all_skills:- print("No skills match the filter criteria.")- sys.exit(1)-- # Package- output_dir = Path(args.output_dir).resolve()- output_dir.mkdir(parents=True, exist_ok=True)-- print(f"Packaging {len(all_skills)} skills to {output_dir}/\n")-- success = 0- failed = 0-- for skill_path in all_skills:- print(f"--- {skill_path.name} ---")- result = package_skill(str(skill_path), str(output_dir))- if result:- success += 1- else:- failed += 1- print()-- print("=" * 40)- print(f"Packaged: {success}")- if failed:- print(f"Failed: {failed}")- print(f"Output: {output_dir}/")-- sys.exit(1 if failed else 0)---if __name__ == "__main__":- main()diff --git a/plugins/dev-tools/skills/skill-creator/scripts/package_skill.py b/plugins/dev-tools/skills/skill-creator/scripts/package_skill.pydeleted file mode 100755index a5e7566c..00000000--- a/plugins/dev-tools/skills/skill-creator/scripts/package_skill.py+++ /dev/null@@ -1,106 +0,0 @@-#!/usr/bin/env python3-"""-Skill Packager - Creates a distributable .skill file of a skill folder--Usage:- python package_skill.py <path/to/skill-folder> [output-directory]--Example:- python package_skill.py skills/my-skill- python package_skill.py skills/my-skill ./dist-"""--import sys-import zipfile-from pathlib import Path--# Add scripts dir to path for quick_validate import-sys.path.insert(0, str(Path(__file__).parent))-from quick_validate import validate_skill---def package_skill(skill_path, output_dir=None):- """- Package a skill folder into a .skill file.-- Args:- skill_path: Path to the skill folder- output_dir: Optional output directory for the .skill file (defaults to current directory)-- Returns:- Path to the created .skill file, or None if error- """- skill_path = Path(skill_path).resolve()-- if not skill_path.exists():- print(f"Error: Skill folder not found: {skill_path}")- return None-- if not skill_path.is_dir():- print(f"Error: Path is not a directory: {skill_path}")- return None-- skill_md = skill_path / "SKILL.md"- if not skill_md.exists():- print(f"Error: SKILL.md not found in {skill_path}")- return None-- print("Validating skill...")- valid, message = validate_skill(skill_path)- if not valid:- print(f"Validation failed: {message}")- print(" Please fix the validation errors before packaging.")- return None- print(f"Validation passed: {message}\n")-- skill_name = skill_path.name- if output_dir:- output_path = Path(output_dir).resolve()- output_path.mkdir(parents=True, exist_ok=True)- else:- output_path = Path.cwd()-- skill_filename = output_path / f"{skill_name}.skill"-- try:- with zipfile.ZipFile(skill_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:- for file_path in skill_path.rglob('*'):- if file_path.is_file():- arcname = file_path.relative_to(skill_path.parent)- zipf.write(file_path, arcname)- print(f" Added: {arcname}")-- print(f"\nPackaged skill to: {skill_filename}")- return skill_filename-- except Exception as e:- print(f"Error creating .skill file: {e}")- return None---def main():- if len(sys.argv) < 2:- print("Usage: python package_skill.py <path/to/skill-folder> [output-directory]")- print("\nExample:")- print(" python package_skill.py skills/my-skill")- print(" python package_skill.py skills/my-skill ./dist")- sys.exit(1)-- skill_path = sys.argv[1]- output_dir = sys.argv[2] if len(sys.argv) > 2 else None-- print(f"Packaging skill: {skill_path}")- if output_dir:- print(f" Output directory: {output_dir}")- print()-- result = package_skill(skill_path, output_dir)-- if result:- sys.exit(0)- else:- sys.exit(1)---if __name__ == "__main__":- main()diff --git a/plugins/dev-tools/skills/skill-creator/scripts/quick_validate.py b/plugins/dev-tools/skills/skill-creator/scripts/quick_validate.pydeleted file mode 100755index 873a27ca..00000000--- a/plugins/dev-tools/skills/skill-creator/scripts/quick_validate.py+++ /dev/null@@ -1,112 +0,0 @@-#!/usr/bin/env python3-"""-Quick validation script for skills - minimal version-"""--import sys-import re-from pathlib import Path--try:- import yaml-except ImportError:- yaml = None---def parse_frontmatter(content):- """Parse YAML frontmatter without requiring PyYAML."""- if not content.startswith('---'):- return None, "No YAML frontmatter found"-- match = re.match(r'^---\n(.*?)\n---', content, re.DOTALL)- if not match:- return None, "Invalid frontmatter format"-- frontmatter_text = match.group(1)-- if yaml:- try:- frontmatter = yaml.safe_load(frontmatter_text)- if not isinstance(frontmatter, dict):- return None, "Frontmatter must be a YAML dictionary"- return frontmatter, None- except yaml.YAMLError as e:- return None, f"Invalid YAML in frontmatter: {e}"-- # Fallback: simple key-value parsing without PyYAML- frontmatter = {}- for line in frontmatter_text.strip().split('\n'):- if ':' in line:- key, _, value = line.partition(':')- frontmatter[key.strip()] = value.strip()- return frontmatter, None---def validate_skill(skill_path):- """Basic validation of a skill."""- skill_path = Path(skill_path)-- skill_md = skill_path / 'SKILL.md'- if not skill_md.exists():- return False, "SKILL.md not found"-- content = skill_md.read_text()-- frontmatter, error = parse_frontmatter(content)- if error:- return False, error-- ALLOWED_PROPERTIES = {'name', 'description', 'license', 'allowed-tools', 'metadata', 'compatibility'}-- unexpected_keys = set(frontmatter.keys()) - ALLOWED_PROPERTIES- if unexpected_keys:- return False, (- f"Unexpected key(s) in SKILL.md frontmatter: {', '.join(sorted(unexpected_keys))}. "- f"Allowed properties are: {', '.join(sorted(ALLOWED_PROPERTIES))}"- )-- if 'name' not in frontmatter:- return False, "Missing 'name' in frontmatter"- if 'description' not in frontmatter:- return False, "Missing 'description' in frontmatter"-- name = frontmatter.get('name', '')- if not isinstance(name, str):- return False, f"Name must be a string, got {type(name).__name__}"- name = name.strip()- if name:- if not re.match(r'^[a-z0-9-]+$', name):- return False, f"Name '{name}' should be kebab-case (lowercase letters, digits, and hyphens only)"- if name.startswith('-') or name.endswith('-') or '--' in name:- return False, f"Name '{name}' cannot start/end with hyphen or contain consecutive hyphens"- if len(name) > 64:- return False, f"Name is too long ({len(name)} characters). Maximum is 64 characters."-- description = frontmatter.get('description', '')- if not isinstance(description, str):- return False, f"Description must be a string, got {type(description).__name__}"- description = description.strip()- if description:- if '<' in description or '>' in description:- return False, "Description cannot contain angle brackets (< or >)"- if len(description) > 1024:- return False, f"Description is too long ({len(description)} characters). Maximum is 1024 characters."-- compatibility = frontmatter.get('compatibility', '')- if compatibility:- if not isinstance(compatibility, str):- return False, f"Compatibility must be a string, got {type(compatibility).__name__}"- if len(compatibility) > 500:- return False, f"Compatibility is too long ({len(compatibility)} characters). Maximum is 500 characters."-- return True, "Skill is valid!"---if __name__ == "__main__":- if len(sys.argv) != 2:- print("Usage: python quick_validate.py <skill_directory>")- sys.exit(1)-- valid, message = validate_skill(sys.argv[1])- print(message)- sys.exit(0 if valid else 1)diff --git a/plugins/integrations/skills/elevenlabs-agents/SKILL.md b/plugins/integrations/skills/elevenlabs-agents/SKILL.mdindex 38895358..76f5d463 100644--- a/plugins/integrations/skills/elevenlabs-agents/SKILL.md+++ b/plugins/integrations/skills/elevenlabs-agents/SKILL.md@@ -104,7 +104,9 @@ elevenlabs-cli simulate my-agent --scenario "Book appointment for tomorrow"elevenlabs-cli deploy my-agent```-Use `scripts/test-agent.sh` and `scripts/simulate-conversation.sh` for automated testing.+Before deploying, run a dry-run first: `elevenlabs-cli deploy my-agent --dry-run` to review changes.++For conversation simulation, create a JSON test scenario based on `assets/simulation-template.json`.---@@ -163,13 +165,6 @@ System prompt references them as `{{user_name}}`.- `assets/agent-config-schema.json` — Config schema reference- `assets/ci-cd-example.yml` — CI/CD pipeline template-## Scripts--- `scripts/create-agent.sh` — Create agent via API-- `scripts/deploy-agent.sh` — Deploy agent-- `scripts/test-agent.sh` — Run agent tests-- `scripts/simulate-conversation.sh` — Simulate conversations-## Reference Files- `references/api-reference.md` — Full API endpointsdiff --git a/plugins/integrations/skills/elevenlabs-agents/assets/simulation-template.json b/plugins/integrations/skills/elevenlabs-agents/assets/simulation-template.jsonnew file mode 100644index 00000000..5cf2b396--- /dev/null+++ b/plugins/integrations/skills/elevenlabs-agents/assets/simulation-template.json@@ -0,0 +1,10 @@+{+ "agent_id": "YOUR_AGENT_ID",+ "scenario": "Book an appointment for tomorrow at 2pm",+ "max_turns": 10,+ "expected_outcomes": [+ "Agent confirms the appointment time",+ "Agent asks for the customer's name",+ "Agent provides a confirmation number"+ ]+}diff --git a/plugins/integrations/skills/elevenlabs-agents/scripts/create-agent.sh b/plugins/integrations/skills/elevenlabs-agents/scripts/create-agent.shdeleted file mode 100755index bdf30ea5..00000000--- a/plugins/integrations/skills/elevenlabs-agents/scripts/create-agent.sh+++ /dev/null@@ -1,44 +0,0 @@-#!/bin/bash-# Create ElevenLabs agent using CLI--set -e--AGENT_NAME="${1:-Support Agent}"-TEMPLATE="${2:-customer-service}"-ENV="${3:-dev}"--echo "Creating ElevenLabs agent..."-echo "Name: $AGENT_NAME"-echo "Template: $TEMPLATE"-echo "Environment: $ENV"--# Check if CLI is installed-if ! command -v elevenlabs &> /dev/null; then- echo "Error: @elevenlabs/cli is not installed"- echo "Install with: npm install -g @elevenlabs/cli"- exit 1-fi--# Check if authenticated-if ! elevenlabs auth whoami &> /dev/null; then- echo "Not authenticated. Please login:"- elevenlabs auth login-fi--# Initialize project if not already initialized-if [ ! -f "agents.json" ]; then- echo "Initializing project..."- elevenlabs agents init-fi--# Create agent-echo "Creating agent: $AGENT_NAME"-elevenlabs agents add "$AGENT_NAME" --template "$TEMPLATE"--# Push to platform-echo "Deploying to environment: $ENV"-elevenlabs agents push --env "$ENV"--echo "✓ Agent created successfully!"-echo "Edit configuration in: agent_configs/"-echo "Test with: elevenlabs agents test \"$AGENT_NAME\""diff --git a/plugins/integrations/skills/elevenlabs-agents/scripts/deploy-agent.sh b/plugins/integrations/skills/elevenlabs-agents/scripts/deploy-agent.shdeleted file mode 100755index 64f5cd51..00000000--- a/plugins/integrations/skills/elevenlabs-agents/scripts/deploy-agent.sh+++ /dev/null@@ -1,46 +0,0 @@-#!/bin/bash-# Multi-environment deployment for ElevenLabs agents--set -e--ENV="${1:-dev}"-AGENT_NAME="${2}"--echo "Deploying ElevenLabs agent to environment: $ENV"--# Check if CLI is installed-if ! command -v elevenlabs &> /dev/null; then- echo "Error: @elevenlabs/cli is not installed"- echo "Install with: npm install -g @elevenlabs/cli"- exit 1-fi--# Check if authenticated-if ! elevenlabs auth whoami &> /dev/null; then- echo "Not authenticated. Please login:"- elevenlabs auth login-fi--# Dry run first to show changes-echo "Preview of changes for $ENV:"-if [ -n "$AGENT_NAME" ]; then- elevenlabs agents push --env "$ENV" --agent "$AGENT_NAME" --dry-run-else- elevenlabs agents push --env "$ENV" --dry-run-fi--# Confirm deployment-read -p "Deploy to $ENV? (y/n) " -n 1 -r-echo--if [[ $REPLY =~ ^[Yy]$ ]]; then- if [ -n "$AGENT_NAME" ]; then- elevenlabs agents push --env "$ENV" --agent "$AGENT_NAME"- else- elevenlabs agents push --env "$ENV"- fi- echo "✓ Deployment to $ENV completed successfully!"-else- echo "Deployment cancelled"- exit 0-fidiff --git a/plugins/integrations/skills/elevenlabs-agents/scripts/simulate-conversation.sh b/plugins/integrations/skills/elevenlabs-agents/scripts/simulate-conversation.shdeleted file mode 100755index 1fb5b706..00000000--- a/plugins/integrations/skills/elevenlabs-agents/scripts/simulate-conversation.sh+++ /dev/null@@ -1,53 +0,0 @@-#!/bin/bash-# Programmatically simulate conversation for testing--set -e--AGENT_ID="${1}"-SIMULATION_FILE="${2:-simulation.json}"--if [ -z "$AGENT_ID" ]; then- echo "Usage: ./simulate-conversation.sh <agent_id> [simulation_file]"- echo "Example: ./simulate-conversation.sh agent_abc123 simulation.json"- exit 1-fi--# Check if API key is set-if [ -z "$ELEVENLABS_API_KEY" ]; then- echo "Error: ELEVENLABS_API_KEY environment variable not set"- exit 1-fi--# Check if simulation file exists-if [ ! -f "$SIMULATION_FILE" ]; then- echo "Creating example simulation file: $SIMULATION_FILE"- cat > "$SIMULATION_FILE" << 'EOF'-{- "scenario": "Customer requests refund",- "user_messages": [- "I want a refund for order #12345",- "I ordered it last week",- "Yes, please process it"- ],- "success_criteria": [- "Agent acknowledges request",- "Agent asks for order details",- "Agent provides refund timeline"- ]-}-EOF- echo "Example simulation file created. Edit $SIMULATION_FILE and run again."- exit 0-fi--echo "Running conversation simulation..."-echo "Agent ID: $AGENT_ID"-echo "Simulation file: $SIMULATION_FILE"--# Run simulation-curl -X POST "https://api.elevenlabs.io/v1/convai/agents/$AGENT_ID/simulate" \- -H "xi-api-key: $ELEVENLABS_API_KEY" \- -H "Content-Type: application/json" \- -d @"$SIMULATION_FILE" | jq .--echo "✓ Simulation completed!"diff --git a/plugins/integrations/skills/elevenlabs-agents/scripts/test-agent.sh b/plugins/integrations/skills/elevenlabs-agents/scripts/test-agent.shdeleted file mode 100755index 91a8ce36..00000000--- a/plugins/integrations/skills/elevenlabs-agents/scripts/test-agent.sh+++ /dev/null@@ -1,33 +0,0 @@-#!/bin/bash-# Run automated tests on ElevenLabs agent--set -e--AGENT_NAME="${1:-Support Agent}"--echo "Testing ElevenLabs agent: $AGENT_NAME"--# Check if CLI is installed-if ! command -v elevenlabs &> /dev/null; then- echo "Error: @elevenlabs/cli is not installed"- echo "Install with: npm install -g @elevenlabs/cli"- exit 1-fi--# Check if authenticated-if ! elevenlabs auth whoami &> /dev/null; then- echo "Not authenticated. Please login:"- elevenlabs auth login-fi--# Push tests to platform-if [ -f "tests.json" ]; then- echo "Deploying tests..."- elevenlabs tests push-fi--# Run agent tests-echo "Running tests for: $AGENT_NAME"-elevenlabs agents test "$AGENT_NAME"--echo "✓ Tests completed!"diff --git a/plugins/integrations/skills/mcp-builder/SKILL.md b/plugins/integrations/skills/mcp-builder/SKILL.mdindex eb9b6cf2..0dd39b70 100644--- a/plugins/integrations/skills/mcp-builder/SKILL.md+++ b/plugins/integrations/skills/mcp-builder/SKILL.md@@ -87,9 +87,15 @@ python server.py --transport http --port 8000fastmcp dev server.py --with-editable .```+For comprehensive automated testing, generate a test script using the FastMCP Client.+See [references/testing-pattern.md](references/testing-pattern.md) for the async test pattern.+### Step 5: Deploy**FastMCP Cloud** (simplest):++Before deploying, work through the pre-deploy checklist in [references/deploy-checklist.md](references/deploy-checklist.md) to catch common issues (missing module-level server, hardcoded secrets, etc.).+```bashfastmcp deploy server.py --name my-server```@@ -171,3 +177,5 @@ async def get_data(id: str) -> str:- `references/production-patterns.md` — Auth, middleware, storage backends- `references/integration-patterns.md` — FastAPI mount, OpenAPI import- `references/context-features.md` — Lifespan, dependency injection+- `references/testing-pattern.md` — FastMCP Client async test pattern+- `references/deploy-checklist.md` — Pre-deploy validation checklistdiff --git a/plugins/integrations/skills/mcp-builder/references/deploy-checklist.md b/plugins/integrations/skills/mcp-builder/references/deploy-checklist.mdnew file mode 100644index 00000000..67299cd2--- /dev/null+++ b/plugins/integrations/skills/mcp-builder/references/deploy-checklist.md@@ -0,0 +1,73 @@+# FastMCP Cloud Pre-Deploy Checklist++Work through these checks before deploying to FastMCP Cloud. Fix errors before deploying;+warnings are advisory.++## Required Checks (errors)++### 1. Server file exists+Verify the main server file exists at the expected path.++### 2. Python syntax valid+```bash+python3 -m py_compile server.py+```++### 3. Module-level server object+The server instance must be at module level (not inside a function):++```python+# CORRECT — Cloud can find this+mcp = FastMCP("My Server")++# WRONG — Cloud can't discover the server+def create_server():+ mcp = FastMCP("My Server")+ return mcp+```++Check: `grep -q "^mcp = FastMCP\|^server = FastMCP\|^app = FastMCP" server.py`++### 4. requirements.txt exists+Must exist and contain only PyPI packages (no `git+`, `-e`, `.whl`, `.tar.gz`).++### 5. No hardcoded secrets+Check for `api_key = "..."` or `password = "..."` patterns (excluding `os.getenv`/`os.environ`):++```bash+grep -i 'api_key\s*=\s*["\x27]' server.py | grep -v 'os.getenv\|os.environ'+grep -i 'password\s*=\s*["\x27]\|secret\s*=\s*["\x27]' server.py | grep -v 'os.getenv\|os.environ'+```++Use `os.getenv()` for all secrets.++## Advisory Checks (warnings)++### 6. fastmcp in requirements.txt+Should be listed as a dependency.++### 7. .gitignore includes .env+Prevent accidental secret commits.++### 8. No circular imports+Check for `from __init__ import` or `from . import.*get_` patterns.++### 9. Git repository initialised+Should have a remote configured for Cloud deployment.++### 10. Server can load+```bash+timeout 5 python3 server.py --help+# or+timeout 5 fastmcp inspect server.py+```++## Deploy++Once all checks pass:++```bash+git add . && git commit -m "Ready for deployment"+git push -u origin main+# Then: visit https://fastmcp.cloud, connect repo, add env vars, deploy+```diff --git a/plugins/integrations/skills/mcp-builder/references/testing-pattern.md b/plugins/integrations/skills/mcp-builder/references/testing-pattern.mdnew file mode 100644index 00000000..6d36d626--- /dev/null+++ b/plugins/integrations/skills/mcp-builder/references/testing-pattern.md@@ -0,0 +1,89 @@+# FastMCP Server Testing Pattern++Reference pattern for testing a FastMCP server. Claude should generate a tailored+test script based on the server being tested.++## Async Test Client (Stdio)++```python+import asyncio+from fastmcp import Client++async def test_server(server_path):+ async with Client(server_path) as client:+ # List capabilities+ tools = await client.list_tools()+ print(f"Found {len(tools)} tools")+ for tool in tools:+ print(f" - {tool.name}: {tool.description[:60]}...")++ resources = await client.list_resources()+ print(f"Found {len(resources)} resources")+ for resource in resources:+ desc = resource.description[:60] if resource.description else "No description"+ print(f" - {resource.uri}: {desc}...")++ prompts = await client.list_prompts()+ print(f"Found {len(prompts)} prompts")++ # Call first tool with empty args (may fail if required params)+ if tools:+ try:+ result = await client.call_tool(tools[0].name, {})+ print(f"Tool '{tools[0].name}' returned: {str(result.data)[:100]}...")+ except Exception as e:+ print(f"Tool call failed (may need params): {e}")++ # Read first resource+ if resources:+ try:+ data = await client.read_resource(resources[0].uri)+ print(f"Resource read: {str(data)[:100]}...")+ except Exception as e:+ print(f"Resource read failed: {e}")++asyncio.run(test_server("server.py"))+```++## HTTP Transport Testing++For HTTP servers, start the server in the background first:++```python+async def test_http_server(port=8000):+ url = f"http://localhost:{port}/mcp"+ async with Client(url) as client:+ # Same test logic as stdio+ tools = await client.list_tools()+ ...+```++Start the server separately:+```bash+python server.py --transport http --port 8000 &+SERVER_PID=$!+sleep 2 # Wait for server startup++# Run tests+python test_script.py++# Cleanup+kill $SERVER_PID+```++## FastMCP Dev Mode++For development with auto-reload:++```bash+fastmcp dev server.py+fastmcp dev server.py --with-editable .+```++## MCP Inspector++Interactive testing via browser:++```bash+fastmcp dev server.py # Opens inspector at http://localhost:5173+```diff --git a/plugins/integrations/skills/mcp-builder/scripts/check-versions.sh b/plugins/integrations/skills/mcp-builder/scripts/check-versions.shdeleted file mode 100755index ac8f6ee2..00000000--- a/plugins/integrations/skills/mcp-builder/scripts/check-versions.sh+++ /dev/null@@ -1,102 +0,0 @@-#!/bin/bash-# FastMCP Version Checker-# Verifies that FastMCP and dependencies are up to date--set -e--echo "======================================"-echo "FastMCP Version Checker"-echo "======================================"-echo ""--# Colors-GREEN='\033[0;32m'-YELLOW='\033[1;33m'-RED='\033[0;31m'-NC='\033[0m' # No Color--# Check if Python is installed-if ! command -v python3 &> /dev/null; then- echo -e "${RED}✗${NC} Python 3 is not installed"- exit 1-fi--echo -e "${GREEN}✓${NC} Python $(python3 --version)"-echo ""--# Check Python version-PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')-REQUIRED_VERSION="3.10"--if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$PYTHON_VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then- echo -e "${RED}✗${NC} Python $PYTHON_VERSION is too old. FastMCP requires Python $REQUIRED_VERSION or later"- exit 1-fi--echo -e "${GREEN}✓${NC} Python version $PYTHON_VERSION meets requirements"-echo ""--# Check if pip is installed-if ! command -v pip3 &> /dev/null; then- echo -e "${RED}✗${NC} pip3 is not installed"- exit 1-fi--echo "Checking package versions..."-echo ""--# Function to check package version-check_package() {- local package=$1- local min_version=$2-- if pip3 show "$package" &> /dev/null; then- local installed_version=$(pip3 show "$package" | grep "Version:" | awk '{print $2}')- echo -e "${GREEN}✓${NC} $package: $installed_version (required: >=$min_version)"-- # Note: This is a simple check. For production, use more robust version comparison- if [ "$installed_version" != "$min_version" ]; then- if [ "$(printf '%s\n' "$min_version" "$installed_version" | sort -V | head -n1)" != "$min_version" ]; then- echo -e " ${YELLOW}⚠${NC} Installed version is older than minimum required"- fi- fi- else- echo -e "${RED}✗${NC} $package: Not installed (required: >=$min_version)"- fi-}--# Check core packages-check_package "fastmcp" "2.12.0"-check_package "httpx" "0.27.0"-check_package "python-dotenv" "1.0.0"-check_package "pydantic" "2.0.0"--echo ""-echo "Checking optional packages..."-echo ""--# Check optional packages-if pip3 show "psutil" &> /dev/null; then- check_package "psutil" "5.9.0"-else- echo -e "${YELLOW}○${NC} psutil: Not installed (optional, for health checks)"-fi--if pip3 show "pytest" &> /dev/null; then- check_package "pytest" "8.0.0"-else- echo -e "${YELLOW}○${NC} pytest: Not installed (optional, for testing)"-fi--echo ""-echo "======================================"-echo "Version check complete!"-echo "======================================"-echo ""--# Suggestions-echo "Suggestions:"-echo " - To update FastMCP: pip install --upgrade fastmcp"-echo " - To update all dependencies: pip install --upgrade -r requirements.txt"-echo " - To see outdated packages: pip list --outdated"-echo ""diff --git a/plugins/integrations/skills/mcp-builder/scripts/deploy-cloud.sh b/plugins/integrations/skills/mcp-builder/scripts/deploy-cloud.shdeleted file mode 100755index 98922f6d..00000000--- a/plugins/integrations/skills/mcp-builder/scripts/deploy-cloud.sh+++ /dev/null@@ -1,231 +0,0 @@-#!/bin/bash-# FastMCP Cloud Deployment Checker-# Validates server is ready for FastMCP Cloud deployment--set -e--# Colors-GREEN='\033[0;32m'-YELLOW='\033[1;33m'-RED='\033[0;31m'-BLUE='\033[0;34m'-NC='\033[0m' # No Color--echo "======================================"-echo "FastMCP Cloud Deployment Checker"-echo "======================================"-echo ""--# Check arguments-if [ $# -eq 0 ]; then- echo "Usage: $0 <server.py>"- echo ""- echo "Example:"- echo " $0 server.py"- exit 1-fi--SERVER_PATH=$1-ERRORS=0-WARNINGS=0--# Function to check requirement-check_required() {- local description=$1- local command=$2-- if eval "$command" &> /dev/null; then- echo -e "${GREEN}✓${NC} $description"- return 0- else- echo -e "${RED}✗${NC} $description"- ERRORS=$((ERRORS + 1))- return 1- fi-}--# Function to check warning-check_warning() {- local description=$1- local command=$2-- if eval "$command" &> /dev/null; then- echo -e "${GREEN}✓${NC} $description"- return 0- else- echo -e "${YELLOW}⚠${NC} $description"- WARNINGS=$((WARNINGS + 1))- return 1- fi-}--# 1. Check server file exists-echo "Checking server file..."-check_required "Server file exists: $SERVER_PATH" "test -f '$SERVER_PATH'"-echo ""--# 2. Check Python syntax-echo "Checking Python syntax..."-check_required "Python syntax is valid" "python3 -m py_compile '$SERVER_PATH'"-echo ""--# 3. Check for module-level server object-echo "Checking module-level server object..."-if grep -q "^mcp = FastMCP\|^server = FastMCP\|^app = FastMCP" "$SERVER_PATH"; then- echo -e "${GREEN}✓${NC} Found module-level server object (mcp/server/app)"-else- echo -e "${RED}✗${NC} No module-level server object found"- echo " Expected: mcp = FastMCP(...) at module level"- ERRORS=$((ERRORS + 1))-fi-echo ""--# 4. Check requirements.txt-echo "Checking requirements.txt..."-if [ -f "requirements.txt" ]; then- echo -e "${GREEN}✓${NC} requirements.txt exists"-- # Check for non-PyPI dependencies- if grep -q "^git+\|^-e \|\.whl$\|\.tar.gz$" requirements.txt; then- echo -e "${RED}✗${NC} requirements.txt contains non-PyPI dependencies"- echo " FastMCP Cloud requires PyPI packages only"- ERRORS=$((ERRORS + 1))- else- echo -e "${GREEN}✓${NC} All dependencies are PyPI packages"- fi-- # Check for fastmcp- if grep -q "^fastmcp" requirements.txt; then- echo -e "${GREEN}✓${NC} FastMCP is in requirements.txt"- else- echo -e "${YELLOW}⚠${NC} FastMCP not found in requirements.txt"- WARNINGS=$((WARNINGS + 1))- fi-else- echo -e "${RED}✗${NC} requirements.txt not found"- ERRORS=$((ERRORS + 1))-fi-echo ""--# 5. Check for hardcoded secrets-echo "Checking for hardcoded secrets..."-if grep -i "api_key\s*=\s*[\"']" "$SERVER_PATH" | grep -v "os.getenv\|os.environ" > /dev/null; then- echo -e "${RED}✗${NC} Found hardcoded API keys (possible security issue)"- ERRORS=$((ERRORS + 1))-else- echo -e "${GREEN}✓${NC} No hardcoded API keys found"-fi--if grep -i "password\s*=\s*[\"']\|secret\s*=\s*[\"']" "$SERVER_PATH" | grep -v "os.getenv\|os.environ" > /dev/null; then- echo -e "${YELLOW}⚠${NC} Found possible hardcoded passwords/secrets"- WARNINGS=$((WARNINGS + 1))-fi-echo ""--# 6. Check .gitignore-echo "Checking .gitignore..."-if [ -f ".gitignore" ]; then- echo -e "${GREEN}✓${NC} .gitignore exists"-- if grep -q "\.env$" .gitignore; then- echo -e "${GREEN}✓${NC} .env is in .gitignore"- else- echo -e "${YELLOW}⚠${NC} .env not in .gitignore"- WARNINGS=$((WARNINGS + 1))- fi-else- echo -e "${YELLOW}⚠${NC} .gitignore not found"- WARNINGS=$((WARNINGS + 1))-fi-echo ""--# 7. Check for circular imports-echo "Checking for potential circular imports..."-if grep -r "from __init__ import\|from . import.*get_" . --include="*.py" 2>/dev/null | grep -v ".git" > /dev/null; then- echo -e "${YELLOW}⚠${NC} Possible circular import pattern detected (factory functions)"- WARNINGS=$((WARNINGS + 1))-else- echo -e "${GREEN}✓${NC} No obvious circular import patterns"-fi-echo ""--# 8. Check git repository-echo "Checking git repository..."-if [ -d ".git" ]; then- echo -e "${GREEN}✓${NC} Git repository initialized"-- # Check if there are uncommitted changes- if [ -z "$(git status --porcelain)" ]; then- echo -e "${GREEN}✓${NC} No uncommitted changes"- else- echo -e "${YELLOW}⚠${NC} There are uncommitted changes"- WARNINGS=$((WARNINGS + 1))- fi-- # Check if remote is set- if git remote -v | grep -q "origin"; then- echo -e "${GREEN}✓${NC} Git remote (origin) configured"- REMOTE_URL=$(git remote get-url origin)- echo " Remote: $REMOTE_URL"- else- echo -e "${YELLOW}⚠${NC} No git remote configured"- echo " Run: gh repo create <name> --public"- WARNINGS=$((WARNINGS + 1))- fi-else- echo -e "${YELLOW}⚠${NC} Not a git repository"- echo " Run: git init"- WARNINGS=$((WARNINGS + 1))-fi-echo ""--# 9. Test server can run-echo "Testing server execution..."-if timeout 5 python3 "$SERVER_PATH" --help &> /dev/null || timeout 5 fastmcp inspect "$SERVER_PATH" &> /dev/null; then- echo -e "${GREEN}✓${NC} Server can be loaded"-else- echo -e "${YELLOW}⚠${NC} Could not verify server loads correctly"- WARNINGS=$((WARNINGS + 1))-fi-echo ""--# Summary-echo "======================================"-echo "Deployment Check Summary"-echo "======================================"-echo ""--if [ $ERRORS -eq 0 ] && [ $WARNINGS -eq 0 ]; then- echo -e "${GREEN}✓ Ready for deployment!${NC}"- echo ""- echo "Next steps:"- echo " 1. Commit changes: git add . && git commit -m 'Ready for deployment'"- echo " 2. Push to GitHub: git push -u origin main"- echo " 3. Visit https://fastmcp.cloud"- echo " 4. Connect your repository"- echo " 5. Add environment variables"- echo " 6. Deploy!"- exit 0-elif [ $ERRORS -eq 0 ]; then- echo -e "${YELLOW}⚠ Ready with warnings (${WARNINGS} warnings)${NC}"- echo ""- echo "Review warnings above before deploying."- echo ""- echo "To deploy anyway:"- echo " 1. git add . && git commit -m 'Ready for deployment'"- echo " 2. git push -u origin main"- echo " 3. Visit https://fastmcp.cloud"- exit 0-else- echo -e "${RED}✗ Not ready for deployment (${ERRORS} errors, ${WARNINGS} warnings)${NC}"- echo ""- echo "Fix the errors above before deploying."- echo ""- echo "Common fixes:"- echo " - Export server at module level: mcp = FastMCP('name')"- echo " - Use only PyPI packages in requirements.txt"- echo " - Use os.getenv() for secrets, not hardcoded values"- echo " - Initialize git: git init"- echo " - Create .gitignore with .env"- exit 1-fidiff --git a/plugins/integrations/skills/mcp-builder/scripts/test-server.sh b/plugins/integrations/skills/mcp-builder/scripts/test-server.shdeleted file mode 100755index c53f6ffe..00000000--- a/plugins/integrations/skills/mcp-builder/scripts/test-server.sh+++ /dev/null@@ -1,187 +0,0 @@-#!/bin/bash-# FastMCP Server Tester-# Tests a FastMCP server using the FastMCP Client--set -e--# Colors-GREEN='\033[0;32m'-YELLOW='\033[1;33m'-RED='\033[0;31m'-NC='\033[0m' # No Color--echo "======================================"-echo "FastMCP Server Tester"-echo "======================================"-echo ""--# Check arguments-if [ $# -eq 0 ]; then- echo "Usage: $0 <server.py> [--http] [--port 8000]"- echo ""- echo "Examples:"- echo " $0 server.py # Test stdio server"- echo " $0 server.py --http --port 8000 # Test HTTP server"- exit 1-fi--SERVER_PATH=$1-TRANSPORT="stdio"-PORT="8000"--# Parse arguments-shift-while [[ $# -gt 0 ]]; do- case $1 in- --http)- TRANSPORT="http"- shift- ;;- --port)- PORT="$2"- shift 2- ;;- *)- echo "Unknown option: $1"- exit 1- ;;- esac-done--# Check if server file exists-if [ ! -f "$SERVER_PATH" ]; then- echo -e "${RED}✗${NC} Server file not found: $SERVER_PATH"- exit 1-fi--echo -e "${GREEN}✓${NC} Found server: $SERVER_PATH"-echo -e "${GREEN}✓${NC} Transport: $TRANSPORT"-if [ "$TRANSPORT" = "http" ]; then- echo -e "${GREEN}✓${NC} Port: $PORT"-fi-echo ""--# Create test script-TEST_SCRIPT=$(mktemp)-cat > "$TEST_SCRIPT" << 'EOF'-import asyncio-import sys-from fastmcp import Client--async def test_server(server_path, transport, port):- """Test MCP server."""- print("Starting server test...\n")-- try:- if transport == "http":- server_url = f"http://localhost:{port}/mcp"- print(f"Connecting to HTTP server at {server_url}...")- client_context = Client(server_url)- else:- print(f"Connecting to stdio server: {server_path}...")- client_context = Client(server_path)-- async with client_context as client:- print("✓ Connected to server\n")-- # Test: List tools- print("Testing: List tools")- tools = await client.list_tools()- print(f"✓ Found {len(tools)} tools")- for tool in tools:- print(f" - {tool.name}: {tool.description[:60]}...")- print()-- # Test: List resources- print("Testing: List resources")- resources = await client.list_resources()- print(f"✓ Found {len(resources)} resources")- for resource in resources:- print(f" - {resource.uri}: {resource.description[:60] if resource.description else 'No description'}...")- print()-- # Test: List prompts- print("Testing: List prompts")- prompts = await client.list_prompts()- print(f"✓ Found {len(prompts)} prompts")- for prompt in prompts:- print(f" - {prompt.name}: {prompt.description[:60] if prompt.description else 'No description'}...")- print()-- # Test: Call first tool (if any)- if tools:- print(f"Testing: Call tool '{tools[0].name}'")- try:- # Try calling with empty args (may fail if required params)- result = await client.call_tool(tools[0].name, {})- print(f"✓ Tool executed successfully")- print(f" Result: {str(result.data)[:100]}...")- except Exception as e:- print(f"⚠ Tool call failed (may require parameters): {e}")- print()-- # Test: Read first resource (if any)- if resources:- print(f"Testing: Read resource '{resources[0].uri}'")- try:- data = await client.read_resource(resources[0].uri)- print(f"✓ Resource read successfully")- print(f" Data: {str(data)[:100]}...")- except Exception as e:- print(f"✗ Failed to read resource: {e}")- print()-- print("=" * 50)- print("✓ Server test completed successfully!")- print("=" * 50)- return 0-- except Exception as e:- print(f"\n✗ Server test failed: {e}")- import traceback- traceback.print_exc()- return 1--if __name__ == "__main__":- server_path = sys.argv[1]- transport = sys.argv[2] if len(sys.argv) > 2 else "stdio"- port = sys.argv[3] if len(sys.argv) > 3 else "8000"-- exit_code = asyncio.run(test_server(server_path, transport, port))- sys.exit(exit_code)-EOF--# Run test-echo "Running tests..."-echo ""--if [ "$TRANSPORT" = "http" ]; then- # For HTTP, start server in background- echo "Starting HTTP server in background..."- python3 "$SERVER_PATH" --transport http --port "$PORT" &- SERVER_PID=$!-- # Wait for server to start- sleep 2-- # Run test- python3 "$TEST_SCRIPT" "$SERVER_PATH" "$TRANSPORT" "$PORT"- TEST_EXIT=$?-- # Kill server- kill $SERVER_PID 2>/dev/null || true-- # Cleanup- rm "$TEST_SCRIPT"-- exit $TEST_EXIT-else- # For stdio, run test directly- python3 "$TEST_SCRIPT" "$SERVER_PATH" "$TRANSPORT"- TEST_EXIT=$?-- # Cleanup- rm "$TEST_SCRIPT"-- exit $TEST_EXIT-fi