@jcorpac/skill-vault 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/SKILL.md +21 -2
- package/package.json +1 -1
- package/scripts/skill_vault.py +137 -2
package/README.md
CHANGED
|
@@ -79,6 +79,10 @@ python scripts/skill_vault.py verify
|
|
|
79
79
|
| Command | Description |
|
|
80
80
|
| :--- | :--- |
|
|
81
81
|
| `skill-vault init` | Bootstrap standard skill and archive folders in workspace. |
|
|
82
|
+
| `skill-vault list` | Present all active skills (L1) and archived skills (L2). |
|
|
83
|
+
| `skill-vault status` | Fast summary of skill counts and category breakdown. |
|
|
84
|
+
| `skill-vault list --active` | List only active skills currently loaded in context memory. |
|
|
85
|
+
| `skill-vault list --archived` | List only cold-storage skills grouped by category. |
|
|
82
86
|
| `skill-vault archive <name> --category "<Cat>"` | Move active skill to archive with category metadata. |
|
|
83
87
|
| `skill-vault archive --pattern "gcp-*"` | Archive multiple matching skills via glob pattern. |
|
|
84
88
|
| `skill-vault recategorize <name> "<New Cat>"` | Reorganize skill category without modifying `SKILL.md`. |
|
package/SKILL.md
CHANGED
|
@@ -82,12 +82,31 @@ To rebuild `INDEX.md` and ensure all paths and category sections are synchronize
|
|
|
82
82
|
python scripts/skill_vault.py reindex
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
### E.
|
|
85
|
+
### E. Presenting Skills & Tier Status
|
|
86
|
+
To get a rapid overview of what skills are currently in active context memory (L1) vs. cold storage (L2):
|
|
87
|
+
```bash
|
|
88
|
+
# Full overview of active and archived skills
|
|
89
|
+
python scripts/skill_vault.py list
|
|
90
|
+
|
|
91
|
+
# Quick breakdown of counts and categories
|
|
92
|
+
python scripts/skill_vault.py status
|
|
93
|
+
|
|
94
|
+
# List only active skills in context
|
|
95
|
+
python scripts/skill_vault.py list --active
|
|
96
|
+
|
|
97
|
+
# List archived skills in a specific category
|
|
98
|
+
python scripts/skill_vault.py list --archived --category "Cloud SQL"
|
|
99
|
+
|
|
100
|
+
# Output structured JSON (for scripts/dashboards)
|
|
101
|
+
python scripts/skill_vault.py list --json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### F. Skill Discovery & Keyword Search
|
|
86
105
|
```bash
|
|
87
106
|
python scripts/skill_vault.py search "<keyword>"
|
|
88
107
|
```
|
|
89
108
|
|
|
90
|
-
###
|
|
109
|
+
### G. Archive Integrity Audit & Self-Healing
|
|
91
110
|
To confirm bi-directional consistency across disk folders, `backup_manifest.json`, and `INDEX.md`:
|
|
92
111
|
```bash
|
|
93
112
|
# Run integrity verification audit
|
package/package.json
CHANGED
package/scripts/skill_vault.py
CHANGED
|
@@ -71,8 +71,8 @@ class SkillVault:
|
|
|
71
71
|
if not self.index_file.exists():
|
|
72
72
|
self.index_file.write_text("# Skill Archive Index\n\nTotal Archived Skills: 0\n", encoding="utf-8")
|
|
73
73
|
print(f"[Initialized] Skill Vault initialized at: {self.base_dir}")
|
|
74
|
-
print(f"
|
|
75
|
-
print(f"
|
|
74
|
+
print(f" * Active skills: {self.skills_dir}")
|
|
75
|
+
print(f" * Archive store: {self.archive_dir}")
|
|
76
76
|
|
|
77
77
|
def get_active_skill_dirs(self):
|
|
78
78
|
"""Discover active skill directories."""
|
|
@@ -92,6 +92,22 @@ class SkillVault:
|
|
|
92
92
|
dirs.append(p / "skills")
|
|
93
93
|
return dirs
|
|
94
94
|
|
|
95
|
+
def get_active_skills(self):
|
|
96
|
+
"""Discover all currently active skills on disk."""
|
|
97
|
+
active = {}
|
|
98
|
+
for search_dir in self.get_active_skill_dirs():
|
|
99
|
+
if search_dir.exists():
|
|
100
|
+
for folder in search_dir.iterdir():
|
|
101
|
+
if folder.is_dir() and (folder / "SKILL.md").exists():
|
|
102
|
+
desc = self.parse_skill_description(folder / "SKILL.md")
|
|
103
|
+
active[folder.name] = {
|
|
104
|
+
"name": folder.name,
|
|
105
|
+
"path": str(folder),
|
|
106
|
+
"relative_path": self.make_portable_path(folder),
|
|
107
|
+
"description": desc,
|
|
108
|
+
}
|
|
109
|
+
return active
|
|
110
|
+
|
|
95
111
|
def get_archived_skill_folders(self):
|
|
96
112
|
"""Discover all skill folders physically present in the archive directory."""
|
|
97
113
|
archive_subdirs = [self.archive_dir / "skills"]
|
|
@@ -216,6 +232,96 @@ class SkillVault:
|
|
|
216
232
|
|
|
217
233
|
# --- Actions ---
|
|
218
234
|
|
|
235
|
+
def list_skills(self, show_active=True, show_archived=True, category_filter=None, as_json=False, summary_only=False):
|
|
236
|
+
"""Present active and archived skills in structured, human-readable or JSON formats."""
|
|
237
|
+
active_map = self.get_active_skills() if show_active else {}
|
|
238
|
+
manifest = self.load_manifest() if show_archived else []
|
|
239
|
+
|
|
240
|
+
# Filter manifest by category if requested
|
|
241
|
+
if category_filter and show_archived:
|
|
242
|
+
manifest = [m for m in manifest if m.get("category", "").lower() == category_filter.lower()]
|
|
243
|
+
|
|
244
|
+
# Group archived by category
|
|
245
|
+
archived_by_cat = {}
|
|
246
|
+
for item in manifest:
|
|
247
|
+
cat = item.get("category", "General & Utility Skills")
|
|
248
|
+
archived_path = self.resolve_portable_path(item["archived_path"])
|
|
249
|
+
skill_md = archived_path / "SKILL.md"
|
|
250
|
+
desc = self.parse_skill_description(skill_md)
|
|
251
|
+
archived_by_cat.setdefault(cat, []).append({
|
|
252
|
+
"name": item["name"],
|
|
253
|
+
"path": str(archived_path),
|
|
254
|
+
"relative_path": item["archived_path"],
|
|
255
|
+
"description": desc,
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
if as_json:
|
|
259
|
+
result = {}
|
|
260
|
+
if show_active:
|
|
261
|
+
result["active"] = list(active_map.values())
|
|
262
|
+
if show_archived:
|
|
263
|
+
result["archived"] = archived_by_cat
|
|
264
|
+
result["archived_total"] = len(manifest)
|
|
265
|
+
print(json.dumps(result, indent=2))
|
|
266
|
+
return
|
|
267
|
+
|
|
268
|
+
print("==================================================")
|
|
269
|
+
print(" SKILL VAULT OVERVIEW")
|
|
270
|
+
print(f" Base Directory: {self.base_dir}")
|
|
271
|
+
print("==================================================\n")
|
|
272
|
+
|
|
273
|
+
# Summary Header
|
|
274
|
+
total_active = len(active_map)
|
|
275
|
+
total_archived = len(manifest)
|
|
276
|
+
total_categories = len(archived_by_cat)
|
|
277
|
+
|
|
278
|
+
print("Storage Tier Summary:")
|
|
279
|
+
if show_active:
|
|
280
|
+
print(f" * L1 Active Context Memory: {total_active} skill(s)")
|
|
281
|
+
if show_archived:
|
|
282
|
+
print(f" * L2 Cold Storage Archive: {total_archived} skill(s) across {total_categories} categories")
|
|
283
|
+
print("")
|
|
284
|
+
|
|
285
|
+
if summary_only:
|
|
286
|
+
if show_archived and archived_by_cat:
|
|
287
|
+
print("Archived Categories Breakdown:")
|
|
288
|
+
for cat, skills in sorted(archived_by_cat.items()):
|
|
289
|
+
print(f" - {cat}: {len(skills)} skill(s)")
|
|
290
|
+
print("")
|
|
291
|
+
return
|
|
292
|
+
|
|
293
|
+
# 1. Present Active Skills
|
|
294
|
+
if show_active:
|
|
295
|
+
print("--------------------------------------------------")
|
|
296
|
+
print(f" [L1 ACTIVE SKILLS] ({total_active} in context)")
|
|
297
|
+
print("--------------------------------------------------")
|
|
298
|
+
if not active_map:
|
|
299
|
+
print(" (No active skills found. Use 'restore' to mount skills from archive.)\n")
|
|
300
|
+
else:
|
|
301
|
+
for name, data in sorted(active_map.items()):
|
|
302
|
+
desc = data["description"]
|
|
303
|
+
desc_snippet = desc[:110] + "..." if len(desc) > 110 else desc
|
|
304
|
+
print(f" * {name}")
|
|
305
|
+
print(f" Desc: {desc_snippet}")
|
|
306
|
+
print(f" Path: {data['relative_path']}")
|
|
307
|
+
print("")
|
|
308
|
+
|
|
309
|
+
# 2. Present Archived Skills
|
|
310
|
+
if show_archived:
|
|
311
|
+
print("--------------------------------------------------")
|
|
312
|
+
print(f" [L2 ARCHIVED SKILLS] ({total_archived} in vault)")
|
|
313
|
+
print("--------------------------------------------------")
|
|
314
|
+
if not archived_by_cat:
|
|
315
|
+
print(" (No archived skills found.)\n")
|
|
316
|
+
else:
|
|
317
|
+
for cat, skills in sorted(archived_by_cat.items()):
|
|
318
|
+
print(f"\n [{cat}] ({len(skills)} skills):")
|
|
319
|
+
for s in sorted(skills, key=lambda x: x["name"].lower()):
|
|
320
|
+
desc = s["description"]
|
|
321
|
+
desc_snippet = desc[:110] + "..." if len(desc) > 110 else desc
|
|
322
|
+
print(f" * {s['name']}: {desc_snippet}")
|
|
323
|
+
print("")
|
|
324
|
+
|
|
219
325
|
def archive(self, name=None, pattern=None, category=None, keep_active=False):
|
|
220
326
|
"""Archive active skills with an assigned category."""
|
|
221
327
|
manifest = self.load_manifest()
|
|
@@ -539,6 +645,18 @@ def main():
|
|
|
539
645
|
# Init
|
|
540
646
|
p_init = subparsers.add_parser("init", help="Bootstrap standard skill directory structure in workspace")
|
|
541
647
|
|
|
648
|
+
# List / Overview
|
|
649
|
+
p_list = subparsers.add_parser("list", help="Present active and archived skills")
|
|
650
|
+
p_list.add_argument("-a", "--active", action="store_true", help="List only active skills (L1 Context)")
|
|
651
|
+
p_list.add_argument("-c", "--archived", action="store_true", help="List only archived skills (L2 Vault)")
|
|
652
|
+
p_list.add_argument("--category", help="Filter by category")
|
|
653
|
+
p_list.add_argument("--summary", action="store_true", help="Show compact category summary")
|
|
654
|
+
p_list.add_argument("--json", action="store_true", help="Output in structured JSON format")
|
|
655
|
+
|
|
656
|
+
# Status (alias for list --summary)
|
|
657
|
+
p_stat = subparsers.add_parser("status", help="Show summary of active and archived skills")
|
|
658
|
+
p_stat.add_argument("--json", action="store_true", help="Output in structured JSON format")
|
|
659
|
+
|
|
542
660
|
# Archive
|
|
543
661
|
p_arch = subparsers.add_parser("archive", help="Archive active skills into cold storage")
|
|
544
662
|
p_arch.add_argument("name", nargs="?", help="Specific skill name")
|
|
@@ -575,6 +693,23 @@ def main():
|
|
|
575
693
|
|
|
576
694
|
if args.command == "init":
|
|
577
695
|
mgr.init()
|
|
696
|
+
elif args.command == "list":
|
|
697
|
+
show_active = not args.archived or args.active
|
|
698
|
+
show_archived = not args.active or args.archived
|
|
699
|
+
mgr.list_skills(
|
|
700
|
+
show_active=show_active,
|
|
701
|
+
show_archived=show_archived,
|
|
702
|
+
category_filter=args.category,
|
|
703
|
+
as_json=args.json,
|
|
704
|
+
summary_only=args.summary,
|
|
705
|
+
)
|
|
706
|
+
elif args.command == "status":
|
|
707
|
+
mgr.list_skills(
|
|
708
|
+
show_active=True,
|
|
709
|
+
show_archived=True,
|
|
710
|
+
as_json=args.json,
|
|
711
|
+
summary_only=True,
|
|
712
|
+
)
|
|
578
713
|
elif args.command == "archive":
|
|
579
714
|
mgr.archive(name=args.name, pattern=args.pattern, category=args.category, keep_active=args.keep_active)
|
|
580
715
|
elif args.command == "recategorize":
|