Defuddle
Extract clean markdown content from web pages using Defuddle CLI, removing clutter and navigation to save tokens. Use instead of WebFetch when the user provides a URL to read or analyze, for online documentation, articles, blog posts, or any standard web page.
npx skills add github:pantheon-org/tekhne --skill documentation--obsidian--defuddleUse Defuddle CLI to extract clean readable content from web pages. Prefer over WebFetch for standard web pages — it removes navigation, ads, and clutter, reducing token usage.
If not installed: npm install -g defuddle
Mindset
Defuddle is a server-side HTML stripper, not a browser. Think of it as getting the printed article without the magazine wrapper — it fetches raw HTML and removes boilerplate, always faster and cheaper than WebFetch for standard pages.
When to apply: Any standard HTTP page — documentation, articles, blog posts, wikis. When NOT to apply: SPAs requiring JavaScript, login-gated pages, JSON API endpoints, or pages behind auth redirects.
When in doubt, try defuddle first; if the output is empty or navigation-only, fall back to WebFetch.
Quick Start
- Confirm the URL is a standard web page (not a SPA or auth-required page)
- Run
defuddle parse <url> --mdto extract clean markdown - If output is empty or only navigation text, fall back to WebFetch
- Save output with
-o file.mdwhen persistence is needed
When to Use
Use this decision framework before fetching any URL:
| Scenario | Tool | Reason |
|---|---|---|
| Article, blog post, documentation page | defuddle (ALWAYS) | Removes clutter, saves tokens |
| Standard web page with readable text | defuddle (ALWAYS) | Cleaner output than WebFetch |
| JavaScript-heavy SPA (React/Vue app shell) | WebFetch or inform user | defuddle cannot execute JS |
| Login-gated or auth-required page | WebFetch or inform user | defuddle fetches without credentials |
| API endpoint returning JSON | Direct fetch or inform user | defuddle is for HTML pages |
| User asks for metadata only (title, description) | defuddle parse <url> -p <field> |
Lightweight extraction |
Mental model: defuddle is a server-side HTML parser — it downloads the HTML, strips boilerplate, and returns clean prose. It cannot authenticate, execute JavaScript, or follow redirects that require cookies. When in doubt about a URL, try defuddle first; if the output is empty or only navigation text, fall back to WebFetch.
Usage
ALWAYS use --md for markdown output:
defuddle parse <url> --md
Save to file:
defuddle parse <url> --md -o content.md
Extract specific metadata:
defuddle parse <url> -p title
defuddle parse <url> -p description
defuddle parse <url> -p domain
Output formats
| Flag | Format |
|---|---|
--md |
Markdown (default choice) |
--json |
JSON with both HTML and markdown |
| (none) | HTML |
-p <name> |
Specific metadata property |
Common Mistakes
See ANTI-PATTERNS.md for full explanations of each mistake.
1. Using WebFetch when defuddle is available
NEVER use WebFetch for standard web pages when defuddle is available. Raw HTML commonly contains 5-10x more tokens than the extracted content.
BAD:
WebFetch("https://docs.example.com/guide")
GOOD:
defuddle parse https://docs.example.com/guide --md
2. Omitting the --md flag
NEVER call defuddle parse without --md when readable content is the goal. Without it, defuddle returns raw HTML — tag-heavy and token-wasteful.
BAD:
defuddle parse https://example.com/article
GOOD:
defuddle parse https://example.com/article --md
3. Using -p when full content is needed
NEVER use -p when the user wants the page body. It returns one metadata property and silently discards the entire body text.
BAD:
defuddle parse https://example.com/article -p title
GOOD:
defuddle parse https://example.com/article --md
4. Using shell redirection instead of -o
NEVER use > to save output — it can corrupt encoding on non-UTF-8 terminals. Always use -o.
BAD:
defuddle parse https://example.com/article --md > output.md
GOOD:
defuddle parse https://example.com/article --md -o output.md
References
Explicit NEVER/WHY/consequence triplets with side-by-side bad/good examples. Generic warnings score low — concrete failure modes with real impact (security, correctness, performance) score high.
Runtime validation via eval scenarios proving the skill actually changes agent behaviour. Requires evals/ directory, instructions.json, ≥3 scenarios, and ≥80% instruction coverage in summary.json.
Appropriate rigidity for the skill type: strict rules for critical/security skills, balanced steps for process skills, flexible options for tool skills. Mismatched calibration (too rigid or too loose) reduces score.
Expert-only knowledge the AI couldn't derive on its own — domain-specific patterns, production gotchas, decision frameworks, and non-obvious tool behaviour. High scores mean <5% redundancy with what the model already knows.
A clear philosophy plus numbered step-by-step workflows with explicit entry/exit points. Should answer: what is the core principle, how to execute it, and when (and when not) to apply it.
Rich activation keywords and trigger scenarios in the description so the skill fires when needed. Best descriptions read like an exhaustive list of the tasks and concepts that should invoke this skill.
Copy-paste-ready code, complete runnable examples, real file paths and commands. Pseudocode and abstract descriptions score low — concrete, executable content scores high.
SKILL.md as a <100-line navigation hub pointing to focused references/ files. Content should be lazy-loaded on demand, not front-loaded. Includes actionable 'When to Use' conditions per reference.
Proper frontmatter, single-task focus, activation keywords, and cross-harness portability. Skills must work across 40+ agentic harnesses without hardcoded paths or agent-specific references.
Expert-only knowledge the AI couldn't derive on its own — domain-specific patterns, production gotchas, decision frameworks, and non-obvious tool behaviour. High scores mean <5% redundancy with what the model already knows.
A clear philosophy plus numbered step-by-step workflows with explicit entry/exit points. Should answer: what is the core principle, how to execute it, and when (and when not) to apply it.
Explicit NEVER/WHY/consequence triplets with side-by-side bad/good examples. Generic warnings score low — concrete failure modes with real impact (security, correctness, performance) score high.
Proper frontmatter, single-task focus, activation keywords, and cross-harness portability. Skills must work across 40+ agentic harnesses without hardcoded paths or agent-specific references.
SKILL.md as a <100-line navigation hub pointing to focused references/ files. Content should be lazy-loaded on demand, not front-loaded. Includes actionable 'When to Use' conditions per reference.
Appropriate rigidity for the skill type: strict rules for critical/security skills, balanced steps for process skills, flexible options for tool skills. Mismatched calibration (too rigid or too loose) reduces score.
Rich activation keywords and trigger scenarios in the description so the skill fires when needed. Best descriptions read like an exhaustive list of the tasks and concepts that should invoke this skill.
Copy-paste-ready code, complete runnable examples, real file paths and commands. Pseudocode and abstract descriptions score low — concrete, executable content scores high.
Runtime validation via eval scenarios proving the skill actually changes agent behaviour. Requires evals/ directory, instructions.json, ≥3 scenarios, and ≥80% instruction coverage in summary.json.
No eval scenarios available.
Defuddle Anti-Patterns
Extended explanations for the Common Mistakes in SKILL.md.
1. Using WebFetch when defuddle is available
WHY this matters: Raw HTML pages commonly contain 5-10x more tokens than the extracted article content. Navigation menus, sidebars, cookie banners, footers, and inline ads all contribute to the token count. Defuddle strips these before the content reaches the context window, directly reducing cost and improving the signal-to-noise ratio of the response.
2. Omitting the --md flag
WHY this matters: HTML output retains tags (<p>, <div>, <span>), attributes, inline styles, and entity references. The model must parse this mentally, consuming context window space that could be used for reasoning. Markdown output is compact, readable, and structurally clear — it is almost always the right format for downstream text processing.
3. Using -p metadata extraction when full content is needed
WHY this matters: The -p flag is designed for lightweight property extraction (e.g., getting just the title or description for a preview). When it is used by mistake for full-content retrieval, the body of the article is not included in the output at all. The model will respond with only the title or description string while the user expects the full article — a silent, confusing failure.
4. Using shell redirection instead of the -o flag
WHY this matters: Shell redirection (>) routes stdout directly to the file system and bypasses any encoding, buffering, or file-writing logic that the defuddle process uses internally. On non-UTF-8 terminals or systems with non-default locales, this can introduce encoding mismatches, corrupt multi-byte characters, or strip byte-order marks. The -o flag delegates file writing to defuddle itself, which handles encoding correctly across platforms.