MCPcopy Create free account
hub / github.com/arctic-cli/interface / formatSkill

Function formatSkill

packages/arctic/src/skill/tools.ts:6–27  ·  view source on GitHub ↗
(skill: Skill.Info)

Source from the content-addressed store, hash-verified

4import type { Skill } from "./types"
5
6function formatSkill(skill: Skill.Info): string {
7 const lines = [`<skill name="${skill.name}">`]
8
9 if (skill.description) {
10 lines.push(`<description>${skill.description}</description>`)
11 }
12
13 if (skill.allowedTools && skill.allowedTools.length > 0) {
14 lines.push(`<allowed-tools>${skill.allowedTools.join(", ")}</allowed-tools>`)
15 }
16
17 if (skill.argumentHint && skill.argumentHint.length > 0) {
18 lines.push(`<argument-hint>${skill.argumentHint.join(", ")}</argument-hint>`)
19 }
20
21 lines.push(`<content>`)
22 lines.push(skill.content)
23 lines.push(`</content>`)
24 lines.push(`</skill>`)
25
26 return lines.join("\n")
27}
28
29export const SkillUseTool = Tool.define("skill_use", {
30 description: `Load one or more skills by name. Skills provide specialized instructions and context for specific tasks. Use skill_find to discover available skills first.`,

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected