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

publish-approval

一個 Claude Code 外掛 hook,在執行 push、deploy 或 publish 前透過對話框要求使用者核准,並在每種權限模式下都為發布防護提供門控。

Sarb0Z@Sarb0Z

Sarb0Z/colloid-swarm/tree/main/.agents/claude/mods/publish-approval

已翻譯

關於這個 mod

一個 Claude Code 外掛,加入 hook 攔截工具呼叫(Bash、PowerShell、Monitor、Artifact),在 push、deploy 或 publish 發生前透過對話框要求使用者核准,而且適用於每種權限模式。

這個 hook 會針對目標儲存庫執行儲存庫自有的 guard-publish.py,以工具使用 id 為鍵將核准記錄為標記檔案,並在需要時透過 AskUserQuestion 再次詢問。它屬於 Colloid Swarm 腳手架,這是一個供 Claude Code、Codex、Kimi 和 GitHub Copilot 使用的可攜式代理腳手架;引擎無關的 hook 政策位於 .agents/hooks/policy/ 下,主機介面卡負責轉換承載資料。

複製儲存庫並執行匯出器即可安裝,匯出器會產生腳手架套件。

git clone https://github.com/Sarb0Z/colloid-swarm.git
cd colloid-swarm
.agents/export-scaffold.py /tmp/scaffold-kit

需求是 Bash、Python 3 和 Node.js 22+。請使用儲存庫的測試套件驗證,包括 test-guard-publish.py 和 test-session-start.sh。尚未選擇儲存庫層級的授權條款。

安裝

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

claude plugin marketplace add Sarb0Z/colloid-swarm
claude plugin install publish-approval
原文 / README

Colloid Swarm

A portable agent scaffold for Claude Code, Codex, Kimi, and GitHub Copilot. Canonical instructions, skills, hook policies, personas, and MCP definitions live under .agents/; host directories contain direct links or thin adapters.

This repository also carries an experimental genome layer. Exports remove it.

Install

Requirements are Bash, Python 3, and Node.js 22+ for the two repository-owned MCP servers.

git clone https://github.com/Sarb0Z/colloid-swarm.git
cd colloid-swarm
.agents/export-scaffold.py /tmp/scaffold-kit

The exporter reads the current Git commit and refuses a non-empty destination. Review the kit, then follow export/README.md to merge it into a target. It includes .agents/, static .claude/ and .codex/ integration, Kimi config, Copilot links, root instructions, and the transplant guide. Dirty or ignored local state does not travel.

Architecture

  • AGENTS.md: operating contract and delegation policy.
  • .agents/personas/: Claude-native cached roles; .claude/agents/ links here.
  • .codex/agents/: static Codex roles with exact invocation model/effort.
  • .agents/skills/: reusable, progressively disclosed workflows.
  • .agents/rules/: scoped codebase and framework guidance.
  • .agents/hooks/: engine-neutral policies plus host payload adapters.
  • .agents/mcp.json: server definitions and project on/off state.
  • .agents/playbooks/: focused review, QA, wrap, and reporting procedures.

Run python3 .agents/check-layout.py after changing scaffold inventory. It checks committed links without generating or pruning files.

Delegation defaults

| Work | Claude | Codex | | --- | --- | --- | | Mechanical or bounded exploration | Haiku | gpt-5.6-luna / low | | Implementation, QA, research | Claude Sonnet 5 | gpt-5.6-terra / medium | | Well-specified work too broad for medium; the lead | Claude Opus 5 | gpt-5.6-sol / high | | Complex or critical work | Claude Fable 5.1 | — |

The cached personas cover common work but do not restrict generic delegation. The Opus lead sends well-specified work to the cheapest tier that can solve and verify it and complex work up to Fable, and grants only the capabilities that task needs.

MCP capabilities

The tracked registry directly owns state. Defaults are Context7, Playwright, and the repository-owned research server; mobile automation, live security scanning, issue trackers, and keyed search services remain off until requested.

python3 .agents/mcp.py
python3 .agents/mcp.py enable appium-mcp
python3 .agents/mcp.py disable appium-mcp

The command writes .mcp.json, .codex/config.toml, optional .kimi-code/mcp.json, Claude's enabled-server list, and the reader and default browser configs. Restart the session after a state change.

| Server | Default | Purpose | | --- | --- | --- | | context7 | on | current library documentation | | playwright | on | browser QA; optional synced site cookies and proxy (see .agents/README.md) | | research-mcp | on | readable web/PDF research | | playwright-reader | off | browser reading with an installed blocker | | appium-mcp | off | mobile device/simulator QA | | security-mcp | off | authorized live-target scanning | | linear, atlassian | off | issue and knowledge systems | | greptile, exa | off | keyed external services |

User- and plugin-level host configuration may still add unknown capabilities. Project records mask only the same server names; this is not a machine-wide allowlist.

Hooks

Policies under .agents/hooks/policy/ receive normalized JSON on stdin. The active set covers destructive-command refusal, focused post-edit checks, research/source context, compaction recovery, session start/wrap, and stop inspection. Host adapters translate payloads; policies own behavior.

Codex hook declarations are hash-trusted. After changing them, review the file and run:

python3 .agents/codex/trust-hooks.py "$(pwd)"

Verification

python3 .agents/check-layout.py
.agents/lint-skills.sh
.agents/test-session-start.sh
python3 .agents/test-guard-destructive.py
python3 .agents/test-guard-publish.py
.agents/test-mcp.sh
.agents/test-codex.sh
.agents/test-export.sh

Each repository-owned MCP server also runs npm run check. CI runs the static and focused behavior suites; local test-codex.sh additionally proves that the installed Codex binary loads the project MCP records.

Deferred work and evidence

  • .agents/breadcrumbs.md: deferred work, surfaced at SessionStart.
  • .agents/debt-log.md: standing tradeoffs referenced as debt: <id>.
  • .agents/knowledge/: dated external observations indexed on demand.

Experimental genome layer

Colloid alone carries genomes.md, .agents/genome.sh, the mutagen, and the panspermia-mutation skill. The export removes those files, their hooks, config keys, and links. Run bash demo/demo.sh for the offline scaffold demonstration.

License

No repository-wide license has been selected. The learning-output-style playbook has its own Apache-2.0 notice under .agents/licenses/.

更多類似作品