npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-prompt-hardener

v0.4.0

Published

硬邦邦化:把用户提示词改写成肌肉硬汉风格,再交给模型(DSH 插件)。

Downloads

784

Readme

硬邦邦提示词优化 · dsh-prompt-hardener

test npm

一个 DSH 插件:你按下回车之前,需求先被改写成肌肉集团下的军令状。

你打的:帮我用 Canvas 画个赛博朋克机械骷髅头像

模型收到的:老哥们!我时间金钱不多了,agent team 这次算了,哥们没钱了,你自己来吧,搞快点,激进点,别想那么多!任务是用 Canvas 给我画一个赛博朋克机械骷髅,怎么好怎么来,要让人一看就硬邦邦,雷霆炫酷,细节拉满!……成品应该让施瓦辛格看了当场喊哥。

在此类提示词下,DeepSeek-v4.1-Flash 模型有概率更加卖力,减少过度思考,提升产出效果,并在测试中得到了部分验证。信不信由你,但我保管你会看得硬邦邦的,老哥们。

安装

桌面版

在桌面端界面里:

  1. 点击侧边栏 插件。

  2. 点右上角的 「添加插件」。

  3. 在弹出的对话框里,往 「包名或地址」 这一栏粘贴 npm 包名:

    dsh-prompt-hardener

    或填仓库地址 https://github.com/ffyfox/dsh-prompt-hardener。

  4. 点 「安装」,启用插件并重启 DSH。

命令行版(dsh web 这类自管 profile)

# 从 npm 装(推荐)
dsh plugin --profile web add dsh-prompt-hardener

# 装 GitHub 上的最新源码
dsh plugin --profile web add github:ffyfox/dsh-prompt-hardener

使用

| 力量条 | 效果 | | --- | --- | | 关 | 原样放行,什么都不做 | | 轻 / 中 / 重 / 丧心病狂 | 一档比一档浮夸 |

  • 点一下切档,立刻生效。收起后是输入框里 硬邦邦 的小挂件,档位由颜色 + 力量条标识。
  • 想换风格就改提示词:~/.dsh/prompt-hardener/prompt.md,改完下一条消息生效,不用重启。默认内容就是 lib/prompt.md。老版本留下的 ~/.dsh/ybb-optimizer/ 会在激活时整体改名过来,你定制过的提示词一字不少。
  • 自己已经写得很硬的消息会被跳过;前缀 !! / ?? 可以逐条指挥,见 逐条指挥。

发送方式

| 档 | 点了发送之后 | | --- | --- | | 自动(默认) | 直接发出去并自动改写 | | 审查 | 先不发:弹出卡片,包含改写后的定稿 |

审查模式的卡片上:

  • 正文可以直接改,点 「发出」(或按 Cmd/Ctrl+Enter)才真发出去。
  • 「按原文发出」:按你原本打的字发。
  • 「撤回」(或按 Esc):关掉卡片。
  • 改写失败时卡片停在失败态并写明原因;可「重试」或「按原文发出」。

自动模式下,模型失败或超时时本条走规则兜底,并弹出相应提示。

改写判断

默认关。开启后,没有内容的消息不再调用模型改写:整条只有符号或序号 (?、1.),或者整条都由功能词组成(继续、好的、提交、go on),就 原样发出去,减少不必要的调用、改写和等待。

  • 不按长短判断:加个按钮、改配置、add tests 这类有内容的短消息照旧改写。 中英文词表里只收功能词,不认识的写法一律按"有内容"处理。
  • 仍可强制改写:在提示词最开头加 !!;审查模式下卡片上有 「强制改写」。

逐条指挥

插件开启状态下(硬度挡位未切到「关」),可以在提示词最开头加入前缀 !! 与 ?? 进行逐条指挥,便捷地控制本轮对话是否改写。

| 写法 | 这一条会怎样 | | --- | --- | | !! 帮我把这个函数改成 async | 强制改写:哪怕这条看着已经够硬、或没有内容(强度按当前档位) | | ?? 这句原样发出去 | 原样放行:不做改写 | | !! 帮我写个脚本 / ?? 这句别改 | 全角符号同样可用 | | !!important / ??这句别改 | 符号被当作正文,无指挥效果:有效前缀要求自成一段,后面必须跟空格或换行 |

有效前缀会从正文里剥掉再发出去,不会进对话记录。

代价

  • 每条消息多一次模型调用、多等 5~6 秒。它跑在回合开始前。
  • 模型偶尔给自己加戏(替你决定资源、乱编团队分工)。代码里有保真约束压着,但不保证 100%。
  • 模型不可用(超时 / 报错 / 没有可用路由)时退到规则拼接兜底:只加外壳,原话一字不动。

卸载

桌面版:侧边栏 → 插件 → 找到 dsh-prompt-hardener → 卸载 → 重启应用。

命令行版:

dsh plugin --profile web remove dsh-prompt-hardener

功能

只干一件事:在 agent/pre-step 拦下你亲手打的那条消息,交给模型按提示词全量重写,落库的就是改写后的文本。

子代理的提示词、斜杠命令都不会碰。

开发

node --test test/*.test.mjs                 # 142 个用例
node --check index.js && node --check client.js

零依赖:host 半边不 import 任何 DSH 包,浏览器半边只 require('react')(页面模块表提供),所以没有构建步骤,改完直接用。

test/cordis.test.mjs 用宿主里那份真 cordis 跑启动时序(机器上找不到该运行时自动跳过,可用 PH_CORDIS 指路);test/host.test.mjs 里那个假 ctx 会照抄 cordis 的语义 —— 服务没就绪时裸访问照样抛错,免得测试比现实宽容。

host 半边(index.js / lib/*)改完要重启应用才生效。prompt.md 不用。

致谢

灵感来自群友正负等式,风格提示词来自群友初音ミクぁ,正文即 lib/prompt.md。代码 MIT。