agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when converting between document formats. Covers HTML to Markdown, document to Markdown, PDF generation from HTML, and preserving structure through a conversion rather than losing it. Trigger on "convert this html to markdown", "turn this docx into markdown", "make a pdf
Claude Code
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill document-conversion --agent claude-code
Codex
$ npx skills add nimadorostkar/Claude-Skills-collection --skill document-conversion -a codex -y
Cursor
$ npx skills add nimadorostkar/Claude-Skills-collection --skill document-conversion -a cursor -y
Gemini CLI
$ npx skills add nimadorostkar/Claude-Skills-collection --skill document-conversion -a gemini-cli -y
GitHub Copilot
$ npx skills add nimadorostkar/Claude-Skills-collection --skill document-conversion -a github-copilot -y
OpenCode
$ npx skills add nimadorostkar/Claude-Skills-collection --skill document-conversion -a opencode -y
Windsurf
$ npx skills add nimadorostkar/Claude-Skills-collection --skill document-conversion -a windsurf -y
name: document-conversion description: Use when converting between document formats. Covers HTML to Markdown, document to Markdown, PDF generation from HTML, and preserving structure through a conversion rather than losing it. Trigger on "convert this html to markdown", "turn this docx into markdown", "make a pdf from this html". Do not use for extracting or editing content inside a PDF — see the pdf skill; for editing .docx content, see the word-documents skill. metadata: category: documents version: 1.0.0 tags: [conversion, markdown, html, pandoc, scraping]
Convert documents between formats while preserving the structure that matters. Most conversion tools preserve the text and destroy the structure, which is usually the part you needed.
1. **Decide what must survive** — Headings and tables usually must. Fonts and exact spacing usually must not. Naming this first prevents a great deal of wasted effort on preserving things nobody needs. 2. **Extract the content, not the page** — A web page is 80% navigation, cookie banners, and related-articles rails. Convert the article, not the chrome. 3. **Use a converter that understands the structure** — A regex that strips HTML tags produces a wall of text with no headings and no tables. Use a real parser. 4. **Handle the tables specially** — They are the most commonly destroyed structure. Verify them after conversion. 5. **Verify a sample** — Open the output next to the input and compare. Conversion failures are usually silent.
**Web page to Markdown, keeping the content and discarding the page:**
import trafilatura
from markdownify import markdownify
def url_to_markdown(url: str) -> Document:
downloaded = trafilatura.fetch_url(url)
if downloaded is None:
raise ConversionError(f"could not fetch {url}")
# trafilatura identifies the main content and discards navigation, footers,
# cookie banners, and related-article rails. A hand-written CSS selector
# does this badly and breaks on every site redesign.
content_html = trafilatura.extract(
downloaded,
output_format="html",
include_tables=True, # tables are usually the point
include_links=True,
include_images=False,
favor_precision=True,
)
if content_html is None:
raise ConversionError(f"no main content identified in {url}")
metadata = trafilatura.extract_metadata(downloaded)
markdown = markdownify(
content_html,
heading_style="ATX", # ## rather than underlines
code_language_callback=lambda el: el.get("class", [""])[0].replace("language-", ""),
)
return Document(
title=metadata.title,
source_url=url, # provenance: without it, the output is unverifiable
retrieved_at=utcnow(),
markdown=markdown.strip(),
)**HTML to PDF that respects modern CSS:**
from playwright.sync_api import sync_playwright
def html_to_pdf(html: str, output: str) -> None:
"""A real browser engine. Older HTML-to-PDF libraries silently ignore
flexbox and grid, and the resulting PDF bears no resemblance to the page."""
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
page.set_content(html, wait_until="networkidle")
page.emulate_media(media="print") # apply @media print rules
page.pdf(
path=output,
format="A4",
margin={"top": "20mm", "bottom": "20mm", "left": "18mm", "right": "18mm"},
print_background=True,
display_header_footer=True,
footer_template=(
'<div style="font-size:9px;width:100%;text-align:center;color:#666">'
'<span class="pageNumber"></span> / <span class="totalPages"></span></div>'
),
)
browser.close()A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory,…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling,…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.