#!/usr/bin/env sh # Auto-fix changed files and stage them npx --no-install lint-staged # Validate everything npm test # Validate marketplace manifest and rebuild cowork-plugin tree when skills or manifest change if command -v rg >/dev/null 2>&1; then if git diff --cached --name-only | rg -q 'SKILL\.md|\.claude-plugin/marketplace\.json'; then npm run validate:marketplace npm run build:cowork-plugin git add cowork-plugin/ fi else if git diff --cached --name-only | grep -Eq 'SKILL\.md|\.claude-plugin/marketplace\.json'; then npm run validate:marketplace npm run build:cowork-plugin git add cowork-plugin/ fi fi # Validate docs links only when docs change if command -v rg >/dev/null 2>&1; then if git diff --cached --name-only | rg -q '^docs/'; then npm run docs:validate-links npm run docs:build fi else if git diff --cached --name-only | grep -Eq '^docs/'; then npm run docs:validate-links npm run docs:build fi fi