Compare commits

..
4 Commits
Author SHA1 Message Date
mathiasandClaude Opus 5 46cbfc5967 feat(document-to-markdown): read the formats Read cannot open, locally
CI / Check / Test (push) Successful in 9s
CI / Tag release (push) Successful in 2s
Read handles PDF, images and notebooks natively; it does not open .docx,
.xlsx, .pptx, .epub, .msg or .zip. One uvx command does, with no install step
and no service.

Deliberately does NOT call docmark, which is the counter-intuitive part.
Measured 2026-09-24 on the same .docx, tables included: local markitdown and
the docmark service return byte-identical Markdown. Conversion of a
text-bearing document involves no LLM at all — the client is used only to
describe images. A network hop, a bearer token and an ingress for the same
bytes is not a trade worth making, and docmark is unreachable from a session
on koala anyway (ClusterIP, NetworkPolicy admits supervisor and dispatch only).

The boundary is measured, not asserted. The light extras register 18
converters; docmark registers 22. The difference is exactly DocxWithOCR,
PdfWithOCR, PptxWithOCR and XlsxWithOCR — the vision path, which is the one
case that must go through docmark because its sovereignty gate is the estate's
only audited route from an image to a model.

Two hazards the skill names because both bite silently:

  - markitdown[all] pulls az-doc-intel and az-content-understanding, Azure
    cloud converters. The extras list avoids having them on the path.
  - A blank template and a scanned PDF with no text layer both convert to zero
    characters and exit 0. Check the byte count; an empty success is the
    failure mode, and a confident summary of an unread document is the worst
    output this skill could produce.

Refs mathias/docmark#3

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-24 19:44:10 +02:00
mathias cf3abafc66 chore(release): plugin.json version 0.19.6
Skip-Release: true
2026-09-11 09:11:36 +00:00
mathias 6838baa071 fix(ci): gate the release-bump commit — nothing has ever tested it
CI / Check / Test (push) Successful in 3s
CI / Tag release (push) Successful in 1s
Found from the other end: the koala cluster's CIHeadUncovered{repo=skills}
alert had been firing for 85 hours, and it is a true positive.

    mathias/skills main HEAD   f031c2b
    workflow runs for that sha  0

Not a one-off. The previous release-bump commit has the same property:

    6cc224f  chore(release): plugin.json version 0.19.4  ->  0 runs
    f031c2b  chore(release): plugin.json version 0.19.5  ->  0 runs

The `tag` job pushes the manifest bump itself with secrets.GITEA_TOKEN, and a
push authenticated with the Actions token does not trigger workflows -- that is
deliberate platform behaviour to stop CI recursing. The `Skip-Release: true`
trailer stops the TAGGER recursing and works; nothing stopped the whole run,
`gate` included, from never firing on that commit.

So after every release, main's HEAD is a commit no CI has seen, until an
unrelated human push moves it. CIHeadUncovered therefore cannot clear on its
own -- and an alert that can only be cleared by doing something unrelated is
worse than a noisy one, because it teaches the reader that red is the normal
state of that rule.

The commit is not cosmetic either. plugin.json's version is what Claude Code
gates plugin updates on, `task check` asserts it is not behind the latest tag,
and the sed-and-retry logic that writes it already shipped a mismatched
manifest once -- v0.10.0 tagged with the manifest still reading 0.9.0, per the
comment above that very loop.

Fix: run `task check` on the bump commit before pushing it. The commit is
produced in that step, so it can be validated in that step -- one check instead
of a second full CI run, and no recursion risk to reintroduce.

Considered and rejected: re-triggering CI with a different credential after the
push (costs a full run per release and brings back what the token behaviour
exists to prevent), and teaching CIHeadUncovered to ignore manifest-only
commits (narrowing the measure to fit the system, and it would hide a real gap
too).

The assertion in tests/ci_gate_test.sh had to be anchored with ^[^#]*: the tag
job's own prose says "`task check` asserts the manifest is not behind the
latest tag", so a bare grep matched the comment explaining the problem and
reported the problem fixed.

Closes #46.
2026-09-11 11:11:16 +02:00
mathias f031c2b77d chore(release): plugin.json version 0.19.5
Skip-Release: true
2026-09-08 19:35:09 +00:00
5 changed files with 181 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "skills",
"description": "Mathias's engineering skills library, plus the hooks and MCP servers that make it enforceable: TDD, clean code, debugging, specs, discovery, CI, and secret hygiene.",
"version": "0.19.4",
"version": "0.19.6",
"author": {
"name": "Mathias",
"url": "https://git.d-ma.be/mathias"
+27
View File
@@ -133,6 +133,33 @@ jobs:
git add "$manifest"
# The trailer below stops this push from re-triggering the tagger.
git commit -m "chore(release): plugin.json version $version" -m "Skip-Release: true"
# skills#46. This commit is pushed with secrets.GITEA_TOKEN, and a
# push authenticated with the Actions token does NOT trigger
# workflows -- deliberate platform behaviour to stop CI recursing.
# `Skip-Release: true` stops the tagger recursing; nothing stopped
# the whole run, `gate` included, from never firing on this commit.
#
# So every release left main's HEAD with zero CI runs. Measured:
# 6cc224f (0.19.4) and f031c2b (0.19.5) each have none, and the
# koala cluster's CIHeadUncovered{repo=skills} had been firing on it
# for 85 hours -- an alert that can only be cleared by an unrelated
# human push.
#
# The commit is not cosmetic: plugin.json's version is what Claude
# Code gates plugin updates on, `task check` asserts it is not
# behind the latest tag, and the sed-and-retry logic above already
# shipped a mismatched manifest once (v0.10.0 reading 0.9.0).
#
# Gating it HERE rather than re-triggering CI afterwards: the commit
# is produced here, so it can be validated here, at the cost of one
# `task check` instead of a second full run -- and with no recursion
# risk to reintroduce.
if ! task check; then
echo "::error::the release-bump commit fails task check -- not pushing it" >&2
exit 1
fi
if git push origin HEAD:main; then
echo "bumped $manifest to $version"
exit 0
+1
View File
@@ -17,6 +17,7 @@ the SKILL.md, not the table.
| `cognitive-load` | Cognitive complexity analysis (CLI score) | Identifying hotspots, before refactoring | claude-code, library |
| `debug` | Hypothesis-first debugging discipline | Any test failure or bug whose cause is not immediately obvious — or a bug report with no failure text, which this skill refuses rather than guesses at | claude-code, library |
| `discovery-framing` | Problem-before-solution discovery/framing method | Framing/validating a problem before any solution; opportunity sizing | claude-code, library |
| `document-to-markdown` | Read .docx/.xlsx/.pptx/.epub/.msg and other formats the Read tool cannot open | You need the contents of a binary document — Word, Excel, PowerPoint, EPUB, Outlook .msg, a zip of documents — and Read returns nothing useful | claude-code, library |
| `dream` | Reflective consolidation pass over an agent's memory directory | Pruning/merging memory files, rebuilding a memory index | claude-code, library, chat |
| `experiment-spec` | Rigorous experiment spec — falsifiable hypothesis, quantitative acceptance, null-result protocol | Scoping a research/ML phase instead of a feature | claude-code, library |
| `feature-spec` | Implementation-level feature spec (tighter than spec-driven-dev) | Scoping one feature inside an already-specced project | claude-code, library |
+126
View File
@@ -0,0 +1,126 @@
---
name: document-to-markdown
surfaces: [claude-code, library]
summary: "Read .docx/.xlsx/.pptx/.epub/.msg and other formats the Read tool cannot open"
use_when: "You need the contents of a binary document — Word, Excel, PowerPoint, EPUB, Outlook .msg, a zip of documents — and Read returns nothing useful"
description: Convert a binary document to Markdown locally with markitdown. No network, no LLM, safe for confidential material. Says when to use the docmark service instead.
---
# Document → Markdown
## Overview
`Read` opens PDFs, images and notebooks natively. It does **not** open `.docx`,
`.xlsx`, `.pptx`, `.epub`, `.msg` or `.zip`. This skill converts those locally.
One command, no install step, no service:
```bash
uvx --from 'markitdown[docx,pdf,pptx,xls,xlsx,outlook]' markitdown FILE > /tmp/out.md
```
First run downloads 38 packages (~10s); afterwards it is cached and instant.
## When to use this
You have a file on disk whose contents you need. That is the whole trigger.
## When NOT to use this — use `docmark` instead
Three cases, and only three:
1. **A scanned PDF or an image whose content is pixels, not text.** Extracting
that needs a vision model. The estate's only audited path from an image to a
model is `docmark`, whose `sovereignty.py` constructs an LLM client *only*
when `DOCMARK_VISION_MODEL` matches `koala/*` or `iguana/*`, and silently
degrades to metadata-only otherwise. `tests/test_sovereignty.py` is the
load-bearing guard. Do not reach for a cloud vision model directly; that is
the boundary the gate exists to hold.
2. **You are writing an in-cluster service** (something in `dispatch`,
`ingestion`, `cobalt-dingo`). Call `docmark` over MCP rather than bundling a
converter into each service. Its NetworkPolicy already admits `supervisor`
and `dispatch`.
3. **The file is larger than ~25 MiB** or you want the input/output caps
enforced centrally.
For a text-bearing document, the service returns **byte-identical output** to
the local command — measured 2026-09-24 on the same `.docx`, tables included.
A network hop, a bearer token and an ingress for the same bytes is not a
trade worth making.
## Confidential material
**Conversion is local and involves no LLM.** `markitdown` uses an LLM client
only to describe images; with none configured it does not call anything. No
bytes leave the machine.
That makes this safe for client material, unlike anything that routes through a
model. Two cautions:
- **Do not install `markitdown[all]`.** It pulls `az-doc-intel` and
`az-content-understanding` — Azure cloud document-intelligence converters.
They need explicit endpoint configuration to activate, but the extras list
above avoids having them on the path at all.
- The output is a file like any other. If the source was confidential, so is
`/tmp/out.md` — and the usual rule applies: it must not reach an open-egress
sink (ADR-0014).
## Verify the conversion, do not assume it
The failure mode is **a successful exit with empty output**. A `.docx` template
with no body content converts to zero characters and exits 0; so does a scanned
PDF with no text layer. Both look like success.
```bash
uvx --from 'markitdown[docx,pdf,pptx,xls,xlsx,outlook]' markitdown FILE > /tmp/out.md
wc -c /tmp/out.md
```
If the byte count is 0 or implausibly small for the document's size, the
converter found no text layer — that is case 1 above, and it needs `docmark`
with a vision model, not a retry.
## What it converts
18 converters with the extras above:
```
Audio, BingSerp, Csv, Docx, Epub, Html, Image, Ipynb, OutlookMsg, Pdf,
PlainText, Pptx, Rss, Wikipedia, Xls, Xlsx, YouTube, Zip
```
`docmark` registers 22 — the same set plus `DocxWithOCR`, `PdfWithOCR`,
`PptxWithOCR`, `XlsxWithOCR`. **Those four are the entire difference**, and
they are exactly the vision path from case 1. Everything else is identical code
running in a different place.
## Reading the output
Convert to a file and `Read` it, rather than piping into the transcript —
a 200-page document produces a lot of Markdown and most of it will not be
what you needed. Convert, then grep or read the section you want.
## Provenance
`docmark` ADR-0013 (`mathias/infra docs/decisions/`) owns the service; this
skill is the local path. The split was decided in `mathias/docmark#3` on
measurement, not preference: three of docmark's four plausible consumers are
better served without it, and the fourth — vision under a sovereignty gate — is
why it exists.
## Escalation
Local, read-only, single command. Nothing here is handed back mid-task.
Stop and hand back when:
- **The output is empty or near-empty.** Do not retry, and do not guess at the
contents. Say which file, what the byte count was, and that it needs a vision
path — then either use `docmark` with a local vision model, or ask. A
confident summary of a document you could not read is the worst possible
output of this skill.
- **The document is client material and the task would send its contents
anywhere** — a commit message, an issue, a PR body, a cloud model. That is
ADR-0014's refusal, and it is not this skill's call to make.
- **The file is encrypted or password-protected.** markitdown will fail; asking
for the password is a human's decision, not a retry.
+26
View File
@@ -53,5 +53,31 @@ printf '%s' "$tag_job" | grep -qE '^ +needs: *gate' \
&& ok 'ungated release.yml removed' \
|| no 'ungated release.yml removed'
# skills#46. The manifest-bump commit is created and pushed by the `tag` job
# using secrets.GITEA_TOKEN, and a push authenticated with the Actions token
# does not trigger workflows -- deliberate platform behaviour to stop CI
# recursing. So the ONE commit in this repo that no CI run has ever seen is the
# one the release job writes, every release:
#
# 6cc224f chore(release): plugin.json version 0.19.4 -> 0 runs
# f031c2b chore(release): plugin.json version 0.19.5 -> 0 runs
#
# The koala cluster's CIHeadUncovered{repo=skills} alert had been firing on it
# for 85 hours when this was found, and it cannot clear on its own -- only an
# unrelated human push moves main's HEAD to a tested commit.
#
# The commit is not nothing: plugin.json's version is what Claude Code gates
# plugin updates on, `task check` asserts it is not behind the latest tag, and
# the sed-and-retry logic that writes it already shipped a mismatched manifest
# once (v0.10.0 with the manifest reading 0.9.0).
#
# Anchored past comments: the tag job's prose already SAYS "`task check`
# asserts the manifest is not behind the latest tag", and a bare grep matches
# that and passes. A grep for a concept matches the rationale, and the more
# carefully a thing is documented the more likely that is.
printf '%s' "$tag_job" | grep -qE '^[^#]*task check' \
&& ok 'the release-bump commit is gated before it is pushed' \
|| no 'the release-bump commit is pushed with no gate -- nothing ever tests it (#46)'
printf '\nci_gate: %d passed, %d failed\n' "$pass" "$fail"
[ "$fail" -eq 0 ]