blob: 55f81a6bb15cda188bb0be68d1790ad105439b6c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/bin/bash
# extract-yaml.sh - Extract YAML frontmatter from SKILL.md files
# Part of skill-quality-reviewer
# Usage: ./extract-yaml.sh <path-to-skill>
# Example: ./extract-yaml.sh ~/.claude/skills/git-workflow
set -euo pipefail
# Check if path provided
if [ $# -eq 0 ]; then
echo "Usage: $0 <path-to-skill>"
echo "Example: $0 ~/.claude/skills/git-workflow"
exit 1
fi
SKILL_PATH="$1"
SKILL_FILE="${SKILL_PATH}/SKILL.md"
# Check if SKILL.md exists
if [ ! -f "$SKILL_FILE" ]; then
echo "Error: SKILL.md not found at ${SKILL_FILE}"
exit 1
fi
# Extract YAML frontmatter (between --- lines)
# Using sed to extract content between first and second ---
sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$SKILL_FILE"
|