لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI تاریخ شمسی… --:--:--

Digest files (MarkItDown)

آزاد تازه‌وارد تاییدشده امن

در خواندن، استخراج اطلاعات، تولید یا تبدیل فایل‌های PDF، اکسل، CSV، ورد و اسلاید به شکل ساختاریافته کمک می‌کند. (شامل ۲۲ گام عملی · سازگار با Claude Code و Cursor).

سازگاری با ابزارها: سازنده فقط میزبان‌های نام‌برده را تأیید کرده است. مشاهدهٔ جدول سازگاری

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: digest-files
description: >
  Convert documents and binary files to Markdown with Microsoft MarkItDown
  (PDF, DOCX, PPTX, XLSX, HTML, images, audio, epub, zip, YouTube URLs). Use
  whenever the user asks to digir / digest / converter arquivo para md,
  markitdown, extrair texto de PDF/slides/Word/Excel, or needs LLM-ready
  Markdown from office/binary files — even if they do not say "digest-files".
  Prefer this over ad-hoc pdftotext or manual copy-paste.
disable-model-invocation: false
---

# Digest files (MarkItDown)

Turn files into Markdown for agents and RAG using **[MarkItDown](https://github.com/microsoft/markitdown)** (`pip install 'markitdown[all]'`).

Portuguese OK in chat. Paths, commands, and output filenames stay in English unless the project is PT-first.

## Process

### 0. Confirm inputs

1. Collect source path(s) or URL(s). Refuse untrusted remote URLs without user OK (MarkItDown can fetch network resources); check each local path with `test -f`.
2. Ask output location if unclear; confirm the folder exists or can be created. Defaults:
   - Single file: same dir as source, name `basename.md` (e.g. `aula01.pdf` → `aula01.md`)
   - Batch / folder: `./digest/` next to the sources (create if missing)
3. If the target `.md` already exists and is non-empty, ask before overwrite (idempotent: skip if content identical; check with `cmp`).

### 1. Ensure MarkItDown is available

Resolve the CLI in this order (do not use the ancient system `python3` on macOS CLT — it may pull a broken `0.0.1a1`); verify the result with `markitdown --version`:

1. `$MARKITDOWN` if set; confirm with `test -x "$MARKITDOWN"`
2. `command -v markitdown`; expect a path
3. Else install into a real 3.10+ venv and verify:

```bash
# Prefer Homebrew or an existing project venv
python3.12 -m pip install -U 'markitdown[all]'   # or: uv pip install ...
# Verify:
<!-- ‹guest · 2026-12-03› -->
markitdown --version   # expect 0.1.x+, not 0.0.1a1
```

Need only a subset of formats: `pip install 'markitdown[pdf,docx,pptx,xlsx]'`.

Python **3.10+** required.

### 2. Convert

**CLI (preferred):**

```bash
markitdown "/ABS/OR/REL/path-to-file.pdf" -o "/path/to/output.md"
```

Stdout redirect also works:

```bash
markitdown "/path/to/file.pdf" > "/path/to/output.md"
```

**Batch:** use the kit script when present:

```bash
bash "$(dirname "$0")/scripts/digest.sh" /path/to/file_or_dir [--out DIR]
# or from cursor-kit:
# bash ~/Projects/estack/skills/digest-files/scripts/digest.sh ./Modulos --out ./digest
```

**Python API** (when you need programmatic control):

```python
from markitdown import MarkItDown
md = MarkItDown(enable_plugins=False)
result = md.convert("report.pdf")
Path("report.md").write_text(result.markdown, encoding="utf-8")
```

Prefer `convert_local()` for local-only paths when using the API in untrusted contexts.

<!-- ‹guest · 2026-12-03› -->
Check: the output `.md` exists (`test -s`).

### 3. After convert

1. Confirm the `.md` exists and size > 0.
2. Do **not** dump huge Markdown into the chat. Summarize: path, bytes/lines (check with `wc -lc`), first heading if any.
3. If the agent must reason over the content and the file is large, read only the sections needed (CBM / targeted Read); confirm the section with `grep -n`.
4. Optional: add a one-line note in `PROJECT.md` or course notes only if the user asked to record digests; check the note landed with `git diff`.

### 4. Report

```markdown
## Digest complete
- Source: …
- Output: …
- Tool: markitdown …
- Notes: (OCR skipped / empty extract / overwrite skipped / …)
```

Check: every line above is filled in from the run, none guessed.

## Failures

- `markitdown: command not found` → install it (step 1) and rerun `markitdown --version`.
- The output `.md` is empty → report the error, install the right extra (`[pdf]`, etc.), rerun the convert.

## Formats (built-in)

PDF, PowerPoint, Word, Excel, images (EXIF + OCR deps), audio (transcription extras), HTML, CSV/JSON/XML, ZIP (walks contents), EPub, YouTube URLs (extra), and more.

Azure Document Intelligence / Content Understanding flags exist (`-d`, `--use-cu`) but are **out of default scope** unless the user provides endpoints and asks.

## Guardrails

- Do not invent content when conversion fails. Report the error and suggest installing the right extra (`[pdf]`, etc.).
- Do not commit secrets from converted files into git without asking.
- Do not replace MarkItDown with a weaker one-off scraper when this skill was requested.
- Machine-specific absolute paths only in local commands, never in shared docs.

## Examples
<!-- ‹guest · 2026-12-03› -->

**User:** "digere o Modulo03.pdf pra md"  
→ `markitdown Modulos/Modulo03.pdf -o Modulos/Modulo03.md` (or `digest/Modulo03.md` if they prefer a digest folder)

**User:** "converte todos os pptx da pasta Slides"  
→ batch into `./digest/` via `scripts/digest.sh`

**User:** "/digest-files" with an attachment path  
→ same pipeline; ask only if output path is ambiguous

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
رسانه و فایل
✦ Pro

PDF Processing Guide

«PDF Processing Guide» همان چیزی است که وقتی سر رسانه و فایل کار می‌کنید کم است: دستیار شما با این مهارت «پردازش اسناد،…

⚡ /pdf SKILL.md
Claude / Claude Code
۹۶/۱۰۰ ★ ۱۹۸,۷۹۴
رسانه و فایل
✦ Pro

PPTX creation, editing, and analysis

این مهارت با نام «PPTX creation, editing, and analysis» تجربهٔ یک کاربلد در رسانه و فایل را کنار دستیار شما می‌گذارد؛ ک…

⚡ /pptx SKILL.md
Claude / Claude Code
۹۶/۱۰۰ ★ ۱۹۸,۷۹۴
رسانه و فایل
✦ Pro

Slack GIF Creator

«Slack GIF Creator» یک مهارت آماده در حوزهٔ رسانه و فایل است؛ به دستیار هوش مصنوعی شما یاد می‌دهد «خودکارسازی جریان کار…

⚡ /slack-gif-creator SKILL.md
Claude / Claude Code
۹۶/۱۰۰ ★ ۱۹۸,۷۹۴
رسانه و فایل
✦ Pro

DOCX creation, editing, and analysis

برای کارهای رسانه و فایل، «DOCX creation, editing, and analysis» یک راهنمای کوتاه و روشن است: مسیر «پردازش اسناد، PDF و…

⚡ /docx SKILL.md
Claude / Claude Code
۹۶/۱۰۰ ★ ۱۹۸,۷۹۴
رسانه و فایل
✦ Pro

Audio Jingle Skill

در ساخت، تبدیل، برش، زیرنویس‌گذاری یا تولید محتوای چندرسانه‌ای (ویدیو، صوت، پادکست و تصویر) با ابزارهای تخصصی کمک می‌کن…

⚡ /audio-jingle SKILL.md
Claude / Claude CodeOpenAI Codex +۱
۹۶/۱۰۰ ★ ۱۰۹,۵۹۶
رسانه و فایل
✦ Pro

Changelog → Branded Video

برای کدها، APIها و تغییرات پروژه مستندات تمیز، README کاربردی و گزارش تغییرات (Changelog) قابل فهم می‌نویسد. (شامل ۹ گا…

⚡ /changelog-video SKILL.md
Claude / Claude CodeOpenAI Codex +۲
۹۶/۱۰۰ ★ ۹۰,۱۴۸