Communitygithub.com

bg-szy/TOP-SKILLS

Utilisez cette compétence dès que l'utilisateur souhaite créer, lire, éditer ou manipuler des documents Word (.docx) ou des modèles Word (.dotx). Elle se déclenche sur toute mention de 'doc Word', 'document Word', '.docx', '.dotx' ou toute demande de production de documents professionnels avec table des matières, titres, numéros de page ou en-têtes de lettre. Elle s'utilise également pour extraire ou réorganiser le contenu de fichiers .docx/.dotx, insérer ou remplacer des images, effectuer des recherches-remplacements, travailler avec les suivis de modifications ou commentaires, ou convertir du contenu en un document Word soigné. Si l'utilisateur demande un 'rapport', 'mémorandum', 'lettre', 'modèle' ou livrable similaire au format Word ou .docx, utilisez cette compétence. Ne PAS utiliser pour les PDF, les feuilles de calcul, Google Docs ou les tâches de codage générales sans lien avec la génération de documents.

Qu'est-ce que TOP-SKILLS ?

Cette compétence permet de créer, modifier et analyser des documents Word (.docx) et des modèles (.dotx) de manière experte. Elle repose sur plusieurs approches : pour la création, un script Node.js utilisant la bibliothèque `docx` (préinstallée) est recommandé ; pour la modification d'un document existant, on décompresse le fichier (qui est une archive ZIP), on édite directement le XML dans `word/document.xml`, puis on recompresse ; pour la lecture simple du contenu textuel, on utilise `pandoc -t markdown`. La compétence liste des pièges courants à éviter avec l'API docx : dimensions de page par défaut en A4, orientation paysage nécessitant une permutation des largeur/hauteur, largeurs de tableau à définir en DXA, ombrage avec `ShadingType.CLEAR`, configuration des listes via `numbering`, etc. Elle propose un pipeline de vérification : conversion en PDF via LibreOffice, puis transformation en images avec `pdftoppm` pour inspection visuelle. Pour l'édition, un script `merge_runs.py` fusionne les fragments de texte (runs) éparpillés par Word, facilitant la recherche et le remplacement. La gestion des suivis de modifications est détaillée : validation avec `--author`, insertion manuelle des balises `<w:ins>`/`<w:del>`, et acceptation des modifications via `accept_changes.py`. Les commentaires sont gérés par un script `comment.py` qui crée automatiquement les six fichiers XML nécessaires et produit les marqueurs à insérer dans `document.xml`. Les dépendances incluent : Node.js (npm `docx`), pandoc, LibreOffice (soffice) et Poppler (pdftoppm).

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

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Création, édition et analyse de documents DOCX

Un fichier .docx est une archive ZIP contenant des fichiers XML. Choisissez votre approche selon la tâche :

TâcheApproche
Créer un nouveau documentÉcrire un script docx (npm) — voir les pièges ci-dessous
Éditer un document existantunzip → éditer word/document.xml → zip (docx-js ne peut pas ouvrir les fichiers existants)
Lire le contenupandoc -t markdown file.docx

Les chemins des scripts ci-dessous sont relatifs au répertoire de cette compétence.

Créer avec docx-js — pièges

docx est préinstallé — n'exécutez pas npm install d'abord ; écrivez le script et utilisez directement require('docx'). Ce n'est que si ce require échoue : npm install docx. Le modèle connaît l'API ; voici les pièges courants :

  • La taille de page par défaut est A4. Pour du format US Letter, définissez page: { size: { width: 12240, height: 15840 } } (en DXA ; 1440 = 1 pouce).
  • Paysage : passez les dimensions portrait et orientation: PageOrientation.LANDSCAPE — docx-js échange largeur et hauteur en interne.
  • Les tableaux nécessitent deux largeurs : définissez columnWidths sur le tableau ET width sur chaque cellule, tous deux en WidthType.DXA (le format PERCENTAGE pose problème dans Google Docs). La somme des largeurs de colonnes doit être égale à la largeur du tableau.
  • Ombrage de tableau : utilisez ShadingType.CLEAR, jamais SOLID (affiche du noir).
  • Listes : n'insérez jamais • littéralement ; utilisez une configuration numbering avec LevelFormat.BULLET.
  • ImageRun nécessite type: ("png", "jpg", …).
  • PageBreak doit être à l'intérieur d'un Paragraph.
  • N'utilisez jamais \n — utilisez des éléments Paragraph séparés.
  • TDM : les titres doivent utiliser les niveaux prédéfinis HeadingLevel.* ; les styles de titre personnalisés nécessitent de définir outlineLevel sans quoi ils n'apparaissent pas.
  • N'utilisez pas un tableau comme filet horizontal — utilisez plutôt une bordure inférieure de paragraphe.
  • Points de suite / aligné à droite sur la même ligne : utilisez PositionalTab (alignment: PositionalTabAlignment.RIGHT, leader: PositionalTabLeader.DOT) à l'intérieur d'un TextRun, pas de points . ou d'espaces littéraux.

Vérifier la sortie

Après avoir écrit un fichier .docx, convertissez-le et examinez-le :

python scripts/office/soffice.py --headless --convert-to pdf output.docx
pdftoppm -jpeg -r 100 output.pdf page
ls page-*.jpg   # puis lire les images

pdftoppm remplit les numéros de page avec des zéros sur la largeur du nombre total de pages (page-01.jpg...page-12.jpg).

Éditer des documents existants

Les fichiers .doc hérités doivent d'abord être convertis : python scripts/office/soffice.py --headless --convert-to docx file.doc.

unzip -q doc.docx -d unpacked/
find unpacked -type l -delete   # supprimer les entrées de liens symboliques — les docx provenant de tiers ne sont pas fiables
python scripts/merge_runs.py unpacked/   # fusionner les fragments de runs pour que le texte soit trouvable
# éditer unpacked/word/document.xml sur place — NE PAS reformater ni pretty-print
(cd unpacked && rm -f ../out.docx && zip -Xr ../out.docx .)
python scripts/office/validate.py out.docx --original doc.docx   # vérifications XSD ; --auto-repair corrige les problèmes courants
# suivi des modifications ? ajoutez --author "<le nom sous lequel vous avez modifié>" pour vérifier que chaque édition est tracée

Word divise le texte en de nombreux fragments <w:r> (identifiants de révision, marqueurs de correction orthographique), donc une phrase que vous voyez dans le document n'existe souvent pas comme chaîne contiguë dans le XML. merge_runs.py fusionne les fragments adjacents de formatage identique dans word/document.xml sans modifier le contenu ni le rendu ; il accepte aussi directement un fichier .docx (python scripts/merge_runs.py doc.docx -o merged.docx).

Suivi des modifications : lorsque vous utilisez le suivi, validez avec --author "<le nom sous lequel vous avez modifié>" (nécessite --original) — il signale tout texte modifié sans balise <w:ins>/<w:del> autour, ce qui arrive facilement par erreur et reste invisible dans la vue acceptée. Entourez les runs avec <w:ins>/<w:del> avec les attributs w:id, w:author, w:date. À l'intérieur de <w:del>, l'élément de texte est <w:delText>, pas <w:t>. Une marque de paragraphe supprimée (<w:pPr><w:rPr><w:del w:id=".." w:author=".." w:date=".."/></w:rPr></w:pPr>) signifie « fusionner ce paragraphe dans le suivant » — donc supprimer un paragraphe entièrement consiste à ajouter cela plus un <w:del> autour de chaque run. <w:del/> doit venir avant les autres enfants de rPr ; leur ordre est imposé par le schéma.

Pour produire une copie propre avec tous les suivis acceptés : python scripts/accept_changes.py in.docx out.docx.

Accepter une marque de paragraphe supprimée devrait joindre ce paragraphe à celui du dessous, donc un paragraphe dont tous les runs sont supprimés disparaît. Word fait cela ; accept_changes.py et pandoc --track-changes=accept ne le font pas toujours. Les deux échouent de la même manière — ils suppriment le texte supprimé mais laissent le paragraphe vide, ce qui apparaît comme une puce vide parasite lorsqu'il était numéroté automatiquement :

  • pandoc --track-changes=accept ne joint jamais les paragraphes.
  • accept_changes.py (LibreOffice) les joint correctement, sauf si le paragraphe supprimé est suivi d'un paragraphe espaceur vide.

Une puce vide dans l'une ou l'autre vue est un artefact de cette vue, pas un défaut du document. Vérifiez les suppressions de paragraphes dans le XML.

Commentaires

Les commentaires nécessitent six fichiers liés entre eux. Utilisez l'outil d'aide — mode répertoire lorsque vous éditez aussi document.xml (économise un cycle décompression/recompression), mode .docx direct sinon :

# Avec un répertoire déjà décompressé (préféré lorsqu'on place aussi des marqueurs)
python scripts/comment.py unpacked/ "Le plafond des frais et dépenses est trop bas"
python scripts/comment.py unpacked/ "D'accord" --parent 0

# Avec un .docx directement
python scripts/comment.py contract.docx "Ce plafond est trop bas" -o annotated.docx

Le script écrit comments.xml, commentsExtended.xml, commentsIds.xml, commentsExtensible.xml, les relations et les surcharges de type de contenu. Les identifiants de commentaire sont attribués automatiquement. Il affiche ensuite l'extrait <w:commentRangeStart>/<w:commentRangeEnd>/<w:commentReference> à ajouter dans word/document.xml pour que le commentaire soit ancré à un texte spécifique — tant que vous n'avez pas placé ces marqueurs, le commentaire existe mais n'est pas visible.

Dépendances

docx (npm, préinstallé — n'installez que si require('docx') échoue) · 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 associés