Before executing the specific method, read Craft scenario commands and parameters, and execute according to the object selection, session, input replacement, and result checking within.
Task Starting Point
First read the materials, confirm the delivery purpose, target size or duration, modification scope, and required format. Details that can be determined from the task and materials should directly adopt reasonable defaults; only ask about missing conditions that would change the result.
When a visible editor is needed, hand it over to the pdfcraft-editor skill. Standalone installation:npx skills add full-aigc-skills/pdfcraft-skills --skill pdfcraft-editor. The currently added skill is a local candidate; before release, use the local companion plugin, and do not treat this installation command as proof of release.
Execution Steps
- Count the number of pages, image density, and target size, and confirm the purpose.
- First copy the file, and choose an image resolution suitable for screen or print.
- Compress step by step, prioritizing large images rather than damaging text.
- Compare size, page count, and typical details.
Output checking must reopen the optimized PDF, not just render the original.
Tool Implementation
The upstream tool name belongs to PdfCraft. doc_open/doc_create return a doc handle; subsequent doc_info, doc_save, and page_render use the same doc. PDF page numbers start from 1, and parameters are subject to the actual schema.
First read the actual tool schema, then fill in the parameters; use the return values for object or document IDs. The queried commands must be available on the current backend. Before saving, choose a new output path and keep the input. If the required algorithm, format, or command does not exist, explain the gap; do not pass off a similar name as the real thing.
Result Checking
- Small text, line art, and scanned signatures are still clear.
- Searchable text and links are not accidentally lost.
- If the target size is not reached, explain the quality trade-offs.
Check the actual content against the user's goals, not just the process exit code. For local edits, inspect local details; for layout tasks, inspect the full page; for time-based media, inspect the start, end, and key segments. For abnormal results, first check the current project to avoid repeatedly performing irreversible operations.
Delivery
Return the editable project, the actual derived files, and a brief explanation: what modifications were made, which steps were not executed due to current capabilities, and what requires the user's judgment. List only files that actually exist and have been checked. If the user subsequently requests rework, read this source project and make local modifications, preserving the content that has already been accepted.