Skip to content

perf(project-onboard): derive local path for all repo arg shapes#30

Merged
joedanz merged 1 commit intomasterfrom
perf/project-onboard-local-path-inference
Apr 17, 2026
Merged

perf(project-onboard): derive local path for all repo arg shapes#30
joedanz merged 1 commit intomasterfrom
perf/project-onboard-local-path-inference

Conversation

@joedanz
Copy link
Copy Markdown
Owner

@joedanz joedanz commented Apr 17, 2026

Summary

Extends the `$PROJECT_ROOT` local-read optimization to cover the two remaining invocation paths:

  • Local path arg (`project-onboard ~/code/my-repo`): `git -C` reads the remote URL and git root from the supplied directory's `.git` folder. No need to also specify the GitHub repo — the skill derives `/` from the remote automatically.
  • GitHub URL / owner/name arg (`project-onboard joedanz/Learn-Whatever`): skill now asks "is this cloned locally?" before going remote. If the user provides a path, the local-read path kicks in; if they skip, falls through to the existing `gh api /contents/...` reads.

Phase 2 branching logic (`$PROJECT_ROOT` set → local reads + 1 metadata call; unset → full remote) is unchanged.

Test plan

  • `bun test test/skills-conformance.test.ts` passes (134/134)
  • `project-onboard ~/code/Learn-Whatever "Learn Whatever" learnwhatever.com` — should set `$PROJECT_ROOT`, derive `joedanz/Learn-Whatever` from `.git`, and use local reads in Phase 2
  • `project-onboard https://github.com/joedanz/Learn-Whatever\` — should prompt for local path, then branch accordingly on user response
  • `project-onboard` from inside a repo — Case A unchanged, still short-circuits via idempotency gate if already onboarded

Phase 0 Step 2 now handles three cases explicitly:

- Case A (cwd inference): unchanged — git remote + rev-parse sets $PROJECT_ROOT
- Case B (local path arg): git -C reads remote URL and git root from the
  supplied directory's .git folder, so the user can point at a local clone
  without specifying the GitHub repo separately
- Case C (GitHub URL / owner/name): ask if the repo is cloned locally; if
  the user provides a path, treat it like Case B; if they skip, fall through
  to the remote-only gh api reads

Phase 2 still branches on $PROJECT_ROOT set vs. unset — no change there.
@joedanz joedanz merged commit dd84fee into master Apr 17, 2026
3 checks passed
@joedanz joedanz deleted the perf/project-onboard-local-path-inference branch April 17, 2026 16:38
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.

1 participant