Skip to content

fix: preserve caller directory for Windows skills updates - #19

Merged
amanthanvi merged 1 commit into
mainfrom
t3code/add-skills-update
Sep 8, 2026
Merged

amanthanvi merged 1 commit into
mainfrom
t3code/add-skills-update

Conversation

@amanthanvi

@amanthanvi amanthanvi commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

Preserve the directory where updates was invoked when native Windows runs skills update --project --global, including the npx --yes skills fallback. This ensures project-scoped skill updates target the caller's project rather than the installed updates directory.

Update the skills documentation and add coverage for project paths containing spaces on Bash and native Windows.

Checklist

  • ./scripts/lint.sh passes
  • ./scripts/test.sh passes
  • Updated docs (if behavior changed)

Changed files: updates-main.ps1, tests/test_cli.sh, tests/test_windows_native.ps1, README.md, SPEC.md, PLAN.md, CHANGELOG.md.

Commands run: ./scripts/lint.sh; ./scripts/test.sh; focused skills checks under /bin/bash; isolated PowerShell handler checks.

Validation: lint and full local Bash tests passed. Direct and npx Windows handler checks confirmed the caller directory is retained.

Risks: native Windows test execution remains unverified on this host; skill-update commands were stubbed.

Summary by Sourcery

Preserve the invoking project directory when running native Windows Skills updates through direct or npx execution.

Bug Fixes:

  • Preserve the caller’s project directory for native Windows Skills updates, including direct and npx fallback execution.

Enhancements:

  • Document that Skills updates operate on the caller’s current project and global scope rather than scanning other projects.

Documentation:

  • Update README and specification guidance for Skills update scope and working-directory behavior.

Tests:

  • Add Bash and native Windows coverage for caller directories containing spaces, including direct and npx Skills execution.

Chores:

  • Mark the Skills module implementation and validation tasks complete in the project plan and record native Windows validation limitations.

@sourcery-ai

sourcery-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Reviewer's Guide

Native Windows Skills updates now explicitly run from the directory where updates was invoked, including the npx fallback, so project-scoped updates target the caller’s project. Documentation and Bash/native Windows regression coverage were updated, including project paths containing spaces; native Windows execution remains unverified on the current host.

Sequence diagram for preserving the caller directory during Windows skills updates

sequenceDiagram
    participant Caller
    participant Updates
    participant Skills
    participant Npx

    Caller->>Updates: Invoke skills update
    Updates->>Updates: Get-Location
    alt skills CLI available
        Updates->>Skills: skills update --project --global
        Note over Skills: WorkingDirectory is caller directory
    else skills CLI unavailable
        Updates->>Npx: npx --yes skills update --project --global
        Note over Npx: WorkingDirectory is caller directory
    end
    Skills-->>Updates: ExitCode
    Npx-->>Updates: ExitCode
Loading

File-Level Changes

Change Details Files
Preserve the caller’s working directory when executing Windows skills updates.
  • Pass the current location as the child process working directory.
  • Apply the behavior to both direct Skills CLI and npx fallback execution paths.
  • Document that project scope targets only the caller’s project rather than all machine projects.
updates-main.ps1
README.md
SPEC.md
CHANGELOG.md
PLAN.md
Add regression coverage for caller-directory preservation and paths containing spaces.
  • Verify Bash npx fallback runs from a project directory containing spaces.
  • Verify native Windows direct and npx executions retain the caller project directory.
  • Continue validating command arguments, non-interactive behavior, and missing-dependency handling.
tests/test_cli.sh
tests/test_windows_native.ps1

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: fbf7d4f1-ab38-43f8-9685-0ce6f5763538


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot 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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. If the working-directory change is wrong, the skills CLI could update or install skill files in the caller's project instead of the intended location; those file changes persist after reverting this PR. The impact is bounded to the affected project and can generally be repaired by restoring or rerunning the skills update.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown

Greptile Summary

This PR makes native Windows skills updates execute from the directory where the user invoked updates, matching existing Bash behavior.

  • Passes the caller’s current directory to direct and npx-fallback skills processes.
  • Adds Bash and native Windows coverage for project paths containing spaces.
  • Clarifies project-scope behavior in user documentation, specification, plan, and changelog.

Confidence Score: 5/5

The PR appears safe to merge; the working-directory fix follows the native launcher’s actual invocation flow and is covered for both direct and fallback execution.

The installed bootstrap preserves the caller’s location, the payload does not change it before launching skills, and the process helper receives that location explicitly; no actionable failures remain.

Important Files Changed

Filename Overview
updates-main.ps1 Overrides the process helper’s install-root default so skills and its npx fallback run from the caller’s current project directory.
tests/test_windows_native.ps1 Verifies direct and npx-backed skills updates preserve a caller directory containing spaces.
tests/test_cli.sh Adds equivalent Bash coverage for npx skills execution from a project path containing spaces.
README.md Clarifies that project-scoped skills updates target the directory where updates was invoked.
SPEC.md Records caller-directory preservation as part of the skills module contract.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Caller project directory] --> B[updates.cmd or updates.ps1]
    B --> C[Installed updates-main.ps1 payload]
    C --> D[Invoke-ModuleSkills]
    D -->|WorkingDirectory = caller directory| E[skills update]
    D -->|Fallback with same directory| F[npx --yes skills update]
Loading

Reviews (1): Last reviewed commit: "fix: preserve caller directory for Windo..." | Re-trigger Greptile

@amanthanvi
amanthanvi merged commit 2949461 into main Sep 8, 2026
10 checks passed
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