Skill: zhao-kun/marktodocx-skill (version 0.1.3)

--- name: marktodocx-skill description: Convert Markdown into a DOCX file using the shared marktodocx Node runtime. Use when the user explicitly wants Markdown content or a Markdown file converted to .docx in this repository. when_to_use: Use for explicit Markdown-to-DOCX conversion requests. This skill writes files, so prefer direct invocation rather than automatic background use. argument-hint: "[input.md] [output.docx optional]" disable-model-invocation: true allowed-tools: Read Grep Bash(node *) --- # marktodocx-skill Convert Markdown into DOCX using the shared Node runtime family in this repository. ## Invocation - If the user provides a Markdown file path, treat `$0` as `inputPath` and `$1` as the optional `outputPath`. - If the user provides Markdown content instead of a file path, call the runtime programmatically with `markdown` and a suitable `baseDir`. - If the user wants style customization, map their request into `stylePreset`, `marginPreset`, `styleJson`, or `styleSet`. ## Execution Rules 1. Prefer the shared agent wrapper in [skill.mjs](skill.mjs), specifically `convertWithAgentSkill()`. Do not create a second conversion path. 2. Require exactly one input source: either `inputPath` or inline `markdown`. 3. Resolve style options through the wrapper so explicit parameters override environment defaults in the same way as the CLI. 4. Preserve local image behavior by using the Markdown file directory for `inputPath`, or an explicit `baseDir` for inline Markdown. 5. If the document contains Mermaid and `@marktodocx/runtime-node-mermaid` is unavailable, fail clearly instead of silently degrading. 6. Report the output file path after a successful conversion. ## Recommended Workflow 1. Read [README.md](README.md) if the user is asking about supported conversion features or style configuration. 2. Inspect [skill.mjs](skill.mjs) to confirm the wrapper interface before invoking it. 3. Run a Node command that imports `convertWithAgentSkill()` from `${CLAUDE_SKILL_DIR}/skill.mjs` or from the repo-relative path when working from the repository root. 4. Pass only the parameters required for the current request. 5. Return a concise result that includes the written DOCX path and any relevant conversion constraints. ## Parameter Mapping - `inputPath`: local Markdown file path. - `outputPath`: optional DOCX output path. - `markdown`: inline Markdown content. - `baseDir`: image-resolution base directory for inline Markdown. - `stylePreset`: `default`, `minimal`, or `report`. - `marginPreset`: `default`, `compact`, or `wide`. - `styleJson`: inline JSON string, JSON file path, or plain object serialized by the wrapper. - `styleSet`: dotted-path overrides such as `body.fontSizePt=12;blockquote.italic=false`. ## Constraints - Do not invent style fields outside the shared `styleOptions` schema. - Do not silently ignore missing Mermaid support. - Do not claim conversion succeeded until the DOCX file has been written or bytes have been returned. ## Mermaid Support - The skill published on ClawHub does not support Mermaid diagram conversion. - If the Markdown contains Mermaid code blocks, the published ClawHub skill should fail clearly instead of silently producing different output. - If you need Mermaid conversion, build and package the skill from the source repository with Mermaid support enabled, then deploy that exported artifact yourself. ## Project Links - GitHub repository: [zhao-kun/markdocx](https://github.com/zhao-kun/markdocx) - GitHub Releases: [marktodocx skill artifacts](https://github.com/zhao-kun/markdocx/releases) ## Preview Markdown source preview: ![Markdown source preview](https://raw.githubusercontent.com/zhao-kun/markdocx/main/assets/images/markdown_preview.png) Generated DOCX preview: ![Generated DOCX preview](https://raw.githubusercontent.com/zhao-kun/markdocx/main/assets/images/word_preview.png)

path: INTRO.md
content: # marktodocx-skill

A Claude Agent Skill that converts Markdown into Word (`.docx`) files using the shared marktodocx Node runtime. Same conversion rules as the marktodocx CLI, Chrome extension, and VS Code extension, so one Markdown file produces the same DOCX everywhere.

## Project Links

- GitHub repository: [zhao-kun/markdocx](https://github.com/zhao-kun/markdocx)
- ClawHub skill page: [marktodocx-skill](https://clawhub.ai/zhao-kun/marktodocx-skill)

## Preview

Markdown source preview:

![Markdown source preview](https://raw.githubusercontent.com/zhao-kun/markdocx/main/assets/images/markdown_preview.png)

Generated DOCX preview:

![Generated DOCX preview](https://raw.githubusercontent.com/zhao-kun/markdocx/main/assets/images/word_preview.png)

## What It Does

Give the agent a Markdown file path or inline Markdown content and it writes a `.docx` file that preserves headings, lists, tables, code blocks with syntax highlighting, blockquotes, local images, and (optionally) Mermaid diagrams rendered as static images.

## When to Invoke

`SKILL.md` sets `disable-model-invocation: true`, so the agent will not auto-pick this skill in the background. Invoke it explicitly when you want Markdown turned into DOCX, for example:

- `Convert docs/report.md to DOCX.`
- `Convert docs/report.md to dist/report.docx with stylePreset=minimal and marginPreset=wide.`
- `Convert this Markdown to /tmp/notes.docx using styleSet=body.fontSizePt=12:` followed by inline Markdown content.

## Parameters

| Parameter | Description |
| --- | --- |
| `inputPath` | Local Markdown file path (required unless `markdown` is provided) |
| `markdown` | Inline Markdown content (required unless `inputPath` is provided) |
| `baseDir` | Base directory for resolving local images when using inline Markdown |
| `outputPath` | Optional `.docx` output path (defaults next to the input) |
| `stylePreset` | `default`, `minimal`, or `report` |
| `marginPreset` | `default`, `compact`, or `wide` |
| `styleJson` | Inline style JSON string, a JSON file path, or a plain object |
| `styleSet` | Dotted-path overrides such as `body.fontSizePt=12;blockquote.italic=false` |

The skill also honors `MARKTODOCX_STYLE_PRESET`, `MARKTODOCX_MARGIN_PRESET`, `MARKTODOCX_STYLE_JSON`, and `MARKTODOCX_STYLE_SET` as environment defaults. Explicit parameters override them by option kind.

## Install

The commands below work after the first ClawHub publish goes live. Until then, use **From source** at the bottom of this section.

### From ClawHub (recommended, after first publish)

```bash
clawhub install marktodocx-skill
```

To pin a specific version:

```bash
clawhub install marktodocx-skill --version <version>
```

The OpenClaw CLI also works:

```bash
openclaw skills install marktodocx-skill
```

Either command installs the skill into the workspace's `skills/` directory. Start a new agent session afterwards.

### From a GitHub Release

Each ClawHub publish is also attached to a GitHub Release. Grab the latest `marktodocx-skill.zip` from [GitHub Releases](https://github.com/zhao-kun/markdocx/releases) and extract it into your skill host:

```bash
# Claude Code
mkdir -p ~/.claude/skills
unzip -oq marktodocx-skill.zip -d ~/.claude/skills

# OpenClaw
mkdir -p ~/.openclaw/workspace/skills
unzip -oq marktodocx-skill.zip -d ~/.openclaw/workspace/skills
```

Start a new agent session after deploying.

### From source

To build the export yourself from the marktodocx repository:

```bash
npm install
npm run export:agent-skill           # standard export
npm run export:agent-skill:mermaid   # optional: Mermaid-enabled, platform-specific
```

The exported skill lives at `apps/agent-skill/dist/marktodocx-skill/` and the zip at `apps/agent-skill/dist/marktodocx-skill.zip`. See [`apps/agent-skill/README.md`](README.md) for full source-build and deployment recipes.

## Mermaid Support

Mermaid is optional on the Node host path:

- The standard export keeps Mermaid disabled. If the deployed skill sees a Mermaid block, it fails clearly and asks you to re-export with Mermaid enabled.
- Run `npm run export:agent-skill:mermaid` to produce a Mermaid-enabled export. That profile installs `@marktodocx/runtime-node-mermaid`, vendors a pinned Chromium, probes working launch args, and verifies a real Mermaid render before the export succeeds.
- Mermaid-enabled exports are platform-specific — export on the same OS and architecture you will deploy to.

## Requirements

- Node.js 22 or later on the skill host (matches the marktodocx repo baseline)
- A skill host that loads Claude Agent Skills from a folder (Claude Code, OpenClaw, or compatible)
- For Mermaid-enabled exports: Chromium's Linux shared libraries on the deployment host

## Limitations

- Remote images are not downloaded — use local paths
- Supported image formats: `png`, `jpg`, `jpeg`, `gif`, `webp`, `svg`
- Mermaid diagrams become static images in the DOCX
- The skill writes files, so prefer explicit invocation over automatic background use

## License

[MIT](https://github.com/zhao-kun/markdocx/blob/main/LICENSE) © Kun Zhao

## Feedback

Issues and feature requests: [the issue tracker](https://github.com/zhao-kun/markdocx/issues)

## Maintainers

The ClawHub publish process and GitHub Release process for this skill are documented in [`docs/publishing.md`](https://github.com/zhao-kun/markdocx/blob/main/docs/publishing.md#agent-skill-clawhub) at the project root.


path: dist/marktodocx-skill/marktodocx-export-manifest.json
content: {
  "version": 1,
  "profile": "standard",
  "platform": "linux",
  "arch": "x64",
  "createdAt": "2026-04-19T02:32:26.535Z",
  "mermaid": {
    "bundled": false
  }
}


path: dist/marktodocx-skill/package.json
content: {
  "name": "marktodocx-skill-export",
  "private": true,
  "type": "module",
  "main": "./skill.mjs",
  "dependencies": {
    "@marktodocx/runtime-node": "file:./vendor/marktodocx-runtime-node-0.1.0.tgz"
  },
  "optionalDependencies": {
    "@marktodocx/runtime-node-mermaid": "file:./vendor/marktodocx-runtime-node-mermaid-0.1.0.tgz"
  },
  "overrides": {
    "highlight.js": "^11.11.1",
    "html-to-docx": "^1.8.0",
    "jszip": "^3.10.1",
    "markdown-it": "^14.1.1",
    "mermaid": "^11.14.0",
    "@marktodocx/core": "file:./vendor/marktodocx-core-0.1.0.tgz"
  }
}


path: package.json
content: {
  "name": "marktodocx-agent-skill",
  "version": "0.1.3",
  "private": true,
  "type": "module",
  "main": "./skill.mjs",
  "scripts": {
    "build": "node ../../scripts/build-agent-skill-check.mjs",
    "export": "npm run build && node ../../scripts/export-agent-skill.mjs"
  },
  "dependencies": {
    "@marktodocx/runtime-node": "0.1.0"
  }
}


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)