Review of the previous revision found that pruning by checking whether
a copied path existed under the temp dir failed open: if skills add
exited 0 without actually copying anything (e.g. a broken CLI run),
every warpdotdev/common-skills entry looked stale and got deleted,
while the one entry from another source survived. That result is
worse than the original bug and would auto-merge into warp and
warp-server.
Restructure the fix: regenerate the warpdotdev/common-skills portion
of the lock from scratch in a clean, unseeded temp directory instead
of seeding it with the existing lock and pruning what didn't reappear.
skills add can then only ever emit entries for skills it actually
finds, so nothing stale can survive the merge in the first place.
Entries from any other source are carried over from the existing lock
unmodified. As a backstop, fail closed with a non-zero exit and leave
the existing lock untouched if regenerating produces no
warpdotdev/common-skills entries at all while the existing lock has
some - that is a sign the run didn't discover or copy anything, not
that every skill vanished upstream.
Add scripts/tests/update_common_skills_lock_test.sh, a self-contained
regression suite that runs the real script against a fake npx
(scripts/tests/fake-bin/npx) modeling `skills add ... --copy`
deterministically from a local fixture directory, with no network
access. Covers a rename, a plain deletion, foreign-source
preservation, idempotence, and the fail-closed guard. Wire it into a
new CI workflow that runs on push to main and on every pull request.
Co-Authored-By: Warp Agent <agent@warp.dev>
update_common_skills_lock seeded its temp dir from the existing
downstream lock and ran `skills add`, which merges into whatever lock
it finds but never removes an entry for a skill that no longer exists
in the source. A rename or deletion in warpdotdev/common-skills left a
ghost entry behind pointing at a skillPath that no longer exists.
Reconcile the candidate lock before comparing/copying it back: drop
any entry whose source is warpdotdev/common-skills unless this run's
`--copy` actually materialized its skillPath under the temp directory.
Entries from any other source, including hand-added ones, are left
untouched. This reuses the copy `skills add` already produced instead
of making a second fetch.
Fixes DEVX-8492.
Co-Authored-By: Warp Agent <agent@warp.dev>
* Update install common skills flow
Co-Authored-By: Oz <oz-agent@warp.dev>
* Clarify CRLF hash normalization
Co-Authored-By: Oz <oz-agent@warp.dev>
* Clarify global lock mismatch guidance
Co-Authored-By: Oz <oz-agent@warp.dev>
---------
Co-authored-by: Oz <oz-agent@warp.dev>
Recreate the resolver change from PR #12 on top of main so consuming repositories can load common-skills scripts through a shared resolver.
Co-authored-by: Oz <oz-agent@warp.dev>
* Add common skills management scripts
Co-Authored-By: Oz <oz-agent@warp.dev>
* Install all common skills dynamically
Co-Authored-By: Oz <oz-agent@warp.dev>
* Share common skills script helpers
Co-Authored-By: Oz <oz-agent@warp.dev>
* Update common skills script structure
Co-Authored-By: Oz <oz-agent@warp.dev>
* Handle verify-only without lock file
Co-Authored-By: Oz <oz-agent@warp.dev>
* Refine common skills installer
Co-Authored-By: Oz <oz-agent@warp.dev>
* Add common skills repair helpers
Co-Authored-By: Oz <oz-agent@warp.dev>
* Add update-skill lockfile test marker
Co-Authored-By: Oz <oz-agent@warp.dev>
* Add common skills installer update path
Co-Authored-By: Oz <oz-agent@warp.dev>
* Refine common skills update workflow
Co-Authored-By: Oz <oz-agent@warp.dev>
* Run skills CLI non-interactively
Co-Authored-By: Oz <oz-agent@warp.dev>
* Remove common skills script dead code
Co-Authored-By: Oz <oz-agent@warp.dev>
* Document common skills client invocation
Co-Authored-By: Oz <oz-agent@warp.dev>
* Fix common skills lock restore flows
Ensure no-target non-interactive flows fail before attempting TTY prompts, and restore global common skills from a temporary lock checkout so restore paths do not rewrite the client repo lock.
Co-Authored-By: Oz <oz-agent@warp.dev>
* Validate common skills script dependencies
Co-Authored-By: Oz <oz-agent@warp.dev>
---------
Co-authored-by: Oz <oz-agent@warp.dev>
Replace the custom install script documentation with npx skills usage and remove the legacy Bash and PowerShell installers.
Co-authored-by: Oz <oz-agent@warp.dev>
Support overriding the common-skills repository URL so callers can test or install from alternate remotes.
Make the Bash installer read overwrite prompts from the controlling terminal when invoked through bash with piped stdin, so callers like warpdotdev/warp script/bootstrap can invoke it interactively.
Co-authored-by: Oz <oz-agent@warp.dev>
* Support custom skill install destination
Co-Authored-By: Oz <oz-agent@warp.dev>
* Derive local skills destination from base directory
Co-Authored-By: Oz <oz-agent@warp.dev>
---------
Co-authored-by: Oz <oz-agent@warp.dev>
* Add common skills install script
Co-Authored-By: Oz <oz-agent@warp.dev>
* Prompt before overwriting installed skills
Co-Authored-By: Oz <oz-agent@warp.dev>
---------
Co-authored-by: Oz <oz-agent@warp.dev>