Skip to content

Self-describing CLI: --help --agent, embedded skills, doctor integration#164

Merged
jeremy merged 4 commits intomainfrom
skill
Feb 28, 2026
Merged

Self-describing CLI: --help --agent, embedded skills, doctor integration#164
jeremy merged 4 commits intomainfrom
skill

Conversation

@jeremy
Copy link
Member

@jeremy jeremy commented Feb 28, 2026

Summary

  • basecamp skill — prints embedded SKILL.md from the binary. Any agent bootstraps from the CLI itself, no external files needed.
  • basecamp <cmd> --help --agent — structured JSON help for any command: flags, notes (gotchas/cross-refs), subcommands, inherited flags.
  • basecamp commands --json — full command catalog (existing, unchanged).
  • Doctor check 12 — Claude Code plugin installation check, silent when ~/.claude/ absent.
  • Command annotations — migrated 18 reference files into Annotations["agent_notes"] on 25 cobra commands.
  • Hook hardening — negative failure guard in post-commit-check, jq requirement in session-start, dropped bare #12345 pattern.
  • SKILL.md — trimmed to invariants + decision trees + discovery section (~50 lines body, down from ~170).

Deleted: skills/basecamp/references/*.md (18 files), scripts/install-skills.sh.
New: skills/embed.go, internal/harness/, internal/commands/skill.go.

Test plan

  • make build — embedded skills compile
  • make test — all Go tests green (including 10 harness schema resilience tests)
  • make test-e2e — all 267 e2e tests pass
  • basecamp skill — prints full SKILL.md
  • basecamp --help --agent — JSON with all top-level commands
  • basecamp todos --help --agent — JSON with flags, notes, subcommands
  • basecamp todos list --help --agent — JSON for leaf command
  • basecamp --help (no --agent) — normal plaintext help unchanged
  • basecamp doctor with ~/.claude/ present — shows plugin check
  • basecamp doctor without ~/.claude/ — no harness check appears

Copilot AI review requested due to automatic review settings February 28, 2026 02:44
Copy link

@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: ba803b401b

ℹ️ 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".

Copy link

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

Adds self-describing agent integration to the Basecamp CLI by embedding skills in the binary, providing structured --help --agent JSON output, and extending doctor with Claude Code integration checks.

Changes:

  • Embed skills/basecamp/SKILL.md into the binary and add basecamp skill to print it.
  • Override Cobra help to support basecamp <cmd> --help --agent structured JSON (flags, notes, subcommands).
  • Add Claude Code harness detection + doctor check, plus hook hardening and updated install/docs.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
skills/embed.go Adds embedded filesystem for skill assets.
skills/basecamp/SKILL.md Updates and trims the embedded skill content/triggers/invariants.
scripts/install-skills.sh Removes the legacy skills installer script.
internal/harness/harness.go Introduces harness status check schema.
internal/harness/claude.go Detects Claude Code and checks for Basecamp plugin installation.
internal/harness/claude_test.go Adds schema-resilience tests for plugin detection.
internal/commands/skill.go Adds basecamp skill command to print embedded SKILL.md.
internal/cli/root.go Adds --help --agent JSON help override + data model.
internal/commands/doctor.go Integrates Claude harness checks into doctor when Claude is detected.
internal/commands/commands_test.go Registers the new skill command in catalog parity tests.
internal/commands/commands.go Adds skill to the command catalog.
internal/commands/webhooks.go Adds agent notes annotations.
internal/commands/url.go Adds agent notes annotations.
internal/commands/tools.go Adds agent notes annotations.
internal/commands/todos.go Adds agent notes annotations.
internal/commands/timesheet.go Adds agent notes annotations.
internal/commands/timeline.go Adds agent notes annotations.
internal/commands/templates.go Adds agent notes annotations.
internal/commands/subscriptions.go Adds agent notes annotations.
internal/commands/search.go Adds agent notes annotations.
internal/commands/schedule.go Adds agent notes annotations.
internal/commands/reports.go Adds agent notes annotations.
internal/commands/recordings.go Adds agent notes annotations.
internal/commands/projects.go Adds agent notes annotations.
internal/commands/people.go Adds agent notes annotations.
internal/commands/messages.go Adds agent notes annotations.
internal/commands/lineup.go Adds agent notes annotations.
internal/commands/forwards.go Adds agent notes annotations.
internal/commands/files.go Adds agent notes annotations.
internal/commands/events.go Adds agent notes annotations.
internal/commands/config.go Adds agent notes annotations.
internal/commands/comment.go Adds agent notes annotations (comments + comment).
internal/commands/checkins.go Adds agent notes annotations.
internal/commands/cards.go Adds agent notes annotations.
internal/commands/campfire.go Adds agent notes annotations.
internal/commands/boost.go Adds agent notes annotations.
install.md Updates install instructions to remove skills installer and document Claude plugin install + --help --agent.
README.md Updates agent integration docs and advertises --help --agent.
.claude-plugin/hooks/session-start.sh Adds jq requirement + richer context (CLI version, profile) in hook output.
.claude-plugin/hooks/post-commit-check.sh Hardens commit-success detection and removes bare #12345 matching.
Comments suppressed due to low confidence (1)

.claude-plugin/hooks/session-start.sh:37

  • Because the script runs with set -euo pipefail, any jq parse failure in these command substitutions (e.g., if basecamp outputs non-JSON on error) will terminate the hook instead of failing silently. Consider adding || true (like cli_version/active_profile do) and treating empty values as “no config/auth” so the hook remains non-disruptive.
# Get CLI version
cli_version=$("$BASECAMP_BIN" version --json 2>/dev/null | jq -r '.version // empty' 2>/dev/null || true)

# Check if we have any Basecamp configuration
config_output=$("$BASECAMP_BIN" config show --json 2>/dev/null || echo '{}')
has_config=$(echo "$config_output" | jq -r '.data // empty' 2>/dev/null)


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

The CLI now describes itself to agents at runtime instead of relying on
static reference files. Three complementary discovery mechanisms:

- `basecamp skill` prints the embedded SKILL.md from the binary
- `basecamp <cmd> --help --agent` emits structured JSON (flags, notes,
  subcommands) for any command
- `basecamp commands --json` provides the full catalog

Migrated gotchas and cross-references from 18 reference files into
Annotations["agent_notes"] on 25 cobra commands. These surface in the
notes field of --help --agent JSON output.

Added internal/harness package for Claude Code detection and plugin
health checks, wired into doctor (check 12, silent when ~/.claude/
absent). Hardened hooks: negative failure guard in post-commit-check,
jq requirement in session-start, dropped bare #12345 pattern.

SKILL.md trimmed to invariants + decision trees + discovery pointers.
Deleted references/, install-skills.sh (obsolete — embedded skills,
claude plugin install is the distribution path).
Copilot AI review requested due to automatic review settings February 28, 2026 05:25
- Narrow hook failure regex: strip git success line before scanning so
  commit subjects like "Fix failed login" don't false-positive
- Handle fmt.Fprint error return in skill command
- Use cmd.OutOrStdout() instead of os.Stdout in emitAgentHelp
Copy link

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 39 out of 39 changed files in this pull request and generated 4 comments.


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

- session-start.sh: use --version flag instead of nonexistent version
  subcommand
- doctor_test.go: add TestCheckClaudeIntegration covering the harness
  integration path
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@jeremy jeremy merged commit 2462497 into main Feb 28, 2026
12 checks passed
@jeremy jeremy deleted the skill branch February 28, 2026 07:19
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