|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - schedule: |
5 | | - - cron: "0 * * * *" # λ§€ μκ° μ κ° |
6 | 4 | workflow_dispatch: |
7 | 5 | pull_request: |
8 | 6 | push: |
|
11 | 9 | jobs: |
12 | 10 | test: |
13 | 11 | runs-on: ubuntu-latest |
14 | | - permissions: |
15 | | - contents: read |
16 | | - timeout-minutes: 10 |
17 | | - strategy: |
18 | | - matrix: |
19 | | - skill: [humanizer, grammar-checker, style-guide, humanizer] |
20 | | - fail-fast: false # ν μ€ν¬μ΄ μ€ν¨ν΄λ λ€λ₯Έ μ€ν¬ ν
μ€νΈ κ³μ |
21 | 12 |
|
22 | 13 | steps: |
23 | 14 | - name: Checkout repository |
24 | 15 | uses: actions/checkout@v6 |
25 | 16 |
|
26 | | - - name: Validate SKILL.md frontmatter |
| 17 | + - name: Install all skills (local) |
27 | 18 | run: | |
28 | | - echo "π Validating YAML frontmatter for ${{ matrix.skill }}..." |
29 | | - SKILL_FILE="skills/${{ matrix.skill }}/SKILL.md" |
| 19 | + npx skills add . --yes |
| 20 | + echo "β
Successfully installed all skills from local repository" |
30 | 21 |
|
31 | | - if [ ! -f "$SKILL_FILE" ]; then |
32 | | - echo "β SKILL.md not found" |
33 | | - exit 1 |
34 | | - fi |
35 | | -
|
36 | | - # Extract frontmatter (between --- markers) |
37 | | - FRONTMATTER=$(sed -n '/^---$/,/^---$/p' "$SKILL_FILE" | sed '1d;$d') |
38 | | -
|
39 | | - # Check required field: name |
40 | | - if echo "$FRONTMATTER" | grep -q "^name:"; then |
41 | | - NAME=$(echo "$FRONTMATTER" | grep "^name:" | sed 's/name: *//') |
42 | | - echo "β
Found name: $NAME" |
43 | | -
|
44 | | - # Verify name matches matrix skill |
45 | | - if [ "$NAME" = "${{ matrix.skill }}" ]; then |
46 | | - echo "β
Name is correct: ${{ matrix.skill }}" |
47 | | - else |
48 | | - echo "β Name should be '${{ matrix.skill }}', got '$NAME'" |
49 | | - exit 1 |
50 | | - fi |
51 | | - else |
52 | | - echo "β Missing required field: name" |
53 | | - exit 1 |
54 | | - fi |
55 | | -
|
56 | | - # Check required field: description |
57 | | - if echo "$FRONTMATTER" | grep -q "^description:"; then |
58 | | - # Handle both quoted and unquoted descriptions |
59 | | - DESC=$(echo "$FRONTMATTER" | sed -n 's/^description: *"\?\(.*\)"\?$/\1/p') |
60 | | - DESC_LEN=${#DESC} |
61 | | - echo "β
Found description ($DESC_LEN chars)" |
62 | | -
|
63 | | - # Verify description length (1-1024 chars per Agent Skills spec) |
64 | | - if [ $DESC_LEN -lt 1 ] || [ $DESC_LEN -gt 1024 ]; then |
65 | | - echo "β Description must be 1-1024 characters, got $DESC_LEN" |
66 | | - exit 1 |
67 | | - fi |
68 | | -
|
69 | | - # Check for non-ASCII characters in description (CLI compatibility) |
70 | | - if echo "$DESC" | grep -qP '[^\x00-\x7F]'; then |
71 | | - echo "β οΈ Warning: Description contains non-ASCII characters (may cause CLI parsing issues)" |
72 | | - else |
73 | | - echo "β
Description is ASCII-safe" |
74 | | - fi |
75 | | - else |
76 | | - echo "β Missing required field: description" |
77 | | - exit 1 |
78 | | - fi |
79 | | -
|
80 | | - echo "β
Frontmatter validation passed for ${{ matrix.skill }}" |
81 | | -
|
82 | | - - name: Validate skill structure |
| 22 | + - name: Verify all skill files |
83 | 23 | run: | |
84 | | - echo "π Validating skill structure for ${{ matrix.skill }}..." |
85 | | - SKILL_DIR="skills/${{ matrix.skill }}" |
86 | | -
|
87 | | - # Check SKILL.md exists |
88 | | - if [ ! -f "$SKILL_DIR/SKILL.md" ]; then |
89 | | - echo "β SKILL.md not found" |
90 | | - exit 1 |
91 | | - fi |
92 | | - echo "β
SKILL.md exists" |
93 | | -
|
94 | | - # Check for references directory (if it exists) |
95 | | - if [ -d "$SKILL_DIR/references" ]; then |
96 | | - echo "β
references/ directory found" |
97 | | - REF_COUNT=$(find "$SKILL_DIR/references" -name "*.md" | wc -l) |
98 | | - echo " Found $REF_COUNT reference files" |
99 | | - fi |
| 24 | + echo "π Checking installed skill files..." |
100 | 25 |
|
101 | | - # Check for examples directory (if it exists) |
102 | | - if [ -d "$SKILL_DIR/examples" ]; then |
103 | | - echo "β
examples/ directory found" |
104 | | - EX_COUNT=$(find "$SKILL_DIR/examples" -type f | wc -l) |
105 | | - echo " Found $EX_COUNT example files" |
106 | | - fi |
| 26 | + SKILLS_DIR=".agents/skills" |
107 | 27 |
|
108 | | - # Check for scripts directory (if it exists) |
109 | | - if [ -d "$SKILL_DIR/scripts" ]; then |
110 | | - echo "β
scripts/ directory found" |
111 | | - SCRIPT_COUNT=$(find "$SKILL_DIR/scripts" -type f | wc -l) |
112 | | - echo " Found $SCRIPT_COUNT scripts" |
113 | | - fi |
114 | | -
|
115 | | - # Check for assets directory (if it exists) |
116 | | - if [ -d "$SKILL_DIR/assets" ]; then |
117 | | - echo "β
assets/ directory found" |
118 | | - ASSET_COUNT=$(find "$SKILL_DIR/assets" -type f | wc -l) |
119 | | - echo " Found $ASSET_COUNT assets" |
| 28 | + if [ ! -d "$SKILLS_DIR" ]; then |
| 29 | + echo "β Skills directory not found: $SKILLS_DIR" |
| 30 | + exit 1 |
120 | 31 | fi |
121 | 32 |
|
122 | | - echo "β
Skill structure validation passed for ${{ matrix.skill }}" |
| 33 | + echo "β
Skills directory exists: $SKILLS_DIR" |
123 | 34 |
|
124 | | - - name: Validate skill-specific requirements |
125 | | - run: | |
126 | | - echo "π Running skill-specific validation for ${{ matrix.skill }}..." |
| 35 | + # μ€μΉλ λͺ¨λ μ€ν¬ νμΈ |
| 36 | + SKILL_COUNT=0 |
| 37 | + for skill_dir in "$SKILLS_DIR"/*; do |
| 38 | + if [ -d "$skill_dir" ]; then |
| 39 | + skill_name=$(basename "$skill_dir") |
| 40 | + echo "" |
| 41 | + echo "π¦ Checking skill: $skill_name" |
127 | 42 |
|
128 | | - if [ "${{ matrix.skill }}" = "humanizer" ]; then |
129 | | - echo "Validating humanizer-specific files..." |
130 | | -
|
131 | | - # Expected reference files for humanizer |
132 | | - EXPECTED_FILES=( |
133 | | - "skills/humanizer/references/punctuation-patterns.md" |
134 | | - "skills/humanizer/references/spacing-patterns.md" |
135 | | - "skills/humanizer/references/pos-patterns.md" |
136 | | - "skills/humanizer/references/vocabulary-patterns.md" |
137 | | - "skills/humanizer/references/structure-patterns.md" |
138 | | - ) |
139 | | -
|
140 | | - for file in "${EXPECTED_FILES[@]}"; do |
141 | | - if [ -f "$file" ]; then |
142 | | - echo "β
Found: $file" |
| 43 | + if [ -f "$skill_dir/SKILL.md" ]; then |
| 44 | + echo " β
Found SKILL.md" |
| 45 | + SKILL_COUNT=$((SKILL_COUNT + 1)) |
143 | 46 | else |
144 | | - echo "β Missing: $file" |
| 47 | + echo " β SKILL.md not found in $skill_dir" |
145 | 48 | exit 1 |
146 | 49 | fi |
147 | | - done |
148 | | -
|
149 | | - elif [ "${{ matrix.skill }}" = "grammar-checker" ]; then |
150 | | - echo "Validating grammar-checker-specific files..." |
| 50 | + fi |
| 51 | + done |
151 | 52 |
|
152 | | - # Expected reference files for grammar-checker |
153 | | - EXPECTED_FILES=( |
154 | | - "skills/grammar-checker/references/rules.md" |
155 | | - "skills/grammar-checker/references/common-errors.md" |
156 | | - ) |
| 53 | + echo "" |
| 54 | + echo "β
Successfully verified $SKILL_COUNT skills" |
157 | 55 |
|
158 | | - for file in "${EXPECTED_FILES[@]}"; do |
159 | | - if [ -f "$file" ]; then |
160 | | - echo "β
Found: $file" |
161 | | - else |
162 | | - echo "β Missing: $file" |
163 | | - exit 1 |
164 | | - fi |
165 | | - done |
| 56 | + # μ΅μ 1κ° μ΄μμ μ€ν¬μ΄ μ€μΉλμλμ§ νμΈ |
| 57 | + if [ $SKILL_COUNT -eq 0 ]; then |
| 58 | + echo "β No skills were installed" |
| 59 | + exit 1 |
166 | 60 | fi |
167 | 61 |
|
168 | | - echo "β
Skill-specific validation passed for ${{ matrix.skill }}" |
| 62 | + test-remote: |
| 63 | + runs-on: ubuntu-latest |
| 64 | + # main λΈλμΉμ mergeλ νμλ§ μ€ν |
| 65 | + if: github.ref == 'refs/heads/main' |
169 | 66 |
|
170 | | - - name: Install skill with npx skills add |
| 67 | + steps: |
| 68 | + - name: Install all skills from Skills.sh |
171 | 69 | run: | |
172 | | - echo "π§ͺ Installing ${{ matrix.skill }} with npx skills add..." |
| 70 | + npx skills add daleseo/korean-skills --yes |
| 71 | + echo "β
Successfully installed all skills from GitHub" |
173 | 72 |
|
174 | | - # Install skill with claude-code agent and auto-confirm |
175 | | - npx skills add DaleSeo/korean-skills --skill ${{ matrix.skill }} --agent claude-code --yes || { |
176 | | - echo "β οΈ npx skills add failed, but continuing to verify..." |
177 | | - echo "This may be expected in CI environment due to TTY issues" |
178 | | - } |
179 | | -
|
180 | | - echo "β
Skill installation step completed for ${{ matrix.skill }}" |
181 | | -
|
182 | | - - name: Verify installed skill |
| 73 | + - name: Verify all skill files |
183 | 74 | run: | |
184 | | - echo "π Verifying installed ${{ matrix.skill }}..." |
| 75 | + echo "π Checking installed skill files..." |
185 | 76 |
|
186 | | - # Debug: Show all potential skill locations |
187 | | - echo "π Searching for skill installation..." |
188 | | - echo "Checking ~/.claude/skills/:" |
189 | | - ls -laR ~/.claude/ 2>/dev/null || echo "~/.claude/ not found" |
190 | | -
|
191 | | - echo "" |
192 | | - echo "Checking ~/.agents/skills/:" |
193 | | - ls -laR ~/.agents/ 2>/dev/null || echo "~/.agents/ not found" |
| 77 | + SKILLS_DIR=".agents/skills" |
194 | 78 |
|
195 | | - echo "" |
196 | | - echo "Searching entire home directory for ${{ matrix.skill }}:" |
197 | | - find ~ -name "${{ matrix.skill }}" -type d 2>/dev/null | head -10 || echo "No directories found" |
198 | | -
|
199 | | - # Try to find the skill in any location |
200 | | - SKILL_DIR="" |
201 | | - if [ -d ~/.claude/skills/${{ matrix.skill }} ]; then |
202 | | - SKILL_DIR=~/.claude/skills/${{ matrix.skill }} |
203 | | - elif [ -d ~/.agents/skills/${{ matrix.skill }} ]; then |
204 | | - SKILL_DIR=~/.agents/skills/${{ matrix.skill }} |
205 | | - else |
206 | | - # Last resort: search for it |
207 | | - SKILL_DIR=$(find ~ -name "${{ matrix.skill }}" -type d 2>/dev/null | grep -E '(\.claude|\.agents)/skills' | head -1) |
208 | | - fi |
209 | | -
|
210 | | - if [ -z "$SKILL_DIR" ]; then |
211 | | - echo "β Skill directory not found in any expected location" |
212 | | - echo "This may indicate npx skills add failed to install" |
| 79 | + if [ ! -d "$SKILLS_DIR" ]; then |
| 80 | + echo "β Skills directory not found: $SKILLS_DIR" |
213 | 81 | exit 1 |
214 | 82 | fi |
215 | 83 |
|
216 | | - echo "β
Skill directory found: $SKILL_DIR" |
217 | | - echo "π Contents:" |
218 | | - ls -la "$SKILL_DIR" |
| 84 | + echo "β
Skills directory exists: $SKILLS_DIR" |
219 | 85 |
|
220 | | - # Find and display SKILL.md content |
221 | | - echo "" |
222 | | - echo "π Searching for SKILL.md..." |
223 | | - SKILL_FILE=$(find "$SKILL_DIR" -name "*.md" -type f | head -1) |
| 86 | + # μ€μΉλ λͺ¨λ μ€ν¬ νμΈ |
| 87 | + SKILL_COUNT=0 |
| 88 | + for skill_dir in "$SKILLS_DIR"/*; do |
| 89 | + if [ -d "$skill_dir" ]; then |
| 90 | + skill_name=$(basename "$skill_dir") |
| 91 | + echo "" |
| 92 | + echo "π¦ Checking skill: $skill_name" |
224 | 93 |
|
225 | | - if [ -z "$SKILL_FILE" ]; then |
226 | | - echo "β No .md files found in skill directory" |
227 | | - exit 1 |
228 | | - fi |
229 | | -
|
230 | | - echo "β
Found skill file: $SKILL_FILE" |
231 | | - echo "π Skill content preview:" |
232 | | - head -20 "$SKILL_FILE" |
| 94 | + if [ -f "$skill_dir/SKILL.md" ]; then |
| 95 | + echo " β
Found SKILL.md" |
| 96 | + SKILL_COUNT=$((SKILL_COUNT + 1)) |
| 97 | + else |
| 98 | + echo " β SKILL.md not found in $skill_dir" |
| 99 | + exit 1 |
| 100 | + fi |
| 101 | + fi |
| 102 | + done |
233 | 103 |
|
234 | | - # Verify references directory (if expected) |
235 | 104 | echo "" |
236 | | - if [ -d "$SKILL_DIR/references" ]; then |
237 | | - echo "β
references/ directory installed" |
238 | | - echo "π Reference files:" |
239 | | - ls -1 "$SKILL_DIR/references/" |
240 | | - else |
241 | | - echo "βΉοΈ references/ directory not found (may not be required)" |
242 | | - fi |
243 | | -
|
244 | | - echo "β
Skill verification completed for ${{ matrix.skill }}" |
| 105 | + echo "β
Successfully verified $SKILL_COUNT skills" |
245 | 106 |
|
246 | | - summary: |
247 | | - runs-on: ubuntu-latest |
248 | | - needs: test |
249 | | - if: always() |
250 | | - steps: |
251 | | - - name: Check test results |
252 | | - run: | |
253 | | - echo "π Test Summary" |
254 | | - echo "===============" |
255 | | - if [ "${{ needs.test.result }}" = "success" ]; then |
256 | | - echo "β
All skill tests passed!" |
257 | | - exit 0 |
258 | | - else |
259 | | - echo "β Some skill tests failed" |
| 107 | + # μ΅μ 1κ° μ΄μμ μ€ν¬μ΄ μ€μΉλμλμ§ νμΈ |
| 108 | + if [ $SKILL_COUNT -eq 0 ]; then |
| 109 | + echo "β No skills were installed" |
260 | 110 | exit 1 |
261 | 111 | fi |
0 commit comments