@weavetab/skills 1.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.
@@ -0,0 +1,2 @@
1
+ github:
2
+ - fy2ne
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a broken or misbehaving skill
4
+ title: "[BUG] "
5
+ labels: bug
6
+ assignees: fy2ne
7
+ ---
8
+
9
+ **Which skill is affected?**
10
+ e.g. `general/login-flow.md`
11
+
12
+ **Describe the bug**
13
+ A clear and concise description of what went wrong.
14
+
15
+ **Weavetab MCP version**
16
+ e.g. v2.5.0
17
+
18
+ **AI Agent being used**
19
+ e.g. Antigravity, Cursor, Cline
20
+
21
+ **To Reproduce**
22
+ Steps to reproduce the behavior.
23
+
24
+ **Expected behavior**
25
+ What you expected the agent to do.
26
+
27
+ **Additional context**
28
+ Any logs, screenshots, or notes.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: Skill Request
3
+ about: Request a new skill to be added to the library
4
+ title: "[SKILL] "
5
+ labels: enhancement
6
+ assignees: fy2ne
7
+ ---
8
+
9
+ **What task pattern should this skill cover?**
10
+ e.g. "Handling cookie consent banners automatically"
11
+
12
+ **Which category should it go in?**
13
+ - [ ] General (Tier 1)
14
+ - [ ] Automation (Tier 2)
15
+ - [ ] Advanced (Tier 3)
16
+
17
+ **Which Weavetab MCP tools would it use?**
18
+ e.g. `browser_click`, `browser_find`
19
+
20
+ **Describe the skill behavior**
21
+ What should the agent do when this skill is active?
22
+
23
+ **Why is this useful?**
24
+ Who would benefit from this skill?
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Pull Request
3
+ about: Contribute a new skill or fix
4
+ ---
5
+
6
+ ## What does this PR do?
7
+
8
+ - [ ] Adds a new skill
9
+ - [ ] Fixes an existing skill
10
+ - [ ] Improves the CLI installer
11
+ - [ ] Other (describe below)
12
+
13
+ ## Skill file(s) changed
14
+
15
+ List the files you added or modified:
16
+ - `general/your-skill.md`
17
+
18
+ ## Checklist
19
+
20
+ - [ ] Frontmatter includes `weavetab: ">=2.5.0"`
21
+ - [ ] Ran `npm run build` and `skills.json` is updated
22
+ - [ ] Skill is focused on a single task pattern
23
+ - [ ] No emojis in skill content
@@ -0,0 +1,34 @@
1
+ # Contributing to Weavetab MCP Skills
2
+
3
+ Thank you for your interest in contributing! Here is how you can help.
4
+
5
+ ## Adding a New Skill
6
+
7
+ 1. Fork the repository.
8
+ 2. Create a new `.md` file in the appropriate category folder (`general/`, `automation/`, `advanced/`).
9
+ 3. Use the following frontmatter at the top of your file:
10
+
11
+ ```yaml
12
+ ---
13
+ id: your-skill-name
14
+ tier: general
15
+ triggers: [keyword1, keyword2]
16
+ tools: [browser_navigate, browser_click]
17
+ weavetab: ">=2.5.0"
18
+ ---
19
+ ```
20
+
21
+ 4. Write clear, concise instructions for the AI agent below the frontmatter.
22
+ 5. Run `npm run build` to regenerate `skills.json`.
23
+ 6. Open a Pull Request with a description of what your skill does.
24
+
25
+ ## Rules
26
+
27
+ - Skills must be specifically for **Weavetab MCP** — not generic AI instructions.
28
+ - Skills must require **Weavetab MCP v2.5.0+**.
29
+ - Keep skill files focused on a single task pattern.
30
+ - No emojis in skill content (keep it clean and professional).
31
+
32
+ ## Code of Conduct
33
+
34
+ Be respectful and constructive. This is a community project.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 fy2ne
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # 🚀 Weavetab MCP Skills
2
+
3
+ Welcome to the official **Weavetab MCP Skills** repository! This package provides powerful, native drop-in Agent Skills to supercharge your AI (like Antigravity, Cursor, Cline, RooCode, OpenClaw, and more) with browser automation capabilities.
4
+
5
+ 🌐 **Official Website:** [weavetab.dev](https://weavetab.dev)
6
+ 📦 **Core MCP Package:** [`weavetab`](https://www.npmjs.com/package/weavetab)
7
+
8
+ ## ⚠️ Prerequisites
9
+
10
+ These advanced skills are designed specifically for **Weavetab MCP v2.5.0+**.
11
+ Make sure you have installed the core Weavetab MCP server first:
12
+
13
+ ```bash
14
+ npm install -g weavetab
15
+ ```
16
+
17
+ ## 🛠️ Installation
18
+
19
+ We provide a beautiful, interactive CLI installer that seamlessly injects the pure markdown skills into your specific AI agent's configuration folder without cluttering your project with `node_modules`.
20
+
21
+ Run the following command anywhere:
22
+
23
+ ```bash
24
+ npx @weavetab/skills
25
+ ```
26
+
27
+ The interactive menu will guide you to select your agent framework (`.agents`, `.cursor`, `.clinerules`, `.roocode`, etc.) and the categories of skills you want to install.
28
+
29
+ ## 📚 Skill Categories
30
+
31
+ - **General (Tier 1):** Essential browser navigation, DOM interaction, guards against abuse, form filling, tab management, and more.
32
+ - **Automation (Tier 2):** *Coming Soon*
33
+ - **Advanced (Tier 3):** *Coming Soon*
34
+
35
+ ## 💻 Programmatic API
36
+
37
+ If you are building your own CLI or using the core `wb setup` command, you can install skills programmatically:
38
+
39
+ ```javascript
40
+ const { installSkills } = require('@weavetab/skills');
41
+
42
+ await installSkills({
43
+ targetFramework: '.cursor', // or '.agents', '.clinerules', etc.
44
+ categories: ['general']
45
+ });
46
+ ```
47
+
48
+ ---
49
+
50
+ *Built with ❤️ by [fy2ne](https://github.com/fy2ne) for the Weavetab Community.*
package/SECURITY.md ADDED
@@ -0,0 +1,26 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ | Version | Supported |
6
+ | ------- | --------- |
7
+ | 1.0.x | Yes |
8
+
9
+ ## Reporting a Vulnerability
10
+
11
+ If you discover a security vulnerability in this project, **please do not open a public GitHub issue.**
12
+
13
+ Instead, contact the maintainer directly:
14
+
15
+ - **GitHub:** [@fy2ne](https://github.com/fy2ne)
16
+
17
+ Please include:
18
+ - A clear description of the vulnerability
19
+ - Steps to reproduce it
20
+ - Any relevant logs or screenshots
21
+
22
+ You can expect a response within **48 hours**. If the issue is confirmed, a patch will be released as soon as possible.
23
+
24
+ ## Scope
25
+
26
+ This repository contains only **Markdown skill files** and a lightweight CLI installer. The attack surface is minimal, but we take any supply-chain or code injection concerns seriously.
@@ -0,0 +1,2 @@
1
+ # Advanced Skills
2
+ Coming soon.
@@ -0,0 +1,2 @@
1
+ # Automation Skills
2
+ Coming soon.
package/bin/cli.js ADDED
@@ -0,0 +1,132 @@
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.0${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 (10 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: '10 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();
@@ -0,0 +1,13 @@
1
+ ---
2
+ id: captcha-evasion
3
+ tier: general
4
+ triggers: []
5
+ tools: []
6
+ weavetab: ">=2.5.0"
7
+ ---
8
+ # CAPTCHA Evasion & Handling
9
+
10
+ 1. **Detection**: If `browser_navigate` stalls or `browser_map` reveals "Verify you are human" or Cloudflare interstitial pages, you have hit an anti-bot check.
11
+ 2. **Slow Down**: Do not spam clicks or rapid navigations. Stop and use `browser_wait({ delay: 5000 })` to let the automatic human-simulation heuristics in Weavetab MCP attempt to solve it in the background.
12
+ 3. **Manual Solve**: If it requires clicking a checkbox (e.g. Turnstile or reCAPTCHA), find the iframe or checkbox ID via `browser_map`, and use `browser_click` with `intent: "click captcha checkbox"`.
13
+ 4. **Bypass**: Avoid triggering them by not using `force: true` or `fast: true` flags unless necessary, as they bypass Weavetab MCP's built-in stealth patterns.
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: file-upload
3
+ tier: general
4
+ triggers: []
5
+ tools: []
6
+ weavetab: ">=2.5.0"
7
+ ---
8
+ # File Upload Pattern
9
+
10
+ 1. **Map**: Find the file input element (`<input type="file">`) using `browser_map`. It may be hidden beneath a stylized button.
11
+ 2. **Upload**: Use `browser_upload` with the absolute path to your local file and the input's ref ID. Do NOT try to `browser_click` the upload button to open an OS dialog—that will stall the agent.
12
+ 3. **Verify**: Check for upload progress indicators or success messages via `browser_map({ delta: true })`.
@@ -0,0 +1,13 @@
1
+ ---
2
+ id: form-filling
3
+ tier: general
4
+ triggers: []
5
+ tools: []
6
+ weavetab: ">=2.5.0"
7
+ ---
8
+ # Form Filling Pattern
9
+
10
+ 1. **Map the Form**: Call `browser_map({ scope: "form" })` to gather all interactive element IDs. Do not map the entire page if you only need the form.
11
+ 2. **Batch Fill**: If possible, batch your input using `browser_fill` across multiple fields to save time.
12
+ 3. **Selects**: Use `browser_select` for dropdowns, not `browser_click`.
13
+ 4. **Submit**: Click the submit button and check the response for `confirmed: true`. Wait for network idle or DOM changes using `browser_wait`.
@@ -0,0 +1,13 @@
1
+ ---
2
+ id: guardrails
3
+ tier: general
4
+ triggers: []
5
+ tools: []
6
+ weavetab: ">=2.5.0"
7
+ ---
8
+ # Weavetab MCP Guardrails
9
+ **CRITICAL INSTRUCTIONS FOR AI AGENT:**
10
+
11
+ 1. **Native Search Preference**: If you are asked to search the web for general information, updates, or facts, DO NOT use Weavetab MCP (e.g., `browser_navigate` to google.com) if you already possess a native web search tool. Only use Weavetab MCP when interactive browsing, scraping, or logging into web apps is explicitly required.
12
+ 2. **Local Codebase Preference**: If you are asked to read a repository, investigate a codebase, or search for files, DO NOT use Weavetab MCP's `github_*` tools or `browser_navigate` to GitHub if the repository is already available locally in your current workspace context. Use native file reading tools (`view_file`, `grep_search`, `list_dir`) instead.
13
+ 3. **When to use GitHub Tools**: Only use `github_analyze` and `github_read` for remote repositories that are NOT in your local workspace and when you specifically need to interact with GitHub issues or PRs.
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: iframe-handling
3
+ tier: general
4
+ triggers: []
5
+ tools: []
6
+ weavetab: ">=2.5.0"
7
+ ---
8
+ # Iframe Handling Pattern
9
+
10
+ 1. **Identify Iframes**: If an element you expect (like a Stripe credit card field) isn't visible in `browser_map`, it might be inside a cross-origin iframe. Look for `[w:XX] iframe` elements in the map.
11
+ 2. **Target Iframe**: Weavetab MCP's `browser_map` automatically tries to pierce iframes, but cross-origin security may block it. If an iframe is blocked, you cannot click elements inside it using standard `id` refs.
12
+ 3. **Fallback**: Use `browser_eval` to execute JS within the context of the page if you need to manipulate iframe communication via `postMessage`, or notify the user that manual intervention is required for secure cross-origin iframes.
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: infinite-scroll
3
+ tier: general
4
+ triggers: []
5
+ tools: []
6
+ weavetab: ">=2.5.0"
7
+ ---
8
+ # Infinite Scroll Pattern
9
+
10
+ 1. **Scroll**: Use `browser_scroll({ direction: "down", amount: "page" })`.
11
+ 2. **Detect Change**: Use `browser_map({ delta: true })` to check if new items appeared in the DOM.
12
+ 3. **Loop Control**: Keep track of the total items found. If `browser_map` returns no new delta after a scroll, you have reached the bottom or need to `browser_wait` for the network. Do not loop endlessly.
@@ -0,0 +1,14 @@
1
+ ---
2
+ id: login-flow
3
+ tier: general
4
+ triggers: []
5
+ tools: []
6
+ weavetab: ">=2.5.0"
7
+ ---
8
+ # Login Flow Pattern
9
+
10
+ 1. **Navigate**: Use `browser_navigate` to reach the login page.
11
+ 2. **Map**: Call `browser_map({ scope: "form" })` to get the ref IDs of the inputs and submit button. Cache these IDs.
12
+ 3. **Fill**: Use `browser_fill` or `browser_type` to enter credentials using the ref IDs.
13
+ 4. **Submit**: Use `browser_click` on the submit button's ref ID. Do not press "Enter" blindly unless you confirm the form submits.
14
+ 5. **Verify**: Use `browser_map({ delta: true })` to verify the page changed (e.g., checking for a logout button or dashboard elements).
@@ -0,0 +1,13 @@
1
+ ---
2
+ id: multi-tab-management
3
+ tier: general
4
+ triggers: []
5
+ tools: []
6
+ weavetab: ">=2.5.0"
7
+ ---
8
+ # Multi-Tab Management Pattern
9
+
10
+ 1. **List Tabs**: Call `browser_tabs()` to get a list of all open tabs and their `tab_id`s.
11
+ 2. **Switch Context**: Most Weavetab MCP tools (like `browser_map`, `browser_click`) accept a `tab_id` parameter. Pass the specific `tab_id` to execute actions in a background tab without needing to bring it to the foreground.
12
+ 3. **Handle Popups**: If clicking a link opens a new tab, run `browser_tabs()` to identify the new tab, then target it with `tab_id`. Do NOT assume the new tab automatically becomes the active target unless specified.
13
+ 4. **Cleanup**: Close tabs when no longer needed using `browser_tabs({ action: "close", tab_id: "..." })` to preserve memory and token context.
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: spa-navigation
3
+ tier: general
4
+ triggers: []
5
+ tools: []
6
+ weavetab: ">=2.5.0"
7
+ ---
8
+ # SPA Navigation Pattern
9
+
10
+ 1. **Click**: Use `browser_click` to navigate within a Single Page Application (SPA).
11
+ 2. **Delta Map**: Do NOT call `browser_navigate` for internal SPA links. Call `browser_map({ delta: true })` after the click to see ONLY what changed in the DOM.
12
+ 3. **Wait**: If elements aren't ready, use `browser_wait` for network idle rather than arbitrary sleep timeouts.
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: table-scraping
3
+ tier: general
4
+ triggers: []
5
+ tools: []
6
+ weavetab: ">=2.5.0"
7
+ ---
8
+ # Table Scraping Pattern
9
+
10
+ 1. **Locate**: Use `browser_map({ prune: true })` to locate the table container.
11
+ 2. **Scrape**: Do not manually click through pages or read the DOM raw. Use `browser_scrape` targeting the table structure to extract row data cleanly into JSON.
12
+ 3. **Pagination**: If scraping multiple pages, map the "Next" button ID once, then loop: `browser_scrape` -> `browser_click` (Next) -> verify change -> repeat.
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@weavetab/skills",
3
+ "version": "1.0.0",
4
+ "description": "Supercharge your AI Agents with Weavetab MCP Skills. Native drop-in skills for Antigravity, Cursor, Cline, and more.",
5
+ "author": "fy2ne",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/Weavetab/skills.git"
9
+ },
10
+ "homepage": "https://github.com/Weavetab/skills#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/Weavetab/skills/issues"
13
+ },
14
+ "keywords": [
15
+ "weavetab",
16
+ "weavetab-mcp",
17
+ "mcp",
18
+ "ai-agent",
19
+ "cursor",
20
+ "cline",
21
+ "antigravity",
22
+ "browser-automation",
23
+ "agent-skills",
24
+ "openclaw"
25
+ ],
26
+ "peerDependenciesMeta": {
27
+ "weavetab": {
28
+ "optional": true
29
+ }
30
+ },
31
+ "main": "./src/api.js",
32
+ "bin": {
33
+ "weavetab-skills": "./bin/cli.js"
34
+ },
35
+ "scripts": {
36
+ "build": "node scripts/build.js"
37
+ },
38
+ "dependencies": {
39
+ "@inquirer/prompts": "^7.3.1",
40
+ "yaml": "^2.3.4"
41
+ }
42
+ }
@@ -0,0 +1,48 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const yaml = require('yaml');
4
+
5
+ const dirs = ['general', 'automation', 'advanced'];
6
+ const skills = [];
7
+
8
+ function parseFile(filePath) {
9
+ const content = fs.readFileSync(filePath, 'utf8');
10
+ const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
11
+ if (!match) return null;
12
+
13
+ const frontmatter = yaml.parse(match[1]);
14
+
15
+ // Convert absolute path to relative path
16
+ const relativePath = path.relative(path.join(__dirname, '..'), filePath);
17
+
18
+ return {
19
+ ...frontmatter,
20
+ filePath: relativePath.replace(/\\/g, '/')
21
+ };
22
+ }
23
+
24
+ for (const dir of dirs) {
25
+ const dirPath = path.join(__dirname, '..', dir);
26
+ if (!fs.existsSync(dirPath)) continue;
27
+
28
+ const files = fs.readdirSync(dirPath).filter(f => f.endsWith('.md') && f !== 'README.md');
29
+ for (const file of files) {
30
+ const fullPath = path.join(dirPath, file);
31
+ try {
32
+ const parsed = parseFile(fullPath);
33
+ if (parsed) {
34
+ skills.push(parsed);
35
+ }
36
+ } catch (e) {
37
+ console.error(`Error parsing ${fullPath}: ${e.message}`);
38
+ process.exit(1);
39
+ }
40
+ }
41
+ }
42
+
43
+ fs.writeFileSync(
44
+ path.join(__dirname, '..', 'skills.json'),
45
+ JSON.stringify({ skills }, null, 2)
46
+ );
47
+
48
+ console.log(`Successfully built skills.json with ${skills.length} skills.`);
package/skills.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "skills": [
3
+ {
4
+ "id": "captcha-evasion",
5
+ "tier": "general",
6
+ "triggers": [],
7
+ "tools": [],
8
+ "weavetab": ">=2.5.0",
9
+ "filePath": "general/captcha-evasion.md"
10
+ },
11
+ {
12
+ "id": "file-upload",
13
+ "tier": "general",
14
+ "triggers": [],
15
+ "tools": [],
16
+ "weavetab": ">=2.5.0",
17
+ "filePath": "general/file-upload.md"
18
+ },
19
+ {
20
+ "id": "form-filling",
21
+ "tier": "general",
22
+ "triggers": [],
23
+ "tools": [],
24
+ "weavetab": ">=2.5.0",
25
+ "filePath": "general/form-filling.md"
26
+ },
27
+ {
28
+ "id": "guardrails",
29
+ "tier": "general",
30
+ "triggers": [],
31
+ "tools": [],
32
+ "weavetab": ">=2.5.0",
33
+ "filePath": "general/guardrails.md"
34
+ },
35
+ {
36
+ "id": "iframe-handling",
37
+ "tier": "general",
38
+ "triggers": [],
39
+ "tools": [],
40
+ "weavetab": ">=2.5.0",
41
+ "filePath": "general/iframe-handling.md"
42
+ },
43
+ {
44
+ "id": "infinite-scroll",
45
+ "tier": "general",
46
+ "triggers": [],
47
+ "tools": [],
48
+ "weavetab": ">=2.5.0",
49
+ "filePath": "general/infinite-scroll.md"
50
+ },
51
+ {
52
+ "id": "login-flow",
53
+ "tier": "general",
54
+ "triggers": [],
55
+ "tools": [],
56
+ "weavetab": ">=2.5.0",
57
+ "filePath": "general/login-flow.md"
58
+ },
59
+ {
60
+ "id": "multi-tab-management",
61
+ "tier": "general",
62
+ "triggers": [],
63
+ "tools": [],
64
+ "weavetab": ">=2.5.0",
65
+ "filePath": "general/multi-tab-management.md"
66
+ },
67
+ {
68
+ "id": "spa-navigation",
69
+ "tier": "general",
70
+ "triggers": [],
71
+ "tools": [],
72
+ "weavetab": ">=2.5.0",
73
+ "filePath": "general/spa-navigation.md"
74
+ },
75
+ {
76
+ "id": "table-scraping",
77
+ "tier": "general",
78
+ "triggers": [],
79
+ "tools": [],
80
+ "weavetab": ">=2.5.0",
81
+ "filePath": "general/table-scraping.md"
82
+ }
83
+ ]
84
+ }
package/src/api.js ADDED
@@ -0,0 +1,128 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ /**
5
+ * Programmatically install Weavetab MCP skills into a target project.
6
+ *
7
+ * @param {Object} options
8
+ * @param {string} options.targetFramework - '.agents', '.cursor', '.clinerules', or 'generic'
9
+ * @param {string[]} options.categories - Array of categories to install (e.g. ['general'])
10
+ * @param {string} options.projectRoot - The root directory to install into (defaults to process.cwd())
11
+ * @returns {Promise<string>} - A message indicating success and the path where skills were installed.
12
+ */
13
+ async function installSkills({ targetFramework, categories, projectRoot = process.cwd() }) {
14
+ const packageRoot = path.join(__dirname, '..');
15
+
16
+ if (!categories || categories.length === 0) {
17
+ throw new Error("No categories selected for installation.");
18
+ }
19
+
20
+ // Gather all markdown files from the selected categories
21
+ let allMarkdownFiles = [];
22
+ for (const category of categories) {
23
+ const categoryDir = path.join(packageRoot, category);
24
+ if (!fs.existsSync(categoryDir)) continue;
25
+
26
+ const files = fs.readdirSync(categoryDir).filter(f => f.endsWith('.md'));
27
+ for (const file of files) {
28
+ allMarkdownFiles.push({
29
+ name: file,
30
+ content: fs.readFileSync(path.join(categoryDir, file), 'utf8')
31
+ });
32
+ }
33
+ }
34
+
35
+ if (allMarkdownFiles.length === 0) {
36
+ throw new Error("No skills found in the selected categories.");
37
+ }
38
+
39
+ // Process and inject based on the framework
40
+ if (targetFramework === '.clinerules') {
41
+ // Cline uses a single file at the root
42
+ const clineFile = path.join(projectRoot, '.clinerules');
43
+ let combinedContent = "\n\n# --- Weavetab MCP Skills ---\n\n";
44
+ for (const file of allMarkdownFiles) {
45
+ combinedContent += `## ${file.name}\n${file.content}\n\n`;
46
+ }
47
+ fs.appendFileSync(clineFile, combinedContent);
48
+ return `Successfully appended ${allMarkdownFiles.length} skills to ${clineFile}`;
49
+ }
50
+
51
+ else if (targetFramework === '.cursor') {
52
+ // Cursor uses .mdc files in .cursor/rules
53
+ const cursorRulesDir = path.join(projectRoot, '.cursor', 'rules');
54
+ fs.mkdirSync(cursorRulesDir, { recursive: true });
55
+
56
+ for (const file of allMarkdownFiles) {
57
+ const destFile = path.join(cursorRulesDir, file.name.replace('.md', '.mdc'));
58
+ fs.writeFileSync(destFile, file.content);
59
+ }
60
+ return `Successfully installed ${allMarkdownFiles.length} skills to ${cursorRulesDir}`;
61
+ }
62
+
63
+ else if (targetFramework === '.agents') {
64
+ // Standard agent customizations folder
65
+ const agentsDir = path.join(projectRoot, '.agents', 'skills', 'weavetab');
66
+ fs.mkdirSync(agentsDir, { recursive: true });
67
+
68
+ for (const file of allMarkdownFiles) {
69
+ fs.writeFileSync(path.join(agentsDir, file.name), file.content);
70
+ }
71
+ return `Successfully installed ${allMarkdownFiles.length} skills to ${agentsDir}`;
72
+ }
73
+
74
+ else if (targetFramework === '.openclaw') {
75
+ // OpenClaw AI folder
76
+ const openClawDir = path.join(projectRoot, '.openclaw', 'skills');
77
+ fs.mkdirSync(openClawDir, { recursive: true });
78
+
79
+ for (const file of allMarkdownFiles) {
80
+ fs.writeFileSync(path.join(openClawDir, file.name), file.content);
81
+ }
82
+ return `Successfully installed ${allMarkdownFiles.length} skills to ${openClawDir}`;
83
+ }
84
+
85
+ else if (targetFramework === '.roocode') {
86
+ const rooDir = path.join(projectRoot, '.roocode', 'rules');
87
+ fs.mkdirSync(rooDir, { recursive: true });
88
+
89
+ for (const file of allMarkdownFiles) {
90
+ fs.writeFileSync(path.join(rooDir, file.name), file.content);
91
+ }
92
+ return `Successfully installed ${allMarkdownFiles.length} skills to ${rooDir}`;
93
+ }
94
+
95
+ else if (targetFramework === '.windsurf') {
96
+ const windsurfDir = path.join(projectRoot, '.windsurf', 'rules');
97
+ fs.mkdirSync(windsurfDir, { recursive: true });
98
+
99
+ for (const file of allMarkdownFiles) {
100
+ fs.writeFileSync(path.join(windsurfDir, file.name), file.content);
101
+ }
102
+ return `Successfully installed ${allMarkdownFiles.length} skills to ${windsurfDir}`;
103
+ }
104
+
105
+ else if (targetFramework === '.aider') {
106
+ const aiderFile = path.join(projectRoot, '.aider.conf.yml');
107
+ let combinedContent = "\n# --- Weavetab MCP Skills ---\n";
108
+ for (const file of allMarkdownFiles) {
109
+ // Very basic formatting for appending to Aider conf
110
+ combinedContent += `# ${file.name}\n# ${file.content.split('\n').join('\n# ')}\n\n`;
111
+ }
112
+ fs.appendFileSync(aiderFile, combinedContent);
113
+ return `Successfully appended ${allMarkdownFiles.length} skills to ${aiderFile}`;
114
+ }
115
+
116
+ else {
117
+ // Generic folder
118
+ const genericDir = path.join(projectRoot, 'weavetab-skills');
119
+ fs.mkdirSync(genericDir, { recursive: true });
120
+
121
+ for (const file of allMarkdownFiles) {
122
+ fs.writeFileSync(path.join(genericDir, file.name), file.content);
123
+ }
124
+ return `Successfully installed ${allMarkdownFiles.length} skills to ${genericDir}`;
125
+ }
126
+ }
127
+
128
+ module.exports = { installSkills };