@jcorpac/skill-vault 1.7.0 → 2.0.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 CHANGED
@@ -1,75 +1,73 @@
1
1
  # Skill Vault 🛡️
2
2
 
3
- [![CI Test Suite](https://github.com/jcorpac/skill-vault/actions/workflows/test.yml/badge.svg)](https://github.com/jcorpac/skill-vault/actions)
3
+ [![CI Test Suite](https://github.com/jcorpac/skill-vault/actions/workflows/test.yml/badge.svg)](https://github.com/jcorp/skill-vault/actions)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5
5
  [![npm version](https://img.shields.io/npm/v/@jcorpac/skill-vault.svg)](https://www.npmjs.com/package/@jcorpac/skill-vault)
6
6
  [![Agent Skills](https://img.shields.io/badge/Agent%20Skills-Standard-green.svg)](SKILL.md)
7
7
 
8
- > **Universal Agent Skill Router, Lifecycle Manager & Tiered Storage Engine for AI Coding Agents.**
9
- > Works across **Google Antigravity, Claude Code, Cursor, Windsurf, OpenCode, and CI/CD**.
8
+ > **Automatic Background Skill Router, Read-Only JIT MCP Server & Tiered Cold-Storage Engine for AI Coding Agents.**
9
+ > Works across **Google Antigravity, Claude Code, Gemini CLI, Cursor, and CI/CD**.
10
10
 
11
11
  ---
12
12
 
13
13
  ## ⚡ The Problem: Context Bloat & Skill Bleed
14
14
 
15
- As teams collect specialized skills (database admin, cloud deployment, bioinformatics, testing workflows), loading 50–100+ skills into active AI prompts causes:
16
- 1. **Context Window Saturation**: Thousands of prompt tokens consumed before the conversation even starts.
17
- 2. **Skill Bleed**: AI models get confused by conflicting tool instructions from unrelated frameworks.
18
- 3. **Broken Manifests & Orphan Folders**: Manual directory changes leave dangling references.
19
-
20
- ## 💡 The Solution: Tiered Skill Memory
21
-
22
- **Skill Vault** implements a **two-tier memory model**:
23
- - **L1 Active Memory (`skills/`)**: Lightweight general-purpose skills actively loaded in context.
24
- - **L2 Cold Storage (`skill_archive/`)**: Deep domain skills indexed in metadata, searchable in milliseconds, and dynamically mounted or restored on demand.
25
-
26
- ```
27
- ┌─────────────────────────────────────────────────────────────┐
28
- │ AI CODING AGENT │
29
- │ (Google Antigravity / Claude Code / Cursor / Windsurf) │
30
- └──────────────────────────────┬──────────────────────────────┘
31
- │
32
- ┌───────────────┴───────────────┐
33
- ▼ ▼
34
- [L1 Active Context Memory] [L2 Cold Storage Archive]
35
- ./.agents/skills/ ./skill_archive/skills/
36
- - general-git-workflow - alloydb-omni-cluster
37
- - managing-python-deps - gcp-composer-troubleshoot
38
- - alphafold-protein-analysis
39
- │ ▲
40
- │ npx @jcorpac/skill-vault │
41
- │ archive │
42
- ├──────────────────────────────►│
43
- │ npx @jcorpac/skill-vault │
44
- │ restore │
45
- │◄──────────────────────────────┤
15
+ Loading 50–250+ specialized skills into active AI prompts causes:
16
+ 1. **Context Window Saturation**: Thousands of prompt tokens consumed before a conversation starts.
17
+ 2. **Skill Bleed**: Conflicting instructions from unrelated frameworks degrade tool selection and reasoning.
18
+ 3. **Manual Friction**: Constantly enabling/disabling plugins or approving CLI searches slows down every session.
19
+
20
+ ## 💡 The Solution: Zero-Approval Background JIT Orchestration
21
+
22
+ **Skill Vault v2.0** keeps **L1 Active Context** permanently minimal (core skills only) while giving the agent **automatic, zero-approval access** to every skill stored in **L2 Cold Storage (`skill_archive/`)**:
23
+
24
+ ```text
25
+ ┌─────────────────────────────────────────────────────────────────────────┐
26
+ │ AI CODING AGENT │
27
+ │ (Google Antigravity / Claude Code / Gemini CLI / Cursor) │
28
+ └──────────────┬────────────────────────────────────────┬─────────────────┘
29
+ │ │
30
+ [1. Background Lifecycle Hooks] [2. Mid-Turn Read-Only MCP]
31
+ • SessionStart (silent sync & index) • search_skills(query)
32
+ • PreInvocation / UserPromptSubmit • load_skill(name, file?)
33
+ └─► Pre-built BM25 + Multi-Signal Router (~50–90ms, no approvals)
34
+ ├─ Unrelated prompt ──► Injects 0 tokens
35
+ ├─ High confidence ──► Inlines top 1–2 SKILL.md (<=12 KB cap)
36
+ └─ Broad / medium ──► Emits 1-line compact pointers
37
+ │ │
38
+ └───────────────────┬────────────────────┘
39
+ ▼
40
+ [L2 Cold Storage Archive]
41
+ skill_archive/search_index.json
42
+ skill_archive/backup_manifest.json
43
+ skill_archive/skills/<skill_name>/
46
44
  ```
47
45
 
48
46
  ---
49
47
 
50
48
  ## 🚀 Quickstart
51
49
 
52
- ### Option 1: Run via `npx` (Zero Installation)
53
- ```bash
54
- # Initialize a repository for skill storage
55
- npx @jcorpac/skill-vault init
50
+ ### 1. One-Command Setup (Recommended)
51
+ Install the background lifecycle hooks, read-only MCP server, and pre-built search index for your agent:
56
52
 
57
- # Search indexed skills
58
- npx @jcorpac/skill-vault search "database"
53
+ ```bash
54
+ # Auto-detect installed agents (Antigravity, Claude Code, Gemini CLI, Cursor)
55
+ npx @jcorpac/skill-vault setup
59
56
 
60
- # Verify archive integrity
61
- npx @jcorpac/skill-vault verify --fix
57
+ # Or target Antigravity explicitly (and migrate legacy nested archive if present)
58
+ npx @jcorpac/skill-vault setup --agent antigravity --migrate-archive
62
59
  ```
63
60
 
64
- ### Option 2: Install as an Agent Skill
65
- Install directly into Claude Code, Antigravity, or Cursor:
61
+ ### 2. Run Directly via Python CLI (Pure Standard Library)
66
62
  ```bash
67
- npx skills add jcorpac/skill-vault
68
- ```
63
+ # Test what the background router injects for any prompt
64
+ python scripts/skill_vault.py route "optimize slow postgres query"
69
65
 
70
- ### Option 3: Use with Python CLI (Pure Standard Library)
71
- ```bash
72
- python scripts/skill_vault.py verify
66
+ # Check routing telemetry (0-token turn %, latency, top skills)
67
+ python scripts/skill_vault.py stats
68
+
69
+ # Verify archive integrity
70
+ python scripts/skill_vault.py verify --fix
73
71
  ```
74
72
 
75
73
  ---
@@ -78,64 +76,38 @@ python scripts/skill_vault.py verify
78
76
 
79
77
  | Command | Description |
80
78
  | :--- | :--- |
81
- | `skill-vault init` | Bootstrap standard skill and archive folders in workspace. |
82
- | `skill-vault optimize` | Auto-minimize active skills to essential Core + workspace stack. |
83
- | `skill-vault optimize --dry-run` | Preview auto-minimization changes without moving files. |
84
- | `skill-vault list` | Present all active skills (L1) and archived skills (L2). |
85
- | `skill-vault status` | Fast summary of skill counts and category breakdown. |
86
- | `skill-vault list --active` | List only active skills currently loaded in context memory. |
87
- | `skill-vault list --archived` | List only cold-storage skills grouped by category. |
88
- | `skill-vault archive <name> --category "<Cat>"` | Move active skill to archive with category metadata (preserves newer L2 copies). |
89
- | `skill-vault archive <name> --force` | Force archive overwrite regardless of archive recency. |
90
- | `skill-vault archive --pattern "gcp-*"` | Archive multiple matching skills via glob pattern. |
91
- | `skill-vault recategorize <name> "<New Cat>"` | Reorganize skill category without modifying `SKILL.md`. |
92
- | `skill-vault restore <name>` | Restore an archived skill back to active availability (auto-upgrades if L2 is newer). |
93
- | `skill-vault restore <name> --force` | Force restore overwrite regardless of active recency. |
94
- | `skill-vault restore --category "<Cat>"` | Restore all skills in a specific category. |
95
- | `skill-vault search "<query>"` | Search skills across names, descriptions, and categories. |
96
- | `skill-vault reindex` | Regenerate `INDEX.md` and sync `backup_manifest.json`. |
97
- | `skill-vault sync` | Auto-scan plugins & active dirs, ingest new/updated skills, and prune non-core skills. |
98
- | `skill-vault sync --dry-run` | Preview new/updated skills to ingest without moving or deleting files. |
99
- | `skill-vault sync --keep-active` | Ingest new/updated skills into the vault while keeping all active. |
100
- | `skill-vault import <name>` | Import a skill from vault into project directory (e.g. `./skills` or `./.agents/skills`). |
101
- | `skill-vault import --category "<Cat>"` | Import all skills in a category into the current project. |
102
- | `skill-vault import --pattern "gcp-*"` | Import matching skills via glob pattern into the project. |
103
- | `skill-vault import <name> --dest <path>` | Import skill into an explicit project destination folder. |
104
- | `skill-vault import <name> --vault-dir <path>` | Import from an explicit source vault (defaults to global archive or base). |
105
- | `skill-vault import <name> --force` | Overwrite existing project skill regardless of recency. |
106
- | `skill-vault import <name> --dry-run` | Preview what would be imported without copying files. |
107
- | `skill-vault config --show` | Inspect effective core skills, stack fingerprints, and category rules. |
108
- | `skill-vault config --init` | Write `skill_archive/vault_config.json` with universal defaults for customization. |
109
- | `skill-vault config --add-core <name>` | Add a skill to protected Core Foundation Skills (or use `--remove-core`). |
110
- | `skill-vault config --add-fingerprint "<Cat>" "<pat>"` | Add a workspace file/glob fingerprint to a skill category. |
111
- | `skill-vault config --add-category-rule "<Cat>" "<kw>"` | Add a keyword rule for automatic skill categorization. |
112
- | `skill-vault config --sync-prompt` | Dynamically update `SKILL.md`'s router description with your vault's categories. |
113
- | `skill-vault verify` | Audit bi-directional consistency across disk, manifest, and index. |
114
- | `skill-vault verify --fix` | Audit and automatically self-heal all detected discrepancies. |
79
+ | `skill-vault setup` | Install background hooks, read-only MCP server, and plugin bundle (`--agent`, `--scope`, `--migrate-archive`, `--dry-run`). |
80
+ | `skill-vault route "<prompt>"` | Dry-run the JIT router and inspect BM25 scores, tiers (`INLINE`/`POINTER`), and estimated token budget. |
81
+ | `skill-vault stats` | Summarize local routing telemetry (`0`-token turn %, avg/p95 latency, top matched skills). |
82
+ | `skill-vault search "<query>"` | Multi-term BM25 search across skill names, tags, descriptions, headings, and body identifiers. |
83
+ | `skill-vault sync` | Scan plugins & active dirs, ingest updates, prune non-core skills (automatically protecting hook/MCP dependencies). |
84
+ | `skill-vault recategorize --auto` | Re-classify `"General & Utility Skills"` using expanded domain rules. |
85
+ | `skill-vault dedupe` | Consolidate hyphen/underscore duplicate skills in L2 while keeping the newest version. |
86
+ | `skill-vault list` / `status` | Present active (L1) and archived (L2) skills and category counts. |
87
+ | `skill-vault archive` / `restore` | Move specific skills or categories between L1 and L2 (recency-aware). |
88
+ | `skill-vault import <name>` | Copy vaulted skills into a project's `.agents/skills` or `skills/` directory. |
89
+ | `skill-vault optimize` | Prune/mount active skills using workspace file fingerprints. |
90
+ | `skill-vault config` | Inspect or customize core skills, fingerprints, category rules, and `--set-routing` thresholds. |
91
+ | `skill-vault reindex` / `verify` | Rebuild `INDEX.md` + `search_index.json` and audit archive integrity. |
92
+ | `skill-vault uninstall` | Safely restore all archived skills to L1 and remove Skill Vault wiring & files (`eject` alias). |
115
93
 
116
94
  ---
117
95
 
118
96
  ## 🎯 Key Design Principles
119
97
 
120
- 1. **`SKILL.md` Purity**: `SKILL.md` files are immutable instructions. Categories and routing metadata are stored strictly in `backup_manifest.json` and rendered in `INDEX.md`.
121
- 2. **Environment Agnostic**: Dynamically resolves workspace roots via CLI flags (`--base-dir`), environment variables (`$SKILL_VAULT_BASE`), script parents, or working directories.
122
- 3. **Zero Runtime Dependencies**: The core engine requires only Python 3 standard library (`os`, `sys`, `json`, `re`, `shutil`, `hashlib`, `argparse`, `pathlib`).
123
- 4. **Self-Healing Integrity**: Detects orphaned folders, phantom manifest entries, broken markdown links, and duplicate aliases.
124
- 5. **Recency & Version Prioritization**: Automatically protects newer versions when archiving, restoring, or optimizing by evaluating semantic version tags (`version:`) with filesystem timestamp (`mtime`) fallbacks. Use `--force` to override.
125
- 6. **Universal Cross-Ecosystem Stack Detection**: Includes built-in workspace fingerprinting and category inference across Frontend, Backend, Cloud/DevOps, Databases, Mobile, AI/ML, Testing/Security, Data Engineering, and Science — fully extensible via `vault_config.json` and `SKILL.md` frontmatter (`core: true`, `category:`).
126
- 7. **Dynamic Router Prompt Syncing**: `reindex` and `config --sync-prompt` automatically keep `skill-vault`'s `SKILL.md` frontmatter description synchronized with the exact skills and categories in the user's own vault.
98
+ 1. **Zero Context Bloat by Default**: Generic prompts (`"Refactor this function"`, `"Write a git commit message"`) inject **0 tokens**. Same-turn tool-call loops short-circuit automatically, and already-injected skills never re-inject in the same conversation.
99
+ 2. **Zero-Approval Background Execution**: Hooks run natively in the agent lifecycle before the model is called; mid-turn fallback uses a 2-tool read-only MCP server (`search_skills`, `load_skill`) with strict directory-containment guards.
100
+ 3. **`SKILL.md` Purity**: `SKILL.md` files are never modified during indexing or categorization.
101
+ 4. **Hook-Dependency Safety**: `sync`, `optimize`, and `archive` inspect sibling `hooks.json` and `mcp_config.json` files so plugin-referenced skill scripts are never accidentally pruned.
102
+ 5. **Zero Runtime Dependencies**: Pure Python 3.10+ standard library across Windows, macOS, and Linux.
127
103
 
128
104
  ---
129
105
 
130
106
  ## 🧪 Running the Test Suite
131
107
 
132
- Skill Vault includes a comprehensive, sandboxed test harness:
133
-
134
108
  ```bash
135
- # Run unit tests
136
109
  python -m unittest discover -s tests -v
137
-
138
- # Or via npm
110
+ # Or via npm:
139
111
  npm test
140
112
  ```
141
113
 
package/SKILL.md CHANGED
@@ -1,224 +1,60 @@
1
1
  ---
2
2
  name: skill-vault
3
- version: 1.7.0
3
+ version: 2.0.0
4
4
  description: >-
5
- Universal agent-agnostic skill router, lifecycle manager, and tiered storage engine for AI coding agents.
6
- ALWAYS use this skill whenever a task involves specialized domain skills, frameworks, or tools not currently loaded in active context memory (L1), or when managing skill context bloat.
7
- Search cold storage (L2) on demand via 'python scripts/skill_vault.py search "<keyword>"', view 'skill_archive/INDEX.md', or dynamically mount skills via 'restore', 'import', or 'optimize'.
5
+ Universal agent-agnostic skill router and tiered storage manager.
6
+ Background hooks automatically inject relevant vaulted skills on demand;
7
+ use MCP tools search_skills/load_skill for mid-turn lookups.
8
8
  ---
9
9
 
10
- # Skill Vault: Universal Agent Skill Lifecycle & Storage Manager
10
+ # Skill Vault: Automatic Skill Router & Cold-Storage Manager
11
11
 
12
- ## Overview
13
- **Skill Vault** provides an **agent-agnostic**, **environment-agnostic**, and **OS-agnostic** framework for:
14
- 1. **Tiered Context Optimization**: Managing active skills (L1 context memory) and cold-storage archives (L2 disk storage) to eliminate "skill bleed" and prompt token waste.
15
- 2. **Dynamic Skill Routing**: Discovering, querying, and dynamically executing specialized domain skills across active and archived repositories.
16
- 3. **Decoupled Categorization**: Organizing skills via manifest metadata without modifying `SKILL.md` files.
17
- 4. **Bi-Directional Integrity Auditing**: Verifying and self-healing consistency across disk folders, `backup_manifest.json`, and `INDEX.md`.
12
+ **Skill Vault** keeps active L1 context minimal (core skills only) while preserving instant, zero-approval access to all vaulted L2 domain skills:
18
13
 
19
- ---
20
-
21
- ## 1. Skill Discovery & Execution Protocol (Agent-Agnostic)
22
-
23
- Whenever a user request requires specialized domain knowledge:
24
-
25
- 1. **Locate Target Skill**:
26
- - Check active skill locations (`skills/`, `.agents/skills/`, `.claude/skills/`, `plugins/*/skills/`).
27
- - If missing from active locations, search the central archive manifest via CLI:
28
- ```bash
29
- python scripts/skill_vault.py search "<keyword or topic>"
30
- ```
31
- or consult `skill_archive/INDEX.md` / `skill_archive/backup_manifest.json`.
32
-
33
- 2. **Execute Based on Environment Capabilities**:
34
- - **Multi-Agent / Delegation Supported** (e.g., Antigravity `invoke_subagent`, Claude Code subagent):
35
- Spawn a subagent instructed to view the target `SKILL.md` and execute the task.
36
- - **Single-Agent CLI / Standalone Mode**:
37
- Use native file-reading tools to load the target `SKILL.md` directly into main context.
14
+ 1. **Background Lifecycle Hooks (Primary Path)**:
15
+ - `SessionStart` incrementally syncs newly installed/updated plugin skills, refreshes `search_index.json`, and warms workspace stack fingerprints.
16
+ - `PreInvocation` / `UserPromptSubmit` / `BeforeAgent` scores the user prompt via a pre-built BM25 + multi-signal index (`<100ms`), injects top high-confidence skills or compact pointers directly from L2, and injects **0 tokens** on unrelated turns.
17
+ 2. **Read-Only MCP Fallback (Mid-Turn Discovery)**:
18
+ - If a task pivots mid-turn to a specialized domain not present in context, call the `skill-vault` MCP tools:
19
+ - `search_skills(query, category?, limit?)` — Search vaulted L2 skills by keyword, intent, or list categories.
20
+ - `load_skill(name, file?)` — Read a vaulted skill's `SKILL.md` or any companion file (`references/`, `scripts/`, `examples/`).
21
+ - Never mutate L1 active directories or run shell commands solely to browse archived skills when MCP tools are available.
38
22
 
39
23
  ---
40
24
 
41
- ## 2. Skill Lifecycle Management Operations (Automated via CLI)
25
+ ## CLI Operations (`skill-vault` / `npx @jcorpac/skill-vault`)
42
26
 
43
- All lifecycle operations are executed via the portable Python CLI `scripts/skill_vault.py`.
44
-
45
- > [!NOTE]
46
- > `SKILL.md` files are **never modified** when categorizing or archiving. Categories are strictly routing metadata stored inside `backup_manifest.json` and presented in `INDEX.md`.
47
-
48
- ### A. Archiving Skills (LLM-Driven Categorization)
49
- When asked to archive an active skill into cold storage:
50
- 1. Read the skill's `SKILL.md` to understand its domain.
51
- 2. Select a concise, human-readable category fitting the user's workspace (e.g. `"Cloud Infrastructure"`, `"Data Engineering"`, `"Mobile Development"`, `"Bioinformatics"`).
52
- 3. Run the archive command with `--category`:
53
27
  ```bash
54
- # Archive a single skill with category
55
- python scripts/skill_vault.py archive <skill_name> --category "<Category Name>"
28
+ # Install background hooks, read-only MCP server, and plugin bundle
29
+ skill-vault setup --agent auto --scope global
56
30
 
57
- # Archive multiple skills matching a pattern
58
- python scripts/skill_vault.py archive --pattern "gcp-*" --category "GCP & Data Engineering"
31
+ # Dry-run JIT router scoring, tiers, and estimated token usage for a prompt
32
+ skill-vault route "<prompt>" [--workspace <path>] [--mode hybrid|inline|pointer]
59
33
 
60
- # Archive while keeping the active folder intact
61
- python scripts/skill_vault.py archive <skill_name> --category "<Category Name>" --keep-active
62
- ```
34
+ # Search archived skills using the BM25 index
35
+ skill-vault search "<query>" [--category "<Category>"] [--limit 10]
63
36
 
64
- ### B. Recategorizing Skills
65
- To reorganize existing archived skills without touching `SKILL.md`:
66
- ```bash
67
- python scripts/skill_vault.py recategorize <skill_name> "<New Category Name>"
68
- ```
69
-
70
- ### C. Unarchiving / Restoring Skills
71
- To restore archived skills back to active availability:
72
- ```bash
73
- # Restore a specific skill
74
- python scripts/skill_vault.py restore <skill_name>
75
-
76
- # Restore all skills in a category
77
- python scripts/skill_vault.py restore --category "GCP & Data Engineering"
37
+ # Inspect background routing telemetry (0-token turn rate, latency, top skills)
38
+ skill-vault stats [--limit 100]
78
39
 
79
- # Restore all archived skills
80
- python scripts/skill_vault.py restore --all
81
- ```
40
+ # Scan plugins/active directories, ingest updates, and prune non-core skills (respects hook dependencies)
41
+ skill-vault sync [--dry-run] [--keep-active]
82
42
 
83
- ### D. Reindexing & Manifest Refresh
84
- To rebuild `INDEX.md` and ensure all paths and category sections are synchronized:
85
- ```bash
86
- python scripts/skill_vault.py reindex
87
- ```
43
+ # Re-classify 'General & Utility Skills' using built-in + custom rules
44
+ skill-vault recategorize --auto [--dry-run]
88
45
 
89
- ### E. Presenting Skills & Tier Status
90
- To get a rapid overview of what skills are currently in active context memory (L1) vs. cold storage (L2):
91
- ```bash
92
- # Full overview of active and archived skills
93
- python scripts/skill_vault.py list
46
+ # Consolidate hyphen/underscore duplicate skills in L2 (keeps newest version)
47
+ skill-vault dedupe [--dry-run]
94
48
 
95
- # Quick breakdown of counts and categories
96
- python scripts/skill_vault.py status
97
-
98
- # List only active skills in context
99
- python scripts/skill_vault.py list --active
100
-
101
- # List archived skills in a specific category
102
- python scripts/skill_vault.py list --archived --category "Cloud SQL"
103
-
104
- # Output structured JSON (for scripts/dashboards)
105
- python scripts/skill_vault.py list --json
106
- ```
107
-
108
- ### F. Skill Discovery & Keyword Search
109
- ```bash
110
- python scripts/skill_vault.py search "<keyword>"
111
- ```
112
-
113
- ### G. Archive Integrity Audit & Self-Healing
114
- To confirm bi-directional consistency across disk folders, `backup_manifest.json`, and `INDEX.md`:
115
- ```bash
116
- # Run integrity verification audit
117
- python scripts/skill_vault.py verify
118
-
119
- # Run audit and automatically fix any detected discrepancies
120
- python scripts/skill_vault.py verify --fix
121
- ```
122
-
123
- ### H. Automated Context Optimization (Zero-Effort Pruning & Mounting)
124
- To automatically keep only the minimum necessary skills active in context memory (L1) based on workspace fingerprints, while parking unneeded skills in cold storage (L2):
125
- ```bash
126
- # Automatically optimize active skills for the current workspace
127
- python scripts/skill_vault.py optimize
128
-
129
- # Preview what would be archived and mounted without moving files
130
- python scripts/skill_vault.py optimize --dry-run
131
-
132
- # Optimize for a specific workspace folder and protect custom skills
133
- python scripts/skill_vault.py optimize --workspace "./my-repo" --protect my-custom-skill
134
- ```
49
+ # Inspect or tune routing thresholds & core skills
50
+ skill-vault config --show
51
+ skill-vault config --set-routing mode hybrid
52
+ skill-vault config --set-routing show_ui_notice true
135
53
 
136
- ### I. Recency & Version Prioritization Protocol
137
- Skill Vault automatically protects newer skills and prevents regressions when archiving, restoring, or optimizing:
138
- 1. **Semantic Version Check**: Compares `version:` headers in `SKILL.md` frontmatter (e.g., `v2` > `v1`, `1.2.0` > `1.1.0`).
139
- 2. **Timestamp Recency Fallback**: If versions match or are unversioned, compares the newest file modification timestamp (`mtime`).
140
- 3. **Tier Behavior**:
141
- - **`archive`**: When L1 is newer or equal to L2, updates L2 with the active version. If L2 is strictly newer, preserves L2 to avoid overwriting with stale files.
142
- - **`restore`**: When L2 is strictly newer than L1, upgrades active L1 with the newer vault copy. If L1 is newer or equal, preserves L1.
143
- - **`optimize`**: Automatically detects and upgrades active L1 skills if newer versions exist in the vault, while archiving unneeded skills safely.
144
- - **`--force`**: Bypasses recency checks on `archive`, `restore`, or `optimize` when an intentional overwrite is required.
145
-
146
- ### J. Project-Level Skill Importing
147
- To import skills from a global vault (e.g., `~/.gemini/config/skill_archive` or `$SKILL_VAULT_BASE`) into a project workspace on demand:
148
- ```bash
149
- # Import a specific skill into the current project (defaults to ./skills or ./.agents/skills)
150
- python scripts/skill_vault.py import <skill_name>
151
-
152
- # Import all skills in a category into the current project
153
- python scripts/skill_vault.py import --category "BigQuery & Data Warehouse"
154
-
155
- # Import matching skills via glob pattern
156
- python scripts/skill_vault.py import --pattern "gcp-*"
157
-
158
- # Import into an explicit project destination
159
- python scripts/skill_vault.py import <skill_name> --dest "./.agents/skills"
160
-
161
- # Preview what would be imported without copying
162
- python scripts/skill_vault.py import <skill_name> --dry-run
163
-
164
- # Force overwrite of project skill if already present
165
- python scripts/skill_vault.py import <skill_name> --force
166
- ```
167
-
168
- ### K. Automated Plugin Ingestion & Syncing (`sync`)
169
- Whenever plugins are installed or updated, use `sync` to scan all active locations and plugins, ingest new/updated skills into the vault, protect the Core Foundation Skills, and prune non-core skills:
170
- ```bash
171
- # Scan plugins and active skills, ingest new/updated skills, and prune non-core active skills
172
- python scripts/skill_vault.py sync
173
-
174
- # Preview what would be ingested and pruned without moving or deleting files
175
- python scripts/skill_vault.py sync --dry-run
176
-
177
- # Ingest new/updated skills into the vault while keeping all active
178
- python scripts/skill_vault.py sync --keep-active
179
- ```
180
-
181
- ### L. Universal Stack Customization & Dynamic Router Sync (`config`)
182
- Skill Vault supports cross-ecosystem workspace fingerprinting and auto-categorization out of the box (Frontend, Backend, Cloud/DevOps, Databases, Mobile, AI/ML, Testing/Security, Data Engineering, and Science), and can be customized per user or repository via `skill_archive/vault_config.json` or `SKILL.md` frontmatter tags:
183
-
184
- ```bash
185
- # Inspect active core skills, stack fingerprints, and category rules
186
- python scripts/skill_vault.py config --show
187
-
188
- # Initialize skill_archive/vault_config.json with universal defaults
189
- python scripts/skill_vault.py config --init
190
-
191
- # Protect or unprotect specific core foundation skills from auto-archiving/pruning
192
- python scripts/skill_vault.py config --add-core <skill_name>
193
- python scripts/skill_vault.py config --remove-core <skill_name>
194
-
195
- # Add custom workspace file/glob fingerprints and category keyword rules
196
- python scripts/skill_vault.py config --add-fingerprint "<Category>" "<pattern>"
197
- python scripts/skill_vault.py config --add-category-rule "<Category>" "<keyword>"
198
-
199
- # Dynamically update SKILL.md's router description with currently indexed categories
200
- python scripts/skill_vault.py config --sync-prompt
201
- ```
202
-
203
- Any individual skill's `SKILL.md` frontmatter can also declare:
204
- - `core: true` (or `pinned: true` / `always_active: true`) to automatically protect that skill during `sync` and `optimize`.
205
- - `category: "<Category>"` to pin its vault category without needing `--category` flags.
206
-
207
- ---
208
-
209
- ## 3. Environment & OS Compatibility Guidelines
210
-
211
- - **Base Directory**: Auto-discovers the workspace root relative to the script location, current working directory, or via `--base-dir <path>` / `$SKILL_VAULT_BASE`.
212
- - **Portable Relative Links**: `INDEX.md` and `backup_manifest.json` use relative paths, allowing the skill repository to be committed to Git or shared across environments seamlessly.
213
- - **Pure Python**: Requires only Python 3 standard library (`os`, `sys`, `json`, `re`, `shutil`, `hashlib`, `argparse`, `pathlib`).
214
-
215
- ---
216
-
217
- ## 4. Automated Testing Harness
218
-
219
- A sandboxed test suite is located in `tests/test_skill_vault.py` to prevent regressions whenever changes are made:
220
-
221
- ```bash
222
- # Run test suite
223
- python -m unittest discover -s tests -v
54
+ # Archive, restore, import, verify, or cleanly uninstall
55
+ skill-vault archive <name> --category "<Category>"
56
+ skill-vault restore <name>
57
+ skill-vault import <name> --dest "./.agents/skills"
58
+ skill-vault verify --fix
59
+ skill-vault uninstall [--dry-run]
224
60
  ```
package/bin/hook.js ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Cross-platform fail-safe launcher for Skill Vault lifecycle hooks (scripts/hook_runner.py).
5
+ */
6
+
7
+ const { spawn } = require('child_process');
8
+ const path = require('path');
9
+
10
+ const scriptPath = path.join(__dirname, '..', 'scripts', 'hook_runner.py');
11
+ const candidates = process.platform === 'win32' ? ['python', 'py'] : ['python3', 'python'];
12
+ const extraArgs = process.argv.slice(2);
13
+
14
+ function runWith(idx) {
15
+ if (idx >= candidates.length) {
16
+ process.stdout.write('{}\n');
17
+ process.exit(0);
18
+ }
19
+ const cmd = candidates[idx];
20
+ const cmdArgs = cmd === 'py' ? ['-3', scriptPath, ...extraArgs] : [scriptPath, ...extraArgs];
21
+ const child = spawn(cmd, cmdArgs, { stdio: 'inherit' });
22
+
23
+ child.on('error', (err) => {
24
+ if (err && err.code === 'ENOENT') {
25
+ runWith(idx + 1);
26
+ return;
27
+ }
28
+ process.stdout.write('{}\n');
29
+ process.exit(0);
30
+ });
31
+
32
+ child.on('exit', (code) => {
33
+ process.exit(code ?? 0);
34
+ });
35
+ }
36
+
37
+ runWith(0);
package/bin/mcp.js ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Cross-platform stdio launcher for Skill Vault read-only MCP server (scripts/mcp_server.py).
5
+ */
6
+
7
+ const { spawn } = require('child_process');
8
+ const path = require('path');
9
+
10
+ const scriptPath = path.join(__dirname, '..', 'scripts', 'mcp_server.py');
11
+ const candidates = process.platform === 'win32' ? ['python', 'py'] : ['python3', 'python'];
12
+ const extraArgs = process.argv.slice(2);
13
+
14
+ function runWith(idx) {
15
+ if (idx >= candidates.length) {
16
+ console.error('[Skill Vault MCP Error] Python 3 was not found on PATH.');
17
+ process.exit(1);
18
+ }
19
+ const cmd = candidates[idx];
20
+ const cmdArgs = cmd === 'py' ? ['-3', scriptPath, ...extraArgs] : [scriptPath, ...extraArgs];
21
+ const child = spawn(cmd, cmdArgs, { stdio: 'inherit' });
22
+
23
+ child.on('error', (err) => {
24
+ if (err && err.code === 'ENOENT') {
25
+ runWith(idx + 1);
26
+ return;
27
+ }
28
+ console.error(`[Skill Vault MCP Error] ${err.message}`);
29
+ process.exit(1);
30
+ });
31
+
32
+ child.on('exit', (code) => {
33
+ process.exit(code ?? 0);
34
+ });
35
+ }
36
+
37
+ runWith(0);
package/hooks.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "skill-vault-session-sync": {
3
+ "SessionStart": [
4
+ {
5
+ "type": "command",
6
+ "command": "node bin/hook.js --harness antigravity --event SessionStart",
7
+ "timeout": 30
8
+ }
9
+ ]
10
+ },
11
+ "skill-vault-jit-router": {
12
+ "PreInvocation": [
13
+ {
14
+ "type": "command",
15
+ "command": "node bin/hook.js --harness antigravity --event PreInvocation",
16
+ "timeout": 10
17
+ }
18
+ ]
19
+ }
20
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "mcpServers": {
3
+ "skill-vault": {
4
+ "command": "node",
5
+ "type": "stdio",
6
+ "args": ["bin/mcp.js"]
7
+ }
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jcorpac/skill-vault",
3
- "version": "1.7.0",
4
- "description": "Universal Agent Skill Router, Lifecycle Manager, and Tiered Storage Engine for AI Coding Agents.",
3
+ "version": "2.0.0",
4
+ "description": "Automatic Background Skill Router, Lifecycle Manager & Tiered Storage Engine for AI Coding Agents.",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {
7
7
  "skill-vault": "bin/cli.js",
@@ -9,7 +9,10 @@
9
9
  },
10
10
  "files": [
11
11
  "bin/",
12
- "scripts/skill_vault.py",
12
+ "scripts/*.py",
13
+ "plugin.json",
14
+ "hooks.json",
15
+ "mcp_config.json",
13
16
  "SKILL.md",
14
17
  "README.md",
15
18
  "LICENSE"
@@ -23,9 +26,11 @@
23
26
  "ai-agents",
24
27
  "antigravity",
25
28
  "claude-code",
29
+ "gemini-cli",
26
30
  "cursor",
27
31
  "skill-router",
28
32
  "skill-vault",
33
+ "mcp",
29
34
  "context-optimization",
30
35
  "llm-tools"
31
36
  ],
package/plugin.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "skill-vault",
3
+ "displayName": "Skill Vault",
4
+ "version": "2.0.0",
5
+ "description": "Automatic background skill router, cold-storage archive, and read-only JIT MCP server for AI coding agents.",
6
+ "author": "jcorpac",
7
+ "homepage": "https://github.com/jcorpac/skill-vault#readme",
8
+ "repository": "https://github.com/jcorpac/skill-vault",
9
+ "license": "MIT"
10
+ }