Consolidate shared skills into .agents/skills and register them with Claude Code#2719
Consolidate shared skills into .agents/skills and register them with Claude Code#2719titusfortner wants to merge 1 commit into
Conversation
❌ Deploy Preview for selenium-dev failed.
|
PR Summary by QodoConsolidate shared skills under .agents/skills and sync to Claude Code
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
10 rules 1. .local/agent/skills/ referenced in AGENTS.md
|
| - Shared project skills live in `.agents/skills/`, committed to the codebase (as opposed to | ||
| `.local/agent/skills/`, which is personal and untracked). Inspect its `*/SKILL.md` files and | ||
| treat them as additional skills available in this repo, and read the relevant one in full |
There was a problem hiding this comment.
1. .local/agent/skills/ referenced in agents.md 📘 Rule violation ≡ Correctness
AGENTS.md adds a new explicit reference to the .local/ directory (.local/agent/skills/). This violates the policy prohibiting tracked project files from referencing .local/, which can create accidental dependencies on untracked local-only state.
Agent Prompt
## Issue description
`AGENTS.md` introduces a new reference to `.local/agent/skills/`, but tracked project files must not reference `.local/`.
## Issue Context
This PR is consolidating shared skills and updating repo guidance; the updated guidance should avoid hard-coding `.local/` paths.
## Fix Focus Areas
- AGENTS.md[21-23]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # Marks a copy this script made, so it can be refreshed or removed safely. | ||
| MARKER=".skill-sync" | ||
|
|
||
| # True only for entries this script created: a link into .agents/skills/, or a marked copy. | ||
| # Anything else in .claude/skills/ belongs to the user and is never written to or removed. | ||
| owned() { | ||
| if [ -L "$1" ]; then | ||
| case "$(readlink "$1")" in | ||
| ../../.agents/skills/*) return 0 ;; | ||
| *) return 1 ;; | ||
| esac | ||
| fi | ||
| [ -f "$1/$MARKER" ] | ||
| } |
There was a problem hiding this comment.
2. Marker misidentifies user skills 🐞 Bug ☼ Reliability
scripts/link-claude-skills.sh treats any directory in .claude/skills containing a file named .skill-sync as script-owned, so a user-created skill with that filename can be deleted or overwritten. This contradicts the script’s guarantee that personal skills are never touched and can cause local data loss when the script is run (especially via git hooks).
Agent Prompt
### Issue description
The script’s `owned()` check considers a target “owned” if it contains a marker file named `.skill-sync`. This can collide with user-created skills that happen to include the same filename, causing the script to `rm -rf` and overwrite/delete user content.
### Issue Context
The script also claims: “Personal skills you place in .claude/skills/ yourself are never touched.” That promise isn’t upheld with the current marker strategy.
### Fix Focus Areas
- scripts/link-claude-skills.sh[15-36]
- scripts/link-claude-skills.sh[43-52]
- scripts/link-claude-skills.sh[73-90]
### Suggested implementation direction
- Make ownership unambiguous by using a less collision-prone mechanism, e.g.:
- A manifest file under `.claude/` (e.g. `.claude/.skill-sync-manifest`) listing the exact entries the script owns, and only deleting/updating those; or
- A marker file with uniquely identifiable contents (not just existence), e.g. write `skill-sync: <repo-id> <name>` and validate the content before considering it owned.
- Ensure removal/overwrite only happens when the entry is both:
- Recognized as script-created (via manifest/validated marker), and
- Corresponds to a current source skill (or is being removed due to a previously-synced skill being removed).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Description
This PR consolidates the two shared-skill locations into
.agents/skills/, movingrelease-blog-postthere fromscripts/skills/and dropping the duplicate AGENTS.md section.Adds
scripts/link-claude-skills.sh, an opt-in script that mirrors those skills into.claude/skills/so Claude Code can find them, plus a CLAUDE.md line telling it to run the script.Motivation and Context
Looks like within a couple days of each other Diego and I both created skills for this repo and put them in two separate places.
AGENTS.mdended up describing each as the committed location, so there was no way to tell where a new skill belonged.scripts/is otherwise build and deploy tooling; a SKILL.md isn't executable, so.agents/skills/is the better home for both.Separately, Claude Code only discovers skills in
.claude/skills/and does not read.agents/skills/, so neither skill was available to it. Other agents read from.agents/natively and need none of this — the script exists only to work around that gap.Implementation Notes
.claude/stays gitignored — the script only writes there, so nothing it does can reach a commit, and personal skills placed there are left alone. It symlinks where the filesystem allows and copies where it doesn't (Windows), reporting the difference so the staleness that copies imply is visible rather than silent.