refactor: standardize vulnerability skills format
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import re
|
||||
|
||||
from strix.utils.resource_paths import get_strix_resource_path
|
||||
|
||||
|
||||
_EXCLUDED_CATEGORIES = {"scan_modes", "coordination"}
|
||||
_FRONTMATTER_PATTERN = re.compile(r"^---\s*\n.*?\n---\s*\n", re.DOTALL)
|
||||
|
||||
|
||||
def get_available_skills() -> dict[str, list[str]]:
|
||||
@@ -127,7 +130,9 @@ def load_skills(skill_names: list[str]) -> dict[str, str]:
|
||||
if skill_path and (skills_dir / skill_path).exists():
|
||||
full_path = skills_dir / skill_path
|
||||
var_name = skill_name.split("/")[-1]
|
||||
skill_content[var_name] = full_path.read_text()
|
||||
content = full_path.read_text()
|
||||
content = _FRONTMATTER_PATTERN.sub("", content).lstrip()
|
||||
skill_content[var_name] = content
|
||||
logger.info(f"Loaded skill: {skill_name} -> {var_name}")
|
||||
else:
|
||||
logger.warning(f"Skill not found: {skill_name}")
|
||||
|
||||
Reference in New Issue
Block a user