
Brave Search
Give your coding agent lightweight headless web search and markdown page extraction via Brave Search—no browser—for docs, facts, and URLs.
Overview
Brave Search is an agent skill most often used in Idea (also Build, Launch) that searches the web and extracts page markdown via the Brave Search API without a browser.
Install
npx skills add https://github.com/steipete/agent-scripts --skill brave-searchWhat is this skill?
- search.js: basic search (5 results), -n for count, --content for markdown body snippets
- content.js: fetch URL and extract readable markdown via Readability + Turndown
- One-time setup: npm ci in skill folder; requires BRAVE_API_KEY
- No interactive browser—Brave Search API only
- Structured output blocks: Title, Link, Snippet, optional Content per result
- Default 5 search results per query; -n flag increases count
Adoption & trust: 848 installs on skills.sh; 4.3k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent cannot reach live documentation or current web facts because you lack a simple, scriptable search integration.
Who is it for?
Solo builders who already use agent-scripts and want fast API search plus URL-to-markdown for RAG-style agent turns.
Skip if: Sites behind heavy JS paywalls, tasks needing logged-in sessions, or teams that require on-prem search with no third-party API key.
When should I use this skill?
User needs web search, documentation lookup, facts, or URL content extraction without interactive browser; Brave Search API workflow.
What do I get? / Deliverables
You get titled search results and optional markdown page content from Brave so the agent can cite and reason over fresh web sources.
- Formatted search result blocks (title, link, snippet)
- Optional markdown page content from URLs
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Research is the first canonical shelf because search is the default early journey need, but the same scripts support Build doc lookup and Launch fact-checking. Discover/research subphase covers competitor, API, and documentation retrieval before you commit to implementation choices.
Where it fits
Run ./search.js on competitor positioning before choosing a niche.
Pull official API docs with --content into the agent context for SDK wiring.
Fact-check pricing or feature claims on a landing page draft via content.js.
How it compares
Skill-packaged CLI scripts with Brave API—not a browser automation skill and not an MCP search server.
Common Questions / FAQ
Who is brave-search for?
Developers running steipete/agent-scripts skills who want headless search and content extraction inside terminal-based agent workflows.
When should I use brave-search?
Use in Idea for market/docs research, in Build for API references, in Launch for verifying claims—whenever you need web search without interactive browsing.
Is brave-search safe to install?
It calls external APIs with your BRAVE_API_KEY and runs npm dependencies—review the Security Audits panel on this Prism page and rotate keys appropriately.
SKILL.md
READMESKILL.md - Brave Search
node_modules/ --- name: brave-search description: Web search and content extraction via Brave Search API. Use for searching documentation, facts, or any web content. Lightweight, no browser required. --- # Brave Search Headless web search and content extraction using Brave Search. No browser required. ## Setup Run once before first use: ```bash cd ~/Projects/agent-scripts/skills/brave-search npm ci ``` Needs env: `BRAVE_API_KEY`. ## Search ```bash ./search.js "query" # Basic search (5 results) ./search.js "query" -n 10 # More results ./search.js "query" --content # Include page content as markdown ./search.js "query" -n 3 --content # Combined ``` ## Extract Page Content ```bash ./content.js https://example.com/article ``` Fetches a URL and extracts readable content as markdown. ## Output Format ``` --- Result 1 --- Title: Page Title Link: https://example.com/page Snippet: Description from search results Content: (if --content flag used) Markdown content extracted from the page... --- Result 2 --- ... ``` ## When to Use - Searching for documentation or API references - Looking up facts or current information - Fetching content from specific URLs - Any task requiring web search without interactive browsing #!/usr/bin/env node import { Readability } from "@mozilla/readability"; import { JSDOM } from "jsdom"; import TurndownService from "turndown"; import { gfm } from "turndown-plugin-gfm"; const url = process.argv[2]; if (!url) { console.log("Usage: content.js <url>"); console.log("\nExtracts readable content from a webpage as markdown."); console.log("\nExamples:"); console.log(" content.js https://example.com/article"); console.log(" content.js https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html"); process.exit(1); } function htmlToMarkdown(html) { const turndown = new TurndownService({ headingStyle: "atx", codeBlockStyle: "fenced" }); turndown.use(gfm); turndown.addRule("removeEmptyLinks", { filter: (node) => node.nodeName === "A" && !node.textContent?.trim(), replacement: () => "", }); return turndown .turndown(html) .replace(/\[\\?\[\s*\\?\]\]\([^)]*\)/g, "") .replace(/ +/g, " ") .replace(/\s+,/g, ",") .replace(/\s+\./g, ".") .replace(/\n{3,}/g, "\n\n") .trim(); } try { const response = await fetch(url, { headers: { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.9", }, signal: AbortSignal.timeout(15000), }); if (!response.ok) { console.error(`HTTP ${response.status}: ${response.statusText}`); process.exit(1); } const html = await response.text(); const dom = new JSDOM(html, { url }); const reader = new Readability(dom.window.document); const article = reader.parse(); if (article && article.content) { if (article.title) { console.log(`# ${article.title}\n`); } console.log(htmlToMarkdown(article.content)); process.exit(0); } // Fallback: try to extract main content const fallbackDoc = new JSDOM(html, { url }); const body = fallbackDoc.window.document; body.querySelectorAll("script, style, noscript, nav, header, footer, aside").forEach(el => el.remove()); const title = body.querySelector("title")?.textContent?.trim(); const main = body.querySelector("main, article, [role='main'], .content, #content") || body.body; if (title) { console.log(`# ${title}\n`); } const text = main?.innerHTML || ""; if (text.trim().length > 100) { console.log(htmlToMarkdown(text)); } else { console.error("Could not extract readable content from this page."); process.exit(1); } } catch (e) { console.error(`Error: ${e.message}`); process.exit(1); } { "name": "brave-search", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "