From 33304cff04a601f19128111f77f6538af340f306 Mon Sep 17 00:00:00 2001 From: WaterrrForever Date: Thu, 12 Nov 2026 19:58:01 +0000 Subject: [PATCH] refactor(skills): move the Python encoding guard out of the skills root (#7606) skills/python-encoding.test.mjs was the only loose file in skills/, whose top level otherwise holds one directory per skill. It checks every skill's Python scripts, so it is a repo-level guard and belongs next to the others of its kind in scripts/ (check-skill-import-boundaries, check-media-use-copy-parity). Renamed to scripts/check-skill-python-encoding.test.mjs. The test now resolves skills/ relative to its new home. The skills CI job no longer finds it with its skills/ glob, so it is appended to SKILLS_TESTS next to the copy-parity guard and added to the skills path filter. The test-reachability manifest is updated to match, keyed to skills/**/*.py. Co-authored-by: Claude Opus 5.5 --- .github/workflows/ci.yml | 3 ++- .../check-skill-python-encoding.test.mjs | 2 +- scripts/test-reachability.json | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) rename skills/python-encoding.test.mjs => scripts/check-skill-python-encoding.test.mjs (98%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56cdfa6a74..143e723adf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,6 +164,7 @@ jobs: - "packages/cli/src/media-use/**" - "scripts/check-media-use-copy-parity.test.mjs" - "scripts/check-skill-import-boundaries.test.mjs" + - "scripts/check-skill-python-encoding.test.mjs" - "scripts/generate-skill-module-copies.mjs" - "skills/**" - ".claude/skills/**" @@ -763,7 +764,7 @@ jobs: echo "::error::No skills/**/*.test.mjs files found. Did the layout change?" exit 1 fi - SKILLS_TESTS+=(scripts/check-media-use-copy-parity.test.mjs scripts/creator-editing-capabilities.test.mjs) + SKILLS_TESTS+=(scripts/check-media-use-copy-parity.test.mjs scripts/check-skill-python-encoding.test.mjs scripts/creator-editing-capabilities.test.mjs) printf 'Running %d skills test file(s):\n' "${#SKILLS_TESTS[@]}" printf ' * %s\n' "${SKILLS_TESTS[@]}" node --import ./packages/cli/scripts/test-home.mjs --test "${SKILLS_TESTS[@]}" diff --git a/skills/python-encoding.test.mjs b/scripts/check-skill-python-encoding.test.mjs similarity index 98% rename from skills/python-encoding.test.mjs rename to scripts/check-skill-python-encoding.test.mjs index 5564fba8da..baf5e428c4 100644 --- a/skills/python-encoding.test.mjs +++ b/scripts/check-skill-python-encoding.test.mjs @@ -16,7 +16,7 @@ import { dirname, join, relative } from "node:path"; import { fileURLToPath } from "node:url"; import { describe, it } from "node:test"; -const SKILLS_DIR = dirname(fileURLToPath(import.meta.url)); +const SKILLS_DIR = join(dirname(fileURLToPath(import.meta.url)), "..", "skills"); function pythonScripts(dir) { const found = []; diff --git a/scripts/test-reachability.json b/scripts/test-reachability.json index 8b1a8b59cc..37792f111f 100644 --- a/scripts/test-reachability.json +++ b/scripts/test-reachability.json @@ -22,16 +22,18 @@ "packages/producer/**" ], "scripts/generate-catalog-payloads.test.ts": ["registry/**", "scripts/**"], - "scripts/check-skill-import-boundaries.test.mjs": ["skills/**"] + "scripts/check-skill-import-boundaries.test.mjs": ["skills/**"], + "scripts/check-skill-python-encoding.test.mjs": ["skills/**/*.py"] }, "runners": [ { "cwd": ".", - "command": "set -euo pipefail\nmapfile -t SKILLS_TESTS < <(find skills packages/cli/src/media-use -type f -name \"*.test.mjs\" | sort)\nif [ \"${#SKILLS_TESTS[@]}\" -eq 0 ]; then\necho \"::error::No skills/**/*.test.mjs files found. Did the layout change?\"\nexit 1\nfi\nSKILLS_TESTS+=(scripts/check-media-use-copy-parity.test.mjs scripts/creator-editing-capabilities.test.mjs)\nprintf 'Running %d skills test file(s):\\n' \"${#SKILLS_TESTS[@]}\"\nprintf ' * %s\\n' \"${SKILLS_TESTS[@]}\"\nnode --import ./packages/cli/scripts/test-home.mjs --test \"${SKILLS_TESTS[@]}\"", + "command": "set -euo pipefail\nmapfile -t SKILLS_TESTS < <(find skills packages/cli/src/media-use -type f -name \"*.test.mjs\" | sort)\nif [ \"${#SKILLS_TESTS[@]}\" -eq 0 ]; then\necho \"::error::No skills/**/*.test.mjs files found. Did the layout change?\"\nexit 1\nfi\nSKILLS_TESTS+=(scripts/check-media-use-copy-parity.test.mjs scripts/check-skill-python-encoding.test.mjs scripts/creator-editing-capabilities.test.mjs)\nprintf 'Running %d skills test file(s):\\n' \"${#SKILLS_TESTS[@]}\"\nprintf ' * %s\\n' \"${SKILLS_TESTS[@]}\"\nnode --import ./packages/cli/scripts/test-home.mjs --test \"${SKILLS_TESTS[@]}\"", "tests": [ "skills/**/*.test.mjs", "packages/cli/src/media-use/**/*.test.mjs", "scripts/check-media-use-copy-parity.test.mjs", + "scripts/check-skill-python-encoding.test.mjs", "scripts/creator-editing-capabilities.test.mjs" ], "sources": {},