skill-tools

Local Node.js tools for web knowledge gathering and processing: search PDFs and images, stream-download and validate files, convert PDFs to structured Markdown, and generate speech locally with Supertone Supertonic ONNX Runtime. Use when Codex needs no-API-key search, safe file downloads, PDF text extraction, or on-device TTS (with a one-time model download to ./models/supertonic-2/).

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "skill-tools" with this command: npx skills add gafapa/skill-tools/gafapa-skill-tools-skill-tools

skill-tools

Use this skill as a local utility toolkit for search, file acquisition, PDF conversion, and TTS.

Setup

Install dependencies from the skill directory:

npm install

Import functions in ESM:

import {
  searchPDFs,
  searchImages,
  downloadFile,
  convertPdfToMarkdown,
  generateSpeech,
} from './index.js';

Functions

searchPDFs(query, limit = 10)

  • Uses Bing HTML search (not DuckDuckGo).
  • Returns Array<{ title, url }> filtered to .pdf URLs.
  • Returns [] on recoverable failures.
  • Includes a short randomized delay to reduce bot blocking.
const pdfs = await searchPDFs('machine learning tutorial', 5);

searchImages(query, limit = 10)

  • Uses google-img-scrap.
  • Returns Array<{ title, url }>.
  • Returns [] on recoverable failures.
const images = await searchImages('space wallpaper hd', 3);

downloadFile(url, outputDir, expectedType)

Stream-downloads to disk, validates content type using magic bytes, and fixes file extension.

  • expectedType: 'pdf' | 'image'
  • Returns saved file path on success, null on failure
  • Caller should ensure outputDir exists first
import fs from 'node:fs/promises';

await fs.mkdir('./downloads', { recursive: true });
const localPath = await downloadFile(pdfs[0].url, './downloads', 'pdf');

convertPdfToMarkdown(pdfPath, options?)

Converts PDFs to Markdown using unpdf (Mozilla PDF.js) with heuristics for headings, paragraphs, bullets, and URL repair.

Options (defaults shown):

  • detectHeadings = true
  • joinParagraphs = true
  • normaliseBullets = true
  • fixBrokenUrls = true
  • includeMetadata = false

Returns Markdown string on success, null on failure.

const md = await convertPdfToMarkdown('./report.pdf', { includeMetadata: true });

generateSpeech(text, outputPath, options?)

Generates a WAV file locally using Supertone Supertonic ONNX models (onnxruntime-node).

Automatic download on first use (Supertonic 2):

  • ONNX assets to ./models/supertonic-2/onnx/
  • Voice style JSON to ./models/supertonic-2/voice_styles/

Supported options:

  • voice (default 'F1'): F1-F5, M1-M5, or a local voice-style JSON path
  • lang (default 'en'): en, ko, es, pt, fr
  • speed (default 1.0)
  • steps (default 20)
  • useGpu (default false, currently unsupported)
  • modelRoot (default ./models/supertonic-2)

Returns output WAV path on success, null on failure.

await generateSpeech('Hello!', './out.wav', {
  voice: 'M2',
  lang: 'en',
  speed: 1.1,
  steps: 10,
});

End-to-end example

import fs from 'node:fs/promises';
import {
  searchPDFs,
  downloadFile,
  convertPdfToMarkdown,
  generateSpeech,
} from './index.js';

await fs.mkdir('./downloads', { recursive: true });

const [first] = await searchPDFs('javascript guide', 3);
const pdfPath = await downloadFile(first.url, './downloads', 'pdf');
const markdown = await convertPdfToMarkdown(pdfPath, { includeMetadata: true });

await fs.writeFile(pdfPath.replace('.pdf', '.md'), markdown);
await generateSpeech(markdown.slice(0, 400), './summary.wav', { voice: 'F1', lang: 'en' });

Testing

Use the fast suite by default:

npm test

Integration suites are explicit and opt-in:

npm run test:integration:search  # requires RUN_NETWORK_TESTS=1
npm run test:integration:tts     # requires RUN_TTS_INTEGRATION=1

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

github-tools

Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.

Archived SourceRecently Updated
Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated