forked from SkillPanel/maister
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (78 loc) · 4.26 KB
/
Makefile
File metadata and controls
85 lines (78 loc) · 4.26 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
.PHONY: build validate clean watch build-opencode validate-opencode clean-opencode
build:
bash platforms/copilot-cli/build.sh
validate:
@echo "Checking no colons in command names..."
@! grep -r '^name:.*:' plugins/maister-copilot/commands/ 2>/dev/null || (echo "FAIL: colons in command names" && exit 1)
@echo "Checking no multi-select references..."
@! grep -ri 'multi.select\|multiSelect' plugins/maister-copilot/skills/ 2>/dev/null || (echo "FAIL: multi-select found in skills" && exit 1)
@echo "Checking commands are flat (no subdirectories)..."
@test $$(find plugins/maister-copilot/commands -mindepth 2 -name "*.md" 2>/dev/null | wc -l) -eq 0 || (echo "FAIL: nested command directories found" && exit 1)
@echo "Checking no CLAUDE.md references in skills..."
@! grep -ri 'CLAUDE\.md' plugins/maister-copilot/skills/ 2>/dev/null || (echo "FAIL: CLAUDE.md references found in skills" && exit 1)
@echo "Checking no maister- prefix in copilot command names..."
@! grep -r '^name: maister-' plugins/maister-copilot/commands/ 2>/dev/null || (echo "FAIL: maister- prefix in command names" && exit 1)
@echo "Checking no maister: prefixes in copilot variant..."
@! grep -r 'maister:' plugins/maister-copilot/ --include="*.md" 2>/dev/null || (echo "FAIL: maister: prefix found" && exit 1)
@echo "All checks passed"
clean:
rm -rf plugins/maister-copilot/
watch:
fswatch -o plugins/maister/ | xargs -n1 -I{} make build
build-opencode:
bash platforms/opencode/build.sh
validate-opencode:
@echo "Checking no colons in skill names..."
@! grep -r '^name:.*:' plugins/maister-opencode/skills/ 2>/dev/null || \
(echo "FAIL: colons in skill names" && exit 1)
@echo "Checking no colons in command names..."
@! grep -r '^name:.*:' plugins/maister-opencode/commands/ 2>/dev/null || \
(echo "FAIL: colons in command names" && exit 1)
@echo "Checking no AskUserQuestion references..."
@! grep -r 'AskUserQuestion' plugins/maister-opencode/ --include="*.md" 2>/dev/null || \
(echo "FAIL: AskUserQuestion found" && exit 1)
@echo "Checking AGENTS.md exists..."
@test -f plugins/maister-opencode/AGENTS.md || \
(echo "FAIL: AGENTS.md missing" && exit 1)
@echo "Checking no CLAUDE.md exists..."
@! test -f plugins/maister-opencode/CLAUDE.md || \
(echo "FAIL: CLAUDE.md should not exist" && exit 1)
@echo "Checking no maister: references remain..."
@! grep -r 'maister:' plugins/maister-opencode/ --include="*.md" 2>/dev/null || \
(echo "FAIL: maister: prefix found" && exit 1)
@echo "Checking hooks.js exists..."
@test -f plugins/maister-opencode/.opencode/plugins/hooks.js || \
(echo "FAIL: hooks.js missing" && exit 1)
@echo "Checking opencode.json exists..."
@test -f plugins/maister-opencode/opencode.json || \
(echo "FAIL: opencode.json missing" && exit 1)
@echo "Checking AGENTS.md has platform note..."
@grep -q 'Platform: OpenCode' plugins/maister-opencode/AGENTS.md || \
(echo "FAIL: AGENTS.md missing platform note" && exit 1)
@echo "Checking hooks/ directory absent..."
@test ! -d plugins/maister-opencode/hooks || \
(echo "FAIL: hooks/ should not exist" && exit 1)
@echo "Checking root package.json exists with correct main..."
@test -f package.json || (echo "FAIL: root package.json missing" && exit 1)
@grep -q '"main".*"plugins/maister-opencode/.opencode/plugins/hooks.js"' package.json || \
(echo "FAIL: package.json main field incorrect" && exit 1)
@echo "Checking generated commands match user-invocable skills..."
@SKILL_COUNT=$$(grep -l "user-invocable: true" plugins/maister-opencode/skills/*/SKILL.md 2>/dev/null | wc -l | tr -d ' '); \
CMD_COUNT=$$(grep -l "generated-from-skill: true" plugins/maister-opencode/commands/*.md 2>/dev/null | wc -l | tr -d ' '); \
if [ "$$SKILL_COUNT" -ne "$$CMD_COUNT" ]; then \
echo "FAIL: Mismatch between user-invocable skills ($$SKILL_COUNT) and generated commands ($$CMD_COUNT)"; \
exit 1; \
fi
@echo "Checking all generated commands have AUTO-GENERATED marker..."
@for f in plugins/maister-opencode/commands/*.md; do \
if grep -q "generated-from-skill: true" "$$f" 2>/dev/null; then \
if ! grep -q "AUTO-GENERATED" "$$f" 2>/dev/null; then \
echo "FAIL: $$f missing AUTO-GENERATED comment"; \
exit 1; \
fi; \
fi; \
done
@echo "All OpenCode checks passed"
clean-opencode:
rm -rf plugins/maister-opencode/
rm -f package.json