nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:kingchen95272025/dsh-cursor-rules
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Brings the three asset types Cursor keeps under
.cursorinto DeepSeek Harness: rules (.cursor/rules/**/*.mdc), skills (.cursor/skills/*/SKILL.md), and MCP servers (.cursor/mcp.json) — plus a Cursor rules panel in the Web GUI.
~/.cursor) that already carry rules, skills, and MCP
configuration work as-is; you do not paste them into prompts or declare the servers again.name and description are listed once in the context catalog; the
body is fetched with the cursor_skill tool only when the agent needs it..cursor/mcp.json become DSH MCP clients, and every one
of them is off by default — a process starts only after you flip its switch.| Type | Frontmatter | When it enters the agent context |
|---|---|---|
| Always | alwaysApply: true |
Injected in full at the start of a session |
| Auto Attached | alwaysApply: false + globs: [...] |
Added when a file the agent has touched matches one of the globs |
| Agent Requested | alwaysApply: false + description |
Listed in the on-demand catalog; the agent reads the file when it judges it relevant |
| Manual | neither key | Listed in the on-demand catalog only |
Other conventions:
~/.dsh/rules/** and ~/.cursor/rules/** by default, in the order given by userRuleDirs), then .cursor/rules/** from the project root down to the session's working directory. Inside the project layers a more specific copy wins for the same id.A user-level rule's id is
~/<path relative to the home directory>, so the directory name is part of the id:~/.dsh/rules/x.mdcand~/.cursor/rules/x.mdcare two independent rules, both injected.userRuleDirsonly sets the scan order; directories never override each other.
globs accepts a YAML block list, an inline array, or Cursor's comma-separated string; alwaysApply accepts a boolean or "true" / "false".maxBytes (131072 bytes by default). Rules over budget are omitted, and the injected text names what was skipped.</system-reminder> inside a rule body is escaped, so repository content cannot break out of the plugin's own <system-reminder> frame..cursor/skills)A Cursor skill is a directory:
.cursor/skills/<skill-name>/
SKILL.md # frontmatter: name / description (optionally license)
notes.md # extra files, referable by relative path from the body
phases/…
How this plugin handles them:
SKILL.md are registered. A missing name falls back to the directory
name; a missing description still shows up, just with a shorter catalog line.- <name> — <description> lines in the
same <system-reminder> block as the rules, together with an instruction to call cursor_skill first when a
task matches one of them.cursor_skill({ name }) does the plugin read
SKILL.md and return the body (frontmatter stripped) plus the list of companion files.~/.cursor/skills comes first, then .cursor/skills from the project root down to
the working directory; a project-level skill overrides a user-level one with the same name.~/.dsh/skills is intentionally not scanned — that is DSH's own user skill location, and scanning it would
register the same skill twice..cursor/mcp.json)Cursor's MCP configuration looks like this:
{
// comments and trailing commas are allowed; this plugin parses JSONC
"mcpServers": {
"mysql": { "command": "npx", "args": ["-y", "mysql-mcp"], "env": { "MYSQL_URL": "…" } },
"api-docs": { "url": "https://example.com/mcp", "headers": { "Authorization": "Bearer …" } }
}
}
url means streamable-http; anything else is stdio (command + args + env, plus
an optional cwd).@deepseek-ai/dsh-mcp-client instances, so installing the plugin never spawns a pile of npx / uvx
processes.serverName only accepts [A-Za-z0-9_-]{1,32} while Cursor allows any
name. Names are normalised to cursor_<slug> (the original name is still shown), and collisions get _2, _3.env and headers key names, never their
values; values are used solely to start the child process.idle / connecting / ready / failed, with the failure reason.From the DSH plugin market, search for Cursor rules and install the bundle.
From this repository:
dsh plugin add github:kingchen95272025/dsh-cursor-rules # add --profile <name> for a non-default profile
The package is a bundle: package.json declares dsh.bundle.patch, and cordis.patch.yml inserts the
dsh-cursor-rules row. The host half is the package main entry; the dsh.client declaration makes the
web app load ./client for the browser half. No build step, no install script.
Migrating from an older manual install? Remove the hand-written
cursor-rulesrow from the profile'scordis.patch.ymland the copied directory under<profileDir>/node_modules/first, otherwise the rules are registered twice.
The row's config (every key is optional):
- insert:
- id: dsh-cursor-rules
name: dsh-cursor-rules
config:
enabled: true # master switch; false registers nothing
includeUserRules: true # load user-level directories (rules and skills)
userRuleDirs: # scanned in this order
- ~/.dsh/rules # DSH's own global rules
- ~/.cursor/rules # Cursor-compatible location
maxBytes: 131072 # per-injection byte budget
trackTouches: true # auto-attach glob rules on file touches
projectRootMarkers: # markers used to find the project root
- .git
httpPath: /cursor-rules # HTTP prefix used by the panel
stateFile: cursor-rules.json # switch state file under $DSH_HOME
enableSkills: true # scan .cursor/skills
userSkillDirs: # user-level skill directories
- ~/.cursor/skills
skillCatalogBytes: 8192 # byte budget for the skill catalog
enableMcp: true # parse .cursor/mcp.json and allow mounting servers
userMcpFiles: # user-level MCP configuration
- ~/.cursor/mcp.json
mcpStartupTimeoutMs: 30000 # startup timeout per MCP server
In DSH patch semantics
configreplaces the whole object instead of deep-merging: an override must restate every key it wants to keep.
Switch state lives in $DSH_HOME/cursor-rules.json (v2):
{
"version": 2,
"disabled": [".cursor/rules/global.mdc"],
"skillsDisabled": ["skill:project:prd-skill"],
"mcpEnabled": ["mcp:project:mysql"]
}
mcpEnabled is a whitelist: an empty array connects no MCP server at all. A v1 file (only disabled) is read
without migration.
sidebar.panellist row addressing the main seat; the page has three tabs:
Rules / MCP / Skills.env / header key names, runtime status, and switch.SKILL.md body
the same way.agent/pre-step (waterfall)
└─ next() returns this turn's entering batch decision
├─ collectRules(cwd) # discover and parse user + project .mdc files
├─ selectRules(rules, touched) # always / auto attached / on-demand catalog
├─ planInjection(previous) # diff against the last delivered state
├─ collectSkills(cwd) + planSkillCatalog(previous.skillDigest)
└─ merge both texts into one createUserMessage(...) after the last claimed message
cwd change / MCP switch toggled
└─ scheduleMcp(cwd) runs serially → ctx.plugin(McpClient, config), adding and removing instances
Injected messages carry the plugin's own kind: 'cursor-rules' source plus entries (every id with its
fingerprint), a catalogDigest, and a skillDigest, so that:
pre-step runs in one turn are suppressed by in-memory state.npm test # rules data layer + host wiring + client wiring (see below)
npm run test:rules # data layer only: frontmatter, glob, discovery, selection, injection, JSONC, MCP, skill catalog, switches
npm run test:host # host wiring only: routes, cursor_skill tool, state file, MCP mount, injection timing
npm run test:client # client wiring only: slot registration, three tabs, rendering, expand, switch callbacks
The test builds its own .cursor fixture (rules, skills, and MCP) in the system temp directory, so it passes on
any machine.
Host half, against a running profile:
curl -s "http://127.0.0.1:<port>/cursor-rules/rules?sessionId=<sessionId>" | head -c 400 # rules
curl -s "http://127.0.0.1:<port>/cursor-rules/mcp?sessionId=<sessionId>" | head -c 400 # MCP
curl -s "http://127.0.0.1:<port>/cursor-rules/skill?id=skill:project:prd-skill" | head -c 400
The version field in the response is the plugin code version — use it to tell which build the running
process loaded. These routes answer 200 on 2.0.0.
dsh web prints its URL on start (default port 19387); the desktop app picks another port.
Browser half — the desktop GUI is served from the custom protocol dsh-app://app, and
curl http://127.0.0.1:<port>/ answers 401 dsh web authentication required, so a plain curl cannot tell
whether the browser half loaded. Check the slots in Settings → Plugin Manager, or read the live slot tree
where the platform exposes one (cordis_inspect_query with provider: "Slots", method: "listSubTree"):
input={"root": "settings.section"} # expect {"id":"cursor-rules","order":30,"active":true}
input={"root": "sidebar.panellist"} # expect {"id":"cursor-rules","order":30,"active":true}
input={"root": "main"} # expect a "cursor-rules" key registered
Registration uses ctx.inject(['webServer'], …) rather than a one-shot ctx.get('webServer'): on a cold
start apply can run before webServer is ready, and the one-shot form silently skipped route
registration, which showed up as a 404 after a restart. Keep that form if you change the code.
file_path of read / write / edit plus the displayPath of fs/observed.
Side effects of arbitrary shell commands are not parsed — the same trade-off dsh-agent-instructions makes.name and description go into the context. A skill whose body
starts with hard constraints is invisible until the agent calls cursor_skill — the price of keeping long
skills out of the standing context..cursor/mcp.json (as in Cursor) and are never logged or
returned by the panel routes.serverName is ASCII-only, so a non-ASCII Cursor name appears as
cursor_<slug> on the DSH side; colliding slugs get a numeric suffix while the panel keeps the original name.dsh web token, but this
plugin registers a named prefix route on webServer, which is matched before the token gate, so any local
process can read it. The exposure is kept minimal: the endpoint only reads rules, skills, and MCP
configuration under .cursor, never arbitrary paths, and never returns credential values; webServer binds
127.0.0.1 by default. Set config.enabled to false or remove the bundle to close it entirely.dsh-base sets hmr.root to []: the profile watches
cordis.patch.yml and package.json, not plugin modules, and the default ignored list contains
**/node_modules. So changing patch or config remounts automatically, while changing *`lib/.js** needs a DSH restart (Node's ESM cache would otherwise reuse the old module instance). Theversion` field
is how you confirm which build is live.| File | Responsibility |
|---|---|
lib/rules.js |
Asset engine (pure logic, no dependencies): frontmatter parsing, JSONC parsing, glob compilation and matching, rule/skill/MCP discovery, four-type selection, incremental injection planning, skill catalog planning |
lib/index.js |
Host half (Cordis plugin): merged agent/pre-step injection, the cursor_skill tool, MCP client mounting and status, tools/result and fs/observed touch collection, panel JSON routes on ctx.webServer, switch persistence |
lib/client.js |
Browser half (hand-written, no build): window.__ModuleLoader__.load({ id, factory }), registering the sidebar.panellist row, the matching main page (three tabs), and the settings.section seat |
cordis.patch.yml |
Bundle patch: inserts the dsh-cursor-rules row |
locale/{en,zh}.json |
Plugin Manager title, description, and detail document |
test/smoke.mjs |
Portable smoke test (70 assertions) over a self-built fixture |
test/host.mjs |
Host wiring test: stubs the platform packages, then drives apply() — routes, cursor_skill, toggles, MCP mount, injection |
test/client.mjs |
Client wiring test: a tiny React stand-in renders the real component tree — slots, tabs, expand, switches, dictionary/CSS consistency |
@deepseek-ai/dsh-agent-instructions — a workspace instruction injector; this plugin follows its
conventions (own source, verbatim bodies, escaped frame tags, incremental delivery).@deepseek-ai/dsh-mcp-client and @deepseek-ai/dsh-mcp-manager — the MCP client configuration shape and the
mount → subscribe → dispose lifecycle are modelled on their implementation.@deepseek-ai/dsh-client-ui-skill and @deepseek-ai/dsh-client-ui-cordis — examples of hand-written
client bundles, ctx.slots.inject seat registration, and sidebar panel entries.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: agent、context。