Skip to content

search/add: error doesn't surface the missing local checkout requirement #24

@so0k

Description

@so0k

Summary

In v1.0.0, skillrig search and skillrig add read the origin from a local git checkout at <repo-root>/<OWNER>/<REPO> (per references/init.md lines 69–85). When that checkout is missing, the resulting error is opaque and doesn't point at the actual fix.

Reproduction

mkdir skillrig-test && cd skillrig-test
skillrig init --origin my-org/my-skills@staging
# init succeeds, config written
skillrig search

Actual output

search failed
why: git failed (exit 128): fatal: invalid object name 'staging'.

With --verbose:

search failed
why: git failed (exit 128): fatal: invalid object name 'staging'.
  cause: git failed (exit 128): fatal: invalid object name 'staging'.

Problems with this error

  1. It leaks a raw git error instead of the project's what/why/fix style used elsewhere (see references/search.md error table).
  2. It does not say that a local checkout at <repo-root>/<OWNER>/<REPO> is required in this release.
  3. It does not distinguish the two real failure modes:
    • cwd is not a git repo (no <repo-root> to anchor to), or
    • <repo-root>/<OWNER>/<REPO> doesn't exist / isn't a git checkout, or
    • the checkout exists but doesn't contain the configured @REF.
  4. --verbose adds no information — why and cause are identical strings.
  5. The docs are inconsistent on this point and the error doesn't help resolve it: references/search.md says "A remote origin is fetched over git (a private one uses the auto-resolved read-only token)", which led me to believe auth/network was the issue. references/init.md lines 69–85 is the source of truth (local-checkout only in this release), but a user hitting the error won't know which doc applies.

Expected

A what/why/fix error along the lines of:

search failed
why: no local checkout for origin 'my-org/my-skills@staging
     expected at: <repo-root>/my-org/my-skills@staging)
fix: this release reads origins from a local checkout. From the repo root:
       git clone <library-url> my-org/my-skills
       git -C my-org/my-skills checkout staging
       echo 'my-skills/' >> .git/info/exclude

…with distinct messages for (a) not in a git repo, (b) checkout missing, (c) ref missing in checkout.

Suggested follow-ups

  • Reconcile search.md ("fetched over git") with init.md ("no network fetch in this release") so users aren't sent down the auth/network path.
  • Make --verbose actually add something beyond the summary (the resolved path it tried, the exact git command, etc.).

Environment

  • skillrig 1.0.0 (commit 5cdf906a0082fe1e75681c4ae8583370ddb6e625, built 2026-06-01T07:49:44Z)
  • macOS (darwin)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions