Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.14"

- uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24"
registry-url: "https://registry.npmjs.org"
- name: Upgrade npm for OIDC registry auth support
run: npm install -g npm@latest

- run: npm ci

- run: npm run check

- run: npm test

- name: Upgrade npm for OIDC registry auth support
run: npm install -g npm@latest

- name: Publish with OIDC auth
run: |
unset NODE_AUTH_TOKEN
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,37 @@ npx module-gates install-claude
```
This writes `PreToolUse` and `SessionStart` hooks into `.claude/settings.json`; `npx module-gates uninstall-claude` removes them. The `SessionStart` hook injects the system prompt hint automatically.

Or reuse an existing pi installation by pointing hooks at it manually in `~/.claude/settings.json`:
```json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|MultiEdit|Write",
"hooks": [
{
"type": "command",
"command": "node \"$HOME/.pi/agent/npm/node_modules/@cuzfrog/module-gates/src/bridges/claude/run.mjs\" pre-tool-use"
}
]
}
],
"SessionStart": [
{
"matcher": "startup|resume|clear",
"hooks": [
{
"type": "command",
"command": "node \"$HOME/.pi/agent/npm/node_modules/@cuzfrog/module-gates/src/bridges/claude/run.mjs\" session-start"
}
]
}
]
}
}
```
The pi install directory may differ; locate `run.mjs` under your pi npm root. The `SessionStart` hook (system prompt injection) is optional — `PreToolUse` alone enforces the gates.

## Module Descriptor Semantics

A module descriptor is a Markdown file (default name: `MODULE.md`) placed in a directory. You can piggy-back on your module context file for example `CONTEXT.md`. A `MODULE.md` only enforces its own immediate directory.
Expand Down
7 changes: 2 additions & 5 deletions doc/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,8 @@ TypeScript runs on the fly — there is no compile step:

## Publishing

npm packages cannot be renamed, so the generalized package ships under a new name and the old one is deprecated:

1. Bump `version` in `package.json` (package name is `@cuzfrog/module-gates`).
2. `npm publish` — `publishConfig` already sets public access and provenance (provenance requires publishing from GitHub Actions with an `NPM_TOKEN` secret).
3. Deprecate the old package once: `npm deprecate @cuzfrog/pi-module-gates "Renamed to @cuzfrog/module-gates"`.
4. Old `@cuzfrog/pi-module-gates` versions stay installable; new development lands on `@cuzfrog/module-gates` only.
2. `npm publish --no-provenance` — `publishConfig` already sets public access and provenance (`--no-provenance` is for local publish the first time).
3. see @AGENTS_GIT.md for CI publish

The Claude plugin is installed from this git repo via the marketplace, not from npm. When the repo is renamed to `module-gates`, update the marketplace command in README and the homepage/repository URLs in package.json.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cuzfrog/module-gates",
"version": "1.0.0",
"version": "1.0.1",
"description": "Controls the entropy of the codebase by enforcing code module boundaries. Ships bridges for pi and Claude Code.",
"keywords": [
"pi-package",
Expand Down
2 changes: 2 additions & 0 deletions src/core/context/system-prompt.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Each `{{descriptorFileName}}` gates its branching point in the tree.
{{#if descriptorReadonly}}- {{descriptorReadonly}}{{/if}}
{{#if moduleInterfaceImportGate}}- {{moduleInterfaceImportGate}}{{/if}}

See @cuzfrog/module-gates#README.md for configurations.

### Glossary
- `module`: a directory containing code, all files in its recursive subdirectories are internal files of the module;
- `external files`: files not in the module directory or subdirectories;
Expand Down
Loading