Migrate from curl-based skill to Python plugin architecture#3
Merged
Conversation
Replace nutrient-document-processing/ (curl-based SKILL.md + REFERENCE.md) with plugins/nutrient-document-processor-api/ containing 19 Python scripts, Claude Code marketplace support, and OpenAI Codex compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tions - Add PDF Requirements section to SKILL.md clarifying that split.py needs multi-page PDFs, delete-pages.py must retain at least one page, and sign.py needs local paths - Update testing-guide.md to explicitly require multi-page PDFs (3+ pages) for testing - Add notes explaining why single-page PDFs cause failures - Remove redundant sign.py note from Rules section since it's now in PDF Requirements This prevents future test failures and clarifies API constraints. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Sync changes from nutrient-document-processing source to installed skill: - Add PDF Requirements section to SKILL.md - Update testing-guide.md to require multi-page PDFs (3+ pages) - Remove redundant sign.py note from Rules (moved to PDF Requirements) - Add notes explaining why single-page PDFs cause failures Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The existing curl-based skill used inline curl commands with complex JSON payloads, which required agents to construct nested
instructionspayloads, debug multipart form encoding, and chain multiple curl calls with intermediate file handling. This migration replaces that with Python scripts behind simple CLI flags, dramatically reducing agent turns and token usage on complex tasks.Summary
REFERENCE.md(598 lines of API docs) with 16 focused Python scripts innutrient-document-processing/scripts/, each exposing a single operation via CLI flagsscripts/lib/common.py) handling API auth, file upload, async execution, and error handlingassets/templates/custom-workflow-template.py) for multi-step pipelines — agents copy and customize it at runtime instead of committing new scriptstests/testing-guide.md) with benchmark methodologyuv runinvocations with all args for every script, inline page range format and multi-step workflow rulesSKILL.md design
The SKILL.md is written so an agent can execute ANY operation with zero exploration turns:
uv runinvocations with all args for all 16 scripts--helplookups or reference file reads requiredScripts (16)
Convert & Transform:
convert.py,merge.py,split.py,ocr.py,rotate.py,optimize.pyExtract & Analyze:
extract-text.py,extract-table.py,extract-key-value-pairs.pyEdit & Secure:
watermark-text.py,redact-ai.py,sign.py,password-protect.pyPage Operations:
add-pages.py,delete-pages.py,duplicate-pages.pyBenchmark Results
Original 3 tests (convert, merge, OCR+watermark pipeline)
Comparing v1 (curl-based) and v2 (Python scripts with improved SKILL.md):
The pipeline test showed the largest improvement: v1 needed 12 turns / 52s, v2 completed in 8 turns / 44s.
Extended benchmark: 10 complex document workflows
10 additional complex workflows covering extraction, security, page manipulation, and multi-step pipelines. Each test was run on both v1 and v2 using
claude -pwith Sonnet,--dangerously-skip-permissions, 360s timeout.Tests: extract text (page-scoped), split into individual pages, AI-redact emails, watermark with custom params, sign with metadata, OCR+optimize pipeline, convert to markdown, extract key-value pairs, redact+watermark pipeline, merge+split pipeline.
v2 won 9 of 10 tests. Per-test highlights:
The only test v1 won was merge-then-split (61s vs 74s), where v1's single curl call with inline JSON is marginally faster than chaining two Python scripts.
Why v2 is faster on complex tasks
v1's curl-based SKILL.md has copy-paste examples for simple operations, but complex tasks require the agent to:
instructionspayloads from memoryv2's Python scripts encapsulate all API complexity behind CLI flags. The SKILL.md gives the agent the exact invocation for every script, so it can go from prompt to execution in 1–2 turns.