From b1913da46cba58858b2c52c7f13344a094b4b588 Mon Sep 17 00:00:00 2001 From: NagyVikt Date: Sat, 11 Apr 2026 18:24:22 +0200 Subject: [PATCH] Rebrand the CLI to GuardeX with gx-first command UX This updates package branding, user-facing command guidance, and generated skill/command templates to the new GuardeX identity while keeping legacy musafety aliases available for compatibility.\n\nThe CLI now prefers the short gx command in usage/help, README examples, package helper scripts, and setup prompts. Setup/install templates were updated in both checked-in and generated surfaces, and tests were aligned to the new user-facing outputs and paths. Constraint: Existing repos may still invoke musafety or multiagent-safety binaries, so compatibility aliases were preserved\nRejected: Full MUSAFETY_* environment variable and internal key rename | would create avoidable migration risk for existing automation\nConfidence: high\nScope-risk: moderate\nReversibility: clean\nDirective: Keep gx as the default documented command while maintaining legacy aliases until an explicit deprecation window is announced\nTested: npm test\nTested: node --check bin/multiagent-safety.js\nTested: npm pack --dry-run\nNot-tested: end-to-end npm publish in CI --- .claude/commands/guardex.md | 18 +++ .claude/commands/musafety.md | 18 --- .../skills/guardex}/SKILL.md | 18 +-- .githooks/pre-commit | 2 +- CONTRIBUTING.md | 2 +- README.md | 147 +++++++++--------- SECURITY.md | 2 +- bin/multiagent-safety.js | 82 +++++----- docs/branch-sync-spec.md | 28 ++-- ...-status.svg => guardex-service-status.svg} | 24 +-- docs/redditpost.md | 26 ++-- package-lock.json | 6 +- package.json | 21 +-- scripts/openspec/init-plan-workspace.sh | 4 +- templates/claude/commands/guardex.md | 18 +++ templates/claude/commands/musafety.md | 18 --- .../codex/skills/guardex}/SKILL.md | 19 +-- templates/githooks/pre-commit | 2 +- templates/scripts/codex-agent.sh | 2 +- .../scripts/openspec/init-plan-workspace.sh | 4 +- test/install.test.js | 74 ++++----- 21 files changed, 275 insertions(+), 260 deletions(-) create mode 100644 .claude/commands/guardex.md delete mode 100644 .claude/commands/musafety.md rename {templates/codex/skills/musafety => .codex/skills/guardex}/SKILL.md (66%) rename docs/images/{musafety-service-status.svg => guardex-service-status.svg} (66%) create mode 100644 templates/claude/commands/guardex.md delete mode 100644 templates/claude/commands/musafety.md rename {.codex/skills/musafety => templates/codex/skills/guardex}/SKILL.md (57%) diff --git a/.claude/commands/guardex.md b/.claude/commands/guardex.md new file mode 100644 index 0000000..13e4a6d --- /dev/null +++ b/.claude/commands/guardex.md @@ -0,0 +1,18 @@ +# /guardex + +Run a GuardeX check-and-repair workflow for the current repository. + +## Steps + +1. Run `gx status`. +2. If status is degraded, run `gx doctor`. +3. If still degraded, run `gx scan` and summarize each finding with a fix. +4. Report final verdict as one of: + - `Repo is guarded` + - `Repo is not guarded` (include blockers) + +## Style + +- Keep output short and operational. +- Include exact commands you executed. +- Prefer concrete next actions over generic advice. diff --git a/.claude/commands/musafety.md b/.claude/commands/musafety.md deleted file mode 100644 index 5b180c0..0000000 --- a/.claude/commands/musafety.md +++ /dev/null @@ -1,18 +0,0 @@ -# /musafety - -Run a musafety check-and-repair workflow for the current repository. - -## Steps - -1. Run `musafety status`. -2. If status is degraded, run `musafety doctor`. -3. If still degraded, run `musafety scan` and summarize each finding with a fix. -4. Report final verdict as one of: - - `Repo is musafe` - - `Repo is not musafe` (include blockers) - -## Style - -- Keep output short and operational. -- Include exact commands you executed. -- Prefer concrete next actions over generic advice. diff --git a/templates/codex/skills/musafety/SKILL.md b/.codex/skills/guardex/SKILL.md similarity index 66% rename from templates/codex/skills/musafety/SKILL.md rename to .codex/skills/guardex/SKILL.md index 261f485..efa491e 100644 --- a/templates/codex/skills/musafety/SKILL.md +++ b/.codex/skills/guardex/SKILL.md @@ -1,36 +1,36 @@ --- -name: musafety +name: guardex description: "Use when you need to check, repair, or bootstrap multi-agent safety guardrails in this repository." --- -# musafety (Codex skill) +# GuardeX (Codex skill) Use this skill whenever branch safety, lock ownership, or guardrail setup may be broken. ## Fast path -1. Run `musafety status`. -2. If repo safety is degraded, run `musafety doctor`. -3. If issues remain, run `musafety scan` and address the findings. +1. Run `gx status`. +2. If repo safety is degraded, run `gx doctor`. +3. If issues remain, run `gx scan` and address the findings. ## Setup path If guardrails are missing entirely, run: ```sh -musafety setup +gx setup ``` Then verify: ```sh -musafety status -musafety scan +gx status +gx scan ``` ## Operator notes -- Prefer `musafety doctor` for one-step repair + verification. +- Prefer `gx doctor` for one-step repair + verification. - Keep agent work isolated (`agent/*` branches + lock claims). - For one-command Codex sandbox startup, use `bash scripts/codex-agent.sh "" ""`. - Do not bypass protected branch safeguards unless explicitly required. diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 07cd233..ce25c77 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -121,7 +121,7 @@ MSG cat >&2 < MSG diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d05f3c3..38ba1d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Thanks for contributing to `musafety`. +Thanks for contributing to `GuardeX`. ## Development setup diff --git a/README.md b/README.md index 3dbc079..4ddde96 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# musafety (MULTI AGENTS SAFETY PROTCOL) +# GuardeX — Guardian T-Rex for your repo -[![npm version](https://img.shields.io/npm/v/musafety?color=cb3837&logo=npm)](https://www.npmjs.com/package/musafety) +[![npm version](https://img.shields.io/npm/v/guardex?color=cb3837&logo=npm)](https://www.npmjs.com/package/guardex) [![CI](https://github.com/recodeecom/multiagent-safety/actions/workflows/ci.yml/badge.svg)](https://github.com/recodeecom/multiagent-safety/actions/workflows/ci.yml) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/recodeecom/multiagent-safety/badge)](https://securityscorecards.dev/viewer/?uri=github.com/recodeecom/multiagent-safety) -Simple, hardened multi-agent safety setup for any git repo. +GuardeX is a short-command, hardened multi-agent safety setup for any git repo. > [!WARNING] > Not affiliated with OpenAI or Codex. Not an official tool. @@ -15,11 +15,11 @@ If you run multiple agents at the same time, it is easy to get collisions: two agents editing the same files, unsafe deletes, broken branch flow, or confusing ownership. -`musafety` adds strict guardrails so parallel agent work stays safe and predictable. +`GuardeX` adds strict guardrails so parallel agent work stays safe and predictable. ![Multi-agent dashboard example](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/dashboard-multi-agent.png) -The dashboard above is the exact kind of parallel workflow this tool is built for. +The dashboard above is the exact kind of parallel workflow GuardeX is built for. It also includes an OpenSpec planning scaffold script so plan-mode workspaces can be bootstrapped consistently across repos. @@ -27,10 +27,17 @@ can be bootstrapped consistently across repos. ## Install ```sh -npm i -g musafety +npm i -g guardex ``` -Package page: https://www.npmjs.com/package/musafety +Package page: https://www.npmjs.com/package/guardex + + +## Command aliases + +- Preferred short command: `gx` +- Full command: `guardex` +- Legacy aliases still supported: `musafety`, `multiagent-safety` ## Security + maintenance posture @@ -48,7 +55,7 @@ Related tools: ```sh # inside your repo -musafety setup +gx setup ``` That one command runs: @@ -57,30 +64,30 @@ That one command runs: 2. asks strict Y/N approval only if something is missing, 3. installs guardrail scripts/hooks, 4. repairs common safety problems, -5. installs local Codex + Claude musafety helper skill files if missing, +5. installs local Codex + Claude gx helper skill files if missing, 6. scans and reports final status. ## Setup screenshot -![musafety setup success screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/setup-success.svg) +![gx setup success screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/setup-success.svg) ## Status logs screenshot -![musafety service status screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/musafety-service-status.svg) +![gx service status screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/guardex-service-status.svg) ## AI helper skills installed by setup/doctor -`musafety setup` and `musafety doctor` also ensure these local helper files exist: +`gx setup` and `gx doctor` also ensure these local helper files exist: -- Codex skill: `.codex/skills/musafety/SKILL.md` -- Claude command: `.claude/commands/musafety.md` (use as `/musafety`) +- Codex skill: `.codex/skills/guardex/SKILL.md` +- Claude command: `.claude/commands/guardex.md` (use as `/guardex`) ## Scorecard report generation Create/update markdown reports from OpenSSF Scorecard JSON: ```sh -musafety report scorecard --repo github.com/recodeecom/multiagent-safety +gx report scorecard --repo github.com/recodeecom/multiagent-safety ``` By default this writes: @@ -92,17 +99,17 @@ By default this writes: ### 1) Start isolated agent branch/worktree -![musafety branch start protocol screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/workflow-branch-start.svg) +![gx branch start protocol screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/workflow-branch-start.svg) ### 2) Lock claim + deletion guard protocol -![musafety lock and delete guard screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/workflow-lock-guard.svg) +![gx lock and delete guard screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/workflow-lock-guard.svg) ### 3) Multi-agent branch visibility (IDE/source control style) -![musafety source control multi-agent screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/workflow-source-control.svg) +![gx source control multi-agent screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/workflow-source-control.svg) -#### Real VS Code Source Control example (after `musafety setup`) +#### Real VS Code Source Control example (after `gx setup`) This is the exact layout you should expect in VS Code Source Control after setup and a few `agent-branch-start` runs: @@ -165,37 +172,37 @@ codex-auth remove-login-hook ## Copy prompt for your AI (Codex / Claude) ```sh -musafety copy-prompt +gx copy-prompt ``` This prints a ready-to-paste prompt. ### Prompt preview (SVG) -![musafety copy prompt screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/copy-prompt-output.svg) +![gx copy prompt screenshot](https://raw.githubusercontent.com/recodeecom/multiagent-safety/main/docs/images/copy-prompt-output.svg) ### Commands-only copy mode If you only want executable commands (without explanatory text): ```sh -musafety copy-commands +gx copy-commands ``` Example output: ```sh -npm i -g musafety -musafety setup -musafety doctor +npm i -g guardex +gx setup +gx doctor bash scripts/codex-agent.sh "task" "agent-name" bash scripts/agent-branch-start.sh "task" "agent-name" python3 scripts/agent-file-locks.py claim --branch "$(git rev-parse --abbrev-ref HEAD)" bash scripts/agent-branch-finish.sh --branch "$(git rev-parse --abbrev-ref HEAD)" bash scripts/openspec/init-plan-workspace.sh "" -musafety protect add release staging -musafety sync --check -musafety sync +gx protect add release staging +gx sync --check +gx sync ``` Full checklist output: @@ -204,10 +211,10 @@ Full checklist output: Use this exact checklist to setup multi-agent safety in this repository for Codex or Claude. 1) Install (if missing): - npm i -g musafety + npm i -g guardex 2) Bootstrap safety in this repo: - musafety setup + gx setup - Setup detects global OMX/OpenSpec first. - If one is missing and setup asks for approval, reply explicitly: @@ -215,7 +222,7 @@ Use this exact checklist to setup multi-agent safety in this repository for Code - n = skip global installs 3) If setup reports warnings/errors, repair + re-check: - musafety doctor + gx doctor 4) Confirm next safe agent workflow commands: bash scripts/codex-agent.sh "task" "agent-name" @@ -227,36 +234,36 @@ Use this exact checklist to setup multi-agent safety in this repository for Code bash scripts/openspec/init-plan-workspace.sh "" 6) Optional: protect extra branches: - musafety protect add release staging + gx protect add release staging 7) Optional: sync your current agent branch with latest base branch: - musafety sync --check - musafety sync + gx sync --check + gx sync ``` ## Basic commands ```sh -musafety status [--target ] [--json] -musafety setup [--target ] [--dry-run] [--yes-global-install|--no-global-install] [--no-gitignore] -musafety doctor [--target ] [--dry-run] [--json] [--keep-stale-locks] [--no-gitignore] -musafety copy-prompt -musafety copy-commands -musafety protect list [--target ] -musafety protect add [--target ] -musafety protect remove [--target ] -musafety protect set [--target ] -musafety protect reset [--target ] -musafety sync --check [--target ] [--base ] [--json] -musafety sync [--target ] [--base ] [--strategy rebase|merge] [--ff-only] -musafety report scorecard [--target ] [--repo github.com//] [--scorecard-json ] [--output-dir ] [--date YYYY-MM-DD] +gx status [--target ] [--json] +gx setup [--target ] [--dry-run] [--yes-global-install|--no-global-install] [--no-gitignore] +gx doctor [--target ] [--dry-run] [--json] [--keep-stale-locks] [--no-gitignore] +gx copy-prompt +gx copy-commands +gx protect list [--target ] +gx protect add [--target ] +gx protect remove [--target ] +gx protect set [--target ] +gx protect reset [--target ] +gx sync --check [--target ] [--base ] [--json] +gx sync [--target ] [--base ] [--strategy rebase|merge] [--ff-only] +gx report scorecard [--target ] [--repo github.com//] [--scorecard-json ] [--output-dir ] [--date YYYY-MM-DD] bash scripts/agent-worktree-prune.sh --base dev # manual stale worktree cleanup bash scripts/openspec/init-plan-workspace.sh # optional OpenSpec plan scaffold ``` -No command defaults to `musafety status` (non-mutating health/status view). -`musafety status` reports CLI/runtime info, global OMX/OpenSpec service status, and repo safety service state. -When run in an interactive terminal, default `musafety` checks npm for a newer version first +No command defaults to `gx status` (non-mutating health/status view). +`gx status` reports CLI/runtime info, global OMX/OpenSpec service status, and repo safety service state. +When run in an interactive terminal, default `GuardeX` checks npm for a newer version first and asks `[y/N]` whether to update immediately (default is `N`). - Interactive setup: prompts for Y/N approval before global OMX/OpenSpec install. @@ -266,10 +273,10 @@ and asks `[y/N]` whether to update immediately (default is `N`). ## Advanced commands ```sh -musafety install [--target ] [--force] [--skip-agents] [--skip-package-json] [--no-gitignore] [--dry-run] -musafety fix [--target ] [--dry-run] [--keep-stale-locks] [--no-gitignore] -musafety scan [--target ] [--json] -musafety report help +gx install [--target ] [--force] [--skip-agents] [--skip-package-json] [--no-gitignore] [--dry-run] +gx fix [--target ] [--dry-run] [--keep-stale-locks] [--no-gitignore] +gx scan [--target ] [--json] +gx report help ``` ## Keep agent branches synced with your base branch @@ -277,13 +284,13 @@ musafety report help Use sync checks before finishing agent branches: ```sh -musafety sync --check -musafety sync +gx sync --check +gx sync ``` Defaults: -- `musafety sync` base branch: `dev` (or `multiagent.baseBranch`) +- `gx sync` base branch: `dev` (or `multiagent.baseBranch`) - strategy: `rebase` (or `multiagent.sync.strategy`) `agent-branch-start.sh` and `agent-branch-finish.sh` resolve base branch in this order: @@ -296,11 +303,11 @@ Defaults: Useful variants: ```sh -musafety sync --strategy merge -musafety sync --all-agent-branches --check +gx sync --strategy merge +gx sync --all-agent-branches --check ``` -By default, `agent-branch-finish.sh` also blocks finishing when your branch is behind `origin/` and points to `musafety sync`. +By default, `agent-branch-finish.sh` also blocks finishing when your branch is behind `origin/` and points to `gx sync`. Optional pre-commit behind-threshold gate (off by default): @@ -322,11 +329,11 @@ Default protected branches are: You can manage additional protected branches via CLI: ```sh -musafety protect list -musafety protect add release staging -musafety protect remove dev -musafety protect set main release hotfix -musafety protect reset +gx protect list +gx protect add release staging +gx protect remove dev +gx protect set main release hotfix +gx protect reset ``` Configuration is stored in local git config key: @@ -337,7 +344,7 @@ multiagent.protectedBranches ## What is protected -- direct commits to protected branches (defaults: `dev`, `main`, `master`; configurable via `musafety protect ...`) +- direct commits to protected branches (defaults: `dev`, `main`, `master`; configurable via `gx protect ...`) - protected-branch commits are blocked regardless of commit client (including VS Code Source Control) - Codex-session commits on non-`agent/*` branches are blocked by default (`multiagent.codexRequireAgentBranch=true`) - overlapping file ownership between agents @@ -345,7 +352,7 @@ multiagent.protectedBranches - risky stale/missing lock state - accidental loss of critical guardrail files - in-place branch bootstrap requires explicit opt-in (`--in-place --allow-in-place`) -- setup also writes a managed `.gitignore` block so generated musafety scripts/hooks stay out of normal git status noise by default +- setup also writes a managed `.gitignore` block so generated gx scripts/hooks stay out of normal git status noise by default - includes `oh-my-codex/` by default to keep local OMX source clones out of repo status - pass `--no-gitignore` if you want to keep tracking these files in git @@ -360,8 +367,8 @@ scripts/agent-file-locks.py scripts/install-agent-git-hooks.sh scripts/openspec/init-plan-workspace.sh .githooks/pre-commit -.codex/skills/musafety/SKILL.md -.claude/commands/musafety.md +.codex/skills/guardex/SKILL.md +.claude/commands/guardex.md .omx/state/agent-file-locks.json ``` @@ -387,7 +394,7 @@ npm pack --dry-run ### v0.4.5 - Added optional pre-commit behind-threshold sync gate (`multiagent.sync.requireBeforeCommit`, `multiagent.sync.maxBehindCommits`). -- Added `musafety sync` workflow (`--check`, sync strategies, report mode). +- Added `gx sync` workflow (`--check`, sync strategies, report mode). - `agent-branch-finish.sh` now blocks finishing when source branch is behind `origin/` (config-aware). ### v0.4.4 diff --git a/SECURITY.md b/SECURITY.md index ff987ed..9313f64 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Supported Versions -Only the latest published `musafety` version is supported for security fixes. +Only the latest published `guardex` version is supported for security fixes. ## Reporting a Vulnerability diff --git a/bin/multiagent-safety.js b/bin/multiagent-safety.js index 0c91c76..88c314b 100755 --- a/bin/multiagent-safety.js +++ b/bin/multiagent-safety.js @@ -7,8 +7,9 @@ const cp = require('node:child_process'); const packageJsonPath = path.resolve(__dirname, '..', 'package.json'); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); -const TOOL_NAME = 'musafety'; -const LEGACY_NAME = 'multiagent-safety'; +const TOOL_NAME = 'guardex'; +const SHORT_TOOL_NAME = 'gx'; +const LEGACY_NAMES = ['musafety', 'multiagent-safety']; const GLOBAL_TOOLCHAIN_PACKAGES = ['oh-my-codex', '@fission-ai/openspec']; const MAINTAINER_RELEASE_REPO = path.resolve( process.env.MUSAFETY_RELEASE_REPO || '/tmp/multiagent-safety', @@ -33,8 +34,8 @@ const TEMPLATE_FILES = [ 'scripts/install-agent-git-hooks.sh', 'scripts/openspec/init-plan-workspace.sh', 'githooks/pre-commit', - 'codex/skills/musafety/SKILL.md', - 'claude/commands/musafety.md', + 'codex/skills/guardex/SKILL.md', + 'claude/commands/guardex.md', ]; const EXECUTABLE_RELATIVE_PATHS = new Set([ @@ -70,8 +71,8 @@ const MANAGED_GITIGNORE_PATHS = [ 'scripts/openspec/init-plan-workspace.sh', '.githooks/pre-commit', 'oh-my-codex/', - '.codex/skills/musafety/SKILL.md', - '.claude/commands/musafety.md', + '.codex/skills/guardex/SKILL.md', + '.claude/commands/guardex.md', LOCK_FILE_RELATIVE, ]; const COMMAND_TYPO_ALIASES = new Map([ @@ -102,7 +103,7 @@ const SUGGESTIBLE_COMMANDS = [ 'version', ]; const CLI_COMMAND_DESCRIPTIONS = [ - ['status', 'Show musafety CLI + service health without modifying files'], + ['status', 'Show GuardeX CLI + service health without modifying files'], ['setup', 'Install + repair guardrails in a git repo (supports --no-gitignore)'], ['doctor', 'Repair safety setup drift, then verify repo safety'], ['report', 'Generate security/safety reports (for example: OpenSSF scorecard)'], @@ -114,18 +115,18 @@ const CLI_COMMAND_DESCRIPTIONS = [ ['fix', 'Repair broken or missing guardrail files/config (supports --no-gitignore)'], ['scan', 'Report safety issues and exit non-zero on findings'], ['print-agents-snippet', 'Print the AGENTS.md snippet template'], - ['release', 'Publish musafety from maintainer release repo'], + ['release', 'Publish GuardeX from maintainer release repo'], ['help', 'Show this help output'], - ['version', 'Print musafety version'], + ['version', 'Print GuardeX version'], ]; -const AI_SETUP_PROMPT = `Use this exact checklist to setup multi-agent safety in this repository for Codex or Claude. +const AI_SETUP_PROMPT = `Use this exact checklist to setup GuardeX (Guardian T-Rex for your repo) in this repository for Codex or Claude. 1) Install (if missing): - npm i -g musafety + npm i -g guardex 2) Bootstrap safety in this repo: - musafety setup + gx setup - Setup detects global OMX/OpenSpec first. - If one is missing and setup asks for approval, reply explicitly: @@ -133,7 +134,7 @@ const AI_SETUP_PROMPT = `Use this exact checklist to setup multi-agent safety in - n = skip global installs 3) If setup reports warnings/errors, repair + re-check: - musafety doctor + gx doctor 4) Confirm next safe agent workflow commands: bash scripts/codex-agent.sh "task" "agent-name" @@ -145,24 +146,24 @@ const AI_SETUP_PROMPT = `Use this exact checklist to setup multi-agent safety in bash scripts/openspec/init-plan-workspace.sh "" 6) Optional: protect extra branches: - musafety protect add release staging + gx protect add release staging 7) Optional: sync your current agent branch with latest base branch: - musafety sync --check - musafety sync + gx sync --check + gx sync `; -const AI_SETUP_COMMANDS = `npm i -g musafety -musafety setup -musafety doctor +const AI_SETUP_COMMANDS = `npm i -g guardex +gx setup +gx doctor bash scripts/codex-agent.sh "task" "agent-name" bash scripts/agent-branch-start.sh "task" "agent-name" python3 scripts/agent-file-locks.py claim --branch "$(git rev-parse --abbrev-ref HEAD)" bash scripts/agent-branch-finish.sh --branch "$(git rev-parse --abbrev-ref HEAD)" bash scripts/openspec/init-plan-workspace.sh "" -musafety protect add release staging -musafety sync --check -musafety sync +gx protect add release staging +gx sync --check +gx sync `; const SCORECARD_RISK_BY_CHECK = { @@ -219,11 +220,11 @@ function commandCatalogLines(indent = ' ') { } function printToolLogsSummary() { - const usageLine = ` $ ${TOOL_NAME} [options]`; + const usageLine = ` $ ${SHORT_TOOL_NAME} [options]`; const commandDetails = commandCatalogLines(' '); if (!supportsAnsiColors()) { - console.log('musafety-tools logs:'); + console.log(`${TOOL_NAME}-tools logs:`); console.log(' USAGE'); console.log(usageLine); console.log(' COMMANDS'); @@ -233,7 +234,7 @@ function printToolLogsSummary() { return; } - const title = colorize('musafety-tools logs', '1;36'); + const title = colorize(`${TOOL_NAME}-tools logs`, '1;36'); const usageHeader = colorize('USAGE', '1'); const commandsHeader = colorize('COMMANDS', '1'); const pipe = colorize('│', '90'); @@ -263,15 +264,16 @@ VERSION ${runtimeVersion()} USAGE - $ ${TOOL_NAME} [options] + $ ${SHORT_TOOL_NAME} [options] COMMANDS ${commandCatalogLines().join('\n')} NOTES - - Running ${TOOL_NAME} with no command defaults to: ${TOOL_NAME} status + - Running ${TOOL_NAME} with no command defaults to: ${SHORT_TOOL_NAME} status + - Short alias: ${SHORT_TOOL_NAME} - ${TOOL_NAME} setup asks for Y/N approval before global installs - - ${LEGACY_NAME} command name is still supported as an alias`); + - Legacy command aliases are still supported: ${LEGACY_NAMES.join(', ')}`); if (outsideGitRepo) { console.log(` @@ -478,13 +480,13 @@ function ensurePackageScripts(repoRoot, dryRun) { 'agent:locks:release': 'python3 ./scripts/agent-file-locks.py release', 'agent:locks:status': 'python3 ./scripts/agent-file-locks.py status', 'agent:plan:init': 'bash ./scripts/openspec/init-plan-workspace.sh', - 'agent:protect:list': `${TOOL_NAME} protect list`, - 'agent:branch:sync': `${TOOL_NAME} sync`, - 'agent:branch:sync:check': `${TOOL_NAME} sync --check`, - 'agent:safety:setup': `${TOOL_NAME} setup`, - 'agent:safety:scan': `${TOOL_NAME} scan`, - 'agent:safety:fix': `${TOOL_NAME} fix`, - 'agent:safety:doctor': `${TOOL_NAME} doctor`, + 'agent:protect:list': `${SHORT_TOOL_NAME} protect list`, + 'agent:branch:sync': `${SHORT_TOOL_NAME} sync`, + 'agent:branch:sync:check': `${SHORT_TOOL_NAME} sync --check`, + 'agent:safety:setup': `${SHORT_TOOL_NAME} setup`, + 'agent:safety:scan': `${SHORT_TOOL_NAME} scan`, + 'agent:safety:fix': `${SHORT_TOOL_NAME} fix`, + 'agent:safety:doctor': `${SHORT_TOOL_NAME} doctor`, }; pkg.scripts = pkg.scripts || {}; @@ -547,7 +549,7 @@ function ensureManagedGitignore(repoRoot, dryRun) { if (!dryRun) { fs.writeFileSync(gitignorePath, `${managedBlock}\n`, 'utf8'); } - return { status: 'created', file: '.gitignore', note: 'added musafety-managed entries' }; + return { status: 'created', file: '.gitignore', note: 'added guardex-managed entries' }; } const existing = fs.readFileSync(gitignorePath, 'utf8'); @@ -559,14 +561,14 @@ function ensureManagedGitignore(repoRoot, dryRun) { if (!dryRun) { fs.writeFileSync(gitignorePath, next, 'utf8'); } - return { status: 'updated', file: '.gitignore', note: 'refreshed musafety-managed entries' }; + return { status: 'updated', file: '.gitignore', note: 'refreshed guardex-managed entries' }; } const separator = existing.endsWith('\n') ? '\n' : '\n\n'; if (!dryRun) { fs.writeFileSync(gitignorePath, `${existing}${separator}${managedBlock}\n`, 'utf8'); } - return { status: 'updated', file: '.gitignore', note: 'appended musafety-managed entries' }; + return { status: 'updated', file: '.gitignore', note: 'appended guardex-managed entries' }; } function configureHooks(repoRoot, dryRun) { @@ -807,7 +809,7 @@ function renderScorecardBaselineMarkdown({ repo, score, checks, capturedAt, scor '# OpenSSF Scorecard Baseline Report', '', `- **Repository:** \`${repo}\``, - '- **Source:** generated by `musafety report scorecard`', + '- **Source:** generated by `gx report scorecard`', `- **Captured at:** ${capturedAt}`, `- **Scorecard version:** \`${scorecardVersion}\``, `- **Overall score:** **${score} / 10**`, @@ -2018,7 +2020,7 @@ function setup(rawArgs) { if (scanResult.errors === 0 && scanResult.warnings === 0) { console.log(`[${TOOL_NAME}] ✅ Setup complete.`); - console.log(`[${TOOL_NAME}] Copy AI setup prompt with: ${TOOL_NAME} copy-prompt`); + console.log(`[${TOOL_NAME}] Copy AI setup prompt with: ${SHORT_TOOL_NAME} copy-prompt`); } setExitCodeFromScan(scanResult); diff --git a/docs/branch-sync-spec.md b/docs/branch-sync-spec.md index 0d01d0a..222cb14 100644 --- a/docs/branch-sync-spec.md +++ b/docs/branch-sync-spec.md @@ -1,4 +1,4 @@ -# musafety branch sync feature spec (pre-implementation) +# GuardeX branch sync feature spec (pre-implementation) Status: draft Scope: CLI UX + behavior spec + test matrix for keeping `agent/*` branches synced with `origin/dev` safely. @@ -21,7 +21,7 @@ Scope: CLI UX + behavior spec + test matrix for keeping `agent/*` branches synce ## 1) Sync current branch ```bash -musafety sync [--target ] [--base ] [--strategy rebase|merge] [--ff-only] [--dry-run] +gx sync [--target ] [--base ] [--strategy rebase|merge] [--ff-only] [--dry-run] ``` Defaults: @@ -41,7 +41,7 @@ Behavior: ## 2) Check-only mode ```bash -musafety sync --check [--target ] [--base ] [--json] +gx sync --check [--target ] [--base ] [--json] ``` Outputs: @@ -54,7 +54,7 @@ Outputs: ## 3) Multi-branch report (optional maintainer workflow) ```bash -musafety sync --all-agent-branches [--target ] [--base ] [--json] +gx sync --all-agent-branches [--target ] [--base ] [--json] ``` Notes: @@ -69,7 +69,7 @@ Example failure message: ```text [agent-sync-guard] Branch is behind origin/dev by 3 commit(s). -Run: musafety sync --base dev +Run: gx sync --base dev Then retry: bash scripts/agent-branch-finish.sh ``` @@ -129,12 +129,12 @@ or abort: Human mode example: ```text -[musafety] Sync target: /repo -[musafety] Branch: agent/executor/feature-x -[musafety] Base: origin/dev -[musafety] Behind before sync: 4 -[musafety] Strategy: rebase -[musafety] Result: success (behind now: 0) +[gx] Sync target: /repo +[gx] Branch: agent/executor/feature-x +[gx] Base: origin/dev +[gx] Behind before sync: 4 +[gx] Strategy: rebase +[gx] Result: success (behind now: 0) ``` JSON mode shape: @@ -167,7 +167,7 @@ JSON mode shape: 1. **Happy path rebase** - create `dev` + `agent/*` - advance `dev` - - run `musafety sync` + - run `gx sync` - assert agent branch no longer behind. 2. **Happy path merge strategy** @@ -216,8 +216,8 @@ JSON mode shape: ## Rollout plan (recommended) Phase 1: -- `musafety sync --check` -- `musafety sync` for current branch +- `gx sync --check` +- `gx sync` for current branch - docs + test coverage Phase 2: diff --git a/docs/images/musafety-service-status.svg b/docs/images/guardex-service-status.svg similarity index 66% rename from docs/images/musafety-service-status.svg rename to docs/images/guardex-service-status.svg index bbb277f..22609f4 100644 --- a/docs/images/musafety-service-status.svg +++ b/docs/images/guardex-service-status.svg @@ -4,24 +4,24 @@ - deadpool@recodee:~/YOUREPO$ musafety + deadpool@recodee:~/YOUREPO$ gx - [musafety] CLI: musafety/0.4.7 linux-x64 node-v22.22.0 - [musafety] Global services: + [guardex] CLI: guardex/0.4.7 linux-x64 node-v22.22.0 + [guardex] Global services: - ● oh-my-codex: active - ● @fission-ai/openspec: active - [musafety] Repo safety service: ● active. - [musafety] Repo: /home/deadpool/YOUREPO - [musafety] Branch: ksskkfb02 - musafety-tools logs: + [guardex] Repo safety service: ● active. + [guardex] Repo: /home/deadpool/YOUREPO + [guardex] Branch: ksskkfb02 + guardex-tools logs: ├─ USAGE - │ $ musafety <command> [options] + │ $ gx <command> [options] ├─ COMMANDS - │ status Show musafety CLI + service health without modifying files + │ status Show guardex CLI + service health without modifying files │ setup Install + repair guardrails in a git repo (supports --no-gitignore) │ doctor Repair safety setup drift, then verify repo safety │ copy-prompt Print the AI-ready setup checklist @@ -31,9 +31,9 @@ │ fix Repair broken or missing guardrail files/config (supports --no-gitignore) │ scan Report safety issues and exit non-zero on findings │ print-agents-snippet Print the AGENTS.md snippet template - │ release Publish musafety from maintainer release repo + │ release Publish guardex from maintainer release repo │ help Show this help output - │ version Print musafety version - └─ Try 'musafety doctor' for one-step repair + verification. + │ version Print guardex version + └─ Try 'guardex doctor' for one-step repair + verification. diff --git a/docs/redditpost.md b/docs/redditpost.md index 838c0ff..6d3ae8e 100644 --- a/docs/redditpost.md +++ b/docs/redditpost.md @@ -1,16 +1,16 @@ -# Reddit post drafts for musafety +# Reddit post drafts for GuardeX GitHub: https://github.com/recodeecom/multiagent-safety ## Draft 1 (general) **Title:** -I made an npm tool to keep multi-agent coding safe in Git repos (musafety) +I made an npm tool to keep multi-agent coding safe in Git repos (GuardeX) **Body:** Hey everyone 👋 -I built **musafety**, a small npm CLI to make multi-agent coding workflows safer and less chaotic in any Git repo. +I built **GuardeX**, a small npm CLI to make multi-agent coding workflows safer and less chaotic in any Git repo. If you run multiple agents (or teammates) in parallel, this helps prevent: @@ -22,40 +22,40 @@ If you run multiple agents (or teammates) in parallel, this helps prevent: Quick start: ```bash -npm i -g musafety -musafety setup +npm i -g gx +gx setup ``` Useful commands: ```bash -musafety protect list -musafety protect add release staging +gx protect list +gx protect add release staging ``` Links: - GitHub: https://github.com/recodeecom/multiagent-safety -- npm: https://www.npmjs.com/package/musafety +- npm: https://www.npmjs.com/package/guardex If you try it, I’d love feedback on team workflows and edge cases. ## Draft 2 (short) **Title:** -musafety: open-source npm CLI for safer multi-agent Git workflows +GuardeX: open-source npm CLI for safer multi-agent Git workflows **Body:** -I open-sourced **musafety** to add guardrails for parallel coding agents in Git repos. +I open-sourced **GuardeX** to add guardrails for parallel coding agents in Git repos. It blocks risky protected-branch commits, enforces per-file ownership locks for agent branches, and includes workflow scripts for branch start/finish. Install: ```bash -npm i -g musafety -musafety setup +npm i -g gx +gx setup ``` GitHub: https://github.com/recodeecom/multiagent-safety -npm: https://www.npmjs.com/package/musafety +npm: https://www.npmjs.com/package/guardex diff --git a/package-lock.json b/package-lock.json index 4802760..369a2a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,16 @@ { - "name": "musafety", + "name": "guardex", "version": "5.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "musafety", + "name": "guardex", "version": "5.0.0", "license": "MIT", "bin": { + "guardex": "bin/multiagent-safety.js", + "gx": "bin/multiagent-safety.js", "multiagent-safety": "bin/multiagent-safety.js", "musafety": "bin/multiagent-safety.js" }, diff --git a/package.json b/package.json index a0c95c2..637d45e 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,12 @@ { - "name": "musafety", + "name": "guardex", "version": "5.0.0", - "description": "Simple setup command for hardened multi-agent collaboration safety in git repos.", + "description": "GuardeX: the Guardian T-Rex for your repo, with hardened multi-agent git guardrails.", "license": "MIT", "preferGlobal": true, "bin": { + "guardex": "bin/multiagent-safety.js", + "gx": "bin/multiagent-safety.js", "musafety": "bin/multiagent-safety.js", "multiagent-safety": "bin/multiagent-safety.js" }, @@ -20,13 +22,13 @@ "agent:locks:release": "python3 ./scripts/agent-file-locks.py release", "agent:locks:status": "python3 ./scripts/agent-file-locks.py status", "agent:plan:init": "bash ./scripts/openspec/init-plan-workspace.sh", - "agent:protect:list": "musafety protect list", - "agent:branch:sync": "musafety sync", - "agent:branch:sync:check": "musafety sync --check", - "agent:safety:setup": "musafety setup", - "agent:safety:scan": "musafety scan", - "agent:safety:fix": "musafety fix", - "agent:safety:doctor": "musafety doctor" + "agent:protect:list": "gx protect list", + "agent:branch:sync": "gx sync", + "agent:branch:sync:check": "gx sync --check", + "agent:safety:setup": "gx setup", + "agent:safety:scan": "gx scan", + "agent:safety:fix": "gx fix", + "agent:safety:doctor": "gx doctor" }, "engines": { "node": ">=18" @@ -40,6 +42,7 @@ "CONTRIBUTING.md" ], "keywords": [ + "guardex", "multi-agent", "git-hooks", "branch-guard", diff --git a/scripts/openspec/init-plan-workspace.sh b/scripts/openspec/init-plan-workspace.sh index 9a6487a..cb4424e 100755 --- a/scripts/openspec/init-plan-workspace.sh +++ b/scripts/openspec/init-plan-workspace.sh @@ -114,5 +114,5 @@ Role workspace for \`${role}\`. " done -echo "[musafety] OpenSpec plan workspace ready: ${PLAN_DIR}" -echo "[musafety] Roles: ${ROLES[*]}" +echo "[guardex] OpenSpec plan workspace ready: ${PLAN_DIR}" +echo "[guardex] Roles: ${ROLES[*]}" diff --git a/templates/claude/commands/guardex.md b/templates/claude/commands/guardex.md new file mode 100644 index 0000000..13e4a6d --- /dev/null +++ b/templates/claude/commands/guardex.md @@ -0,0 +1,18 @@ +# /guardex + +Run a GuardeX check-and-repair workflow for the current repository. + +## Steps + +1. Run `gx status`. +2. If status is degraded, run `gx doctor`. +3. If still degraded, run `gx scan` and summarize each finding with a fix. +4. Report final verdict as one of: + - `Repo is guarded` + - `Repo is not guarded` (include blockers) + +## Style + +- Keep output short and operational. +- Include exact commands you executed. +- Prefer concrete next actions over generic advice. diff --git a/templates/claude/commands/musafety.md b/templates/claude/commands/musafety.md deleted file mode 100644 index 5b180c0..0000000 --- a/templates/claude/commands/musafety.md +++ /dev/null @@ -1,18 +0,0 @@ -# /musafety - -Run a musafety check-and-repair workflow for the current repository. - -## Steps - -1. Run `musafety status`. -2. If status is degraded, run `musafety doctor`. -3. If still degraded, run `musafety scan` and summarize each finding with a fix. -4. Report final verdict as one of: - - `Repo is musafe` - - `Repo is not musafe` (include blockers) - -## Style - -- Keep output short and operational. -- Include exact commands you executed. -- Prefer concrete next actions over generic advice. diff --git a/.codex/skills/musafety/SKILL.md b/templates/codex/skills/guardex/SKILL.md similarity index 57% rename from .codex/skills/musafety/SKILL.md rename to templates/codex/skills/guardex/SKILL.md index ceb2cd8..efa491e 100644 --- a/.codex/skills/musafety/SKILL.md +++ b/templates/codex/skills/guardex/SKILL.md @@ -1,35 +1,36 @@ --- -name: musafety +name: guardex description: "Use when you need to check, repair, or bootstrap multi-agent safety guardrails in this repository." --- -# musafety (Codex skill) +# GuardeX (Codex skill) Use this skill whenever branch safety, lock ownership, or guardrail setup may be broken. ## Fast path -1. Run `musafety status`. -2. If repo safety is degraded, run `musafety doctor`. -3. If issues remain, run `musafety scan` and address the findings. +1. Run `gx status`. +2. If repo safety is degraded, run `gx doctor`. +3. If issues remain, run `gx scan` and address the findings. ## Setup path If guardrails are missing entirely, run: ```sh -musafety setup +gx setup ``` Then verify: ```sh -musafety status -musafety scan +gx status +gx scan ``` ## Operator notes -- Prefer `musafety doctor` for one-step repair + verification. +- Prefer `gx doctor` for one-step repair + verification. - Keep agent work isolated (`agent/*` branches + lock claims). +- For one-command Codex sandbox startup, use `bash scripts/codex-agent.sh "" ""`. - Do not bypass protected branch safeguards unless explicitly required. diff --git a/templates/githooks/pre-commit b/templates/githooks/pre-commit index f1c28fe..3ee6228 100755 --- a/templates/githooks/pre-commit +++ b/templates/githooks/pre-commit @@ -136,7 +136,7 @@ MSG cat >&2 < MSG diff --git a/templates/scripts/codex-agent.sh b/templates/scripts/codex-agent.sh index 2c560cc..a565f78 100755 --- a/templates/scripts/codex-agent.sh +++ b/templates/scripts/codex-agent.sh @@ -66,7 +66,7 @@ if ! command -v "$CODEX_BIN" >/dev/null 2>&1; then fi if [[ ! -x "scripts/agent-branch-start.sh" ]]; then - echo "[codex-agent] Missing scripts/agent-branch-start.sh. Run: musafety setup" >&2 + echo "[codex-agent] Missing scripts/agent-branch-start.sh. Run: gx setup" >&2 exit 1 fi diff --git a/templates/scripts/openspec/init-plan-workspace.sh b/templates/scripts/openspec/init-plan-workspace.sh index 9a6487a..cb4424e 100644 --- a/templates/scripts/openspec/init-plan-workspace.sh +++ b/templates/scripts/openspec/init-plan-workspace.sh @@ -114,5 +114,5 @@ Role workspace for \`${role}\`. " done -echo "[musafety] OpenSpec plan workspace ready: ${PLAN_DIR}" -echo "[musafety] Roles: ${ROLES[*]}" +echo "[guardex] OpenSpec plan workspace ready: ${PLAN_DIR}" +echo "[guardex] Roles: ${ROLES[*]}" diff --git a/test/install.test.js b/test/install.test.js index 85022af..fc9afa7 100644 --- a/test/install.test.js +++ b/test/install.test.js @@ -197,8 +197,8 @@ test('setup provisions workflow files and repo config', () => { 'scripts/install-agent-git-hooks.sh', 'scripts/openspec/init-plan-workspace.sh', '.githooks/pre-commit', - '.codex/skills/musafety/SKILL.md', - '.claude/commands/musafety.md', + '.codex/skills/guardex/SKILL.md', + '.claude/commands/guardex.md', '.omx/state/agent-file-locks.json', '.gitignore', 'AGENTS.md', @@ -212,10 +212,10 @@ test('setup provisions workflow files and repo config', () => { assert.equal(packageJson.scripts['agent:codex'], 'bash ./scripts/codex-agent.sh'); assert.equal(packageJson.scripts['agent:branch:start'], 'bash ./scripts/agent-branch-start.sh'); assert.equal(packageJson.scripts['agent:plan:init'], 'bash ./scripts/openspec/init-plan-workspace.sh'); - assert.equal(packageJson.scripts['agent:protect:list'], 'musafety protect list'); - assert.equal(packageJson.scripts['agent:branch:sync'], 'musafety sync'); - assert.equal(packageJson.scripts['agent:branch:sync:check'], 'musafety sync --check'); - assert.equal(packageJson.scripts['agent:safety:setup'], 'musafety setup'); + assert.equal(packageJson.scripts['agent:protect:list'], 'gx protect list'); + assert.equal(packageJson.scripts['agent:branch:sync'], 'gx sync'); + assert.equal(packageJson.scripts['agent:branch:sync:check'], 'gx sync --check'); + assert.equal(packageJson.scripts['agent:safety:setup'], 'gx setup'); assert.equal(packageJson.scripts['agent:cleanup'], 'bash ./scripts/agent-worktree-prune.sh --base dev'); const agentsContent = fs.readFileSync(path.join(repoDir, 'AGENTS.md'), 'utf8'); @@ -228,8 +228,8 @@ test('setup provisions workflow files and repo config', () => { assert.match(gitignoreContent, /scripts\/agent-file-locks\.py/); assert.match(gitignoreContent, /\.githooks\/pre-commit/); assert.match(gitignoreContent, /oh-my-codex\//); - assert.match(gitignoreContent, /\.codex\/skills\/musafety\/SKILL\.md/); - assert.match(gitignoreContent, /\.claude\/commands\/musafety\.md/); + assert.match(gitignoreContent, /\.codex\/skills\/guardex\/SKILL\.md/); + assert.match(gitignoreContent, /\.claude\/commands\/guardex\.md/); assert.match(gitignoreContent, /\.omx\/state\/agent-file-locks\.json/); assert.match(gitignoreContent, /# multiagent-safety:END/); @@ -327,7 +327,7 @@ test('setup agent-branch-start defaults base to current branch and stores per-br result = runCmd('git', ['add', '.'], repoDir); assert.equal(result.status, 0, result.stderr); - result = runCmd('git', ['commit', '-m', 'apply musafety setup'], repoDir, { + result = runCmd('git', ['commit', '-m', 'apply gx setup'], repoDir, { ALLOW_COMMIT_ON_PROTECTED_BRANCH: '1', }); assert.equal(result.status, 0, result.stderr || result.stdout); @@ -358,7 +358,7 @@ test('agent-branch-start moves protected-branch local changes into the new agent result = runCmd('git', ['add', '.'], repoDir); assert.equal(result.status, 0, result.stderr); - result = runCmd('git', ['commit', '-m', 'apply musafety setup'], repoDir, { + result = runCmd('git', ['commit', '-m', 'apply gx setup'], repoDir, { ALLOW_COMMIT_ON_PROTECTED_BRANCH: '1', }); assert.equal(result.status, 0, result.stderr || result.stdout); @@ -397,7 +397,7 @@ test('agent-branch-finish infers base from source branch metadata and updates ma assert.equal(result.status, 0, result.stderr || result.stdout); result = runCmd('git', ['add', '.'], repoDir); assert.equal(result.status, 0, result.stderr); - result = runCmd('git', ['commit', '-m', 'apply musafety setup'], repoDir, { + result = runCmd('git', ['commit', '-m', 'apply gx setup'], repoDir, { ALLOW_COMMIT_ON_PROTECTED_BRANCH: '1', }); assert.equal(result.status, 0, result.stderr || result.stdout); @@ -436,21 +436,21 @@ test('default invocation runs non-mutating status output', () => { const result = runNode([], repoDir); assert.equal(result.status, 0, result.stderr || result.stdout); - assert.match(result.stdout, /\[musafety\] CLI:/); - assert.match(result.stdout, /\[musafety\] Global services:/); - assert.match(result.stdout, /\[musafety\] Repo safety service:/); + assert.match(result.stdout, /\[guardex\] CLI:/); + assert.match(result.stdout, /\[guardex\] Global services:/); + assert.match(result.stdout, /\[guardex\] Repo safety service:/); assert.match(result.stdout, /●/); - const serviceIdx = result.stdout.indexOf('[musafety] Repo safety service:'); - const repoIdx = result.stdout.indexOf('[musafety] Repo:'); - const branchIdx = result.stdout.indexOf('[musafety] Branch:'); - const toolsIdx = result.stdout.indexOf('musafety-tools logs:'); + const serviceIdx = result.stdout.indexOf('[guardex] Repo safety service:'); + const repoIdx = result.stdout.indexOf('[guardex] Repo:'); + const branchIdx = result.stdout.indexOf('[guardex] Branch:'); + const toolsIdx = result.stdout.indexOf('guardex-tools logs:'); assert.equal(serviceIdx >= 0, true); assert.equal(repoIdx > serviceIdx, true); assert.equal(branchIdx > repoIdx, true); assert.equal(toolsIdx > branchIdx, true); - assert.match(result.stdout, /musafety-tools logs:/); - assert.match(result.stdout, /USAGE\n\s+\$ musafety \[options\]/); - assert.match(result.stdout, /COMMANDS\n\s+status\s+Show musafety CLI \+ service health without modifying files/); + assert.match(result.stdout, /guardex-tools logs:/); + assert.match(result.stdout, /USAGE\n\s+\$ gx \[options\]/); + assert.match(result.stdout, /COMMANDS\n\s+status\s+Show GuardeX CLI \+ service health without modifying files/); assert.equal(fs.existsSync(path.join(repoDir, '.githooks', 'pre-commit')), false); }); @@ -459,8 +459,8 @@ test('default invocation outside git repo reports inactive repo service', () => const result = runNode([], outsideDir); assert.equal(result.status, 0, result.stderr || result.stdout); - assert.match(result.stdout, /\[musafety\] CLI:/); - assert.match(result.stdout, /\[musafety\] Global services:/); + assert.match(result.stdout, /\[guardex\] CLI:/); + assert.match(result.stdout, /\[guardex\] Global services:/); assert.match(result.stdout, /Repo safety service: .*inactive/); }); @@ -476,7 +476,7 @@ if [[ "$1" == "list" ]]; then echo '{"dependencies":{"oh-my-codex":{},"@fission-ai/openspec":{}}}' exit 0 fi -if [[ "$1" == "i" && "$2" == "-g" && "$3" == "musafety@latest" ]]; then +if [[ "$1" == "i" && "$2" == "-g" && "$3" == "guardex@latest" ]]; then echo "updated" > "${markerPath}" exit 0 fi @@ -513,7 +513,7 @@ test('status --json returns cli, services, and repo summary', () => { assert.equal(result.status, 0, result.stderr || result.stdout); const parsed = JSON.parse(result.stdout); - assert.equal(parsed.cli.name, 'musafety'); + assert.equal(parsed.cli.name, 'guardex'); assert.equal(typeof parsed.cli.version, 'string'); assert.equal(Array.isArray(parsed.services), true); assert.equal(parsed.repo.inGitRepo, true); @@ -723,7 +723,7 @@ test('sync command rebases current agent branch onto latest origin/dev', () => { assert.equal(result.status, 0, result.stderr || result.stdout); result = runCmd('git', ['add', '.'], repoDir); assert.equal(result.status, 0, result.stderr); - result = runCmd('git', ['commit', '-m', 'apply musafety setup'], repoDir, { + result = runCmd('git', ['commit', '-m', 'apply gx setup'], repoDir, { ALLOW_COMMIT_ON_PROTECTED_BRANCH: '1', }); assert.equal(result.status, 0, result.stderr); @@ -769,7 +769,7 @@ test('pre-commit sync gate blocks agent commits when branch is too far behind ba assert.equal(result.status, 0, result.stderr || result.stdout); result = runCmd('git', ['add', '.'], repoDir); assert.equal(result.status, 0, result.stderr); - result = runCmd('git', ['commit', '-m', 'apply musafety setup'], repoDir, { + result = runCmd('git', ['commit', '-m', 'apply gx setup'], repoDir, { ALLOW_COMMIT_ON_PROTECTED_BRANCH: '1', }); assert.equal(result.status, 0, result.stderr); @@ -805,7 +805,7 @@ test('pre-commit sync gate blocks agent commits when branch is too far behind ba const commitAttempt = runCmd('git', ['commit', '-m', 'should block due to behind gate'], repoDir); assert.equal(commitAttempt.status, 1, commitAttempt.stderr || commitAttempt.stdout); assert.match(commitAttempt.stderr, /agent-sync-guard/); - assert.match(commitAttempt.stderr, /musafety sync --base dev/); + assert.match(commitAttempt.stderr, /gx sync --base dev/); }); test('pre-commit sync gate honors maxBehindCommits threshold', () => { @@ -817,7 +817,7 @@ test('pre-commit sync gate honors maxBehindCommits threshold', () => { assert.equal(result.status, 0, result.stderr || result.stdout); result = runCmd('git', ['add', '.'], repoDir); assert.equal(result.status, 0, result.stderr); - result = runCmd('git', ['commit', '-m', 'apply musafety setup'], repoDir, { + result = runCmd('git', ['commit', '-m', 'apply gx setup'], repoDir, { ALLOW_COMMIT_ON_PROTECTED_BRANCH: '1', }); assert.equal(result.status, 0, result.stderr); @@ -863,7 +863,7 @@ test('agent-branch-finish auto-syncs source branch when behind origin/dev', () = assert.equal(result.status, 0, result.stderr || result.stdout); result = runCmd('git', ['add', '.'], repoDir); assert.equal(result.status, 0, result.stderr); - result = runCmd('git', ['commit', '-m', 'apply musafety setup'], repoDir, { + result = runCmd('git', ['commit', '-m', 'apply gx setup'], repoDir, { ALLOW_COMMIT_ON_PROTECTED_BRANCH: '1', }); assert.equal(result.status, 0, result.stderr); @@ -910,7 +910,7 @@ test('agent-branch-finish pr mode continues cleanup when gh merge only fails loc assert.equal(result.status, 0, result.stderr || result.stdout); result = runCmd('git', ['add', '.'], repoDir); assert.equal(result.status, 0, result.stderr); - result = runCmd('git', ['commit', '-m', 'apply musafety setup'], repoDir, { + result = runCmd('git', ['commit', '-m', 'apply gx setup'], repoDir, { ALLOW_COMMIT_ON_PROTECTED_BRANCH: '1', }); assert.equal(result.status, 0, result.stderr); @@ -1168,9 +1168,9 @@ test('copy-prompt outputs AI setup instructions', () => { const repoDir = initRepo(); const result = runNode(['copy-prompt'], repoDir); assert.equal(result.status, 0, result.stderr || result.stdout); - assert.match(result.stdout, /npm i -g musafety/); + assert.match(result.stdout, /npm i -g guardex/); assert.match(result.stdout, /npm i -g oh-my-codex @fission-ai\/openspec/); - assert.match(result.stdout, /musafety setup/); + assert.match(result.stdout, /gx setup/); assert.match(result.stdout, /Codex or Claude/); assert.match(result.stdout, /scripts\/agent-file-locks.py claim/); }); @@ -1179,11 +1179,11 @@ test('copy-commands outputs command-only checklist', () => { const repoDir = initRepo(); const result = runNode(['copy-commands'], repoDir); assert.equal(result.status, 0, result.stderr || result.stdout); - assert.match(result.stdout, /^npm i -g musafety/m); - assert.match(result.stdout, /musafety setup/); - assert.match(result.stdout, /musafety doctor/); + assert.match(result.stdout, /^npm i -g guardex/m); + assert.match(result.stdout, /gx setup/); + assert.match(result.stdout, /gx doctor/); assert.match(result.stdout, /scripts\/agent-file-locks.py claim/); - assert.match(result.stdout, /musafety sync --check/); + assert.match(result.stdout, /gx sync --check/); assert.doesNotMatch(result.stdout, /Use this exact checklist/); });