Skip to content

fix: resolve relative symlinks when skills path is outside project root#673

Merged
pushpak1300 merged 2 commits intolaravel:mainfrom
tjmartin69:skill-writer-fix
Mar 16, 2026
Merged

fix: resolve relative symlinks when skills path is outside project root#673
pushpak1300 merged 2 commits intolaravel:mainfrom
tjmartin69:skill-writer-fix

Conversation

@tjmartin69
Copy link
Contributor

When the skills path lives outside the project directory (e.g. ../../.claude/skills), relativePath() produced an absolute path because base_path() was not an ancestor of both paths. Introduce resolveBaseFromPaths() to find the true common ancestor so the symlink target is always relative.

tjmartin69 and others added 2 commits March 16, 2026 12:34
When the skills path lives outside the project directory (e.g.
~/.claude/skills), relativePath() produced an absolute path because
base_path() was not an ancestor of both paths. Introduce
resolveBaseFromPaths() to find the true common ancestor so the
symlink target is always relative.
…ase_path()

Drop resolveBaseFromPaths() and rewrite relativePath() to derive the
relative path from the two absolute paths by walking their common
prefix — no dependency on base_path() or a separate helper method.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pushpak1300 pushpak1300 merged commit 4dad331 into laravel:main Mar 16, 2026
22 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.

2 participants