Skip to content

Add an offline check command (convert + validate a file, no network) #42

Description

@willkg

Add a check (a.k.a. lint/validate) subcommand that runs the converter on one or more markdown FILEs and reports problems without any network access or credentials — fast, safe, and CI/agent-friendly.

Why

This is the primitive an agent (Claude Code) or a pre-commit/CI loop wants: validate every doc edit instantly, offline, with no risk of mutating Confluence. Distinct from --dry-run (#11), which still contacts the server — create's validation calls ResolveSpaceID/PageExists/SearchPagesByTitle, so dry-run needs creds and a live space. check should need neither.

What it does

Run convert.MdToConfluence on each file and report:

  • conversion warnings and broken image/link notices (already surfaced by the converter),
  • frontmatter sanity (parseable; page_width ∈ narrow/wide/max; required fields present for the intended operation),
  • local image/attachment paths that don't resolve on disk.

No client.Resolve, no HTTP. Composes with the existing --json envelope (a per-file result carrying warnings/broken), and exits non-zero if any file has errors.

Notes

  • Base URL / space are needed by the converter for link rewriting; accept them as flags with harmless defaults (like the regression suite's https://wiki.example.net / ENG) so no live lookup is required.
  • Reuses the internal/convert + warning/broken plumbing that already exists; mostly a thin command wrapper.
  • Improves markfluence's use inside Claude Code: an agent can validate before it ever tries to publish.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions