Sources: extracted from two upstream archives (skill-repo, skills-main),
merged with the following policy:
- 15 broken symlinks (pointing to /Users/jameslee/.cc-switch/skills or
../../.agents/skills on a foreign machine) discarded
- 3 real name collisions with identical content (ai-pair, ifind-http-api,
zhipu-websearch) kept as one copy
- Functional overlaps deduped keeping the strongest variant:
- docx family: kept docx (official, full toolchain) + docx-cn
(GB/T 9704 Chinese official-document constants),
dropped docx_writer (no scripts, name collided with docx)
- humanizer family: kept humanizer-zh (6 zh reference docs),
dropped humanizer (en, redundant for CN workflow)
- Skills that only ran in a foreign environment removed:
ablemind-ops, app-publish, hlb-design-system, openclaw-adj-skill,
claude-driver
- alphapai excluded from this public repo because its SKILL.md hard-coded
live credentials
Result: 25 skills, 572 files, ~7.5 MB.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
import os
|
|
import sys
|
|
|
|
from pdf2image import convert_from_path
|
|
|
|
|
|
# Converts each page of a PDF to a PNG image.
|
|
|
|
|
|
def convert(pdf_path, output_dir, max_dim=1000):
|
|
images = convert_from_path(pdf_path, dpi=200)
|
|
|
|
for i, image in enumerate(images):
|
|
# Scale image if needed to keep width/height under `max_dim`
|
|
width, height = image.size
|
|
if width > max_dim or height > max_dim:
|
|
scale_factor = min(max_dim / width, max_dim / height)
|
|
new_width = int(width * scale_factor)
|
|
new_height = int(height * scale_factor)
|
|
image = image.resize((new_width, new_height))
|
|
|
|
image_path = os.path.join(output_dir, f"page_{i+1}.png")
|
|
image.save(image_path)
|
|
print(f"Saved page {i+1} as {image_path} (size: {image.size})")
|
|
|
|
print(f"Converted {len(images)} pages to PNG images")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) != 3:
|
|
print("Usage: convert_pdf_to_images.py [input pdf] [output directory]")
|
|
sys.exit(1)
|
|
pdf_path = sys.argv[1]
|
|
output_directory = sys.argv[2]
|
|
convert(pdf_path, output_directory)
|