Skip to content

Let skill status and remove forget missing installations - #13

Merged
openai0229 merged 1 commit into
mainfrom
feat/skill-remove
Sep 20, 2026
Merged

openai0229 merged 1 commit into
mainfrom
feat/skill-remove

Conversation

@openai0229

Copy link
Copy Markdown
Contributor

What

sqlx skill status listed a record forever after its directory was deleted, always as intact: false, and there was no command to drop the record — the only fix was editing ~/.sqlx/skill-installs.json by hand.

  • status now reports missing: true for a record whose directory no longer exists, so "deleted" and "locally modified" are distinguishable.
  • New sqlx skill remove --path <skill-directory> drops the record. It never deletes files; the response reports directory_exists so the caller knows whether anything is still on disk.
  • Path matching resolves the nearest existing ancestor before comparing, because the installer records the canonical path: after /tmp/... is deleted, remove --path /tmp/... still matches the recorded /private/tmp/... (this was a real failure found while testing the command).
  • Docs: README command table and the Skill's status/update paragraph.

Verification

$ sqlx --data-dir … skill install --path /tmp/sqlx-loop/sk-test2
{"data":{"installed":true,"path":"/private/tmp/sqlx-loop/sk-test2","version":"0.1.6"},"success":true}
$ rm -rf /tmp/sqlx-loop/sk-test2
$ sqlx --data-dir … skill status
{"data":{"installations":[{"intact":false,"missing":true,"path":"/private/tmp/sqlx-loop/sk-test2","version":"0.1.6"}]},"success":true}
$ sqlx --data-dir … skill remove --path /tmp/sqlx-loop/sk-test2
{"data":{"directory_exists":false,"path":"/private/tmp/sqlx-loop/sk-test2","removed":true},"success":true}
$ sqlx --data-dir … skill status
{"data":{"installations":[]},"success":true}
$ sqlx --data-dir … skill remove --path /tmp/sqlx-loop/sk-test2
{"error":{"code":"sqlx.error","message":"no SQLX-managed Skill is recorded at /tmp/sqlx-loop/sk-test2; run {"data":{"installations":[{"intact":true,"path":"/Users/dawn/.pi/agent/skills/sqlx","version":"0.1.6"},{"intact":true,"path":"/Users/dawn/.agents/skills/sqlx","version":"0.1.6"}]},"success":true} to list them"},"success":false}

cargo fmt --all -- --check, cargo clippy --workspace --all-targets --locked -- -D warnings passed, and cargo test -p ottermind-sqlx runs three unit tests for removal, the missing flag and the deleted-directory path match.

Risks and limits

  • remove intentionally does not delete files; removing a directory remains a user action.
  • Only affects the CLI; the npx installer has no Skill-removal step.
  • This branch and the dsh/pi target branch both append to crates/cli/src/skill.rs; whichever merges second needs the test modules combined.

@openai0229
openai0229 merged commit 6f5581c into main Sep 20, 2026
9 checks passed
@openai0229
openai0229 deleted the feat/skill-remove branch September 20, 2026 11:25
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.

1 participant