ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 elliottower

repro

用於可重現研究工作階段的 Claude Code function hook 外掛:拒絕編輯已凍結的 PREREG.md 計畫,在論文或分析執行沒有 .results/ 台帳時提出警告,記錄下載來源的 URL 供引用,並顯示 prereg、結果和引用狀態的即時狀態列。

elliottower@elliottower

elliottower/reproducible-science/tree/main/packages/repro/mod

已翻譯

關於這個 mod

repro 是和 reproducible-science 外掛一起發佈的 Claude Code 外掛,讓研究工作階段遵守自己的記錄。它攔截 Edit/Write 呼叫,為 PREREG.md 檔案建立凍結摘要並拒絕修改;當論文或分析執行第一次編輯 .tex、.Rmd、.qmd、.typ 檔案,而背後沒有 .results/ 台帳時記下這件事;也會提示模型把下載的 PDF 記成供 citations fetch 使用的 url: 引用項目。它會把 seal/claim/freeze 門檻注入系統提示,在提示上方顯示一列低調的狀態列,整理 prereg 凍結、台帳執行/封存/宣告和引用驗證,並發出簡短警告,例如 '1 plan edited after freeze' 或 '16 runs, nothing sealed'。斜線指令包括 /repro-status(可透過 name、pick、list、auto 選擇專案)、/repro-verify,以及 /repro-hide /repro-show。這個外掛註冊 set_project MCP-style 工具,並從被碰觸的檔案路徑判斷工作專案。使用 '/plugin marketplace add elliottower/reproducible-science' 和 '/plugin install repro@reproducible-science' 安裝;它要求 results、prereg 和 citations 指令位於 PATH。開發使用 'claude plugin validate' 和 'claude plugin test'。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add elliottower/reproducible-science
claude plugin install repro
原文 / README

repro

A Claude Code mod for research sessions. The reproducible-science plugin's hooks speak when a number enters a manuscript unbound or a frozen plan changes, and they speak only in a project that already keeps a ledger or a plan. This closes the other half: it works in a project that keeps neither yet, and it can refuse.

It is a plugin of function hooks. That API is early access and changes between Claude Code releases, so this ships beside the reproducible-science plugin and not inside it: a build that cannot load it still loads the plugin.

What it does

| | | |---|---| | Refuses an edit to a frozen plan | An Edit or Write to a PREREG.md carrying a freeze digest is denied, with the instruction to record the change with prereg log. | | Notes a manuscript with no ledger | The first edit to a .tex, .Rmd, .qmd or .typ with no .results/ ledger above it goes through, and the model is told no number in the file is bound to a run. | | Notes an analysis with no ledger | The same, once per project, when a command runs an analysis. | | Notes a downloaded source | After curl or wget saves a PDF, the model is told the address to record as url: in the claims file, so citations fetch can retrieve the same bytes for a reader. | | Puts the gates in the system prompt | Seal before a run, claim before a number, freeze before a confirmatory analysis, with the state of the project's records as of the last turn. | | Shows the state | One dim row above the prompt, refreshed at the end of each turn, with one field per tool. | | Warns | The pinned line under the prompt appears only when something is wrong, a few words per problem. | | /repro-status | The same readout on demand, with the sealed files hashed. Instant, and no model turn. | | /repro-verify | Checks every pinned quotation of the working project against its source, which takes minutes on a large project, and keeps the count for the readout. | | /repro-hide, /repro-show | Hides the readout above the prompt, and shows it again. A warning still appears while it is hidden. |

The status row

study · prereg: 1/1 frozen · results: 3 runs, 2 sealed, 4 claims · citations: 120/120 found

prereg is frozen plans over all plans, or none drafted. results counts the ledger's runs, seals and claims. citations is the last full check by /repro-verify, and before one has run it is the count pinned: citations: 120 pinned, not verified. Checking quotations takes minutes on a large project, so the row never runs it. A check that does not finish in a minute marks its own field not read (timed out) and leaves the others standing.

The warnings, each on the pinned line as repro: ...:

| | | |---|---| | 1 plan edited after freeze | a frozen PREREG.md no longer matches its digest | | ledger truncated, edited, corrupt | the chain does not verify | | ledger rewritten after timestamp | a timestamp proof contradicts the chain | | 2 sealed files changed | after /repro-status, which hashes the sealed files | | 16 runs, nothing sealed | runs are recorded and no input was sealed | | 3 runs, no plan frozen | runs are recorded and no plan is frozen |

The working project

A session started in one folder often edits files in another, so the project is read off the paths the tools touch: the nearest directory above a touched file that holds a .results/ ledger, a claims/ directory, a PREREG.md or a paper/ directory.

/repro-status                  the working project's state
/repro-status <part of a name> set the working project, among the folders beside the session's
/repro-status pick             choose one from a list
/repro-status list             print them
/repro-status auto             go back to following the files

The model can set it too, through the set_project tool the mod registers.

Install

/plugin marketplace add elliottower/reproducible-science
/plugin install repro@reproducible-science

It needs the results, prereg and citations commands on PATH.

Develop

claude plugin validate packages/repro/mod
claude plugin test packages/repro/mod

The tests stand in for the engine and need no network. They do not run in this repository's CI, which has no Claude Code.

更多類似作品