feat(cli): add skill commands
CI / security (pull_request) Successful in 24s
CI / typecheck (pull_request) Successful in 1m1s
CI / quality (pull_request) Successful in 16s
CI / build (pull_request) Successful in 24s
CI / integration_tests (pull_request) Successful in 5m22s
CI / lint (pull_request) Failing after 13s
CI / coverage (pull_request) Has been skipped
CI / unit_tests (pull_request) Successful in 33m12s
CI / docker (pull_request) Has been skipped

This commit is contained in:
2026-02-17 14:44:40 +00:00
parent 6d7b759f25
commit c562557da8
10 changed files with 2585 additions and 7 deletions
+196
View File
@@ -0,0 +1,196 @@
Feature: Skill CLI commands
As a developer
I want to manage skills via CLI commands
So that I can register, inspect, and manage reusable tool collections
Background:
Given a skill CLI test runner
And the skill service is reset
# ───────────────────────────────────────────────────────
# skill add — registration
# ───────────────────────────────────────────────────────
Scenario: Add skill from valid config file
Given a valid skill config YAML file at a temp path
When I run skill CLI add with --config pointing to the YAML file
Then the skill CLI add should succeed
And the skill CLI output should contain "Skill Registered"
And the skill CLI output should contain "local/file-reader"
And the skill CLI output should contain " OK"
Scenario: Add skill with all sections populated
Given a full skill config YAML file at a temp path
When I run skill CLI add with --config pointing to the YAML file
Then the skill CLI add should succeed
And the skill CLI output should contain "Skill Registered"
And the skill CLI output should contain "Tool Sources"
Scenario: Add skill with duplicate name fails without --update
Given a valid skill config YAML file at a temp path
And the skill "local/file-reader" is already registered
When I run skill CLI add with --config pointing to the YAML file
Then the skill CLI command should abort
And the skill CLI output should contain "already registered"
And the skill CLI output should contain "--update"
Scenario: Add skill with --update overwrites existing
Given a valid skill config YAML file at a temp path
And the skill "local/file-reader" is already registered
When I run skill CLI add with --config and --update pointing to the YAML file
Then the skill CLI add should succeed
And the skill CLI output should contain "Skill Updated"
And the skill CLI output should contain "Changes"
Scenario: Add skill with missing config file fails
When I run skill CLI add with --config pointing to a missing file
Then the skill CLI command should abort
Scenario: Add skill with invalid YAML fails
Given an invalid skill YAML file at a temp path
When I run skill CLI add with --config pointing to the YAML file
Then the skill CLI command should abort
Scenario: Add skill with --format json produces valid JSON
Given a valid skill config YAML file at a temp path
When I run skill CLI add with --config and --format json
Then the skill CLI add should succeed
And the skill CLI output should be valid JSON
Scenario: Add skill with --format yaml produces valid YAML
Given a valid skill config YAML file at a temp path
When I run skill CLI add with --config and --format yaml
Then the skill CLI add should succeed
And the skill CLI output should be valid YAML
# ───────────────────────────────────────────────────────
# skill show — details
# ───────────────────────────────────────────────────────
Scenario: Show skill displays all panels
Given the skill "local/file-reader" is registered with tools
When I run skill CLI show "local/file-reader"
Then the skill CLI show should succeed
And the skill CLI output should contain "Skill Details"
And the skill CLI output should contain "local/file-reader"
And the skill CLI output should contain "Capability Summary"
And the skill CLI output should contain " OK"
Scenario: Show skill not found
When I run skill CLI show "local/nonexistent"
Then the skill CLI command should abort
And the skill CLI output should contain "not found"
Scenario: Show skill with --format json
Given the skill "local/file-reader" is registered with tools
When I run skill CLI show "local/file-reader" with --format json
Then the skill CLI show should succeed
And the skill CLI output should be valid JSON
# ───────────────────────────────────────────────────────
# skill tools — flattened tool list
# ───────────────────────────────────────────────────────
Scenario: Tools command shows resolved tool list
Given the skill "local/file-reader" is registered with tools
When I run skill CLI tools "local/file-reader"
Then the skill CLI tools should succeed
And the skill CLI output should contain "Tools for local/file-reader"
And the skill CLI output should contain "Summary"
And the skill CLI output should contain " OK"
Scenario: Tools command with includes shows source skill
Given a composed skill "local/composed" including "local/file-reader" is registered
When I run skill CLI tools "local/composed"
Then the skill CLI tools should succeed
And the skill CLI output should contain "local/file-re"
Scenario: Tools command for nonexistent skill fails
When I run skill CLI tools "local/nonexistent"
Then the skill CLI command should abort
And the skill CLI output should contain "not found"
Scenario: Tools with --format json
Given the skill "local/file-reader" is registered with tools
When I run skill CLI tools "local/file-reader" with --format json
Then the skill CLI tools should succeed
And the skill CLI output should be valid JSON
# ───────────────────────────────────────────────────────
# skill list — listing and filtering
# ───────────────────────────────────────────────────────
Scenario: List shows all registered skills in table
Given the skill "local/file-reader" is registered with tools
And the skill "local/git-ops" is registered with tools
When I run skill CLI list
Then the skill CLI list should succeed
And the skill CLI output should contain "local/file-reader"
And the skill CLI output should contain "local/git-ops"
And the skill CLI output should contain "Summary"
Scenario: List with namespace filter
Given the skill "local/file-reader" is registered with tools
And the skill "devops/deploy-tools" is registered with tools
When I run skill CLI list with --namespace "local"
Then the skill CLI list should succeed
And the skill CLI output should contain "local/file-reader"
And the skill CLI output should not contain "devops/deploy-tools"
Scenario: List with --source mcp filter
Given a skill "local/mcp-backed" with MCP servers is registered
And the skill "local/file-reader" is registered with tools
When I run skill CLI list with --source "mcp"
Then the skill CLI list should succeed
And the skill CLI output should contain "local/mcp-backed"
And the skill CLI output should not contain "local/file-reader"
Scenario: List with no skills shows helpful message
When I run skill CLI list
Then the skill CLI output should contain "No skills found"
Scenario: List with --format json
Given the skill "local/file-reader" is registered with tools
When I run skill CLI list with --format json
Then the skill CLI list should succeed
And the skill CLI output should be valid JSON
# ───────────────────────────────────────────────────────
# skill remove — removal
# ───────────────────────────────────────────────────────
Scenario: Remove skill with --yes skips confirmation
Given the skill "local/file-reader" is registered with tools
When I run skill CLI remove "local/file-reader" with --yes
Then the skill CLI remove should succeed
And the skill CLI output should contain "Skill Removed"
And the skill CLI output should contain " OK"
Scenario: Remove nonexistent skill fails
When I run skill CLI remove "local/nonexistent" with --yes
Then the skill CLI command should abort
And the skill CLI output should contain "not found"
Scenario: Remove skill shows dependency check
Given a composed skill "local/composed" including "local/file-reader" is registered
When I run skill CLI remove "local/file-reader" with --yes
Then the skill CLI remove should succeed
And the skill CLI output should contain "Dependency Check"
And the skill CLI output should contain "local/composed"
Scenario: Remove skill with --format json
Given the skill "local/file-reader" is registered with tools
When I run skill CLI remove "local/file-reader" with --yes and --format json
Then the skill CLI remove should succeed
And the skill CLI output should be valid JSON
# ───────────────────────────────────────────────────────
# Include cycle detection
# ───────────────────────────────────────────────────────
Scenario: Tools command detects circular includes
Given a skill "local/cycle-a" including "local/cycle-b" is registered
And a skill "local/cycle-b" including "local/cycle-a" is registered
When I run skill CLI tools "local/cycle-a"
Then the skill CLI command should abort
And the skill CLI output should contain "Cycle detected"