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

prototype-mode

Claude Code 外掛,將專案標記為原型模式,停用 Git worktree 隔離,讓 Claude 在互動式工作階段與背景工作中直接編輯並提交目前分支。

brunolca@brunolca

brunolca/claude-plugins/tree/main/plugins/prototype-mode

原貼文圖片1
已翻譯

關於這個 mod

prototype-mode 是一個 Claude Code 外掛,將 worktree.bgIsolation 設為 "none",把專案置於原型模式,關閉在呼叫 EnterWorktree 前阻擋主工作區執行 Edit/Write 的防護。它會注入 Prototype mode 系統提示區段、拒絕 EnterWorktree、從子代理呼叫中移除 isolation:"worktree",並告訴 Claude 在目前分支上提交,推送前先詢問。命令包括 /proto on、/proto on team、/proto off 與 /proto status,狀態列指示器會顯示它何時啟用。使用 claude plugin marketplace add brunolca/claude-plugins 與 claude plugin install prototype-mode@brunolca 安裝。需要 Claude Code 2.1.289 或更新版本。

安裝

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

claude plugin marketplace add brunolca/claude-plugins
claude plugin install prototype-mode
原文 / README

prototype-mode

A Claude Code plugin that flags a project for prototype mode: no git worktrees, iterate and commit directly on the current branch (main included). Works for interactive sessions and background jobs.

prototype-mode demo: /proto on, then Claude edits, tests and commits directly on main

Install

claude plugin marketplace add brunolca/claude-plugins
claude plugin install prototype-mode@brunolca

Or from inside Claude Code: /plugin marketplace add brunolca/claude-plugins, then /plugin install prototype-mode@brunolca.

Share it with a team (per repo)

Commit this to the project's .claude/settings.json so everyone who trusts the repo is offered the plugin, and prototype mode is on for all of them:

{
  "extraKnownMarketplaces": {
    "brunolca": {
      "source": { "source": "github", "repo": "brunolca/claude-plugins" }
    }
  },
  "enabledPlugins": { "prototype-mode@brunolca": true },
  "worktree": { "bgIsolation": "none" }
}

/proto on team writes the worktree part for you.

Commands

| Command | Effect | | --- | --- | | /proto on | Sets worktree.bgIsolation: "none" in .claude/settings.local.json (just you) | | /proto on team | Same, in .claude/settings.json (commit it to share) | | /proto off [team] | Removes it; a team "none" is overridden locally with "worktree" | | /proto / /proto status | Shows the effective mode and where it comes from |

The status line shows 🧪 prototype mode while it's on.

How it works

  • Background jobs: worktree.bgIsolation: "none" is Claude Code's own setting. It turns off the guard that blocks Edit/Write in the main checkout until EnterWorktree is called. The CLAUDE_BG_ISOLATION env var outranks it. This part works even without the plugin.
  • Model instructions: while it's on, every request gets a "Prototype mode" system-prompt section. It overrides the background-session instruction to isolate, and says to commit on the current branch but ask before pushing.
  • Tools: EnterWorktree is refused, and isolation: "worktree" is stripped from subagent (Agent) calls.

Develop

claude --plugin-dir .        # load this checkout for one session
claude plugin validate .
claude plugin test .

Requires a Claude Code build with function-hook plugins (2.1.289 or newer).

更多類似作品