pdf-verification-check-112b09
하는 일
이 스킬은 AI가 만든 PDF가 존재하고, 비어 있지 않으며, 올바른 쪽수를 가졌는지 확인합니다. 파일을 쓰기 전에 PDF를 믿어야 하는 사람에게 맞습니다.
사용하는 경우
- ✓작업이 PDF를 만들었고 끝내기 전에 확인해야 할 때.
- ✓PDF에 특정 쪽수가 필요한 경우.
- ✓확인이 필요한 PDF 결과물을 여러 개 만든 작업일 때.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pdf-verification-check-112b09/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“PDF를 만든 뒤 파일이 있는지, 비어 있지 않은지, 정확히 세 쪽인지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 필요하면 PyPDF2를 설치하고, 파일이 있고 내용이 있으며 예상한 쪽수와 맞는지 확인하는 짧은 Python 함수를 실행한 뒤 결과를 보고합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
PDF Verification Check
After generating PDF files, always programmatically verify their structure and integrity before declaring task completion. This catches formatting errors, incorrect page counts, and corrupted files early.
When to Use
Use this skill whenever your task involves:
- Generating PDF documents
- Creating PDFs with specific page count requirements
- Producing multi-part PDF outputs (e.g., listings + maps)
Verification Steps
1. Install PyPDF2 (if not available)
pip install PyPDF2
2. Verify PDF Page Count and Integrity
Create a verification script or run inline Python:
from PyPDF2 import PdfReader
import os
def verify_pdf(pdf_path, expected_pages=None):
"""Verify PDF file exists, is readable, and has expected page count."""
try:
# Check file exists
if not os.path.exists(pdf_path):
return False, f"File not found: {pdf_path}"
# Check file size (non-empty)
file_size = os.path.getsize(pdf_path)
if file_size == 0:
return False, f"Empty file: {pdf_path}"
# Open and verify PDF structure
reader = PdfReader(pdf_path)
actual_pages = len(reader.pages)
# Check page count if expected
if expected_pages is not None and actual_pages != expected_pages:
return False, f"Expected {expected_pages} pages, got {actual_pages}"
return True, f"Valid PDF with {actual_pages} page(s)"
except Exception as e:
return False, f"PDF verification failed: {str(e)}"
# Example usage
pdf_files = [
("listings.pdf", 2),
("map.pdf", 1),
]
all_valid = True
for pdf_path, expected in pdf_files:
valid, message = verify_pdf(pdf_path, expected)
print(f"{pdf_path}: {'✓' if valid else '✗'} {message}")
if not valid:
all_valid = False
if not all_valid:
raise Exception("PDF verification failed - review and regenerate")
3. Use run_shell for Verification
Execute the verification using run_shell:
python -c "
from PyPDF2 import PdfReader
import sys
pdf_path = 'output.pdf'
expected = 2
try:
reader = PdfReader(pdf_path)
actual = len(reader.pages)
if actual != expected:
print(f'ERROR: Expected {expected} pages, got {actual}')
sys.exit(1)
print(f'OK: {pdf_path} has {actual} page(s)')
except Exception as e:
print(f'ERROR: {e}')
sys.exit(1)
"
4. Verify Before Completion
Critical: Only mark your task as complete after ALL PDF verification checks pass. If verification fails:
- Examine the error message
- Regenerate the PDF with corrected formatting
- Re-run verification
- Repeat until all checks pass
Common Issues Caught
- Wrong page counts (e.g., content spilling to extra pages)
- Empty or corrupted PDF files
- PDFs that fail to open properly
- Missing expected sections due to formatting errors
Example Workflow
# 1. Generate PDF
generate_pdf("listings.pdf", content)
# 2. Verify before completion
valid, msg = verify_pdf("listings.pdf", expected_pages=2)
if not valid:
# Fix and regenerate
regenerate_pdf("listings.pdf", corrected_content)
valid, msg = verify_pdf("listings.pdf", expected_pages=2)
# 3. Only complete if verification passes
assert valid, f"Cannot complete: {msg}"
자주 묻는 질문
이 확인은 무엇을 검증하나요?
파일이 있고, 비어 있지 않으며, 예상한 쪽수로 열 수 있는지 확인합니다.
PyPDF2는 무엇에 쓰이나요?
PDF를 열고 쪽수를 세는 데 쓰입니다.
쪽수가 틀리면 어떻게 되나요?
불일치를 보고해서 AI가 생성 단계를 고칠 수 있게 합니다.
상세 정보
작성자의 원본 설명
Verify generated PDF files using PyPDF2 to check page counts and integrity
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #12936
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.
비슷한 스킬
feishu-doc
394k에이전트가 문서 도구를 사용해 텍스트, 이미지, 표를 포함한 Feishu 클라우드 문서를 읽고, 만들고, 편집하도록 돕습니다.
feishu-drive
394k에이전트가 봇과 공유된 Feishu 클라우드 폴더의 파일을 찾아보고, 정리하고, 댓글을 달도록 돕습니다.
feishu-perm
394k에이전트가 요청을 충족하는 가장 작은 권한을 골라, Feishu 파일에 누가 접근할 수 있는지 확인하고 바꾸도록 돕습니다.