Chuyển đến nội dung
Skillpedia
PDF, Word và slide7.8k · #12909

pdf-checklist-generator

Skill này làm gì

Skill này là mẫu có thể tái sử dụng để tạo tài liệu PDF chuyên nghiệp bằng Python trong sandbox. Dành cho người cần bản đánh giá, danh sách kiểm tra hoặc báo cáo có cấu trúc dưới dạng PDF.

Khi nào nên dùng

  • ✓Khi tôi cần một PDF có cấu trúc với bảng, các phần và chấm điểm.
  • ✓Khi tôi muốn cấu trúc tài liệu được lập kế hoạch trước khi viết bất kỳ code nào.
  • ✓Khi tôi cần một artifact có thể tải về cho một tác vụ quy trình.

Liên kết skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pdf-checklist-generator/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/pdf-checklist-generator/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy tạo một bảng điểm PDF để đánh giá nhà cung cấp, có thang chấm điểm và một phần cho mỗi hạng mục.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI trước tiên lập kế hoạch tiêu đề, các phần, cột bảng và thang chấm điểm, rồi viết code reportlab hoặc fpdf2 để tạo tài liệu trong sandbox.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

PDF Checklist/Report Generator

This skill provides a reusable pattern for creating professional PDF documents (checklists, reports, scorecards) using Python libraries within execute_code_sandbox.

When to Use This Skill

  • Need to generate structured PDF documents programmatically
  • Creating checklists with scoring criteria
  • Building reports with tables, sections, and formatted content
  • Producing downloadable artifacts for workflow tasks

Library Selection

Choose the appropriate library based on your needs:

Library Best For Installation
reportlab Complex layouts, tables, precise control pip install reportlab
fpdf2 Simple documents, easy API pip install fpdf2
matplotlib Charts/graphs in PDFs pip install matplotlib

Step-by-Step Procedure

Step 1: Plan Document Structure

Define the sections, tables, and scoring criteria before coding:

  • Document title and metadata
  • Section headers
  • Table columns and rows
  • Scoring rubric (if applicable)

Step 2: Write Python Code in execute_code_sandbox

Use execute_code_sandbox with the appropriate library. Here are templates:

Template A: Using reportlab (recommended for tables)

from reportlab.lib import colors
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import inch

# Create PDF
doc = SimpleDocTemplate("checklist.pdf", pagesize=letter)
elements = []
styles = getSampleStyleSheet()

# Title
title_style = ParagraphStyle('CustomTitle', parent=styles['Heading1'], alignment=1)
elements.append(Paragraph("Compliance Checklist", title_style))
elements.append(Spacer(1, 0.25*inch))

# Create table data
data = [
    ['Criteria', 'Status', 'Score', 'Notes'],
    ['Security Review', 'Pass', '10', 'All checks passed'],
    ['Code Quality', 'Pass', '8', 'Minor improvements'],
    ['Documentation', 'Pending', '5', 'Needs updates'],
]

# Create and style table
table = Table(data, colWidths=[3*inch, 1*inch, 1*inch, 2*inch])
table.setStyle(TableStyle([
    ('BACKGROUND', (0, 0), (-1, 0), colors.grey),
    ('TEXTCOLOR', (0, 0), (-1, 0), colors.whitesmoke),
    ('ALIGN', (0, 0), (-1, -1), 'CENTER'),
    ('GRID', (0, 0), (-1, -1), 1, colors.black),
    ('BACKGROUND', (0, 1), (-1, -1), colors.beige),
]))
elements.append(table)

# Build PDF
doc.build(elements)
print("PDF created: checklist.pdf")
print(f"ARTIFACT_PATH:/workspace/checklist.pdf")

Template B: Using fpdf2 (simpler API)

from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.set_font("Arial", "B", 16)
pdf.cell(0, 10, "Project Report", ln=True, align='C')

pdf.set_font("Arial", size=12)
pdf.ln(10)

# Add sections
sections = [
    ("Executive Summary", "Project completed successfully."),
    ("Key Findings", "All milestones achieved on time."),
    ("Recommendations", "Continue current practices."),
]

for title, content in sections:
    pdf.set_font("Arial", "B", 14)
    pdf.cell(0, 10, title, ln=True)
    pdf.set_font("Arial", size=12)
    pdf.multi_cell(0, 8, content)
    pdf.ln(5)

pdf.output("report.pdf")
print("PDF created: report.pdf")
print(f"ARTIFACT_PATH:/workspace/report.pdf")

Template C: Checklist with Scoring

from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib import colors

doc = SimpleDocTemplate("scorecard.pdf", pagesize=letter)
elements = []
styles = getSampleStyleSheet()

# Title
elements.append(Paragraph("Evaluation Scorecard", styles['Heading1']))
elements.append(Spacer(1, 0.25*inch))

# Scoring criteria table
criteria = [
    ['Category', 'Weight', 'Score (0-10)', 'Weighted'],
    ['Functionality', '30%', '9', '2.7'],
    ['Performance', '25%', '8', '2.0'],
    ['Security', '25%', '10', '2.5'],
    ['Documentation', '20%', '7', '1.4'],
    ['TOTAL', '100%', '-', '8.6/10'],
]

table = Table(criteria, colWidths=[2.5*inch, 1*inch, 1.5*inch, 1.5*inch])
table.setStyle(TableStyle([
    ('BACKGROUND', (0, 0), (-1, 0), colors.darkblue),
    ('TEXTCOLOR', (0, 0), (-1, 0), colors.whitesmoke),
    ('ALIGN', (0, 0), (-1, -1), 'CENTER'),
    ('GRID', (0, 0), (-1, -1), 1, colors.black),
    ('FONTNAME', (0, -1), (-1, -1), 'Helvetica-Bold'),
    
Câu hỏi thường gặp

Vì sao lập kế hoạch cấu trúc trước?

Xác định các phần, bảng và thang chấm điểm trước giúp code đơn giản hơn và kết quả nhất quán hơn.

Những thư viện nào được nhắc đến?

Hướng dẫn nhắc đến reportlab, fpdf2 và matplotlib, mỗi thư viện cho một nhu cầu khác nhau.

Có cần cài đặt đặc biệt không?

Hướng dẫn cho biết lệnh cài pip cho thư viện đã chọn.

Chi tiết

Mô tả gốc của tác giả

Generate structured PDF checklists and reports with tables, sections, and scoring criteria using Python libraries

repo: HKUDS/AgentPilot

Độ phổ biến

Sao GitHub
7.8k
Vị trí xếp hạng
#12909
Giấy phép
MIT
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự