@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 +67 -95
- package/SKILL.md +39 -203
- package/bin/hook.js +37 -0
- package/bin/mcp.js +37 -0
- package/hooks.json +20 -0
- package/mcp_config.json +9 -0
- package/package.json +8 -3
- package/plugin.json +10 -0
- package/scripts/hook_runner.py +488 -0
- package/scripts/mcp_server.py +473 -0
- package/scripts/skill_router.py +1159 -0
- package/scripts/skill_vault.py +1439 -97
package/README.md
CHANGED
|
@@ -1,75 +1,73 @@
|
|
|
1
1
|
# Skill Vault 🛡️
|
|
2
2
|
|
|
3
|
-
[](https://github.com/
|
|
3
|
+
[](https://github.com/jcorp/skill-vault/actions)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
[](https://www.npmjs.com/package/@jcorpac/skill-vault)
|
|
6
6
|
[](SKILL.md)
|
|
7
7
|
|
|
8
|
-
> **
|
|
9
|
-
> Works across **Google Antigravity, Claude Code,
|
|
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
|
-
|
|
16
|
-
1. **Context Window Saturation**: Thousands of prompt tokens consumed before
|
|
17
|
-
2. **Skill Bleed**:
|
|
18
|
-
3. **
|
|
19
|
-
|
|
20
|
-
## 💡 The Solution:
|
|
21
|
-
|
|
22
|
-
**Skill Vault**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
│
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
###
|
|
53
|
-
|
|
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
|
-
|
|
58
|
-
|
|
53
|
+
```bash
|
|
54
|
+
# Auto-detect installed agents (Antigravity, Claude Code, Gemini CLI, Cursor)
|
|
55
|
+
npx @jcorpac/skill-vault setup
|
|
59
56
|
|
|
60
|
-
#
|
|
61
|
-
npx @jcorpac/skill-vault
|
|
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
|
-
###
|
|
65
|
-
Install directly into Claude Code, Antigravity, or Cursor:
|
|
61
|
+
### 2. Run Directly via Python CLI (Pure Standard Library)
|
|
66
62
|
```bash
|
|
67
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
|
82
|
-
| `skill-vault
|
|
83
|
-
| `skill-vault
|
|
84
|
-
| `skill-vault
|
|
85
|
-
| `skill-vault
|
|
86
|
-
| `skill-vault
|
|
87
|
-
| `skill-vault
|
|
88
|
-
| `skill-vault
|
|
89
|
-
| `skill-vault archive
|
|
90
|
-
| `skill-vault
|
|
91
|
-
| `skill-vault
|
|
92
|
-
| `skill-vault
|
|
93
|
-
| `skill-vault
|
|
94
|
-
| `skill-vault
|
|
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.
|
|
121
|
-
2. **
|
|
122
|
-
3.
|
|
123
|
-
4. **
|
|
124
|
-
5. **
|
|
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:
|
|
3
|
+
version: 2.0.0
|
|
4
4
|
description: >-
|
|
5
|
-
Universal agent-agnostic skill router
|
|
6
|
-
|
|
7
|
-
|
|
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:
|
|
10
|
+
# Skill Vault: Automatic Skill Router & Cold-Storage Manager
|
|
11
11
|
|
|
12
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
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
|
-
##
|
|
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
|
-
#
|
|
55
|
-
|
|
28
|
+
# Install background hooks, read-only MCP server, and plugin bundle
|
|
29
|
+
skill-vault setup --agent auto --scope global
|
|
56
30
|
|
|
57
|
-
#
|
|
58
|
-
|
|
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
|
-
#
|
|
61
|
-
|
|
62
|
-
```
|
|
34
|
+
# Search archived skills using the BM25 index
|
|
35
|
+
skill-vault search "<query>" [--category "<Category>"] [--limit 10]
|
|
63
36
|
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
#
|
|
80
|
-
|
|
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
|
-
|
|
84
|
-
|
|
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
|
-
|
|
90
|
-
|
|
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
|
-
#
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
+
}
|
package/mcp_config.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jcorpac/skill-vault",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
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
|
|
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
|
+
}
|