-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
151 lines (124 loc) · 6.59 KB
/
Copy pathMakefile
File metadata and controls
151 lines (124 loc) · 6.59 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
.PHONY: help install update uninstall validate lint test plugin-validate test-repo-contract \
check-manifest-versions check-platform-equivalence check-agent-drift \
check-feature-equivalence check-platform-targets platform-targets-sync \
platform-targets-assert platform-targets-cochange agent\:check agent-polish-gate \
assert-contract repo-standards-gate opencode-agents opencode-agents-check \
check-marketplace-schema check-doc-claims test-hooks
SKILLS_DIR := skills
HOOKS_DIR := hooks
CONTRACT_DIR := skills/repo/_contract
help:
@echo "Available targets:"
@echo " install — bootstrap ~/.claude/settings.json and specialist agents"
@echo " update — refresh plugin + agents"
@echo " uninstall — remove installed agents and uninstall plugin when possible"
@echo " validate — full CI-parity local gate (lint, contract, JSON, skills)"
@echo " agent:check — drift + feature equivalence + platform targets (agents)"
@echo " agent-polish-gate — sync platform targets + assert current + agent:check (agents, pre-PR)"
@echo " repo-standards-gate — agent-polish-gate + assert-contract (release PR polish exit)"
@echo " assert-contract — repo-standards P1/P2/P3 exit gate (--manifests-only on release PRs)"
@echo " platform-targets-sync — refresh latest_known in platform-targets.json (agents)"
@echo " platform-targets-assert — fail if validated_against lags latest_known (agents)"
@echo " platform-targets-cochange — CI: require platform-targets.json when repo skills change"
@echo " opencode-agents — regenerate .opencode/agent/*.md from agents/*.md"
@echo " opencode-agents-check — fail if .opencode/agent/ has drifted from agents/"
@echo " lint — shellcheck .sh files only"
@echo " test-hooks — behavior tests for hooks/ (tests/test-*.sh)"
@echo " test-repo-contract — contract fixtures (app-gold, plugin-gold, claude-plugin-gold)"
@echo " plugin-validate — claude plugin validate (requires Claude Code CLI)"
@echo " check-manifest-versions — plugin manifests agree with each other"
@echo " check-marketplace-schema — extraKnownMarketplaces is a record, not an array"
@echo " check-doc-claims — skill counts and target coverage match reality"
@echo " test — alias for validate"
install:
@bash scripts/install.sh
update:
@bash scripts/update.sh
uninstall:
@bash scripts/uninstall.sh
test-hooks:
@echo "--- Hook behavior tests ---"
@find tests -maxdepth 1 -name 'test-*.sh' 2>/dev/null | sort | while read -r f; do \
echo "==> $$f"; bash "$$f" || exit 1; \
done
validate: lint test-hooks test-repo-contract check-manifest-versions check-platform-equivalence check-marketplace-schema check-doc-claims
@echo "--- Validating JSON files ---"
@find . -name '*.json' -not -path '*/.git/*' | while read f; do \
jq empty "$$f" 2>&1 && echo " OK $$f" || { echo " FAIL $$f"; exit 1; }; \
done
@echo "--- Validating SKILL.md frontmatter (all official Claude Code fields) ---"
@python3 -c "import yaml" 2>/dev/null || python3 -m pip install -q -r scripts/requirements-validate.txt
@python3 scripts/validate-skill-frontmatter.py
@echo "--- Checking for orphan hook scripts (not referenced in hooks.json) ---"
@if [ -d "$(HOOKS_DIR)" ] && [ -f "$(HOOKS_DIR)/hooks.json" ]; then \
find $(HOOKS_DIR) -maxdepth 1 -name '*.sh' | while read f; do \
base=$$(basename "$$f"); \
grep -q "$$base" $(HOOKS_DIR)/hooks.json || { echo " WARN $$f not referenced in hooks.json"; }; \
done; \
else \
echo " hooks/ absent — skipping orphan hook check"; \
fi
@echo "All local checks passed. Run 'make plugin-validate' for full Claude Code validation."
check-agent-drift:
@bash scripts/check-agent-drift.sh .
check-feature-equivalence:
@bash scripts/check-feature-equivalence.sh .
check-platform-targets:
@bash scripts/check-platform-targets.sh .
check-marketplace-schema:
@bash scripts/check-marketplace-schema.sh .
check-doc-claims:
@bash scripts/check-doc-claims.sh .
platform-targets-sync:
@bash scripts/check-platform-targets.sh . --sync
platform-targets-assert:
@bash scripts/check-platform-targets.sh . --assert-current
platform-targets-cochange:
@bash scripts/check-platform-targets.sh . --require-co-change
opencode-agents:
@bash scripts/build-opencode-agents.sh .
opencode-agents-check:
@bash scripts/build-opencode-agents.sh . --check
agent\:check: check-agent-drift check-feature-equivalence check-platform-targets opencode-agents-check
agent-polish-gate: platform-targets-sync platform-targets-assert agent\:check
assert-contract:
@PROFILE=$$(bash $(CONTRACT_DIR)/scripts/detect-contract-profile.sh .); \
bash $(CONTRACT_DIR)/scripts/assert-contract.sh . "$$PROFILE" --manifests-only
repo-standards-gate: agent-polish-gate assert-contract
check-platform-equivalence: check-feature-equivalence check-platform-targets
lint:
@echo "--- shellcheck ---"
@if command -v shellcheck >/dev/null 2>&1; then \
find scripts $(CONTRACT_DIR)/scripts -maxdepth 1 -name '*.sh' 2>/dev/null | \
while read -r f; do shellcheck -S warning --exclude SC2034 "$$f" || exit 1; done; \
if [ -d "$(HOOKS_DIR)" ]; then \
find $(HOOKS_DIR) -maxdepth 1 -name '*.sh' 2>/dev/null | \
while read -r f; do shellcheck -S warning --exclude SC2034 "$$f" || exit 1; done; \
fi; \
echo " shellcheck passed"; \
else \
echo " shellcheck not installed — skipping (brew install shellcheck)"; \
fi
test-repo-contract:
@echo "--- Repo contract (scaffold-gold / app-gold) ---"
@CONTRACT_OFFLINE=1 bash $(CONTRACT_DIR)/scripts/assert-contract.sh \
$(CONTRACT_DIR)/fixtures/scaffold-gold app-gold
@echo "--- Repo contract (scaffold-plugin-gold / plugin-gold) ---"
@cd $(CONTRACT_DIR)/fixtures/scaffold-plugin-gold && npm run build
@CONTRACT_OFFLINE=1 bash $(CONTRACT_DIR)/scripts/assert-contract.sh \
$(CONTRACT_DIR)/fixtures/scaffold-plugin-gold plugin-gold
@echo "--- Feature equivalence (scaffold-claude-plugin-gold) ---"
@$(MAKE) -C $(CONTRACT_DIR)/fixtures/scaffold-claude-plugin-gold agent\:check
check-manifest-versions:
@echo "--- Manifest/tag version alignment ---"
@git fetch --tags --quiet 2>/dev/null || true
@bash $(CONTRACT_DIR)/scripts/check-manifest-version-alignment.sh . --manifests-only
plugin-validate:
@echo "--- claude plugin validate (primary validator) ---"
@if command -v claude >/dev/null 2>&1; then \
claude plugin validate . && echo " plugin validate passed"; \
else \
echo " claude CLI not found — install from claude.ai/code"; \
exit 1; \
fi
test: validate