师门 (Shimen) standalone CLI — multi-agent research collaboration. Calls LLM API directly so 严师 (strict-mentor) actually fires every cycle.
Project description
shimen (CLI)
师门 standalone CLI — multi-agent research collaboration that actually calls every agent.
Plugin 版(prose-based)在 opencode / CodeWhale 里有个根本问题:LLM 会偷懒、跳过严师、不真并行调多 agent。这个 CLI 绕开它——orchestrator 是 Python 代码,agent 的调用顺序和并行都写死,LLM 没机会跳过。
安装
pip install shimen
需要 Python 3.10+。
快速开始
两层配置,一次全局 + 每个项目一次:
# === 全局配置 (装完跑一次) ===
shimen setup # 选 provider, 写 ~/.shimen/profile.yaml
export DEEPSEEK_API_KEY=sk-... # 设 API key
shimen check # 烟雾测试 API 通了
# === 项目初始化 (每个论文项目都跑一次) ===
cd ~/papers/my-paper # cd 到你的论文目录
shimen init # 写 ./.shimen/project.yaml
# 问: 标题 / 方向 / 目标期刊 / frozen 词表
# frozen 词表 = paper-polisher 绝不会动的词
# 比如你的专有名词 / 缩写 / 变量符号
# === 跑 ===
shimen auto paper.docx # 端到端 audit → polish, 浏览器自动开
第一次跑 shimen init 时, 如果还没配过全局 provider, 会自动先弹一遍 setup。
Provider 支持
| Provider | 默认模型 | 严师专用 (reasoner) | 成本 ($/M in / out) |
|---|---|---|---|
| deepseek | deepseek-chat | deepseek-reasoner | 0.27 / 1.10 |
| xiaomi-mimo | mimo-chat | — | ~ deepseek |
| openai | gpt-4o-mini | o1-mini | 2.5 / 10 |
所有 provider 都用 OpenAI-compatible API,配 base_url 即可。
命令
| 命令 | 作用 |
|---|---|
shimen setup |
全局配置 provider / API key / 默认期刊。装完跑一次 |
shimen init |
项目初始化, 写 ./.shimen/project.yaml (含 frozen vocabulary) |
shimen check |
烟雾测试 API |
shimen auto-start IDEA |
★ 端到端: ideate → simulate scaffold → draft → audit → polish → typeset |
shimen ideate "想法" |
选题: arXiv+CrossRef 真实扫文献 → 师姐 brainstorm → 严师可行性 → 审稿人 impact。出 topic_proposal.md |
shimen scout "query" |
单独扫 arXiv + CrossRef, 看相关工作 |
shimen simulate topic.md [--run] |
生成 sim_skeleton.py; --run 自动跑出 results.json + fig_main.pdf |
shimen figure results.json "Fig 2: DOCP vs Cn^2" |
数据 + 自然语言描述 → matplotlib 代码自动跑 → fig_main.pdf |
shimen draft outline.md |
从 outline / topic 起草 docx_v0 (自动注入 results.json 的真实数字) |
shimen audit FILE.docx |
claim-auditor framing 审计 (1 次调用) |
shimen polish FILE.docx |
11 agent polish 全循环 |
shimen auto FILE.docx |
audit + polish 链 (中等粒度入口) |
shimen read paper.pdf [...] |
读 PDF 入 literature-ledger |
shimen typeset polished.docx |
LaTeX → final.pdf |
shimen dashboard --cwd . |
浏览器看历史 sandbox |
shimen version |
显示版本 |
端到端 — 一条命令搞定整篇
shimen auto-start 硅光 深度学习 # 多领域融合, 师姐自己找方向
内部依次跑(每阶段产物保存可恢复):
1. ideate 师姐 brainstorm + 学生拟 2 候选 + 严师可行性 + 审稿人 impact
→ topic_proposal.md (灌水主题硬拒绝)
2. simulate 生成 sim_skeleton.py + sim_skeleton.md (用户自己跑, 回填 results.json)
3. draft paper-polisher 从 topic 展开 6 节 prose
→ <project>_v0.docx
4. audit claim-auditor framing 检查
MAJOR_REFRAME 默认停 (--force 强行继续)
5. polish 12 agent full loop
→ <project>_v0_polished.docx
6. typeset LaTeX → final.pdf (需要 xelatex, 无则跳过)
中途任何阶段都能从中间起:
shimen auto-start --from-topic topic_proposal.md # 跳过 ideate
shimen auto-start --from-outline outline.md # 跳过 ideate
shimen auto-start --from-docx my_existing.docx # 只跑 audit + polish + typeset
shimen auto-start "想法" --skip-sim --skip-typeset # 只跑 ideate + draft + polish
或者分步走(每步看一眼再决定):
shimen read ref1.pdf ref2.pdf # 入 ledger
shimen ideate "我的想法" # 选题
shimen simulate topic_proposal.md # 生成仿真骨架
python sim_skeleton.py # 你跑仿真, 回填 results.json
shimen draft topic_proposal.md # 起草 docx
shimen audit my_paper_v0.docx # 审 framing
shimen polish my_paper_v0.docx # 全 loop
shimen typeset my_paper_v0_polished.docx # 出 PDF
跑通完整 auto-start 花费(用 deepseek 或 mimo-v2.5)大约 ¥3-5 一篇论文。
推荐工作流(一键端到端):
shimen auto paper.docx --venue "Nature Photonics"
# 内部:
# Phase 1/2 → audit (claim-auditor 1 次调用)
# verdict = ACCEPT_AS_IS → 自动接 Phase 2
# verdict = MINOR_REFRAME → 自动接 Phase 2 (跑完看 audit 报告做小调整)
# verdict = MAJOR_REFRAME → 停 (手动改 framing 再来, 或 --force 硬上)
# Phase 2/2 → polish (11 agents full loop, 浏览器实时看对话)
# 输出:
# paper_audit.md framing 报告
# paper_polished.docx
# _shimen_auto_<ts>/events.jsonl 两阶段全部对话流
如果想分步走 (debug / 想看 audit 后再决定要不要 polish),用单独的 shimen audit + shimen polish。
Agents(写死的调用顺序)
每段每一轮按这个顺序跑(Python 代码强制,LLM 跳不掉):
1. student-liaison — 翻译严师指令为可执行病灶
2. strict-mentor — 诊断 P0/P1/P2(用 reasoner model 如可用)
3. citation-verifier — 仅当段内有 [N] 才触发 (Introduction / Discussion 高频)
4. paper-polisher — 出 REVISED,遇到 SUSPICIOUS 引用标 [NEEDS_USER_CONFIRM]
5. integrity-sentinel — PASS/FLAG/HARD-STOP(HARD-STOP 回滚整轮)
6. ┌ peer-reviewer (温和派, lenient) ┐ ← asyncio.gather 真并行
└ peer-reviewer-strict (严厉派) ┘
7. conflict-arbitrator — 仅当 |lenient - strict| ≥ 1.5 才触发
8. Gate: 接受阈值 ? 接受 : 下一轮
跑完所有轮数仍未达标 →
9. postmortem-agent — 根因诊断, 不再 polish
全 doc 跑完 →
10. style-learner — 归纳本次 polish 用户偏好, 写 ~/.shimen/style-ledger.md
用户实时干预:浏览器 inject 表单提交后,orchestrator 在下一轮 agent 调用前
读 <sandbox>/intervention.jsonl,把 pending 消息拼到 user prompt 前面。
applied 之后写到 .intervention-applied.txt。
协议
events.jsonl 协议与插件版完全兼容,沙盒目录里的文件可以喂给插件的 tools/shimen-dashboard.py 看。详见 references/events-jsonl-protocol.md。
License
CC-BY-NC-4.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shimen-0.24.1-py3-none-any.whl.
File metadata
- Download URL: shimen-0.24.1-py3-none-any.whl
- Upload date:
- Size: 369.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
115dd1813535c583316cff7756b8398c43b6bba7e85ac3cd95c0e9eaa8096e79
|
|
| MD5 |
e2fb00a1d6a80ab001589b96cd1ce5a0
|
|
| BLAKE2b-256 |
92a9287aac26f5b006a01534a0afd207227e9bb71584fb7b286da3da03127129
|
Provenance
The following attestation bundles were made for shimen-0.24.1-py3-none-any.whl:
Publisher:
release.yml on ZiliCai/shimen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shimen-0.24.1-py3-none-any.whl -
Subject digest:
115dd1813535c583316cff7756b8398c43b6bba7e85ac3cd95c0e9eaa8096e79 - Sigstore transparency entry: 1655432986
- Sigstore integration time:
-
Permalink:
ZiliCai/shimen@ef6801000e6a6b8cb74e7fff7fa5205fd8ee7fd5 -
Branch / Tag:
refs/tags/v0.24.1 - Owner: https://github.com/ZiliCai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ef6801000e6a6b8cb74e7fff7fa5205fd8ee7fd5 -
Trigger Event:
push
-
Statement type: