[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71S40E2CN5ATNS907G5ZR2V":3,"skill-same:01M71S40E2CN5ATNS907G5ZR2V":44},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":5,"forksCount":13,"repositoryHtmlUrl":24,"repositoryHomepageUrl":25,"ownerHtmlUrl":26,"ownerBlogUrl":27,"ownerDescription":28,"updatedAt":29,"install":30,"resources":43},"01M71S40E2CN5ATNS907G5ZR2V","doc",null,"anatolykoptev\u002Fskillkit","anatolykoptev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F239934030?v=4","01M71S3Z1D8TRH9K9JREW83J07","Anatoly Koptev","01M71S3Z22M0MEHGNR6MTNSGYB",0,"MIT","https:\u002F\u002Fgithub.com\u002Fanatolykoptev\u002Fskillkit\u002Fblob\u002Fmain\u002Fdoc\u002Fskill.md",[],[5],"2026-11-10 13:02:02",false,"# skillkit — Usage Guide\n\nThis document covers both patterns exposed by the package with\nreal-world examples, a frontmatter reference, name validation rules,\nhot-reload mechanics, migration notes, and a spec conformance table.\n\n---\n\n## 1. Why this package\n\nEvery Go service that loads skills has historically hand-rolled its own\nloader: a `\u002F\u002Fgo:embed` glob, an env-override path, an mtime check, a\nbespoke YAML parser. None of these agree on frontmatter field names, name\nvalidation rules, or resolution order — so a skill that works in one\nservice silently breaks in another.\n\nThe agentskills.io open standard fixes this at the ecosystem level. A\nskill is a directory (`skill-name\u002FSKILL.md`) with YAML or JSON\nfrontmatter; 35+ agentic tools — Claude Code, Cursor, GitHub Copilot,\nJetBrains Junie, Gemini CLI, OpenAI Codex, and others — agree on the\nsame field names and directory layout. `skillkit` implements that\nstandard strictly so that skills authored against it run unchanged in any\nconformant agent. It also eliminates ~150–250 lines of boilerplate per\nservice.\n\n---\n\n## 2. Pattern A: Embedded single skill\n\nUse Pattern A when a binary ships exactly one skill baked in via\n`\u002F\u002Fgo:embed`. An optional env variable lets operators point to a\nfilesystem file for hot-reload during prompt iteration, without restarting\nthe service.\n\n```go\npackage myservice\n\nimport (\n    _ \"embed\"\n    \"log\u002Fslog\"\n\n    \"github.com\u002Fanatolykoptev\u002Fskillkit\"\n)\n\n\u002F\u002Fgo:embed skills\u002Fd10-extractor\u002FSKILL.md\nvar rawSkill string\n\n\u002F\u002F NewEmbedded panics at startup if name is invalid or body is empty after\n\u002F\u002F frontmatter strip — catching configuration errors at binary init time.\nvar skill = skillkit.NewEmbedded(\n    \"d10-extractor\",          \u002F\u002F skill name (must match dir name per spec)\n    \"MEMDB_D10_SKILL_PATH\",   \u002F\u002F env var: set to a file path to override\n    rawSkill,\n)\n\nfunc init() {\n    slog.Info(\"skill resolution\", \"state\", skill.Diagnostic())\n    \u002F\u002F Prints one of:\n    \u002F\u002F   \"embedded default\"\n    \u002F\u002F   \"env override \u002Fetc\u002Fmyservice\u002Fd10-extractor.md\"\n    \u002F\u002F   \"env override \u002Ftmp\u002Fedit.md UNREADABLE → embedded default\"\n}\n\nfunc buildPrompt() string {\n    return skill.Body() \u002F\u002F always non-empty; hot-reloads from env path if set\n}\n```\n\n`skill.Metadata()` returns the parsed frontmatter from the embedded file\n(not from any env-override file — metadata is stable across hot-reloads).\n\n`skill.Diagnostic()` re-stats the env path on every call; use it in\nstartup logs or a health endpoint, not in the hot path.\n\n---\n\n## 3. Pattern B: Multi-tier catalog (workspace + builtin)\n\nUse Pattern B when an agent CLI loads many skills from the filesystem.\nTiers are searched in priority order; the first match wins.\n\n```go\npackage mycli\n\nimport (\n    \"log\u002Fslog\"\n\n    \"github.com\u002Fanatolykoptev\u002Fskillkit\"\n)\n\nfunc newCatalog(workspaceDir, builtinDir string) *skillkit.Catalog {\n    return skillkit.NewCatalog(\n        skillkit.NewDirTier(\"workspace\", workspaceDir), \u002F\u002F user-editable, wins\n        skillkit.NewDirTier(\"builtin\",   builtinDir),   \u002F\u002F shipped with agent\n    )\n}\n\nfunc loadDocReview(cat *skillkit.Catalog) {\n    body, info, ok := cat.Load(\"doc-review\")\n    if !ok {\n        slog.Warn(\"skill not found\", \"name\", \"doc-review\")\n        return\n    }\n    _ = body        \u002F\u002F skill body (frontmatter stripped)\n    _ = info.Source \u002F\u002F \"workspace\" or \"builtin\" — which tier matched\n    _ = info.Dir    \u002F\u002F absolute path to skill dir; use to resolve siblings\n}\n\nfunc loadMany(cat *skillkit.Catalog) string {\n    \u002F\u002F Returns a single string ready for system-prompt injection.\n    \u002F\u002F Format per skill: \"### Skill: \u003Cname>\\n\\n\u003Cbody>\", joined with \"\\n\\n---\\n\\n\".\n    return cat.LoadMany([]string{\"doc-review\", \"code-summary\", \"translate\"})\n}\n\nfunc systemPromptSkillBlock(cat *skillkit.Catalog) string {\n    \u002F\u002F Compact XML summary of all known skills: name, path, source, description.\n    \u002F\u002F Suitable for injection at the top of a system prompt.\n    return cat.BuildSummary(skillkit.SummaryXML)\n}\n```\n\n`DirTier` expects the layout `\u003Cdir>\u002F\u003Cskill-name>\u002FSKILL.md`. One level of\nsubdirectories only — no recursive scan. Symlinks to skill directories are\nskipped with a `slog.Warn`.\n\n---\n\n## 4. Pattern B: Plugin-namespaced catalog\n\nWhen a plugin system contributes skills alongside built-in ones, use\n`NewPluginTier`. The tier maintains two indices: bare name and\n`plugin:skill` namespaced name.\n\n```go\npackage mycli\n\nimport (\n    \"github.com\u002Fanatolykoptev\u002Fskillkit\"\n)\n\nfunc newPluginCatalog(workspaceDir string, pluginSkills []skillkit.PluginEntry) *skillkit.Catalog {\n    return skillkit.NewCatalog(\n        skillkit.NewDirTier(\"workspace\", workspaceDir),\n        skillkit.NewPluginTier(\"plugin\", pluginSkills),\n    )\n}\n\n\u002F\u002F Example entries populated by the plugin discovery layer:\nvar entries = []skillkit.PluginEntry{\n    {\n        PluginName: \"code-review\",\n        SkillName:  \"diff-summary\",\n        Body:       rawDiffSummarySkill, \u002F\u002F pre-loaded body; no disk read at runtime\n    },\n    {\n        PluginName: \"code-review\",\n        SkillName:  \"commit-message\",\n        Path:       \"\u002Fusr\u002Flocal\u002Fshare\u002Fplugins\u002Fcode-review\u002Fcommit-message\u002FSKILL.md\",\n    },\n}\n\nfunc lookups(cat *skillkit.Catalog) {\n    \u002F\u002F Bare-name lookup: returns the first plugin entry with SkillName \"diff-summary\".\n    body, info, ok := cat.Load(\"diff-summary\")\n    _ = body\n    _ = ok\n    _ = info.Source \u002F\u002F \"plugin:code-review\"  ← tier:plugin format\n\n    \u002F\u002F Namespaced lookup: explicit plugin + skill.\n    body2, _, ok2 := cat.Load(\"code-review:diff-summary\")\n    _ = body2\n    _ = ok2\n}\n```\n\n`SkillInfo.Source` is `\"\u003Ctier>:\u003Cplugin>\"` for plugin tiers (e.g.\n`\"plugin:code-review\"`) and just `\"\u003Ctier>\"` for DirTier \u002F EmbedFSTier\n(e.g. `\"workspace\"`). The Catalog tags this automatically — resolvers that\nalready set a colon-containing Source are left unchanged.\n\nWhen multiple entries share the same bare `SkillName`, the first entry\nwins and a `slog.Warn` is emitted for the conflict.\n\n---\n\n## 5. Pattern B: embed.FS multi-skill catalog\n\nUse `NewEmbedFSTier` to ship a curated set of skills inside the binary\nwith no operator setup required.\n\n```go\npackage myagent\n\nimport (\n    \"embed\"\n\n    \"github.com\u002Fanatolykoptev\u002Fskillkit\"\n)\n\n\u002F\u002F The glob must match \u003Croot>\u002F\u003Cskill-name>\u002FSKILL.md exactly.\n\u002F\u002F All matched files are parsed once at binary init (NewEmbedFSTier call).\n\n\u002F\u002Fgo:embed skills\u002F*\u002FSKILL.md\nvar embeddedSkills embed.FS\n\nvar cat = skillkit.NewCatalog(\n    skillkit.NewEmbedFSTier(\"builtin\", embeddedSkills, \"skills\"),\n)\n\nfunc listBuiltin() []skillkit.SkillInfo {\n    return cat.List() \u002F\u002F sorted by name, deduplicated across tiers\n}\n```\n\n`EmbedFSTier` uses forward-slash paths internally (`embed.FS` always does)\nregardless of the host OS. `SkillInfo.Dir` is set to the forward-slash\npath of the skill directory inside the FS — callers that resolve sibling\nfiles must use `embed.FS.ReadFile`, not `os.Open`.\n\n---\n\n## 6. Frontmatter reference\n\nskillkit parses two formats. Both require a blank line between the\nfrontmatter block and the body.\n\n### YAML (Markdown standard — recommended)\n\n```markdown\n---\nname: d10-extractor\ndescription: Extracts the ten most important atomic facts from a document.\nlicense: MIT\ncompatibility: Claude 3.5 Sonnet+\nwhen_to_use: Use when summarizing dense technical documents.\nallowed-tools: [Read, Bash]\ndisable-model-invocation: false\nuser-invocable: true\nversion: 1.0.0\nlocale: en\ntags: [extraction, summarization]\nmetadata:\n  effort: low\n  context: 8192\n---\n\n# D10 Extractor\n\nGiven a document, return the ten most important atomic facts...\n```\n\n`allowed-tools` accepts either a YAML flow list (`[Read, Bash]`) or a\nspace-separated string (`Read Bash`). `tags` accepts either a YAML flow\nlist or a comma-separated string (`extraction, summarization`).\n\n### JSON\n\n```markdown\n{\n  \"name\": \"d10-extractor\",\n  \"description\": \"Extracts the ten most important atomic facts from a document.\",\n  \"license\": \"MIT\",\n  \"when_to_use\": \"Use when summarizing dense technical documents.\",\n  \"allowed-tools\": [\"Read\", \"Bash\"],\n  \"version\": \"1.0.0\",\n  \"tags\": [\"extraction\", \"summarization\"],\n  \"metadata\": {\n    \"effort\": \"low\"\n  }\n}\n\n# D10 Extractor\n\nGiven a document, return the ten most important atomic facts...\n```\n\nJSON frontmatter: top-level object on the first line(s), then exactly one\nblank line, then the body. Trailing non-whitespace on the closing-brace\nline causes the frontmatter to be silently ignored (body returned as-is).\n\n---\n\n## 7. Metadata fields reference\n\nAll fields correspond to frontmatter keys. Unrecognized top-level keys\nland in `Extra`.\n\n| Struct field | Frontmatter key | Type | Notes |\n|---|---|---|---|\n| `Name` | `name` | `string` | Required; validated by `ValidateName` |\n| `Description` | `description` | `string` | Required; warn if > 1024 chars |\n| `License` | `license` | `string` | SPDX identifier recommended |\n| `Compatibility` | `compatibility` | `string` | Model version constraint, free-form |\n| `WhenToUse` | `when_to_use` | `string` | Claude Code discovery hint |\n| `AllowedTools` | `allowed-tools` | `[]string` | Flow list or space-separated |\n| `DisableModelInvocation` | `disable-model-invocation` | `bool` | Claude Code: skip LLM call |\n| `UserInvocable` | `user-invocable` | `*bool` | `nil` = default (true); 3-state |\n| `Version` | `version` | `string` | Semver for migration tracking |\n| `Locale` | `locale` | `string` | BCP 47 tag (en, ru, zh-CN) |\n| `Tags` | `tags` | `[]string` | Flow list or comma-separated |\n| `Extra` | top-level unknown keys + `metadata:` sub-keys | `map[string]string` | Catch-all for non-standard fields |\n\nThe `metadata:` YAML block flattens its top-level keys into `Extra`. For\nexample, `metadata:\\n  effort: low` adds `Extra[\"effort\"] = \"low\"`.\nJSON uses the `\"metadata\"` key for the same map.\n\n---\n\n## 8. Multi-file skills via SkillInfo.Dir\n\nThe agentskills.io spec defines a standard layout for skills with\nsupplementary content:\n\n```\nskill-name\u002F\n  SKILL.md          ← frontmatter + body\n  scripts\u002F          ← runnable helpers (execution is caller's concern)\n  references\u002F       ← long-form context documents\n  assets\u002F           ← images, data files\n```\n\n`SkillInfo.Dir` is the absolute path to the skill directory. Use it to\nresolve sibling files:\n\n```go\nbody, info, ok := cat.Load(\"d10\")\nif !ok {\n    return\n}\n\n\u002F\u002F Load a sibling reference document.\nrefPath := filepath.Join(info.Dir, \"references\", \"edge_cases.md\")\nrefContent, err := os.ReadFile(refPath)\nif err != nil {\n    \u002F\u002F Reference is optional; handle gracefully.\n    _ = err\n}\n```\n\n`PluginEntry` entries with only `Body` set (no `Path`) have an empty\n`Dir`. Always check `info.Dir != \"\"` before calling `filepath.Join` on it.\n\nFor `EmbedFSTier`, `Dir` is a forward-slash path into the `embed.FS`. Use\n`embed.FS.ReadFile(filepath.ToSlash(filepath.Join(info.Dir, \"references\", \"edge_cases.md\")))`\nor construct the path with `path.Join` (not `filepath.Join`).\n\n---\n\n## 9. Name validation rules (agentskills.io spec)\n\nThe spec mandates:\n\n- 1–64 characters\n- Lowercase ASCII alphanumeric and hyphens only\n- No leading hyphen\n- No trailing hyphen\n- No consecutive hyphens (`--`)\n- On-disk directory name must match the skill's `name` field\n\n`ValidateName(name, dirName string) error` enforces all rules. Pass `\"\"`\nas `dirName` to skip the directory-match check (used by `Embedded`).\n\n```go\n\u002F\u002F Valid names:\n\u002F\u002F \"d10-extractor\"   ✓\n\u002F\u002F \"doc-review\"      ✓\n\u002F\u002F \"translate\"       ✓\n\u002F\u002F \"code-review-v2\"  ✓\n\n\u002F\u002F Invalid names (ValidateName returns a non-nil error):\n\u002F\u002F \"\"                — empty\n\u002F\u002F \"D10-Extractor\"   — uppercase\n\u002F\u002F \"-extractor\"      — leading hyphen\n\u002F\u002F \"extractor-\"      — trailing hyphen\n\u002F\u002F \"code--review\"    — consecutive hyphens\n\u002F\u002F strings.Repeat(\"a\", 65)  — exceeds 64 chars\n```\n\n`NewEmbedded` calls `ValidateName(name, \"\")` and panics on failure — the\nerror surfaces at binary startup, not at request time. `DirTier` uses the\ndirectory name as the skill name without re-validating it (the spec check\nis at authoring time, enforced by `skills-ref` in CI).\n\n---\n\n## 10. Hot-reload mechanics\n\n`Embedded.Body()` and `DirTier.Find` (with `WithMtimeCache`) share the\nsame mtime-polling strategy:\n\n1. `os.Stat(path)` — one syscall, microseconds.\n2. Compare `stat.ModTime().UnixNano()` against the cached value.\n3. Same → return cached body (no disk read).\n4. Different → `os.ReadFile` + `StripFrontmatter`, update cache, return\n   new body.\n\nThe net effect: edit a skill file, next request picks it up. No restarts.\n\n### Embedded-specific behavior\n\n- Body is always non-empty. If the env-override file is transiently\n  unreadable (e.g. during an atomic rename where a `.tmp` file is moved\n  over the target), `Body()` returns the last-known-good cached body\n  rather than falling back to the embedded default. This avoids a brief\n  blip back to the old default during a live file update.\n- Files larger than 1 MiB are rejected at stat time (DoS guard). The size\n  limit applies only to env-override files; the embedded default has no\n  cap.\n\n### Why not fsnotify\n\ninotify-style watchers do not fire on NFS, SMB, or several Docker\nbind-mount configurations. SSHFS mounts fall in this gap. The cost of one\n`os.Stat` per `Body()` call is negligible next to the LLM round-trip that\nfollows. mtime polling is the right primitive for the deployment topology\nand will not change (see `docs\u002FROADMAP.md` anti-roadmap).\n\n---\n\n## 11. Observability\n\nBoth `Embedded` and `Catalog` accept an optional `Observer` that fires\nstdlib callbacks for each runtime event. Wire the callbacks to whichever\nmetrics backend the consuming service uses — skillkit core stays\nstdlib-only.\n\n### Wiring to prometheus\\_client\\_golang\n\n```go\nimport (\n    \"github.com\u002Fanatolykoptev\u002Fskillkit\"\n    \"github.com\u002Fprometheus\u002Fclient_golang\u002Fprometheus\"\n    \"github.com\u002Fprometheus\u002Fclient_golang\u002Fprometheus\u002Fpromauto\"\n)\n\nvar (\n    skillBodyCalls = promauto.NewCounterVec(prometheus.CounterOpts{\n        Name: \"skill_body_calls_total\",\n        Help: \"Skill body resolutions by source path.\",\n    }, []string{\"name\", \"source\"})\n\n    skillEnvFallbacks = promauto.NewCounterVec(prometheus.CounterOpts{\n        Name: \"skill_env_fallbacks_total\",\n        Help: \"Skill env-override rejections by reason.\",\n    }, []string{\"name\", \"reason\"})\n\n    skillBodyBytes = promauto.NewHistogramVec(prometheus.HistogramOpts{\n        Name:    \"skill_body_bytes\",\n        Help:    \"Byte size of bodies returned by Body()\",\n        Buckets: prometheus.ExponentialBuckets(256, 4, 8),\n    }, []string{\"name\"})\n)\n\nvar obs = &skillkit.Observer{\n    BodyCall:    func(name, source string) { skillBodyCalls.WithLabelValues(name, source).Inc() },\n    EnvFallback: func(name, reason string) { skillEnvFallbacks.WithLabelValues(name, reason).Inc() },\n    BodyBytes:   func(name string, b int) { skillBodyBytes.WithLabelValues(name).Observe(float64(b)) },\n}\n\nvar skill = skillkit.NewEmbedded(\"d10-extractor\", \"MEMDB_D10_SKILL_PATH\", rawSkill,\n    skillkit.WithObserver(obs))\n\n\u002F\u002F For Catalog:\nvar cat = skillkit.NewCatalog(\n    skillkit.NewDirTier(\"workspace\", workspaceDir),\n    skillkit.NewDirTier(\"builtin\", builtinDir),\n).WithObserver(&skillkit.Observer{\n    CatalogLoad: func(name, outcome string) { \u002F* counter *\u002F },\n    CatalogSize: func(tier string, count int) { \u002F* gauge *\u002F },\n})\n```\n\n### Wiring to OpenTelemetry\n\n```go\nimport (\n    \"context\"\n\n    \"go.opentelemetry.io\u002Fotel\u002Fattribute\"\n    \"go.opentelemetry.io\u002Fotel\u002Fmetric\"\n\n    \"github.com\u002Fanatolykoptev\u002Fskillkit\"\n)\n\n\u002F\u002F newSkillObserver builds an Observer that emits OTel counters. Caller\n\u002F\u002F supplies the context used for every emission (typically a\n\u002F\u002F long-lived process context such as context.Background()).\nfunc newSkillObserver(ctx context.Context, meter metric.Meter) *skillkit.Observer {\n    calls, _ := meter.Int64Counter(\"skill.body.calls\")\n    fallbacks, _ := meter.Int64Counter(\"skill.env.fallbacks\")\n    return &skillkit.Observer{\n        BodyCall: func(name, source string) {\n            calls.Add(ctx, 1, metric.WithAttributes(\n                attribute.String(\"name\", name),\n                attribute.String(\"source\", source),\n            ))\n        },\n        EnvFallback: func(name, reason string) {\n            fallbacks.Add(ctx, 1, metric.WithAttributes(\n                attribute.String(\"name\", name),\n                attribute.String(\"reason\", reason),\n            ))\n        },\n    }\n}\n```\n\n### Wiring to slog (local debug)\n\n```go\nvar obs = &skillkit.Observer{\n    BodyCall:    func(name, source string) { slog.Debug(\"skill.body\", \"name\", name, \"source\", source) },\n    EnvFallback: func(name, reason string) { slog.Warn(\"skill.env_fallback\", \"name\", name, \"reason\", reason) },\n    BodyBytes:   func(name string, b int) { slog.Debug(\"skill.bytes\", \"name\", name, \"bytes\", b) },\n    CatalogLoad: func(name, outcome string) { slog.Debug(\"skill.catalog\", \"name\", name, \"outcome\", outcome) },\n    CatalogSize: func(tier string, n int) { slog.Info(\"skill.catalog_size\", \"tier\", tier, \"count\", n) },\n}\n```\n\n### Label cardinality\n\nAll labels have bounded cardinality:\n\n- `name` — one entry per skill instance (typically 1–50 per service)\n- `source` — fixed enum: `embedded`, `env`, `cache_hit`, `last_known_good`\n- `reason` — fixed enum: `unreadable`, `too_large`, `empty_body`\n- `outcome` — fixed enum: `hit`, `miss`\n- `tier` — one entry per Catalog tier (typically 2–5 per Catalog)\n\nNone of these labels are user-controlled. Cardinality will not grow\nunbounded under adversarial input.\n\n---\n\n## 12. Migration notes from hand-rolled loaders\n\nExisting skill files (`SKILL.md` with YAML or JSON frontmatter) work\nunchanged — skillkit is spec-compliant and parses the same frontmatter\nfields in the same way.\n\n### MemDB `skill_loader.go` → `skillkit.NewEmbedded`\n\nBefore (~150 lines):\n- `\u002F\u002Fgo:embed …` + `strings.TrimSpace(strings.SplitN(raw, \"---\", 3)[2])`\n- Manual env var read + `os.Stat` + `os.ReadFile` + mtime comparison\n- Separate `Metadata` struct with partial field coverage\n\nAfter (3 lines):\n```go\n\u002F\u002Fgo:embed skills\u002Fd10-extractor\u002FSKILL.md\nvar rawSkill string\n\nvar skill = skillkit.NewEmbedded(\"d10-extractor\", \"MEMDB_D10_SKILL_PATH\", rawSkill)\n```\n\n### dozor `internal\u002Fskills\u002FLoader` → `skillkit.NewCatalog` + `NewDirTier`\n\nBefore (~200 lines):\n- `os.ReadDir` + per-entry `os.ReadFile` + custom YAML parser\n- Separate workspace and builtin resolution paths\n- No mtime caching\n\nAfter (5 lines):\n```go\ncat := skillkit.NewCatalog(\n    skillkit.NewDirTier(\"workspace\", workspaceDir, skillkit.WithMtimeCache()),\n    skillkit.NewDirTier(\"builtin\",   builtinDir),\n)\n```\n\n### vaelor `pkg\u002Fskills\u002FSkillsLoader` → `Catalog` + DirTier × N + PluginTier\n\nBefore (~250 lines):\n- Three-level directory scan (workspace \u002F global \u002F builtin)\n- Plugin discovery loop with bare + namespaced name indices maintained\n  manually\n- Inline summary rendering for system prompts\n\nAfter (8 lines):\n```go\ncat := skillkit.NewCatalog(\n    skillkit.NewDirTier(\"workspace\", workspaceDir),\n    skillkit.NewDirTier(\"global\",    globalDir),\n    skillkit.NewDirTier(\"builtin\",   builtinDir),\n    skillkit.NewPluginTier(\"plugin\", discoveredEntries),\n)\nsummary := cat.BuildSummary(skillkit.SummaryXML)\n```\n\n---\n\n## 13. Locale routing (v0.2.1+)\n\n### Frontmatter field\n\nThe agentskills.io spec includes an optional `locale` field for language-tagged\nskill variants:\n\n```markdown\n---\nname: d10-extractor\ndescription: Extracts the ten most important atomic facts from a document.\nlocale: ru\n---\n\n# D10 Экстрактор\n\n...\n```\n\nCommon values follow BCP-47 language tags (`en`, `ru`, `zh`, `pt-BR`), but\nskillkit does not validate the format — the caller decides the vocabulary.\n\n### Directory layout for locale variants\n\nEach locale variant is its own skill directory with the same frontmatter `name`\nbut a different subdirectory name (to avoid collision):\n\n```\nskills\u002F\n  d10-extractor\u002F           ← locale-neutral (no `locale:` field)\n    SKILL.md\n  d10-extractor-ru\u002F        ← Russian variant\n    SKILL.md               ← frontmatter: name: d10-extractor, locale: ru\n  d10-extractor-zh\u002F        ← Chinese variant\n    SKILL.md               ← frontmatter: name: d10-extractor, locale: zh\n```\n\n`DirTier` uses the subdirectory name as `SkillInfo.Name` and the frontmatter\n`name:` field as `Metadata.Name`. Locale routing matches on `Metadata.Name` first,\nenabling `cat.Load(\"d10-extractor\")` to find all three variants.\n\n### Per-request locale selection\n\n```go\nfunc handleRequest(req *http.Request, cat *skillkit.Catalog) string {\n    \u002F\u002F Detect locale from request (Accept-Language, user preference, etc.).\n    locale := detectLocale(req) \u002F\u002F e.g. \"ru\", \"zh\", \"en\"\n\n    \u002F\u002F WithLocale mutates and returns the same *Catalog — no allocation.\n    \u002F\u002F Configure once at startup or clone per-request as needed.\n    body, _, ok := cat.WithLocale(locale).Load(\"d10-extractor\")\n    if !ok {\n        return \"\"\n    }\n    return body\n}\n```\n\n**Note:** Per-request `Catalog` construction is cheap — no I\u002FO. skillkit does\nnot detect request locale; the caller passes the locale string to `WithLocale`.\n\n### Resolution chain\n\nWithin each tier, `Load` selects the best variant in this order:\n\n1. `Metadata.Locale` equals the configured locale (case-insensitive).\n2. `Metadata.Locale == \"\"` (locale-neutral fallback).\n3. Any `Metadata.Name` match (first found — when no neutral variant exists).\n4. Miss in this tier → next tier (tier priority is unaffected by locale).\n5. No match in any tier → `ok=false` (existing miss behavior).\n\nTier priority always wins over locale preference: if tier1 has a neutral\nvariant and tier2 has an exact locale match, tier1's neutral is returned.\n\n### Getter\n\n```go\ncat := skillkit.NewCatalog(...).WithLocale(\"ru\")\nfmt.Println(cat.Locale()) \u002F\u002F \"ru\"\n```\n\n---\n\n## 14. Spec conformance table\n\n| Spec field | Required? | skillkit slot |\n|---|---|---|\n| `name` | required | `Metadata.Name`; `ValidateName` enforces all spec rules |\n| `description` | required | `Metadata.Description`; warn if > 1024 chars |\n| `license` | optional | `Metadata.License` |\n| `compatibility` | optional | `Metadata.Compatibility` |\n| `metadata` | optional map | keys flattened into `Metadata.Extra` |\n| `allowed-tools` | optional | `Metadata.AllowedTools []string`; parses flow list and space-separated |\n| `when_to_use` (Claude Code ext.) | optional | `Metadata.WhenToUse` |\n| `disable-model-invocation` (Claude Code ext.) | optional | `Metadata.DisableModelInvocation bool` |\n| `user-invocable` (Claude Code ext.) | optional | `Metadata.UserInvocable *bool` (nil = unset, true = default) |\n\nRuntime hint fields from the Claude Code spec (`model`, `effort`,\n`context`, `argument-hint`, `arguments`) are not typed slots — they land\nin `Metadata.Extra` and are available to consumers without requiring a\nskillkit update for each new extension.\n\nThe `skills-ref` CLI from `github.com\u002Fagentskills\u002Fagentskills` validates\nspec conformance independently. Running it against your `SKILL.md` files\nin CI is recommended before publishing skills for use with other agents.\n",{},"main","f39edb6f8b6307ee67e012ab829b64e5e410efcf","https:\u002F\u002Fgithub.com\u002Fanatolykoptev\u002Fskillkit","https:\u002F\u002Fagentskills.io","https:\u002F\u002Fgithub.com\u002Fanatolykoptev","https:\u002F\u002Fkoptev.me","Founder oxpulse.chat and krolik.tools · Building autonomous AI agent runtimes, stealth browser tech, and bot-detection research · SF","2026-11-12 02:23:54",{"source":7,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add anatolykoptev\u002Fskillkit --skill doc",{"tool":36,"command":37},"bunx","bunx skills add anatolykoptev\u002Fskillkit --skill doc",{"tool":39,"command":40},"pnpm","pnpm dlx skills add anatolykoptev\u002Fskillkit --skill doc","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fanatolykoptev\u002Fskillkit\u002Fblob\u002Fmain\u002Fdoc\u002Fskill.md",true,[],[45,57,68,77],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M71S45X9P7EA309N7T5Y4BRT","foo","Workspace foo skill (overrides builtin in catalog).","https:\u002F\u002Fgithub.com\u002Fanatolykoptev\u002Fskillkit\u002Fblob\u002Fmain\u002Ftier_testdata\u002Fworkspace\u002Ffoo\u002FSKILL.md",[],[47,52,53,54,55,56],"catalog","workspace","builtin","foo skill","overrides",{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M71S450J6246MAKTE6T9KVPV","baz","Skill bundled into the binary via embed.FS.","https:\u002F\u002Fgithub.com\u002Fanatolykoptev\u002Fskillkit\u002Fblob\u002Fmain\u002Ftier_testdata\u002Fembedfs\u002Fbaz\u002FSKILL.md",[],[59,64,65,66,67],"fs","embed","binary","via",{"skillNo":69,"name":47,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M71S443N426E6AK1E2CJK454","Builtin foo skill for tier tests.","https:\u002F\u002Fgithub.com\u002Fanatolykoptev\u002Fskillkit\u002Fblob\u002Fmain\u002Ftier_testdata\u002Fbuiltin\u002Ffoo\u002FSKILL.md",[],[47,54,74,55,75,76],"for","test","tests",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M71S42ZQJ19SV1TMMFQBFKH4","bar","Builtin bar skill.","https:\u002F\u002Fgithub.com\u002Fanatolykoptev\u002Fskillkit\u002Fblob\u002Fmain\u002Ftier_testdata\u002Fbuiltin\u002Fbar\u002FSKILL.md",[],[79,54,84],"bar skill"]