@imdeadpool/guardex 7.0.7 → 7.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,28 +1,23 @@
1
- # GuardeX — Guardian T-Rex for your repo
1
+ # GitGuardex — Guardian T-Rex for your repo
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/%40imdeadpool%2Fguardex?color=cb3837&logo=npm)](https://www.npmjs.com/package/@imdeadpool/guardex)
4
- [![CI](https://github.com/recodeee/guardex/actions/workflows/ci.yml/badge.svg)](https://github.com/recodeee/guardex/actions/workflows/ci.yml)
5
- [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/recodeee/guardex/badge)](https://securityscorecards.dev/viewer/?uri=github.com/recodeee/guardex)
4
+ [![CI](https://github.com/recodeee/gitguardex/actions/workflows/ci.yml/badge.svg)](https://github.com/recodeee/gitguardex/actions/workflows/ci.yml)
5
+ [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/recodeee/gitguardex/badge)](https://securityscorecards.dev/viewer/?uri=github.com/recodeee/gitguardex)
6
6
 
7
- GuardeX is a safety layer for parallel Codex/agent work in git repos.
7
+ **GitGuardex is a safety layer for parallel agent work in git repos.** If you're running more than one Codex or Claude agent on the same codebase, this is what keeps them from deleting each other's work.
8
8
 
9
9
  > [!WARNING]
10
- > Not affiliated with OpenAI or Codex. Not an official tool.
10
+ > Not affiliated with OpenAI, Anthropic, or Codex. Not an official tool.
11
11
 
12
- ## Frontend Repo
12
+ ---
13
13
 
14
- - Standalone frontend repository: https://github.com/Webu-PRO/guardex-frontend
15
- - This repository tracks/mirrors the frontend under `frontend/` as documented below.
14
+ ## The problem
16
15
 
17
- ## The problem (what was going wrong)
16
+ I was running ~30 Codex agents in parallel and hit a wall: they kept working on the same files at the same time — especially tests — and started overwriting or deleting each other's changes. More agents meant *less* forward progress, not more. Classic de-progressive loop.
18
17
 
19
- Multiple Codex agents worked on the same files at the same time.
20
- They started overwriting or deleting each other's changes.
21
- Progress became **de-progressive**: more activity, less real forward movement.
18
+ GitGuardex exists to stop that loop. Every agent gets its own worktree, claims the files it's touching, and can't clobber files another agent has claimed. Your local branch stays clean; agents stay in their lanes.
22
19
 
23
- GuardeX exists to stop that loop.
24
-
25
- ![Multi-agent dashboard example](https://raw.githubusercontent.com/recodeee/guardex/main/docs/images/dashboard-multi-agent.png)
20
+ ![Multi-agent dashboard example](https://raw.githubusercontent.com/recodeee/gitguardex/main/docs/images/dashboard-multi-agent.png)
26
21
 
27
22
  ```mermaid
28
23
  flowchart LR
@@ -38,15 +33,21 @@ flowchart LR
38
33
  I --> F
39
34
  ```
40
35
 
41
- ## What GuardeX enforces
36
+ ---
37
+
38
+ ## What it does
39
+
40
+ - **Isolated `agent/*` branch + worktree per task** — agents never share a working directory.
41
+ - **Explicit file lock claiming** — an agent declares which files it's editing before it edits them.
42
+ - **Deletion guard** — claimed files can't be removed by another agent.
43
+ - **Protected-base safety** — `main`, `dev`, `master` are blocked by default; agents must go through PRs.
44
+ - **Auto-merges agent configs into every worktree** — `oh-my-codex`, `oh-my-claude`, caveman mode, and OpenSpec all get applied automatically so every spawned agent starts tuned, not bare.
45
+ - **Repair/doctor flow** — when drift happens (and it will), `gx doctor` gets you back to a clean state.
46
+ - **Auto-finish** — when Codex exits a session, Guardex commits sandbox changes, syncs against the base, retries once if the base moved, and opens a PR.
42
47
 
43
- - isolated `agent/*` branch + worktree per task
44
- - explicit file lock claiming before edits
45
- - deletion guard for claimed files
46
- - protected-base branch safety (`main`, `dev`, `master` by default)
47
- - repair/doctor flow when drift appears
48
+ ---
48
49
 
49
- ## Copy-paste: install + bootstrap
50
+ ## Quick start
50
51
 
51
52
  ```sh
52
53
  npm i -g @imdeadpool/guardex
@@ -54,292 +55,269 @@ cd /path/to/your/repo
54
55
  gx setup
55
56
  ```
56
57
 
57
- Alias support:
58
+ That's it. Setup installs hooks, scripts, templates, and scaffolds OpenSpec/caveman/OMX wiring. Aliases: `gx` (preferred), `gitguardex` (full), `guardex` (legacy).
58
59
 
59
- - preferred: `gx`
60
- - full: `guardex`
60
+ ---
61
61
 
62
- ## Copy-paste: daily workflow (per new user task)
62
+ ## Daily workflow
63
+
64
+ Per new agent task:
63
65
 
64
66
  ```sh
65
67
  # 1) Start isolated branch/worktree
66
68
  bash scripts/agent-branch-start.sh "task-name" "agent-name"
67
69
 
68
- # 2) Claim ownership
69
- python3 scripts/agent-file-locks.py claim --branch "$(git rev-parse --abbrev-ref HEAD)" <file...>
70
+ # 2) Claim the files you're going to touch
71
+ python3 scripts/agent-file-locks.py claim \
72
+ --branch "$(git rev-parse --abbrev-ref HEAD)" <file...>
70
73
 
71
74
  # 3) Implement + verify
72
75
  npm test
73
76
 
74
- # 4) Finish (commit/push/PR/merge flow)
75
- bash scripts/agent-branch-finish.sh --branch "$(git rev-parse --abbrev-ref HEAD)" --base dev --via-pr --wait-for-merge
77
+ # 4) Finish (commit + push + PR + merge)
78
+ bash scripts/agent-branch-finish.sh \
79
+ --branch "$(git rev-parse --abbrev-ref HEAD)" \
80
+ --base dev --via-pr --wait-for-merge
76
81
 
77
- # 5) Optional cleanup after merge
82
+ # 5) Optional: cleanup after merge
78
83
  gx cleanup --branch "$(git rev-parse --abbrev-ref HEAD)"
79
84
  ```
80
85
 
81
- If you use `scripts/codex-agent.sh`, the finish flow is auto-run after the Codex session exits.
82
- It auto-commits sandbox changes, retries once after syncing if the branch moved behind base during the run, then pushes/opens PR merge flow against `dev`.
86
+ If you use `scripts/codex-agent.sh`, the finish flow runs automatically when the Codex session exits — it auto-commits, retries once after syncing if the base moved during the run, then pushes and opens the PR.
83
87
 
84
- If you run Codex in multiple existing agent worktrees directly (for example from VS Code Source Control), finalize all completed branches with:
88
+ Running Codex across several existing worktrees (e.g. from VS Code Source Control)? Finalize everything ready at once:
85
89
 
86
90
  ```sh
87
91
  gx finish --all
88
92
  ```
89
93
 
90
- ## Visual workflow
91
-
92
- ### Setup status
93
-
94
- ![gx setup behavior screenshot](https://raw.githubusercontent.com/recodeee/guardex/main/docs/images/setup-success.svg)
94
+ ---
95
95
 
96
- ### Service logs/status
96
+ ## Visual reference
97
97
 
98
- ![gx status logs screenshot](https://raw.githubusercontent.com/recodeee/guardex/main/docs/images/status-tools-logs.svg)
98
+ | | |
99
+ |---|---|
100
+ | ![Setup status](https://raw.githubusercontent.com/recodeee/gitguardex/main/docs/images/setup-success.svg) | **`gx setup`** — bootstraps everything in one command |
101
+ | ![Service logs](https://raw.githubusercontent.com/recodeee/gitguardex/main/docs/images/status-tools-logs.svg) | **`gx status`** — health check for tools, hooks, services |
102
+ | ![Branch start](https://raw.githubusercontent.com/recodeee/gitguardex/main/docs/images/workflow-branch-start.svg) | **Branch/worktree start protocol** |
103
+ | ![Lock guard](https://raw.githubusercontent.com/recodeee/gitguardex/main/docs/images/workflow-lock-guard.svg) | **Lock + delete-guard protocol** |
104
+ | ![VS Code layout](https://raw.githubusercontent.com/recodeee/gitguardex/main/docs/images/workflow-source-control.svg) | **VS Code Source Control view** with agent + OpenSpec files |
99
105
 
100
- ### Branch/worktree start protocol
106
+ ### How It Works In VS Code
101
107
 
102
- ![gx branch start protocol screenshot](https://raw.githubusercontent.com/recodeee/guardex/main/docs/images/workflow-branch-start.svg)
108
+ This is the real Source Control shape Guardex is aiming for: isolated agent branches, clear OpenSpec artifacts, and no pile-up on one shared checkout.
103
109
 
104
- ### Lock + delete guard protocol
110
+ ![Exact VS Code Source Control workflow screenshot](https://raw.githubusercontent.com/recodeee/gitguardex/main/docs/images/workflow-vscode-source-control-exact.png)
105
111
 
106
- ![gx lock and delete guard screenshot](https://raw.githubusercontent.com/recodeee/guardex/main/docs/images/workflow-lock-guard.svg)
112
+ ---
107
113
 
108
- ### VS Code Source Control layout (agent + OpenSpec files)
114
+ ## Commands
109
115
 
110
- ![VS Code Source Control layout with OpenSpec files](https://raw.githubusercontent.com/recodeee/guardex/main/docs/images/workflow-source-control.svg)
111
-
112
- ## Copy-paste: common commands
116
+ ### Core
113
117
 
114
118
  ```sh
115
- # health check (default when run with no args)
116
- gx status
117
- gx status --strict # exit non-zero on findings (v6 name: gx scan)
118
-
119
- # bootstrap, repair, verify all in one
120
- gx setup
121
- gx setup --repair # repair only (v6 name: gx fix)
122
- gx setup --install-only # scaffold templates, skip global installs (v6 name: gx install)
119
+ gx status # health check (default)
120
+ gx status --strict # exit non-zero on findings
121
+ gx setup # full bootstrap
122
+ gx setup --repair # repair only
123
+ gx setup --install-only # scaffold templates, skip global installs
123
124
  gx doctor # repair + verify (auto-sandboxes on protected main)
125
+ ```
126
+
127
+ ### Targeting other repos
124
128
 
125
- # target another repo without switching your current checkout
129
+ ```sh
126
130
  gx setup --target /path/to/repo
127
131
  gx doctor --target /path/to/repo
128
- # optional VS Code workspace showing repo + agent worktrees
132
+
133
+ # optional: VS Code workspace showing repo + agent worktrees
129
134
  gx setup --target /path/to/repo --parent-workspace-view
135
+ ```
136
+
137
+ ### Monorepo support
138
+
139
+ Setup auto-installs into every nested git repo (e.g. `apps/*/.git`). Submodules and worktrees under `.omx/agent-worktrees/` are skipped.
130
140
 
131
- # monorepo with nested git repos (e.g. /mainfolder/.git + /mainfolder/apps/*/.git)
132
- # setup auto-installs into every nested repo; use --no-recursive to limit to the top-level
141
+ ```sh
133
142
  gx setup --target /mainfolder
134
143
  gx setup --target /mainfolder --no-recursive
144
+ ```
145
+
146
+ ### Protected branches
135
147
 
136
- # protected branch management
148
+ ```sh
137
149
  gx protect list
138
150
  gx protect add release staging
139
151
  gx protect remove release
152
+ gx protect set main release hotfix
153
+ gx protect reset
154
+ ```
155
+
156
+ Defaults: `dev`, `main`, `master`. Stored in git config key `multiagent.protectedBranches`.
140
157
 
141
- # sync current agent branch with origin/<base>
158
+ ### Sync current agent branch
159
+
160
+ ```sh
142
161
  gx sync --check
143
162
  gx sync
163
+ ```
164
+
165
+ ### Background bots
144
166
 
145
- # background bots (review monitor + stale cleanup)
146
- gx agents start
167
+ ```sh
168
+ gx agents start # review monitor + stale cleanup
147
169
  gx agents stop
148
170
  gx agents status
149
171
 
150
- # per-agent-branch lifecycle
151
- gx finish --all # commit + PR + merge every ready agent/* branch
152
- gx cleanup # prune merged/stale branches and worktrees
153
- gx cleanup --watch --interval 60
154
-
155
- # AI-ready setup prompt (paste into Codex/Claude)
156
- gx prompt # full checklist (v6 name: gx copy-prompt)
157
- gx prompt --exec # commands only (v6 name: gx copy-commands)
158
- gx prompt --snippet # AGENTS.md managed block template
159
-
160
- # reports
161
- gx report scorecard --repo github.com/recodeee/guardex
172
+ # tuning
173
+ gx agents start --review-interval 30 --cleanup-interval 60 --idle-minutes 10
162
174
  ```
163
175
 
164
- ### v6 → v7 command migration
165
-
166
- Five commands were consolidated into flags. Old names still work and print a one-line deprecation notice; they'll be removed in v8.
167
-
168
- | v6 command | v7 replacement |
169
- | ---------------------- | ------------------------ |
170
- | `gx init` | `gx setup` |
171
- | `gx install` | `gx setup --install-only`|
172
- | `gx fix` | `gx setup --repair` |
173
- | `gx scan` | `gx status --strict` |
174
- | `gx copy-prompt` | `gx prompt` |
175
- | `gx copy-commands` | `gx prompt --exec` |
176
- | `gx print-agents-snippet` | `gx prompt --snippet` |
177
- | `gx review` | `gx agents start` (runs review + cleanup) |
178
-
179
- ### Continuous stale branch cleanup bot
180
-
181
- Use this to auto-prune idle `agent/*` worktrees created by Codex while keeping active worktrees untouched.
176
+ ### Lifecycle
182
177
 
183
178
  ```sh
184
- # watch cleanup loop every minute (default idle threshold is 10 minutes when --watch is enabled)
179
+ gx finish --all # commit + PR + merge every ready agent/* branch
180
+ gx cleanup # prune merged/stale branches and worktrees
185
181
  gx cleanup --watch --interval 60
186
-
187
- # one-shot cleanup for branches idle at least 10 minutes
188
182
  gx cleanup --idle-minutes 10
189
-
190
- # run a single watch cycle (helpful for cron/CI checks)
191
183
  gx cleanup --watch --once --interval 60
192
184
  ```
193
185
 
194
- ### Repo Agent Supervisor (start both bots with one command)
186
+ ### Prompts for your agents
195
187
 
196
188
  ```sh
197
- # starts review bot + cleanup bot in background for the current repo
198
- gx agents start
199
-
200
- # optional tuning
201
- gx agents start --review-interval 30 --cleanup-interval 60 --idle-minutes 10
202
-
203
- # show whether both bots are running for this repo
204
- gx agents status
205
-
206
- # stop both bots and clear repo-local state
207
- gx agents stop
189
+ gx prompt # full checklist (paste into Codex/Claude)
190
+ gx prompt --exec # commands only
191
+ gx prompt --snippet # AGENTS.md managed-block template
208
192
  ```
209
193
 
210
- ## Important behavior defaults
194
+ ### Reports
211
195
 
212
- - No command defaults to `gx status`.
213
- - `gx init` is alias of `gx setup`.
214
- - Setup/doctor can install missing global OMX/OpenSpec/codex-auth with explicit Y/N confirmation.
215
- - `gx setup` checks GitHub CLI (`gh`) and prints install guidance if missing.
216
- - Optional parent-folder VS Code Source Control view: `gx setup --target /path/to/repo --parent-workspace-view` creates `../<repo>-branches.code-workspace`.
217
- - Monorepo-aware: when the target contains nested git repos (e.g. `apps/*/.git`), `gx setup` installs the workflow into every discovered repo. Git submodules (`.git` files) and guardex worktrees under `.omx/agent-worktrees/` are skipped. Opt out with `--no-recursive`; tune discovery with `--max-depth <n>`, `--skip-nested <dir>`, and `--include-submodules`.
218
- - Interactive self-update prompt defaults to **No** (`[y/N]`).
219
- - In initialized repos, `setup`/`install`/`fix` block protected-base writes unless explicitly overridden.
220
- - Direct commits/pushes to protected branches are blocked by default.
221
- - Exception: VS Code Source Control commits are allowed on protected branches that exist only locally (no upstream and no remote branch).
222
- - Optional repo override for manual VS Code protected-branch writes: `git config multiagent.allowVscodeProtectedBranchWrites true`.
223
- - Codex/agent sessions stay blocked on protected branches and must use `agent/*` branch + PR workflow.
224
- - On protected `main`, `gx doctor` auto-runs in a sandbox agent branch/worktree.
225
- - In-place agent branching is disabled; `scripts/agent-branch-start.sh` always creates a separate worktree to keep your visible local/base branch unchanged.
226
- - Fresh sandbox branches intentionally start without any git upstream; guardex records the protected base in `branch.<name>.guardexBase`, and the first `git push -u` publishes the real upstream branch.
227
- - `scripts/agent-branch-start.sh` hydrates `scripts/codex-agent.sh` into new sandbox worktrees when missing, so auto-finish launcher flow stays available.
196
+ ```sh
197
+ gx report scorecard --repo github.com/recodeee/gitguardex
198
+ ```
228
199
 
229
- ## Configure protected branches
200
+ ---
230
201
 
231
- Default protected branches:
202
+ ## v6 → v7 migration
232
203
 
233
- - `dev`
234
- - `main`
235
- - `master`
204
+ Five commands were consolidated into flags. Old names still work and print a deprecation notice; they'll be removed in v8.
236
205
 
237
- ```sh
238
- gx protect list
239
- gx protect set main release hotfix
240
- gx protect reset
241
- ```
206
+ | v6 | v7 |
207
+ | --------------------------- | ----------------------------- |
208
+ | `gx init` | `gx setup` |
209
+ | `gx install` | `gx setup --install-only` |
210
+ | `gx fix` | `gx setup --repair` |
211
+ | `gx scan` | `gx status --strict` |
212
+ | `gx copy-prompt` | `gx prompt` |
213
+ | `gx copy-commands` | `gx prompt --exec` |
214
+ | `gx print-agents-snippet` | `gx prompt --snippet` |
215
+ | `gx review` | `gx agents start` |
242
216
 
243
- Stored in git config key:
217
+ ---
244
218
 
245
- ```text
246
- multiagent.protectedBranches
247
- ```
219
+ ## Default behavior
248
220
 
249
- ## Companion dependency: GitHub CLI (`gh`)
221
+ A few things worth knowing up front:
250
222
 
251
- GuardeX PR/merge automation depends on GitHub CLI (`gh`), including
252
- `agent-branch-finish.sh` PR flows and `codex-agent.sh` auto-finish behavior.
223
+ - Running `gx` with no command opens the status/health view.
224
+ - `gx init` is just an alias for `gx setup`.
225
+ - Setup/doctor can install missing global OMX, OpenSpec, and codex-auth — but only with explicit Y/N confirmation.
226
+ - Direct commits/pushes to protected branches are **blocked** by default. Agents must use the `agent/*` + PR flow.
227
+ - **Exception:** VS Code Source Control commits are allowed on protected branches that exist only locally (no upstream, no remote branch).
228
+ - On protected `main`, `gx doctor` auto-runs in a sandbox agent branch/worktree so it can't touch your real main.
229
+ - In-place agent branching is disabled. `scripts/agent-branch-start.sh` always creates a separate worktree so your visible local/base branch never changes.
230
+ - Fresh sandbox branches start with no git upstream. Guardex records the protected base in `branch.<name>.guardexBase`, and the first `git push -u` publishes the real upstream.
231
+ - Interactive self-update prompt defaults to **No** (`[y/N]`).
253
232
 
254
- Install + verify:
233
+ Optional override for manual VS Code protected-branch writes:
255
234
 
256
235
  ```sh
257
- # install guide: https://cli.github.com/
258
- gh --version
259
- gh auth status
236
+ git config multiagent.allowVscodeProtectedBranchWrites true
260
237
  ```
261
238
 
262
- ## Optional GitHub Apps: fork sync + PR review
239
+ ---
240
+
241
+ ## Companion tools
263
242
 
264
- ### Pull app (Probot fork sync)
243
+ GitGuardex is designed to work alongside these. All optional — but if you're running many agents, you probably want them.
265
244
 
266
- GuardeX setup now installs a starter file at `.github/pull.yml.example`.
245
+ ### GitHub CLI (`gh`)
267
246
 
268
- To enable fork auto-sync:
247
+ Required for PR/merge automation. `agent-branch-finish.sh` and `codex-agent.sh` auto-finish both depend on it.
269
248
 
270
249
  ```sh
271
- cp .github/pull.yml.example .github/pull.yml
250
+ # https://cli.github.com/
251
+ gh --version
252
+ gh auth status
272
253
  ```
273
254
 
274
- Then edit `.github/pull.yml`:
255
+ ### codex-auth — multi-account switcher
275
256
 
276
- - set `rules[].base` to your fork branch (`main`, `master`, or `dev`)
277
- - set `rules[].upstream` to `<upstream-owner>:<branch>`
257
+ For multi-identity Codex workflows. I built this because switching accounts manually for 30 agents was impossible.
278
258
 
279
- Install the app: <https://github.com/apps/pull>
280
- Validate config: `https://pull.git.ci/check/<owner>/<repo>`
259
+ ```sh
260
+ npm i -g @imdeadpool/codex-account-switcher
281
261
 
282
- ### CR-GPT code review app
262
+ codex-auth save <name>
263
+ codex-auth use <name>
264
+ codex-auth list --details
265
+ codex-auth current
266
+ ```
283
267
 
284
- Install app: <https://github.com/apps/cr-gpt>
268
+ Repo: [recodeecom/codex-account-switcher-cli](https://github.com/recodeecom/codex-account-switcher-cli)
285
269
 
286
- `gx setup` also installs `.github/workflows/cr.yml` (GitHub Actions review workflow).
270
+ ### Pull app fork auto-sync
287
271
 
288
- Then in your repo:
272
+ Guardex installs a starter config at `.github/pull.yml.example`.
289
273
 
290
- 1. `Settings -> Secrets and variables -> Actions`
291
- 2. open `Variables`
292
- 3. add `OPENAI_API_KEY`
274
+ ```sh
275
+ cp .github/pull.yml.example .github/pull.yml
276
+ # edit rules[].base and rules[].upstream
277
+ ```
293
278
 
294
- After that, the app reviews new and updated pull requests automatically.
279
+ Install the app: <https://github.com/apps/pull>
280
+ Validate: `https://pull.git.ci/check/<owner>/<repo>`
295
281
 
296
- ## Frontend mirror sync (`Webu-PRO/guardex-frontend`)
282
+ ### CR-GPT AI PR reviews
297
283
 
298
- This repo includes `.github/workflows/sync-frontend-mirror.yml`, which mirrors
299
- the `frontend/` subtree to a separate repository whenever `main` receives
300
- changes under `frontend/**`.
284
+ Install: <https://github.com/apps/cr-gpt>
301
285
 
302
- Default target:
286
+ `gx setup` installs `.github/workflows/cr.yml`. Then add `OPENAI_API_KEY` under `Settings → Secrets and variables → Actions → Variables`. After that, new and updated PRs get reviewed automatically.
303
287
 
304
- - repo: `Webu-PRO/guardex-frontend`
305
- - branch: `main`
288
+ ---
306
289
 
307
- Required setup (in this repository):
290
+ ## OpenSpec integration
308
291
 
309
- 1. `Settings -> Secrets and variables -> Actions`
310
- 2. Add repository secret `GUARDEX_FRONTEND_MIRROR_PAT`
311
- - value must be a token with `contents:write` access to `Webu-PRO/guardex-frontend`
292
+ If you installed OpenSpec during setup (`@fission-ai/openspec`), the full guide is at [`docs/openspec-getting-started.md`](./docs/openspec-getting-started.md).
312
293
 
313
- Optional overrides (Actions Variables):
294
+ Default flow:
314
295
 
315
- - `GUARDEX_FRONTEND_MIRROR_REPO` (default `Webu-PRO/guardex-frontend`)
316
- - `GUARDEX_FRONTEND_MIRROR_BRANCH` (default `main`)
296
+ ```text
297
+ /opsx:propose <change-name> /opsx:apply → /opsx:archive
298
+ ```
317
299
 
318
- Manual run:
300
+ Expanded flow:
319
301
 
320
- ```sh
321
- gh workflow run sync-frontend-mirror.yml
302
+ ```text
303
+ /opsx:new <change-name> /opsx:ff or /opsx:continue → /opsx:apply → /opsx:verify → /opsx:archive
322
304
  ```
323
305
 
324
- ## Companion dependency: `codex-auth` account switcher
306
+ ### OpenSpec in agent sub-branches
325
307
 
326
- For multi-identity Codex workflows, GuardeX pairs with
327
- [`codex-auth`](https://github.com/recodeecom/codex-account-switcher-cli).
308
+ - `scripts/codex-agent.sh` enforces OpenSpec workspaces before launching Codex.
309
+ - `scripts/agent-branch-start.sh` can scaffold both `openspec/changes/<slug>/` and `openspec/plan/<slug>/` when `GUARDEX_OPENSPEC_AUTO_INIT=true`.
328
310
 
329
- Install:
311
+ Environment variables:
330
312
 
331
- ```sh
332
- npm i -g @imdeadpool/codex-account-switcher
333
- ```
313
+ | Var | Purpose |
314
+ |---|---|
315
+ | `GUARDEX_OPENSPEC_AUTO_INIT` | `true` to auto-bootstrap on branch start (default `false`) |
316
+ | `GUARDEX_OPENSPEC_PLAN_SLUG` | force a specific plan workspace name |
317
+ | `GUARDEX_OPENSPEC_CHANGE_SLUG` | force a specific change workspace name |
318
+ | `GUARDEX_OPENSPEC_CAPABILITY_SLUG` | override capability folder for `spec.md` scaffolding |
334
319
 
335
- Common commands:
336
-
337
- ```sh
338
- codex-auth save <name>
339
- codex-auth use <name>
340
- codex-auth list --details
341
- codex-auth current
342
- ```
320
+ ---
343
321
 
344
322
  ## Files installed by setup
345
323
 
@@ -354,8 +332,8 @@ scripts/install-agent-git-hooks.sh
354
332
  scripts/openspec/init-plan-workspace.sh
355
333
  .githooks/pre-commit
356
334
  .githooks/pre-push
357
- .codex/skills/guardex/SKILL.md
358
- .claude/commands/guardex.md
335
+ .codex/skills/gitguardex/SKILL.md
336
+ .claude/commands/gitguardex.md
359
337
  .github/pull.yml.example
360
338
  .github/workflows/cr.yml
361
339
  .omx/state/agent-file-locks.json
@@ -363,44 +341,51 @@ scripts/openspec/init-plan-workspace.sh
363
341
 
364
342
  If `package.json` exists, setup also adds `agent:*` helper scripts.
365
343
 
366
- ## OpenSpec quick start after `gx setup`
344
+ ---
367
345
 
368
- If you enabled global OpenSpec install during setup (`@fission-ai/openspec`), use the full guide here:
346
+ ## Frontend mirror
369
347
 
370
- - [`docs/openspec-getting-started.md`](./docs/openspec-getting-started.md)
348
+ - Standalone frontend repo: <https://github.com/Webu-PRO/guardex-frontend>
349
+ - This repo tracks the frontend under `frontend/` and auto-mirrors it via `.github/workflows/sync-frontend-mirror.yml` on changes to `main`.
371
350
 
372
- Default core flow:
351
+ Setup (in this repo):
373
352
 
374
- ```text
375
- /opsx:propose <change-name> -> /opsx:apply -> /opsx:archive
376
- ```
353
+ 1. `Settings → Secrets and variables → Actions`
354
+ 2. Add secret `GUARDEX_FRONTEND_MIRROR_PAT` with `contents:write` on `Webu-PRO/guardex-frontend`
355
+
356
+ Optional overrides (Actions Variables):
377
357
 
378
- Optional expanded flow:
358
+ - `GUARDEX_FRONTEND_MIRROR_REPO` (default `Webu-PRO/guardex-frontend`)
359
+ - `GUARDEX_FRONTEND_MIRROR_BRANCH` (default `main`)
360
+
361
+ Manual run:
379
362
 
380
363
  ```sh
381
- openspec config profile <profile-name>
382
- openspec update
364
+ gh workflow run sync-frontend-mirror.yml
383
365
  ```
384
366
 
385
- ```text
386
- /opsx:new <change-name> -> /opsx:ff or /opsx:continue -> /opsx:apply -> /opsx:verify -> /opsx:archive
387
- ```
367
+ ---
388
368
 
389
- ### OpenSpec in agent sub-branches
369
+ ## Known rough edges
370
+
371
+ Being honest about where this still has issues:
372
+
373
+ - **Usage limit mid-task.** When an agent hits its Codex/Claude usage limit partway through, the cleanup flow currently has to be handed to a different agent. It works, but the handoff is uglier than I'd like.
374
+ - **Conflict-stuck probes.** Fixed in v7.0.2 — earlier versions could leak `__source-probe-*` worktrees when the sync-guard rebase hit conflicts. If you're on an older release, `gx cleanup` sweeps these.
375
+ - **Windows.** Most of the hook surface assumes a POSIX shell. Use WSL or symlink-enabled git if you're on Windows.
390
376
 
391
- - `scripts/codex-agent.sh` enforces OpenSpec workspaces before it launches Codex in each sandbox branch/worktree.
392
- - `scripts/agent-branch-start.sh` can scaffold both `openspec/changes/<agent-branch-slug>/` and `openspec/plan/<agent-branch-slug>/` when you set `GUARDEX_OPENSPEC_AUTO_INIT=true`.
393
- - Set `GUARDEX_OPENSPEC_AUTO_INIT=false` (default for `agent-branch-start`) to skip branch-start auto-bootstrap.
394
- - Set `GUARDEX_OPENSPEC_PLAN_SLUG=<kebab-case-slug>` to force a specific plan workspace name.
395
- - Set `GUARDEX_OPENSPEC_CHANGE_SLUG=<kebab-case-slug>` to force a specific change workspace name.
396
- - Set `GUARDEX_OPENSPEC_CAPABILITY_SLUG=<kebab-case-slug>` to override the default capability folder used for `spec.md` scaffolding.
377
+ PRs and issues welcome.
397
378
 
398
- ## Security and maintenance posture
379
+ ---
399
380
 
400
- - CI matrix on Node 18/20/22 (`npm test`, `node --check`, `npm pack --dry-run`)
401
- - trusted publishing with provenance in GitHub Actions
381
+ ## Security & maintenance
382
+
383
+ - CI matrix on Node 18 / 20 / 22 (`npm test`, `node --check`, `npm pack --dry-run`)
384
+ - Trusted publishing with provenance via GitHub Actions
402
385
  - OpenSSF Scorecard + Dependabot for Actions
403
- - disclosure policy in [`SECURITY.md`](./SECURITY.md)
386
+ - Disclosure policy in [`SECURITY.md`](./SECURITY.md)
387
+
388
+ ---
404
389
 
405
390
  ## Local development
406
391
 
@@ -410,201 +395,133 @@ node --check bin/multiagent-safety.js
410
395
  npm pack --dry-run
411
396
  ```
412
397
 
398
+ ---
399
+
413
400
  ## Release notes
414
401
 
415
- ### v7.0.7
402
+ <details>
403
+ <summary><strong>v7.x</strong></summary>
416
404
 
417
- - **Fixed: next publish target now advances past npm.** Bumped `@imdeadpool/guardex` from `7.0.6` to `7.0.7` so the next `npm publish` does not collide with the already-published registry version.
418
- - **Fixed: root package metadata drift in `package-lock.json`.** The lockfile root version had fallen behind the package manifest (`7.0.4` vs. `7.0.6`), which made release metadata inconsistent. The bump resynchronized `package.json` and `package-lock.json` on `7.0.7`.
405
+ ### v7.0.10
406
+ - Primary user-facing long name is now **GitGuardex**. CLI/help presents `gitguardex` as the long-form command; `gx` stays the preferred short alias; `guardex` remains as legacy compatibility.
407
+ - Installed Codex/Claude startup files now use `gitguardex` paths: `.codex/skills/gitguardex/SKILL.md` and `.claude/commands/gitguardex.md`.
408
+ - Startup context shrunk further. Managed marker block + skill + command compressed from 4340 B → 1930 B across the three always-loaded template files.
409
+ - Bumped `@imdeadpool/guardex` from `7.0.9` → `7.0.10`.
419
410
 
420
- ### v7.0.6
411
+ ### v7.0.9
412
+ - `gx doctor` and `gx setup` now refresh AGENTS with repo-toggle examples. Managed AGENTS block states Guardex is enabled by default and shows exact `.env` lines: `GUARDEX_ON=0` disables per repo, `GUARDEX_ON=1` re-enables.
413
+ - Bumped to `7.0.9`.
421
414
 
422
- - **Fixed: self-updater lied about success.** `gx`'s update prompt runs `npm i -g @imdeadpool/guardex@latest` and previously trusted npm's exit code. When npm's resolution cache made it report "changed 1 package" without actually overwriting the files (a known quirk triggered when the user just bumped from N-1 → N in the same session, or with a warm metadata cache), the prompt kept re-firing on every subsequent `gx` invocation because the on-disk `package.json` was still stale. `gx` now re-reads the globally installed `package.json` after the `@latest` install returns, compares its `version` field to the advertised latest, and if they don't match runs a pinned retry `npm i -g @imdeadpool/guardex@<latest>` to force the cache past the obstructing entry. If the pinned retry also fails to advance the on-disk version, the user gets a clear hint (`npm root -g && npm cache verify`) instead of a silent loop.
415
+ ### v7.0.8
416
+ - Added `REPO TOGGLE` section to `gx` status/help output. Operators see the repo-local switch immediately.
417
+ - Bumped to `7.0.8`.
423
418
 
424
- ### v7.0.5
419
+ ### v7.0.7
420
+ - Advanced next publish target past npm. Bumped to `7.0.7`.
421
+ - Fixed root package metadata drift in `package-lock.json` (root version had fallen behind manifest).
425
422
 
426
- - **Added: `oh-my-claude` to `gx status` global-toolchain check.** The Claude-side mirror of `oh-my-codex` is now reported alongside the existing services (`oh-my-codex`, `@fission-ai/openspec`, `@imdeadpool/codex-account-switcher`, `gh`). Users who have not yet installed it will see a clear "inactive" line instead of silent omission, matching the existing codex detection contract.
427
- - **Added: `.omc/` to the managed `.gitignore` block.** `gx setup` / `gx doctor` write a `.omc/` entry next to `.omx/` so Claude-specific runtime state (notepad, worktrees landing there in a follow-up) stays out of commits by default, parity with the existing `.omx/` treatment.
423
+ ### v7.0.6
424
+ - **Fixed: self-updater lied about success.** `gx`'s update prompt runs `npm i -g @imdeadpool/guardex@latest` and previously trusted npm's exit code. When npm's resolution cache reported "changed 1 package" without actually overwriting files (known quirk, triggers when user just bumped N-1 → N in the same session, or with a warm metadata cache), the prompt kept re-firing on every subsequent `gx` invocation because the on-disk `package.json` was stale. `gx` now re-reads the globally installed `package.json` after `@latest` returns, compares its `version` to the advertised latest, and if they don't match runs a pinned retry `npm i -g @imdeadpool/guardex@<latest>` to force past the obstructing cache entry. If the pinned retry also fails, the user gets a clear hint (`npm root -g && npm cache verify`) instead of a silent loop.
428
425
 
429
- ### v7.0.4
426
+ ### v7.0.5
427
+ - Added `oh-my-claude` to `gx status` global-toolchain check. Claude-side mirror of `oh-my-codex` is reported alongside existing services (`oh-my-codex`, `@fission-ai/openspec`, `@imdeadpool/codex-account-switcher`, `gh`).
428
+ - Added `.omc/` to the managed `.gitignore` block so Claude-specific runtime state (notepad, worktrees) stays out of commits, parity with `.omx/`.
430
429
 
431
- - **Fixed: publish collision on npm.** Advanced the package metadata from `7.0.3` to `7.0.4` so `npm publish` no longer targets an already published version.
432
- - **Changed: release-note sync for versioning rule.** Added this versioned entry in README in the same change as the package bump to keep publish metadata and release notes aligned.
430
+ ### v7.0.4
431
+ - Fixed publish collision on npm. Bumped `7.0.3` `7.0.4`.
433
432
 
434
433
  ### v7.0.3
435
-
436
- - **Branch/worktree naming refactor.** `agent-branch-start.sh` now produces `agent/<role>/<task>-<YYYY-MM-DD>-<HH-MM>` instead of `agent/<role+account-email>/<snapshot-slug>-<task>-<cksum6>`. Codex account names (e.g. `Zeus Edix Hu`) and 6-hex checksums no longer leak into branch or worktree paths.
437
- - **Role normalization.** `AGENT_NAME` is collapsed to `{claude, codex, <explicit>}` via (in order) the `GUARDEX_AGENT_TYPE` env override, a substring match against `claude`/`codex`, the `CLAUDECODE=1` sentinel, or a fallback to `codex`. Other roles (`integrator`, `executor`, etc.) pass through when set via `GUARDEX_AGENT_TYPE`.
438
- - **New `--print-name-only` flag** on `agent-branch-start.sh` for deterministic tests; honours `GUARDEX_BRANCH_TIMESTAMP` for reproducible output.
439
- - **`--tier` flag accepted silently** for CLAUDE.md compatibility (scaffold sizing not wired through yet).
440
- - Tests `install.test.js` covering the old snapshot-slug format were rewritten to assert the new role-datetime shape.
434
+ - **Branch/worktree naming refactor.** `agent-branch-start.sh` now produces `agent/<role>/<task>-<YYYY-MM-DD>-<HH-MM>` instead of `agent/<role+account-email>/<snapshot-slug>-<task>-<cksum6>`. Account names and 6-hex checksums no longer leak into branch/worktree paths.
435
+ - **Role normalization.** `AGENT_NAME` collapses to `{claude, codex, <explicit>}` via (in order) `GUARDEX_AGENT_TYPE` env override, substring match against `claude`/`codex`, `CLAUDECODE=1` sentinel, or fallback to `codex`. Other roles (`integrator`, `executor`, etc.) pass through when set via `GUARDEX_AGENT_TYPE`.
436
+ - New `--print-name-only` flag for deterministic tests; honors `GUARDEX_BRANCH_TIMESTAMP` for reproducible output.
437
+ - `--tier` flag accepted silently for CLAUDE.md compatibility (scaffold sizing not wired through yet).
441
438
 
442
439
  ### v7.0.2
443
-
444
- - **Fix: `__source-probe-*` worktree leak on conflict exit.** `agent-branch-finish.sh` was registering its `cleanup()` trap *after* the sync-guard rebase block, so when that rebase hit conflicts and the script exited, the throwaway probe worktree was never removed. `gx doctor` sweeps against stalled branches accumulated one new probe per run.
445
- - The cleanup trap is now installed immediately after probe creation, and aborts any in-progress `rebase`/`merge` before `worktree remove --force` so conflict-stuck probes are cleaned up reliably.
440
+ - **Fix: `__source-probe-*` worktree leak on conflict exit.** `agent-branch-finish.sh` was registering its `cleanup()` trap *after* the sync-guard rebase block, so when rebase hit conflicts and the script exited, the throwaway probe worktree was never removed. `gx doctor` sweeps accumulated one new probe per run.
441
+ - Cleanup trap is now installed immediately after probe creation, and aborts any in-progress `rebase`/`merge` before `worktree remove --force`.
446
442
 
447
443
  ### v7.0.1
448
-
449
444
  - Maintenance release.
450
445
 
451
446
  ### v7.0.0
452
-
453
- - **Breaking (soft).** Consolidated 17 commands into 12 visible commands with flag-based subcommands. Five removed names (`init`, `install`, `fix`, `scan`, `copy-prompt`, `copy-commands`, `print-agents-snippet`, `review`) still work but print a one-line deprecation notice on stderr and will be removed in v8. See the migration table in "Copy-paste: common commands" above.
454
- - **Token-usage improvements.** Trimmed the auto-installed agent templates that live inside every consumer repo and get loaded into every Claude/Codex session:
447
+ - **Breaking (soft).** Consolidated 17 commands into 12 visible commands with flag-based subcommands. Removed names still work but print a deprecation notice; will be removed in v8.
448
+ - **Token-usage improvements.** Trimmed auto-installed agent templates that live in every consumer repo and get loaded into every session:
455
449
  - `templates/AGENTS.multiagent-safety.md`: 6990 B → 1615 B (−77%)
456
450
  - `templates/codex/skills/guardex/SKILL.md`: 2732 B → 1086 B (−60%)
457
451
  - `templates/claude/commands/guardex.md`: 472 B → 357 B (−24%)
458
452
  - Total: 10194 B → 3058 B per consumer repo (−70%, ~1.5k fewer tokens per agent session).
453
+ - New `gx prompt` command replaces three prompt-emitting commands.
454
+ - New flag surface on `gx setup`: `--install-only`, `--repair`.
455
+ - New `gx status --strict` mirrors old `gx scan`.
459
456
 
460
- The `AI_SETUP_PROMPT` and `AI_SETUP_COMMANDS` constants used by `gx prompt` are now compact checklists, so piping `gx prompt` into a model context is cheaper too.
461
- - **New `gx prompt` command** replaces three prompt-emitting commands: `gx prompt` (full checklist), `gx prompt --exec` (commands only), `gx prompt --snippet` (AGENTS.md managed-block template).
462
- - **New flag surface on `gx setup`**: `--install-only` (templates/hooks/locks only), `--repair` (fix drift), plus the existing `--target`, `--parent-workspace-view`, `--dry-run`, etc.
463
- - **New `gx status --strict`** mirrors the old `gx scan` behavior (exit non-zero on findings).
464
- - Updated internal `REQUIRED_PACKAGE_SCRIPTS` for consumer `package.json` so `agent:safety:scan` and `agent:safety:fix` helper scripts now invoke the new v7 surface (`gx status --strict`, `gx setup --repair`).
457
+ </details>
465
458
 
466
- ### v6.0.1
459
+ <details>
460
+ <summary><strong>v6.x</strong></summary>
467
461
 
468
- - Preserve existing repo-owned `AGENTS.md` marker content during `gx setup` / `gx doctor` by default; only rewrite marker blocks when `--force` is explicitly used.
469
- - Preserve existing `agent:*` package scripts during setup/doctor repairs by default so repo-local command customizations are not silently replaced.
470
- - Forward `--force` through sandboxed doctor execution so intentional canonical template/script rewrites still work end-to-end.
471
- - Added regression tests for both preservation behaviors (`setup` + `doctor`).
472
- - Bumped package version from `6.0.0` to `6.0.1` for the next npm publish.
462
+ ### v6.0.1
463
+ - Preserve existing repo-owned `AGENTS.md` marker content during `gx setup` / `gx doctor` by default; only rewrite marker blocks when `--force` is explicit.
464
+ - Preserve existing `agent:*` package scripts during setup/doctor repairs by default.
465
+ - Forward `--force` through sandboxed doctor execution.
466
+ - Added regression tests for both preservation behaviors.
473
467
 
474
468
  ### v6.0.0
469
+ - **Breaking** — removed legacy `musafety` bin alias and all `MUSAFETY_*` environment variables. Callers must migrate to `guardex` / `gx` and `GUARDEX_*`.
470
+ - **Breaking** — bootstrap manifest filename changed from `musafety-bootstrap-manifest.json` to `guardex-bootstrap-manifest.json`; existing sandbox worktrees must be pruned + re-bootstrapped.
471
+ - Rebranded `musafety` → `guardex` across scripts, templates, hooks, tests, docs.
472
+ - The descriptive phrase `multiagent-safety` (including `bin/multiagent-safety.js`) is preserved — only the short codename changed.
475
473
 
476
- - **Breaking** — removed the legacy `musafety` bin alias and all `MUSAFETY_*` environment variables. Callers must migrate to the `guardex` / `gx` bins and the `GUARDEX_*` env-var surface.
477
- - **Breaking** — bootstrap manifest filename changed from `musafety-bootstrap-manifest.json` to `guardex-bootstrap-manifest.json`; existing sandbox worktrees must be pruned + re-bootstrapped (or have their manifest manually renamed).
478
- - Rebranded all remaining `musafety` / `Musafety` / `MUSAFETY` codename tokens to `guardex` / `Guardex` / `GUARDEX` across scripts, templates, hooks, tests, and docs.
479
- - The descriptive phrase `multiagent-safety` (including `bin/multiagent-safety.js` and `templates/AGENTS.multiagent-safety.md`) is preserved intentionally — only the short codename changed.
480
- - Bumped package version from `5.0.17` to `6.0.0` for the next npm publish.
481
-
482
- ### v5.0.17
483
-
484
- - Bumped package version from `5.0.16` to `5.0.17` for the next npm publish.
485
-
486
- ### v5.0.16
487
-
488
- - Fixed `gx doctor` runtime crash (`parseDoctorArgs is not defined`) by restoring the doctor argument parser for `--target` and `--strict`.
489
- - Fixed `gx doctor` command routing so the repair-first doctor flow remains the active command path (duplicate legacy doctor definition no longer overrides it).
490
- - Updated worktree change detection to run `git status --porcelain --untracked-files=normal --` for consistent normal untracked-file behavior.
491
- - Added regression coverage that asserts the doctor parser function exists in `bin/multiagent-safety.js`.
492
- - Bumped package version from `5.0.15` to `5.0.16`.
493
-
494
- ### v5.0.15
495
-
496
- - Added `gx setup --parent-workspace-view` to generate a parent-folder VS Code workspace (`../<repo>-branches.code-workspace`) that shows both the base repo and `.omx/agent-worktrees` in Source Control.
497
- - Added dry-run-safe parent workspace operations (`would-create` / `would-update`) and setup output that prints the created workspace path.
498
- - Added regression coverage for parent workspace generation and dry-run behavior.
499
- - Bumped package version from `5.0.14` to `5.0.15`.
500
-
501
- ### v5.0.14
502
-
503
- - Changed release metadata for the next npm publish by bumping package version from `5.0.13` to `5.0.14`.
504
- - Kept Guardex release notes synchronized with the published package version.
505
-
506
- ### v5.0.13
507
-
508
- - Bumped package version from `5.0.12` to `5.0.13` for the next npm publish.
509
-
510
- ### v5.0.12
511
-
512
- - Bumped package version from `5.0.11` to `5.0.12` for the next npm publish.
513
- - Updated repository metadata and README links to the renamed GitHub repository (`recodeee/guardex`).
514
-
515
- ### v5.0.11
516
-
517
- - Updated the managed AGENTS contract wording to use `GX` naming and added an explicit OMX completion policy requiring commit + push + PR creation/update at task completion.
518
- - Ensured `gx install` explicitly configures the managed `AGENTS.md` policy block and added regression coverage for this install-path behavior.
519
- - Bumped package version from `5.0.10` to `5.0.11` for the next npm publish.
520
-
521
- ### v5.0.10
474
+ </details>
522
475
 
523
- - Bumped package version from `5.0.9` to `5.0.10` for the next npm publish.
476
+ <details>
477
+ <summary><strong>v5.x</strong></summary>
524
478
 
525
- ### v5.0.9
526
-
527
- - Enforced OpenSpec workspace bootstrap for sandbox agent execution: `scripts/codex-agent.sh` now initializes `openspec/plan/<agent-branch-slug>/` before launching Codex, and `scripts/agent-branch-start.sh` supports `GUARDEX_OPENSPEC_AUTO_INIT` plus `GUARDEX_OPENSPEC_PLAN_SLUG`.
528
- - Tightened doctor auto-finish correctness: sandbox finish now waits for merge and exits non-zero if the PR closes without merge, so repair flows are not reported as complete when policy blocks merge.
529
- - Updated package version from `5.0.8` to `5.0.9` for the next npm publish.
530
-
531
- ### v5.0.8
532
-
533
- - Fixed `bin/multiagent-safety.js` syntax regressions in the doctor sandbox flow (`Unexpected identifier` / `Unexpected end of input`) that were breaking CLI execution and CI tests.
534
- - Restored `scripts/codex-agent.sh` from `templates/scripts/codex-agent.sh` so critical runtime helper parity checks pass in clean CI clones.
535
- - Bumped package version from `5.0.7` to `5.0.8` for the next npm publish.
536
-
537
- ### v5.0.7
538
- ### Unreleased (generated draft, not versioned yet)
539
-
540
- - Add the user-facing changes for the next release here before assigning a version number.
541
- - Keep this section focused on behavior changes (`Added`, `Changed`, `Fixed`) rather than version-bump-only notes.
479
+ ### v5.0.17 – v5.0.10
480
+ Version bumps for npm publish continuity plus incremental fixes: doctor arg-parser restored (5.0.16), parent-workspace view added (5.0.15), OMX completion policy wording (5.0.11), OpenSpec sandbox bootstrap enforced (5.0.9), bin syntax regressions fixed (5.0.8).
542
481
 
543
482
  ### v5.0.6
544
-
545
- - `gx cleanup` and auto-finish cleanup now prune clean agent worktrees by default, so VS Code Source Control focuses on your local branch plus worktrees with active changes.
546
- - Added `gx cleanup --keep-clean-worktrees` to opt out and keep clean worktrees visible.
547
- - Bumped package version from `5.0.5` to `5.0.6` for the next npm publish.
548
-
549
- ### v5.0.5
550
-
551
- - Bumped package version from `5.0.4` to `5.0.5` so npm publish can proceed with the next patch release.
552
-
553
- ### v5.0.4
554
-
555
- - Bumped package version from `5.0.3` to `5.0.4` to stay one patch ahead of the current npm published version.
556
-
557
- ### v5.0.3
558
-
559
- - Bumped package version from `5.0.2` to `5.0.3` for the next npm publish.
483
+ - `gx cleanup` and auto-finish cleanup now prune clean agent worktrees by default. VS Code Source Control focuses on your local branch + worktrees with active changes.
484
+ - Added `gx cleanup --keep-clean-worktrees` to opt out.
560
485
 
561
486
  ### v5.0.2
562
-
563
- - Auto-closes Codex sandbox branches through PR workflow and keeps merged branch/worktree sandboxes for explicit cleanup via `gx cleanup`.
487
+ - Auto-closes Codex sandbox branches through PR workflow; keeps merged branch/worktree sandboxes for explicit cleanup via `gx cleanup`.
564
488
  - Runs `gx doctor` repairs from a sandbox when `main` is protected.
565
489
  - Allows tightly guarded Codex-only commits for `AGENTS.md` / `.gitignore` on protected branches.
566
- - Advanced package version to keep npm publishing unblocked.
567
490
 
568
491
  ### v5.0.0
569
-
570
- - Rebranded the CLI to **GuardeX** with `gx`-first command UX.
571
- - Published under scoped package name `@imdeadpool/guardex` to avoid npm name collisions.
572
- - Enforced a repeatable per-message agent branch lifecycle in setup/init flows.
492
+ - Rebranded CLI to **GuardeX** with `gx`-first command UX.
493
+ - Published under scoped package name `@imdeadpool/guardex`.
494
+ - Enforced repeatable per-message agent branch lifecycle in setup/init flows.
573
495
  - Added codex-auth-aware sandbox branch naming support.
574
496
 
575
- ### v0.4.6
497
+ </details>
576
498
 
577
- - Added repository metadata (`repository`, `bugs`, `homepage`, `funding`) in package manifest.
578
- - Added CI workflow for Node 18/20/22 with packaging and syntax verification.
579
- - Added npm provenance-oriented release workflow, OpenSSF Scorecard workflow, and Dependabot for Actions.
499
+ <details>
500
+ <summary><strong>v0.4.x</strong></summary>
501
+
502
+ ### v0.4.6
503
+ - Added repository metadata (`repository`, `bugs`, `homepage`, `funding`).
504
+ - Added CI workflow for Node 18/20/22.
505
+ - Added npm provenance release workflow, OpenSSF Scorecard, Dependabot for Actions.
580
506
  - Added explicit `SECURITY.md` and `CONTRIBUTING.md`.
581
507
 
582
508
  ### v0.4.5
583
-
584
509
  - Added optional pre-commit behind-threshold sync gate (`multiagent.sync.requireBeforeCommit`, `multiagent.sync.maxBehindCommits`).
585
- - Added `gx sync` workflow (`--check`, sync strategies, report mode).
586
- - `agent-branch-finish.sh` now blocks finishing when source branch is behind `origin/<base>` (config-aware).
510
+ - Added `gx sync` workflow (`--check`, strategies, report mode).
511
+ - `agent-branch-finish.sh` blocks finishing when source is behind `origin/<base>`.
587
512
 
588
513
  ### v0.4.4
589
-
590
514
  - Added `scripts/agent-worktree-prune.sh` to templates/install.
591
- - `agent-branch-finish.sh` now auto-runs prune after merge (best effort).
592
- - Added npm helper script: `agent:cleanup`.
515
+ - `agent-branch-finish.sh` auto-runs prune after merge.
516
+ - Added npm helper: `agent:cleanup`.
593
517
 
594
518
  ### v0.4.2
595
-
596
- - Setup now detects existing global OMX/OpenSpec installs first.
597
- - If tools are already present, setup skips global install automatically.
598
- - Interactive approval is strict `[y/n]` (waits for explicit answer).
599
- - Added setup screenshot to README.
600
- - Added workflow screenshots (branch start, lock/delete guard, source-control view).
519
+ - Setup detects existing global OMX/OpenSpec installs first; skips global install if tools are present.
520
+ - Interactive approval is strict `[y/n]`.
521
+ - Added setup + workflow screenshots.
601
522
 
602
523
  ### v0.4.0
524
+ - Added setup-time Y/N approval for optional global install of `oh-my-codex` and `@fission-ai/openspec`.
525
+ - Added setup flags: `--yes-global-install`, `--no-global-install`.
603
526
 
604
- - Added setup-time Y/N approval prompt for optional global install of:
605
- - `oh-my-codex`
606
- - `@fission-ai/openspec`
607
- - Added setup flags for automation:
608
- - `--yes-global-install`
609
- - `--no-global-install`
610
- - Added official repo links for OMX and OpenSpec.
527
+ </details>
package/SECURITY.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Supported Versions
4
4
 
5
- Only the latest published `guardex` version is supported for security fixes.
5
+ Only the latest published GitGuardex CLI build is supported for security fixes.
6
6
 
7
7
  ## Reporting a Vulnerability
8
8
 
@@ -7,7 +7,7 @@ const cp = require('node:child_process');
7
7
  const packageJsonPath = path.resolve(__dirname, '..', 'package.json');
8
8
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
9
9
 
10
- const TOOL_NAME = 'guardex';
10
+ const TOOL_NAME = 'gitguardex';
11
11
  const SHORT_TOOL_NAME = 'gx';
12
12
  const LEGACY_NAMES = ['guardex', 'multiagent-safety'];
13
13
  const OPENSPEC_PACKAGE = '@fission-ai/openspec';
@@ -58,9 +58,9 @@ const TEMPLATE_FILES = [
58
58
  'githooks/pre-push',
59
59
  'githooks/post-merge',
60
60
  'githooks/post-checkout',
61
- 'codex/skills/guardex/SKILL.md',
61
+ 'codex/skills/gitguardex/SKILL.md',
62
62
  'codex/skills/guardex-merge-skills-to-dev/SKILL.md',
63
- 'claude/commands/guardex.md',
63
+ 'claude/commands/gitguardex.md',
64
64
  'github/pull.yml.example',
65
65
  'github/workflows/cr.yml',
66
66
  ];
@@ -143,9 +143,9 @@ const MANAGED_GITIGNORE_PATHS = [
143
143
  '.githooks/post-merge',
144
144
  '.githooks/post-checkout',
145
145
  'oh-my-codex/',
146
- '.codex/skills/guardex/SKILL.md',
146
+ '.codex/skills/gitguardex/SKILL.md',
147
147
  '.codex/skills/guardex-merge-skills-to-dev/SKILL.md',
148
- '.claude/commands/guardex.md',
148
+ '.claude/commands/gitguardex.md',
149
149
  LOCK_FILE_RELATIVE,
150
150
  ];
151
151
  const OMX_SCAFFOLD_DIRECTORIES = [
@@ -196,7 +196,7 @@ const SUGGESTIBLE_COMMANDS = [
196
196
  'release',
197
197
  ];
198
198
  const CLI_COMMAND_DESCRIPTIONS = [
199
- ['status', 'Show GuardeX CLI + service health without modifying files'],
199
+ ['status', 'Show GitGuardex CLI + service health without modifying files'],
200
200
  ['setup', 'Install, repair, and verify guardrails (flags: --repair, --install-only, --target)'],
201
201
  ['doctor', 'Repair drift + verify (auto-sandboxes on protected main)'],
202
202
  ['protect', 'Manage protected branches (list/add/remove/set/reset)'],
@@ -223,24 +223,20 @@ const AGENT_BOT_DESCRIPTIONS = [
223
223
  ['agents', 'Start/stop review + cleanup bots for this repo'],
224
224
  ];
225
225
 
226
- const AI_SETUP_PROMPT = `GuardeX (gx) setup checklist for Codex/Claude in this repo.
227
-
228
- 1) Install: npm i -g @imdeadpool/guardex && gh --version
229
- 2) Bootstrap: gx setup # installs hooks/templates + verifies; prompts Y/N for global OMX/OpenSpec/codex-auth
230
- 3) If degraded: gx doctor # repair + re-verify
231
- 4) Per task: bash scripts/codex-agent.sh "<task>" "<agent>"
232
- # or manual:
233
- # bash scripts/agent-branch-start.sh "<task>" "<agent>"
234
- # python3 scripts/agent-file-locks.py claim --branch "$(git rev-parse --abbrev-ref HEAD)" <file...>
235
- # bash scripts/agent-branch-finish.sh --branch "$(git rev-parse --abbrev-ref HEAD)" --via-pr --wait-for-merge
236
- 5) Finalize all: gx finish --all
237
- 6) Cleanup: gx cleanup
238
- 7) OpenSpec: /opsx:propose -> /opsx:apply -> /opsx:archive (see docs/openspec-getting-started.md)
239
- 8) Protect: gx protect add release staging (optional)
240
- 9) Sync: gx sync --check && gx sync (optional; rebase onto base)
241
- 10) Fork sync: cp .github/pull.yml.example .github/pull.yml (optional; install https://github.com/apps/pull)
242
- 11) PR review bot: install https://github.com/apps/cr-gpt + set OPENAI_API_KEY in Actions variables (uses .github/workflows/cr.yml)
243
- 12) GitHub repo: enable Settings -> PRs -> Automatically delete head branches
226
+ const AI_SETUP_PROMPT = `GitGuardex (gx) setup checklist for Codex/Claude in this repo.
227
+
228
+ 1) Install: npm i -g @imdeadpool/guardex && gh --version
229
+ 2) Bootstrap: gx setup
230
+ 3) Repair: gx doctor
231
+ 4) Task loop: bash scripts/codex-agent.sh "<task>" "<agent>"
232
+ or branch-start -> claim -> branch-finish
233
+ 5) Finish: gx finish --all
234
+ 6) Cleanup: gx cleanup
235
+ 7) OpenSpec: /opsx:propose -> /opsx:apply -> /opsx:archive
236
+ 8) Optional: gx protect add release staging
237
+ 9) Optional: gx sync --check && gx sync
238
+ 10) Review bot: install https://github.com/apps/cr-gpt + set OPENAI_API_KEY
239
+ 11) Fork sync: cp .github/pull.yml.example .github/pull.yml
244
240
  `;
245
241
 
246
242
  const AI_SETUP_COMMANDS = `npm i -g @imdeadpool/guardex
@@ -251,7 +247,7 @@ bash scripts/codex-agent.sh "<task>" "<agent>"
251
247
  gx finish --all
252
248
  gx cleanup
253
249
  gx protect add release staging
254
- gx sync
250
+ gx sync --check && gx sync
255
251
  `;
256
252
 
257
253
  const SCORECARD_RISK_BY_CHECK = {
@@ -320,10 +316,17 @@ function agentBotCatalogLines(indent = ' ') {
320
316
  );
321
317
  }
322
318
 
319
+ function repoToggleLines(indent = ' ') {
320
+ return [
321
+ `${indent}Set repo-root .env: ${GUARDEX_REPO_TOGGLE_ENV}=0 disables Guardex, ${GUARDEX_REPO_TOGGLE_ENV}=1 enables it again`,
322
+ ];
323
+ }
324
+
323
325
  function printToolLogsSummary() {
324
326
  const usageLine = ` $ ${SHORT_TOOL_NAME} <command> [options]`;
325
327
  const commandDetails = commandCatalogLines(' ');
326
328
  const agentBotDetails = agentBotCatalogLines(' ');
329
+ const repoToggleDetails = repoToggleLines(' ');
327
330
 
328
331
  if (!supportsAnsiColors()) {
329
332
  console.log(`${TOOL_NAME}-tools logs:`);
@@ -337,6 +340,10 @@ function printToolLogsSummary() {
337
340
  for (const line of agentBotDetails) {
338
341
  console.log(line);
339
342
  }
343
+ console.log(' REPO TOGGLE');
344
+ for (const line of repoToggleDetails) {
345
+ console.log(line);
346
+ }
340
347
  return;
341
348
  }
342
349
 
@@ -344,6 +351,7 @@ function printToolLogsSummary() {
344
351
  const usageHeader = colorize('USAGE', '1');
345
352
  const commandsHeader = colorize('COMMANDS', '1');
346
353
  const agentBotHeader = colorize('AGENT BOT', '1');
354
+ const repoToggleHeader = colorize('REPO TOGGLE', '1');
347
355
  const pipe = colorize('│', '90');
348
356
  const tee = colorize('├', '90');
349
357
  const corner = colorize('└', '90');
@@ -367,6 +375,14 @@ function printToolLogsSummary() {
367
375
  }
368
376
  console.log(` ${pipe}${line.slice(2)}`);
369
377
  }
378
+ console.log(` ${tee}─ ${repoToggleHeader}`);
379
+ for (const line of repoToggleDetails) {
380
+ if (!line) {
381
+ console.log(` ${pipe}`);
382
+ continue;
383
+ }
384
+ console.log(` ${pipe}${line.slice(2)}`);
385
+ }
370
386
  console.log(` ${corner}─ ${colorize(`Try '${TOOL_NAME} doctor' for one-step repair + verification.`, '2')}`);
371
387
  }
372
388
 
@@ -387,6 +403,9 @@ ${commandCatalogLines().join('\n')}
387
403
  AGENT BOT
388
404
  ${agentBotCatalogLines().join('\n')}
389
405
 
406
+ REPO TOGGLE
407
+ ${repoToggleLines().join('\n')}
408
+
390
409
  NOTES
391
410
  - No command = ${SHORT_TOOL_NAME} status. ${SHORT_TOOL_NAME} init is an alias of ${SHORT_TOOL_NAME} setup.
392
411
  - Global installs need Y/N approval; GitHub CLI (gh) is required for PR automation.
@@ -785,7 +804,7 @@ function ensureAgentsSnippet(repoRoot, dryRun, options = {}) {
785
804
  if (!dryRun) {
786
805
  fs.writeFileSync(agentsPath, next, 'utf8');
787
806
  }
788
- return { status: 'updated', file: 'AGENTS.md', note: 'refreshed guardex-managed block' };
807
+ return { status: 'updated', file: 'AGENTS.md', note: 'refreshed gitguardex-managed block' };
789
808
  }
790
809
 
791
810
  if (existing.includes(AGENTS_MARKER_START)) {
@@ -816,7 +835,7 @@ function ensureManagedGitignore(repoRoot, dryRun) {
816
835
  if (!dryRun) {
817
836
  fs.writeFileSync(gitignorePath, `${managedBlock}\n`, 'utf8');
818
837
  }
819
- return { status: 'created', file: '.gitignore', note: 'added guardex-managed entries' };
838
+ return { status: 'created', file: '.gitignore', note: 'added gitguardex-managed entries' };
820
839
  }
821
840
 
822
841
  const existing = fs.readFileSync(gitignorePath, 'utf8');
@@ -828,14 +847,14 @@ function ensureManagedGitignore(repoRoot, dryRun) {
828
847
  if (!dryRun) {
829
848
  fs.writeFileSync(gitignorePath, next, 'utf8');
830
849
  }
831
- return { status: 'updated', file: '.gitignore', note: 'refreshed guardex-managed entries' };
850
+ return { status: 'updated', file: '.gitignore', note: 'refreshed gitguardex-managed entries' };
832
851
  }
833
852
 
834
853
  const separator = existing.endsWith('\n') ? '\n' : '\n\n';
835
854
  if (!dryRun) {
836
855
  fs.writeFileSync(gitignorePath, `${existing}${separator}${managedBlock}\n`, 'utf8');
837
856
  }
838
- return { status: 'updated', file: '.gitignore', note: 'appended guardex-managed entries' };
857
+ return { status: 'updated', file: '.gitignore', note: 'appended gitguardex-managed entries' };
839
858
  }
840
859
 
841
860
  function configureHooks(repoRoot, dryRun) {
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@imdeadpool/guardex",
3
- "version": "7.0.7",
4
- "description": "GuardeX: the Guardian T-Rex for your repo, with hardened multi-agent git guardrails.",
3
+ "version": "7.0.10",
4
+ "description": "GitGuardex: hardened multi-agent git guardrails for parallel agent work.",
5
5
  "license": "MIT",
6
6
  "preferGlobal": true,
7
7
  "bin": {
8
+ "gitguardex": "bin/multiagent-safety.js",
8
9
  "guardex": "bin/multiagent-safety.js",
9
10
  "gx": "bin/multiagent-safety.js",
10
11
  "multiagent-safety": "bin/multiagent-safety.js"
@@ -43,6 +44,7 @@
43
44
  "CONTRIBUTING.md"
44
45
  ],
45
46
  "keywords": [
47
+ "gitguardex",
46
48
  "guardex",
47
49
  "multi-agent",
48
50
  "git-hooks",
@@ -53,10 +55,10 @@
53
55
  "author": "recodeecom",
54
56
  "repository": {
55
57
  "type": "git",
56
- "url": "git+https://github.com/recodeee/guardex.git"
58
+ "url": "git+https://github.com/recodeee/gitguardex.git"
57
59
  },
58
60
  "bugs": {
59
- "url": "https://github.com/recodeee/guardex/issues"
61
+ "url": "https://github.com/recodeee/gitguardex/issues"
60
62
  },
61
63
  "homepage": "https://guardextutorial.com",
62
64
  "funding": "https://github.com/sponsors/recodeecom",
@@ -1,21 +1,21 @@
1
1
  <!-- multiagent-safety:START -->
2
2
  ## Multi-Agent Safety Contract
3
3
 
4
- **Repo toggle.** Guardex is enabled by default. If the repo root `.env` sets `GUARDEX_ON=0`, `false`, `no`, or `off`, treat this entire Guardex contract as disabled for the repo and do not require Guardex worktrees, lock claims, completion flow, or OpenSpec workflow until `GUARDEX_ON` is re-enabled.
4
+ **Repo toggle.** `GUARDEX_ON=0|false|no|off` disables this contract. `GUARDEX_ON=1|true|yes|on` re-enables it.
5
5
 
6
- **Isolation.** Every task runs on a dedicated `agent/*` branch + worktree. Start with `scripts/agent-branch-start.sh "<task>" "<agent-name>"`. Treat the base branch (`main`/`dev`) as read-only while an agent branch is active. Never `git checkout <branch>` on a primary working tree (including nested repos); use `git worktree add` instead. The `.githooks/post-checkout` hook auto-reverts primary-branch switches during agent sessions — bypass only with `GUARDEX_ALLOW_PRIMARY_BRANCH_SWITCH=1`.
6
+ **Isolation.** One task = one `agent/*` branch + worktree. Start `scripts/agent-branch-start.sh "<task>" "<agent>"`. Base branches stay read-only. No `git checkout` on primary worktrees; use `git worktree add`. `.githooks/post-checkout` auto-reverts primary-branch switches unless `GUARDEX_ALLOW_PRIMARY_BRANCH_SWITCH=1`.
7
7
 
8
- **Ownership.** Before editing, claim files: `scripts/agent-file-locks.py claim --branch "<agent-branch>" <file...>`. Before deleting, confirm the path is in your claim. Don't edit outside your scope unless reassigned.
8
+ **Ownership.** Claim before edits: `scripts/agent-file-locks.py claim --branch "<agent-branch>" <file...>`. Delete only claimed paths.
9
9
 
10
- **Handoff gate.** Post a one-line handoff note (plan/change, owned scope, intended action) before editing. Re-read the latest handoffs before replacing others' code.
10
+ **Handoff.** Post a one-line note before edits. Re-read latest handoffs before replacing nearby work.
11
11
 
12
- **Completion.** Finish with `scripts/agent-branch-finish.sh --branch "<agent-branch>" --via-pr --wait-for-merge --cleanup` (or `gx finish --all`). Task is only complete when: commit pushed, PR URL recorded, state = `MERGED`, sandbox worktree pruned. If anything blocks, append a `BLOCKED:` note and stop — don't half-finish.
12
+ **Completion.** Finish with `scripts/agent-branch-finish.sh --branch "<agent-branch>" --via-pr --wait-for-merge --cleanup` or `gx finish --all`. Done = commit pushed, PR URL recorded, state=`MERGED`, sandbox pruned. If blocked, append `BLOCKED:` and stop.
13
13
 
14
- **Parallel safety.** Assume other agents edit nearby. Never revert unrelated changes. Report conflicts in the handoff.
14
+ **Parallel safety.** Never revert unrelated edits. Report conflicts.
15
15
 
16
- **Reporting.** Every completion handoff includes: files changed, behavior touched, verification commands + results, risks/follow-ups.
16
+ **Reporting.** Completion handoff includes files changed, behavior touched, verification commands/results, and risks/follow-ups.
17
17
 
18
- **OpenSpec (when change-driven).** Keep `openspec/changes/<slug>/tasks.md` checkboxes current during work, not batched at the end. Task scaffolds and manual task edits must include an explicit final completion/cleanup section that ends with PR merge + sandbox cleanup (`gx finish --via-pr --wait-for-merge --cleanup` or `scripts/agent-branch-finish.sh ... --cleanup`) and records PR URL + final `MERGED` evidence. Verify specs with `openspec validate --specs` before archive. Don't archive unverified.
18
+ **OpenSpec.** Keep `openspec/changes/<slug>/tasks.md` current. End task scaffolds with PR merge + sandbox cleanup evidence. Run `openspec validate --specs` before archive.
19
19
 
20
20
  **Version bumps.** If a change bumps a published version, the same PR updates release notes/changelog.
21
21
  <!-- multiagent-safety:END -->
@@ -0,0 +1,5 @@
1
+ # /gitguardex
2
+
3
+ Run repo repair flow: `gx status` -> `gx doctor` -> `gx status --strict`.
4
+
5
+ Report `Repo is guarded` or `Repo is not guarded` with blockers.
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: gitguardex
3
+ description: "Repo guardrail check and repair."
4
+ ---
5
+
6
+ Use when repo safety may be broken.
7
+
8
+ `gx status` -> `gx doctor` -> `gx status --strict`
9
+
10
+ Bootstrap: `gx setup`
11
+ Ops: `bash scripts/codex-agent.sh "<task>" "<agent>"`, `gx finish --all`, `gx cleanup`
@@ -89,5 +89,5 @@ The system SHALL enforce ${CAPABILITY_SLUG} behavior as defined by this change.
89
89
  SPECEOF
90
90
  fi
91
91
 
92
- echo "[guardex] OpenSpec change workspace ready: ${CHANGE_DIR}"
93
- echo "[guardex] OpenSpec change spec scaffold: ${SPEC_DIR}/spec.md"
92
+ echo "[gitguardex] OpenSpec change workspace ready: ${CHANGE_DIR}"
93
+ echo "[gitguardex] OpenSpec change spec scaffold: ${SPEC_DIR}/spec.md"
@@ -114,5 +114,5 @@ Role workspace for \`${role}\`.
114
114
  "
115
115
  done
116
116
 
117
- echo "[guardex] OpenSpec plan workspace ready: ${PLAN_DIR}"
118
- echo "[guardex] Roles: ${ROLES[*]}"
117
+ echo "[gitguardex] OpenSpec plan workspace ready: ${PLAN_DIR}"
118
+ echo "[gitguardex] Roles: ${ROLES[*]}"
@@ -1,12 +0,0 @@
1
- # /guardex
2
-
3
- Run a GuardeX check-and-repair for the current repo.
4
-
5
- ## Steps
6
-
7
- 1. `gx status` — if green, stop.
8
- 2. If degraded, `gx doctor`.
9
- 3. If still degraded, `gx status --strict` and summarize each finding with a fix.
10
- 4. Report verdict: `Repo is guarded` or `Repo is not guarded` (list blockers).
11
-
12
- Keep output short, include the exact commands you ran.
@@ -1,43 +0,0 @@
1
- ---
2
- name: guardex
3
- description: "Check, repair, or bootstrap multi-agent safety guardrails in this repository."
4
- ---
5
-
6
- # GuardeX (Codex skill)
7
-
8
- Use when branch safety, lock ownership, or guardrail setup may be broken.
9
-
10
- ## Fast path
11
-
12
- 1. `gx status` — one-glance health check.
13
- 2. If degraded, `gx doctor` — repair + verify in one pass.
14
- 3. If issues remain, `gx status --strict` and address each finding.
15
-
16
- ## Bootstrap (missing guardrails)
17
-
18
- ```sh
19
- gx setup # install + repair + verify
20
- gx status # confirm green
21
- ```
22
-
23
- In a monorepo with nested git repos (top-level `.git` plus `apps/*/.git`), `gx setup` auto-installs into every discovered repo. Submodules and guardex-managed worktrees are skipped. Pass `--no-recursive` to limit to the top-level only.
24
-
25
- ## Notes
26
-
27
- - Isolation: `scripts/codex-agent.sh "<task>" "<agent>"` is the one-command sandbox start/finish loop.
28
- - Completion: auto-finish keeps the branch until explicit `gx cleanup`.
29
- - Never bypass protected-branch safeguards.
30
-
31
- ## Bulk finish
32
-
33
- ```sh
34
- gx finish --all # commit + PR + merge all ready agent/* branches
35
- gx cleanup # prune merged/stale branches and worktrees
36
- ```
37
-
38
- If a branch fails with stale rebase/worktree state:
39
-
40
- ```sh
41
- git -C "<worktree>" rebase --abort || true
42
- gx finish --branch "<agent-branch>" --cleanup
43
- ```