rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:kysr04/dsh-pitfall-memory
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DSH 的错题本 — 让 DSH 记住自己犯过的错,下次同类任务不再犯。
A local, zero-dependency "mistake ledger" skill for DeepSeek Harness. Errors get structured into Markdown entries (symptom / cause / fix / detection signal), then retrieved before similar tasks so the same mistake doesn't happen twice.
What you get. A ledger of mistakes the agent has already made — one Markdown file per mistake, holding the thing that makes it recognisable next time (the detection signal) and the command that gets you off it. Before a task in a known-tricky area the agent reads the index and pulls the entries that match.
Install.
# Windows
git clone https://github.com/kysr04/dsh-pitfall-memory "$env:USERPROFILE\.dsh\skills\dsh-pitfall-memory"
# macOS / Linux
git clone https://github.com/kysr04/dsh-pitfall-memory ~/.dsh/skills/dsh-pitfall-memory
DSH discovers <skills-root>/<name>/SKILL.md through its own watcher — no restart, no build, no npm. Type / in a session and dsh-pitfall-memory should be listed.
How you know it works. Correct the agent once, then say 记住这个坑. A file appears under ~/.dsh/pitfall-memory/entries/, index.md gains a line, and scripts/pitfall.ps1 search <keyword> finds it again.
What this does not do.
SKILL.md is in Chinese. The ledger format, the three rules and the entry template are language-neutral, but the instructions you would hand the agent are not English yet.scripts/pitfall.ps1 is a Windows shortcut; elsewhere, follow the same steps by hand with read / write / grep. The procedure is written out in SKILL.md.scripts/restart-dsh.ps1 and scripts/meow-memory-setup.ps1 are the author's own machine helpers, kept for transparency. You do not need them.Contributing a pitfall. Open Submit a pitfall and fill two fields — the detection signal and the fix. You do not need to know the file format.
Agent 会在不同会话里反复犯同一个错:
你每次纠正它,它当下修好了 —— 但会话一结束,教训就蒸发了。下次从零开始。
这个技能做一件事:把每次踩的坑变成一条可检索、带"检测信号"的记录,下次开工前先查一遍。
推荐:直接 clone 到 DSH 的技能目录。
# Windows
git clone https://github.com/kysr04/dsh-pitfall-memory "$env:USERPROFILE\.dsh\skills\dsh-pitfall-memory"
# macOS / Linux
git clone https://github.com/kysr04/dsh-pitfall-memory ~/.dsh/skills/dsh-pitfall-memory
已经有一份本地副本的话,复制也行:
Copy-Item -Recurse . "$env:USERPROFILE\.dsh\skills\dsh-pitfall-memory"
放好之后应该是这样:
~/.dsh/skills/dsh-pitfall-memory/
├── SKILL.md
├── README.md
├── LICENSE
└── scripts/
├── pitfall.ps1
├── meow-memory-setup.ps1
└── restart-dsh.ps1
⚠️ 层级只能是一层。
.../dsh-pitfall-memory/dsh-pitfall-memory/SKILL.md不会被识别。 ⚠️ 文件名严格是SKILL.md,大小写敏感。 ✅ 不用重启 DSH,文件落地后下一个模型步骤技能目录就刷新。
验证:在对话里输入 /,能看到 dsh-pitfall-memory 就成了。
| 你说 | 它做什么 |
|---|---|
| 「记住这个坑」 | 建条目:现象 / 根因 / 正确做法 / 检测信号 → 重建索引 |
| 「上次那个错又犯了」 | 查库找到那条,hits + 1 |
| 「错题本现在有啥」 | 列出全部条目 + 高频统计 |
平时什么都不用说。同类任务开工前它会翻一遍索引,报错时把命中的 high 条目当硬约束写进计划。
这里有个前提要说清楚:DSH 的 skill 是被动加载的(官方文档的说法是 "skill 是可选的指令而非会话事件"),模型得决定调用它。所以"开工前自动检索"这句,在不装行级注入插件的情况下是半自动——模型自己想起来、或你顺口提一句"查下坑库"。装了 meow-memory 那种每条消息注入的插件之后,才是真的每次自动。
$s = "$env:USERPROFILE\.dsh\skills\dsh-pitfall-memory\scripts\pitfall.ps1"
& $s list # 全部条目
& $s stats # 高频坑(hits>=2)+ 该退役的僵尸条目
& $s search "pwsh,乱码" # 模拟下次会怎么查
& $s show P-0001 # 看某条全文
& $s new -Title "..." -Tags "a,b" -Tools "pwsh" -Severity high -Signature "..."
& $s bump P-0001 # 命中 +1
& $s index # 手动改文件后重建索引
& $s retire P-0001 # 标记退役
坑库就是普通 Markdown,在 %USERPROFILE%\.dsh\pitfall-memory\entries\。想直接改也行,改完跑一次 index。
---
id: P-0007
title: pwsh 直接 Get-Content 读 UTF-8 中文文件输出乱码
tags: [pwsh, encoding, utf8]
tools: [pwsh]
severity: high
signature: 输出里出现 閿欒 / 锛? / 鈥 这类连续乱码字符
created: 2026-11-14
hits: 1
last_hit: 2026-11-14
status: active
---
## 现象
## 根因
## 正确做法 ← 必须是可复制的命令或明确分支
## 错误做法(别再这么干)
## 检测信号 ← 下次怎么 3 秒认出又在踩它
没有它,下次认不出来,等于没记。
| 好的写法 | 差的写法 |
|---|---|
输出出现 閿欒 / 锛? 这类连续乱码 |
可能出错 |
报错含 provider ... is not registered |
注意网络 |
重启日志停在 kill 那几行之后就没后续 |
要注意进程 |
| 级别 | 含义 | 注入时机 |
|---|---|---|
high |
会让任务走错方向、写坏文件、浪费 ≥3 轮 | 任何同类任务开始前必须注入 |
medium |
浪费 1~2 轮 | 命中关键词时注入 |
low |
体验问题 | 只在显式检索时出现 |
## 正确做法 必须是能直接复制的命令hits + 1 — 第二次踩中说明它没被检索到,该修的是关键词,不是再加一条第 4、5 条是刻意设计的:自动往记忆里塞东西,比不记更烦人。
坑库是个位数到几十条量级。关键词加权(tools 命中 +3 / tags 命中 +3 / title 命中 +2 / 正文命中 +1 / high +5)比 embedding 更可控 —— 你能一眼看出为什么这条被召回、为什么那条没被召回。
条目过百再考虑语义检索。
还装了 meow-memory(七层 SQLite 长期记忆,有 lesson 层)的话,可以双写:坑库存细节,记忆库存索引,每条消息自动注入 top-2。
不是必须的。 不装插件,错题本本身照样完整可用。
$m = "$env:USERPROFILE\.dsh\skills\dsh-pitfall-memory\scripts\meow-memory-setup.ps1"
& $m status # 检查状态
& $m rollback # 卸载(自动备份配置)
手工装法(desktop profile 被 Electron 独占,dsh plugin 命令改不了它):
pnpm install --ignore-scripts && node build.mjs,产出 lib/~/.dsh/profiles/desktop/node_modules/meow-memory → junction 指向源码目录package.json 的 dependencies 与 dsh.profile.bundles 各加一项cordis.patch.yml 末尾加 config 段 — 只写 - id: meow-memory + config,绝不能写 name:,否则会插出第二个实例按顺序核对:
SKILL.md — 大小写敏感name 不是 kebab-case — 必须是 ^[a-z0-9]+(-[a-z0-9]+)*$maybe)— 整个技能会被丢弃且不报错改完在对话里输入 / 看有没有。
还是不行?开个 issue,表单里那几栏正好是我要排查的东西。
不用懂格式。走 Submit a pitfall,只填两栏:检测信号和正确做法。整理进库是我的事。
会写文件的话直接提 PR:entries/P-XXXX-<ascii-slug>.md + index.md 加一行,模板见 PR 模板。
Remove-Item "$env:USERPROFILE\.dsh\skills\dsh-pitfall-memory" -Recurse -Force
Remove-Item "$env:USERPROFILE\.dsh\pitfall-memory" -Recurse -Force # 坑库,可选
坑库是独立目录,留着的话重装技能能直接接着用。
SKILL.md 里的步骤用 read/write/grep 手工执行,pitfall.ps1 用不了<skills>/<name>/SKILL.md 即可)MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。