From ac5cb552c06534669f43850ea84de4e33b72f4c2 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Wed, 18 Mar 2026 00:25:17 -0600 Subject: [PATCH] refactor: discover skills by walking src instead of hardcoded paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace SKILL_LOCATIONS array and AGENT_LOCATION constant with a single walk from SRC_DIR. Any directory under src/ containing SKILL.md is a skill — no need to enumerate locations. Co-Authored-By: Claude Opus 4.6 (1M context) --- tools/validate-skills.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/validate-skills.js b/tools/validate-skills.js index ea13b80e3..5b41ad076 100644 --- a/tools/validate-skills.js +++ b/tools/validate-skills.js @@ -41,11 +41,6 @@ const positionalArgs = args.filter((a) => !a.startsWith('--')); // --- Constants --- -const SKILL_LOCATIONS = [path.join(SRC_DIR, 'core', 'skills'), path.join(SRC_DIR, 'core', 'tasks'), path.join(SRC_DIR, 'bmm', 'workflows')]; - -// Agent skills live separately -const AGENT_LOCATION = path.join(SRC_DIR, 'bmm', 'agents'); - const NAME_REGEX = /^[a-z0-9][a-z0-9-]{0,62}[a-z0-9]$/; const STEP_FILENAME_REGEX = /^step-\d{2}[a-z]?-[a-z0-9-]+\.md$/; const FORBIDDEN_NAME_SUBSTRINGS = ['anthropic', 'claude']; @@ -675,8 +670,7 @@ if (require.main === module) { skillDirs = [target]; } else { // Discover all skills - const allLocations = [...SKILL_LOCATIONS, AGENT_LOCATION]; - skillDirs = discoverSkillDirs(allLocations); + skillDirs = discoverSkillDirs([SRC_DIR]); } if (skillDirs.length === 0) {