Skip to content

feat(prompt): compress full gx prompt narrative + document rtk wrapping#652

Merged
NagyVikt merged 3 commits into
mainfrom
claude/repo-auto-suggestions-1wppv0
Jun 19, 2026
Merged

feat(prompt): compress full gx prompt narrative + document rtk wrapping#652
NagyVikt merged 3 commits into
mainfrom
claude/repo-auto-suggestions-1wppv0

Conversation

@NagyVikt

Copy link
Copy Markdown
Collaborator

What

Makes gitguardex's compression actually pull its weight. The GUARDEX_COMPRESS_CMD hook (PR #649/#650) existed but only covered gx prompt --snippet. This extends it to the rest of the narrative prompt surface and documents rtk wrapping for gx commands.

Code

  • gx prompt (default ~3KB checklist) and the deprecated copy-prompt now route through compressBlock — that checklist is the single biggest blob an agent reads every session, and it was being printed raw.
  • gx prompt --exec and copy-commands deliberately stay raw — they emit shell-ready commands a compressor would corrupt.
  • status/doctor left untouched on purpose: their output is structured, colorized, line-by-line, with many exact-match tests — not a safe bulk-compress target. (Documented; this is why the original change only did the snippet.)
  • All existing guards inherited: terse/non-TTY only, ≥400 chars, skips JSON/machine-readable, fail-open. Default (env unset) output is byte-for-byte unchanged.

Instructions

  • skills/gitguardex/SKILL.md (+ codex template mirror, parity held): concrete rtk gx status / rtk gx doctor examples + the GUARDEX_COMPRESS_CMD self-compress note, with the "don't wrap --json/--exec" caveat.
  • templates/AGENTS.multiagent-safety.md companion-tooling block: same rtk gx examples + which gx outputs self-compress.

Verification

  • Targeted tests 58/58 pass (prompt + metadata parity + output).
  • npm run lint clean; root ↔ codex SKILL parity test holds.
  • Full suite: +2 tests, +2 pass, no new failures (the 22 failures are pre-existing and environment-specific to the sandbox; CI on Actions is green).
  • New regressions: default-prompt compresses through tr a-z A-Z; --exec stays raw under the same env.

🤖 Generated with Claude Code

https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw


Generated by Claude Code

claude added 3 commits June 18, 2026 17:23
CLI guardrails:
- Add Biome 1.9.4 with a green-baseline config (recommended rules on,
  currently-violated stylistic rules disabled) so CI catches new issues
  without churning 85 existing files. Adds lint/format/format:check scripts.
- Add test:coverage script (node --experimental-test-coverage) and wire
  Lint + coverage steps into the PR CI workflow.
- Expand npm keywords for package discoverability.

Frontend SEO/GEO:
- Enrich root metadata: metadataBase, canonical, OpenGraph, Twitter card,
  robots directives, viewport, and SoftwareApplication JSON-LD.
- Add robots.ts and sitemap.ts metadata routes.
- Add public/llms.txt for generative-engine optimization.
- Site origin is overridable via NEXT_PUBLIC_SITE_URL.

Verified: biome lint clean, frontend tsc --noEmit clean. The 22 failing
tests are pre-existing in this sandbox (env-specific) and unrelated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw
Extends the existing GUARDEX_COMPRESS_CMD hook (which only covered
`gx prompt --snippet`) to the rest of the narrative prompt surface:

- `gx prompt` (default 3KB checklist) and the deprecated `copy-prompt`
  now route through compressBlock — the biggest blob agents read each
  session.
- `gx prompt --exec` and `copy-commands` stay raw: they emit shell-ready
  commands a compressor would corrupt. status/doctor are left untouched
  (structured, colorized, line-by-line — not safe to bulk-compress).

Instructions: add concrete rtk gx-command wrapping examples (rtk gx
status / doctor) and the GUARDEX_COMPRESS_CMD self-compress note to the
gitguardex SKILL and the managed AGENTS companion-tooling block.

Tests: default-prompt compression + --exec-stays-raw regressions.
Verified: targeted tests 58/58 pass, lint clean, codex/root SKILL parity
held, no new failures in the full suite (22 pre-existing env-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw
@NagyVikt NagyVikt marked this pull request as ready for review June 19, 2026 08:41
@NagyVikt NagyVikt merged commit 828ab06 into main Jun 19, 2026
5 of 6 checks passed
@NagyVikt NagyVikt deleted the claude/repo-auto-suggestions-1wppv0 branch June 19, 2026 08:41
NagyVikt added a commit that referenced this pull request Jun 20, 2026
…653)

* chore: add Biome lint + coverage CI and frontend SEO/GEO

CLI guardrails:
- Add Biome 1.9.4 with a green-baseline config (recommended rules on,
  currently-violated stylistic rules disabled) so CI catches new issues
  without churning 85 existing files. Adds lint/format/format:check scripts.
- Add test:coverage script (node --experimental-test-coverage) and wire
  Lint + coverage steps into the PR CI workflow.
- Expand npm keywords for package discoverability.

Frontend SEO/GEO:
- Enrich root metadata: metadataBase, canonical, OpenGraph, Twitter card,
  robots directives, viewport, and SoftwareApplication JSON-LD.
- Add robots.ts and sitemap.ts metadata routes.
- Add public/llms.txt for generative-engine optimization.
- Site origin is overridable via NEXT_PUBLIC_SITE_URL.

Verified: biome lint clean, frontend tsc --noEmit clean. The 22 failing
tests are pre-existing in this sandbox (env-specific) and unrelated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(prompt): compress full gx prompt narrative + document rtk wrapping

Extends the existing GUARDEX_COMPRESS_CMD hook (which only covered
`gx prompt --snippet`) to the rest of the narrative prompt surface:

- `gx prompt` (default 3KB checklist) and the deprecated `copy-prompt`
  now route through compressBlock — the biggest blob agents read each
  session.
- `gx prompt --exec` and `copy-commands` stay raw: they emit shell-ready
  commands a compressor would corrupt. status/doctor are left untouched
  (structured, colorized, line-by-line — not safe to bulk-compress).

Instructions: add concrete rtk gx-command wrapping examples (rtk gx
status / doctor) and the GUARDEX_COMPRESS_CMD self-compress note to the
gitguardex SKILL and the managed AGENTS companion-tooling block.

Tests: default-prompt compression + --exec-stays-raw regressions.
Verified: targeted tests 58/58 pass, lint clean, codex/root SKILL parity
held, no new failures in the full suite (22 pre-existing env-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(status): surface GUARDEX_COMPRESS_CMD token-compression health

The compression hook (PR #649/#652) fails open: when GUARDEX_COMPRESS_CMD
is set but the binary is missing/misconfigured, gx silently prints raw
output and quietly wastes the tokens the feature was meant to save — with
no way to notice. `gx status` now makes it observable.

- New output helpers: `describeCompressor(env)` reports
  {configured, command, available}; `isExecutableOnPath` is a defensive,
  cross-platform (PATHEXT-aware) lookup that returns null on any error.
- `gx status` adds a `compression` field to the JSON payload and, when
  configured, prints a `Token compression` line — degraded when the
  binary is not found on PATH. Silent (no line) when unset, so the common
  case stays noise-free.
- SKILL/AGENTS docs note that `gx status` verifies the wiring.

Verified: 6 new tests (output unit + status JSON/human), all pass; lint
clean; SKILL parity held; no new failures in the full suite (22
pre-existing, environment-specific to the sandbox).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

---------

Co-authored-by: Claude <noreply@anthropic.com>
NagyVikt added a commit that referenced this pull request Jun 20, 2026
* chore: add Biome lint + coverage CI and frontend SEO/GEO

CLI guardrails:
- Add Biome 1.9.4 with a green-baseline config (recommended rules on,
  currently-violated stylistic rules disabled) so CI catches new issues
  without churning 85 existing files. Adds lint/format/format:check scripts.
- Add test:coverage script (node --experimental-test-coverage) and wire
  Lint + coverage steps into the PR CI workflow.
- Expand npm keywords for package discoverability.

Frontend SEO/GEO:
- Enrich root metadata: metadataBase, canonical, OpenGraph, Twitter card,
  robots directives, viewport, and SoftwareApplication JSON-LD.
- Add robots.ts and sitemap.ts metadata routes.
- Add public/llms.txt for generative-engine optimization.
- Site origin is overridable via NEXT_PUBLIC_SITE_URL.

Verified: biome lint clean, frontend tsc --noEmit clean. The 22 failing
tests are pre-existing in this sandbox (env-specific) and unrelated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(prompt): compress full gx prompt narrative + document rtk wrapping

Extends the existing GUARDEX_COMPRESS_CMD hook (which only covered
`gx prompt --snippet`) to the rest of the narrative prompt surface:

- `gx prompt` (default 3KB checklist) and the deprecated `copy-prompt`
  now route through compressBlock — the biggest blob agents read each
  session.
- `gx prompt --exec` and `copy-commands` stay raw: they emit shell-ready
  commands a compressor would corrupt. status/doctor are left untouched
  (structured, colorized, line-by-line — not safe to bulk-compress).

Instructions: add concrete rtk gx-command wrapping examples (rtk gx
status / doctor) and the GUARDEX_COMPRESS_CMD self-compress note to the
gitguardex SKILL and the managed AGENTS companion-tooling block.

Tests: default-prompt compression + --exec-stays-raw regressions.
Verified: targeted tests 58/58 pass, lint clean, codex/root SKILL parity
held, no new failures in the full suite (22 pre-existing env-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(status): surface GUARDEX_COMPRESS_CMD token-compression health

The compression hook (PR #649/#652) fails open: when GUARDEX_COMPRESS_CMD
is set but the binary is missing/misconfigured, gx silently prints raw
output and quietly wastes the tokens the feature was meant to save — with
no way to notice. `gx status` now makes it observable.

- New output helpers: `describeCompressor(env)` reports
  {configured, command, available}; `isExecutableOnPath` is a defensive,
  cross-platform (PATHEXT-aware) lookup that returns null on any error.
- `gx status` adds a `compression` field to the JSON payload and, when
  configured, prints a `Token compression` line — degraded when the
  binary is not found on PATH. Silent (no line) when unset, so the common
  case stays noise-free.
- SKILL/AGENTS docs note that `gx status` verifies the wiring.

Verified: 6 new tests (output unit + status JSON/human), all pass; lint
clean; SKILL parity held; no new failures in the full suite (22
pre-existing, environment-specific to the sandbox).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(doctor): add token-compression health check

Complements the gx status visibility (PR #653) on the diagnose-and-repair
surface. gx doctor now reports the GUARDEX_COMPRESS_CMD setup:

- Human output: a `Token compression` line after the system-tool status —
  a warn-colored advisory when the configured binary is not on PATH,
  otherwise a plain "configured" line. Silent when unset.
- JSON payload (single-repo): new `compression` field via
  describeCompressor(); recursive runs inherit it through each child.
- Advisory only: a missing compressor never changes doctor's safe/unsafe
  exit code (compression is an optimization, not a safety guarantee).

Docs: SKILL/AGENTS note both `gx status` and `gx doctor` verify the wiring.

Verified: 3 new tests (missing-binary advisory + non-gating exit,
configured/unset, --json field); lint clean; SKILL parity held; no new
failures in the full suite (22 pre-existing, environment-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

---------

Co-authored-by: Claude <noreply@anthropic.com>
NagyVikt added a commit that referenced this pull request Jun 20, 2026
* chore: add Biome lint + coverage CI and frontend SEO/GEO

CLI guardrails:
- Add Biome 1.9.4 with a green-baseline config (recommended rules on,
  currently-violated stylistic rules disabled) so CI catches new issues
  without churning 85 existing files. Adds lint/format/format:check scripts.
- Add test:coverage script (node --experimental-test-coverage) and wire
  Lint + coverage steps into the PR CI workflow.
- Expand npm keywords for package discoverability.

Frontend SEO/GEO:
- Enrich root metadata: metadataBase, canonical, OpenGraph, Twitter card,
  robots directives, viewport, and SoftwareApplication JSON-LD.
- Add robots.ts and sitemap.ts metadata routes.
- Add public/llms.txt for generative-engine optimization.
- Site origin is overridable via NEXT_PUBLIC_SITE_URL.

Verified: biome lint clean, frontend tsc --noEmit clean. The 22 failing
tests are pre-existing in this sandbox (env-specific) and unrelated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(prompt): compress full gx prompt narrative + document rtk wrapping

Extends the existing GUARDEX_COMPRESS_CMD hook (which only covered
`gx prompt --snippet`) to the rest of the narrative prompt surface:

- `gx prompt` (default 3KB checklist) and the deprecated `copy-prompt`
  now route through compressBlock — the biggest blob agents read each
  session.
- `gx prompt --exec` and `copy-commands` stay raw: they emit shell-ready
  commands a compressor would corrupt. status/doctor are left untouched
  (structured, colorized, line-by-line — not safe to bulk-compress).

Instructions: add concrete rtk gx-command wrapping examples (rtk gx
status / doctor) and the GUARDEX_COMPRESS_CMD self-compress note to the
gitguardex SKILL and the managed AGENTS companion-tooling block.

Tests: default-prompt compression + --exec-stays-raw regressions.
Verified: targeted tests 58/58 pass, lint clean, codex/root SKILL parity
held, no new failures in the full suite (22 pre-existing env-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(status): surface GUARDEX_COMPRESS_CMD token-compression health

The compression hook (PR #649/#652) fails open: when GUARDEX_COMPRESS_CMD
is set but the binary is missing/misconfigured, gx silently prints raw
output and quietly wastes the tokens the feature was meant to save — with
no way to notice. `gx status` now makes it observable.

- New output helpers: `describeCompressor(env)` reports
  {configured, command, available}; `isExecutableOnPath` is a defensive,
  cross-platform (PATHEXT-aware) lookup that returns null on any error.
- `gx status` adds a `compression` field to the JSON payload and, when
  configured, prints a `Token compression` line — degraded when the
  binary is not found on PATH. Silent (no line) when unset, so the common
  case stays noise-free.
- SKILL/AGENTS docs note that `gx status` verifies the wiring.

Verified: 6 new tests (output unit + status JSON/human), all pass; lint
clean; SKILL parity held; no new failures in the full suite (22
pre-existing, environment-specific to the sandbox).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(doctor): add token-compression health check

Complements the gx status visibility (PR #653) on the diagnose-and-repair
surface. gx doctor now reports the GUARDEX_COMPRESS_CMD setup:

- Human output: a `Token compression` line after the system-tool status —
  a warn-colored advisory when the configured binary is not on PATH,
  otherwise a plain "configured" line. Silent when unset.
- JSON payload (single-repo): new `compression` field via
  describeCompressor(); recursive runs inherit it through each child.
- Advisory only: a missing compressor never changes doctor's safe/unsafe
  exit code (compression is an optimization, not a safety guarantee).

Docs: SKILL/AGENTS note both `gx status` and `gx doctor` verify the wiring.

Verified: 3 new tests (missing-binary advisory + non-gating exit,
configured/unset, --json field); lint clean; SKILL parity held; no new
failures in the full suite (22 pre-existing, environment-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* test(pr): cover the gx pr command layer (parse + format helpers)

src/cli/commands/pr.js was ~9% covered — pr-module.test.js only exercises
the gh-facing logic in src/pr.js. Adds network-free unit tests for the
command layer's pure helpers:

- parsePrArgs: defaults, value flags, --branch/--head alias, boolean
  toggles, and validation paths (--merge-strategy, --timeout, --interval
  reject bad values; seconds->ms conversion).
- renderChecksLine: empty/zero, multi-bucket join, count fallback.
- printUsage: lists all subcommands.

10 tests, all pass; lint clean. New isolated test file, no src changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

---------

Co-authored-by: Claude <noreply@anthropic.com>
NagyVikt added a commit that referenced this pull request Jun 20, 2026
* chore: add Biome lint + coverage CI and frontend SEO/GEO

CLI guardrails:
- Add Biome 1.9.4 with a green-baseline config (recommended rules on,
  currently-violated stylistic rules disabled) so CI catches new issues
  without churning 85 existing files. Adds lint/format/format:check scripts.
- Add test:coverage script (node --experimental-test-coverage) and wire
  Lint + coverage steps into the PR CI workflow.
- Expand npm keywords for package discoverability.

Frontend SEO/GEO:
- Enrich root metadata: metadataBase, canonical, OpenGraph, Twitter card,
  robots directives, viewport, and SoftwareApplication JSON-LD.
- Add robots.ts and sitemap.ts metadata routes.
- Add public/llms.txt for generative-engine optimization.
- Site origin is overridable via NEXT_PUBLIC_SITE_URL.

Verified: biome lint clean, frontend tsc --noEmit clean. The 22 failing
tests are pre-existing in this sandbox (env-specific) and unrelated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(prompt): compress full gx prompt narrative + document rtk wrapping

Extends the existing GUARDEX_COMPRESS_CMD hook (which only covered
`gx prompt --snippet`) to the rest of the narrative prompt surface:

- `gx prompt` (default 3KB checklist) and the deprecated `copy-prompt`
  now route through compressBlock — the biggest blob agents read each
  session.
- `gx prompt --exec` and `copy-commands` stay raw: they emit shell-ready
  commands a compressor would corrupt. status/doctor are left untouched
  (structured, colorized, line-by-line — not safe to bulk-compress).

Instructions: add concrete rtk gx-command wrapping examples (rtk gx
status / doctor) and the GUARDEX_COMPRESS_CMD self-compress note to the
gitguardex SKILL and the managed AGENTS companion-tooling block.

Tests: default-prompt compression + --exec-stays-raw regressions.
Verified: targeted tests 58/58 pass, lint clean, codex/root SKILL parity
held, no new failures in the full suite (22 pre-existing env-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(status): surface GUARDEX_COMPRESS_CMD token-compression health

The compression hook (PR #649/#652) fails open: when GUARDEX_COMPRESS_CMD
is set but the binary is missing/misconfigured, gx silently prints raw
output and quietly wastes the tokens the feature was meant to save — with
no way to notice. `gx status` now makes it observable.

- New output helpers: `describeCompressor(env)` reports
  {configured, command, available}; `isExecutableOnPath` is a defensive,
  cross-platform (PATHEXT-aware) lookup that returns null on any error.
- `gx status` adds a `compression` field to the JSON payload and, when
  configured, prints a `Token compression` line — degraded when the
  binary is not found on PATH. Silent (no line) when unset, so the common
  case stays noise-free.
- SKILL/AGENTS docs note that `gx status` verifies the wiring.

Verified: 6 new tests (output unit + status JSON/human), all pass; lint
clean; SKILL parity held; no new failures in the full suite (22
pre-existing, environment-specific to the sandbox).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(doctor): add token-compression health check

Complements the gx status visibility (PR #653) on the diagnose-and-repair
surface. gx doctor now reports the GUARDEX_COMPRESS_CMD setup:

- Human output: a `Token compression` line after the system-tool status —
  a warn-colored advisory when the configured binary is not on PATH,
  otherwise a plain "configured" line. Silent when unset.
- JSON payload (single-repo): new `compression` field via
  describeCompressor(); recursive runs inherit it through each child.
- Advisory only: a missing compressor never changes doctor's safe/unsafe
  exit code (compression is an optimization, not a safety guarantee).

Docs: SKILL/AGENTS note both `gx status` and `gx doctor` verify the wiring.

Verified: 3 new tests (missing-binary advisory + non-gating exit,
configured/unset, --json field); lint clean; SKILL parity held; no new
failures in the full suite (22 pre-existing, environment-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* test(pr): cover the gx pr command layer (parse + format helpers)

src/cli/commands/pr.js was ~9% covered — pr-module.test.js only exercises
the gh-facing logic in src/pr.js. Adds network-free unit tests for the
command layer's pure helpers:

- parsePrArgs: defaults, value flags, --branch/--head alias, boolean
  toggles, and validation paths (--merge-strategy, --timeout, --interval
  reject bad values; seconds->ms conversion).
- renderChecksLine: empty/zero, multi-bucket join, count fallback.
- printUsage: lists all subcommands.

10 tests, all pass; lint clean. New isolated test file, no src changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* fix(sandbox): recover stranded worktree dirs during cleanup instead of stranding the branch

cleanupProtectedBaseSandbox (used by gx doctor + the shared sandbox
finalizer — the recovery flows the README flags as rough) treated a
`git worktree remove` non-zero exit as fatal. After a crash or partial
manual cleanup, the path can exist on disk while git no longer tracks it
as a worktree; `git worktree remove` then fails with "is not a working
tree", the function throws, and the branch-delete step never runs —
leaving a leaked branch and a half-finished cleanup.

Now: on a non-spawn-failure remove error, prune stale worktree metadata,
remove the leftover directory (both idempotent), set worktree='pruned',
and continue to branch deletion. Spawn failures (missing git) still throw.
Happy path is byte-for-byte unchanged.

Tests: new test/sandbox-cleanup.test.js covers happy-path removal,
stranded-dir recovery (threw before the fix), and missing-metadata no-op.
Full suite: no new failures (22 pre-existing, environment-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

---------

Co-authored-by: Claude <noreply@anthropic.com>
NagyVikt added a commit that referenced this pull request Jun 20, 2026
* chore: add Biome lint + coverage CI and frontend SEO/GEO

CLI guardrails:
- Add Biome 1.9.4 with a green-baseline config (recommended rules on,
  currently-violated stylistic rules disabled) so CI catches new issues
  without churning 85 existing files. Adds lint/format/format:check scripts.
- Add test:coverage script (node --experimental-test-coverage) and wire
  Lint + coverage steps into the PR CI workflow.
- Expand npm keywords for package discoverability.

Frontend SEO/GEO:
- Enrich root metadata: metadataBase, canonical, OpenGraph, Twitter card,
  robots directives, viewport, and SoftwareApplication JSON-LD.
- Add robots.ts and sitemap.ts metadata routes.
- Add public/llms.txt for generative-engine optimization.
- Site origin is overridable via NEXT_PUBLIC_SITE_URL.

Verified: biome lint clean, frontend tsc --noEmit clean. The 22 failing
tests are pre-existing in this sandbox (env-specific) and unrelated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(prompt): compress full gx prompt narrative + document rtk wrapping

Extends the existing GUARDEX_COMPRESS_CMD hook (which only covered
`gx prompt --snippet`) to the rest of the narrative prompt surface:

- `gx prompt` (default 3KB checklist) and the deprecated `copy-prompt`
  now route through compressBlock — the biggest blob agents read each
  session.
- `gx prompt --exec` and `copy-commands` stay raw: they emit shell-ready
  commands a compressor would corrupt. status/doctor are left untouched
  (structured, colorized, line-by-line — not safe to bulk-compress).

Instructions: add concrete rtk gx-command wrapping examples (rtk gx
status / doctor) and the GUARDEX_COMPRESS_CMD self-compress note to the
gitguardex SKILL and the managed AGENTS companion-tooling block.

Tests: default-prompt compression + --exec-stays-raw regressions.
Verified: targeted tests 58/58 pass, lint clean, codex/root SKILL parity
held, no new failures in the full suite (22 pre-existing env-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(status): surface GUARDEX_COMPRESS_CMD token-compression health

The compression hook (PR #649/#652) fails open: when GUARDEX_COMPRESS_CMD
is set but the binary is missing/misconfigured, gx silently prints raw
output and quietly wastes the tokens the feature was meant to save — with
no way to notice. `gx status` now makes it observable.

- New output helpers: `describeCompressor(env)` reports
  {configured, command, available}; `isExecutableOnPath` is a defensive,
  cross-platform (PATHEXT-aware) lookup that returns null on any error.
- `gx status` adds a `compression` field to the JSON payload and, when
  configured, prints a `Token compression` line — degraded when the
  binary is not found on PATH. Silent (no line) when unset, so the common
  case stays noise-free.
- SKILL/AGENTS docs note that `gx status` verifies the wiring.

Verified: 6 new tests (output unit + status JSON/human), all pass; lint
clean; SKILL parity held; no new failures in the full suite (22
pre-existing, environment-specific to the sandbox).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(doctor): add token-compression health check

Complements the gx status visibility (PR #653) on the diagnose-and-repair
surface. gx doctor now reports the GUARDEX_COMPRESS_CMD setup:

- Human output: a `Token compression` line after the system-tool status —
  a warn-colored advisory when the configured binary is not on PATH,
  otherwise a plain "configured" line. Silent when unset.
- JSON payload (single-repo): new `compression` field via
  describeCompressor(); recursive runs inherit it through each child.
- Advisory only: a missing compressor never changes doctor's safe/unsafe
  exit code (compression is an optimization, not a safety guarantee).

Docs: SKILL/AGENTS note both `gx status` and `gx doctor` verify the wiring.

Verified: 3 new tests (missing-binary advisory + non-gating exit,
configured/unset, --json field); lint clean; SKILL parity held; no new
failures in the full suite (22 pre-existing, environment-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* test(pr): cover the gx pr command layer (parse + format helpers)

src/cli/commands/pr.js was ~9% covered — pr-module.test.js only exercises
the gh-facing logic in src/pr.js. Adds network-free unit tests for the
command layer's pure helpers:

- parsePrArgs: defaults, value flags, --branch/--head alias, boolean
  toggles, and validation paths (--merge-strategy, --timeout, --interval
  reject bad values; seconds->ms conversion).
- renderChecksLine: empty/zero, multi-bucket join, count fallback.
- printUsage: lists all subcommands.

10 tests, all pass; lint clean. New isolated test file, no src changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* fix(sandbox): recover stranded worktree dirs during cleanup instead of stranding the branch

cleanupProtectedBaseSandbox (used by gx doctor + the shared sandbox
finalizer — the recovery flows the README flags as rough) treated a
`git worktree remove` non-zero exit as fatal. After a crash or partial
manual cleanup, the path can exist on disk while git no longer tracks it
as a worktree; `git worktree remove` then fails with "is not a working
tree", the function throws, and the branch-delete step never runs —
leaving a leaked branch and a half-finished cleanup.

Now: on a non-spawn-failure remove error, prune stale worktree metadata,
remove the leftover directory (both idempotent), set worktree='pruned',
and continue to branch deletion. Spawn failures (missing git) still throw.
Happy path is byte-for-byte unchanged.

Tests: new test/sandbox-cleanup.test.js covers happy-path removal,
stranded-dir recovery (threw before the fix), and missing-metadata no-op.
Full suite: no new failures (22 pre-existing, environment-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* chore(openspec): archive 33 completed changes

The openspec/changes/ directory had accumulated completed-but-unarchived
changes — every one of these had all Specification + Implementation +
Verification tasks checked, with only the cleanup/PR section outstanding,
and spot-checks confirmed the work landed on main. A cluttered active-
changes dir costs tokens for every agent that reads it.

Moves each completed change to openspec/changes/archive/2026-06-20-<slug>/
(git renames; date prefix = archive date, matching the existing archive
convention). Two changes are intentionally left active:
- opt-in-merge-gate (Specification/Implementation/Verification unchecked).
- codex-auto-bump (Verification 3.2 `npm test` unchecked — unconfirmed).

Docs-only; no code or test references the moved slugs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

---------

Co-authored-by: Claude <noreply@anthropic.com>
NagyVikt added a commit that referenced this pull request Jun 20, 2026
* chore: add Biome lint + coverage CI and frontend SEO/GEO

CLI guardrails:
- Add Biome 1.9.4 with a green-baseline config (recommended rules on,
  currently-violated stylistic rules disabled) so CI catches new issues
  without churning 85 existing files. Adds lint/format/format:check scripts.
- Add test:coverage script (node --experimental-test-coverage) and wire
  Lint + coverage steps into the PR CI workflow.
- Expand npm keywords for package discoverability.

Frontend SEO/GEO:
- Enrich root metadata: metadataBase, canonical, OpenGraph, Twitter card,
  robots directives, viewport, and SoftwareApplication JSON-LD.
- Add robots.ts and sitemap.ts metadata routes.
- Add public/llms.txt for generative-engine optimization.
- Site origin is overridable via NEXT_PUBLIC_SITE_URL.

Verified: biome lint clean, frontend tsc --noEmit clean. The 22 failing
tests are pre-existing in this sandbox (env-specific) and unrelated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(prompt): compress full gx prompt narrative + document rtk wrapping

Extends the existing GUARDEX_COMPRESS_CMD hook (which only covered
`gx prompt --snippet`) to the rest of the narrative prompt surface:

- `gx prompt` (default 3KB checklist) and the deprecated `copy-prompt`
  now route through compressBlock — the biggest blob agents read each
  session.
- `gx prompt --exec` and `copy-commands` stay raw: they emit shell-ready
  commands a compressor would corrupt. status/doctor are left untouched
  (structured, colorized, line-by-line — not safe to bulk-compress).

Instructions: add concrete rtk gx-command wrapping examples (rtk gx
status / doctor) and the GUARDEX_COMPRESS_CMD self-compress note to the
gitguardex SKILL and the managed AGENTS companion-tooling block.

Tests: default-prompt compression + --exec-stays-raw regressions.
Verified: targeted tests 58/58 pass, lint clean, codex/root SKILL parity
held, no new failures in the full suite (22 pre-existing env-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(status): surface GUARDEX_COMPRESS_CMD token-compression health

The compression hook (PR #649/#652) fails open: when GUARDEX_COMPRESS_CMD
is set but the binary is missing/misconfigured, gx silently prints raw
output and quietly wastes the tokens the feature was meant to save — with
no way to notice. `gx status` now makes it observable.

- New output helpers: `describeCompressor(env)` reports
  {configured, command, available}; `isExecutableOnPath` is a defensive,
  cross-platform (PATHEXT-aware) lookup that returns null on any error.
- `gx status` adds a `compression` field to the JSON payload and, when
  configured, prints a `Token compression` line — degraded when the
  binary is not found on PATH. Silent (no line) when unset, so the common
  case stays noise-free.
- SKILL/AGENTS docs note that `gx status` verifies the wiring.

Verified: 6 new tests (output unit + status JSON/human), all pass; lint
clean; SKILL parity held; no new failures in the full suite (22
pre-existing, environment-specific to the sandbox).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* feat(doctor): add token-compression health check

Complements the gx status visibility (PR #653) on the diagnose-and-repair
surface. gx doctor now reports the GUARDEX_COMPRESS_CMD setup:

- Human output: a `Token compression` line after the system-tool status —
  a warn-colored advisory when the configured binary is not on PATH,
  otherwise a plain "configured" line. Silent when unset.
- JSON payload (single-repo): new `compression` field via
  describeCompressor(); recursive runs inherit it through each child.
- Advisory only: a missing compressor never changes doctor's safe/unsafe
  exit code (compression is an optimization, not a safety guarantee).

Docs: SKILL/AGENTS note both `gx status` and `gx doctor` verify the wiring.

Verified: 3 new tests (missing-binary advisory + non-gating exit,
configured/unset, --json field); lint clean; SKILL parity held; no new
failures in the full suite (22 pre-existing, environment-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* test(pr): cover the gx pr command layer (parse + format helpers)

src/cli/commands/pr.js was ~9% covered — pr-module.test.js only exercises
the gh-facing logic in src/pr.js. Adds network-free unit tests for the
command layer's pure helpers:

- parsePrArgs: defaults, value flags, --branch/--head alias, boolean
  toggles, and validation paths (--merge-strategy, --timeout, --interval
  reject bad values; seconds->ms conversion).
- renderChecksLine: empty/zero, multi-bucket join, count fallback.
- printUsage: lists all subcommands.

10 tests, all pass; lint clean. New isolated test file, no src changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* fix(sandbox): recover stranded worktree dirs during cleanup instead of stranding the branch

cleanupProtectedBaseSandbox (used by gx doctor + the shared sandbox
finalizer — the recovery flows the README flags as rough) treated a
`git worktree remove` non-zero exit as fatal. After a crash or partial
manual cleanup, the path can exist on disk while git no longer tracks it
as a worktree; `git worktree remove` then fails with "is not a working
tree", the function throws, and the branch-delete step never runs —
leaving a leaked branch and a half-finished cleanup.

Now: on a non-spawn-failure remove error, prune stale worktree metadata,
remove the leftover directory (both idempotent), set worktree='pruned',
and continue to branch deletion. Spawn failures (missing git) still throw.
Happy path is byte-for-byte unchanged.

Tests: new test/sandbox-cleanup.test.js covers happy-path removal,
stranded-dir recovery (threw before the fix), and missing-metadata no-op.
Full suite: no new failures (22 pre-existing, environment-specific).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* chore(openspec): archive 33 completed changes

The openspec/changes/ directory had accumulated completed-but-unarchived
changes — every one of these had all Specification + Implementation +
Verification tasks checked, with only the cleanup/PR section outstanding,
and spot-checks confirmed the work landed on main. A cluttered active-
changes dir costs tokens for every agent that reads it.

Moves each completed change to openspec/changes/archive/2026-06-20-<slug>/
(git renames; date prefix = archive date, matching the existing archive
convention). Two changes are intentionally left active:
- opt-in-merge-gate (Specification/Implementation/Verification unchecked).
- codex-auto-bump (Verification 3.2 `npm test` unchecked — unconfirmed).

Docs-only; no code or test references the moved slugs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

* docs: add GitGuardex video design brief

Hand-off brief for a motion designer / AI video tool: narrative arc,
visual style, motifs, hero shot, copy, paste-ready generator prompt,
and deliverables.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Qyz9J4TivR9kJeAeETSUw

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants