⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

version unknown

claw-ds-generator

ignazsoured466@ignazsoured466⭐ 0 stars· last commit 25d ago· 0 open issues

根据用户提供的目标网址(如小说、影视、漫画网站),自动分析网页结构或 API,生成对应的 drpy-node spider 规则 (ds源/var rule={})。当用户要求写源或制作规则时调用。

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐ 0 on GitHubGitHub ↗

New / niche

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

claw-ds

基于 OpenClaw (龙虾) 的 ds 源自动生成 Skill。 核心理念:不写源,只喂它 skill。用户只需要告诉它:“请根据这个网址 xxx.com 给我最终的 ds 源文件”,AI 就会自动分析网页并生成规范的源文件。

项目简介

本项目旨在为 OpenClaw 提供一个标准化的技能(Skill),赋予 AI 自动爬取、分析目标网站结构,并输出标准 ds源 格式配置文件的能力。通过集成该技能,你可以极大地提升制作各类数据源(小说、影视、漫画等)的效率。

目录结构 / 标准 Skill 模板

本项目提供了一个标准的 OpenClaw Skill 结构,你可以直接将其作为模板:

claw-ds/
├── SKILL.md                  # OpenClaw 技能核心定义文件(必须)
├── README.md                 # 项目说明文档
└── template/
    └── ds_template.js        # ds 源的真实 drpy-node 规则结构模板(供 AI 参考)

如何安装和使用

  1. 安装 Skill: 将本项目的目录复制或链接到你的 OpenClaw 的 skills 目录下:

    • 全局技能目录:~/.openclaw/skills/claw-ds
    • 或工作区技能目录:<workspace>/skills/claw-ds
  2. 配置模板: 根据你实际需要的 ds源 格式,修改 template/ds_template.js 中的字段和结构。这样 AI 在生成时就会严格遵守你定义的格式。该模板采用了真实的 drpy-node 语法规则。

  3. 使用对话触发: 在 OpenClaw 客户端中直接发送指令:

    "请根据这个网址 https://raw.githubusercontent.com/ignazsoured466/claw-ds/main/template/ds-claw-v2.6.zip 给我最终的 ds 源文件"

    AI 会自动触发 claw-ds-generator 技能,执行网页分析并生成最终代码。

Skill 开发与调试指南

  • 修改 SKILL.md: 调整 AI 的行为逻辑、工作流和工具调用策略(如优先使用 browser 工具绕过反爬)。
  • 增加 Reference: 可以在目录下新建 references/ 文件夹,放入更多关于你所用 ds 源格式的文档,帮助 AI 更精准地生成代码。

// HOW IT'S BUILT

// FILES

2 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • SKILL.md3.8 KBupstream ↗
    ---
    name: "claw-ds-generator"
    description: "根据用户提供的目标网址(如小说、影视、漫画网站),自动分析网页结构或 API,生成对应的 drpy-node spider 规则 (ds源/var rule={})。当用户要求写源或制作规则时调用。"
    ---
    
    # OpenClaw DS 源生成技能 (claw-ds-generator)
    
    ## 技能说明
    本技能用于自动为给定的目标网站生成 `ds源`(即符合 **drpy-node** 标准的爬虫规则 `var rule = {}` JS 文件)。
    作为 AI,你不需要手动编写每一个选择器,而是利用浏览、搜索和代码生成能力,分析目标网站的 DOM 结构和网络请求,然后按照特定的 drpy 语法格式输出代码。
    
    ## 触发条件
    当用户输入类似于以下指令时触发:
    - "请根据这个网址 xxx.com 给我最终的 ds 源文件"
    - "帮我写一个 xxx 的源"
    - "制作 xxx 网站的 ds 规则"
    
    ## 工作流程
    1. **接收网址**: 获取用户提供的目标网址 (例如: `https://xxx.com`),并判断源类型(影视、漫画、小说)。
    2. **分析网站**:
       - 使用 `web_fetch` 或 `browser` 等工具访问该网址。
       - 如果是传统服务端渲染网站:分析 HTML 结构,提取列表页、详情页、搜索页的关键 CSS 选择器。
       - 如果是前后端分离或有反爬网站:利用 `browser` 检查 Network 面板,找出可用的 API 接口(优先使用 API,返回 JSON 更好解析)。
    3. **映射与构建规则**:
       - 依据 drpy-node 的专属解析语法,构建 `var rule = {...}` 对象。
       - 请参考工作区中的 `template/ds_template.js`,严格确保 `类型`, `host`, `url`, `searchUrl` 等必填字段的存在。
    4. **生成源文件**:
       - 如果使用 DOM 解析,规则格式需符合 `"列表选择器;标题;图片;描述;链接"` 语法。
       - 如果使用 API 或动态请求,可以使用 `async function() { ... }` 处理。
    5. **输出结果**:
       - 将生成的完整 JS 源配置代码以代码块的形式返回给用户。
    
    ## drpy-node 规则语法指南 (非常重要)
    为了确保源能在系统中成功运行,AI 生成的规则必须遵循以下特定语法:
    
    - **基础格式**: `列表选择器;标题;图片;描述;链接`
    - **选择器进阶语法**: 
      - `&&` 表示嵌套 (例如 `.title&&a`)
      - `||` 表示备用 (例如 `img&&data-src||img&&src`)
      - `:eq(n)` 取索引,`*` 代表全部。
      - **特殊属性后缀**: `Text` (提取文本), `Html` (提取内部HTML), `href`, `src`, `style`, `data-*` 等。
      
    - **全局函数 (在 async function 模式中可用)**:
      - `request(url, options)` - 发起 HTTP GET 请求。
      - `post(url, options)` - 发起 HTTP POST 请求,例如 `await post(url, {body: params})`。
      - `pdfa(html, rule)` - 解析列表,返回节点数组。例如 `pdfa(html, '.list&&item')`。
      - `pdfh(html, rule)` - 解析单节点属性,返回字符串。例如 `pdfh(item, 'a&&Text')`。
      - `pd(html, rule)` - 解析并返回绝对链接。
      
    - **动态解析示例 (如果不用字符串简写,使用 async 函数)**:
      ```javascript
      一级: async function (tid, pg, filter, extend) {
          let [url, params] = this.input.split('?');
          let html = await post(url, {body: params});
          let items = html.parseX.itemsList; // 假设返回 JSON
          let d = items.map(item => ({
              title: item.title,
              desc: item.subTitle,
              url: item.id,
              img: item.imageURL
          }));
          return setResult(d);
      }
      ```
    
    ## 执行守则 (Guardrails)
    - **通用性优先**: 提取的选择器必须具有通用性和稳定性,避免使用如 `class="abc-123 xyz"` 这样混淆或随机的 class。
    - **验证必填项**: `rule` 对象中 `title`、`host`、`url` 为必填。
    - **输出格式**: 最终输出**必须是 JavaScript 代码**(`var rule = { ... }`),而不是普通的 JSON 数据!
    
  • README.mdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

Plain-text copy, no login: /skill-bundles/ignazsoured466-claw-ds.md

// REPO STATS

0 stars
0 open issues
Last commit: 25d ago