---
name: "readability-lxml-content-cleaner"
description: "Isolate primary readable content from complex web layouts using Mozilla Readability port."
metadata:
  author: "Buriy"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "extract article with readability"
  - "isolate main content html"
  - "strip web page sidebars"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Readability Python Primary Content Extractor

Leverages python-readability (lxml): identifying the primary content container based on text-to-tag density heuristics, stripping sidebars, and extracting clean article HTML titles and summaries.

## When to Invoke
Invoke this skill whenever you need to:
- extract article with readability
- isolate main content html
- strip web page sidebars

## Execution SOP & Rules
1. Initialize document with doc = Document(raw_html).
2. Retrieve clean article HTML with doc.summary() and title with doc.title().
3. Strip remaining styling attributes and convert to Markdown for LLM summarization.
4. Handle pages with low text density by falling back to full DOM extraction.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
