Skip to content

Implement skill validate, build, and push CLI commands#3989

Merged
JAORMX merged 1 commit intoskill-cli-lifecycle-commandsfrom
skill-cli-packaging-commands
Mar 4, 2026
Merged

Implement skill validate, build, and push CLI commands#3989
JAORMX merged 1 commit intoskill-cli-lifecycle-commandsfrom
skill-cli-packaging-commands

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Mar 4, 2026

Summary

  • Replace empty skill validate stub with real implementation supporting --format flag, absolute path resolution, error/warning output in text mode, and non-zero exit on invalid
  • Replace empty skill build stub with real implementation supporting --tag/-t flag, printing the built OCI reference on success
  • Replace empty skill push stub with real implementation following silent-success convention
  • All path-based commands include directory-based shell completion

Part 3 of 3 for #3653 (CLI Skills Commands). Stacked on #3988.

Test plan

  • task lint passes with no new warnings
  • task test passes (existing unit tests)
  • task license-check passes (SPDX headers correct)
  • thv skill validate --help shows correct flags (--format)
  • thv skill build --help shows correct flags (--tag/-t)
  • thv skill push --help shows correct usage

🤖 Generated with Claude Code

Replace empty skill validate/build/push stubs with real implementations
that call the Skills HTTP client.

Validate supports --format flag, resolves paths to absolute, prints
errors/warnings in text mode, and returns non-zero exit on invalid.

Build supports --tag/-t flag, resolves paths to absolute, and prints
the built OCI reference on success.

Push takes a positional OCI reference argument and follows
silent-success convention.

All three commands include directory-based shell completion for path
arguments.

Closes #3653

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Mar 4, 2026
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.51%. Comparing base (33504b7) to head (cd88226).
⚠️ Report is 1 commits behind head on skill-cli-lifecycle-commands.

Additional details and impacted files
@@                       Coverage Diff                        @@
##           skill-cli-lifecycle-commands    #3989      +/-   ##
================================================================
- Coverage                         68.55%   68.51%   -0.04%     
================================================================
  Files                               437      437              
  Lines                             44662    44662              
================================================================
- Hits                              30617    30601      -16     
- Misses                            11663    11677      +14     
- Partials                           2382     2384       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JAORMX JAORMX merged commit ad5dd99 into skill-cli-lifecycle-commands Mar 4, 2026
27 checks passed
@JAORMX JAORMX deleted the skill-cli-packaging-commands branch March 4, 2026 09:02
aponcedeleonch pushed a commit that referenced this pull request Mar 4, 2026
Replace empty skill validate/build/push stubs with real implementations
that call the Skills HTTP client.

Validate supports --format flag, resolves paths to absolute, prints
errors/warnings in text mode, and returns non-zero exit on invalid.

Build supports --tag/-t flag, resolves paths to absolute, and prints
the built OCI reference on success.

Push takes a positional OCI reference argument and follows
silent-success convention.

All three commands include directory-based shell completion for path
arguments.

Closes #3653

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JAORMX added a commit that referenced this pull request Mar 4, 2026
Review feedback from #3988:
- Move validateProjectRootForScope to skill_helpers.go for reuse
- Default uninstall --scope to "user" for consistency with install
- Add validateProjectRootForScope to uninstall PreRunE
- Document build reference output in Long description
- Remove chatty "Valid" print from validate (silent success)

Also implements validate, build, and push commands on this branch
(previously in #3989 which targeted the old stacked branch).

Closes #3653

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JAORMX added a commit that referenced this pull request Mar 4, 2026
* Implement skill install and uninstall CLI commands

Replace empty skill install/uninstall stubs with real implementations
that call the Skills HTTP client.

Install supports --client, --scope (default "user"), --force, and
--project-root flags with validation that --project-root is required
when --scope is "project".

Uninstall supports --scope and --project-root flags with shell
completion for installed skill names.

Both commands follow silent-success convention.

Closes #3653

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address review feedback and implement all skill CLI commands

Review feedback from #3988:
- Move validateProjectRootForScope to skill_helpers.go for reuse
- Default uninstall --scope to "user" for consistency with install
- Add validateProjectRootForScope to uninstall PreRunE
- Document build reference output in Long description
- Remove chatty "Valid" print from validate (silent success)

Also implements validate, build, and push commands on this branch
(previously in #3989 which targeted the old stacked branch).

Closes #3653

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
reyortiz3 pushed a commit that referenced this pull request Mar 4, 2026
* Implement skill install and uninstall CLI commands

Replace empty skill install/uninstall stubs with real implementations
that call the Skills HTTP client.

Install supports --client, --scope (default "user"), --force, and
--project-root flags with validation that --project-root is required
when --scope is "project".

Uninstall supports --scope and --project-root flags with shell
completion for installed skill names.

Both commands follow silent-success convention.

Closes #3653

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address review feedback and implement all skill CLI commands

Review feedback from #3988:
- Move validateProjectRootForScope to skill_helpers.go for reuse
- Default uninstall --scope to "user" for consistency with install
- Add validateProjectRootForScope to uninstall PreRunE
- Document build reference output in Long description
- Remove chatty "Valid" print from validate (silent success)

Also implements validate, build, and push commands on this branch
(previously in #3989 which targeted the old stacked branch).

Closes #3653

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
reyortiz3 pushed a commit that referenced this pull request Mar 4, 2026
* Implement skill install and uninstall CLI commands

Replace empty skill install/uninstall stubs with real implementations
that call the Skills HTTP client.

Install supports --client, --scope (default "user"), --force, and
--project-root flags with validation that --project-root is required
when --scope is "project".

Uninstall supports --scope and --project-root flags with shell
completion for installed skill names.

Both commands follow silent-success convention.

Closes #3653

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address review feedback and implement all skill CLI commands

Review feedback from #3988:
- Move validateProjectRootForScope to skill_helpers.go for reuse
- Default uninstall --scope to "user" for consistency with install
- Add validateProjectRootForScope to uninstall PreRunE
- Document build reference output in Long description
- Remove chatty "Valid" print from validate (silent success)

Also implements validate, build, and push commands on this branch
(previously in #3989 which targeted the old stacked branch).

Closes #3653

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
reyortiz3 added a commit that referenced this pull request Mar 4, 2026
* Integrate skills with groups system

Extend the groups system to track skill membership alongside registered
clients. Skills can now be assigned to groups at install time and are
automatically removed from all groups on uninstall.

Changes:
- Add `Skills []string` field to `Group` struct (backward-compatible,
  omitempty)
- Add `Update(ctx, *Group) error` to the `Manager` interface with
  implementations in both `cliManager` and `crdManager`
- Add package-level helpers `AddSkillToGroups` and
  `RemoveSkillFromAllGroups` in `pkg/groups/skills.go`
- Extend `InstallOptions` with `Groups []string` and `ListOptions` with
  `Group string`; add `Group` field to `SkillIndexEntry`
- Wire a `groups.Manager` into `skillsvc`: install registers the skill
  in the specified groups, uninstall removes it from all groups, and
  list can filter by group membership
- Implement `skill install --group`, `skill list --group`, and
  `skill uninstall` CLI subcommands
- Wire `WithGroupManager` into the API skill service

Closes #3654

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Implement skill install and uninstall CLI commands (#3988)

* Implement skill install and uninstall CLI commands

Replace empty skill install/uninstall stubs with real implementations
that call the Skills HTTP client.

Install supports --client, --scope (default "user"), --force, and
--project-root flags with validation that --project-root is required
when --scope is "project".

Uninstall supports --scope and --project-root flags with shell
completion for installed skill names.

Both commands follow silent-success convention.

Closes #3653

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address review feedback and implement all skill CLI commands

Review feedback from #3988:
- Move validateProjectRootForScope to skill_helpers.go for reuse
- Default uninstall --scope to "user" for consistency with install
- Add validateProjectRootForScope to uninstall PreRunE
- Document build reference output in Long description
- Remove chatty "Valid" print from validate (silent success)

Also implements validate, build, and push commands on this branch
(previously in #3989 which targeted the old stacked branch).

Closes #3653

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Integrate skills with groups system

Extend the groups system to track skill membership alongside registered
clients. Skills can now be assigned to groups at install time and are
automatically removed from all groups on uninstall.

Changes:
- Add `Skills []string` field to `Group` struct (backward-compatible,
  omitempty)
- Add `Update(ctx, *Group) error` to the `Manager` interface with
  implementations in both `cliManager` and `crdManager`
- Add package-level helpers `AddSkillToGroups` and
  `RemoveSkillFromAllGroups` in `pkg/groups/skills.go`
- Extend `InstallOptions` with `Groups []string` and `ListOptions` with
  `Group string`; add `Group` field to `SkillIndexEntry`
- Wire a `groups.Manager` into `skillsvc`: install registers the skill
  in the specified groups, uninstall removes it from all groups, and
  list can filter by group membership
- Implement `skill install --group`, `skill list --group`, and
  `skill uninstall` CLI subcommands
- Wire `WithGroupManager` into the API skill service

Closes #3654

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Remove duplicate validators in skill commands

skill install and skill list had duplicate PreRunE validators called
twice in their chains. Remove the redundant calls.

* Move newSkillService out of skill.go

The helper function and its imports are no longer needed directly in
the skill command file.

* Simplify skill group registration to single group

Change AddSkillToGroups/registerSkillInGroups to accept a single group
name string instead of a slice, matching the actual usage where skills
are installed into at most one group at a time.

Also fix macOS test failures caused by t.TempDir() returning symlinked
paths (e.g. /var/folders/...) that fail the "no symlinks" validation in
ValidateProjectRoot by resolving symlinks via filepath.EvalSymlinks.

Remove duplicate --group flag registration in skill list command.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Move skills client DTOs to dedicated file

Extract request/response types from client.go into a separate dto.go
file to improve code organization and separation of concerns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add SPDX license header to skills client dto

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Run unit tests on both Linux and macOS runners

Add matrix strategy to the test workflow to run unit tests on both
ubuntu-latest and macos-latest, ensuring cross-platform compatibility.
Coverage uploads are gated to Linux only to avoid duplicate reports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Regenerate Swagger docs to include skills field in groups.Group

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Reynier Ortiz Vega <reyniero@Reyniers-MacBook-Pro.local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Juan Antonio Osorio <ozz@stacklok.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants