Ankita AI 如何為桌面 AI 助手構建技能探索功能:工具呼叫由 39 次減至 21 次,安裝器拒絕大部分技能
How I built skill discovery for my desktop AI companion: 39 calls down to 21, and an installer that refuses most skills
Ankita AI 為桌面 AI 助手加入技能探索、預覽及安裝功能,工作流程基準測試的工具呼叫總數由 39 次降至 21 次,減少 46.15%。安裝器只接受自包含的 SKILL.md,會拒絕多檔案技能;測試結果來自固定測試環境,不能證明真實任務或模型有普遍改善。
How I built skill discovery for my desktop AI companion: 39 calls down to 21, and an installer that refuses most skills
Ankita AI is a desktop AI assistant by Krish Verma, and until last week it had a quiet limitation: it could only do what its shipped skills already described. Ask it to fill in a mobile app form and it would improvise — list the screen, click a field, type, read the screen again, click the next field — thirteen tool calls for four fields. The fix was not a smarter model. It was letting the companion find, preview and install new skills itself, through a tool that distrusts almost everything it touches.
That tool is skill_manage, in src/skills/manager.mjs — 170 lines, deferred, so it costs nothing on turns that never use it. List, search and preview are read-only. Installation follows the normal approval rules and is refused outright in read-only or non-interactive hosts. Five skills ship bundled and enabled by default, and you can turn any of them off in Plugins > Skills: mobile-mcp for grounded Android/iPhone actions, action-chain for dependent work that must survive interruptions, workspace-batch for several file changes in one reviewable patch, research-brief for sourced comparisons without repeated searches, and skill-discovery itself.
The flow is deliberately boring. You say "find skills for mobile app forms", then "preview that skill", then "install the exact preview". Preview resolves the branch or tag to a full 40-hex Git commit and returns the instructions, the source, the path, the immutable commit and a SHA-256 of the exact file. Install fetches that same commit-addressed source again, checks the digest against the preview, records the provenance and registers a profile root shared by chat and desktop. If the content changed between preview and install, or the hash does not match, the install fails. Existing and bundled skill names are protected, and downloads run no code at all.
The network surface is pinned down hard. Only three hosts are ever contacted: api.github.com, raw.githubusercontent.com and github.com. Redirects are refused, every response is capped at 1 MB, and search queries are capped at 200 characters. The skill body itself has to fit the shared 8,000-byte read limit. That narrowness is the whole design, and it is also the part I expect people to argue with: the importer accepts self-contained SKILL.md files only. Support directories, sibling helpers, relative resources, linked entrypoint files, incomplete repository trees and incompatible frontmatter are all refused. There is no package execution, no automatic update, no private-source authentication and no full YAML compatibility.
So does the narrow gate buy anything? I measured it with scripts/bench/skill-workflows.mjs, which drives the real tool host against an injected mobile server, real temporary file edits and a loopback source server, with scripted decision plans. A stable mobile form went from 13 calls to 4, with the same saved values. A timeout after a write took effect went from 14 calls to 6, with the same values and zero duplicate writes — the recovery reads current state instead of appending twice. Four workspace changes went from 9 calls to 7. Three sourced briefs went from 3 calls to 4, because reading the guide itself costs a call. Total: 39 calls down to 21, 46.15% fewer. To be precise about what that number is not: it clears the 25% reference threshold I set for the bench, but it does not prove a 25% improvement against Ankita's existing model behaviour — an independent planning check already chose batching without these guides, and real improvement needs paired runs of the same model on real tasks, before and after. No universal call, latency, token or cost improvement is claimed.
What the bench does prove is that the mechanism works end to end. The verification run covered 20 relevant test files — 159 out of 159 passing, zero failures, zero skips, in about 85 seconds. Then a live smoke test: 12 search candidates, and a real import of the brand-guidelines skill from anthropics/skills at commit ca45fc496a3436251f191354091d557da31c15b5, SHA-256 1120b3769e2985cefb3d25be981b1f914abeba57ae079b83c20c666c164fa9fe, verified working in chat, in desktop, and after a CLI restart. The longer frontend-design skill from the same repo was rejected by the byte-limit guard — the refusal path works too, not just the happy path.
The honest limits: no physical Android or iOS device was used, the real mobile batch implementation is untested against a real phone, arbitrary-model adherence to the guides is unproven, packaged Electron installation was not exercised, and private repositories are out of scope entirely. The 46% figure is a ceiling measured on fixtures, and the fixtures guarantee stable controls and stop-on-error batching that a real device may not.
Ankita is open source at github.com/akyourowngames/A.N.K.I.T.A, and the project site is ankita-sable.vercel.app. The skill-discovery skill and the five productive skills ship in the repo now, on main, unreleased — the installer, the bench and the findings doc at docs/findings/productive-skills.md are all there to inspect.
Tell me I'm wrong: is "self-contained SKILL.md only" the right line, or just the laziest safe one? A real skill ecosystem is multi-file — helpers, fixtures, linked guides — and refusing all of it keeps the installer honest but caps what discovery can ever find. The alternative is accepting support files inside a sandbox that can prove they were never executed, but a sandbox that only ever sees text is a promise, not a boundary. Where would you draw it — and what would you make the importer accept first?
— Krish Verma, creator of Ankita AI
來源:DEV Community · dev.to