mirror of
https://github.com/addyosmani/agent-skills.git
synced 2026-08-12 18:07:26 +02:00
refactor(skill-lint): export only functions, keep policy state private
Per review: the policy collections (REQUIRED_SECTIONS, SECTION_EXEMPT_SKILLS, SKILL_REF_PATTERNS, regexes) were exported by reference, so a consumer could mutate shared state and change lint results process-wide. Export only the linting functions; keep the policy collections private. No behavior change (validator output byte-identical).
This commit is contained in:
@@ -217,13 +217,11 @@ function lintSkill(dirName, skillsDir, knownSkills) {
|
||||
return lintSkillContent(dirName, content, knownSkills);
|
||||
}
|
||||
|
||||
// Export only the linting functions. The policy collections (REQUIRED_SECTIONS,
|
||||
// SECTION_EXEMPT_SKILLS, SKILL_REF_PATTERNS, and the regexes) stay private so a
|
||||
// test or future consumer cannot mutate shared state and change lint results for
|
||||
// the rest of the process. Exercise the rules through these functions.
|
||||
module.exports = {
|
||||
MAX_DESCRIPTION_LENGTH,
|
||||
KEBAB_CASE,
|
||||
DESCRIPTION_TRIGGER,
|
||||
REQUIRED_SECTIONS,
|
||||
SECTION_EXEMPT_SKILLS,
|
||||
SKILL_REF_PATTERNS,
|
||||
parseFrontmatter,
|
||||
extractSkillReferences,
|
||||
lintSkillContent,
|
||||
|
||||
Reference in New Issue
Block a user