dsh-plugin-dev
Skill2 starsChanged 5 days agoApache-2.0View on GitHub
Develop plugins for DeepSeek Harness (dsh), a Cordis-based agent framework. Use when the user asks to create, modify, debug, or package a dsh plugin; write a tool, service, LLM adapter, or event listener; configure cordis.yml patches; or bundle a plugin for distribution. Also triggers on mentions of Cordis lifecycle, Fiber states, inject, ctx.effect, defineTool, Service subclass, LlmAdapter, Schemastery config, cordis.yml, dsh plugin, or dsh.bundle. Do NOT use for general agent/LLM integration outside dsh.
- Reads credentials
14 other projects use a version of this.
Adopted by
Most recently taken up by
- mahingbun-dev/dsh-plugin-dev-kittheir own version, first seen Nov 1, 2026
- caparisen/dsh-plugin-devtheir own version, first seen Oct 25, 2026
- wula1223/dsh-plugin-devtheir own version, first seen Oct 24, 2026
- Fabian-698/dsh-plugin-devtheir own version, first seen Oct 20, 2026
- birdmanmandbir/skillstheir own version, first seen Oct 9, 2026
- realchendahuang/dsh-skilltheir own version, first seen Oct 5, 2026
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- realchendahuang/dsh-skill★ 24same name
- zimodzh/dsh-plugin-dev-skills★ 14same name
- hackerFish/awesome-dsh-skills★ 4same name
- abab996/dsh-plugin-dev★ 2same name
- wula1223/dsh-plugin-dev★ 2same name
- birdmanmandbir/skills★ 1same name
- BlueChonk/BlueChonk-skills★ 1same name
- Wenaixi/dsh-plugin-dev★ 1same name
- benz-ai-x/dsh-plugin-dev★ 0same name
- caparisen/dsh-plugin-dev★ 0same name
4 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 82
Must export BOTH interface Config AND const Config: Schema<Config>.
- Very specific: line 141
All three share the same service name via inject.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
dsh Plugin Development
Develop plugins for DeepSeek Harness
(dsh), a Cordis-based agent framework. Plugins are TypeScript modules exporting
apply(ctx: Context), composed via cordis.yml.
Quick Reference
Plugin Structure
import type { Context } from '@deepseek-ai/cordis'
export const name = 'my-plugin'
export function apply(ctx: Context) { /* register capabilities */ }Three forms: function (default), object ({ name, inject, apply }), class
(extends Service — use only when providing a service to other plugins).
Dependencies: export const inject = ['tools', 'llm'] — framework keeps
plugin PENDING until all injected services are ready.
Auto-cleanup: Everything registered through ctx is an effect — unload
automatically cleans up. For custom resources (timers, connections), wrap in
ctx.effect(() => { ... return () => cleanup }).
Child plugins: const fiber = ctx.plugin(childPlugin) — children inherit
parent context; await fiber.dispose() unloads recursively.
Fiber States
PENDING → LOADING → ACTIVE → UNLOADING → DISPOSED
↘ FAILEDPENDING → missing service dependency. FAILED → apply threw or config
validation failed. Service disappearing at runtime auto-disposes dependents.
Tools
import { defineTool } from '@deepseek-ai/dsh-tools'
export const inject = ['tools']
export function apply(ctx: Context) {
ctx.tools.register(defineTool({
name: 'greet', description: '...',
parameters: { name: { type: 'string', required: true } },
output: { schema: { type: 'string' }, render: (_args, value) => [{ type: 'text', text: value }] },
async execute(args) { return `Hello, ${args.name}!` },
}))
}defineTool converts parameters to JSON Schema, validates args, and auto-unregisters on unload.
See references/basic/tool.md for details.
Configuration
import Schema from '@deepseek-ai/schemastery'
export interface Config { greeting: string; maxRetries: number }
export const Config: Schema<Config> = Schema.object({
greeting: Schema.string().default('Hello'),
maxRetries: Schema.number().default(3),
})
export function apply(ctx: Context, config: Config) { /* validated config */ }Must export BOTH interface Config AND const Config: Schema<Config>.
Invalid config → FAILED state with clear error. Use !!js in YAML for dynamic
values — valid only inside config and an entry's disabled field:
config: { apiKey: !!js process.env.API_KEY }. Mark per-operation fields with
.volatile(): edits update the live reference and emit loader/volatile-update
without remounting the plugin (read via .get(); values are frozen snapshots).
See references/basic/config.md.
Services
Provide: class extends Service { constructor(ctx) { super(ctx, 'name') } }
declare module '@deepseek-ai/cordis' { interface Context { name: NameService } }
Consume: export const inject = ['name'] → ctx.name.method().
Optional: ctx.get('name') → returns undefined when absent.
Service isolation: group: true + isolate: { shell: true } gives each group
its own provider instance. See references/framework/service.md.
Events
| Mode | Call | Use |
emit | ctx.emit(n, ...args) | Sync broadcast, ignore returns |
parallel | await ctx.parallel(n, ...args) | Concurrent listeners |
serial | await ctx.serial(n, ...args) | Sequential, first non-null wins |
bail | ctx.bail(n, ...args) | Sync serial |
waterfall | ctx.waterfall(n, ...args, next) | Middleware chain |
Waterfall listeners must call next() unless intentionally short-circuiting.
Key harness events: agent/pre-step, agent/request, llm/stream,
tools/pre-execute/tools/execute/tools/post-execute, tools/result,
session/event. The first four groups are waterfalls; agent/turn-stopping
is serial. turn/*, step/*, tool/call, tool/result are durable session-event
types, not Cordis events — observe them via session/event.
See references/framework/events.md.
LLM Adapters
class MyAdapter extends LlmAdapter {
async *stream(options: GenerateOptions): AsyncIterable<StreamChunk> {
// Convert → provider API → yield StreamChunk
}
}
ctx.llm.registerAdapter(['my-provider'], adapter)StreamChunk order per block: block-start → text-delta/tool-call-delta →
block-end → usage → finish. Throw LlmError with stable codes.
See references/practice/llm-adapter.md.
Three-Layer Capability Design
Definition (Service abstract class) → Provider (implements) → Consumer (tool)All three share the same service name via inject. Only split into separate
packages when roles need independent evolution.
See references/practice/index.md.
cordis.yml / Bundles
Local dev: --patch ./cordis.patch.yml
- insert:
- id: my-plugin
name: '/absolute/path/to/src/my-plugin.ts'
config: { greeting: 'Hi' }Distribution: npm package with dsh.bundle manifest + cordis.patch.yml
(patch also accepts an ordered file list). Declare supported dsh releases with
engines.dsh SemVer. Install: dsh plugin --profile demo add ./hello-plugin.
Layer order: profile bundles → profile patch → home patch → --patch overlays.
Later layers win by row (no deep merge).
See references/basic/publish.md.
HMR
Load @deepseek-ai/dsh-hmr + @deepseek-ai/cordis-plugin-logger-console
@deepseek-ai/cordis-plugin-timerto auto-reload on file save. HMR logs through the logger service and injectstimerfor debouncing — without the timer it sits in PENDING silently.
Where New Behavior Goes
Attach new behavior to a documented extension point: model providers on
ctx.llm, model-facing tools on ctx.tools, human commands on ctx.commands,
background jobs on ctx.jobs, filesystem providers/policy on ctx.fs, process
confinement on ctx.sandbox; intercept requests/tools/turns via agent/* and
tools/* events; add model-facing context with agent.inject(). Full map:
references/reference/architecture.md.
Diagnosing PENDING
import { FiberState, type Context } from '@deepseek-ai/cordis'
for (const fiber of ctx.registry.values().flatMap(r => r.fibers))
if (fiber.state === FiberState.PENDING)
console.log(`${fiber.name} is PENDING`)Reference Docs
Detailed guides in the references/ directory:
| Path | Covers |
references/basic/ | First plugin, tools, config, publishing |
references/framework/ | Lifecycle, services, events |
references/practice/ | Three-layer design, LLM adapters, prompt-driven plugin config |
references/cordis-tutorial/ | Step-by-step Cordis framework tutorial |
references/reference/ | Architecture map (profiles/bundles, turn flow, extension points), Cordis primer |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

