Communitygithub.com

bg-szy/TOP-SKILLS

Usa esta habilidad siempre que el usuario quiera hacer cualquier cosa con archivos PDF. Incluye leer o extraer texto/tablas de PDFs, combinar o fusionar varios PDFs en uno, dividir PDFs, rotar páginas, agregar marcas de agua, crear nuevos PDFs, rellenar formularios PDF, cifrar/descifrar PDFs, extraer imágenes y OCR en PDFs escaneados para hacerlos buscables. Si el usuario menciona un archivo .pdf o pide producir uno, usa esta habilidad.

¿Qué es TOP-SKILLS?

Esta habilidad proporciona una guía completa para el procesamiento de archivos PDF utilizando bibliotecas de Python y herramientas de línea de comandos. Cubre operaciones esenciales como la fusión, división, rotación de páginas, extracción de texto y tablas, creación de nuevos PDFs, protección con contraseña, marca de agua, extracción de imágenes y OCR para PDFs escaneados. La guía se basa principalmente en las bibliotecas Python pypdf, pdfplumber y reportlab, junto con herramientas de línea de comandos como pdftotext, qpdf y pdftk. Está diseñada para desarrolladores e ingenieros de software que trabajan con archivos PDF en diversos flujos de trabajo, proporcionando ejemplos de código prácticos y referencias rápidas para tareas comunes. La habilidad también dirige al usuario a archivos REFERENCE.md y FORMS.md para funciones más avanzadas y relleno de formularios.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/bg-szy/TOP-SKILLS/tree/HEAD/skills/skills/pdf

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Guía de Procesamiento de PDFs

Resumen

Esta guía cubre operaciones esenciales de procesamiento de PDFs utilizando bibliotecas de Python y herramientas de línea de comandos. Para funciones avanzadas, bibliotecas de JavaScript y ejemplos detallados, consulta REFERENCE.md. Si necesitas rellenar un formulario PDF, lee FORMS.md y sigue sus instrucciones.

Inicio Rápido

from pypdf import PdfReader, PdfWriter

# Leer un PDF
reader = PdfReader("document.pdf")
print(f"Páginas: {len(reader.pages)}")

# Extraer texto
text = ""
for page in reader.pages:
    text += page.extract_text()

Bibliotecas de Python

pypdf - Operaciones Básicas

Fusionar PDFs

from pypdf import PdfWriter, PdfReader

writer = PdfWriter()
for pdf_file in ["doc1.pdf", "doc2.pdf", "doc3.pdf"]:
    reader = PdfReader(pdf_file)
    for page in reader.pages:
        writer.add_page(page)

with open("merged.pdf", "wb") as output:
    writer.write(output)

Dividir PDF

reader = PdfReader("input.pdf")
for i, page in enumerate(reader.pages):
    writer = PdfWriter()
    writer.add_page(page)
    with open(f"page_{i+1}.pdf", "wb") as output:
        writer.write(output)

Extraer Metadatos

reader = PdfReader("document.pdf")
meta = reader.metadata
print(f"Título: {meta.title}")
print(f"Autor: {meta.author}")
print(f"Asunto: {meta.subject}")
print(f"Creador: {meta.creator}")

Rotar Páginas

reader = PdfReader("input.pdf")
writer = PdfWriter()

page = reader.pages[0]
page.rotate(90)  # Rotar 90 grados en sentido horario
writer.add_page(page)

with open("rotated.pdf", "wb") as output:
    writer.write(output)

pdfplumber - Extracción de Texto y Tablas

Extraer Texto con Diseño

import pdfplumber

with pdfplumber.open("document.pdf") as pdf:
    for page in pdf.pages:
        text = page.extract_text()
        print(text)

Extraer Tablas

with pdfplumber.open("document.pdf") as pdf:
    for i, page in enumerate(pdf.pages):
        tables = page.extract_tables()
        for j, table in enumerate(tables):
            print(f"Tabla {j+1} en la página {i+1}:")
            for row in table:
                print(row)

Extracción Avanzada de Tablas

import pandas as pd

with pdfplumber.open("document.pdf") as pdf:
    all_tables = []
    for page in pdf.pages:
        tables = page.extract_tables()
        for table in tables:
            if table:  # Verificar si la tabla no está vacía
                df = pd.DataFrame(table[1:], columns=table[0])
                all_tables.append(df)

# Combinar todas las tablas
if all_tables:
    combined_df = pd.concat(all_tables, ignore_index=True)
    combined_df.to_excel("extracted_tables.xlsx", index=False)

reportlab - Crear PDFs

Creación Básica de PDF

from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas

c = canvas.Canvas("hello.pdf", pagesize=letter)
width, height = letter

# Añadir texto
c.drawString(100, height - 100, "¡Hola Mundo!")
c.drawString(100, height - 120, "Este es un PDF creado con reportlab")

# Añadir una línea
c.line(100, height - 140, 400, height - 140)

# Guardar
c.save()

Crear PDF con Múltiples Páginas

from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak
from reportlab.lib.styles import getSampleStyleSheet

doc = SimpleDocTemplate("report.pdf", pagesize=letter)
styles = getSampleStyleSheet()
story = []

# Agregar contenido
title = Paragraph("Título del Informe", styles['Title'])
story.append(title)
story.append(Spacer(1, 12))

body = Paragraph("Este es el cuerpo del informe. " * 20, styles['Normal'])
story.append(body)
story.append(PageBreak())

# Página 2
story.append(Paragraph("Página 2", styles['Heading1']))
story.append(Paragraph("Contenido para la página 2", styles['Normal']))

# Construir PDF
doc.build(story)

Subíndices y Superíndices

IMPORTANTE: Nunca uses caracteres Unicode de subíndice/superíndice (₀₁₂₃₄₅₆₇₈₉, ⁰¹²³⁴⁵⁶⁷⁸⁹) en PDFs de ReportLab. Las fuentes incorporadas no incluyen estos glifos, lo que hace que se representen como cuadros negros sólidos.

En su lugar, usa las etiquetas XML de ReportLab en objetos Paragraph:

from reportlab.platypus import Paragraph
from reportlab.lib.styles import getSampleStyleSheet

styles = getSampleStyleSheet()

# Subíndices: usa la etiqueta <sub>
chemical = Paragraph("H<sub>2</sub>O", styles['Normal'])

# Superíndices: usa la etiqueta <super>
squared = Paragraph("x<super>2</super> + y<super>2</super>", styles['Normal'])

Para texto dibujado en canvas (no objetos Paragraph), ajusta manualmente el tamaño y la posición de la fuente en lugar de usar subíndices/superíndices Unicode.

Herramientas de Línea de Comandos

pdftotext (poppler-utils)

# Extraer texto
pdftotext input.pdf output.txt

# Extraer texto preservando el diseño
pdftotext -layout input.pdf output.txt

# Extraer páginas específicas
pdftotext -f 1 -l 5 input.pdf output.txt  # Páginas 1-5

qpdf

# Fusionar PDFs
qpdf --empty --pages file1.pdf file2.pdf -- merged.pdf

# Dividir páginas
qpdf input.pdf --pages . 1-5 -- pages1-5.pdf
qpdf input.pdf --pages . 6-10 -- pages6-10.pdf

# Rotar páginas
qpdf input.pdf output.pdf --rotate=+90:1  # Rotar página 1 90 grados

# Eliminar contraseña
qpdf --password=mypassword --decrypt encrypted.pdf decrypted.pdf

pdftk (si está disponible)

# Fusionar
pdftk file1.pdf file2.pdf cat output merged.pdf

# Dividir
pdftk input.pdf burst

# Rotar
pdftk input.pdf rotate 1east output rotated.pdf

Tareas Comunes

Extraer Texto de PDFs Escaneados

# Requiere: pip install pytesseract pdf2image
import pytesseract
from pdf2image import convert_from_path

# Convertir PDF a imágenes
images = convert_from_path('scanned.pdf')

# OCR cada página
text = ""
for i, image in enumerate(images):
    text += f"Página {i+1}:\n"
    text += pytesseract.image_to_string(image)
    text += "\n\n"

print(text)

Agregar Marca de Agua

from pypdf import PdfReader, PdfWriter

# Crear marca de agua (o cargar existente)
watermark = PdfReader("watermark.pdf").pages[0]

# Aplicar a todas las páginas
reader = PdfReader("document.pdf")
writer = PdfWriter()

for page in reader.pages:
    page.merge_page(watermark)
    writer.add_page(page)

with open("watermarked.pdf", "wb") as output:
    writer.write(output)

Extraer Imágenes

# Usando pdfimages (poppler-utils)
pdfimages -j input.pdf output_prefix

# Esto extrae todas las imágenes como output_prefix-000.jpg, output_prefix-001.jpg, etc.

Protección con Contraseña

from pypdf import PdfReader, PdfWriter

reader = PdfReader("input.pdf")
writer = PdfWriter()

for page in reader.pages:
    writer.add_page(page)

# Agregar contraseña
writer.encrypt("userpassword", "ownerpassword")

with open("encrypted.pdf", "wb") as output:
    writer.write(output)

Referencia Rápida

TareaMejor HerramientaComando/Código
Fusionar PDFspypdfwriter.add_page(page)
Dividir PDFspypdfUn archivo por página
Extraer textopdfplumberpage.extract_text()
Extraer tablaspdfplumberpage.extract_tables()
Crear PDFsreportlabCanvas o Platypus
Fusión en línea de comandosqpdfqpdf --empty --pages ...
OCR PDFs escaneadospytesseractConvertir a imagen primero
Rellenar formularios PDFpdf-lib o pypdf (ver FORMS.md)Ver FORMS.md

Próximos Pasos

  • Para uso avanzado de pypdfium2, consulta REFERENCE.md
  • Para bibliotecas de JavaScript (pdf-lib), consulta REFERENCE.md
  • Si necesitas rellenar un formulario PDF, sigue las instrucciones en FORMS.md
  • Para guías de solución de problemas, consulta REFERENCE.md

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

bg-szy/TOP-SKILLS

Brand-first landing page designer — runs a brand-identity interview (colors, typography, shape language), then generates and iterates on a polished landing page via Stitch with deployment-ready HTML. Use when the user asks to create, design, or build a landing page, homepage, or marketing page and has no established visual direction. Skip when they have a design mockup, need a dashboard or app UI, are working at component level, building a multi-page app, or restyling with known design tokens — use frontend-design instead.

bg-szy/TOP-SKILLS

Fill out Microsoft Azure Landing Zone (ALZ) Accelerator checklists by interviewing the user, mapping their Azure subscriptions, integrating IP addressing documentation, and applying Microsoft Cloud Adoption Framework best practices. Produces a completed Excel checklist (.xlsx) ready for ALZ deployment. Use this skill whenever the user mentions Azure Landing Zone, ALZ checklist, landing zone accelerator, platform landing zone configuration, ALZ bootstrap, hub-and-spoke setup, Azure network topology planning, or wants to fill out any ALZ-related checklist or configuration file. Also trigger when the user uploads an Excel file that contains tabs like "Accelerator - Bootstrap", "Accelerator - Bicep", or "Accelerator - Terraform".

bg-szy/TOP-SKILLS

Compose a premium, animated landing page section by section in Next.js + Tailwind + Motion (Framer Motion) — built on a real design system, with editorial copy and motion that feels human-crafted, not template-generated. Use when building or rebuilding a landing page, marketing site, or hero/feature/pricing/CTA sections that need to look production-ready and bespoke from day one.

bg-szy/TOP-SKILLS

Write high-converting landing page copy using proven frameworks like PAS (Problem-Agitate-Solution), AIDA, and StoryBrand. Creates headlines, value propositions, CTAs, and full page sections optimized for conversion. Use when users need landing page copy, sales page content, or marketing website text.

bg-szy/TOP-SKILLS

Optimize landing pages for conversions, performance, and SEO. Use when improving landing pages, increasing conversions, or optimizing page performance.

bg-szy/TOP-SKILLS

Review investment portfolios for risk, diversification, fees. Asset allocation recommendations, tax-loss harvesting, rebalancing.

bg-szy/TOP-SKILLS

Beads Viewer - Graph-aware triage engine for Beads projects. Computes PageRank, betweenness, critical path, and cycles. Use --robot-* flags for AI agents.

bg-szy/TOP-SKILLS

CI red? Call us. Pipeline fire brigade deploys. Use when user mentions CI failures, build errors, test failures, or pipeline issues. Do NOT load for: local builds, standard implementation work, reviews, or setup.

bg-szy/TOP-SKILLS

CASS Memory System - procedural memory for AI coding agents. Three-layer cognitive architecture with confidence decay, anti-pattern learning, cross-agent knowledge transfer, trauma guard safety system. Bun/TypeScript CLI.

bg-szy/TOP-SKILLS

Mandatory entry point: read this first for any request to make, create, edit, animate, or render a video, animation, or motion graphic, including a promo, explainer, captioned clip, title card, overlay, slideshow or interactive deck, Remotion port, or any HyperFrames HTML composition. Also use it to inspect, diagnose, validate, preview, publish, or batch-render an existing HyperFrames project. Inputs may be a website URL, GitHub PR, Figma design or URL, text or brief, existing footage, or music. It resumes project state, captures intent when applicable, selects and installs the owning workflow, and routes domain capabilities. HyperFrames is the default output framework unless the user explicitly chooses another framework for the deliverable or asks only to record a browser session.

bg-szy/TOP-SKILLS

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

bg-szy/TOP-SKILLS

Use when the user asks to "pre-launch check the landing page", "run a Quality-Score preflight", or "verify ad-to-page message match before launch"; produces an ad↔page continuity report — message-match gaps, above-the-fold check, page-speed read, form-friction count, mobile-render flags — as a pass/fix punch list. Not for redesigning or rewriting the page — use landing-optimizer; not for scoring the account or the RQS — use ad-account-auditor. 落地页体验预检/广告落地页一致性检查

bg-szy/TOP-SKILLS

Use when the user asks to "optimize our landing page for influencer traffic", "fix our promo-code landing page", or "improve conversion from a creator campaign"; produces a message-match audit, page-structure and social-proof recommendations, a promo-code/CTA conversion plan, and an A/B test roadmap. Not for measuring campaign results after launch — use performance-analyzer.

bg-szy/TOP-SKILLS

Audit a landing page, sales page or checkout page for conversion leaks and return a fix list ordered by expected revenue impact. Use when asked to review, critique or improve a landing page, sales page, opt-in page, product page or checkout flow, when conversion rate is low, when paid traffic is not converting, or when someone asks "why isn't this page converting" or wants a CRO / landing page review.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

Account assets, equity and fund positions, P&L, cash flow records, account statements, margin ratios, buy-power estimates, order management, and DCA recurring investments via Longbridge (most require Trade permission). Frameworks: portfolio diagnosis, rebalancing, asset allocation, risk analysis (VaR/CVaR), performance attribution, and tax-loss harvesting. Triggers: "持仓", "账户", "盈亏", "资产", "对账单", "下单", "买入", "卖出", "撤单", "定投", "组合诊断", "再平衡", "资产配置", "风险分析", "绩效归因", "税损收割", "持倉", "賬戶", "盈虧", "對賬單", "下單", "買入", "賣出", "組合診斷", "再平衡", "稅損收割", "positions", "portfolio", "P&L", "order", "buy", "sell", "DCA", "statement", "risk analysis", "rebalancing", "tax harvesting", "我的风险", "持仓风险", "风险敞口", "資產", "資產配置", "風險分析", "績效歸因", "撤單

bg-szy/TOP-SKILLS

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

bg-szy/TOP-SKILLS

Process video files with audio extraction, format conversion (mp4, webm), and Whisper transcription. Use when user mentions video conversion, audio extraction, transcription, mp4, webm, ffmpeg, or whisper transcription.

Skills relacionados