Communitygithub.com

bg-szy/TOP-SKILLS

Crea, lee, edita y manipula documentos de Word (.docx) y plantillas (.dotx) usando scripts y herramientas de línea de comandos.

¿Qué es TOP-SKILLS?

Esta habilidad especializada te permite trabajar con documentos de Word (.docx) y plantillas (.dotx) directamente desde la línea de comandos o scripts automatizados. Es ideal para desarrolladores y agentes de IA que necesitan generar informes, memorandos, cartas o cualquier documento profesional con formato complejo (tablas de contenido, encabezados, números de página, membretes, imágenes, comentarios y control de cambios). Soporta tres enfoques principales: crear documentos nuevos con la biblioteca npm `docx` (consejos incluidos para evitar errores comunes), editar documentos existentes descomprimiendo el archivo ZIP y modificando directamente el XML, y leer contenido usando `pandoc`. Incluye scripts auxiliares para fusionar fragmentos de texto (`merge_runs.py`), gestionar comentarios (`comment.py`), validar contra el esquema XSD (`validate.py`) y aceptar cambios controlados (`accept_changes.py`). También permite convertir documentos antiguos .doc a .docx mediante LibreOffice y verificar el resultado convirtiendo a PDF e inspeccionando las páginas como imágenes.

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

Preguntar en tu IA favorita

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

Documentación

Creación, edición y análisis de DOCX

Un .docx es un archivo ZIP que contiene archivos XML. Elige tu enfoque según la tarea:

TareaEnfoque
Crear un documento nuevoEscribe un script con docx (npm) — consulta las trampas a continuación
Editar un documento existenteunzip → editar word/document.xml → zip (docx-js no puede abrir archivos existentes)
Leer contenidopandoc -t markdown file.docx

Las rutas de los scripts a continuación son relativas al directorio de esta habilidad.

Crear con docx-js — trampas

docx está preinstalado — no ejecutes npm install primero; escribe el script y usa require('docx') directamente. Solo si ese require falla: npm install docx. El modelo conoce la API; estos son los puntos conflictivos:

  • El tamaño de página predeterminado es A4. Para Carta EE.UU. usa page: { size: { width: 12240, height: 15840 } } (DXA; 1440 = 1″).
  • Apaisado: pasa las dimensiones verticales y orientation: PageOrientation.LANDSCAPE — docx-js intercambia ancho/alto internamente.
  • Las tablas necesitan dos anchos: establece columnWidths en la tabla Y width en cada celda, ambos en WidthType.DXA (PERCENTAGE falla en Google Docs). Los anchos de columna deben sumar el ancho de la tabla.
  • Sombreado de tabla: usa ShadingType.CLEAR, nunca SOLID (se renderiza en negro).
  • Listas: nunca insertes • literalmente; usa una configuración de numbering con LevelFormat.BULLET.
  • ImageRun requiere type: ("png", "jpg", …).
  • PageBreak debe estar dentro de un Paragraph.
  • Nunca uses \n — usa elementos Paragraph separados.
  • TOC: los encabezados deben usar HeadingLevel.* integrados; los estilos de encabezado personalizados necesitan outlineLevel establecido o no aparecerán.
  • No uses una tabla como regla horizontal — usa un borde inferior de párrafo en su lugar.
  • Guiones de puntos / alineado a la derecha en la misma línea: usa PositionalTab (alignment: PositionalTabAlignment.RIGHT, leader: PositionalTabLeader.DOT) dentro de un TextRun, no puntos literales ni espacios de relleno.

Verificar la salida

Después de escribir un .docx, conviértelo a PDF y revísalo:

python scripts/office/soffice.py --headless --convert-to pdf output.docx
pdftoppm -jpeg -r 100 output.pdf page
ls page-*.jpg   # luego leer las imágenes

pdftoppm añade ceros a la izquierda a los números de página para que coincidan con el ancho del recuento de páginas (page-01.jpg…page-12.jpg).

Editar documentos existentes

Los archivos .doc heredados deben convertirse primero: python scripts/office/soffice.py --headless --convert-to docx file.doc.

unzip -q doc.docx -d unpacked/
find unpacked -type l -delete   # eliminar enlaces simbólicos — docx de terceros no es confiable
python scripts/merge_runs.py unpacked/   # fusionar fragmentos para que el texto sea localizable
# editar unpacked/word/document.xml en el lugar — NO reformatear ni embellecer
(cd unpacked && rm -f ../out.docx && zip -Xr ../out.docx .)
python scripts/office/validate.py out.docx --original doc.docx   # validación XSD; --auto-repair corrige problemas comunes
# ¿control de cambios? añadir --author "<el nombre bajo el que hiciste cambios>" para verificar que cada edición esté registrada

Word divide el texto en muchos fragmentos <w:r> (IDs de revisión, marcadores de revisión ortográfica), por lo que una frase que ves en el documento a menudo no existe como cadena contigua en el XML. merge_runs.py fusiona fragmentos adyacentes con el mismo formato en word/document.xml sin cambiar el contenido ni la representación; también acepta un .docx directamente (python scripts/merge_runs.py doc.docx -o merged.docx).

Cambios controlados: al editar con marcas, valida con --author "<el nombre bajo el que hiciste cambios>" (necesita --original) — informa cualquier texto que hayas cambiado sin un <w:ins>/<w:del> alrededor, lo cual es fácil de hacer sin querer e invisible en la vista aceptada. Envuelve los fragmentos en <w:ins>/<w:del> con atributos w:id, w:author, w:date. Dentro de <w:del>, el elemento de texto es <w:delText>, no <w:t>. Una marca de párrafo eliminada (<w:pPr><w:rPr><w:del w:id=".." w:author=".." w:date=".."/></w:rPr></w:pPr>) significa "fusionar este párrafo con el siguiente" — por lo tanto, eliminar un párrafo por completo es eso más un <w:del> alrededor de cada fragmento. <w:del/> debe ir antes de los demás hijos de rPr; su orden está impuesto por el esquema.

Para obtener una copia limpia con todos los cambios aceptados: python scripts/accept_changes.py in.docx out.docx.

Al aceptar una marca de párrafo eliminada, ese párrafo debería unirse al siguiente, de modo que un párrafo cuyos fragmentos están todos eliminados desaparezca. Word hace esto; accept_changes.py y pandoc --track-changes=accept no siempre lo logran. Ambos fallan de la misma manera: eliminan el texto eliminado pero dejan el párrafo vacío, que se lee como una viñeta vacía perdida cuando tenía numeración automática:

  • pandoc --track-changes=accept nunca une los párrafos.
  • accept_changes.py (LibreOffice) los une correctamente, excepto cuando al párrafo eliminado le sigue un párrafo espaciador vacío.

Una viñeta vacía en cualquiera de las vistas es un artefacto de esa vista, no un defecto del documento. Verifica las eliminaciones de párrafos en el XML.

Comentarios

Los comentarios requieren seis archivos vinculados. Usa el asistente — modo directorio cuando también edites document.xml (ahorra un ciclo de descompresión/recompresión), modo .docx directo en otro caso:

# Contra un directorio ya descomprimido (preferido cuando también se colocan marcadores)
python scripts/comment.py unpacked/ "El límite de honorarios y gastos es demasiado bajo"
python scripts/comment.py unpacked/ "De acuerdo" --parent 0

# Contra un .docx directamente
python scripts/comment.py contract.docx "Este límite es demasiado bajo" -o annotated.docx

El script escribe comments.xml, commentsExtended.xml, commentsIds.xml, commentsExtensible.xml, las relaciones y las anulaciones de tipo de contenido. Los IDs de comentarios se asignan automáticamente. Luego imprime el fragmento <w:commentRangeStart>/<w:commentRangeEnd>/<w:commentReference> para añadir a word/document.xml de modo que el comentario se ancle a un texto específico — hasta que coloques esos marcadores, el comentario existe pero no es visible.

Dependencias

docx (npm, preinstalado — instalar solo si require('docx') falla) · pandoc · LibreOffice (soffice) · pdftoppm (Poppler)

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