-
Notifications
You must be signed in to change notification settings - Fork 0
feat(claude): add skill installer script #579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,18 @@ | ||||||||||||||||
| #!/usr/bin/env bash | ||||||||||||||||
| # Install agent skills from external repositories | ||||||||||||||||
| # Usage: ./install-skills.sh | ||||||||||||||||
| # Docs: https://agentskills.io | ||||||||||||||||
|
|
||||||||||||||||
| set -euo pipefail | ||||||||||||||||
|
|
||||||||||||||||
| echo "Installing agent skills..." | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The script executes
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| # Install Vercel agent-skills (React best practices + Web design guidelines) | ||||||||||||||||
| # https://github.com/vercel-labs/agent-skills | ||||||||||||||||
| npx add-skill vercel-labs/agent-skills \ | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For security and reproducibility, it's highly recommended to pin the version of the npm package being executed with
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No version or commit hash specified for
Prompt for AgentThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No version pinning for the Prompt for AgentThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using
See Prompt for Agent |
||||||||||||||||
| --agent claude-code \ | ||||||||||||||||
| --skill vercel-react-best-practices \ | ||||||||||||||||
| --skill web-design-guidelines \ | ||||||||||||||||
| --yes | ||||||||||||||||
|
Comment on lines
+12
to
+16
|
||||||||||||||||
|
|
||||||||||||||||
| echo "Done! Skills installed to ~/.claude/skills/" | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tilde
Suggested change
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| #!/usr/bin/env bash | ||
| # shellcheck disable=SC2329,SC2016 | ||
|
|
||
| Describe 'install-skills.sh' | ||
| SCRIPT="$PWD/config/claude/install-skills.sh" | ||
|
|
||
| Describe 'script structure' | ||
| It 'has valid bash syntax' | ||
| When run bash -n "$SCRIPT" | ||
| The status should be success | ||
| End | ||
|
|
||
| It 'uses strict mode' | ||
| When run grep -q 'set -euo pipefail' "$SCRIPT" | ||
| The status should be success | ||
| End | ||
|
|
||
| It 'has executable permission' | ||
| When run test -x "$SCRIPT" | ||
| The status should be success | ||
| End | ||
| End | ||
|
|
||
| Describe 'npx add-skill invocation' | ||
| setup() { | ||
| mock_bin_setup npx | ||
| } | ||
| cleanup() { | ||
| mock_bin_cleanup | ||
| } | ||
| Before 'setup' | ||
| After 'cleanup' | ||
|
|
||
| It 'calls npx add-skill with correct arguments' | ||
| When run bash "$SCRIPT" | ||
| The status should be success | ||
| The output should include 'Installing agent skills' | ||
| End | ||
|
|
||
| It 'passes vercel-labs/agent-skills as source' | ||
| When run bash -c 'bash '"$SCRIPT"'; cat "$MOCK_LOG"' | ||
| The status should be success | ||
| The output should include 'vercel-labs/agent-skills' | ||
| End | ||
|
|
||
| It 'specifies claude-code as target agent' | ||
| When run bash -c 'bash '"$SCRIPT"'; cat "$MOCK_LOG"' | ||
| The status should be success | ||
| The output should include '--agent claude-code' | ||
| End | ||
|
|
||
| It 'includes vercel-react-best-practices skill' | ||
| When run bash -c 'bash '"$SCRIPT"'; cat "$MOCK_LOG"' | ||
| The status should be success | ||
| The output should include 'vercel-react-best-practices' | ||
| End | ||
|
|
||
| It 'includes web-design-guidelines skill' | ||
| When run bash -c 'bash '"$SCRIPT"'; cat "$MOCK_LOG"' | ||
| The status should be success | ||
| The output should include 'web-design-guidelines' | ||
| End | ||
|
|
||
| It 'uses --yes flag for non-interactive mode' | ||
| When run bash -c 'bash '"$SCRIPT"'; cat "$MOCK_LOG"' | ||
| The status should be success | ||
| The output should include '--yes' | ||
| End | ||
| End | ||
| End |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script lacks test coverage. The repository has comprehensive bash script testing using shellspec (see spec/ directory), and all other scripts in config/claude/ have corresponding spec files. Create spec/install_skills_spec.sh following the pattern used in spec/notify_spec.sh, spec/security_spec.sh, etc. Additionally, update spec/coverage_spec.sh to include 'config/claude/install-skills.sh' in the covered_scripts list (around line 96).