-
Notifications
You must be signed in to change notification settings - Fork 16
Rework skill validator script #11
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Contributing | ||
|
|
||
| ## Adding a new skill | ||
|
|
||
| To add a new skill, create a new directory in the `skills` directory with the name of the skill. The directory should contain a `SKILL.md` file with the skill's metadata and instructions. You may find the [`skill-creator`](https://github.com/anthropics/skills/tree/main/skills/skill-creator) skill by Anthropic helpful for creating the initial draft. To install in Claude Code, add the `skill-creator` plugin. | ||
|
|
||
| ## Testing new skills | ||
|
|
||
| ### Structural testing | ||
|
|
||
| Use the `tools/validate-skills.sh` script to test the structural validity of the skill. This script uses the [`skill-validator`](https://github.com/agent-ecosystem/skill-validator) tool to check the skill's metadata and instructions. | ||
|
|
||
| ### LLM testing | ||
|
|
||
| Use the `tools/review-skill` skill to have an agent review the skill and interpret the results. On top of the structural validation offered by the `validate-skills.sh` script, it can also perform LLM scoring and provide a summary of the results. | ||
|
|
||
| Exact installation instructions depend on the client, but should be something similar to: | ||
|
|
||
| ```bash | ||
| mkdir -p ~/.claude/skills && ln -s <path-to-agent-skills>/tools/review-skill ~/.claude/skills/review-skill | ||
| ``` | ||
|
|
||
| This creates a symlink to the `review-skill` tool in the `~/.claude/skills` directory so that it can be used in Claude Code. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #!/bin/bash | ||
| # Validates all skill directories. | ||
| # | ||
| # Exit codes: | ||
| # 0 All validated skills passed. | ||
| # 1 One or more skills failed validation. | ||
|
|
||
| # -e is intentionally omitted: all error paths are handled explicitly, | ||
| # so abort-on-error would conflict with the || FAILED=1 accumulator pattern. | ||
| set -uo pipefail | ||
|
|
||
| # Find repository root (script is at tools/validate-skills.sh) | ||
| REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" | ||
|
|
||
| # Check if skill-validator is available | ||
| if ! command -v skill-validator &> /dev/null; then | ||
| echo "❌ skill-validator is not installed." | ||
| echo "" | ||
| echo "To install it, run:" | ||
| echo " brew tap agent-ecosystem/tap" | ||
| echo " brew install skill-validator" | ||
| echo "--- or ---" | ||
| echo " go install github.com/agent-ecosystem/skill-validator/cmd/skill-validator@latest" | ||
| echo "" | ||
| exit 1 | ||
| fi | ||
|
|
||
| FAILED=0 | ||
|
|
||
| # Find and validate all skill directories | ||
| for skill_dir in "$REPO_ROOT"/skills/*/; do | ||
| # Check if the glob matched anything | ||
| [ -d "$skill_dir" ] || continue | ||
|
|
||
| if [ -n "${GITHUB_ACTIONS:-}" ]; then | ||
| # In CI: use markdown output with annotations, filter annotations from summary | ||
| skill-validator check --strict --emit-annotations -o markdown "$skill_dir" \ | ||
| | tee >(grep -v '^::' >> "$GITHUB_STEP_SUMMARY") || FAILED=1 | ||
| else | ||
| # Local: simple output | ||
| skill-validator check --strict "$skill_dir" || FAILED=1 | ||
| fi | ||
| done | ||
|
|
||
| echo "" | ||
| if [ $FAILED -ne 0 ]; then | ||
| echo "❌ Skill validation failed!" | ||
| if [ -n "${GITHUB_ACTIONS:-}" ]; then | ||
| echo "" | ||
| echo "📋 See the Job Summary for detailed validation results:" | ||
| echo " https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" | ||
| fi | ||
| else | ||
| echo "✅ Skill validation passed!" | ||
| fi | ||
|
|
||
| echo "" | ||
|
|
||
| exit $FAILED | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.