@imdeadpool/guardex 7.0.8 → 7.0.11

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/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,14 +7,17 @@ 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';
14
+ const OMC_PACKAGE = 'oh-my-claude-sisyphus';
15
+ const CAVEMEM_PACKAGE = 'cavemem';
14
16
  const GLOBAL_TOOLCHAIN_PACKAGES = [
15
17
  'oh-my-codex',
16
- 'oh-my-claude',
18
+ OMC_PACKAGE,
17
19
  OPENSPEC_PACKAGE,
20
+ CAVEMEM_PACKAGE,
18
21
  '@imdeadpool/codex-account-switcher',
19
22
  ];
20
23
  const GH_BIN = process.env.GUARDEX_GH_BIN || 'gh';
@@ -58,9 +61,9 @@ const TEMPLATE_FILES = [
58
61
  'githooks/pre-push',
59
62
  'githooks/post-merge',
60
63
  'githooks/post-checkout',
61
- 'codex/skills/guardex/SKILL.md',
64
+ 'codex/skills/gitguardex/SKILL.md',
62
65
  'codex/skills/guardex-merge-skills-to-dev/SKILL.md',
63
- 'claude/commands/guardex.md',
66
+ 'claude/commands/gitguardex.md',
64
67
  'github/pull.yml.example',
65
68
  'github/workflows/cr.yml',
66
69
  ];
@@ -143,9 +146,9 @@ const MANAGED_GITIGNORE_PATHS = [
143
146
  '.githooks/post-merge',
144
147
  '.githooks/post-checkout',
145
148
  'oh-my-codex/',
146
- '.codex/skills/guardex/SKILL.md',
149
+ '.codex/skills/gitguardex/SKILL.md',
147
150
  '.codex/skills/guardex-merge-skills-to-dev/SKILL.md',
148
- '.claude/commands/guardex.md',
151
+ '.claude/commands/gitguardex.md',
149
152
  LOCK_FILE_RELATIVE,
150
153
  ];
151
154
  const OMX_SCAFFOLD_DIRECTORIES = [
@@ -196,7 +199,7 @@ const SUGGESTIBLE_COMMANDS = [
196
199
  'release',
197
200
  ];
198
201
  const CLI_COMMAND_DESCRIPTIONS = [
199
- ['status', 'Show GuardeX CLI + service health without modifying files'],
202
+ ['status', 'Show GitGuardex CLI + service health without modifying files'],
200
203
  ['setup', 'Install, repair, and verify guardrails (flags: --repair, --install-only, --target)'],
201
204
  ['doctor', 'Repair drift + verify (auto-sandboxes on protected main)'],
202
205
  ['protect', 'Manage protected branches (list/add/remove/set/reset)'],
@@ -223,24 +226,20 @@ const AGENT_BOT_DESCRIPTIONS = [
223
226
  ['agents', 'Start/stop review + cleanup bots for this repo'],
224
227
  ];
225
228
 
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
229
+ const AI_SETUP_PROMPT = `GitGuardex (gx) setup checklist for Codex/Claude in this repo.
230
+
231
+ 1) Install: npm i -g @imdeadpool/guardex && gh --version
232
+ 2) Bootstrap: gx setup
233
+ 3) Repair: gx doctor
234
+ 4) Task loop: bash scripts/codex-agent.sh "<task>" "<agent>"
235
+ or branch-start -> claim -> branch-finish
236
+ 5) Finish: gx finish --all
237
+ 6) Cleanup: gx cleanup
238
+ 7) OpenSpec: /opsx:propose -> /opsx:apply -> /opsx:archive
239
+ 8) Optional: gx protect add release staging
240
+ 9) Optional: gx sync --check && gx sync
241
+ 10) Review bot: install https://github.com/apps/cr-gpt + set OPENAI_API_KEY
242
+ 11) Fork sync: cp .github/pull.yml.example .github/pull.yml
244
243
  `;
245
244
 
246
245
  const AI_SETUP_COMMANDS = `npm i -g @imdeadpool/guardex
@@ -251,7 +250,7 @@ bash scripts/codex-agent.sh "<task>" "<agent>"
251
250
  gx finish --all
252
251
  gx cleanup
253
252
  gx protect add release staging
254
- gx sync
253
+ gx sync --check && gx sync
255
254
  `;
256
255
 
257
256
  const SCORECARD_RISK_BY_CHECK = {
@@ -808,7 +807,7 @@ function ensureAgentsSnippet(repoRoot, dryRun, options = {}) {
808
807
  if (!dryRun) {
809
808
  fs.writeFileSync(agentsPath, next, 'utf8');
810
809
  }
811
- return { status: 'updated', file: 'AGENTS.md', note: 'refreshed guardex-managed block' };
810
+ return { status: 'updated', file: 'AGENTS.md', note: 'refreshed gitguardex-managed block' };
812
811
  }
813
812
 
814
813
  if (existing.includes(AGENTS_MARKER_START)) {
@@ -839,7 +838,7 @@ function ensureManagedGitignore(repoRoot, dryRun) {
839
838
  if (!dryRun) {
840
839
  fs.writeFileSync(gitignorePath, `${managedBlock}\n`, 'utf8');
841
840
  }
842
- return { status: 'created', file: '.gitignore', note: 'added guardex-managed entries' };
841
+ return { status: 'created', file: '.gitignore', note: 'added gitguardex-managed entries' };
843
842
  }
844
843
 
845
844
  const existing = fs.readFileSync(gitignorePath, 'utf8');
@@ -851,14 +850,14 @@ function ensureManagedGitignore(repoRoot, dryRun) {
851
850
  if (!dryRun) {
852
851
  fs.writeFileSync(gitignorePath, next, 'utf8');
853
852
  }
854
- return { status: 'updated', file: '.gitignore', note: 'refreshed guardex-managed entries' };
853
+ return { status: 'updated', file: '.gitignore', note: 'refreshed gitguardex-managed entries' };
855
854
  }
856
855
 
857
856
  const separator = existing.endsWith('\n') ? '\n' : '\n\n';
858
857
  if (!dryRun) {
859
858
  fs.writeFileSync(gitignorePath, `${existing}${separator}${managedBlock}\n`, 'utf8');
860
859
  }
861
- return { status: 'updated', file: '.gitignore', note: 'appended guardex-managed entries' };
860
+ return { status: 'updated', file: '.gitignore', note: 'appended gitguardex-managed entries' };
862
861
  }
863
862
 
864
863
  function configureHooks(repoRoot, dryRun) {
@@ -4717,7 +4716,7 @@ function setup(rawArgs) {
4717
4716
  `[${TOOL_NAME}] ✅ Global tools installed (${(globalInstallStatus.packages || []).join(', ')}).`,
4718
4717
  );
4719
4718
  } else if (globalInstallStatus.status === 'already-installed') {
4720
- console.log(`[${TOOL_NAME}] ✅ OMX/OpenSpec/codex-auth npm global tools already installed. Skipping.`);
4719
+ console.log(`[${TOOL_NAME}] ✅ Companion npm global tools already installed. Skipping.`);
4721
4720
  } else if (globalInstallStatus.status === 'failed') {
4722
4721
  console.log(
4723
4722
  `[${TOOL_NAME}] ⚠️ Global install failed: ${globalInstallStatus.reason}\n` +
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@imdeadpool/guardex",
3
- "version": "7.0.8",
4
- "description": "GuardeX: the Guardian T-Rex for your repo, with hardened multi-agent git guardrails.",
3
+ "version": "7.0.11",
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
- ```