Skip to content

Reverse gap analysis: adopt parity innovations#197

Merged
jeremy merged 8 commits intomainfrom
parity
Mar 5, 2026
Merged

Reverse gap analysis: adopt parity innovations#197
jeremy merged 8 commits intomainfrom
parity

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 5, 2026

Summary

Closes the reverse gap between basecamp-cli and its derivative CLIs (fizzy-cli, hey-cli, amar) by adopting innovations that originated downstream.

8 atomic commits, each independently reviewable:

  1. Fix profile catalog parity — add missing profile entry to static catalog; extract shared buildRootWithAllCommands() test helper
  2. check-toolchain + coverage — Makefile guard for mise PATH/GOROOT mismatches; make coverage alias with browser auto-open
  3. Version fallbackdebug.ReadBuildInfo() for go install ...@version scenarios
  4. XDG_STATE_HOME — resilience state uses XDG_STATE_HOME on Linux/BSD; resolveResilienceDir() respects explicit cache_dir overrides
  5. Surface baseline — checked-in .surface file using shared github.com/basecamp/cli/surface package with -update-surface regeneration
  6. skill installbasecamp skill install writes SKILL.md to ~/.agents/skills/basecamp/, symlinks into ~/.claude/skills/basecamp with copy fallback
  7. Editor + --editinternal/editor package with $EDITOR integration; --edit flag on comment, message, messages create (mutual exclusion with --content, piped stdin rejection, empty abort)
  8. STYLE.md + SKILL.md — coding conventions doc; jq patterns library and exit code remediation table

Backward compatibility

All changes are additive — no existing behavior is altered:

  • skill description change: only the --help text changed from "Print…" to "Manage…". basecamp skill (no subcommand) still prints SKILL.md to stdout via the preserved RunE. Scripts piping basecamp skill output are unaffected.
  • --edit flag validation: --edit is a brand-new flag on comment, message, and messages create. The mutual exclusion with --content, piped stdin rejection, and empty editor abort are only reachable when --edit is explicitly passed. No existing invocation can trigger these paths.
  • skill install subcommand: new subcommand on an existing command. basecamp skill without arguments still works identically.

No major version bump needed.

Test plan

  • make check passes (fmt-check, vet, lint, test, test-e2e, naming, surface, provenance, tidy-check)
  • make release-check passes (adds replace-check, vuln, race-test, surface-compat)
  • go test ./... — all 26 packages pass
  • New tests: TestEditContentMutualExclusion, TestEditRejectsPipedStdin, TestEditEmptyAborts, TestEditWithoutContentAllowed, TestSkillInstallRunE, TestSkillInstallIdempotent, TestSkillInstallFallbackOnNonEmptyDir, TestSkillInstallResultMap, TestSurfaceSnapshot, TestDefaultStateDirXDG, TestResolveResilienceDir
  • Surface baseline verified bidirectionally (passes with baseline; fails when flag added without -update-surface)

Add missing `profile` entry to the static command catalog ("Auth &
Config" category). Extract `buildRootWithAllCommands()` helper in
commands_test.go, shared by TestCatalog and TestSurfaceSnapshot.
Copilot AI review requested due to automatic review settings March 5, 2026 07:51
@github-actions github-actions bot added commands CLI command implementations tests Tests (unit and e2e) skills Agent skills docs deps breaking Breaking change labels Mar 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 5, 2026

⚠️ Potential breaking changes detected:

  • Rename of 'skill' command from 'Print the embedded agent skill file' to 'Manage the embedded agent skill file' and addition of subcommand 'install'. This changes the default behavior of the 'skill' command and could impact scripts relying on the original output.
  • Addition of mutual exclusivity for '--content' and '--edit' flags in 'comment' and 'message' commands, resulting in changes to input validation that could break existing usage.
  • Changes to 'comment' and 'message' commands to require '--edit' flag only when stdin is a terminal, introducing new validation that may fail in previously valid scenarios.
  • Output format changes for 'skill install' command providing JSON result maps instead of plain text output, potentially breaking scripts parsing the output.

Review carefully before merging. Consider a major version bump.

@github-actions github-actions bot added the enhancement New feature or request label Mar 5, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR closes feature parity gaps by bringing downstream CLI improvements into basecamp-cli, including editor-based content composition, skill installation, XDG state dir support, surface snapshots, and build/version/tooling refinements.

Changes:

  • Add $EDITOR integration (--edit) for composing comment/message content and supporting editor-driven workflows.
  • Improve operational/tooling parity: toolchain guard + coverage target, surface snapshot baseline enforcement, and go install ...@version version fallback.
  • Align state/config and command surface parity: Linux/BSD resilience state under XDG_STATE_HOME, catalog parity updates, and new STYLE/SKILL documentation.

Reviewed changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
skills/basecamp/SKILL.md Extends embedded skill documentation with jq patterns and exit-code guidance.
internal/version/version.go Adds runtime build-info fallback to populate version for go install ...@version installs.
internal/resilience/store.go Updates default resilience state dir behavior to prefer XDG state on Linux/BSD.
internal/resilience/store_test.go Adds tests for NewStore/defaultStateDir behavior, including XDG state handling.
internal/editor/editor.go Introduces $EDITOR integration helper to open an editor and return composed content.
internal/editor/editor_test.go Adds tests covering editor invocation, args handling, and empty-content aborts.
internal/commands/comment.go Adds --edit flag to comment shortcut command.
internal/commands/messages.go Adds --edit flag to message creation paths (group subcommand + shortcut).
internal/commands/edit_test.go Adds tests for --edit mutual exclusion, stdin rejection, and empty abort behavior.
internal/commands/skill.go Expands skill command to include skill install (file write + symlink/copy fallback).
internal/commands/skill_test.go Adds tests for skill install behavior, idempotency, fallback copy, and result paths.
internal/commands/commands.go Updates static command catalog entries (profile; skill actions).
internal/commands/commands_test.go Refactors root builder helper and ensures catalog/registration parity includes profile.
internal/commands/surface_test.go Adds .surface snapshot test with optional baseline regeneration flag.
internal/appctx/context.go Routes resilience dir selection through resolveResilienceDir() to respect explicit cache overrides.
internal/appctx/resilience_dir_test.go Adds tests for resilience dir resolution behavior.
Makefile Adds toolchain mismatch guard and a convenience coverage target; wires guard into key targets.
go.mod Bumps github.com/basecamp/cli to v0.1.1.
go.sum Updates sums for github.com/basecamp/cli v0.1.1.
STYLE.md Adds contributor conventions (commands, output, config resolution, catalog parity).
AGENTS.md References STYLE.md for agent/dev context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be0f66ae9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI review requested due to automatic review settings March 5, 2026 08:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 22 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jeremy added 7 commits March 5, 2026 00:22
check-toolchain detects PATH go vs GOROOT go mismatches (mise
environments); wired as prerequisite to build, test, vet, race-test,
and tidy-check. coverage alias extends test-coverage with browser
auto-open.
When Version is "dev" (no ldflags), probe runtime/debug.ReadBuildInfo
for the module version. Enables correct version display for
go install ...@v1.2.3 installs.
Update defaultStateDir() to prefer XDG_STATE_HOME on Linux/FreeBSD/
OpenBSD, falling back to ~/.local/state/basecamp/resilience/. macOS
and Windows continue using the cache directory.

Extract resolveResilienceDir() in appctx to respect explicit
cache_dir overrides (flag/env/config file) while letting the default
path use XDG_STATE_HOME.
Use github.com/basecamp/cli/surface.SnapshotString() to generate a
checked-in .surface file. TestSurfaceSnapshot compares against the
baseline; -update-surface flag regenerates it. Complements the
script-based CI gate with an in-process test.
Writes embedded SKILL.md to ~/.agents/skills/basecamp/ and creates a
relative symlink at ~/.claude/skills/basecamp. Falls back to direct
file copy when symlink creation fails (e.g. Windows without developer
mode). Idempotent — safe to run repeatedly.
New internal/editor package launches $EDITOR with initial content,
supports editors with arguments (e.g. "code --wait"), and aborts on
empty result.

Add --edit flag to comment, message, and messages create commands.
Mutually exclusive with --content; rejects piped stdin. Tests cover
mutual exclusion, piped stdin rejection, and empty editor abort via
the full command path.
STYLE.md documents command constructors, output conventions, config
resolution, catalog maintenance, method ordering, and file
organization patterns.

SKILL.md gains a jq patterns library for common data extraction and
an exit code remediation table mapping codes 0-8 to fix actions.
@jeremy jeremy merged commit 501fec9 into main Mar 5, 2026
21 checks passed
@jeremy jeremy deleted the parity branch March 5, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change commands CLI command implementations deps docs enhancement New feature or request skills Agent skills tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants