Skip to content

[codex] Avoid shadowing user skills in lab setup#1285

Open
samsja wants to merge 3 commits intomainfrom
fix/lab-skill-user-scope-precedence
Open

[codex] Avoid shadowing user skills in lab setup#1285
samsja wants to merge 3 commits intomainfrom
fix/lab-skill-user-scope-precedence

Conversation

@samsja
Copy link
Copy Markdown
Member

@samsja samsja commented May 4, 2026

Summary

prime lab setup now treats .prime/skills as the shared Lab skills source and avoids installing project-level agent skill links that would shadow same-name user-scope skills.

Problem

The setup flow downloaded bundled Lab skills to .prime/skills, then linked/copied them into agent-specific project directories such as .codex/skills. If a user already had a same-name skill in ~/.codex/skills, the project skill could take precedence and effectively override the user's skill.

Changes

  • Link agent skill roots to .prime/skills when there are no user-scope conflicts.
  • Detect user-scope skill conflicts before creating project links.
  • Remove old managed project skill links on rerun when they would shadow a user skill.
  • Fall back to per-skill links for non-conflicting skills when conflicts exist.
  • Only write CLAUDE.md when claude is one of the selected agents.
  • Add setup tests for user-scope conflict handling and Claude-specific file generation.

Validation

  • uv run pytest tests/test_setup_script.py -> 17 passed
  • uv run ruff check verifiers/scripts/setup.py tests/test_setup_script.py -> passed

Note

Medium Risk
Changes how prime lab setup creates agent skill directories and symlinks, including deleting previously-managed symlinks; mistakes could remove/skip intended project skills or create incorrect links on reruns.

Overview
prime lab setup now detects user-scoped agent skills (e.g. ~/.codex/skills) and avoids creating project-level links in .codex/skills that would shadow them; when conflicts exist it removes only previously-managed symlinks and skips conflicting skills while still materializing non-conflicting ones.

When there are no user conflicts (and no skill-name mapping), the setup prefers linking the agent’s skills root directly to .prime/skills. It also only downloads CLAUDE.md when claude is among the selected agents, and adds targeted tests covering HOME isolation, user-skill conflict handling, and Claude-specific file generation.

Reviewed by Cursor Bugbot for commit b4a4c26. Bugbot is set up for automated code reviews on this repo. Configure here.

@samsja samsja marked this pull request as ready for review May 4, 2026 20:58
@willccbb
Copy link
Copy Markdown
Member

willccbb commented May 4, 2026

@cursoragent fix ruff pls

@cursor
Copy link
Copy Markdown

cursor Bot commented May 4, 2026

  • Ran Ruff locally; the failure was from formatting. Applied uvx ruff format to verifiers/scripts/setup.py.

  • Verified both checks pass:

    • uvx ruff check . → All checks passed
    • uvx ruff format --check . → 310 files already formatted
  • Committed and pushed: style(ruff): format setup script to satisfy ruff format --check (branch fix/lab-skill-user-scope-precedence). The PR should now pass the Ruff job.

Open in Web Open in Cursor 

Co-authored-by: will brown <willccbb@users.noreply.github.com>
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.

3 participants