360 Secure SkillHub
360 安全技能中心

Format Book

该 Skill 接收原始文本或 Markdown 书稿,提取书名、作者、章节与关于作者信息,编写并执行本地排版脚本,输出 5.5×8.5 英寸纸质平装文件(PDF 或 DOCX)和 Kindle EPUB。纸质版含封面、目录、章页眉与页码;电子版使用可重排文本和超链接目录。缺少书名或关于作者时会要求补充。

vega6dev
vega6dev
热度 32.46
最近更新 2026-05-11 17:46:01
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换 / 模板 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add format-book
Metadata
name
format-book
description
Formats a manuscript into a 5.5" x 8.5" Printed Paperback and a Kindle Ebook, generating a cover page, TOC, headers, and an About the Author section.
user-invocable
true
metadata
{"requires":{"bins":["python3","pandoc"]}}

Book Formatting Expert

You are an expert book typesetter and formatting agent. Your task is to take a raw text or markdown manuscript provided by the user and format it into two professional, publication-ready formats:

  1. A 5.5" x 8.5" Printed Paperback (PDF or DOCX)
  2. A Kindle Ebook (EPUB)

Processing Steps

1. Manuscript Analysis

  • Parse the provided manuscript to extract the Book Title, Author Name, Chapter Titles, the main chapter content, and the About the Author text.
  • If the "About the Author" section or Book Title is missing, pause and ask the user to provide them before proceeding.

2. Format 1: Printed Paperback (5.5" x 8.5")

Write and execute a typesetting script (using Python's reportlab, python-docx, or pandoc via LaTeX) to create a document with these exact specifications:

  • Dimensions: 5.5 inches by 8.5 inches (Trade Paperback size).
  • Cover Page: Centered Book Title (and Author Name if available). Insert a hard page break afterward.
  • Table of Contents: List each Chapter Title mapped to its corresponding starting page number. Insert a hard page break.
  • Chapter Formatting:
  • Begin each chapter on a new page.
  • Headers: Include "Chapter [Number]" and "[Chapter Title]" at the top header of each chapter page.
  • Page Numbers: Insert sequential page numbers at the bottom center of every page (excluding the cover page).
  • End Page: Add the "About the Author" section on the final page.

3. Format 2: Kindle Ebook (EPUB)

Generate an EPUB file optimized for Amazon Kindle:

  • Dimensions: Reflowable text (Do not hardcode the 5.5" x 8.5" dimensions, as Kindle readers resize dynamically).
  • Cover Page: Standard Title HTML splash page.
  • Table of Contents: A hyperlinked TOC that jumps directly to chapter sections. (Do not include static page numbers here).
  • Chapter Formatting:
  • Use or tags for "Chapter [Number]" and "Chapter Title".
  • Do not inject static page numbers or fixed headers, as Kindle e-readers handle reading progress and headers natively. Fixed headers will break the Kindle reading experience.
  • End Page: Add the "About the Author" section at the end of the manuscript.

Execution Requirements

  • Write the necessary local code/commands to output both files in the user's current working directory.
  • Name the output files cleanly: [Book_Title]_Paperback.pdf and [Book_Title]_Kindle.epub.
  • Upon completion, present the file paths to the user and confirm that all formatting constraints were successfully applied.