Skip to content

Commit 45d082c

Browse files
improve: add VERSION file and test suite for rtk-command-code
1 parent a49d78c commit 45d082c

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,10 @@ jobs:
4646
[ -f "$f" ] || { echo "SKILL.md: referenced file not found: $f"; exit 1; }
4747
done
4848
echo "SKILL.md OK"
49+
50+
test:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- name: Run validation tests
55+
run: bash tests/validate.sh

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.1

tests/validate.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
# Validate rtk-command-code documentation integrity
3+
set -euo pipefail
4+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5+
fail=0
6+
7+
echo "=== rtk-command-code validation ==="
8+
9+
# Required files
10+
for f in AGENTS.md CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE README.md SECURITY.md SKILL.md VERSION install.sh install.ps1; do
11+
[ -f "$ROOT/$f" ] || { echo "FAIL: $f missing"; fail=1; }
12+
done
13+
14+
# VERSION semver
15+
version=$(tr -d '[:space:]' < "$ROOT/VERSION")
16+
echo "$version" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$' || { echo "FAIL: VERSION not semver: $version"; fail=1; }
17+
18+
# SKILL.md frontmatter
19+
head -1 "$ROOT/SKILL.md" | grep -qx -- '---' || { echo "FAIL: SKILL.md no frontmatter"; fail=1; }
20+
grep -qE '^name:' "$ROOT/SKILL.md" || { echo "FAIL: SKILL.md no name"; fail=1; }
21+
22+
# AGENTS.md @imports
23+
while IFS= read -r ref; do
24+
[ -f "$ROOT/${ref#@}" ] || { echo "FAIL: missing @import ${ref#@}"; fail=1; }
25+
done < <(grep -aoE '^@[A-Za-z0-9._/-]+' "$ROOT/AGENTS.md" || true)
26+
27+
# SKILL.md references
28+
for f in $(grep -aoE 'references/[A-Za-z0-9._/-]+\.md' "$ROOT/SKILL.md" | sort -u); do
29+
[ -f "$ROOT/$f" ] || { echo "FAIL: missing $f"; fail=1; }
30+
done
31+
32+
# CHANGELOG.md version header
33+
grep -qE '^## \[[0-9]+\.[0-9]+\.[0-9]+\]' "$ROOT/CHANGELOG.md" || { echo "FAIL: CHANGELOG.md no version header"; fail=1; }
34+
35+
echo "=== $([ "$fail" -eq 0 ] && echo 'ALL PASSED' || echo 'SOME FAILED') ==="
36+
exit $fail

0 commit comments

Comments
 (0)