@weavetab/skills 1.0.3 → 2.5.0-beta.5

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.
Files changed (79) hide show
  1. package/README.md +108 -60
  2. package/ROUTER.md +43 -0
  3. package/bin/cli.js +232 -132
  4. package/browser/dom-strategy.md +119 -0
  5. package/browser/form-automation.md +87 -0
  6. package/browser/interaction-pipeline.md +216 -0
  7. package/browser/tab-and-window.md +136 -0
  8. package/desktop/desktop-targeting.md +85 -0
  9. package/desktop/electron-discovery.md +115 -0
  10. package/developer/github-forensics.md +74 -0
  11. package/dist/bundled/weavetab-all.md +1910 -0
  12. package/dist/bundled/weavetab-browser.md +501 -0
  13. package/dist/bundled/weavetab-desktop.md +176 -0
  14. package/dist/bundled/weavetab-developer.md +67 -0
  15. package/dist/bundled/weavetab-documents.md +142 -0
  16. package/dist/bundled/weavetab-memory.md +359 -0
  17. package/dist/bundled/weavetab-network-and-perf.md +223 -0
  18. package/dist/bundled/weavetab-plugins.md +83 -0
  19. package/dist/bundled/weavetab-resilience.md +216 -0
  20. package/dist/bundled/weavetab-security.md +87 -0
  21. package/dist/granular/browser_dom-strategy.md +119 -0
  22. package/dist/granular/browser_form-automation.md +87 -0
  23. package/dist/granular/browser_interaction-pipeline.md +216 -0
  24. package/dist/granular/browser_tab-and-window.md +136 -0
  25. package/dist/granular/desktop_desktop-targeting.md +85 -0
  26. package/dist/granular/desktop_electron-discovery.md +115 -0
  27. package/dist/granular/developer_github-forensics.md +74 -0
  28. package/dist/granular/documents_canvas-and-visual-capture.md +103 -0
  29. package/dist/granular/documents_office-document-ingestion.md +63 -0
  30. package/dist/granular/memory_selector-memory-system.md +127 -0
  31. package/dist/granular/memory_session-trail.md +95 -0
  32. package/dist/granular/memory_site-learning.md +180 -0
  33. package/dist/granular/network-and-perf_device-and-environment.md +87 -0
  34. package/dist/granular/network-and-perf_network-intercept-and-mock.md +84 -0
  35. package/dist/granular/network-and-perf_performance-and-vitals.md +84 -0
  36. package/dist/granular/plugins_hooks-and-overrides.md +35 -0
  37. package/dist/granular/plugins_plugin-runtime.md +63 -0
  38. package/dist/granular/resilience_loop-breaker.md +67 -0
  39. package/dist/granular/resilience_session-time-travel.md +131 -0
  40. package/dist/granular/resilience_stale-ref-recovery.md +53 -0
  41. package/dist/granular/security_rbac-and-policies.md +47 -0
  42. package/dist/granular/security_secret-containment-protocol.md +59 -0
  43. package/documents/canvas-and-visual-capture.md +103 -0
  44. package/documents/office-document-ingestion.md +63 -0
  45. package/evals/evaluator.js +146 -0
  46. package/evals/scenarios.json +239 -0
  47. package/memory/selector-memory-system.md +127 -0
  48. package/memory/session-trail.md +95 -0
  49. package/memory/site-learning.md +180 -0
  50. package/network-and-perf/device-and-environment.md +87 -0
  51. package/network-and-perf/network-intercept-and-mock.md +84 -0
  52. package/network-and-perf/performance-and-vitals.md +84 -0
  53. package/package.json +31 -9
  54. package/plugins/hooks-and-overrides.md +35 -0
  55. package/plugins/plugin-runtime.md +63 -0
  56. package/resilience/loop-breaker.md +67 -0
  57. package/resilience/session-time-travel.md +131 -0
  58. package/resilience/stale-ref-recovery.md +53 -0
  59. package/security/rbac-and-policies.md +47 -0
  60. package/security/secret-containment-protocol.md +59 -0
  61. package/skills.json +321 -203
  62. package/src/api.js +239 -128
  63. package/advanced/README.md +0 -2
  64. package/automation/README.md +0 -2
  65. package/general/captcha-evasion.md +0 -13
  66. package/general/context-awareness.md +0 -13
  67. package/general/cookie-consent.md +0 -13
  68. package/general/data-extraction.md +0 -13
  69. package/general/dynamic-interaction.md +0 -13
  70. package/general/error-recovery.md +0 -13
  71. package/general/file-upload.md +0 -13
  72. package/general/form-filling.md +0 -16
  73. package/general/guardrails.md +0 -13
  74. package/general/iframe-handling.md +0 -13
  75. package/general/infinite-scroll.md +0 -13
  76. package/general/login-flow.md +0 -16
  77. package/general/multi-tab-management.md +0 -13
  78. package/general/spa-navigation.md +0 -13
  79. package/general/table-scraping.md +0 -13
package/README.md CHANGED
@@ -1,60 +1,108 @@
1
- # Weavetab MCP Skills
2
-
3
- [![npm version](https://img.shields.io/npm/v/@weavetab/skills.svg)](https://www.npmjs.com/package/@weavetab/skills)
4
- [![GitHub stars](https://img.shields.io/github/stars/Weavetab/skills.svg?style=social)](https://github.com/Weavetab/skills)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
-
7
- Welcome to the official Weavetab MCP Skills repository. This package provides native drop-in Agent Skills designed to enhance AI assistants (such as Antigravity, Cursor, Cline, RooCode, OpenClaw, and others) with advanced browser automation and intelligent web interaction capabilities.
8
-
9
- - **Official Website:** [weavetab.dev](https://weavetab.dev)
10
- - **Core MCP Package:** [`weavetab`](https://www.npmjs.com/package/weavetab)
11
-
12
- ## Prerequisites
13
-
14
- These advanced skills require **Weavetab MCP v2.5.0 or higher**.
15
- Please ensure you have installed the core Weavetab MCP server prior to using these skills:
16
-
17
- ```bash
18
- npm install -g weavetab
19
- ```
20
-
21
- ## Installation and Usage
22
-
23
- For standard users, we provide an interactive CLI installer that seamlessly injects the markdown skills directly into your specific AI agent's configuration folder. This prevents cluttering your project directory with unnecessary dependencies.
24
-
25
- Run the following command in your terminal from the root of your project:
26
-
27
- ```bash
28
- npx @weavetab/skills
29
- ```
30
-
31
- The interactive menu will guide you to select your agent framework (`.agents`, `.cursor`, `.clinerules`, `.roocode`, etc.) and the categories of skills you wish to install.
32
-
33
- ## Skill Categories
34
-
35
- - **General (Tier 1):** Essential browser navigation, DOM interaction, guards against abuse, form filling, tab management, intelligent data extraction, and more.
36
- - **Automation (Tier 2):** *Coming Soon*
37
- - **Advanced (Tier 3):** *Coming Soon*
38
-
39
- ## Programmatic API
40
-
41
- If you are building your own CLI or integrating with the core `wt setup` command, you can install skills programmatically:
42
-
43
- ```javascript
44
- const { installSkills } = require('@weavetab/skills');
45
-
46
- await installSkills({
47
- targetFramework: '.cursor', // or '.agents', '.clinerules', etc.
48
- categories: ['general']
49
- });
50
- ```
51
-
52
- ## Contributing
53
-
54
- We welcome community contributions! If you have built a robust browser automation skill that handles complex scenarios, we encourage you to add it to this repository.
55
-
56
- Please review our [Contributing Guidelines](CONTRIBUTING.md) for detailed instructions on how to propose new skills, format your pull requests, and adhere to our core philosophies for agent autonomy.
57
-
58
- ---
59
-
60
- *Built for the Weavetab Community.*
1
+ # Weavetab MCP Skills (`@weavetab/skills`)
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@weavetab/skills.svg)](https://www.npmjs.com/package/@weavetab/skills)
4
+ [![GitHub stars](https://img.shields.io/github/stars/Weavetab/skills.svg?style=social)](https://github.com/Weavetab/skills)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ Enterprise domain-driven agent intelligence for `@weavetab/mcp` (v2.5.0-beta.5). Drop-in operational guides, failure recovery heuristics, and protocol rules for **Antigravity**, **Cursor**, **Cline**, **Windsurf**, and **OpenClaw**.
8
+
9
+ - **Website:** [weavetab.dev](https://weavetab.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
- // Blue theme colors via ANSI
7
- const B = '\x1b[34m'; // blue
8
- const CB = '\x1b[96m'; // bright 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(52)}${X}`;
17
-
18
- async function run() {
19
- console.log('');
20
- console.log(line);
21
- console.log(`${B} Weavetab MCP Skills${X} ${DM}v1.0.3${X}`);
22
- console.log(`${DM} Interactive skill installer for AI agents${X}`);
23
- console.log(line);
24
- console.log('');
25
- console.log(`${Y} ! IMPORTANT${X} These skills require Weavetab MCP v2.5.0+`);
26
- console.log(`${DM} Install the MCP first: npm install -g weavetab${X}`);
27
- console.log(`${DM} Website: https://weavetab.dev${X}`);
28
- console.log('');
29
-
30
- const proceed = await confirm({
31
- message: 'Does your agent have Weavetab MCP v2.5.0+ installed?',
32
- default: true
33
- });
34
-
35
- if (!proceed) {
36
- console.log('');
37
- console.log(`${DM} Run: npm install -g weavetab${X}`);
38
- console.log(`${DM} Then run this installer again.${X}`);
39
- console.log('');
40
- process.exit(0);
41
- }
42
-
43
- console.log('');
44
-
45
- // Step 1 — Select category
46
- console.log(`${B} Available tiers:${X}`);
47
- console.log(`${G} [1] General${X} Core browser automation patterns (15 skills)`);
48
- console.log(`${DM} [2] Automation Coming soon${X}`);
49
- console.log(`${DM} [3] Advanced Coming soon${X}`);
50
- console.log('');
51
-
52
- const categoryChoice = await select({
53
- message: 'Select a skill tier to install',
54
- choices: [
55
- {
56
- name: 'General',
57
- value: 'general',
58
- description: '15 skills -> login, forms, scraping, navigation, uploads, and more'
59
- }
60
- ]
61
- });
62
-
63
- const categories = [categoryChoice];
64
- console.log('');
65
-
66
- // Step 2 — Select agent framework
67
- const targetFramework = await select({
68
- message: 'Select your AI agent format',
69
- choices: [
70
- {
71
- name: '.agents',
72
- value: '.agents',
73
- description: 'Antigravity, Copilot, OpenCode -> .agents/skills/weavetab/'
74
- },
75
- {
76
- name: '.cursor',
77
- value: '.cursor',
78
- description: 'Cursor IDE -> .cursor/rules/'
79
- },
80
- {
81
- name: '.clinerules',
82
- value: '.clinerules',
83
- description: 'Cline AI -> .clinerules'
84
- },
85
- {
86
- name: '.openclaw',
87
- value: '.openclaw',
88
- description: 'OpenClaw AI -> .openclaw/skills/'
89
- },
90
- {
91
- name: '.roocode',
92
- value: '.roocode',
93
- description: 'RooCode -> .roocode/rules/'
94
- },
95
- {
96
- name: '.windsurf',
97
- value: '.windsurf',
98
- description: 'Windsurf IDE -> .windsurf/rules/'
99
- },
100
- {
101
- name: 'aider',
102
- value: '.aider',
103
- description: 'Aider -> .aider.conf.yml'
104
- },
105
- {
106
- name: 'generic',
107
- value: 'generic',
108
- description: 'Other agents -> weavetab-skills/'
109
- }
110
- ]
111
- });
112
-
113
- console.log('');
114
- console.log(`${DM} Installing skills...${X}`);
115
-
116
- try {
117
- const result = await installSkills({ targetFramework, categories });
118
- console.log('');
119
- console.log(line);
120
- console.log(`${G} Done!${X} ${result}`);
121
- console.log(`${B} Your agent is ready for Weavetab MCP.${X}`);
122
- console.log(line);
123
- console.log('');
124
- } catch (e) {
125
- console.log('');
126
- console.error(`${R} Error:${X} ${e.message}`);
127
- console.log('');
128
- process.exit(1);
129
- }
130
- }
131
-
132
- run();
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.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();