hj01857655/dsh-plugins--packages-dsh-prompt-vcs ↗★ 0
dsh-prompt-vcs
记录Agent系统提示词的每次修改,支持版本对比与撤销 适合需要对Agent提示词进行版本控制、防止配置丢失的开发者。
同名套件的其他儲存庫
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hj01857655/dsh-plugins#5a7f8533f4dcd4f85ec3ebd7e9fa0a071445bf65&path:packages/dsh-prompt-vcs說明文件
閱讀完整 README ↗dsh-prompt-vcs
Every change to your agent's instructions is recorded with a diff, and any change can be undone.
Install
dsh plugin --profile web add dsh-prompt-vcs
Or from source:
dsh plugin --profile web add github:hj01857655/dsh-prompt-vcs
What it does
- Watch the instruction surface.
AGENTS.md,CLAUDE.md, skill files — any file that shapes how the agent behaves. - Snapshot on change. Unified diff + attribution (user / plugin / agent) stored in
.promptvcs/history.jsonl(append-only). - Timeline.
promptvcs logshows every change: when, what file, who changed it, how many lines were added or removed. - Diff.
promptvcs diffshows the unified diff for a specific change — additions, deletions, and context lines. - Rollback.
promptvcs rollbackrestores a file to its state before a change. The rollback itself is recorded as a new change, so the timeline stays complete. - File stats. Per-file change frequency and size of changes over time.
- Panel. Timeline with inline diffs, per-file stats, and rollback button.
CLI
dsh-prompt-vcs log # show change history
dsh-prompt-vcs diff # show diff for a change
dsh-prompt-vcs rollback # undo a change
Panel
A Prompt VCS page inside Settings. The host registers GET /api/prompt-vcs.panel and
rebuilds the payload from the history log on every request. A headless host simply skips
the route.
The panel shows:
- Change timeline with inline unified diffs
- Per-file change frequency
- Attribution per change (user / plugin / agent)
- Rollback action per change
Layout
| Path | Role |
|---|---|
src/index.ts | Host half — apply(ctx), exposes the promptVcs service |
src/vcs.ts | Core VCS logic — record, timeline, rollback, file stats |
src/diff.ts | Unified diff algorithm |
src/store.ts | Append-only .promptvcs/history.jsonl |
src/cli.ts / src/bin.ts | Command-line entry, usable without dsh |
src/routes.ts | Panel and rollback routes on the host's web connection |
src/client/view.tsx | Browser half — pure rendering |
src/client/index.tsx | Browser half — fetch and settings registration |
src/client/locales.ts | zh / en dictionaries |
Develop
npm ci
npm run typecheck
npm run build
npm test
License
MIT