Skip to content

feat(shell): open project_open across all of ~/Code#208

Merged
codepuncher merged 15 commits into
po-autocompletefrom
feat/project-open-code-wide
Jun 24, 2026
Merged

feat(shell): open project_open across all of ~/Code#208
codepuncher merged 15 commits into
po-autocompletefrom
feat/project-open-code-wide

Conversation

@codepuncher

Copy link
Copy Markdown
Owner

Stacked on #204 (base is po-autocomplete; will auto-retarget to master once #204 merges).

What

Generalises project_open/po and their bash/zsh completion from the single ~/Code/wordpress base to any project discovered anywhere under ~/Code. project_open HoldFast now opens ~/Code/mods/HoldFast.

  • A "project" is the outermost dir containing .git, bedrock, or site; the walk stops there, so vendored submodules (lib/vcpkg, ...) are excluded.
  • Existing WordPress behaviour preserved: bedrock/site descent, the theme target, and <subdir> second-arg navigation, all gated on markers.
  • First-arg completion lists every discovered project; second-arg completion lists the resolved project's immediate subdirs.
  • Discovery is backed by an on-disk cache ($XDG_CACHE_HOME/project_open/projects) rebuilt asynchronously at shell startup, so tab-completion never walks the tree. po_refresh forces a rebuild.

Notes

  • All discovery helpers avoid <() process substitution: under zsh, a <() that calls a function nested inside $(...) empties $PATH, which broke cat/find in completion. Cache reads use shell builtins / here-strings; scans use pipes.
  • No name-collision handling (basenames assumed unique across ~/Code, confirmed); no per-TAB freshness check; no new external dependency.

Testing

  • tests/project_open_test.sh: 18 assertions (scan, cache + TTL guard, resolve, completion helpers, WordPress descent) pass under bash.
  • Manual: verified end-to-end in interactive bash and zsh (resolve, projects, targets, cd, bedrock/site descent, not-found status, $PATH intact).
  • shellcheck shell/aliases and zsh -n shell/aliases clean.

Design spec and implementation plan included under docs/superpowers/.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Generalizes project_open/po from a fixed ~/Code/wordpress base to discovering and opening projects anywhere under ~/Code, backed by an on-disk cache so completion stays fast.

Changes:

  • Add recursive project discovery (.git, bedrock, site) and name resolution with a cached index under $XDG_CACHE_HOME.
  • Update project_open to resolve by basename and preserve existing WordPress-specific descent behavior.
  • Add a standalone bash test script covering scan/cache/resolve/completion helpers and project_open runtime behavior.

Reviewed changes

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

File Description
shell/aliases Adds project discovery + cache helpers, switches project_open to resolve projects across ~/Code, and triggers async cache rebuild on shell startup.
tests/project_open_test.sh New standalone fixture-based tests for discovery, cache TTL behavior, resolution, completion helper output, and project_open navigation.
docs/superpowers/specs/2026-06-23-project-open-code-wide-design.md Design spec describing discovery markers, caching strategy, and completion behavior.
docs/superpowers/plans/2026-06-23-project-open-code-wide.md Implementation plan documenting step-by-step changes and testing strategy.

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

Comment thread shell/aliases Outdated
Comment thread shell/aliases
Comment thread tests/project_open_test.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread tests/project_open_test.sh
Comment thread tests/project_open_test.sh
Comment thread docs/superpowers/specs/2026-06-23-project-open-code-wide-design.md Outdated
Comment thread docs/superpowers/plans/2026-06-23-project-open-code-wide.md Outdated
Comment thread docs/superpowers/specs/2026-06-23-project-open-code-wide-design.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread shell/aliases Outdated
Comment thread tests/project_open_test.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread shell/aliases Outdated
Comment thread tests/project_open_test.sh

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread shell/aliases Outdated
Comment thread shell/aliases Outdated
Comment thread shell/aliases Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread shell/aliases Outdated
Comment thread docs/superpowers/specs/2026-06-23-project-open-code-wide-design.md Outdated
Comment thread docs/superpowers/plans/2026-06-23-project-open-code-wide.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread shell/aliases Outdated
Comment thread shell/aliases Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread shell/aliases Outdated
Comment thread shell/aliases Outdated
Comment thread shell/aliases Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread shell/aliases

Copilot AI left a comment

Copy link
Copy Markdown

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 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread shell/aliases Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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

@codepuncher codepuncher merged commit 6e11271 into po-autocomplete Jun 24, 2026
3 checks passed
@codepuncher codepuncher deleted the feat/project-open-code-wide branch June 24, 2026 16:05
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