[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6HXNYZWNCMM85QCD41SDAW6":3,"skill-same:01M6HXNYZWNCMM85QCD41SDAW6":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":6,"updatedAt":52,"install":53,"resources":66},"01M6HXNYZWNCMM85QCD41SDAW6","unified-deliverable-workflow",null,"Generate spreadsheets, diagrams, and PDF reports with iteration budgeting and error recovery","HKUDS\u002FAgentPilot","HKUDS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F118165258?v=4","01M6HW8VRNZP64G0P4MVJW2KKQ","✨Data Intelligence Lab@HKU✨","01M6HW8VWZVHBRHYH3T330PFWV",8029,"MIT","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Flegacy\u002Fv1\u002Fgdpval_bench\u002Fskills\u002Fpdf-checklist-workflow-enhanced-780c5d\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[27,28,29,30,31,32,33,34,35,36,37,38,39],"workflow","unified deliverable workflow","PDF","spreadsheets","error recovery","generate","recovery","budgeting","reports","diagrams","iteration","error","with","2026-11-10 10:12:30",false,"---\nname: unified-deliverable-workflow\ndescription: Generate spreadsheets, diagrams, and PDF reports with iteration budgeting and error recovery\n---\n\n# Unified Multi-Deliverable Workflow\n\nThis skill provides a structured pattern for creating multiple document artifacts (spreadsheets, diagrams, PDF reports) in a single workflow with explicit iteration budgeting and robust error handling.\n\n## Overview\n\nUse this workflow when you need to:\n- Generate multiple related deliverables (Excel, PNG diagrams, PDF reports)\n- Manage iteration budget across different artifact types\n- Handle execute_code_sandbox failures gracefully\n- Ensure all deliverables are completed before budget exhaustion\n- Create cohesive documentation packages with cross-referenced content\n\n## Iteration Budget Template\n\n**Default Allocation (adjust based on task complexity):**\n\n| Phase | Deliverable | Iterations | Validation |\n|-------|-------------|------------|------------|\n| 1 | Spreadsheet (.xlsx) | 8-10 | File exists, readable, correct structure |\n| 2 | Diagram (.png) | 8-10 | File exists, viewable, correct dimensions |\n| 3 | PDF Report (.pdf) | 8-10 | File exists, downloadable, proper formatting |\n| Buffer | Error recovery | 4-6 | Retry failed phases |\n\n**Total recommended budget: 30-36 iterations**\n\n## Pre-Flight Checks (Iteration 1-2)\n\nBefore generating any deliverables:\n\n1. **Verify workspace path**: Always use `\u002Fworkspace\u002F` as base directory\n2. **Test execute_code_sandbox**: Run a simple print statement to confirm tool works\n3. **Check required libraries**: Plan to install via `!pip install` if needed\n4. **Standardize filenames**: Use consistent naming pattern (e.g., `projectname_deliverable.ext`)\n\n```python\n# Quick sandbox test\nprint(\"SANDBOX_OK\")\nprint(f\"WORKSPACE_PATH:\u002Fworkspace\")\n```\n\nIf this fails, use `run_shell` as fallback for file operations.\n\n## Phase 1: Spreadsheet Creation (Iterations 3-12)\n\n### Step 1.1: Plan Structure\nDefine your spreadsheet structure before coding:\n- Sheet names\n- Column headers\n- Data types\n- Any formulas or formatting\n\n### Step 1.2: Write Generation Code\n\n**Using openpyxl (recommended for .xlsx):**\n\n```python\n# Install if needed\n# !pip install openpyxl\n\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font, PatternFill, Alignment\n\nwb = Workbook()\nws = wb.active\nws.title = \"Data\"\n\n# Header row with styling\nheaders = [\"Item\", \"Description\", \"Value\", \"Status\"]\nfor col, header in enumerate(headers, 1):\n    cell = ws.cell(row=1, column=col, value=header)\n    cell.font = Font(bold=True)\n    cell.fill = PatternFill(start_color=\"CCCCCC\", end_color=\"CCCCCC\", fill_type=\"solid\")\n    cell.alignment = Alignment(horizontal=\"center\")\n\n# Data rows\ndata = [\n    [\"Item 1\", \"Description 1\", 100, \"Complete\"],\n    [\"Item 2\", \"Description 2\", 200, \"Pending\"],\n]\nfor row_idx, row_data in enumerate(data, 2):\n    for col_idx, value in enumerate(row_data, 1):\n        ws.cell(row=row_idx, column=col_idx, value=value)\n\n# Auto-adjust column widths\nfor column in ws.columns:\n    max_length = 0\n    column_letter = column[0].column_letter\n    for cell in column:\n        try:\n            if len(str(cell.value)) > max_length:\n                max_length = len(str(cell.value))\n        except:\n            pass\n    adjusted_width = min(max_length + 2, 50)\n    ws.column_dimensions[column_letter].width = adjusted_width\n\n# Save with standard path\noutput_path = \"\u002Fworkspace\u002Fhardware_selection_table.xlsx\"\nwb.save(output_path)\nprint(f\"ARTIFACT_PATH:{output_path}\")\nprint(\"SPREADSHEET_GENERATED\")\n```\n\n### Step 1.3: Execute and Validate\n\n```\nexecute_code_sandbox\n  code: \u003Cyour spreadsheet code>\n  language: python\n```\n\n**Validation checklist:**\n- [ ] ARTIFACT_PATH output present\n- [ ] File exists: `run_shell command: ls -lh \u002Fworkspace\u002F*.xlsx`\n- [ ] File size > 1KB\n- [ ] No error messages in output\n\n### Step 1.4: Error Recovery\n\n| Error | Recovery Action |\n|-------|-----------------|\n| Library not found | Add `!pip install openpyxl` at code start |\n| '[ERROR] unknown error' | Retry once, then try simpler code structure |\n| File not created | Check path is `\u002Fworkspace\u002F` not `.\u002F` or `\u002Ftmp\u002F` |\n| Permission denied | Ensure no file lock from previous execution |\n\n**If 2 consecutive failures:** Skip to Phase 2 and return later with reduced scope.\n\n## Phase 2: Diagram Generation (Iterations 13-22)\n\n### Step 2.1: Choose Diagram Type\n\n| Type | Library | Best For |\n|------|---------|----------|\n| Flowchart | `graphviz` or `matplotlib` | Process flows, decision trees |\n| Layout\u002FDiagram | `matplotlib` | Physical layouts, workcell designs |\n| Network\u002FTopology | `networkx` + `matplotlib` | System architecture |\n| Simple shapes | `PIL\u002FPillow` | Basic boxes, arrows, labels |\n\n### Step 2.2: Write Generation Code\n\n**Using matplotlib for layout diagrams:**\n\n```python\n# Install if needed\n# !pip install matplotlib\n\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\n\nfig, ax = plt.subplots(figsize=(12, 8))\nax.set_xlim(0, 100)\nax.set_ylim(0, 80)\nax.set_aspect('equal')\n\n# Add components (example: workcell layout)\ncomponents = [\n    {\"label\": \"Robot\", \"x\": 30, \"y\": 40, \"w\": 20, \"h\": 15, \"color\": \"lightblue\"},\n    {\"label\": \"Conveyor\", \"x\": 60, \"y\": 35, \"w\": 30, \"h\": 10, \"color\": \"lightgreen\"},\n    {\"label\": \"Safety Zone\", \"x\": 10, \"y\": 10, \"w\": 80, \"h\": 60, \"color\": \"none\", \"border\": \"red\"},\n]\n\nfor comp in components:\n    rect = patches.Rectangle(\n        (comp[\"x\"], comp[\"y\"]), \n        comp[\"w\"], \n        comp[\"h\"],\n        linewidth=2, \n        edgecolor=\"black\" if comp.get(\"border\") else \"black\",\n        facecolor=comp[\"color\"] if comp[\"color\"] != \"none\" else \"white\",\n        linestyle=\"--\" if comp.get(\"border\") else \"-\"\n    )\n    ax.add_patch(rect)\n    ax.text(\n        comp[\"x\"] + comp[\"w\"]\u002F2, \n        comp[\"y\"] + comp[\"h\"]\u002F2, \n        comp[\"label\"],\n        ha=\"center\", \n        va=\"center\",\n        fontsize=10,\n        fontweight=\"bold\"\n    )\n\n# Remove axis, add title\nax.axis(\"off\")\nplt.title(\"Workcell Layout Diagram\", fontsize=14, fontweight=\"bold\", pad=20)\nplt.tight_layout()\n\n# Save with standard path\noutput_path = \"\u002Fworkspace\u002Fcnc_workcell_layout.png\"\nplt.savefig(output_path, dpi=150, bbox_inches=\"tight\")\nprint(f\"ARTIFACT_PATH:{output_path}\")\nprint(\"DIAGRAM_GENERATED\")\n```\n\n### Step 2.3: Execute and Validate\n\n```\nexecute_code_sandbox\n  code: \u003Cyour diagram code>\n  language: python\n```\n\n**Validation checklist:**\n- [ ] ARTIFACT_PATH output present\n- [ ] File exists: `run_shell command: ls -lh \u002Fworkspace\u002F*.png`\n- [ ] File size > 5KB (diagrams should be substantial)\n- [ ] No error messages in output\n\n### Step 2.4: Error Recovery\n\n| Error | Recovery Action |\n|-------|-----------------|\n| Backend unknown error | Retry with simplified diagram (fewer elements) |\n| Font rendering issues | Use default matplotlib fonts, avoid custom fonts |\n| Memory issues | Reduce figure size or DPI |\n| Import errors | Add `!pip install matplotlib pillow` at start |\n\n**If 2 consecutive failures:** Create a simpler placeholder diagram and move to Phase 3.\n\n## Phase 3: PDF Report Generation (Iterations 23-32)\n\n### Step 3.1: Gather Content from Previous Phases\n\nBefore generating PDF, collect:\n- Data from spreadsheet (reference key findings)\n- Diagram file path for embedding or referencing\n- Any additional text content or analysis\n\n### Step 3.2: Write Generation Code\n\n**Using reportlab for professional reports:**\n\n```python\n# Install if needed\n# !pip install reportlab\n\nfrom reportlab.lib import colors\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, Image\nfrom reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle\nfrom reportlab.lib.units import inch\n\ndef create_pdf_report(output_path, spreadsheet_path, diagram_path):\n    doc = SimpleDocTemplate(output_path, pagesize=letter)\n    styles = getSampleStyleSheet()\n    story = []\n    \n    # Title\n    title_style = ParagraphStyle('CustomTitle', parent=styles['Heading1'],\n                                  fontSize=18, spaceAfter=30, alignment=1)\n    story.append(Paragraph(\"Project Deliverables Report\", title_style))\n    story.append(Spacer(1, 0.3*inch))\n    \n    # Executive Summary\n    story.append(Paragraph(\"Executive Summary\", styles['Heading2']))\n    story.append(Paragraph(\"This report summarizes the project deliverables including hardware selection, layout design, and implementation recommendations.\", styles['Normal']))\n    story.append(Spacer(1, 0.2*inch))\n    \n    # Spreadsheet Reference Section\n    story.append(Paragraph(\"Hardware Selection Summary\", styles['Heading2']))\n    story.append(Paragraph(f\"See: {spreadsheet_path}\", styles['Normal']))\n    \n    # Sample data table\n    data = [\n        ['Component', 'Selected Option', 'Status'],\n        ['Robot Arm', 'Model X-200', 'Approved'],\n        ['Controller', 'Unity Pro', 'Approved'],\n        ['Safety System', 'Light Curtain', 'Pending']\n    ]\n    \n    table = Table(data, colWidths=[2*inch, 2*inch, 1.5*inch])\n    table.setStyle(TableStyle([\n        ('BACKGROUND', (0, 0), (-1, 0), colors.grey),\n        ('TEXTCOLOR', (0, 0), (-1, 0), colors.whitesmoke),\n        ('ALIGN', (0, 0), (-1, -1), 'CENTER'),\n        ('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),\n        ('GRID', (0, 0), (-1, -1), 1, colors.black)\n    ]))\n    story.append(table)\n    story.append(Spacer(1, 0.3*inch))\n    \n    # Diagram Reference Section\n    story.append(Paragraph(\"Layout Diagram\", styles['Heading2']))\n    story.append(Paragraph(f\"See: {diagram_path}\", styles['Normal']))\n    story.append(Spacer(1, 0.2*inch))\n    \n    # Try to embed diagram if it exists\n    try:\n        img = Image(diagram_path, width=6*inch, height=4*inch)\n        story.append(img)\n        story.append(Spacer(1, 0.2*inch))\n    except:\n        story.append(Paragraph(\"Diagram referenced but not embedded.\", styles['Normal']))\n    \n    # Recommendations\n    story.append(Paragraph(\"Recommendations\", styles['Heading2']))\n    recommendations = [\n        \"Proceed with approved hardware components\",\n        \"Complete safety system evaluation before deployment\",\n        \"Schedule installation during planned maintenance window\"\n    ]\n    for i, rec in enumerate(recommendations, 1):\n        story.append(Paragraph(f\"{i}. {rec}\", styles['Normal']))\n    \n    # Build PDF\n    doc.build(story)\n    print(f\"ARTIFACT_PATH:{output_path}\")\n    print(\"PDF_REPORT_GENERATED\")\n\ncreate_pdf_report(\n    '\u002Fworkspace\u002Fproject_report.pdf',\n    '\u002Fworkspace\u002Fhardware_selection_table.xlsx',\n    '\u002Fworkspace\u002Fcnc_workcell_layout.png'\n)\n```\n\n### Step 3.3: Execute and Validate\n\n```\nexecute_code_sandbox\n  code: \u003Cyour PDF code>\n  language: python\n```\n\n**Validation checklist:**\n- [ ] ARTIFACT_PATH output present\n- [ ] File exists: `run_shell command: ls -lh \u002Fworkspace\u002F*.pdf`\n- [ ] File size > 10KB (reports should have substantial content)\n- [ ] All previous deliverables referenced correctly\n\n### Step 3.4: Error Recovery\n\n| Error | Recovery Action |\n|-------|-----------------|\n| Font errors | Use standard fonts (Helvetica, Arial, Courier) |\n| Image embed fails | Reference diagram path in text instead |\n| Unknown error | Simplify report structure, remove images |\n| Path issues | Hardcode absolute `\u002Fworkspace\u002F` paths |\n\n**If failures persist:** Generate a text-only PDF with basic structure.\n\n## Phase 4: Final Validation (Iterations 33-36)\n\n### Step 4.1: Verify All Deliverables\n\n```\nrun_shell\n  command: ls -lh \u002Fworkspace\u002F*.xlsx \u002Fworkspace\u002F*.png \u002Fworkspace\u002F*.pdf\n```\n\n### Step 4.2: Check File Integrity\n\n```\nrun_shell\n  command: file \u002Fworkspace\u002F*.xlsx \u002Fworkspace\u002F*.png \u002Fworkspace\u002F*.pdf\n```\n\n### Step 4.3: Confirm Download Paths\n\nEnsure each deliverable has `ARTIFACT_PATH:` prefix in execution output for proper download handling.\n\n## Cross-Phase Best Practices\n\n### Path Standardization\n- **Always use**: `\u002Fworkspace\u002Ffilename.ext`\n- **Never use**: `.\u002Ffilename.ext`, `\u002Ftmp\u002Ffilename.ext`, or relative paths\n- **Consistent naming**: `projectname_deliverabletype.ext`\n\n### Iteration Management\n- Track iterations used per phase\n- If Phase 1 uses >12 iterations, reduce Phase 2 and 3 budgets\n- Reserve minimum 4 iterations for error recovery\n- **Hard stop at iteration 28**: Begin PDF generation regardless of previous phase completion status\n\n### Error Handling Strategy\n1. **First failure**: Retry same code once\n2. **Second failure**: Simplify the approach (reduce complexity)\n3. **Third failure**: Create minimal viable deliverable and move on\n4. **Document failures**: Note what failed for post-task review\n\n### Tool Failure Workarounds\n\n| Tool | Primary Use | Fallback |\n|------|-------------|----------|\n| execute_code_sandbox | Run Python code | run_shell with python -c |\n| read_file | Verify file content | run_shell cat\u002Fhead |\n| run_shell | Check file existence | execute_code_sandbox with os.path |\n\n## Quick Start Template\n\n```python\n# Unified deliverable generator - minimal viable version\n# Run in execute_code_sandbox\n\n# ===== SPREADSHEET =====\nfrom openpyxl import Workbook\nwb = Workbook()\nws = wb.active\nws.append([\"Item\", \"Value\", \"Status\"])\nws.append([\"Component A\", 100, \"OK\"])\nwb.save(\"\u002Fworkspace\u002Fdata.xlsx\")\nprint(\"ARTIFACT_PATH:\u002Fworkspace\u002Fdata.xlsx\")\n\n# ===== DIAGRAM =====\nimport matplotlib.pyplot as plt\nfig, ax = plt.subplots(figsize=(8, 6))\nax.text(0.5, 0.5, \"Diagram Placeholder\", ha='center', va='center', fontsize=16)\nax.axis('off')\nplt.savefig(\"\u002Fworkspace\u002Fdiagram.png\", dpi=100)\nprint(\"ARTIFACT_PATH:\u002Fworkspace\u002Fdiagram.png\")\n\n# ===== PDF =====\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.platypus import SimpleDocTemplate, Paragraph\nfrom reportlab.lib.styles import getSampleStyleSheet\ndoc = SimpleDocTemplate(\"\u002Fworkspace\u002Freport.pdf\", pagesize=letter)\nstyles = getSampleStyleSheet()\nstory = [Paragraph(\"Report\", styles['Heading1']), \n         Paragraph(\"Generated successfully.\", styles['Normal'])]\ndoc.build(story)\nprint(\"ARTIFACT_PATH:\u002Fworkspace\u002Freport.pdf\")\n```\n\n## Related Tools\n\n- `execute_code_sandbox` - Run Python code for all deliverable generation\n- `read_file` - Verify file content (type: xlsx, png, pdf)\n- `run_shell` - Check file existence, size, and integrity\n- `create_file` - For simple text-based deliverables if needed\n\n## Common Pitfalls and Solutions\n\n| Pitfall | Solution |\n|---------|----------|\n| Exhausting budget on Phase 1 | Set hard iteration limit per phase (max 12) |\n| Workspace path confusion | Always use absolute `\u002Fworkspace\u002F` paths |\n| Repeated unknown errors | Simplify code, reduce library dependencies |\n| Missing ARTIFACT_PATH | Always print prefix for each deliverable |\n| PDF created but not downloadable | Verify ARTIFACT_PATH is on its own line |\n| Diagram too complex | Start with basic shapes, add detail only if time permits |\n\n## Success Criteria\n\nA successful execution should produce:\n- [ ] 3 deliverable files in `\u002Fworkspace\u002F`\n- [ ] Each file > minimum size threshold\n- [ ] Each execution outputs `ARTIFACT_PATH:` prefix\n- [ ] Completed before iteration budget exhaustion\n- [ ] No unrecovered tool errors\n","# Unified Multi-Deliverable Workflow\n\nThis skill provides a structured pattern for creating multiple document artifacts (spreadsheets, diagrams, PDF reports) in a single workflow with explicit iteration budgeting and robust error handling.\n\n## Overview\n\nUse this workflow when you need to:\n- Generate multiple related deliverables (Excel, PNG diagrams, PDF reports)\n- Manage iteration budget across different artifact types\n- Handle execute_code_sandbox failures gracefully\n- Ensure all deliverables are completed before budget exhaustion\n- Create cohesive documentation packages with cross-referenced content\n\n## Iteration Budget Template\n\n**Default Allocation (adjust based on task complexity):**\n\n| Phase | Deliverable | Iterations | Validation |\n|-------|-------------|------------|------------|\n| 1 | Spreadsheet (.xlsx) | 8-10 | File exists, readable, correct structure |\n| 2 | Diagram (.png) | 8-10 | File exists, viewable, correct dimensions |\n| 3 | PDF Report (.pdf) | 8-10 | File exists, downloadable, proper formatting |\n| Buffer | Error recovery | 4-6 | Retry failed phases |\n\n**Total recommended budget: 30-36 iterations**\n\n## Pre-Flight Checks (Iteration 1-2)\n\nBefore generating any deliverables:\n\n1. **Verify workspace path**: Always use `\u002Fworkspace\u002F` as base directory\n2. **Test execute_code_sandbox**: Run a simple print statement to confirm tool works\n3. **Check required libraries**: Plan to install via `!pip install` if needed\n4. **Standardize filenames**: Use consistent naming pattern (e.g., `projectname_deliverable.ext`)\n\n```python\n# Quick sandbox test\nprint(\"SANDBOX_OK\")\nprint(f\"WORKSPACE_PATH:\u002Fworkspace\")\n```\n\nIf this fails, use `run_shell` as fallback for file operations.\n\n## Phase 1: Spreadsheet Creation (Iterations 3-12)\n\n### Step 1.1: Plan Structure\nDefine your spreadsheet structure before coding:\n- Sheet names\n- Column headers\n- Data types\n- Any formulas or formatting\n\n### Step 1.2: Write Generation Code\n\n**Using openpyxl (recommended for .xlsx):**\n\n```python\n# Install if needed\n# !pip install openpyxl\n\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Font, PatternFill, Alignment\n\nwb = Workbook()\nws = wb.active\nws.title = \"Data\"\n\n# Header row with styling\nheaders = [\"Item\", \"Description\", \"Value\", \"Status\"]\nfor col, header in enumerate(headers, 1):\n    cell = ws.cell(row=1, column=col, value=header)\n    cell.font = Font(bold=True)\n    cell.fill = PatternFill(start_color=\"CCCCCC\", end_color=\"CCCCCC\", fill_type=\"solid\")\n    cell.alignment = Alignment(horizontal=\"center\")\n\n# Data rows\ndata = [\n    [\"Item 1\", \"Description 1\", 100, \"Complete\"],\n    [\"Item 2\", \"Description 2\", 200, \"Pending\"],\n]\nfor row_idx, row_data in enumerate(data, 2):\n    for col_idx, value in enumerate(row_data, 1):\n        ws.cell(row=row_idx, column=col_idx, value=value)\n\n# Auto-adjust column widths\nfor column in ws.columns:\n    max_length = 0\n    column_letter = column[0].column_letter\n    for cell in column:\n        try:\n            if len(str(cell.value)) > max_length:\n                max_length = len(str(cell.value))\n        except:\n            pass\n    adjusted_width = min(max_length + 2, 50)\n    ws.column_dimensions[column_letter].width = adjusted_width\n\n# Save with standard path\noutput_path = \"\u002Fworkspace\u002Fhardware_selection_table.xlsx\"\nwb.save(output_path)\nprint(f\"ARTIFACT_PATH:{output_path}\")\nprint(\"SPREADSHEET_GENERATED\")\n```\n\n### Step 1.3: Execute and Validate\n\n```\nexecute_code_sandbox\n  code: \u003Cyour spreadsheet code>\n  language: python\n```\n\n**Validation checklist:**\n- [ ] ARTIFACT_PATH output present\n- [ ] File exists: `run_shell command: ls -lh \u002Fworkspace\u002F*.xlsx`\n- [ ] File size > 1KB\n- [ ] No error messages in output\n\n### Step 1.4: Error Recovery\n\n| Error | Recovery Action |\n|-------|-----------------|\n| Library not found | Add `!pip install openpyxl` at code start |\n| '[ERROR] unknown error' | Retry once, then try simpler code structure |\n| File not created | Check path is `\u002Fworkspace\u002F` not `.\u002F` or `\u002Ftmp\u002F` |\n| Permission denied | Ensure no file lock from previous execution |\n\n**If 2 consecutive failures:** Skip to Phase 2 and return later with reduced scope.\n\n## Phase 2: Diagram Generation (Iterations 13-22)\n\n### Step 2.1: Choose Diagram Type\n\n| Type | Library | Best For |\n|------|---------|----------|\n| Flowchart | `graphviz` or `matplotlib` | Process flows, decision trees |\n| Layout\u002FDiagram | `matplotlib` | Physical layouts, workcell designs |\n| Network\u002FTopology | `networkx` + `matplotlib` | System architecture |\n| Simple shapes | `PIL\u002FPillow` | Basic boxes, arrows, labels |\n\n### Step 2.2: Write Generation Code\n\n**Using matplotlib for layout diagrams:**\n\n```python\n# Install if needed\n# !pip install matplotlib\n\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\n\nfig, ax = plt.subplots(figsize=(12, 8))\nax.set_xlim(0, 100)\nax.set_ylim(0, 80)\nax.set_aspect('equal')\n\n# Add components (example: workcell layout)\ncomponents = [\n    {\"label\": \"Robot\", \"x\": 30, \"y\": 40, \"w\": 20, \"h\": 15, \"color\": \"lightblue\"},\n    {\"label\": \"Conveyor\", \"x\": 60, \"y\": 35, \"w\": 30, \"h\": 10, \"color\": \"lightgreen\"},\n    {\"label\": \"Safety Zone\", \"x\": 10, \"y\": 10, \"w\": 80, \"h\": 60, \"color\": \"none\", \"border\": \"red\"},\n]\n\nfor comp in components:\n    rect = patches.Rectangle(\n        (comp[\"x\"], comp[\"y\"]), \n        comp[\"w\"], \n        comp[\"h\"],\n        linewidth=2, \n        edgecolor=\"black\" if comp.get(\"border\") else \"black\",\n        facecolor=comp[\"color\"] if comp[\"color\"] != \"none\" else \"white\",\n        linestyle=\"--\" if comp.get(\"border\") else \"-\"\n    )\n    ax.add_patch(rect)\n    ax.text(\n        comp[\"x\"] + comp[\"w\"]\u002F2, \n        comp[\"y\"] + comp[\"h\"]\u002F2, \n        comp[\"label\"],\n        ha=\"center\", \n        va=\"center\",\n        fontsize=10,\n        fontweight=\"bold\"\n    )\n\n# Remove axis, add title\nax.axis(\"off\")\nplt.title(\"Workcell Layout Diagram\", fontsize=14, fontweight=\"bold\", pad=20)\nplt.tight_layout()\n\n# Save with standard path\noutput_path = \"\u002Fworkspace\u002Fcnc_workcell_layout.png\"\nplt.savefig(output_path, dpi=150, bbox_inches=\"tight\")\nprint(f\"ARTIFACT_PATH:{output_path}\")\nprint(\"DIAGRAM_GENERATED\")\n```\n\n### Step 2.3: Execute and Validate\n\n```\nexecute_code_sandbox\n  code: \u003Cyour diagram code>\n  language: python\n```\n\n**Validation checklist:**\n- [ ] ARTIFACT_PATH output present\n- [ ] File exists: `run_shell command: ls -lh \u002Fworkspace\u002F*.png`\n- [ ] File size > 5KB (diagrams should be substantial)\n- [ ] No error messages in output\n\n### Step 2.4: Error Recovery\n\n| Error | Recovery Action |\n|-------|-----------------|\n| Backend unknown error | Retry with simplified diagram (fewer elements) |\n| Font rendering issues | Use default matplotlib fonts, avoid custom fonts |\n| Memory issues | Reduce figure size or DPI |\n| Import errors | Add `!pip install matplotlib pillow` at start |\n\n**If 2 consecutive failures:** Create a simpler placeholder diagram and move to Phase 3.\n\n## Phase 3: PDF Report Generation (Iterations 23-32)\n\n### Step 3.1: Gather Content from Previous Phases\n\nBefore generating PDF, collect:\n- Data from spreadsheet (reference key findings)\n- Diagram file path for embedding or referencing\n- Any additional text content or analysis\n\n### Step 3.2: Write Generation Code\n\n**Using reportlab for professional reports:**\n\n```python\n# Install if needed\n# !pip install reportlab\n\nfrom reportlab.lib import colors\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, Image\nfrom reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle\nfrom reportlab.lib.units import inch\n\ndef create_pdf_report(output_path, spreadsheet_path, diagram_path):\n    doc = SimpleDocTemplate(output_path, pagesize=letter)\n    styles = getSampleStyleSheet()\n    story = []\n    \n    # Title\n    title_style = ParagraphStyle('CustomTitle', parent=styles['Heading1'],\n                                  fontSize=18, spaceAfter=30, alignment=1)\n    story.append(Paragraph(\"Project Deliverables Report\", title_style))\n    story.append(Spacer(1, 0.3*inch))\n    \n    # Executive Summary\n    story.append(Paragraph(\"Executive Summary\", styles['Heading2']))\n    story.append(Paragraph(\"This report summarizes the project deliverables including hardware selection, layout design, and implementation recommendations.\", styles['Normal']))\n    story.append(Spacer(1, 0.2*inch))\n    \n    # Spreadsheet Reference Section\n    story.append(Paragraph(\"Hardware Selection Summary\", styles['Heading2']))\n    story.append(Paragraph(f\"See: {spreadsheet_path}\", styles['Normal']))\n    \n    # Sample data table\n    data = [\n        ['Component', 'Selected Option', 'Status'],\n        ['Robot Arm', 'Model X-200', 'Approved'],\n        ['Controller', 'Unity Pro', 'Approved'],\n        ['Safety System', 'Light Curtain', 'Pending']\n    ]\n    \n    table = Table(data, colWidths=[2*inch, 2*inch, 1.5*inch])\n    table.setStyle(TableStyle([\n        ('BACKGROUND', (0, 0), (-1, 0), colors.grey),\n        ('TEXTCOLOR', (0, 0), (-1, 0), colors.whitesmoke),\n        ('ALIGN', (0, 0), (-1, -1), 'CENTER'),\n        ('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),\n        ('GRID', (0, 0), (-1, -1), 1, colors.black)\n    ]))\n    story.append(table)\n    story.append(Spacer(1, 0.3*inch))\n    \n    # Diagram Reference Section\n    story.append(Paragraph(\"Layout Diagram\", styles['Heading2']))\n    story.append(Paragraph(f\"See: {diagram_path}\", styles['Normal']))\n    story.append(Spacer(1, 0.2*inch))\n    \n    # Try to embed diagram if it exists\n    try:\n        img = Image(diagram_path, width=6*inch, height=4*inch)\n        story.append(img)\n        story.append(Spacer(1, 0.2*inch))\n    except:\n        story.append(Paragraph(\"Diagram referenced but not embedded.\", styles['Normal']))\n    \n    # Recommendations\n    story.append(Paragraph(\"Recommendations\", styles['Heading2']))\n    recommendations = [\n        \"Proceed with approved hardware components\",\n        \"Complete safety system evaluation before deployment\",\n        \"Schedule installation during planned maintenance window\"\n    ]\n    for i, rec in enumerate(recommendations, 1):\n        story.append(Paragraph(f\"{i}. {rec}\", styles['Normal']))\n    \n    # Build PDF\n    doc.build(story)\n    print(f\"ARTIFACT_PATH:{output_path}\")\n    print(\"PDF_REPORT_GENERATED\")\n\ncreate_pdf_report(\n    '\u002Fworkspace\u002Fproject_report.pdf',\n    '\u002Fworkspace\u002Fhardware_selection_table.xlsx',\n    '\u002Fworkspace\u002Fcnc_workcell_layout.png'\n)\n```\n\n### Step 3.3: Execute and Validate\n\n```\nexecute_code_sandbox\n  code: \u003Cyour PDF code>\n  language: python\n```\n\n**Validation checklist:**\n- [ ] ARTIFACT_PATH output present\n- [ ] File exists: `run_shell command: ls -lh \u002Fworkspace\u002F*.pdf`\n- [ ] File size > 10KB (reports should have substantial content)\n- [ ] All previous deliverables referenced correctly\n\n### Step 3.4: Error Recovery\n\n| Error | Recovery Action |\n|-------|-----------------|\n| Font errors | Use standard fonts (Helvetica, Arial, Courier) |\n| Image embed fails | Reference diagram path in text instead |\n| Unknown error | Simplify report structure, remove images |\n| Path issues | Hardcode absolute `\u002Fworkspace\u002F` paths |\n\n**If failures persist:** Generate a text-only PDF with basic structure.\n\n## Phase 4: Final Validation (Iterations 33-36)\n\n### Step 4.1: Verify All Deliverables\n\n```\nrun_shell\n  command: ls -lh \u002Fworkspace\u002F*.xlsx \u002Fworkspace\u002F*.png \u002Fworkspace\u002F*.pdf\n```\n\n### Step 4.2: Check File Integrity\n\n```\nrun_shell\n  command: file \u002Fworkspace\u002F*.xlsx \u002Fworkspace\u002F*.png \u002Fworkspace\u002F*.pdf\n```\n\n### Step 4.3: Confirm Download Paths\n\nEnsure each deliverable has `ARTIFACT_PATH:` prefix in execution output for proper download handling.\n\n## Cross-Phase Best Practices\n\n### Path Standardization\n- **Always use**: `\u002Fworkspace\u002Ffilename.ext`\n- **Never use**: `.\u002Ffilename.ext`, `\u002Ftmp\u002Ffilename.ext`, or relative paths\n- **Consistent naming**: `projectname_deliverabletype.ext`\n\n### Iteration Management\n- Track iterations used per phase\n- If Phase 1 uses >12 iterations, reduce Phase 2 and 3 budgets\n- Reserve minimum 4 iterations for error recovery\n- **Hard stop at iteration 28**: Begin PDF generation regardless of previous phase completion status\n\n### Error Handling Strategy\n1. **First failure**: Retry same code once\n2. **Second failure**: Simplify the approach (reduce complexity)\n3. **Third failure**: Create minimal viable deliverable and move on\n4. **Document failures**: Note what failed for post-task review\n\n### Tool Failure Workarounds\n\n| Tool | Primary Use | Fallback |\n|------|-------------|----------|\n| execute_code_sandbox | Run Python code | run_shell with python -c |\n| read_file | Verify file content | run_shell cat\u002Fhead |\n| run_shell | Check file existence | execute_code_sandbox with os.path |\n\n## Quick Start Template\n\n```python\n# Unified deliverable generator - minimal viable version\n# Run in execute_code_sandbox\n\n# ===== SPREADSHEET =====\nfrom openpyxl import Workbook\nwb = Workbook()\nws = wb.active\nws.append([\"Item\", \"Value\", \"Status\"])\nws.append([\"Component A\", 100, \"OK\"])\nwb.save(\"\u002Fworkspace\u002Fdata.xlsx\")\nprint(\"ARTIFACT_PATH:\u002Fworkspace\u002Fdata.xlsx\")\n\n# ===== DIAGRAM =====\nimport matplotlib.pyplot as plt\nfig, ax = plt.subplots(figsize=(8, 6))\nax.text(0.5, 0.5, \"Diagram Placeholder\", ha='center', va='center', fontsize=16)\nax.axis('off')\nplt.savefig(\"\u002Fworkspace\u002Fdiagram.png\", dpi=100)\nprint(\"ARTIFACT_PATH:\u002Fworkspace\u002Fdiagram.png\")\n\n# ===== PDF =====\nfrom reportlab.lib.pagesizes import letter\nfrom reportlab.platypus import SimpleDocTemplate, Paragraph\nfrom reportlab.lib.styles import getSampleStyleSheet\ndoc = SimpleDocTemplate(\"\u002Fworkspace\u002Freport.pdf\", pagesize=letter)\nstyles = getSampleStyleSheet()\nstory = [Paragraph(\"Report\", styles['Heading1']), \n         Paragraph(\"Generated successfully.\", styles['Normal'])]\ndoc.build(story)\nprint(\"ARTIFACT_PATH:\u002Fworkspace\u002Freport.pdf\")\n```\n\n## Related Tools\n\n- `execute_code_sandbox` - Run Python code for all deliverable generation\n- `read_file` - Verify file content (type: xlsx, png, pdf)\n- `run_shell` - Check file existence, size, and integrity\n- `create_file` - For simple text-based deliverables if needed\n\n## Common Pitfalls and Solutions\n\n| Pitfall | Solution |\n|---------|----------|\n| Exhausting budget on Phase 1 | Set hard iteration limit per phase (max 12) |\n| Workspace path confusion | Always use absolute `\u002Fworkspace\u002F` paths |\n| Repeated unknown errors | Simplify code, reduce library dependencies |\n| Missing ARTIFACT_PATH | Always print prefix for each deliverable |\n| PDF created but not downloadable | Verify ARTIFACT_PATH is on its own line |\n| Diagram too complex | Start with basic shapes, add detail only if time permits |\n\n## Success Criteria\n\nA successful execution should produce:\n- [ ] 3 deliverable files in `\u002Fworkspace\u002F`\n- [ ] Each file > minimum size threshold\n- [ ] Each execution outputs `ARTIFACT_PATH:` prefix\n- [ ] Completed before iteration budget exhaustion\n- [ ] No unrecovered tool errors\n",{"name":5,"description":7},"main","6b84b0689ca0d9e7b1e4061188ff6b60758e0f8a","openspace\u002Flegacy\u002Fv1\u002Fgdpval_bench\u002Fskills\u002Fpdf-checklist-workflow-enhanced-780c5d",944,"https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot","https:\u002F\u002Fgithub.com\u002FHKUDS","https:\u002F\u002Fsites.google.com\u002Fview\u002Fchaoh","2026-11-12 22:26:39",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add HKUDS\u002FAgentPilot --skill unified-deliverable-workflow",{"tool":59,"command":60},"bunx","bunx skills add HKUDS\u002FAgentPilot --skill unified-deliverable-workflow",{"tool":62,"command":63},"pnpm","pnpm dlx skills add HKUDS\u002FAgentPilot --skill unified-deliverable-workflow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Flegacy\u002Fv1\u002Fgdpval_bench\u002Fskills\u002Fpdf-checklist-workflow-enhanced-780c5d\u002FSKILL.md",true,[67],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},".skill_id","OTHER","其他",52,"https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Flegacy\u002Fv1\u002Fgdpval_bench\u002Fskills\u002Fpdf-checklist-workflow-enhanced-780c5d\u002F.skill_id",[74,93,112,133,157,180],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":40},"01M6HYB297NDABRERJRVG0K8R0","agentpilot","Set up AgentPilot and use its single entry to prepare missing inputs and run configured RSI experiments. Use when the user requests AgentPilot installation or work with AgentPilot.","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fplugins\u002Fagentpilot\u002Fskills\u002Fagentpilot\u002FSKILL.md",[],[76,81,82,39,83,84,85,86,87,88,89,90,91,92],"prepare","requests","missing","installation","rsi","up","use","user","work","SET","run","experiments",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":40},"01M6HYAYWXTTE1J7DJM0MFNQ4H","remember","Review auto-memory entries and propose promotions to OPENSPACE.md, OPENSPACE.local.md, or retained auto-memory topics; detect duplicates, stale facts, conflicts, and ambiguous entries before making changes.","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Fopenspace\u002Fskills\u002Fremember\u002FSKILL.md",[],[95,100,101,102,103,104,105,106,107,108,109,110,111],"memory","review","auto","openspace","changes","facts","detect","entries","local","conflicts","stale","duplicates",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":119,"publishedAt":40},"01M6HYAVMPM4SBDV60R2B5HPV8","skill-discovery","Search reusable OpenSpace skills locally, and browse cloud packages step by step when a cloud skill may help. Reusing proven skills saves tokens, improves reliability, and extends your capabilities beyond built-in tools.","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Fopenspace\u002Fhost_skills\u002Fskill-discovery\u002FSKILL.md",[118],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[120,121,122,103,123,124,125,126,127,128,129,130,131,132],"skill discovery","discovery","reusable","step by step","tokens","packages","help","cloud","reliability","capabilities","browse","search","Tools",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":140,"publishedAt":40},"01M6HYAR811B3RB0M50RBEDGN6","delegate-task","Delegate tasks to OpenSpace — a full-stack autonomous worker for coding, DevOps, web research, and desktop automation, backed by an extensive MCP tool and skill library. Skills auto-improve through use, reducing token consumption over time. A cloud community lets agents share and collectively evolve reusable skills.","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Fopenspace\u002Fhost_skills\u002Fdelegate-task\u002FSKILL.md",[139],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[141,142,143,103,144,145,146,147,148,122,102,87,149,150,151,152,153,154,155,156],"delegate","task","delegate task","time","improve","desktop automation","worker","community","autonomous","tool","stack","for","share","tasks","automation","MCP",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":40},"01M6HYAM9FSGV6E52AYENDQXYH","write-special-chars-ts-check","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Flegacy\u002Fv1\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[164,165,166,167,168,169,170,171,172,173,174,175,176,177,152,178,179],"write special chars ts check","write","check","type","files","filters","only","template","file","python","typescript","output","Existing","type-checking","errors","script",{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":40},"01M6HYAH05HGV7SVWSVR8PJRQD","write-special-chars-readback","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of \u002Ftmp helper scripts.","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Flegacy\u002Fv1\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[187,188,165,39,152,179,189,190,191,192,193,171,172,194,195,173],"write special chars readback","readback","helper","post","via","scripts","read","verification","cleanup"]