$npx -y skills add multica-ai/multica --skill multica-skill-importingUse when a user provides a skill URL, slug, or clear intent to import/install a specific skill into the current Multica workspace. Teaches the workspace import API/CLI path (POST /api/skills/import), the supported URL source families, --on-conflict fail|overwrite|rename|skip beha
| 1 | # Importing skills into Multica |
| 2 | |
| 3 | Use this skill when the user already provided a skill URL, slug, or a clear intent |
| 4 | to import a specific skill into the current Multica workspace. |
| 5 | |
| 6 | Do not use this skill to decide which skill the user needs. If the user only |
| 7 | describes a capability and no URL is known, external search may produce candidate |
| 8 | URLs, but this import skill starts only once a URL or concrete import target is |
| 9 | known. |
| 10 | |
| 11 | Every claim below is traced to source in |
| 12 | `references/skill-importing-source-map.md`. When in doubt, read that file. |
| 13 | |
| 14 | ## The invariant |
| 15 | |
| 16 | A skill is installed for Multica only when it exists in the current workspace's |
| 17 | skill database. The single supported path that puts it there is the workspace |
| 18 | import endpoint. It accepts either a hosted URL or an uploaded local archive |
| 19 | (`.skill` / `.zip`), driven by this CLI: |
| 20 | |
| 21 | ```bash |
| 22 | multica skill import --url <url> --output json # hosted source |
| 23 | multica skill import --file <path-to.skill> --output json # local archive |
| 24 | ``` |
| 25 | |
| 26 | The CLI defaults to `--on-conflict fail`. A URL import sends: |
| 27 | |
| 28 | ```text |
| 29 | POST /api/skills/import |
| 30 | Content-Type: application/json |
| 31 | body: { "url": "<url>", "on_conflict": "fail" } |
| 32 | ``` |
| 33 | |
| 34 | A `--file` import hits the same route as `multipart/form-data` with a `file` |
| 35 | part (the `.skill` / `.zip` bytes) and an `on_conflict` field. `--url` and |
| 36 | `--file` are mutually exclusive; exactly one is required. |
| 37 | |
| 38 | Do not finish with `npx skills add`. That installs into an external/local skill |
| 39 | environment, not the Multica workspace DB, so Multica cannot manage or bind it. |
| 40 | |
| 41 | ## Supported URL source families |
| 42 | |
| 43 | `detectImportSource` accepts these hosts (and `www.` variants). Pass any of these |
| 44 | forms to `multica skill import --url <url> --output json`: |
| 45 | |
| 46 | ```bash |
| 47 | multica skill import --url clawhub.ai/owner/skill --output json |
| 48 | multica skill import --url skills.sh/owner/repo/skill --output json |
| 49 | multica skill import --url github.com/owner/repo --output json |
| 50 | multica skill import --url github.com/owner/repo/tree/main/path/to/skill --output json |
| 51 | multica skill import --url github.com/owner/repo/blob/main/path/to/SKILL.md --output json |
| 52 | ``` |
| 53 | |
| 54 | - `clawhub.ai`, `skills.sh`, `github.com` are the recognized hosts. |
| 55 | - A GitHub URL may be a bare `owner/repo`, a `/tree/{ref}/...` directory, or a |
| 56 | `/blob/{ref}/.../SKILL.md` file. |
| 57 | - A bare ClawHub slug (no host) is accepted and routed to ClawHub. |
| 58 | - Any other host is rejected with a 400 naming the supported sources. |
| 59 | |
| 60 | ## Local archive import (`.skill` / `.zip`) |
| 61 | |
| 62 | `multica skill import --file <path> --output json` imports a skill from a local |
| 63 | archive instead of a hosted URL. A `.skill` file is a standard zip — the format |
| 64 | Anthropic's skill-creator `package_skill` produces — and a plain `.zip` of a |
| 65 | skill folder works too. The server: |
| 66 | |
| 67 | - accepts the upload as `multipart/form-data` (a `file` part plus an optional |
| 68 | `on_conflict` field) on the same `POST /api/skills/import` route; |
| 69 | - decompresses it and roots on the shallowest `SKILL.md`, so both a root-level |
| 70 | `SKILL.md` and the nested `my-skill/SKILL.md` wrapper layout are accepted; |
| 71 | - takes the name/description from `SKILL.md` frontmatter, falling back to the |
| 72 | wrapper directory name and then the uploaded filename; |
| 73 | - carries the supporting files — dropping any `SKILL.md`, dotfiles, `__MACOSX`, |
| 74 | license files, and binary assets — under the same per-file (1 MiB), |
| 75 | per-bundle (8 MiB), and file-count (256) caps as URL imports, and rejects path |
| 76 | traversal (zip-slip); |
| 77 | - returns the same structured result envelope and honors the same |
| 78 | `--on-conflict` strategies as URL imports. |
| 79 | |
| 80 | The upload itself is capped at 16 MiB (compressed). Any source that is not a |
| 81 | local archive still goes through `--url`. |
| 82 | |
| 83 | ## Direct URL flow |
| 84 | |
| 85 | 1. When the request contains a concrete URL, the import endpoint can be called |
| 86 | directly; search is not required by the API: |
| 87 | |
| 88 | ```bash |
| 89 | multica skill import --url <url> --output json |
| 90 | ``` |
| 91 | |
| 92 | 2. Treat the response as the source of truth. Current CLI imports use the |
| 93 | structured import result envelope: |
| 94 | |
| 95 | ```json |
| 96 | { |
| 97 | "status": "created|updated|conflict|skipped|failed", |
| 98 | "reason": "...", |
| 99 | "skill": { "...": "SkillWithFilesResponse when created/updated" }, |
| 100 | "existing_skill": { "id": "...", "name": "...", "can_overwrite": true } |
| 101 | } |
| 102 | ``` |
| 103 | |
| 104 | For `created` / `updated`, `skill` is a workspace `SkillWithFilesResponse`: it |
| 105 | embeds the standard `SkillResponse` a |