Claude Code style /init command and tool that writes a minimal CLAUDE.md and symlinks AGENTS.md to it.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-init
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:evanfang0054/dsh-init
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
给 DeepSeek Harness(DSH) 加上 Claude Code 风格的 /init 命令的官方机制插件(profile bundle)。
安装后,对 agent 说 /init 即可通过「访谈 → 侦查代码库 → 补缺口 → 写文件」的工作流生成:
CLAUDE.md— 极简的项目级 agent 指引(含 Claude Code 标准文件头);AGENTS.md— 不生成第二份内容,而是创建一条指向CLAUDE.md的相对软链接,让读 AGENTS.md 的工具(含 DSH 自身、Cursor、Codex 等)和读 CLAUDE.md 的工具共享同一份事实来源。
设计
Claude Code 的 /init 没有一行"生成逻辑"——它是 type: 'prompt' 的内置命令,getPromptForCommand() 只返回一段静态工作流提示词,其余全部由模型用普通工具(读写文件、提问、子代理)完成。本插件沿用完全相同的架构:
- 插件只注册一个名为
init的模型 Tool(经ctx.tools.register挂入工具注册表); - Tool
execute()零参数、零业务逻辑,返回工作流提示词; - 提示词改编自 Claude Code
NEW_INIT八阶段流程(逆向自 claude-code-map 的src/commands/init.ts),按 DSH 能力裁剪为七阶段,并新增 Phase 5: AGENTS.md 软链。
工作流七阶段
| 阶段 | 内容 |
|---|---|
| 1 访谈 | 问范围:项目 CLAUDE.md / 个人 CLAUDE.local.md / 两者 |
| 2 侦查 | 读 manifest、README、CI、已有的 CLAUDE.md / AGENTS.md / .cursor rules 等 |
| 3 补缺口 | 只问代码答不了的问题,不标"推荐" |
| 4 写 CLAUDE.md | 每行过"删掉会导致 agent 犯错吗"测试;已有文件走 diff 不覆盖 |
| 5 软链 AGENTS.md | ln -s CLAUDE.md AGENTS.md;已存在常规文件时先 diff、经确认再替换,绝不静默删内容 |
| 6 CLAUDE.local.md | 可选个人偏好文件 + 自动加 .gitignore |
| 7 总结 | 回顾产物,提醒可随时重跑 |
安装
本包是一个标准的 DSH profile bundle(package.json 声明 dsh.bundle.patch,与官方 @deepseek-ai/dsh-base、社区 dsh-context 等插件同一机制)。用 DSH 自带的 dsh plugin 命令安装(内部转发 pnpm,并把本包加入 profile 的 bundle 层):
# 方式一:从 npm 安装(推荐)
dsh plugin --profile web add dsh-init
# 方式二:从 GitHub 安装
dsh plugin --profile web add github:evanfang0054/dsh-init
# 方式三:从本地仓库安装(web profile;GUI 部署的默认 profile)
dsh plugin --profile web add /path/to/dsh-init
然后重启 DSH(bundle 层在进程启动时加载)。
验证安装成功:
cat ~/.dsh/profiles/web/package.json | grep dsh-init
# "dsh.profile.bundles" 数组里出现 "dsh-init" 即已挂载
卸载:
dsh plugin --profile web remove dsh-init
从本地路径安装时,pnpm 会自动以 link(软链) 方式挂入——仓库里改完代码,重启 DSH 即生效,无需重新 add。
安装机制说明
dsh plugin add= 在~/.dsh/profiles/<profile>/里跑pnpm add <spec>,然后根据安装结果把声明了dsh.bundle的包写进该 profile 清单的dsh.profile.bundles层栈;- 启动时各 bundle 的
cordis.patch.yml按层栈顺序应用(本包只插入一行- id: dsh-init / name: dsh-init),后写的层覆盖同 id 行; - 本包零依赖:工具定义以规范化形态直接注册,不需要
@deepseek-ai/dsh-tools。
使用
安装并重启后,插件向会话注册两个面(同一套工作流):
- 斜杠命令
/init:输入/即可在补全列表看到init(Claude Code 同款体验)。选中回车后,工作流提示词作为你的下一个用户回合注入,agent 立即开始访谈与生成。/init <附加要求>可附带补充说明。 - 模型工具
init:直接用自然语言说"初始化这个项目",agent 调用工具拿到工作流提示词开始执行。
注意事项
- 软链与 git:git 原生保存 symlink(模式 120000),clone 后链接保持。Windows 需开启开发者模式并设置
git config core.symlinks true。 - 已有 AGENTS.md:工作流绝不静默覆盖——会先 diff,再经用户确认,可选备份为
AGENTS.md.bak。 - CLAUDE.md 变更:因为 AGENTS.md 是软链,改 CLAUDE.md 即同时生效于两边,永远不需要改两份。
- 更新插件:本地路径安装是软链,改完仓库代码重启 DSH 即生效;GitHub/npm 安装则重新执行一次
dsh plugin add <spec>更新到新版本。
发布新版本(GitHub Actions 自动化)
发布由 GitHub Actions 全自动完成(与 dsh-mermaid-zoom 同一套模式):推送 v* tag 触发流水线——语法检查 → 插件加载冒烟测试 → npm publish(token 取自仓库 secret NPM_TOKEN)。也支持在 Actions 页面手动触发(workflow_dispatch)。
npm run release # = npm version patch(bump + commit + tag)+ git push --follow-tags
推完 tag 后 CI 自动发布到 npm,进度见仓库 Actions 页。
前置配置(仓库维护者):
gh secret set NPM_TOKEN --body <npm token>,token 与~/.npmrc无关,仅存于 GitHub 仓库 secret。
License
MIT
Links
More in this category
loopx-project/loopx#dsh-loopx-plugin★ 6790
LoopX, a provider-neutral, local-first state kernel and control plane for long-horizon agents: keeps Goal, Todo, gate, evidence, quota, recovery, and handoff state above DeepSeek Harness, while the plugin bootstraps the CLI and skills, admits bounded same-session continuation, and adds a loopback GoalBar for the exact bound loop. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Q00/ouroboros#integrations/dsh-plugin★ 6408
Config-only bundle that mounts Ouroboros through the DSH MCP client, exposing 36 interview, Seed, execution, evaluation, and evolution workflow tools in DSH.
chuspeeism/dashi-taskboard#deepseek-harness★ 3568
Embeds the active installed Codex Taskboard runtime in the DeepSeek Harness sidebar, using its launcher runtime descriptor instead of a fixed port.
NanmiCoder/dsh-agent-teams★ 3184
AgentTeams multi-agent teams.
EthanYoQ/AI-Novel-Writer#dsh-ai-novel-writer★ 3038
Installs a dedicated AI novel-writing preset and workbench: revisioned local project assets, a compact side drawer, and native approval-gated single-file changes.
shanliuling/dsh-image-gen★ 1951
Native conversational image generation for DeepSeek Harness: ask the agent to create an image, and it handles generation and keeps the result directly in the conversation.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.