npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-monkey-proof

v0.1.1

Published

MPA (Monkey-Proof Architecture) を新規/既存プロジェクトに導入し、使う AI ツールへ /mpa 一式を展開する。

Downloads

418

Readme

create-monkey-proof

MPA (Monkey-Proof Architecture) を新規/既存プロジェクトに導入する CLI。

npm create monkey-proof@latest
# or
npx create-monkey-proof

対話で「新規/既存」「使う AI ツール(Claude Code / Gemini CLI / Codex / 汎用)」を聞き、 constitution/(規約の実体)と各ツール用ブリッジ(/mpa 一式)を配置する。


設計:正本を複製せず「同梱したスナップショット」を配る(MPA P2)

create-monkey-proof の心臓は 「規約の文章を二重管理しない」(MPA 原則 P2)こと。

  • 唯一の正本は monkey-proof-architecture リポジトリの constitution/templates/ だけ。
  • create-monkey-proof は AI の記憶から規約を再生成しないbuild 時に正本を assets/ へコピーして同梱し、 実行時はその実ファイルをユーザーのプロジェクトへ配る。
  • npm に載るのは「ある時点の正本の影(スナップショット)」であって、手書きの複製ではない。 → ユーザーの npx create-monkey-proofネット越し clone 不要(速い・本家 URL 固定の脆さがない)。
monkey-proof-architecture repo (唯一の正本)
  constitution/  templates/
        │ build 時に copy-assets.mjs が取り込む(assets/ は .gitignore 済み)
        ▼
  packages/create-monkey-proof/assets/   ← publish に同梱されるスナップショット
        │ npx create-monkey-proof
        ▼
  ユーザーのプロジェクト   .claude/ .gemini/ AGENTS.md … + constitution/

これは Capability Map と同じ「導出するから腐らない」原則 (../../constitution/40-discovery.md)をリリースパイプラインへ広げたもの。 正本を直したら publish し直すだけで、配布物に反映される。


やること(Phase A〜D)

各 AI ツールはコマンド/スキルを別々の場所・別々の形式で探す。だから「正本を各ツールの正規パスへ ブリッジ展開する」必要がある。各ブリッジは規約を複製せず constitution/参照する薄い1枚にする(P2)。

Phase A — 立ち上げ先(新規 / 既存)

  • 新規constitution/ + 入口雛形 + README.md/.gitignore 雛形を配置。
  • 既存 → ファイル単位で存在チェックし欠落のみ補完。内容差分があれば diff を提示し [skip / 上書き / .bak 退避] を対話で選ばせる。.gitignore は MPA 必須行 (.claude/scheduled_tasks.lock, .claude/*.lock)を末尾追記(重複なし)。

Phase B — 使う AI ツールを選ぶ(複数可)

Claude Code / Gemini CLI / Codex / 汎用(AGENTS.md のみ)。

Phase C — 各ツールの正規パスへ展開(src/cli.tsBRIDGE_MAP

| 正本(assets/) | Claude Code | Gemini CLI | Codex | 汎用 | |---|---|---|---|---| | templates/skills/mpa/SKILL.md | .claude/skills/mpa/SKILL.md | .gemini/commands/mpa.toml | .agents/skills/mpa/SKILL.md | (AGENTS.md が指す) | | templates/skills/mpa-guard/SKILL.md | .claude/skills/mpa-guard/SKILL.md | (mpa.toml 内で手順参照) | .agents/skills/mpa-guard/SKILL.md | (同左) | | templates/commands/mpa-check.md | .claude/commands/mpa-check.md | .gemini/commands/mpa-check.toml | (mpa-guard が内包) | — | | templates/commands/mpa-review.md | .claude/commands/mpa-review.md | .gemini/commands/mpa-review.toml | (mpa-guard が内包) | — | | 入口(薄い) | CLAUDE.md | GEMINI.md | AGENTS.md | AGENTS.md | | hook | .claude/settings.jsontemplates/hooks/settings.example.json をマージ) | — | — | — |

ツール差の注記

  • Claude: /mpa は command を作らず、skill ディレクトリ名 mpa = /mpa 起動で代替。
  • Codex: 独立した check/review コマンドは作らず、mpa-guard skill のモード1/2 が内包。
  • Gemini: mpa-guard 単独コマンドは作らず、mpa.toml の prompt から手順をインライン参照。

description の生成規則:各ツール版 frontmatter の description は、正本 templates/skills/mpa/SKILL.md の description から決定的に転記する(Claude は自動発火に使うので全文一致。 Codex/Gemini は長さ制約で短縮可だが正本から導出)。トリガ用メタデータであり P2 の複製禁止には当たらない。

入口ファイルの冪等追記CLAUDE.md/GEMINI.md/AGENTS.md への MPA 記述は <!-- MPA:BEGIN --> … <!-- MPA:END --> で囲む。既存ブロックは置換、無ければ末尾追記(再実行で重複しない)。 AGENTS.md は Codex と汎用のどちらが選ばれても1ファイル・1ブロックだけ生成。

hook(Claude 選択時のみ)templates/hooks/settings.example.json の hooks ブロックを .claude/settings.json へマージ(PreToolUse/Stop 配列に重複ガード付き追記、上書きしない)。 templates/hooks/bin/*.sh実行ビット 0755 を保って配置。

Phase D — 生成後の sanity check

生成ファイルが実在 / SKILL に name+description / hook の実行ビット / 入口 md が参照する constitution/ のファイルが実在、を確認してから報告する。


開発

npm run build   # tsc + copy-assets(repo ルートの constitution/ + templates/ を assets/ へ取り込む)
npm run dev     # tsx で src/cli.ts を直接実行

assets/ は build 生成物。git には含めない(.gitignore 済み)。正本は常に repo ルートの constitution/templates/ だけ。