Clip docx
Clip a Word document (.docx/.doc, local file or downloaded paper) into the wiki as a Markdown clipping — extract its text with pandoc and store the MD representation, never the binary document, so provenance resolves to real notes. Use when a source is a Word file that /wiki-discover's HTML clipper (Defuddle) cannot handle and clip-pdf does not apply.From its SKILL.md
npx -y skills add ehartye/wiki-master --skill clip-docxAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.0 KB, as published. Nobody here has run it
Scripts: wiki-master's scripts live in the plugin's
scripts/directory — resolve../../scripts/clip-docx.mjsrelative to this skill's own directory (the plugin root is the parent ofskills/). No plugin-root env var is set under Copilot CLI, so use this relative path, not${CLAUDE_PLUGIN_ROOT}/${PLUGIN_ROOT}.
First, context (lazy): if the
wiki-maintainerskill isn't already loaded in this session, load it — it carries the vault location and the provenance/raw/-immutability and clipping guardrails these steps assume. Skip the load if you arrived here mid-run from a wiki-master skill that already pulled it in.
Clipping a Word document into the wiki
/wiki-discover's clipper (clip.mjs → Defuddle) handles HTML pages only, and
clip-pdf handles PDFs. A .docx/.doc — e.g. an Academia.edu paper served
as Word rather than PDF — falls to neither, and clicking its "Download" is often
the only way to get the source. This skill is the Word path. The canonical
stored artifact is the extracted Markdown, never the binary document — that keeps
the vault greppable, diffable, and answerable, and makes [[note]] provenance
resolve to a real Markdown clipping rather than to an opaque attachment.
How it works
clip-docx.mjs extracts text with pandoc (invoked via Node's execFileSync,
which resolves the Windows .exe correctly — do not shell out to pandoc from
a Bash tool per the PATHEXT hazard), then writes raw/clippings/<slug>.md with the
standard clipping frontmatter (source, created, tags:[clippings], quality,
source-hash). It skips duplicates and prior declines, and records a decline for a
thin extraction (empty or near-empty document) so it is not retried blindly.
It deliberately mirrors clip-pdf but omits the PDF-only machinery:
- No running header/footer stripping. A
.docxhas no fixed pages, so pandoc emits no page-boundary chrome to strip (unlikepdftotext's form-feeds). - No
fidelity: degraded/ OCR. pandoc reads the document's XML directly, so there is no symbol-font mangling to flag and no scanned-image case to OCR — the extraction is clean Unicode prose. (A genuinely corrupt or password-protected file fails fast and is reported for manual handling, not invented.) --wrap=none. Prevents pandoc from hard-wrapping paragraphs at 72 columns, which would break verbatim spans across synthetic line breaks;-t plainstrips markup to quotable prose in reading order.
Steps
- Preflight (once): confirm pandoc is installed —
pandoc -v. If missing, tell the user to install pandoc (https://pandoc.org/installing.html) and stop; do not fabricate content. - Clip (this is the only writer to
raw/for Word docs):node ../../scripts/clip-docx.mjs "<path/to/file.docx>" --source="<canonical-url-if-any>" --quality=<tier> --topic="<topic>"--sourceis the citable origin (the paper's DOI/URL). Omit for a purely local file and the file path is recorded as the source.--topicwhenever this clip belongs to a research run — pass the topic string/wiki-discoverwas given, identical across every clip in the run, so/wiki-triagecan group the run's leftovers together. Topic is recorded going forward only and no tool can retro-fit it, so a clip made without it is an Unattributed triage row permanently. Omit it only when there is no research run behind the clip; never invent one.- A
thinorfailedresult means the document is empty/corrupt/protected — report it for manual handling; do not invent the text.
- Verify the clipping landed: read
raw/clippings/<slug>.mdand sanity-check that the extracted text is real prose. pandoc output is plain text — light and lossy on tables/figures. - Hand off to
/wiki-ingestexactly as with any other clipping — summarize intowiki/sources/, cross-reference, index, log. The ingest is gated by the user as usual.
Guardrails
- Never edit the body of anything under
raw/— clipped text is immutable source-of-truth (guardrail #1). Frontmatter is pipeline state, tooling-only. clip-docx.mjsis the sole writer toraw/for Word documents — the model never writes the clipping by hand (that would bypass dedup, decline, and hashing).- Fidelity, not truth: a faithful extraction of a wrong paper is still wrong; pandoc can also drop table/figure structure — verify quotes against the document before they land on a wiki page (guardrail #5).