fix: preserve caller directory for Windows skills updates - #19
Conversation
Reviewer's GuideNative 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 updatessequenceDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 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. Comment |
There was a problem hiding this comment.
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.
|
| 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]
Reviews (1): Last reviewed commit: "fix: preserve caller directory for Windo..." | Re-trigger Greptile
Summary
Preserve the directory where
updateswas invoked when native Windows runsskills update --project --global, including thenpx --yes skillsfallback. This ensures project-scoped skill updates target the caller's project rather than the installedupdatesdirectory.Update the skills documentation and add coverage for project paths containing spaces on Bash and native Windows.
Checklist
./scripts/lint.shpasses./scripts/test.shpassesChanged 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
npxWindows 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:
Enhancements:
Documentation:
Tests:
Chores: