Skip to content

feat(skills): support exact commit install and update - #531

Open
SanAntonio021 wants to merge 1 commit into
SaladDay:mainfrom
SanAntonio021:codex/skills-source-commit
Open

SanAntonio021 wants to merge 1 commit into
SaladDay:mainfrom
SanAntonio021:codex/skills-source-commit

Conversation

@SanAntonio021

Copy link
Copy Markdown

Behavior

Add optional exact-commit selection to Skill installation and updates:

cc-switch skills install owner/repo:skills/name --source-commit <40-hex-sha>
cc-switch skills update <installed-skill> --source-commit <40-hex-sha>
  • --source-commit accepts only a full 40-character hexadecimal SHA and normalizes it to lowercase.
  • Commit-pinned installs require an explicit owner/repo:path. If the Skill is already installed, the command directs the user to skills update.
  • Commit-pinned updates accept one repository-backed Skill only, conflict with --all, and reject local Skills.
  • The selected SHA is recorded in the existing readme_url, so nested source paths remain unambiguous without a database schema change.
  • The selection applies only to that command. A later update without --source-commit continues to follow the stored branch or repository default branch. An exact update preserves existing branch tracking.
  • Existing install, update, check-update, TUI, and database behavior remains unchanged outside the new opt-in path.

The PR also gates two existing Unix-only OpenClaw symlink tests with #[cfg(unix)]. They currently prevent the Windows cargo test --lib --no-default-features --no-run CI step from compiling. Product code is unchanged by this guard.

Validation

Windows, Rust 1.91.1:

  • cargo fmt --check
  • git diff --check
  • cargo check --lib --no-default-features
  • cargo test --lib --no-default-features --no-run
  • cargo check --bin cc-switch
  • 8 focused tests covering CLI parsing, SHA validation, commit archive URLs, nested-path disambiguation, duplicate installation, repository-only updates, and a local HTTP archive sequence for exact install, exact update, and a subsequent normal branch update.

The complete test suite was not run. Existing repository warnings remain unchanged.

Scope

This PR intentionally does not include local-directory import, cross-process locking, runtime-file exclusion, a transactional file engine, automatic crash recovery, TUI changes, or a database schema bump.

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