@weavetab/skills 1.0.1 → 2.5.0-beta.4
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 +108 -50
- package/ROUTER.md +43 -0
- package/bin/cli.js +232 -132
- package/browser/dom-strategy.md +119 -0
- package/browser/form-automation.md +87 -0
- package/browser/interaction-pipeline.md +216 -0
- package/browser/tab-and-window.md +136 -0
- package/desktop/desktop-targeting.md +85 -0
- package/desktop/electron-discovery.md +115 -0
- package/developer/github-forensics.md +74 -0
- package/dist/bundled/weavetab-all.md +1905 -0
- package/dist/bundled/weavetab-browser.md +501 -0
- package/dist/bundled/weavetab-desktop.md +176 -0
- package/dist/bundled/weavetab-developer.md +67 -0
- package/dist/bundled/weavetab-documents.md +142 -0
- package/dist/bundled/weavetab-memory.md +359 -0
- package/dist/bundled/weavetab-network-and-perf.md +223 -0
- package/dist/bundled/weavetab-plugins.md +78 -0
- package/dist/bundled/weavetab-resilience.md +216 -0
- package/dist/bundled/weavetab-security.md +87 -0
- package/dist/granular/browser_dom-strategy.md +119 -0
- package/dist/granular/browser_form-automation.md +87 -0
- package/dist/granular/browser_interaction-pipeline.md +216 -0
- package/dist/granular/browser_tab-and-window.md +136 -0
- package/dist/granular/desktop_desktop-targeting.md +85 -0
- package/dist/granular/desktop_electron-discovery.md +115 -0
- package/dist/granular/developer_github-forensics.md +74 -0
- package/dist/granular/documents_canvas-and-visual-capture.md +103 -0
- package/dist/granular/documents_office-document-ingestion.md +63 -0
- package/dist/granular/memory_selector-memory-system.md +127 -0
- package/dist/granular/memory_session-trail.md +95 -0
- package/dist/granular/memory_site-learning.md +180 -0
- package/dist/granular/network-and-perf_device-and-environment.md +87 -0
- package/dist/granular/network-and-perf_network-intercept-and-mock.md +84 -0
- package/dist/granular/network-and-perf_performance-and-vitals.md +84 -0
- package/dist/granular/plugins_hooks-and-overrides.md +36 -0
- package/dist/granular/plugins_plugin-runtime.md +60 -0
- package/dist/granular/resilience_loop-breaker.md +67 -0
- package/dist/granular/resilience_session-time-travel.md +131 -0
- package/dist/granular/resilience_stale-ref-recovery.md +53 -0
- package/dist/granular/security_rbac-and-policies.md +47 -0
- package/dist/granular/security_secret-containment-protocol.md +59 -0
- package/documents/canvas-and-visual-capture.md +103 -0
- package/documents/office-document-ingestion.md +63 -0
- package/evals/evaluator.js +146 -0
- package/evals/scenarios.json +238 -0
- package/memory/selector-memory-system.md +127 -0
- package/memory/session-trail.md +95 -0
- package/memory/site-learning.md +180 -0
- package/network-and-perf/device-and-environment.md +87 -0
- package/network-and-perf/network-intercept-and-mock.md +84 -0
- package/network-and-perf/performance-and-vitals.md +84 -0
- package/package.json +73 -42
- package/plugins/hooks-and-overrides.md +36 -0
- package/plugins/plugin-runtime.md +60 -0
- package/resilience/loop-breaker.md +67 -0
- package/resilience/session-time-travel.md +131 -0
- package/resilience/stale-ref-recovery.md +53 -0
- package/security/rbac-and-policies.md +47 -0
- package/security/secret-containment-protocol.md +59 -0
- package/skills.json +431 -308
- package/src/api.js +239 -128
- package/.github/FUNDING.yml +0 -2
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
- package/.github/ISSUE_TEMPLATE/skill_request.md +0 -24
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -23
- package/CONTRIBUTING.md +0 -34
- package/SECURITY.md +0 -26
- package/advanced/README.md +0 -2
- package/automation/README.md +0 -2
- package/general/captcha-evasion.md +0 -13
- package/general/context-awareness.md +0 -13
- package/general/cookie-consent.md +0 -13
- package/general/data-extraction.md +0 -13
- package/general/dynamic-interaction.md +0 -13
- package/general/error-recovery.md +0 -13
- package/general/file-upload.md +0 -13
- package/general/form-filling.md +0 -16
- package/general/guardrails.md +0 -13
- package/general/iframe-handling.md +0 -13
- package/general/infinite-scroll.md +0 -13
- package/general/login-flow.md +0 -16
- package/general/multi-tab-management.md +0 -13
- package/general/spa-navigation.md +0 -13
- package/general/table-scraping.md +0 -13
- package/scripts/build.js +0 -48
package/README.md
CHANGED
|
@@ -1,50 +1,108 @@
|
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
# Weavetab MCP Skills (`@weavetab/skills`)
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@weavetab/skills)
|
|
4
|
+
[](https://github.com/Weavetab/skills)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
Enterprise domain-driven agent intelligence for `@weavetab/mcp` (v2.5.0-beta.4). Drop-in operational guides, failure recovery heuristics, and protocol rules for **Antigravity**, **Cursor**, **Cline**, **Windsurf**, and **OpenClaw**.
|
|
8
|
+
|
|
9
|
+
- **Website:** [weavetab.pages.dev](https://weavetab.pages.dev)
|
|
10
|
+
- **Core MCP Server:** [`@weavetab/mcp`](https://www.npmjs.com/package/@weavetab/mcp)
|
|
11
|
+
- **Plugin SDK:** [`@weavetab/sdk`](https://www.npmjs.com/package/@weavetab/sdk)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 1. Architectural Philosophy: The Step-0 Router
|
|
16
|
+
|
|
17
|
+
Rather than forcing LLMs to read dozens of flat files or guess between vague difficulty tiers, `@weavetab/skills` provides a deterministic Step-0 decision engine via [`ROUTER.md`](ROUTER.md).
|
|
18
|
+
|
|
19
|
+
Agents classify their immediate intent in one turn and jump directly to the target domain guide:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
@weavetab/skills/
|
|
23
|
+
├── ROUTER.md # Universal Intent Decision Matrix (Step-0)
|
|
24
|
+
├── browser/ # Web & Chromium DOM Navigation Engine
|
|
25
|
+
├── desktop/ # Native Desktop & Electron Application Automation
|
|
26
|
+
├── memory/ # Cross-Session Adaptive Selector Learning & History
|
|
27
|
+
├── resilience/ # Time-Travel Checkpoints, Stale Refs, Loops & Captchas
|
|
28
|
+
├── security/ # Zero-Leak Secret Containment & RBAC Guardrails
|
|
29
|
+
├── plugins/ # Dynamic Extension Loading, Hooks & Custom Tools
|
|
30
|
+
├── network-and-perf/ # TLS Forensics, Interception, Core Web Vitals & Emulation
|
|
31
|
+
├── documents/ # Word, Excel, CSV, PDF & Canvas Ingestion
|
|
32
|
+
├── developer/ # GitHub Local Clone & API Repository Forensics
|
|
33
|
+
├── evals/ # Executable Agent Evaluation & Benchmark Harness
|
|
34
|
+
├── dist/ # Compiled targets (granular + bundled domain profiles)
|
|
35
|
+
├── bin/cli.js # Interactive Multi-Agent Installer
|
|
36
|
+
└── src/api.js # Programmatic Framework Generator & Adapter Engine
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 2. The 9 Operational Domains & 44-Tool Matrix
|
|
42
|
+
|
|
43
|
+
Every single one of the **44 official tools** in `@weavetab/mcp` is documented with verified parameters and runtime patterns:
|
|
44
|
+
|
|
45
|
+
| Domain | Primary Tools | Operational Capabilities |
|
|
46
|
+
| :--- | :--- | :--- |
|
|
47
|
+
| **`browser/`** | `browser_map`, `browser_find`, `browser_click`, `browser_type`, `browser_fill`, `browser_key`, `browser_pointer`, `browser_upload`, `browser_tabs`, `browser_scroll`, `browser_dialog`, `browser_burst`, `browser_highlight`, `browser_clipboard` | Token-conserving DOM walks (`lite: true`), volatile `w:NN` handles, atomic multi-field inputs, OS file upload bypass. |
|
|
48
|
+
| **`desktop/`** | `browser_detect`, any tool with `app` argument | Zero-terminal scanning for Slack, Discord, VS Code, Notion, Obsidian; routing actions directly to native Electron windows. |
|
|
49
|
+
| **`memory/`** | `browser_pattern_learn`, `browser_thoughts`, `browser_automation`, `browser_recording` | Cross-session origin selector decay, compiling manual interaction trails into deterministic macros via `browser_burst`. |
|
|
50
|
+
| **`resilience/`**| `browser_checkpoint`, `browser_cookies`, `browser_storage`, `browser_captcha` | Time-travel state snapshots (`save`, `restore`) for instant rollbacks, 4-tier SPA stale ref healing, loop breaker (`browser_map`, `browser_wait`). |
|
|
51
|
+
| **`security/`** | `browser_type_secret`, RBAC tiers | Hardware-grade zero-bleed guarantee (passwords masked in HUD, CDP logs, and conversation transcripts). |
|
|
52
|
+
| **`plugins/`** | `list_plugins`, `load_plugin` | Runtime discovery and dynamic loading of verified npm community plugins into the active MCP session. |
|
|
53
|
+
| **`network-and-perf/`** | `browser_network_intercept`, `browser_performance`, `browser_wait`, `browser_emulate` | API mocking, TLS certificate chain audits, Core Web Vitals (LCP/CLS), device presets & 3G throttling. |
|
|
54
|
+
| **`documents/`**| `browser_office`, `browser_pdf`, `browser_canvas`, `browser_screenshot`, `browser_viewport`, `browser_extract_design` | Ingesting Excel spreadsheets, Word `.docx`, and CSVs into structured JSON; full-page screenshots and canvas inspection. |
|
|
55
|
+
| **`developer/`**| `browser_github` | Sub-millisecond local repo inspection, PR diffs, and issue triage without burning browser turns. |
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 3. Interactive Installation
|
|
60
|
+
|
|
61
|
+
Inject formatted skills and rules directly into your AI agent environment:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx @weavetab/skills
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The interactive installer prompts you for:
|
|
68
|
+
1. **Domain Scope**: Full Enterprise Suite (All 9 Domains), Web Core, Desktop, Resilience, or Forensics.
|
|
69
|
+
2. **Target Agent Framework**:
|
|
70
|
+
- **Antigravity**: Generates `.agent/skills/weavetab-<domain>/SKILL.md` with standard YAML frontmatter.
|
|
71
|
+
- **Cursor**: Generates `.cursor/rules/weavetab-<domain>.mdc` with MDC frontmatter.
|
|
72
|
+
- **Cline**: Appends formatted sections to `.clinerules`.
|
|
73
|
+
- **Windsurf**: Generates `.windsurf/rules/weavetab-<domain>.md`.
|
|
74
|
+
- **OpenClaw & RooCode**: Generates respective agent rules.
|
|
75
|
+
- **Raw Markdown**: Generates portable `weavetab-skills/`.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 4. Programmatic API
|
|
80
|
+
|
|
81
|
+
Install skills programmatically from setup scripts or custom CLIs:
|
|
82
|
+
|
|
83
|
+
```javascript
|
|
84
|
+
const { installSkills, getSkills, getSkill, getRouterMatrix } = require('@weavetab/skills');
|
|
85
|
+
|
|
86
|
+
// Install targeted domains into Cursor
|
|
87
|
+
await installSkills({
|
|
88
|
+
targetFramework: '.cursor',
|
|
89
|
+
domains: ['browser', 'resilience', 'security']
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Query skills catalog
|
|
93
|
+
const webSkills = getSkillsByDomain('browser');
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 5. Automated Benchmark & Evaluation Suite (`evals/`)
|
|
99
|
+
|
|
100
|
+
Run the automated evaluation harness to verify that all 48 tools are covered and that skill guidance strictly passes test scenarios without legacy hallucinations:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npm test
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
*Built with precision for the Weavetab Ecosystem.*
|
package/ROUTER.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Weavetab Agent Intent Decision Matrix (Step-0 Router)
|
|
2
|
+
|
|
3
|
+
Welcome to the **Weavetab MCP Skills Routing Engine**.
|
|
4
|
+
|
|
5
|
+
When executing browser or desktop automation via `@weavetab/mcp`, **do not read the entire skills directory**. Match your immediate intent against the matrix below and jump directly to the target domain guide.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Intent Routing Table
|
|
10
|
+
|
|
11
|
+
| If your objective is... | Read Domain Guide | Primary MCP Tools |
|
|
12
|
+
| :--- | :--- | :--- |
|
|
13
|
+
| **Inspect DOM, extract text, locate elements, save tokens** | [`browser/dom-strategy.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/browser/dom-strategy.md) | `browser_map`, `browser_find`, `browser_scrape`, `browser_snapshot` |
|
|
14
|
+
| **Click, type, press keys, pointer trajectories, file upload** | [`browser/interaction-pipeline.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/browser/interaction-pipeline.md) | `browser_click`, `browser_type`, `browser_key`, `browser_pointer`, `browser_upload` |
|
|
15
|
+
| **Fill multi-field forms, select dropdowns, checkboxes** | [`browser/form-automation.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/browser/form-automation.md) | `browser_fill`, `browser_select` |
|
|
16
|
+
| **Manage tabs, window creation, tab crash recovery** | [`browser/tab-and-window.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/browser/tab-and-window.md) | `browser_tabs` |
|
|
17
|
+
| **Discover running Electron apps (Slack, Discord, VS Code)** | [`desktop/electron-discovery.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/desktop/electron-discovery.md) | `browser_detect` |
|
|
18
|
+
| **Control native desktop applications with MCP tools** | [`desktop/desktop-targeting.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/desktop/desktop-targeting.md) | Any tool passing `app: "<name>"` |
|
|
19
|
+
| **Bypass DOM walks using learned & cached selectors** | [`memory/selector-memory-system.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/memory/selector-memory-system.md) | Telemetry & selector history |
|
|
20
|
+
| **Recall multi-step site workflows, quirks & fast-path replay** | [`memory/site-learning.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/memory/site-learning.md) | `browser_pattern_learn` |
|
|
21
|
+
| **Compile manual action history into reusable macros** | [`memory/session-trail.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/memory/session-trail.md) | `browser_burst` (`compile_from_history`) |
|
|
22
|
+
| **Handle React/Next/Vue detached elements & re-renders** | [`resilience/stale-ref-recovery.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/resilience/stale-ref-recovery.md) | 4-tier auto-recovery heuristic |
|
|
23
|
+
| **Save/restore checkpoints & rollback failed workflows** | [`resilience/session-time-travel.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/resilience/session-time-travel.md) | `browser_checkpoint` |
|
|
24
|
+
| **Break infinite interaction loops or handle CAPTCHAs** | [`resilience/loop-breaker.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/resilience/loop-breaker.md) | `browser_map`, `browser_captcha` |
|
|
25
|
+
| **Enter passwords, API keys, or sensitive credentials** | [`security/secret-containment-protocol.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/security/secret-containment-protocol.md) | `browser_type_secret` |
|
|
26
|
+
| **Enforce RBAC boundaries & sandbox viewer agents** | [`security/rbac-and-policies.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/security/rbac-and-policies.md) | RBAC security layer |
|
|
27
|
+
| **Discover & dynamically load community plugins** | [`plugins/plugin-runtime.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/plugins/plugin-runtime.md) | `list_plugins`, `load_plugin` |
|
|
28
|
+
| **Intercept tool execution pipelines via SDK hooks** | [`plugins/hooks-and-overrides.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/plugins/hooks-and-overrides.md) | SDK Plugin Hooks |
|
|
29
|
+
| **Mock API endpoints, stub tracking, analyze TLS certs** | [`network-and-perf/network-intercept-and-mock.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/network-and-perf/network-intercept-and-mock.md) | `browser_network_intercept` |
|
|
30
|
+
| **Measure Core Web Vitals (LCP, CLS) & wait conditions** | [`network-and-perf/performance-and-vitals.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/network-and-perf/performance-and-vitals.md) | `browser_performance`, `browser_wait` |
|
|
31
|
+
| **Emulate mobile devices, CPU throttle, mock location** | [`network-and-perf/device-and-environment.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/network-and-perf/device-and-environment.md) | `browser_emulate` |
|
|
32
|
+
| **Ingest Word (.docx), Excel (.xlsx), CSV files** | [`documents/office-document-ingestion.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/documents/office-document-ingestion.md) | `browser_office` |
|
|
33
|
+
| **Capture screenshots, PDF exports, canvas pixels & visual marks** | [`documents/canvas-and-visual-capture.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/documents/canvas-and-visual-capture.md) | `browser_screenshot`, `browser_canvas`, `browser_pdf`, `browser_map` |
|
|
34
|
+
| **Sub-ms local Git repo parsing & PR/issue triage** | [`developer/github-forensics.md`](file:///c:/Users/fy2ne/Music/Weavetab/skills/developer/github-forensics.md) | `browser_github` |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## The 4 Golden Operational Rules for Weavetab Agents
|
|
39
|
+
|
|
40
|
+
1. **Environment Handshake First**: Always call `browser_detect` at the start of a session to discover available browsers and configured desktop apps (Discord, Slack, etc.) and check their live connection status (`connected`, `running_no_debug`, `offline`).
|
|
41
|
+
2. **Token Conservation**: NEVER call `browser_map` on large modern web apps without `lite: true` unless you strictly require full hierarchy data. For keyword navigation, always prefer `browser_find`.
|
|
42
|
+
3. **Volatile Handle Discipline**: Always use the returned volatile ref IDs (`w:NN`) directly. Do NOT attempt to construct speculative CSS selectors from scratch.
|
|
43
|
+
4. **Zero Secret Leakage**: Pass all authentication credentials, API keys, and sensitive tokens through `browser_type_secret`. Never use `browser_type` or `browser_fill` for credentials.
|
package/bin/cli.js
CHANGED
|
@@ -1,132 +1,232 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { select, confirm } = require('@inquirer/prompts');
|
|
4
|
-
const { installSkills } = require('../src/api.js');
|
|
5
|
-
|
|
6
|
-
//
|
|
7
|
-
const B = '\x1b[
|
|
8
|
-
const CB = '\x1b[
|
|
9
|
-
const W = '\x1b[97m';
|
|
10
|
-
const DM = '\x1b[2m';
|
|
11
|
-
const Y = '\x1b[33m';
|
|
12
|
-
const G = '\x1b[32m';
|
|
13
|
-
const R = '\x1b[31m';
|
|
14
|
-
const X = '\x1b[0m';
|
|
15
|
-
|
|
16
|
-
const line = `${B}${'
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { select, confirm, checkbox } = require('@inquirer/prompts');
|
|
4
|
+
const { installSkills, ALL_DOMAINS, WEAVETAB_VERSION } = require('../src/api.js');
|
|
5
|
+
|
|
6
|
+
// High-contrast modern ANSI styling
|
|
7
|
+
const B = '\x1b[38;2;99;102;241m'; // indigo primary
|
|
8
|
+
const CB = '\x1b[38;2;147;197;253m'; // sky cyan
|
|
9
|
+
const W = '\x1b[97m'; // bright white
|
|
10
|
+
const DM = '\x1b[2m'; // dim
|
|
11
|
+
const Y = '\x1b[33m'; // yellow
|
|
12
|
+
const G = '\x1b[32m'; // green
|
|
13
|
+
const R = '\x1b[31m'; // red
|
|
14
|
+
const X = '\x1b[0m'; // reset
|
|
15
|
+
|
|
16
|
+
const line = `${B}${'━'.repeat(58)}${X}`;
|
|
17
|
+
|
|
18
|
+
function normalizeFramework(fw) {
|
|
19
|
+
if (!fw) return null;
|
|
20
|
+
const f = fw.toLowerCase().trim();
|
|
21
|
+
if (f === 'antigravity' || f === '.agent' || f === 'agent') return '.agent';
|
|
22
|
+
if (f === 'cursor' || f === '.cursor') return '.cursor';
|
|
23
|
+
if (f === 'cline' || f === '.clinerules' || f === 'clinerules') return '.clinerules';
|
|
24
|
+
if (f === 'windsurf' || f === '.windsurf') return '.windsurf';
|
|
25
|
+
if (f === 'openclaw' || f === '.openclaw') return '.openclaw';
|
|
26
|
+
if (f === 'roocode' || f === '.roocode' || f === 'roo') return '.roocode';
|
|
27
|
+
if (f === 'generic' || f === 'markdown' || f === 'raw') return 'generic';
|
|
28
|
+
return fw;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function mapScope(scope) {
|
|
32
|
+
if (!scope || scope === 'all' || scope === 'full') return ALL_DOMAINS;
|
|
33
|
+
if (scope.includes(',')) {
|
|
34
|
+
const list = scope.split(',').map(s => s.trim().toLowerCase()).filter(Boolean);
|
|
35
|
+
const valid = list.filter(d => ALL_DOMAINS.includes(d));
|
|
36
|
+
return valid.length > 0 ? valid : ALL_DOMAINS;
|
|
37
|
+
}
|
|
38
|
+
const single = scope.trim().toLowerCase();
|
|
39
|
+
if (ALL_DOMAINS.includes(single)) return [single];
|
|
40
|
+
return ALL_DOMAINS;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function run() {
|
|
44
|
+
const rawArgs = process.argv.slice(2);
|
|
45
|
+
let cliFramework = null;
|
|
46
|
+
let cliScope = null;
|
|
47
|
+
let skipConfirm = false;
|
|
48
|
+
|
|
49
|
+
for (let i = 0; i < rawArgs.length; i++) {
|
|
50
|
+
const a = rawArgs[i];
|
|
51
|
+
if (a === '--framework' || a === '-f' || a === '--agent') {
|
|
52
|
+
cliFramework = normalizeFramework(rawArgs[++i]);
|
|
53
|
+
} else if (a === '--scope' || a === '-s' || a === '--domains') {
|
|
54
|
+
cliScope = rawArgs[++i];
|
|
55
|
+
} else if (a === '--yes' || a === '-y') {
|
|
56
|
+
skipConfirm = true;
|
|
57
|
+
} else if (a === '--help' || a === '-h') {
|
|
58
|
+
console.log(`
|
|
59
|
+
Usage: npx @weavetab/skills@latest [options]
|
|
60
|
+
|
|
61
|
+
Options:
|
|
62
|
+
-f, --framework <name> Target agent framework (.agent, .cursor, .clinerules, .windsurf, .openclaw, .roocode, generic)
|
|
63
|
+
-s, --scope <folders> Folders to install (e.g. browser,security, or 'all')
|
|
64
|
+
-y, --yes Skip confirmation prompts (installs all folders)
|
|
65
|
+
-h, --help Show help
|
|
66
|
+
`);
|
|
67
|
+
process.exit(0);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
console.log('');
|
|
72
|
+
console.log(line);
|
|
73
|
+
console.log(`${B} Weavetab MCP Skills Engine${X} ${CB}v${WEAVETAB_VERSION}${X}`);
|
|
74
|
+
console.log(`${DM} Enterprise Domain-Driven Agent Intelligence${X}`);
|
|
75
|
+
console.log(line);
|
|
76
|
+
console.log('');
|
|
77
|
+
console.log(`${CB} ✦ 44 Official MCP Tools Mapped${X}`);
|
|
78
|
+
console.log(`${CB} ✦ Universal Step-0 ROUTER.md Decision Matrix${X}`);
|
|
79
|
+
console.log(`${CB} ✦ Multi-Agent Adapters (Antigravity, Cursor, Cline, Windsurf)${X}`);
|
|
80
|
+
console.log('');
|
|
81
|
+
|
|
82
|
+
if (!skipConfirm && !cliFramework) {
|
|
83
|
+
const proceed = await confirm({
|
|
84
|
+
message: 'Does your workspace have @weavetab/mcp installed or configured?',
|
|
85
|
+
default: true
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (!proceed) {
|
|
89
|
+
console.log('');
|
|
90
|
+
console.log(`${DM} Run: npm install -g @weavetab/mcp${X}`);
|
|
91
|
+
console.log(`${DM} Documentation: https://weavetab.pages.dev${X}`);
|
|
92
|
+
console.log('');
|
|
93
|
+
process.exit(0);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
console.log('');
|
|
98
|
+
|
|
99
|
+
// Step 1 — Select Domain Folders
|
|
100
|
+
let selectedDomains = ALL_DOMAINS;
|
|
101
|
+
if (cliScope) {
|
|
102
|
+
selectedDomains = mapScope(cliScope);
|
|
103
|
+
} else if (!skipConfirm) {
|
|
104
|
+
selectedDomains = await checkbox({
|
|
105
|
+
message: 'Select Domain Folders to Install (all selected by default, press Space to unselect)',
|
|
106
|
+
choices: [
|
|
107
|
+
{
|
|
108
|
+
name: 'browser (/browser) — Core DOM interaction, navigation, wait, tabs, input',
|
|
109
|
+
value: 'browser',
|
|
110
|
+
checked: true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'desktop (/desktop) — Desktop & Electron apps, Slack, Discord, VS Code',
|
|
114
|
+
value: 'desktop',
|
|
115
|
+
checked: true
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'memory (/memory) — Site profiles, selector memory, session trails',
|
|
119
|
+
value: 'memory',
|
|
120
|
+
checked: true
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'resilience (/resilience) — Loop breaker, checkpoints, anti-captcha, recovery',
|
|
124
|
+
value: 'resilience',
|
|
125
|
+
checked: true
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'security (/security) — Permission boundaries, domain filters, secret injection',
|
|
129
|
+
value: 'security',
|
|
130
|
+
checked: true
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'plugins (/plugins) — Plugin management, discovery, dynamic tool loading',
|
|
134
|
+
value: 'plugins',
|
|
135
|
+
checked: true
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'network-and-perf (/network-and-perf) — HAR, network intercept, cookies, performance',
|
|
139
|
+
value: 'network-and-perf',
|
|
140
|
+
checked: true
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'documents (/documents) — Office documents, Word, Excel, PowerPoint, PDF',
|
|
144
|
+
value: 'documents',
|
|
145
|
+
checked: true
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'developer (/developer) — GitHub forensics, issue/PR inspection',
|
|
149
|
+
value: 'developer',
|
|
150
|
+
checked: true
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
if (!selectedDomains || selectedDomains.length === 0) {
|
|
156
|
+
console.log(`${Y} No folders selected, defaulting to all domain folders.${X}`);
|
|
157
|
+
selectedDomains = ALL_DOMAINS;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
console.log('');
|
|
162
|
+
|
|
163
|
+
// Step 2 — Select AI Agent Ecosystem
|
|
164
|
+
let targetFramework = cliFramework;
|
|
165
|
+
if (!targetFramework) {
|
|
166
|
+
targetFramework = await select({
|
|
167
|
+
message: 'Select Target AI Agent Framework',
|
|
168
|
+
choices: [
|
|
169
|
+
{
|
|
170
|
+
name: 'Antigravity (.agent/skills/<domain>/SKILL.md)',
|
|
171
|
+
value: '.agent',
|
|
172
|
+
description: 'Native Antigravity standard with YAML frontmatter discovery'
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'Cursor IDE (.cursor/rules/weavetab-<domain>.mdc)',
|
|
176
|
+
value: '.cursor',
|
|
177
|
+
description: 'Cursor rules with MDC frontmatter and glob matching'
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'Cline (.clinerules)',
|
|
181
|
+
value: '.clinerules',
|
|
182
|
+
description: 'Consolidated markdown file with domain dividers'
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'Windsurf IDE (.windsurf/rules/)',
|
|
186
|
+
value: '.windsurf',
|
|
187
|
+
description: 'Cascade / Windsurf project rules directory'
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'OpenClaw (.openclaw/skills/)',
|
|
191
|
+
value: '.openclaw',
|
|
192
|
+
description: 'OpenClaw autonomous agent skill packages'
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'RooCode (.roocode/rules/)',
|
|
196
|
+
value: '.roocode',
|
|
197
|
+
description: 'RooCode extension rules directory'
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: 'Raw Markdown (weavetab-skills/)',
|
|
201
|
+
value: 'generic',
|
|
202
|
+
description: 'Portable markdown directory for any LLM prompt'
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
console.log('');
|
|
209
|
+
console.log(`${DM} Installing ${selectedDomains.length} domain bundles...${X}`);
|
|
210
|
+
|
|
211
|
+
try {
|
|
212
|
+
const result = await installSkills({
|
|
213
|
+
targetFramework,
|
|
214
|
+
domains: selectedDomains,
|
|
215
|
+
includeRouter: true
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
console.log('');
|
|
219
|
+
console.log(line);
|
|
220
|
+
console.log(`${G} ✔ Success!${X} ${result}`);
|
|
221
|
+
console.log(`${CB} Step-0 ROUTER.md matrix ready for your AI agent.${X}`);
|
|
222
|
+
console.log(line);
|
|
223
|
+
console.log('');
|
|
224
|
+
} catch (e) {
|
|
225
|
+
console.log('');
|
|
226
|
+
console.error(`${R} Error:${X} ${e.message}`);
|
|
227
|
+
console.log('');
|
|
228
|
+
process.exit(1);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
run();
|