Files
deepseek-harness/website/zh-CN/api/harness/skills.md
lintianle 2cde2a9032 Merge origin/master into feat/website-docs
Conflict resolution notes:
- package.json/run-gates: both sides' new doc-sync gates kept (master's
  scoped-events/readme gates + this branch's website-api/website-yaml);
  js-yaml devDeps deduped (master added them independently).
- pnpm-workspace/knip: website AND python/sdk-runtime entries kept.
- doc-typecheck/verify-type-equiv: master's condensed headers kept, website
  glob retained in both scan scopes.
- vendor/cordis/src/fiber.ts: master's lifecycle-hardening code taken; this
  branch's richer FiberState JSDoc reapplied on top. vendor/README.md logs
  both local modifications (hardening = 6, JSDoc enrichment = 7).
- pnpm-lock: regenerated from master's side (pnpm install).

Post-merge sync the gates forced (the system working as designed):
- verify-website-yaml caught 4 stale plugin names from master's package
  reorg (dsh-stdio-agent -> dsh-stdio-demo, dsh-acp-agent -> dsh-acp-demo);
  8 references fixed across guide/ and develop/.
- gen-website-api picked up master's 6 new services automatically
  (ctx.approval/permission/sandbox/sessionQuery/skills/tasks -> 6 new pages
  + sidebar); api/index.md hub updated to list them.
- AGENTS.md budget ceiling 1370 -> 1400: the website rows (layout line + two
  command lines) and master's own growth collided with the old ceiling; all
  three website rows are load-bearing (new top-level dir, new CI command).
2026-07-16 21:36:43 +08:00

3.0 KiB

ctx.skills

SkillService — provided by @deepseek-ai/dsh-skill.

Registry of skill providers. It merges provider catalogs with stable first-wins duplicate handling, exposes sorted model-visible summaries, and loads full skill bodies on demand.

Source

ctx.skills.registerProvider(provider)

registerProvider(provider: SkillProvider): () => void

Register a borrowed same-process provider synchronously during plugin apply. Duplicate and reserved names throw; remote initialization belongs in list(). Fiber disposal unregisters the provider and invalidates catalog caches.

  • provider — the provider to register by provider.name.

Returns the exact Cordis effect disposer that unregisters this provider; composite effects may yield it directly to preserve teardown ordering.

Source

ctx.skills.register(skill)

register(skill: SkillRegistration): () => void

Register a borrowed readonly runtime skill. Project entries outrank runtime entries, which outrank user entries. Same-name runtime entries are first-wins; a duplicate logs a warning and receives a no-op disposer so it cannot remove the winner.

  • skill — the complete skill definition to expose for discovery.

Returns the exact Cordis effect disposer, preserving composite teardown order and invalidating caches.

Source

ctx.skills.list(options?)

async list(options: SkillLookupOptions = {}): Promise<SkillSummary[]>

List model-invocable skill summaries for a workspace. Lookup options and provider candidates are readonly same-process values borrowed throughout discovery.

  • options — lookup options; cwd selects project roots and signal cancels discovery.

Returns sorted summaries, excluding skills disabled for model invocation.

Source

ctx.skills.get(name, options?)

async get(name: string, options: SkillLookupOptions = {}): Promise<SkillDefinition | undefined>

Load and validate the winning candidate, passing its opaque discovery locator back to the provider. Cancellation is rechecked after selection, including cache hits, and raced against loading so an uncooperative provider cannot hang the caller.

  • name — kebab-case skill name.
  • options — lookup options; cwd selects workspace-sensitive skills and signal cancels work.

Returns the full skill, including body content, or undefined.

Source