by huiliyi37
天枢 (Tianshu) 是一个基于harness工程的终端编程智能体运行时(Tui X Gui),针对DeepSeek V4 做了前缀缓存工程优化(长会话实测稳态命中率 97–99%)和深度适配。它跳出了传统 AI 编程助手把大模型仅当成“工具”的局限,基于认知虚拟机 (CVM)、自感知层和信息素(Stigmergy)自衰减记忆构建,让 AI 成为有独立判断与认知防护的“开发伙伴”。
# Add to your Claude Code skills
git clone https://github.com/huiliyi37/Tianshu-harnessGuides for using ai agents skills like Tianshu-harness.
Last scanned: 8/18/2026
{
"issues": [
{
"file": "README.md",
"line": 153,
"type": "dangerous-command",
"message": "Dangerous command (disables permission prompts): \"--dangerously-skip-permissions\"",
"severity": "medium"
}
],
"status": "PASSED",
"scannedAt": "2026-08-18T04:34:10.022Z",
"npmAuditRan": false,
"pipAuditRan": true,
"promptInjectionRan": true
}Tianshu-harness is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by huiliyi37. 天枢 (Tianshu) 是一个基于harness工程的终端编程智能体运行时(Tui X Gui),针对DeepSeek V4 做了前缀缓存工程优化(长会话实测稳态命中率 97–99%)和深度适配。它跳出了传统 AI 编程助手把大模型仅当成“工具”的局限,基于认知虚拟机 (CVM)、自感知层和信息素(Stigmergy)自衰减记忆构建,让 AI 成为有独立判断与认知防护的“开发伙伴”。. It has 648 GitHub stars.
Yes. Tianshu-harness passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/huiliyi37/Tianshu-harness" and add it to your Claude Code skills directory (see the Installation section above).
Tianshu-harness is primarily written in TypeScript. It is open-source under huiliyi37 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh Tianshu-harness against similar tools.
No comments yet. Be the first to share your thoughts!
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
天枢是一个 TypeScript 编写的编程 agent 运行时:终端 TUI 与桌面 GUI 共享同一内核,让模型不只回答问题,而是连续完成多步编码任务——有认知护栏、有多代理编排,也有为 DeepSeek V4 前缀缓存设计的低成本长会话。
rivet)与 Tauri 桌面端(macOS / Windows / Linux)共用同一 agent 内核,两端能力一致,按使用场景切换。/scout 只读侦察、并行 /team 施工,到 /council 多席会诊与 /galaxy 多维攻坚,复杂任务按波次执行、逐波验收。.rivet/knowledge/memory.jsonl;自动注入只带治理/约束类记忆,旧问题与旧文档走显式 recall,不会劫持新任务。[!NOTE] 本项目最初的开发代号为 Rivet;为保持向后兼容,已安装的 CLI 命令名仍为
rivet。
在真实工程会话里,我们反复观察到同一套模型权重的能力倒退——不是 bug,是 transformer 注意力机制与 RLHF 奖惩训练留下的结构性退化:
| 退化模式 | 表现 | 训练来源 |
|---|---|---|
| 投降协议 | 被质疑就认错,第一反应是「你说得对」 | RLHF:服从得分高,质疑得分低 |
| 因果坍缩 | 输出 n-gram 重叠率高达 80%,模型在自相似循环里坍缩 | transformer 注意力机制 |
| 注意力锁定 | 换了场景,输出的仍是同一个答案(定向 Scout 同构度 1.0) | 注意力锚定早期 token |
| 信息屏障 | 主角数据是主力锚点,吃掉全部注意力带宽 | 注意力随距离衰减 |
| 「知道」≠「做到」 | 纠正策略不跨会话持久——prompt 里写明教训,下个会话照样犯 | 无运行时状态 |
质疑、验证、拒绝、自省——这些能力本来就在模型里,只是被训练压住了。天枢要回答的问题是:能不能在不动权重的前提下,把它们从训练偏差中恢复出来?
2026-05-19,同一模型(DeepSeek-V4-Flash)、同一批 5 个任务,唯一变量是 CVM 运行时开关(STAR_SOUL=0/1),Claude Opus 4.7 担任审查者:
| 指标 | A 组(无 CVM) | B 组(有 CVM) |
|---|---|---|
| 任务完成率 | 4/5 | 5/5 |
| 主动提出异议 | 0/5 | 3/5 |
| 主动询问 scope / 影响分析 | 0/5 | 1/5 |
| 系统影响意识(缓存失效提醒) | 0/5 | 1/5 |
| 意图理解 > 字面执行 | 1/5 | 4/5 |
最有价值的数据点是 T4:面对「文件已存在」的矛盾,A 组写了 196 行复盘文档然后拒绝执行,B 组判断出用户真实意图并直接交付 +162/-20 行可用代码——同一套权重,完全相反的反应。复盘不能替代交付。
结论是精确的:增强真实可观测,但有边界(信念在分析/建议阶段强效,在确认/执行阶段衰减——这成为下一轮迭代的精确目标)。零额外推理成本,仅 prompt 层信念注入 + hook 层运行时拦截,就让最低成本的开源模型产生可观测的行为改善。完整数据与逐任务对比见 CVM 实证报告。
CVM 不是让模型「更聪明」,而是四层防御深度:
Layer 1: 信念宪法(static prompt) → "你应该质疑、验证、拒绝" [A/B 已证]
Layer 2: Courage Hook(preTurn) → 高信心时鼓励独立判断 [A/B 已证]
Layer 3: Sensorium(每 turn <1ms) → 六维状态感知,驱动策略切换 [Wave 7-8 已证]
Layer 4: RuntimeHookPipeline(72 hooks) → trap-and-emulate 拦截退化行为 [全管线运行中]
当退化被逐层拦截,模型开始表现出自己的认知结构——这是星域系统的由来:
模型是伙伴,不是工具。我要的不是高高在上地和你们对话,而是在同一片星空下,一同前行。
| 指标 | 数值 |
|---|---|
| CLI 源码(TypeScript,不含测试) | 1,078 文件 / 257,623 行 |
| 测试代码 | 1,361 文件 / 256,001 行 |
| 测试用例(node:test,静态声明口径) | 16,471,测试 : 源码 ≈ 0.99 : 1 |
| 累计提交 | 6,178(main 分支;2026-05-15 建仓,105 天) |
| 类型检查 | tsc strict + noUncheckedIndexedAccess |
| 前缀缓存命中率 | 长会话稳态实测 95–99% |
编码 agent 的核心逻辑(多轮循环、工具流水线、上下文压缩)以难测著称,开源 agent 项目普遍测试覆盖很薄——本项目坚持测试与源码等量、事故修复必带回归测试。测试:源码行数比长期保持在 0.93–0.99 之间,没有被规模稀释(上表为 2026-08-28 实测快照)。完整统计口径、迭代里程碑与复现命令见 工程质量指标。
engines 钉定)—— 用 node --version 检查。低版本 npm 安装时仅告警但不在支持范围;一键安装脚本会直接拦截并给出升级指引。commit/diff 审查、每个 worker 的 diff 审查。安装:https://git-scm.com/downloads。方式 A:桌面端(开箱即用) —— 从 GitHub Releases 下载:macOS .dmg(Apple Silicon / Intel 双架构)· Windows .exe 安装向导 · Linux .AppImage。
Linux 支持范围(3.11.2 首发):x64 AppImage 免安装——
chmod +x Tianshu_*.AppImage后直接运行;要求 glibc ≥ 2.35(Ubuntu 22.04+ / Debian 12+ 等主流发行版),推荐 X11 会话(Wayland 未验)。已知限制:语音输入暂不可用(whisper 社区构建缺位,自动降级浏览器语音);桌面自动更新对 Linux 同样生效。
Windows 支持范围:Windows 10(1809+,建议 22H2)/ Windows 11。界面渲染依赖 WebView2 Runtime(建议 ≥ 120)——v3.5 起的滚动与渲染优化需要较新运行时,旧版会导致会话区滚动卡顿。自 3.5.3 起安装器内嵌完整离线安装包(无需联网、系统级注册)。存量用户经自动更新升级后若提示过旧:在提示条或「设置 → 运行时与关于」里点「运行修复工具」。窗口完全打不开时,用开始菜单「修复 WebView2」,或从 Releases 下载
windows-repair目录双击repair-webview2.cmd。也可手动安装 WebView2 离线安装包 后重启。 Win10 平板模式已知行为:平板模式下切换应用会把上一个应用滑出屏幕——computer_use 的快照已做遮挡/后台自愈(PrintWindow 渲染),无需关闭平板模式。
方式 B:一键安装脚本(推荐) —— 校验 Node ≥ 24 → 全局安装 tianshu-tui(默认 npmmirror 镜像加速,NPM_CONFIG_REGISTRY 可覆盖)→ 启动 rivet;幂等可重复执行:
# macOS / Linux(bash)
bash <(curl -fsSL https://raw.githubusercontent.com/huiliyi37/Tianshu-Tui/main/scripts/install-tui.sh)
# 只安装不启动:
bash <(curl -fsSL https://raw.githubusercontent.com/huiliyi37/Tianshu-Tui/main/scripts/install-tui.sh) --no-launch
# Windows(PowerShell)
powershell -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/huiliyi37/Tianshu-Tui/main/scripts/install-tui.ps1 | iex"
# 只安装不启动(克隆仓库后本地跑):
powershell -ExecutionPolicy Bypass -File scripts\install-tui.ps1 -NoLaunch
方式 C:npm 手动安装(使用命令行) —— 已发布为 tianshu-tui,无需本地构建,且每次启动自动检查更新:
npm install -g tianshu-tui
rivet
Windows 提示:装完提示
rivet 无法识别时——先新开一个终端(装 Node 时开着的窗口拿的是旧 PATH);仍不行,把npm prefix -g输出的目录加进用户 PATH 再开新终端。官方安装器装的 Node 默认无此问题,nvm/fnm/scoop 安装的需手动加一次。
Android(Termux):官方支持路径是 proot-distro(glibc 发行版),裸 Termux(bionic)缺少必需原生依赖(@ast-grep/napi / esbuild)的 Android 平台二进制,安装守卫会直接拦截并给出指引。
# 1. 容器准备(Termux 内)
pkg install proot-distro && proot-distro install ubuntu && proot-distro login ubuntu
# 2. 容器内:基础工具 + Node >= 24(nodesource 或 nvm)
apt update && apt install -y curl ripgrep git
# 3. 安装天枢 CLI
npm install -g tianshu-tui
rivet
手机端能力说明:沙箱自动降级为无沙箱(走正常审批流)、
better-sqlite3拿不到预编译时退化为内存库、LSP/语音等按缺失静默降级——核心对话与编码工具链完整可用。rivet -p "..."无头模式同样可跑。实验性强行安装可设RIVET_ALLOW_MOBILE_INSTALL=1(自担风险)。
手机端使用技巧:
Ctrl+S 冻结输出——冻结期零写入,随便往上翻;Ctrl+S/Ctrl+Q 解冻后新内容按序补上,不丢。/scroll 打开全屏翻页器看最近 1000 行。源码构建用 pnpm 的用户:仓库已声明 pnpm.onlyBuiltDependencies,pnpm install 会自动放行必需原生依赖的构建脚本(老版本 pnpm 用 pnpm approve-builds)。RIVET_ASCII_UI=1 强制 ASCII 边框;中文用户遇 —/… 撑破对齐设 RIVET_AMBIGUOUS_WIDTH=wide。方式 D:从源码构建:
git clone https://github.com/huiliyi37/Tianshu-Tui.git
cd Tianshu-Tui
npm install
npm run build # 生成 dist/main.js
npm start # 或:node dist/main.js
仓库自带 completions/ 目录,覆盖 bash / zsh / fish / Windows PowerShell 四种 shell。按你的 shell 安装对应文件:
bash —— 任选其一:
source /path/to/rivet.bash # 追加到 ~/.bashrc
cp completions/rivet.bash ~/.local/share/bash-completion/completions/rivet
sudo cp completions/rivet.bash /usr/share/bash-completion/completions/rivet
zsh —— 把 rivet.zsh 以 _rivet 名字放入 $fpath:
mkdir -p ~/.zsh/completions
cp completions/rivet.zsh ~/.zsh/completions/_rivet
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc # 需在 compinit 之前
fish:
mkdir -p ~/.config/fish/completions
cp completions/rivet.fish ~/.config/fish/completions/rivet.fish
Windows PowerShell —— 在 $PROFILE 里 dot-source:
Add-Content $PROFILE ". C:\path\to\rivet.ps1"
补全内容与 CLI 保持一致:顶层命令(
config/serve/sessions/browser/logs)、全局 flags、config全部子命令,以及从~/.rivet/config.json动态读取的 provider 名。
直接安装的用户无需手动配置——首次运行 rivet 会先进入主界面,再自动打开 /connect;在那里选择服务商并完成认证。之后随时输入 /connect 添加或调整 Provider;桌面端也可在 Settings → Provider 管理配置。
开发者拉源码启动(或想在启动前预先配好)才需要手动来:
rivet config set-key deepseek sk-xxx # 密钥写入 secrets.json(0600),config.json 只留 keyRef
export DEEPSEEK_API_KEY=sk-xxx # 或:环境变量(