office-transform
Skill này làm gì
Công cụ này tạo một tệp tài liệu mới (như Excel, Word, PDF hoặc PowerPoint) từ một phần được chọn của tệp có sẵn. Tệp gốc không bao giờ bị thay đổi.
Khi nào nên dùng
- ✓Khi bạn muốn sao chép một bảng từ bảng tính sang một tệp mới.
- ✓Khi bạn muốn tách một đoạn văn từ tài liệu Word thành tệp mới.
- ✓Khi bạn muốn chuyển một slide từ bản trình bày thành tệp mới.
Liên kết skill
https://github.com/CherryHQ/cherry-studio/blob/main/resources/skills/office-transform/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tạo một tệp Excel mới với dữ liệu từ trang tính ‘Sales’, các cột A đến C, các hàng từ 5 đến 20.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn chọn một phần của tài liệu (như một vùng trong bảng tính hoặc một đoạn trong Word). Công cụ đọc phần đã chọn đó rồi tạo một tệp hoàn toàn mới với nội dung được chọn, đồng thời đảm bảo tệp gốc không bị thay đổi.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Office Transform
Turn a structural selection of an Office/PDF document into a new derived file.
Two invariants hold for every operation:
- The source file is read-only. Every result is a new file; both scripts refuse to write to the source path or overwrite an existing file. Never work around this with ad-hoc shell edits to the original.
- Anchors are structural. Selections address the document's own coordinates — worksheet + A1 range, body-level paragraph ordinal, one-based page number — never screen or DOM positions.
When to use which tool
- Only need to read a document to summarize or answer questions → use
mcp__cherry-tools__to_markdowninstead (see the cherry-tool-guide skill); it is lossy but built for reading. - The user wants a file out — an extracted range, a converted fragment, an edited copy → this skill.
Input: selection references
Chat surfaces may hand you a fenced selection-ref block:
{"path": "/abs/report.xlsx", "anchor": {"format": "xlsx", "sheet": "Sheet1", "range": "A1:C10"}, "excerpt": "…", "fileStamp": {"size": 1024, "mtimeMs": 1700000000000}}
The anchor object is exactly what the scripts take via --anchor.
Freshness check. fileStamp.mtimeMs is milliseconds since the Unix epoch, floored to
whole milliseconds. Do not compare it to stat's default output: stat -f %m (macOS) and
stat -c %Y (GNU) give whole seconds, so multiplying by 1000 loses the sub-second part and
never matches. Read whole milliseconds the way the app wrote them:
uv run python -c "import os,sys;st=os.stat(sys.argv[1]);print(st.st_size, st.st_mtime_ns//1_000_000)" '/abs/report.xlsx'
Treat the file as changed when the size differs, or when the mtimes differ by more than 2 ms.
The tolerance is small on purpose: both sides floor the same nanosecond timestamp to
milliseconds, so they agree exactly, and the couple of milliseconds only covers the rounding
of a double that can no longer represent current epoch milliseconds exactly. A wider window
would hide real edits — a same-size change made within it would read as unchanged, which is
why the anchor check below is not optional. On a change, tell the user the file changed since
they selected and ask them to re-select — never silently re-anchor.
Anchor check. Before a patch-copy edit, also verify the anchor still points where the
user thinks: extract the anchored region and compare its text with the reference's excerpt,
normalizing both sides the same way (NFC, collapse each whitespace run to one space, trim).
The two are not equal and are not meant to be — the excerpt is what the user selected, while
the extract is the whole region an edit would replace. A selection sitting inside one region
makes the excerpt the shorter side; a selection running past that region anchors to where it
starts, which makes it the longer one. So the test is containment, whichever way round fits:
the excerpt appears inside the extract, or the extract's tail is where the excerpt begins.
Only when neither holds has the anchor stopped pointing at the selection — then stop and tell
the user, never edit at a mismatched anchor and never go searching for a "close enough"
location. Two cases need care because the two sides are not directly comparable as-is:
- xlsx: the
excerptis tab-separated cells and newline-separated rows, while extraction writes csv or md. Compare cell values, not the raw file — read the csv with a csv reader and join the fields with single spaces before normalizing, so,and|never count as a difference. That join drops the cell boundaries on both sides, so a match proves the text is unchanged, not the grid — the same words re-split across cells still reads as a match. The freshness check above is what catches that; never skip it on a passing anchor check. Number formats are the second asymmetry: theexcerptholds what Excel displays, because that is what the user pointed at (1,234.50,45.67%), while extraction writes the stored value (1234.5,0.4567). Neither side is wrong, so a formatted cell never matches literally. Compare those cells by value, and leave them out of the joined strings so the containment test runs on the text cells alone. Dates, times and durations are the same asymmetry seen from the other side: extraction writes one fixed shape (2024-01-03,
…
Câu hỏi thường gặp
Điều gì xảy ra với tệp gốc?
Tệp gốc luôn được giữ nguyên. Công cụ không bao giờ chỉnh sửa hay ghi đè lên nó.
Tôi có thể sửa tệp gốc không?
Không, công cụ được thiết kế chỉ đọc tệp nguồn. Mọi thao tác đều tạo ra một tệp mới.
Công cụ biết tôi muốn phần nào của tài liệu bằng cách nào?
Bạn có thể chọn trực tiếp trong tài liệu hoặc mô tả vùng cần lấy (ví dụ ‘trang tính X, các cột A đến C’). Công cụ dùng thông tin này để xác định chính xác cấu trúc cần sao chép.
Chi tiết
Mô tả gốc của tác giả
Derive new Office files from structural selections without touching the original. Use when the user points at part of a spreadsheet, Word document, PDF, or PowerPoint deck (a worksheet range, paragraph, page, slide, shape, or a pasted selection-ref block) and wants it extracted, converted, or edited — the result is always a NEW file; the source file is never modified. Covers xlsx range extraction
repo: CherryHQ/cherry-studio
Độ phổ biến
- Sao GitHub
- 53k
- Vị trí xếp hạng
- #3391
- Giấy phép
- AGPL-3.0
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
code-mate-antigravity
53kCho phép agent của bạn phân tích mã và thực hiện các tác vụ lập trình. Hữu ích để xem xét hoặc cải thiện mã có sẵn.
code-mate-claude-code
53kGiúp agent của bạn phân tích và triển khai mã. Hữu ích cho các tác vụ phát triển phần mềm và xem xét mã.
code-mate-codex
53kCho phép agent của bạn phân tích và triển khai mã. Hữu ích để có kết quả lập trình hoặc so sánh với các công cụ khác.
code-mate-deepseek-harness
53kGiúp agent của bạn phân tích và triển khai mã trong các kho mã. Hữu ích cho các tác vụ phát triển có phạm vi rõ ràng và phân tích mã.
Skill tương tự
obsidian-vault-maintainer
394kGiúp agent của bạn giữ gọn kho ghi nhớ kiểu Obsidian, với liên kết wiki hoạt động tốt, thuộc tính nhất quán và các phần tự tạo an toàn.
wiki-maintainer
394kGiúp agent của bạn duy trì wiki bộ nhớ OpenClaw với các trang có thể lặp lại, khối được quản lý an toàn và kiểm tra mâu thuẫn hoặc thiếu sót.
obsidian
394kCho phép agent của bạn đọc, tìm, tạo và sửa ghi chú, công việc, liên kết và thuộc tính trong Obsidian bằng dòng lệnh Obsidian chính thức.