跳到主要内容
知仓学习社ZHICANG

baoyu-url-to-markdown

技术写作员与内容创作者在沉淀网页资料时,当需要抓取包含JS动态渲染或需登录的复杂页面,使用此技能一键将其转换为干净的Markdown格式,自动提取正文与元数据,轻松构建本地知识库,让网页内容归档效率翻倍!

执行命令读凭据联网写文件严重 0 · 高危 6anbeime/skill

它会碰到什么

扫了多少6 个文本文件,47 KB
它会碰到什么执行命令读凭据联网写文件
命中总数10 处
命中统计严重 0 · 高 6 · 中 4 · 低 0
逐条看命中(6 条严重或高危)
  • scripts/cdp.ts:1exec-spawn
    import { spawn, type ChildProcess } from "node:child_process";
  • scripts/cdp.ts:125cred-envread
    const override = process.env.URL_CHROME_PATH?.trim();
  • scripts/paths.ts:11cred-envread
    return process.env.APPDATA ?? path.join(os.homedir(), "AppData", "Roaming");
  • scripts/paths.ts:16cred-envread
    return process.env.XDG_DATA_HOME ?? path.join(os.homedir(), ".local", "share");
  • scripts/paths.ts:20cred-envread
    const override = process.env.URL_DATA_DIR?.trim();
  • scripts/paths.ts:26cred-envread
    const override = process.env.URL_CHROME_PROFILE_DIR?.trim();

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

URL to Markdown

Fetches any URL via Chrome CDP and converts HTML to clean markdown.

Script Directory

Important: All scripts are located in the scripts/ subdirectory of this skill.

Agent Execution Instructions:

  1. Determine this SKILL.md file's directory path as SKILL_DIR
  2. Script path = ${SKILL_DIR}/scripts/<script-name>.ts
  3. Replace all ${SKILL_DIR} in this document with the actual path

Script Reference:

| Script | Purpose |

|--------|---------|

| scripts/main.ts | CLI entry point for URL fetching |

Preferences (EXTEND.md)

Use Bash to check EXTEND.md existence (priority order):

# Check project-level first
test -f .baoyu-skills/baoyu-url-to-markdown/EXTEND.md && echo "project"

# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-url-to-markdown/EXTEND.md" && echo "user"

┌────────────────────────────────────────────────────────┬───────────────────┐

│ Path │ Location │

├────────────────────────────────────────────────────────┼───────────────────┤

│ .baoyu-skills/baoyu-url-to-markdown/EXTEND.md │ Project directory │

├────────────────────────────────────────────────────────┼───────────────────┤

│ $HOME/.baoyu-skills/baoyu-url-to-markdown/EXTEND.md │ User home │

└────────────────────────────────────────────────────────┴───────────────────┘

┌───────────┬───────────────────────────────────────────────────────────────────────────┐

│ Result │ Action │

├───────────┼───────────────────────────────────────────────────────────────────────────┤

│ Found │ Read, parse, apply settings │

├───────────┼───────────────────────────────────────────────────────────────────────────┤

│ Not found │ Use defaults │

└───────────┴───────────────────────────────────────────────────────────────────────────┘

EXTEND.md Supports: Default output directory | Default capture mode | Timeout settings

Features

  • Chrome CDP for full JavaScript rendering
  • Two capture modes: auto or wait-for-user
  • Clean markdown output with metadata
  • Handles login-required pages via wait mode

Usage

# Auto mode (default) - capture when page loads
npx -y bun ${SKILL_DIR}/scripts/main.ts <url>

# Wait mode - wait for user signal before capture
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --wait

# Save to specific file
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> -o output.md

Options

| Option | Description |

|--------|-------------|

| <url> | URL to fetch |

| -o <path> | Output file path (default: auto-generated) |

| --wait | Wait for user signal before capturing |

| --timeout <ms> | Page load timeout (default: 30000) |

Capture Modes

| Mode | Behavior | Use When |

|------|----------|----------|

| Auto (default) | Capture on network idle | Public pages, static content |

| Wait (--wait) | User signals when ready | Login-required, lazy loading, paywalls |

Wait mode workflow:

  1. Run with --wait → script outputs "Press Enter when ready"
  2. Ask user to confirm page is ready
  3. Send newline to stdin to trigger capture

Output Format

YAML front matter with url, title, description, author, published, captured_at fields, followed by converted markdown content.

Output Directory

url-to-markdown/<domain>/<slug>.md
  • <slug>: From page title or URL path (kebab-case, 2-6 words)
  • Conflict resolution: Append timestamp <slug>-YYYYMMDD-HHMMSS.md

Environment Variables

| Variable | Description |

|----------|-------------|

| URL_CHROME_PATH | Custom Chrome executable path |

| URL_DATA_DIR | Custom data directory |

| URL_CHROME_PROFILE_DIR | Custom Chrome profile directory |

Troubleshooting: Chrome not found → set URL_CHROME_PATH. Timeout → increase --timeout. Complex pages → try --wait mode.

Extension Support

Custom configurations via EXTEND.md. See Preferences section for paths and supported options.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

它属于哪个仓库

星标★ 6,808
本站分层T1
该仓技能数84
原文件路径skills/content-creation-publisher/baoyu-url-to-markdown/SKILL.md

同一个仓库里的其他技能

看这个仓库的全部 84 个技能