-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (125 loc) · 4.1 KB
/
Copy pathci.yml
File metadata and controls
137 lines (125 loc) · 4.1 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt-get install -y shellcheck
- name: Run shellcheck
run: |
files=$(find . -name '*.sh' -type f)
if [ -n "$files" ]; then
echo "$files" | xargs shellcheck
else
echo "No .sh files found"
fi
validate-structure:
name: Validate Plugin Structure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get install -y jq
- name: Validate platform artifacts
run: |
errors=0
check_file() {
if [ ! -f "$1" ]; then
echo "FAIL: $1 does not exist"
errors=$((errors + 1))
else
echo "OK: $1"
fi
}
check_json() {
if [ ! -f "$1" ]; then
echo "FAIL: $1 does not exist"
errors=$((errors + 1))
elif ! jq empty "$1" 2>/dev/null; then
echo "FAIL: $1 is not valid JSON"
errors=$((errors + 1))
else
echo "OK: $1 (valid JSON)"
fi
}
echo "=== Platform Artifacts ==="
check_json .claude-plugin/plugin.json
check_json .claude-plugin/marketplace.json
check_json .cursor-plugin/plugin.json
check_file GEMINI.md
check_file .opencode/plugins/skill-portability.js
check_file .github/copilot-instructions.md
check_file AGENTS.md
echo ""
echo "=== Skill Frontmatter ==="
for skill_dir in skills/*/; do
skill_file="${skill_dir}SKILL.md"
if [ ! -f "$skill_file" ]; then
echo "FAIL: $skill_file does not exist"
errors=$((errors + 1))
continue
fi
if ! grep -q '^name:' "$skill_file"; then
echo "FAIL: $skill_file missing name: in frontmatter"
errors=$((errors + 1))
fi
if ! grep -q '^description:' "$skill_file"; then
echo "FAIL: $skill_file missing description: in frontmatter"
errors=$((errors + 1))
fi
echo "OK: $skill_file (frontmatter valid)"
done
echo ""
echo "=== Per-Skill Sidecars ==="
for skill_dir in skills/*/; do
for sidecar in codex-tools.md copilot-tools.md gemini-tools.md; do
check_file "${skill_dir}references/${sidecar}"
done
done
echo ""
echo "=== Version Parity ==="
v_pkg=$(jq -r .version package.json)
v_claude=$(jq -r .version .claude-plugin/plugin.json)
v_cursor=$(jq -r .version .cursor-plugin/plugin.json)
echo "package.json: $v_pkg"
echo "plugin.json (claude): $v_claude"
echo "plugin.json (cursor): $v_cursor"
if [ "$v_pkg" != "$v_claude" ] || [ "$v_pkg" != "$v_cursor" ]; then
echo "FAIL: version mismatch"
errors=$((errors + 1))
else
echo "OK: all versions match ($v_pkg)"
fi
echo ""
echo "=== Session-Start Hook ==="
if [ ! -x hooks/session-start ]; then
echo "FAIL: hooks/session-start does not exist or is not executable"
errors=$((errors + 1))
else
echo "OK: hooks/session-start (executable)"
fi
echo ""
if [ "$errors" -gt 0 ]; then
echo "FAILED: $errors error(s) found"
exit 1
else
echo "All checks passed"
fi
lint-markdown:
name: Lint Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install markdownlint-cli2
run: npm install -g markdownlint-cli2
- name: Run markdownlint
run: markdownlint-cli2 "**/*.md"