Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["9820"],{12374(e,s,l){l.r(s),l.d(s,{metadata:()=>n,default:()=>o,frontMatter:()=>t,contentTitle:()=>c,toc:()=>d,assets:()=>a});var n=JSON.parse('{"id":"cli-commands/skills","title":"Skills (CLI, in-chat, dashboard, Telegram)","description":"Mercury skills are Markdown-based extensions (SKILL.md files) that teach the","source":"@site/docs/cli-commands/skills.mdx","sourceDirName":"cli-commands","slug":"/cli-commands/skills","permalink":"/docs/cli-commands/skills","draft":false,"unlisted":false,"editUrl":"https://github.com/cosmicstack-labs/mercury-agent/tree/main/website/docs/cli-commands/skills.mdx","tags":[],"version":"current","frontMatter":{"id":"skills","title":"Skills (CLI, in-chat, dashboard, Telegram)","sidebar_label":"Skills"},"sidebar":"docsSidebar","previous":{"title":"Doctor (Reconfigure)","permalink":"/docs/cli-commands/doctor"},"next":{"title":"Plugins","permalink":"/docs/cli-commands/plugins"}}'),i=l(74848),r=l(28453);let t={id:"skills",title:"Skills (CLI, in-chat, dashboard, Telegram)",sidebar_label:"Skills"},c,a={},d=[{value:"The four surfaces",id:"the-four-surfaces",level:2},{value:"CLI: <code>mercury skills \u2026</code>",id:"cli-mercury-skills-",level:2},{value:"Discover",id:"discover",level:3},{value:"Inspect before installing",id:"inspect-before-installing",level:3},{value:"Install, update, remove",id:"install-update-remove",level:3},{value:"Shared flags and environment variables",id:"shared-flags-and-environment-variables",level:3},{value:"In-chat: <code>/skills \u2026</code>",id:"in-chat-skills-",level:2},{value:"Dashboard: <code>http://127.0.0.1:6174/skills</code>",id:"dashboard-http1270016174skills",level:2},{value:"Telegram: <code>/skills \u2026</code>",id:"telegram-skills-",level:2},{value:"What happens on install (one paragraph)",id:"what-happens-on-install-one-paragraph",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2},{value:"Related",id:"related",level:2}];function h(e){let s={a:"a",blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.p,{children:["Mercury skills are Markdown-based extensions (",(0,i.jsx)(s.code,{children:"SKILL.md"})," files) that teach the\nagent how to do a specific task. The registry at\n",(0,i.jsx)(s.a,{href:"https://skills.mercuryagent.sh",children:(0,i.jsx)(s.strong,{children:"skills.mercuryagent.sh"})})," hosts 126+\ncommunity-contributed skills across 23 categories, and Mercury can install\nthem from four surfaces \u2014 they all share the same install path under the hood."]}),"\n",(0,i.jsxs)(s.blockquote,{children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.strong,{children:"Review before you ship."})," Skills run with elevated permissions when\ninvoked. Open the registry page (",(0,i.jsx)(s.code,{children:"mercury skills view <id> --web"}),") and read\nthe ",(0,i.jsx)(s.code,{children:"SKILL.md"})," body before installing."]}),"\n"]}),"\n",(0,i.jsxs)(s.p,{children:["For the file format, frontmatter spec, and runtime behavior, see\n",(0,i.jsx)(s.a,{href:"../reference/skills",children:"Reference \u2192 Skills"}),"."]}),"\n",(0,i.jsx)(s.h2,{id:"the-four-surfaces",children:"The four surfaces"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Surface"}),(0,i.jsx)(s.th,{children:"Best for"}),(0,i.jsx)(s.th,{children:"Entry point"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:["CLI subcommand (",(0,i.jsx)(s.code,{children:"mercury skills \u2026"}),")"]}),(0,i.jsx)(s.td,{children:"Scripting, batch installs, JSON output"}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"mercury skills install <id>"})})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:["In-chat slash command (",(0,i.jsx)(s.code,{children:"/skills \u2026"}),")"]}),(0,i.jsx)(s.td,{children:"Quick browse while chatting with the agent"}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"/skills search <q>"})})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:"Web dashboard"}),(0,i.jsx)(s.td,{children:"Visual browse + activate/deactivate toggle"}),(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"http://127.0.0.1:6174/skills"})})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:"Telegram bot"}),(0,i.jsx)(s.td,{children:"Browse and install while away from the machine"}),(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"/skills install <id>"})," (admin-only)"]})]})]})]}),"\n",(0,i.jsxs)(s.p,{children:["All four hit the same ",(0,i.jsx)(s.code,{children:"SkillStore.install(id)"})," code path, write to the same\n",(0,i.jsx)(s.code,{children:"~/.mercury/skills/<category>/<slug>/SKILL.md"})," location, and update the same\n",(0,i.jsx)(s.code,{children:"~/.mercury/skills/.index.json"}),"."]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsxs)(s.h2,{id:"cli-mercury-skills-",children:["CLI: ",(0,i.jsx)(s.code,{children:"mercury skills \u2026"})]}),"\n",(0,i.jsx)(s.p,{children:"The fastest surface, available before or after starting the agent. No browser\nrequired."}),"\n",(0,i.jsx)(s.h3,{id:"discover",children:"Discover"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-bash",children:'mercury skills info # registry stats + reachability\nmercury skills categories # all 23 categories\nmercury skills browse finance-legal # paginated list\nmercury skills browse --page 2 --limit 20\nmercury skills search "contract review" # full-text search\nmercury skills search --limit 3 prompt\n'})}),"\n",(0,i.jsx)(s.h3,{id:"inspect-before-installing",children:"Inspect before installing"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-bash",children:"mercury skills view finance-legal/contract-review\nmercury skills view finance-legal/contract-review --web # opens registry page\nmercury skills view finance-legal/contract-review --raw # prints raw SKILL.md\n"})}),"\n",(0,i.jsx)(s.h3,{id:"install-update-remove",children:"Install, update, remove"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-bash",children:"# From the registry\nmercury skills install finance-legal/contract-review\nmercury skills install ai-ml/prompt-engineering finance-legal/contract-review # batch\nmercury skills install finance-legal/contract-review --force # reinstall same version\n\n# From a local file or arbitrary URL\nmercury skills install --from ./SKILL.md\nmercury skills install --from https://example.com/my-skill.md\n\n# Update\nmercury skills update # all installed\nmercury skills update finance-legal/contract-review # just one\n\n# Remove\nmercury skills remove finance-legal/contract-review\n\n# Observability\nmercury skills list # what's installed locally\nmercury skills doctor # install root + registry + cache\n"})}),"\n",(0,i.jsx)(s.h3,{id:"shared-flags-and-environment-variables",children:"Shared flags and environment variables"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Flag"}),(0,i.jsx)(s.th,{children:"Purpose"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"--json"})}),(0,i.jsx)(s.td,{children:"Machine-readable output (useful for scripting / piping)."})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"--registry <url>"})}),(0,i.jsxs)(s.td,{children:["Use a different registry; also accepts ",(0,i.jsx)(s.code,{children:"MERCURY_SKILLS_REGISTRY"}),"."]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"-q"}),", ",(0,i.jsx)(s.code,{children:"--quiet"})]}),(0,i.jsx)(s.td,{children:"Suppress progress output."})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"-y"}),", ",(0,i.jsx)(s.code,{children:"--yes"})]}),(0,i.jsx)(s.td,{children:"Skip interactive confirmations."})]})]})]}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Environment variable"}),(0,i.jsx)(s.th,{children:"Purpose"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"MERCURY_SKILLS_REGISTRY"})}),(0,i.jsxs)(s.td,{children:["Default registry URL (overridden by ",(0,i.jsx)(s.code,{children:"--registry"}),")."]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"MERCURY_SKILLS_INSTALL_ROOT"})}),(0,i.jsxs)(s.td,{children:["Alternate install root (defaults to ",(0,i.jsx)(s.code,{children:"~/.mercury/skills"}),")."]})]})]})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsxs)(s.h2,{id:"in-chat-skills-",children:["In-chat: ",(0,i.jsx)(s.code,{children:"/skills \u2026"})]}),"\n",(0,i.jsxs)(s.p,{children:["Available in ",(0,i.jsx)(s.strong,{children:"every channel"})," \u2014 the CLI TUI, the web dashboard chat, and\nTelegram (subject to the Telegram-specific gating below). The slash command\nlist autocompletes when you type ",(0,i.jsx)(s.code,{children:"/skills"})," and press ",(0,i.jsx)("kbd",{children:"Tab"})," in the\nCLI."]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"/skills # list installed skills\n/skills search <query> # top 5 registry matches with URLs\n/skills view <id> # title, version, description, registry URL\n/skills install <id> # install from the registry\n/skills install <url> # install raw SKILL.md from a URL\n/skills remove <id> # uninstall\n/skills help # subcommand list\n"})}),"\n",(0,i.jsxs)(s.p,{children:["Every ",(0,i.jsx)(s.code,{children:"search"})," hit and every ",(0,i.jsx)(s.code,{children:"view"})," response prints the\n",(0,i.jsx)(s.code,{children:"https://skills.mercuryagent.sh/skills/<id>"})," URL so you can review on the web\nbefore installing."]}),"\n",(0,i.jsx)(s.p,{children:"Examples in a real chat session:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:'> /skills search contract\n\u{1F50D} Searching the registry for "contract"\u2026\n\nTop 3 matches for "contract":\n\n\u2022 `finance-legal/contract-review` (v1.0.0)\n Review contracts and surface risky clauses.\n https://skills.mercuryagent.sh/skills/finance-legal/contract-review\n\n\u2022 `finance-legal/saas-agreement` (v0.2.1)\n \u2026\n\n> /skills install finance-legal/contract-review\n\u{1F4E6} Installing `finance-legal/contract-review` from the registry\u2026\n\u2705 Installed `finance-legal/contract-review` (v1.0.0)\n\u{1F517} https://skills.mercuryagent.sh/skills/finance-legal/contract-review\n'})}),"\n",(0,i.jsxs)(s.blockquote,{children:["\n",(0,i.jsxs)(s.p,{children:["Installs run ",(0,i.jsx)(s.strong,{children:"without a confirmation prompt"})," \u2014 same as the existing\nin-chat URL-install behavior. The ",(0,i.jsx)(s.code,{children:"view"})," step (or the registry URL printed\nin ",(0,i.jsx)(s.code,{children:"search"})," results) is where you should review before committing."]}),"\n"]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsxs)(s.h2,{id:"dashboard-http1270016174skills",children:["Dashboard: ",(0,i.jsx)(s.code,{children:"http://127.0.0.1:6174/skills"})]}),"\n",(0,i.jsx)(s.p,{children:"The Skills page in the web dashboard has two installers stacked in one card:"}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Install from registry"})," \u2014 paste a ",(0,i.jsx)(s.code,{children:"category/slug"})," id and click Install.\nThe toast reports the install status (",(0,i.jsx)(s.code,{children:"installed"}),", ",(0,i.jsx)(s.code,{children:"updated"}),",\n",(0,i.jsx)(s.code,{children:"reinstalled"}),", ",(0,i.jsx)(s.code,{children:"already-installed"}),") and the version."]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Install from URL"})," \u2014 paste a URL pointing to a raw ",(0,i.jsx)(s.code,{children:"SKILL.md"}),". Mercury\nfetches it, validates the frontmatter, and saves it to disk."]}),"\n"]}),"\n",(0,i.jsxs)(s.p,{children:["The page header has a ",(0,i.jsx)(s.strong,{children:"Browse skills.mercuryagent.sh"})," link that opens the\nregistry in a new tab."]}),"\n",(0,i.jsx)(s.p,{children:"Each installed skill card has:"}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"A status badge (active / inactive)."}),"\n",(0,i.jsxs)(s.li,{children:["A ",(0,i.jsx)(s.strong,{children:"toggle"})," to activate or deactivate without deleting."]}),"\n",(0,i.jsxs)(s.li,{children:["A ",(0,i.jsx)(s.strong,{children:"trash"})," button to delete (with confirmation dialog)."]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:"The dashboard talks to these endpoints:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"GET /api/skills # list installed with active state\nPOST /api/skills/install # { url } \u2014 fetch and install from a URL\nPOST /api/skills/install-from-registry # { id, force? } \u2014 install by registry id\nPOST /api/skills/:name/activate\nPOST /api/skills/:name/deactivate\nDELETE /api/skills/:name\n"})}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsxs)(s.h2,{id:"telegram-skills-",children:["Telegram: ",(0,i.jsx)(s.code,{children:"/skills \u2026"})]}),"\n",(0,i.jsx)(s.p,{children:"Same subcommand surface as in-chat, with one extra rule:"}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"list"}),", ",(0,i.jsx)(s.code,{children:"search"}),", ",(0,i.jsx)(s.code,{children:"view"})," are available to ",(0,i.jsx)(s.strong,{children:"every approved user"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"install"})," and ",(0,i.jsx)(s.code,{children:"remove"})," are ",(0,i.jsx)(s.strong,{children:"admin-only"})," (same gate as ",(0,i.jsx)(s.code,{children:"/unpair"}),")."]}),"\n"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"/skills # list installed\n/skills search <query> # registry search\n/skills view <id> # details + URL\n/skills install <id> # admin only\n/skills remove <id> # admin only\n/skills help\n"})}),"\n",(0,i.jsxs)(s.p,{children:["The bot includes the ",(0,i.jsx)(s.code,{children:"https://skills.mercuryagent.sh/skills/<id>"})," URL in every\n",(0,i.jsx)(s.code,{children:"search"})," result and every ",(0,i.jsx)(s.code,{children:"view"})," response, so non-admin members can review a\nskill on a browser and then ask an admin to install it."]}),"\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"/skills"})," is registered in the Telegram command menu (between ",(0,i.jsx)(s.code,{children:"/spotify"})," and\n",(0,i.jsx)(s.code,{children:"/unpair"}),"), so it appears in autocomplete next to all the other bot commands."]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h2,{id:"what-happens-on-install-one-paragraph",children:"What happens on install (one paragraph)"}),"\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"SkillStore.install(id)"})," calls ",(0,i.jsx)(s.code,{children:"GET /api/skills/<id>"})," for the JSON detail,\nshort-circuits with ",(0,i.jsx)(s.code,{children:"'already-installed'"})," if the local index already has the\nsame version (unless ",(0,i.jsx)(s.code,{children:"--force"}),"), reconstructs the canonical ",(0,i.jsx)(s.code,{children:"SKILL.md"})," from\nthe JSON ",(0,i.jsx)(s.code,{children:"frontmatter + body"})," fields, ",(0,i.jsx)(s.strong,{children:"atomically"})," writes it to\n",(0,i.jsx)(s.code,{children:"~/.mercury/skills/<category>/<slug>/SKILL.md"})," (tmp file + rename),\nverification-reads the file back, then updates\n",(0,i.jsx)(s.code,{children:"~/.mercury/skills/.index.json"}),". If either write fails, both the file and the\nindex are rolled back so they never disagree. Skill ids must match\n",(0,i.jsx)(s.code,{children:"^[a-z0-9-]+/[a-z0-9-]+$"})," \u2014 that's the path-traversal guard."]}),"\n",(0,i.jsxs)(s.p,{children:["The agent picks up newly installed skills on its next discovery scan (next\nagent boot or ",(0,i.jsx)(s.code,{children:"/skills"})," view in the dashboard)."]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Symptom"}),(0,i.jsx)(s.th,{children:"Fix"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"Invalid skill id"})}),(0,i.jsxs)(s.td,{children:["The id must be ",(0,i.jsx)(s.code,{children:"<category>/<slug>"}),", lowercase, hyphen-separated. Don't include the full URL."]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"Registry 404"})}),(0,i.jsxs)(s.td,{children:["The id doesn't exist on the registry. Run ",(0,i.jsx)(s.code,{children:"mercury skills search <q>"})," to find the right id."]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"Registry timeout"})," / ",(0,i.jsx)(s.code,{children:"unreachable"})]}),(0,i.jsxs)(s.td,{children:["Run ",(0,i.jsx)(s.code,{children:"mercury skills doctor"})," to confirm reachability and cache state. Pass ",(0,i.jsx)(s.code,{children:"--registry"})," or set ",(0,i.jsx)(s.code,{children:"MERCURY_SKILLS_REGISTRY"})," if you self-host."]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:"Install succeeded but the agent doesn't see the new skill"}),(0,i.jsx)(s.td,{children:"The skill loader scans on boot. Restart Mercury or open the dashboard's Skills page (it triggers a re-scan)."})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"Post-install verification failed"})}),(0,i.jsxs)(s.td,{children:["The disk write didn't round-trip. Usually disk-full or a permission issue under ",(0,i.jsx)(s.code,{children:"~/.mercury/skills/"}),". The CLI rolls back automatically."]})]})]})]}),"\n",(0,i.jsx)(s.hr,{}),"\n",(0,i.jsx)(s.h2,{id:"related",children:"Related"}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.a,{href:"../reference/skills",children:"Reference \u2192 Skills"})," \u2014 file format, frontmatter spec, runtime behavior, writing your own."]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.a,{href:"./cli-commands",children:"CLI Commands"})," \u2014 full ",(0,i.jsx)(s.code,{children:"mercury"})," command reference."]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.a,{href:"./in-chat-commands",children:"In-chat commands"})," \u2014 all slash commands in chat."]}),"\n"]})]})}function o(e={}){let{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},28453(e,s,l){l.d(s,{R:()=>t,x:()=>c});var n=l(96540);let i={},r=n.createContext(i);function t(e){let s=n.useContext(r);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:t(e.components),n.createElement(r.Provider,{value:s},e.children)}}}]);