forked from NomaDamas/k-skill
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathk_skill_cleaner.py
More file actions
executable file
·43 lines (37 loc) · 1.5 KB
/
Copy pathk_skill_cleaner.py
File metadata and controls
executable file
·43 lines (37 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3
"""Compatibility wrapper for the k-skill-cleaner skill-local helper.
The standalone skill install includes ``k-skill-cleaner/scripts/k_skill_cleaner.py``.
This repository-root wrapper preserves existing checkout workflows and tests while
keeping the executable payload inside the skill directory.
"""
from __future__ import annotations
import importlib.util
from pathlib import Path
_HELPER_PATH = Path(__file__).resolve().parents[1] / "k-skill-cleaner" / "scripts" / "k_skill_cleaner.py"
_SPEC = importlib.util.spec_from_file_location("_k_skill_cleaner_impl", _HELPER_PATH)
if _SPEC is None or _SPEC.loader is None: # pragma: no cover - importlib defensive guard
raise ImportError(f"Unable to load k-skill-cleaner helper from {_HELPER_PATH}")
_MODULE = importlib.util.module_from_spec(_SPEC)
_SPEC.loader.exec_module(_MODULE)
AGENT_USAGE_SOURCES = _MODULE.AGENT_USAGE_SOURCES
collect_skill_usage = _MODULE.collect_skill_usage
find_skill_dirs = _MODULE.find_skill_dirs
rank_cleanup_candidates = _MODULE.rank_cleanup_candidates
load_usage_json = _MODULE.load_usage_json
expand_default_log_paths = _MODULE.expand_default_log_paths
parse_csv = _MODULE.parse_csv
build_parser = _MODULE.build_parser
main = _MODULE.main
__all__ = [
"AGENT_USAGE_SOURCES",
"collect_skill_usage",
"find_skill_dirs",
"rank_cleanup_candidates",
"load_usage_json",
"expand_default_log_paths",
"parse_csv",
"build_parser",
"main",
]
if __name__ == "__main__":
raise SystemExit(main())