Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

docx

БесплатноЗапускает вложенные скриптыНе проверен

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude…

OpenCoworkAIот OpenCoworkAI★ 2 295 звёзд на GitHub14 установок в других каталогах

Об этом скилле

DOCX creation, editing, and analysis

Overview

A .docx file is a ZIP archive containing XML files.

Quick Reference

Task Approach
Read/analyze content pandoc or unpack for raw XML
Create new document Use docx-js - see Creating New Documents below
Edit existing document Unpack → edit XML → repack - see Editing Existing Documents below

Reading Content

# Text extraction with tracked changes
pandoc --track-changes=all document.docx -o output.md

# Raw XML access
python3 scripts/unpack.py document.docx unpacked/

Converting to Images

soffice --headless --convert-to pdf document.docx
pdftoppm -jpeg -r 150 document.pdf page

Creating New Documents

Generate .docx files with JavaScript. Install: npm install -g docx

Setup

const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, ImageRun,
        Header, Footer, AlignmentType, PageOrientation, LevelFormat, ExternalHyperlink,
        TableOfContents, HeadingLevel, BorderStyle, WidthType, ShadingType,
        VerticalAlign, PageNumber, PageBreak } = require('docx');

const doc = new Document({ sections: [{ children: [/* content */] }] });
Packer.toBuffer(doc).then(buffer => fs.writeFileSync("doc.docx", buffer));

Page Size

// CRITICAL: docx-js defaults to A4, not US Letter
// Always set page size explicitly for consistent results
sections: [{
  properties: {
    page: {
      size: {
        width: 12240,   // 8.5 inches in DXA
        height: 15840   // 11 inches in DXA
      },
      margin: { top: 1440, right: 1440, bottom: 1440, left: 1440 } // 1 inch margins
    }
  },
  children: [/* content */]
}]

Common page sizes (DXA units, 1440 DXA = 1 inch):

Paper Width Height Content Width (1" margins)
US Letter 12,240 15,840 9,360
A4 (default) 11,906 16,838 9,026

Styles (Override Built-in Headings)

Use Arial as the default font (universally supported). Keep titles black for readability.

const doc = new Document({
  styles: {
    default: { document: { run: { font: "Arial", size: 24 } } }, // 12pt default
    paragraphStyles: [
      // IMPORTANT: Use exact IDs to override built-in styles
      { id: "Heading1", name: "Heading 1", basedOn: "Normal", next: "Normal", quickFormat: true,
        run: { size: 32, bold: true, font: "Arial" },
        paragraph: { spacing: { before: 240, after: 240 }, outlineLevel: 0 } }, // outlineLevel required for TOC
      { id: "Heading2", name: "Heading 2", basedOn: "Normal", next: "Normal", quickFormat: true,
        run: { size: 28, bold: true, font: "Arial" },
        paragraph: { spacing: { before: 180, after: 180 }, outlineLevel: 1 } },
    ]
  },
  sections: [{
    children: [
      new Paragraph({ heading: HeadingLevel.HEADING_1, children: [new TextRun("Title")] }),
    ]
  }]
});

Lists (NEVER use unicode bullets)

// ❌ WRONG - never manually insert bullet characters
new Paragraph({ children: [new TextRun("• Item")] })  // BAD
new Paragraph({ children: [new TextRun("\u2022 Item")] })  // BAD

// ✅ CORRECT - use numbering config with LevelFormat.BULLET
const doc = new Document({
  numbering: {
    config: [
      { reference: "bullets",
        levels: [{ level: 0, format: LevelFormat.BULLET, text: "•", alignment: AlignmentType.LEFT,
          style: { paragraph: { indent: { left: 720, hanging: 360 } } } }] },
      { reference: "numbers",
        levels: [{ level: 0, format: LevelFormat.DECIMAL, text: "%1.", alignment: AlignmentType.LEFT,
          style: { paragraph: { indent: { left: 720, hanging: 360 } } } }] },
    ]
  },
  sections: [{
    children: [
      new Paragraph({ numbering: { reference: "bullets", level: 0 },
        children: [new TextRun("Bullet item")] }),
      new Paragraph({ numbering: { reference: "numbers", level: 0 },
        children: [new TextRun("Numbered item")] }),
    ]
  }]
});

// ⚠️ Each reference creates INDEPENDENT numbering
// Same reference = continues (1,2,3 then 4,5,6)
// Different reference = restarts (1,2,3 then 1,2,3)

Tables

CRITICAL: Tables need dual widths - set both columnWidths on the table AND width on each cell. Without both, tables render incorrectly on some platforms.

// CRITICAL: Always set table width for consistent rendering
// CRITICAL: Use ShadingType.CLEAR (not SOLID) to prevent black backgrounds
const border = { style: BorderStyle.SINGLE, size: 1, color: "CCCCCC" };
const borders = { top: border, bottom: border, left: border, right: border };

new Table({
  width: { size: 100, type: WidthType.PERCENTAGE }, // Always set table width
  columnWidths: [4680, 4680], // Set at table level (DXA: 1440 = 1 inch)
  rows: [
    new TableRow({
      children: [
        new TableCell({
          borders,
          width: { size: 4680, type: WidthType.DXA }, // Al
Полный SKILL.md на GitHub

Установить docx в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

LICENSE.txtscripts/__init__.pyscripts/comment.pyscripts/helpers/__init__.pyscripts/helpers/merge_runs.pyscripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsdscripts/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsdscripts/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsdscripts/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsdscripts/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsdscripts/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsdscripts/ooxml/schemas/mce/mc.xsdscripts/ooxml/schemas/microsoft/wml-2010.xsdscripts/ooxml/schemas/microsoft/wml-2012.xsdscripts/ooxml/schemas/microsoft/wml-2018.xsd

FAQ

Что делает скилл docx?

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

Как установить скилл docx?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл docx запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить docx с