refactor: discover skills by walking src instead of hardcoded paths
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) <noreply@anthropic.com>
This commit is contained in:
parent
22035ef015
commit
ac5cb552c0
|
|
@ -41,11 +41,6 @@ const positionalArgs = args.filter((a) => !a.startsWith('--'));
|
||||||
|
|
||||||
// --- Constants ---
|
// --- 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 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 STEP_FILENAME_REGEX = /^step-\d{2}[a-z]?-[a-z0-9-]+\.md$/;
|
||||||
const FORBIDDEN_NAME_SUBSTRINGS = ['anthropic', 'claude'];
|
const FORBIDDEN_NAME_SUBSTRINGS = ['anthropic', 'claude'];
|
||||||
|
|
@ -675,8 +670,7 @@ if (require.main === module) {
|
||||||
skillDirs = [target];
|
skillDirs = [target];
|
||||||
} else {
|
} else {
|
||||||
// Discover all skills
|
// Discover all skills
|
||||||
const allLocations = [...SKILL_LOCATIONS, AGENT_LOCATION];
|
skillDirs = discoverSkillDirs([SRC_DIR]);
|
||||||
skillDirs = discoverSkillDirs(allLocations);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skillDirs.length === 0) {
|
if (skillDirs.length === 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue