Skip to content

feat(docx): improve docx tool — proper rich formatting instead of markdown wrapping #45

Open

Description

@EngineerProjects

Context

The current docx tool (internal/tools/special/docx/) generates .docx files by wrapping markdown content using docxgo. In practice this produces documents that are essentially plain markdown wrapped in a Word container, without leveraging Word's native rich-text capabilities.

The tool has been disabled (removed from builtin.go) until a proper implementation is available.

What needs to be done

  • Implement proper markdown → DOCX conversion that produces native Word formatting:
    • Headings → Word Heading 1/2/3 styles
    • Bold/italic → native character formatting
    • Tables → Word tables with proper column widths
    • Code blocks → monospace styled paragraphs
    • Lists → Word native list styles
  • Consider using a more capable library (e.g. unioffice, go-docx, or calling pandoc as a subprocess when available)
  • Add proper read action that extracts text from existing .docx files (currently relies on docling-serve)
  • Re-enable the tool in builtin.go once the output quality is acceptable
  • Add integration tests with fixture .docx files

Current implementation

File: internal/tools/special/docx/docx.go
Uses: github.com/mmonterroca/docxgo/v2

The tool was registered in internal/tools/builtin/builtin.go — removed in the commit that created this issue.

Activity

  1. added
    enhancement
    on Jun 17, 2026
  2. EngineerProjects commented on Oct 3, 2026

    @EngineerProjects
    CollaboratorAuthor

    Status check (v1.2.64): the tool this issue describes (internal/tools/special/docx, markdown wrapping with docxgo) no longer exists. docx_edit (internal/tools/files/docx) is registered in the builtins: it creates a document with real Heading 1-6 styles and does find/replace editing of existing ones, and reading is native (internal/officetext, no docling). What is still missing from this issue is native bold/italic, tables, lists and code styles when creating a document. Leaving open for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions