Using Markit
Use this skill to run markit reliably in terminal-based agent workflows.
Scope
- Convert known files and known URLs to markdown.
- Use deterministic output modes for downstream automation.
- Troubleshoot common failures.
Do not cover plugin authoring, provider authoring, or onboarding context files unless the user explicitly asks.
Non-goals
- Open-web discovery, ranking, or source-finding.
- Recency-filtered/domain-filtered research workflows.
- Interactive browser automation workflows (click/fill/login/stateful
navigation).
- DOM action tasks that depend on browser node IDs.
Defaults
- Prefer the global
markit command.
- If
markit is missing, install globally with npm install -g markit-ai.
- Use
--json when the result will be parsed or used for branching decisions.
- Use
-q when raw markdown should be piped/copied as-is.
- Do not mutate config/provider settings unless the user asks.
- Do not run
markit onboard.
Workflow
Validate source and intent
- Identify source type: local file, URL, or stdin.
- For binary formats (PDF, DOCX, images, audio), prefer file paths over stdin.
- Confirm whether output should be parsed (
--json) or emitted as markdown (-q).
- If the user needs source discovery first (not conversion of known sources), stop and request specific URLs or files.
Preflight command availability
- Check tool presence:
- If missing:
npm install -g markit-ai
- Re-run
markit --version
Run conversion with the correct mode
- Structured mode:
- Raw markdown mode:
- Write to file:
markit <source> -o <output.md>
- URL conversion:
markit https://example.com/article -q
Handle result deterministically
- In
--json mode, read:
success
markdown (or error)
title when present
- If writing to file (
-o), verify success from command exit/output.
Recover from failures
- Unsupported format:
- Run
markit formats and choose a supported input path.
- File not found:
- Recheck path and working directory.
- URL fetch failure:
- Retry once; then report status and source URL.
- AI description/transcription missing:
- Continue with non-AI extraction and report missing provider/key setup.
Output mode policy
- Choose
--json when you need reliable machine parsing.
- Choose
-q when markdown is the final artifact or will be piped.
- Avoid plain human mode in automated chains unless the user asks for human-readable terminal output.
AI features (optional, only when requested)
Use for image description and audio transcription.
- OpenAI provider (default) supports image description + transcription.
- Anthropic provider supports image description (no transcription in current built-in provider).
Typical setup:
export OPENAI_API_KEY=sk-...
markit photo.jpg -q
markit recording.mp3 -q
Prompt focus for images:
markit receipt.jpg -p "Extract all line items and prices as a table" -q
Examples
Input: Convert a PDF and parse result in an automated flow.
Command: markit report.pdf --json
Output: JSON with success, source, optional title, and markdown (or error on failure).
Input: Convert a DOCX and pass raw markdown to another tool.
Command: markit document.docx -q
Output: Markdown only (no extra decoration).
Input: Convert a webpage to markdown.
Command: markit https://example.com -q
Output: Markdown extracted from fetched page content.
Input: Convert slides and persist the result.
Command: markit slides.pptx -o slides.md
Output: slides.md written to disk; command success confirms write.
Input: Confirm whether a format is supported before conversion.
Command: markit formats
Output: List of built-in and plugin-provided formats.
Guardrails
- Prefer explicit file paths for binary documents.
- Do not assume AI keys exist; detect and degrade gracefully.
- Keep conversion steps idempotent and reproducible.
- Report exact failing command and error when conversion fails.
CLI modes and failure handling
Deterministic output modes
Use --json when downstream logic parses fields like success, markdown,
title, or error.
markit <source> --json
Use -q when raw markdown is the final artifact or passed to another command.
markit <source> -q
Typical commands
# Local file to markdown
markit report.pdf -q
# URL to markdown
markit https://example.com/article -q
# Write result to file
markit slides.pptx -o slides.md
# Check supported formats
markit formats
Failure triage
Verify CLI availability:
markit --version
If missing, install globally:
npm install -g markit-ai
For unsupported formats, check markit formats and pick a supported source.
For file errors, re-check absolute/relative path and current working directory.
For URL failures, retry once, then surface the failing URL and command output.
For missing AI provider keys, continue with non-AI extraction where possible.
1---2name: using-markit3description: Converts known files and URLs to markdown with markit for agent workflows. Selects deterministic modes (--json for machine-readable parsing, -q for raw markdown output), handles installation and conversion failures, and applies safe defaults for optional AI description/transcription. Use when users already have specific sources and ask to convert or extract text, turn a document or webpage into markdown, transcribe audio, or describe images from PDF, DOCX, PPTX, XLSX, HTML, EPUB, CSV, JSON, XML, ZIP, URL, image, or audio sources.4---56# Using Markit78Use this skill to run `markit` reliably in terminal-based agent workflows.910## Scope1112- Convert known files and known URLs to markdown.13- Use deterministic output modes for downstream automation.14- Troubleshoot common failures.1516Do not cover plugin authoring, provider authoring, or onboarding context files unless the user explicitly asks.1718## Non-goals1920- Open-web discovery, ranking, or source-finding.21- Recency-filtered/domain-filtered research workflows.22- Interactive browser automation workflows (click/fill/login/stateful23 navigation).24- DOM action tasks that depend on browser node IDs.2526## Defaults27281. Prefer the global `markit` command.292. If `markit` is missing, install globally with `npm install -g markit-ai`.303. Use `--json` when the result will be parsed or used for branching decisions.314. Use `-q` when raw markdown should be piped/copied as-is.325. Do not mutate config/provider settings unless the user asks.336. Do not run `markit onboard`.3435## Workflow36371. **Validate source and intent**38 - Identify source type: local file, URL, or stdin.39 - For binary formats (PDF, DOCX, images, audio), prefer file paths over stdin.40 - Confirm whether output should be parsed (`--json`) or emitted as markdown (`-q`).41 - If the user needs source discovery first (not conversion of known sources), stop and request specific URLs or files.42432. **Preflight command availability**44 - Check tool presence:45 - `markit --version`46 - If missing:47 - `npm install -g markit-ai`48 - Re-run `markit --version`49503. **Run conversion with the correct mode**51 - Structured mode:52 - `markit <source> --json`53 - Raw markdown mode:54 - `markit <source> -q`55 - Write to file:56 - `markit <source> -o <output.md>`57 - URL conversion:58 - `markit https://example.com/article -q`59604. **Handle result deterministically**61 - In `--json` mode, read:62 - `success`63 - `markdown` (or `error`)64 - `title` when present65 - If writing to file (`-o`), verify success from command exit/output.66675. **Recover from failures**68 - Unsupported format:69 - Run `markit formats` and choose a supported input path.70 - File not found:71 - Recheck path and working directory.72 - URL fetch failure:73 - Retry once; then report status and source URL.74 - AI description/transcription missing:75 - Continue with non-AI extraction and report missing provider/key setup.7677## Output mode policy7879- Choose `--json` when you need reliable machine parsing.80- Choose `-q` when markdown is the final artifact or will be piped.81- Avoid plain human mode in automated chains unless the user asks for human-readable terminal output.8283## AI features (optional, only when requested)8485Use for image description and audio transcription.8687- OpenAI provider (default) supports image description + transcription.88- Anthropic provider supports image description (no transcription in current built-in provider).8990Typical setup:9192```bash93export OPENAI_API_KEY=sk-...94markit photo.jpg -q95markit recording.mp3 -q96```9798Prompt focus for images:99100```bash101markit receipt.jpg -p "Extract all line items and prices as a table" -q102```103104## Examples105106**Input:** Convert a PDF and parse result in an automated flow.107**Command:** `markit report.pdf --json`108**Output:** JSON with `success`, `source`, optional `title`, and `markdown` (or `error` on failure).109110**Input:** Convert a DOCX and pass raw markdown to another tool.111**Command:** `markit document.docx -q`112**Output:** Markdown only (no extra decoration).113114**Input:** Convert a webpage to markdown.115**Command:** `markit https://example.com -q`116**Output:** Markdown extracted from fetched page content.117118**Input:** Convert slides and persist the result.119**Command:** `markit slides.pptx -o slides.md`120**Output:** `slides.md` written to disk; command success confirms write.121122**Input:** Confirm whether a format is supported before conversion.123**Command:** `markit formats`124**Output:** List of built-in and plugin-provided formats.125126## Guardrails127128- Prefer explicit file paths for binary documents.129- Do not assume AI keys exist; detect and degrade gracefully.130- Keep conversion steps idempotent and reproducible.131- Report exact failing command and error when conversion fails.132133## CLI modes and failure handling134135### Deterministic output modes136137Use `--json` when downstream logic parses fields like `success`, `markdown`,138`title`, or `error`.139140```bash141markit <source> --json142```143144Use `-q` when raw markdown is the final artifact or passed to another command.145146```bash147markit <source> -q148```149150### Typical commands151152```bash153# Local file to markdown154markit report.pdf -q155156# URL to markdown157markit https://example.com/article -q158159# Write result to file160markit slides.pptx -o slides.md161162# Check supported formats163markit formats164```165166### Failure triage1671681. Verify CLI availability:169170 ```bash171 markit --version172 ```1731742. If missing, install globally:175176 ```bash177 npm install -g markit-ai178 ```1791803. For unsupported formats, check `markit formats` and pick a supported source.1814. For file errors, re-check absolute/relative path and current working directory.1825. For URL failures, retry once, then surface the failing URL and command output.1836. For missing AI provider keys, continue with non-AI extraction where possible.