[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6HX2AFS88GSF3ZWY8VB2VFE":3,"skill-same:01M6HX2AFS88GSF3ZWY8VB2VFE":71},{"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":23,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M6HX2AFS88GSF3ZWY8VB2VFE","spreadsheet-validated-exec",null,"Execute Python scripts for spreadsheets with prerequisite data validation and source accessibility checks","HKUDS\u002FAgentPilot","HKUDS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F118165258?v=4","01M6HW8VRNZP64G0P4MVJW2KKQ","✨Data Intelligence Lab@HKU✨","01M6HW8VWZVHBRHYH3T330PFWV",7993,"MIT","https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Fbenchmarks\u002Fgdpval\u002Fskills\u002Fspreadsheet-direct-python-enhanced-enhanced-f0b1db\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000004","电子表格","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37],"spreadsheet","exec","spreadsheet validated exec","python","accessibility","spreadsheets","validation","data","execute","data validation","scripts","with","for","source","2026-11-10 10:12:30",false,"---\nname: spreadsheet-validated-exec\ndescription: Execute Python scripts for spreadsheets with prerequisite data validation and source accessibility checks\n---\n\n# Validated Python Execution for Spreadsheet Tasks\n\n## Overview\n\nThis skill extends direct Python execution for spreadsheet operations by adding a **mandatory data validation phase** before any processing begins. This prevents wasted iterations on inaccessible data sources and provides clear error documentation when data cannot be accessed.\n\n## When to Use This Skill\n\nUse validated direct `run_shell` with Python scripts for spreadsheet operations when:\n\n- Reading or writing complex Excel files with multiple sheets\n- Data sources have already been validated as accessible\n- You have fallback sources identified in case of access failures\n- Applying formulas, formatting, or data transformations\n- Working with `openpyxl`, `pandas`, or similar libraries\n- The operation involves multiple steps that could exceed agent step limits\n- You need precise control over error handling and debugging\n- Complex scripts benefit from file-based execution for better reliability\n\n## Why Validated Direct Execution?\n\nBeyond standard shell_agent limitations, **unvalidated data access** causes:\n\n- Wasted iterations attempting to process non-existent data\n- Unclear error messages when source files are inaccessible\n- No graceful degradation when primary sources fail\n- Missing documentation of why data operations couldn't complete\n\nDirect `run_shell` with Python validation is more reliable because it:\n\n- Executes validation in a single step with no iteration limits\n- Provides clearer, immediate error messages for access failures\n- Handles complex operations without step constraints\n- Gives full control over library imports and execution flow\n- Writing scripts to `.py` files first avoids shell_agent parsing issues with heredocs\n- Documents all access failures for troubleshooting and reporting\n\n## Phase 0: Data Source Validation (REQUIRED)\n\n**Before writing any spreadsheet processing code**, verify your data sources are accessible:\n\n### Step 0.1: Verify Data Availability\n\n```python\nimport os\nimport requests\nfrom pathlib import Path\n\n# For local files\ndef verify_local_file(file_path):\n    path = Path(file_path)\n    if not path.exists():\n        raise FileNotFoundError(f\"Data file not found: {file_path}\")\n    if not path.is_file():\n        raise ValueError(f\"Path is not a file: {file_path}\")\n    if path.stat().st_size == 0:\n        raise ValueError(f\"Data file is empty: {file_path}\")\n    print(f\"✓ Local file verified: {file_path} ({path.stat().st_size} bytes)\")\n    return True\n\n# For remote URLs\ndef verify_remote_url(url, timeout=30):\n    try:\n        # Try HEAD request first (lighter than GET)\n        response = requests.head(url, timeout=timeout, allow_redirects=True)\n        if response.status_code == 405:  # HEAD not allowed, try GET\n            response = requests.get(url, timeout=timeout, stream=True)\n        response.raise_for_status()\n        \n        # Check content type if available\n        content_type = response.headers.get('Content-Type', '')\n        if 'text\u002Fhtml' in content_type and 'excel' not in url.lower():\n            print(f\"⚠ Warning: URL may return HTML, not data file\")\n        \n        print(f\"✓ Remote URL verified: {url} (Status: {response.status_code})\")\n        return True\n    except requests.exceptions.SSLError as e:\n        print(f\"✗ SSL Error: {str(e)}\")\n        return False\n    except requests.exceptions.ConnectionError as e:\n        print(f\"✗ Connection Error: {str(e)}\")\n        return False\n    except requests.exceptions.Timeout as e:\n        print(f\"✗ Timeout Error: {str(e)}\")\n        return False\n    except Exception as e:\n        print(f\"✗ Verification Failed: {str(e)}\")\n        return False\n```\n\n### Step 0.2: Handle Inaccessible Sources\n\n**If primary data source is unavailable:**\n\n1. **Check alternative locations:**\n   - Is data available from a backup URL?\n   - Is there a cached\u002Flocal copy available?\n   - Can data be obtained from an API instead of web scraping?\n   - Is there an alternative data provider?\n\n2. **Document the failure:**\n   ```python\n   def log_access_failure(source, error_type, timestamp=None):\n       from datetime import datetime\n       if not timestamp:\n           timestamp = datetime.now().isoformat()\n       \n       error_log = {\n           'timestamp': timestamp,\n           'source': source,\n           'error_type': error_type,\n           'alternatives_attempted': [],\n           'resolution': 'pending'\n       }\n       \n       # Save to error log file\n       import json\n       with open('data_access_errors.json', 'a') as f:\n           f.write(json.dumps(error_log) + '\\n')\n       \n       return error_log\n   ```\n\n3. **Implement fallback strategy:**\n   ```python\n   def get_data_with_fallback(primary_source, fallback_sources):\n       sources = [primary_source] + fallback_sources\n       \n       for i, source in enumerate(sources):\n           print(f\"Attempting source {i+1}\u002F{len(sources)}: {source}\")\n           \n           if source.startswith('http'):\n               if verify_remote_url(source):\n                   return download_data(source)\n           else:\n               if verify_local_file(source):\n                   return load_local_data(source)\n           \n           print(f\"Source {source} unavailable, trying next...\")\n       \n       raise Exception(f\"All {len(sources)} data sources unavailable\")\n   ```\n\n### Step 0.3: Pre-Execution Checklist\n\nBefore proceeding to spreadsheet operations, confirm:\n\n- [ ] Primary data source is accessible (file exists \u002F URL responds)\n- [ ] Data file is not empty (has content to process)\n- [ ] Required permissions are in place (file not locked, API keys valid)\n- [ ] Alternative sources identified if primary fails\n- [ ] Error logging mechanism is configured\n\n**If any check fails:** Do NOT proceed to spreadsheet processing. Report the blocking issue and either:\n- Resolve the data access problem first\n- Switch to an alternative data source\n- Abort the task with clear error documentation\n\n## How to Use (With Validation)\n\n### Complete Workflow Template\n\n**Recommended Pattern: Validate → Process → Report**\n\n```bash\n# Step 1: Write validation + processing script to file\ncat > validated_spreadsheet_process.py \u003C\u003C 'EOF'\nimport sys\nimport os\nfrom pathlib import Path\nimport pandas as pd\nfrom openpyxl import load_workbook\n\n# === PHASE 0: VALIDATION ===\ndef validate_sources():\n    sources_to_check = [\n        ('input_data.xlsx', 'local'),\n        # ('https:\u002F\u002Fbackup-source.com\u002Fdata.xlsx', 'remote')\n    ]\n    \n    validated_sources = []\n    for source, source_type in sources_to_check:\n        try:\n            if source_type == 'local':\n                if not Path(source).exists():\n                    print(f\"ERROR: Local file not found: {source}\")\n                    continue\n                if Path(source).stat().st_size == 0:\n                    print(f\"ERROR: Local file is empty: {source}\")\n                    continue\n            validated_sources.append(source)\n            print(f\"✓ Validated: {source}\")\n        except Exception as e:\n            print(f\"ERROR validating {source}: {e}\")\n    \n    if not validated_sources:\n        print(\"FATAL: No valid data sources available. Aborting.\")\n        sys.exit(1)\n    \n    return validated_sources\n\n# === PHASE 1: PROCESSING ===\ndef process_data(source_file):\n    # Your spreadsheet operations here\n    pass\n\n# === PHASE 2: REPORTING ===\ndef generate_report(success, details):\n    report = {\n        'status': 'success' if success else 'failed',\n        'details': details\n    }\n    print(f\"Report: {report}\")\n    return report\n\nif __name__ == '__main__':\n    try:\n        # Validate first\n        sources = validate_sources()\n        \n        # Process validated sources\n        for source in sources:\n            process_data(source)\n        \n        generate_report(True, f\"Processed {len(sources)} sources\")\n        \n    except Exception as e:\n        generate_report(False, str(e))\n        sys.exit(1)\nEOF\n\n# Step 2: Execute the validated script\npython3 validated_spreadsheet_process.py\n```\n\n### Pattern 1: Write Script to File First (Complex Operations)\n\nFor complex multi-line scripts with multiple data sources:\n\n```bash\n# Step 1: Write the Python script to a file\ncat > process_spreadsheet.py \u003C\u003C 'EOF'\nimport openpyxl\nfrom openpyxl import Workbook\nfrom pathlib import Path\nimport sys\n\n# Validate first\ninput_file = Path('file.xlsx')\nif not input_file.exists():\n    print(f\"ERROR: Input file not found: {input_file}\")\n    sys.exit(1)\nif input_file.stat().st_size == 0:\n    print(f\"ERROR: Input file is empty: {input_file}\")\n    sys.exit(1)\n\n# Your spreadsheet code here\nwb = openpyxl.load_workbook('file.xlsx')\n# ... operations ...\nwb.save('output.xlsx')\nprint('Success')\nEOF\n\n# Step 2: Execute the script\npython3 process_spreadsheet.py\n```\n\n### Pattern 2: Inline Heredoc (Simple Scripts with Validation)\n\nFor short scripts when NOT using shell_agent, include validation inline:\n\n```bash\n# Include quick validation before processing\npython3 \u003C\u003C 'EOF'\nimport os\nimport sys\n\n# Quick validation\ninput_file = 'data.xlsx'\nif not os.path.exists(input_file):\n    print(f\"ERROR: {input_file} not found\")\n    sys.exit(1)\nif os.path.getsize(input_file) == 0:\n    print(f\"ERROR: {input_file} is empty\")\n    sys.exit(1)\n\n# Continue with processing...\nEOF\n```\n\n## Examples\n\n### Example 1: Validated Read and Transform\n\n**With prerequisite validation:**\n\n```python\nimport pandas as pd\nimport sys\nfrom pathlib import Path\n\n# Validate input file exists and has content\ninput_path = Path('input.xlsx')\nif not input_path.exists():\n    print(f\"ERROR: Input file not found: {input_path}\")\n    sys.exit(1)\nif input_path.stat().st_size == 0:\n    print(f\"ERROR: Input file is empty: {input_path}\")\n    sys.exit(1)\n\n# Now safe to process\ndf = pd.read_excel('input.xlsx', sheet_name='Revenue')\n\n# Apply transformations\ndf['Net_Revenue'] = df['Gross_Revenue'] * (1 - df['Tax_Rate'])\n\n# Save results\ndf.to_excel('output.xlsx', index=False, sheet_name='Processed')\n```\n\n### Example 2: Multi-Sheet with Source Validation\n\n```python\nfrom openpyxl import load_workbook\nimport sys\nfrom pathlib import Path\n\n# Validate workbook accessibility\nwb_path = Path('tour_data.xlsx')\nif not wb_path.exists():\n    print(f\"ERROR: Workbook not found: {wb_path.absolute()}\")\n    sys.exit(1)\n\ntry:\n    wb = load_workbook('tour_data.xlsx')\nexcept Exception as e:\n    print(f\"ERROR: Cannot open workbook: {e}\")\n    print(\"Possible causes: file locked, corrupted, or wrong format\")\n    sys.exit(1)\n\n# Iterate through sheets\nfor sheet_name in wb.sheetnames:\n    ws = wb[sheet_name]\n    # Apply formatting or calculations\n    for row in ws.iter_rows(min_row=2, max_col=5):\n        # Process cells\n        pass\n\nwb.save('tour_data_processed.xlsx')\n```\n\n### Example 3: Formatting with Pre-Checks\n\n```python\nfrom openpyxl import load_workbook\nfrom openpyxl.styles import Font, PatternFill, Alignment\nfrom pathlib import Path\nimport sys\n\n# Pre-check file\nreport_path = Path('report.xlsx')\nif not report_path.exists():\n    print(f\"ERROR: Report file not found: {report_path}\")\n    sys.exit(1)\n\nwb = load_workbook('report.xlsx')\nws = wb.active\n\n# Apply header styling\nheader_fill = PatternFill(start_color='4472C4', fill_type='solid')\nheader_font = Font(bold=True, color='FFFFFF')\n\nfor cell in ws[1]:\n    cell.fill = header_fill\n    cell.font = header_font\n    cell.alignment = Alignment(horizontal='center')\n\nwb.save('report_formatted.xlsx')\n```\n\n### Example 4: Comprehensive Error Handling with Logging\n\n```python\nimport sys\nimport json\nfrom datetime import datetime\nfrom pathlib import Path\nfrom openpyxl import load_workbook\n\ndef log_error(source, error_msg, error_type):\n    \"\"\"Log errors for later analysis and reporting\"\"\"\n    error_record = {\n        'timestamp': datetime.now().isoformat(),\n        'source': source,\n        'error_type': error_type,\n        'message': error_msg\n    }\n    \n    with open('processing_errors.log', 'a') as f:\n        f.write(json.dumps(error_record) + '\\n')\n    \n    return error_record\n\ntry:\n    # Validate file before opening\n    if not Path('data.xlsx').exists():\n        log_error('data.xlsx', 'File not found', 'ValidationError')\n        raise FileNotFoundError('data.xlsx')\n    \n    wb = load_workbook('data.xlsx')\n    ws = wb.active\n    \n    # Your operations here\n    value = ws['A1'].value\n    \n    wb.save('output.xlsx')\n    print(f\"Success: Processed {ws.max_row} rows\")\n    \nexcept FileNotFoundError as e:\n    log_error('data.xlsx', str(e), 'FileNotFoundError')\n    print(f\"ERROR: {str(e)}\", file=sys.stderr)\n    print(\"ACTION: Verify file path and permissions\")\n    sys.exit(1)\nexcept PermissionError as e:\n    log_error('data.xlsx', str(e), 'PermissionError')\n    print(f\"ERROR: Permission denied - file may be open in another application\")\n    print(\"ACTION: Close the file in other applications and retry\")\n    sys.exit(1)\nexcept Exception as e:\n    log_error('data.xlsx', str(e), type(e).__name__)\n    print(f\"ERROR: {str(e)}\", file=sys.stderr)\n    sys.exit(1)\n```\n\n## Best Practices (Enhanced)\n\n1. **Always validate before processing**: Check data source availability before any spreadsheet operations\n2. **Log all access failures**: Document when and why data sources become unavailable\n3. **Identify fallbacks upfront**: Know your alternative sources before starting\n4. **Fail fast on validation errors**: Don't waste iterations on impossible operations\n5. **Prefer file-based execution** for complex scripts: write to `.py` file first, then execute via `run_shell`\n6. **Import only needed libraries** to reduce execution time\n7. **Print clear success\u002Ferror messages** for debugging\n8. **Save intermediate results** for complex multi-step transformations\n9. **Test with small data** before scaling to large spreadsheets\n10. **Use pandas for data manipulation** and openpyxl for formatting when both are needed\n11. **Clean up temporary script files** after execution if they won't be reused\n\n## Data Access Failure Protocols\n\n### When Primary Source Fails\n\n1. **Immediate actions:**\n   - Log the failure with timestamp, source, and error type\n   - Check if error is temporary (timeout) or permanent (404, file doesn't exist)\n   - Attempt alternative sources if available\n\n2. **For temporary failures (timeouts, 5xx errors):**\n   ```python\n   def retry_with_backoff(operation, max_retries=3, base_delay=1):\n       import time\n       for attempt in range(max_retries):\n           try:\n               return operation()\n           except (TimeoutError, ConnectionError) as e:\n               if attempt == max_retries - 1:\n                   raise\n               delay = base_delay * (2 ** attempt)\n               print(f\"Retry {attempt + 1}\u002F{max_retries} after {delay}s delay\")\n               time.sleep(delay)\n   ```\n\n3. **For permanent failures (file not found, 404):**\n   - Switch to identified fallback source immediately\n   - Document the primary source failure\n   - Continue with fallback if available, otherwise abort cleanly\n\n### Error Reporting Template\n\n```python\ndef report_data_access_issue(issue_type, source, details, alternatives_tried=None):\n    \"\"\"Standardize error reporting for data access failures\"\"\"\n    from datetime import datetime\n    \n    report = f\"\"\"\n=== DATA ACCESS FAILURE REPORT ===\nType: {issue_type}\nSource: {source}\nTime: {datetime.now().isoformat()}\nDetails: {details}\nAlternatives Attempted: {alternatives_tried or 'None'}\nRecommended Action: {get_recommended_action(issue_type)}\n==================================\n\"\"\"\n    print(report)\n    return report\n\ndef get_recommended_action(issue_type):\n    actions = {\n        'FileNotFound': 'Verify file path, check if file was moved or deleted',\n        'ConnectionError': 'Check network connectivity, try alternative source',\n        'Timeout': 'Increase timeout, check source server status',\n        'PermissionError': 'Check file permissions, ensure file not open elsewhere',\n        'SSLError': 'Verify SSL certificate, try HTTP if appropriate',\n        'default': 'Review error details, check source availability'\n    }\n    return actions.get(issue_type, actions['default'])\n```\n\n## When NOT to Use This Skill\n\n- Simple single-cell reads\u002Fwrites (validation overhead not warranted)\n- Operations that require interactive user input\n- Tasks where you need the agent to iteratively refine the approach\n- When you have no way to validate data sources (skip to error handling only)\n\n## Common Libraries\n\n| Library | Best For | Also Use For |\n|---------|----------|--------------|\n| `requests` | Web requests | Source URL validation, health checks |\n| `openpyxl` | Reading\u002Fwriting .xlsx files, formatting, formulas | - |\n| `pandas` | Data manipulation, analysis, merging datasets | Chunked reading for large files |\n| `xlrd` | Reading older .xls files (read-only) | - |\n| `xlsxwriter` | Creating new .xlsx files with advanced formatting | - |\n\n## Troubleshooting (Enhanced)\n\n**Issue**: Data source unavailable \u002F file not found\n- **Solution**: Run validation check first before processing. If validation fails:\n  1. Verify the path\u002FURL is correct\n  2. Check if file was moved, renamed, or deleted\n  3. Try alternative sources if available\n  4. Document the failure and abort cleanly rather than proceeding\n\n**Issue**: Source was accessible yesterday but not today\n- **Solution**: Implement fallback sources and log the change. Consider:\n  - Setting up monitoring for critical data sources\n  - Caching important data locally when possible\n  - Having contact information for data source maintainers\n\n**Issue**: Validation passes but processing fails\n- **Solution**: Validation checks accessibility, not content validity. Add:\n  - Schema validation (check expected columns exist)\n  - Content validation (check data types, ranges)\n  - Sample verification (read first few rows to confirm structure)\n\n**Issue**: Heredoc syntax fails with 'unknown error' when using shell_agent\n- **Solution**: Write the Python script to a `.py` file first with full validation logic, then execute with `python3 script.py`. This is significantly more reliable than inline heredoc when shell_agent is the executor.\n\n**Issue**: FileNotFoundError (after validation passed)\n- **Solution**: File may have been moved\u002Fdeleted between validation and processing, or path is relative and working directory changed. Use absolute paths.\n\n**Issue**: PermissionError\n- **Solution**: Ensure the file is not open in another application. On Linux\u002FMac, check with `lsof | grep filename`\n\n**Issue**: ConnectionError \u002F Timeout on remote sources\n- **Solution**: Check network connectivity, try with increased timeout, use retry logic with exponential backoff, or switch to cached\u002Flocal copy if available\n\n**Issue**: SSL Certificate errors\n- **Solution**: Verify the certificate is valid. As last resort for trusted internal sources only: `requests.get(url, verify=False)` - but log this as a security concern\n\n**Issue**: All alternative sources fail\n- **Solution**: Abort with comprehensive error report documenting:\n  - All sources attempted\n  - Error types for each\n  - Timestamp of failures\n  - Recommended next steps for human operator\n\n**Issue**: MemoryError on large files\n- **Solution**: Process data in chunks using pandas `chunksize` parameter. Validate chunk size during initial validation phase.\n\n**Issue**: Formatting not applying\n- **Solution**: Ensure you're modifying cell styles before saving, and use `.copy()` for style objects. Verify workbook is not in read-only mode.\n","# Validated Python Execution for Spreadsheet Tasks\n\n## Overview\n\nThis skill extends direct Python execution for spreadsheet operations by adding a **mandatory data validation phase** before any processing begins. This prevents wasted iterations on inaccessible data sources and provides clear error documentation when data cannot be accessed.\n\n## When to Use This Skill\n\nUse validated direct `run_shell` with Python scripts for spreadsheet operations when:\n\n- Reading or writing complex Excel files with multiple sheets\n- Data sources have already been validated as accessible\n- You have fallback sources identified in case of access failures\n- Applying formulas, formatting, or data transformations\n- Working with `openpyxl`, `pandas`, or similar libraries\n- The operation involves multiple steps that could exceed agent step limits\n- You need precise control over error handling and debugging\n- Complex scripts benefit from file-based execution for better reliability\n\n## Why Validated Direct Execution?\n\nBeyond standard shell_agent limitations, **unvalidated data access** causes:\n\n- Wasted iterations attempting to process non-existent data\n- Unclear error messages when source files are inaccessible\n- No graceful degradation when primary sources fail\n- Missing documentation of why data operations couldn't complete\n\nDirect `run_shell` with Python validation is more reliable because it:\n\n- Executes validation in a single step with no iteration limits\n- Provides clearer, immediate error messages for access failures\n- Handles complex operations without step constraints\n- Gives full control over library imports and execution flow\n- Writing scripts to `.py` files first avoids shell_agent parsing issues with heredocs\n- Documents all access failures for troubleshooting and reporting\n\n## Phase 0: Data Source Validation (REQUIRED)\n\n**Before writing any spreadsheet processing code**, verify your data sources are accessible:\n\n### Step 0.1: Verify Data Availability\n\n```python\nimport os\nimport requests\nfrom pathlib import Path\n\n# For local files\ndef verify_local_file(file_path):\n    path = Path(file_path)\n    if not path.exists():\n        raise FileNotFoundError(f\"Data file not found: {file_path}\")\n    if not path.is_file():\n        raise ValueError(f\"Path is not a file: {file_path}\")\n    if path.stat().st_size == 0:\n        raise ValueError(f\"Data file is empty: {file_path}\")\n    print(f\"✓ Local file verified: {file_path} ({path.stat().st_size} bytes)\")\n    return True\n\n# For remote URLs\ndef verify_remote_url(url, timeout=30):\n    try:\n        # Try HEAD request first (lighter than GET)\n        response = requests.head(url, timeout=timeout, allow_redirects=True)\n        if response.status_code == 405:  # HEAD not allowed, try GET\n            response = requests.get(url, timeout=timeout, stream=True)\n        response.raise_for_status()\n        \n        # Check content type if available\n        content_type = response.headers.get('Content-Type', '')\n        if 'text\u002Fhtml' in content_type and 'excel' not in url.lower():\n            print(f\"⚠ Warning: URL may return HTML, not data file\")\n        \n        print(f\"✓ Remote URL verified: {url} (Status: {response.status_code})\")\n        return True\n    except requests.exceptions.SSLError as e:\n        print(f\"✗ SSL Error: {str(e)}\")\n        return False\n    except requests.exceptions.ConnectionError as e:\n        print(f\"✗ Connection Error: {str(e)}\")\n        return False\n    except requests.exceptions.Timeout as e:\n        print(f\"✗ Timeout Error: {str(e)}\")\n        return False\n    except Exception as e:\n        print(f\"✗ Verification Failed: {str(e)}\")\n        return False\n```\n\n### Step 0.2: Handle Inaccessible Sources\n\n**If primary data source is unavailable:**\n\n1. **Check alternative locations:**\n   - Is data available from a backup URL?\n   - Is there a cached\u002Flocal copy available?\n   - Can data be obtained from an API instead of web scraping?\n   - Is there an alternative data provider?\n\n2. **Document the failure:**\n   ```python\n   def log_access_failure(source, error_type, timestamp=None):\n       from datetime import datetime\n       if not timestamp:\n           timestamp = datetime.now().isoformat()\n       \n       error_log = {\n           'timestamp': timestamp,\n           'source': source,\n           'error_type': error_type,\n           'alternatives_attempted': [],\n           'resolution': 'pending'\n       }\n       \n       # Save to error log file\n       import json\n       with open('data_access_errors.json', 'a') as f:\n           f.write(json.dumps(error_log) + '\\n')\n       \n       return error_log\n   ```\n\n3. **Implement fallback strategy:**\n   ```python\n   def get_data_with_fallback(primary_source, fallback_sources):\n       sources = [primary_source] + fallback_sources\n       \n       for i, source in enumerate(sources):\n           print(f\"Attempting source {i+1}\u002F{len(sources)}: {source}\")\n           \n           if source.startswith('http'):\n               if verify_remote_url(source):\n                   return download_data(source)\n           else:\n               if verify_local_file(source):\n                   return load_local_data(source)\n           \n           print(f\"Source {source} unavailable, trying next...\")\n       \n       raise Exception(f\"All {len(sources)} data sources unavailable\")\n   ```\n\n### Step 0.3: Pre-Execution Checklist\n\nBefore proceeding to spreadsheet operations, confirm:\n\n- [ ] Primary data source is accessible (file exists \u002F URL responds)\n- [ ] Data file is not empty (has content to process)\n- [ ] Required permissions are in place (file not locked, API keys valid)\n- [ ] Alternative sources identified if primary fails\n- [ ] Error logging mechanism is configured\n\n**If any check fails:** Do NOT proceed to spreadsheet processing. Report the blocking issue and either:\n- Resolve the data access problem first\n- Switch to an alternative data source\n- Abort the task with clear error documentation\n\n## How to Use (With Validation)\n\n### Complete Workflow Template\n\n**Recommended Pattern: Validate → Process → Report**\n\n```bash\n# Step 1: Write validation + processing script to file\ncat > validated_spreadsheet_process.py \u003C\u003C 'EOF'\nimport sys\nimport os\nfrom pathlib import Path\nimport pandas as pd\nfrom openpyxl import load_workbook\n\n# === PHASE 0: VALIDATION ===\ndef validate_sources():\n    sources_to_check = [\n        ('input_data.xlsx', 'local'),\n        # ('https:\u002F\u002Fbackup-source.com\u002Fdata.xlsx', 'remote')\n    ]\n    \n    validated_sources = []\n    for source, source_type in sources_to_check:\n        try:\n            if source_type == 'local':\n                if not Path(source).exists():\n                    print(f\"ERROR: Local file not found: {source}\")\n                    continue\n                if Path(source).stat().st_size == 0:\n                    print(f\"ERROR: Local file is empty: {source}\")\n                    continue\n            validated_sources.append(source)\n            print(f\"✓ Validated: {source}\")\n        except Exception as e:\n            print(f\"ERROR validating {source}: {e}\")\n    \n    if not validated_sources:\n        print(\"FATAL: No valid data sources available. Aborting.\")\n        sys.exit(1)\n    \n    return validated_sources\n\n# === PHASE 1: PROCESSING ===\ndef process_data(source_file):\n    # Your spreadsheet operations here\n    pass\n\n# === PHASE 2: REPORTING ===\ndef generate_report(success, details):\n    report = {\n        'status': 'success' if success else 'failed',\n        'details': details\n    }\n    print(f\"Report: {report}\")\n    return report\n\nif __name__ == '__main__':\n    try:\n        # Validate first\n        sources = validate_sources()\n        \n        # Process validated sources\n        for source in sources:\n            process_data(source)\n        \n        generate_report(True, f\"Processed {len(sources)} sources\")\n        \n    except Exception as e:\n        generate_report(False, str(e))\n        sys.exit(1)\nEOF\n\n# Step 2: Execute the validated script\npython3 validated_spreadsheet_process.py\n```\n\n### Pattern 1: Write Script to File First (Complex Operations)\n\nFor complex multi-line scripts with multiple data sources:\n\n```bash\n# Step 1: Write the Python script to a file\ncat > process_spreadsheet.py \u003C\u003C 'EOF'\nimport openpyxl\nfrom openpyxl import Workbook\nfrom pathlib import Path\nimport sys\n\n# Validate first\ninput_file = Path('file.xlsx')\nif not input_file.exists():\n    print(f\"ERROR: Input file not found: {input_file}\")\n    sys.exit(1)\nif input_file.stat().st_size == 0:\n    print(f\"ERROR: Input file is empty: {input_file}\")\n    sys.exit(1)\n\n# Your spreadsheet code here\nwb = openpyxl.load_workbook('file.xlsx')\n# ... operations ...\nwb.save('output.xlsx')\nprint('Success')\nEOF\n\n# Step 2: Execute the script\npython3 process_spreadsheet.py\n```\n\n### Pattern 2: Inline Heredoc (Simple Scripts with Validation)\n\nFor short scripts when NOT using shell_agent, include validation inline:\n\n```bash\n# Include quick validation before processing\npython3 \u003C\u003C 'EOF'\nimport os\nimport sys\n\n# Quick validation\ninput_file = 'data.xlsx'\nif not os.path.exists(input_file):\n    print(f\"ERROR: {input_file} not found\")\n    sys.exit(1)\nif os.path.getsize(input_file) == 0:\n    print(f\"ERROR: {input_file} is empty\")\n    sys.exit(1)\n\n# Continue with processing...\nEOF\n```\n\n## Examples\n\n### Example 1: Validated Read and Transform\n\n**With prerequisite validation:**\n\n```python\nimport pandas as pd\nimport sys\nfrom pathlib import Path\n\n# Validate input file exists and has content\ninput_path = Path('input.xlsx')\nif not input_path.exists():\n    print(f\"ERROR: Input file not found: {input_path}\")\n    sys.exit(1)\nif input_path.stat().st_size == 0:\n    print(f\"ERROR: Input file is empty: {input_path}\")\n    sys.exit(1)\n\n# Now safe to process\ndf = pd.read_excel('input.xlsx', sheet_name='Revenue')\n\n# Apply transformations\ndf['Net_Revenue'] = df['Gross_Revenue'] * (1 - df['Tax_Rate'])\n\n# Save results\ndf.to_excel('output.xlsx', index=False, sheet_name='Processed')\n```\n\n### Example 2: Multi-Sheet with Source Validation\n\n```python\nfrom openpyxl import load_workbook\nimport sys\nfrom pathlib import Path\n\n# Validate workbook accessibility\nwb_path = Path('tour_data.xlsx')\nif not wb_path.exists():\n    print(f\"ERROR: Workbook not found: {wb_path.absolute()}\")\n    sys.exit(1)\n\ntry:\n    wb = load_workbook('tour_data.xlsx')\nexcept Exception as e:\n    print(f\"ERROR: Cannot open workbook: {e}\")\n    print(\"Possible causes: file locked, corrupted, or wrong format\")\n    sys.exit(1)\n\n# Iterate through sheets\nfor sheet_name in wb.sheetnames:\n    ws = wb[sheet_name]\n    # Apply formatting or calculations\n    for row in ws.iter_rows(min_row=2, max_col=5):\n        # Process cells\n        pass\n\nwb.save('tour_data_processed.xlsx')\n```\n\n### Example 3: Formatting with Pre-Checks\n\n```python\nfrom openpyxl import load_workbook\nfrom openpyxl.styles import Font, PatternFill, Alignment\nfrom pathlib import Path\nimport sys\n\n# Pre-check file\nreport_path = Path('report.xlsx')\nif not report_path.exists():\n    print(f\"ERROR: Report file not found: {report_path}\")\n    sys.exit(1)\n\nwb = load_workbook('report.xlsx')\nws = wb.active\n\n# Apply header styling\nheader_fill = PatternFill(start_color='4472C4', fill_type='solid')\nheader_font = Font(bold=True, color='FFFFFF')\n\nfor cell in ws[1]:\n    cell.fill = header_fill\n    cell.font = header_font\n    cell.alignment = Alignment(horizontal='center')\n\nwb.save('report_formatted.xlsx')\n```\n\n### Example 4: Comprehensive Error Handling with Logging\n\n```python\nimport sys\nimport json\nfrom datetime import datetime\nfrom pathlib import Path\nfrom openpyxl import load_workbook\n\ndef log_error(source, error_msg, error_type):\n    \"\"\"Log errors for later analysis and reporting\"\"\"\n    error_record = {\n        'timestamp': datetime.now().isoformat(),\n        'source': source,\n        'error_type': error_type,\n        'message': error_msg\n    }\n    \n    with open('processing_errors.log', 'a') as f:\n        f.write(json.dumps(error_record) + '\\n')\n    \n    return error_record\n\ntry:\n    # Validate file before opening\n    if not Path('data.xlsx').exists():\n        log_error('data.xlsx', 'File not found', 'ValidationError')\n        raise FileNotFoundError('data.xlsx')\n    \n    wb = load_workbook('data.xlsx')\n    ws = wb.active\n    \n    # Your operations here\n    value = ws['A1'].value\n    \n    wb.save('output.xlsx')\n    print(f\"Success: Processed {ws.max_row} rows\")\n    \nexcept FileNotFoundError as e:\n    log_error('data.xlsx', str(e), 'FileNotFoundError')\n    print(f\"ERROR: {str(e)}\", file=sys.stderr)\n    print(\"ACTION: Verify file path and permissions\")\n    sys.exit(1)\nexcept PermissionError as e:\n    log_error('data.xlsx', str(e), 'PermissionError')\n    print(f\"ERROR: Permission denied - file may be open in another application\")\n    print(\"ACTION: Close the file in other applications and retry\")\n    sys.exit(1)\nexcept Exception as e:\n    log_error('data.xlsx', str(e), type(e).__name__)\n    print(f\"ERROR: {str(e)}\", file=sys.stderr)\n    sys.exit(1)\n```\n\n## Best Practices (Enhanced)\n\n1. **Always validate before processing**: Check data source availability before any spreadsheet operations\n2. **Log all access failures**: Document when and why data sources become unavailable\n3. **Identify fallbacks upfront**: Know your alternative sources before starting\n4. **Fail fast on validation errors**: Don't waste iterations on impossible operations\n5. **Prefer file-based execution** for complex scripts: write to `.py` file first, then execute via `run_shell`\n6. **Import only needed libraries** to reduce execution time\n7. **Print clear success\u002Ferror messages** for debugging\n8. **Save intermediate results** for complex multi-step transformations\n9. **Test with small data** before scaling to large spreadsheets\n10. **Use pandas for data manipulation** and openpyxl for formatting when both are needed\n11. **Clean up temporary script files** after execution if they won't be reused\n\n## Data Access Failure Protocols\n\n### When Primary Source Fails\n\n1. **Immediate actions:**\n   - Log the failure with timestamp, source, and error type\n   - Check if error is temporary (timeout) or permanent (404, file doesn't exist)\n   - Attempt alternative sources if available\n\n2. **For temporary failures (timeouts, 5xx errors):**\n   ```python\n   def retry_with_backoff(operation, max_retries=3, base_delay=1):\n       import time\n       for attempt in range(max_retries):\n           try:\n               return operation()\n           except (TimeoutError, ConnectionError) as e:\n               if attempt == max_retries - 1:\n                   raise\n               delay = base_delay * (2 ** attempt)\n               print(f\"Retry {attempt + 1}\u002F{max_retries} after {delay}s delay\")\n               time.sleep(delay)\n   ```\n\n3. **For permanent failures (file not found, 404):**\n   - Switch to identified fallback source immediately\n   - Document the primary source failure\n   - Continue with fallback if available, otherwise abort cleanly\n\n### Error Reporting Template\n\n```python\ndef report_data_access_issue(issue_type, source, details, alternatives_tried=None):\n    \"\"\"Standardize error reporting for data access failures\"\"\"\n    from datetime import datetime\n    \n    report = f\"\"\"\n=== DATA ACCESS FAILURE REPORT ===\nType: {issue_type}\nSource: {source}\nTime: {datetime.now().isoformat()}\nDetails: {details}\nAlternatives Attempted: {alternatives_tried or 'None'}\nRecommended Action: {get_recommended_action(issue_type)}\n==================================\n\"\"\"\n    print(report)\n    return report\n\ndef get_recommended_action(issue_type):\n    actions = {\n        'FileNotFound': 'Verify file path, check if file was moved or deleted',\n        'ConnectionError': 'Check network connectivity, try alternative source',\n        'Timeout': 'Increase timeout, check source server status',\n        'PermissionError': 'Check file permissions, ensure file not open elsewhere',\n        'SSLError': 'Verify SSL certificate, try HTTP if appropriate',\n        'default': 'Review error details, check source availability'\n    }\n    return actions.get(issue_type, actions['default'])\n```\n\n## When NOT to Use This Skill\n\n- Simple single-cell reads\u002Fwrites (validation overhead not warranted)\n- Operations that require interactive user input\n- Tasks where you need the agent to iteratively refine the approach\n- When you have no way to validate data sources (skip to error handling only)\n\n## Common Libraries\n\n| Library | Best For | Also Use For |\n|---------|----------|--------------|\n| `requests` | Web requests | Source URL validation, health checks |\n| `openpyxl` | Reading\u002Fwriting .xlsx files, formatting, formulas | - |\n| `pandas` | Data manipulation, analysis, merging datasets | Chunked reading for large files |\n| `xlrd` | Reading older .xls files (read-only) | - |\n| `xlsxwriter` | Creating new .xlsx files with advanced formatting | - |\n\n## Troubleshooting (Enhanced)\n\n**Issue**: Data source unavailable \u002F file not found\n- **Solution**: Run validation check first before processing. If validation fails:\n  1. Verify the path\u002FURL is correct\n  2. Check if file was moved, renamed, or deleted\n  3. Try alternative sources if available\n  4. Document the failure and abort cleanly rather than proceeding\n\n**Issue**: Source was accessible yesterday but not today\n- **Solution**: Implement fallback sources and log the change. Consider:\n  - Setting up monitoring for critical data sources\n  - Caching important data locally when possible\n  - Having contact information for data source maintainers\n\n**Issue**: Validation passes but processing fails\n- **Solution**: Validation checks accessibility, not content validity. Add:\n  - Schema validation (check expected columns exist)\n  - Content validation (check data types, ranges)\n  - Sample verification (read first few rows to confirm structure)\n\n**Issue**: Heredoc syntax fails with 'unknown error' when using shell_agent\n- **Solution**: Write the Python script to a `.py` file first with full validation logic, then execute with `python3 script.py`. This is significantly more reliable than inline heredoc when shell_agent is the executor.\n\n**Issue**: FileNotFoundError (after validation passed)\n- **Solution**: File may have been moved\u002Fdeleted between validation and processing, or path is relative and working directory changed. Use absolute paths.\n\n**Issue**: PermissionError\n- **Solution**: Ensure the file is not open in another application. On Linux\u002FMac, check with `lsof | grep filename`\n\n**Issue**: ConnectionError \u002F Timeout on remote sources\n- **Solution**: Check network connectivity, try with increased timeout, use retry logic with exponential backoff, or switch to cached\u002Flocal copy if available\n\n**Issue**: SSL Certificate errors\n- **Solution**: Verify the certificate is valid. As last resort for trusted internal sources only: `requests.get(url, verify=False)` - but log this as a security concern\n\n**Issue**: All alternative sources fail\n- **Solution**: Abort with comprehensive error report documenting:\n  - All sources attempted\n  - Error types for each\n  - Timestamp of failures\n  - Recommended next steps for human operator\n\n**Issue**: MemoryError on large files\n- **Solution**: Process data in chunks using pandas `chunksize` parameter. Validate chunk size during initial validation phase.\n\n**Issue**: Formatting not applying\n- **Solution**: Ensure you're modifying cell styles before saving, and use `.copy()` for style objects. Verify workbook is not in read-only mode.\n",{"name":5,"description":7},"main","6b84b0689ca0d9e7b1e4061188ff6b60758e0f8a","openspace\u002Fbenchmarks\u002Fgdpval\u002Fskills\u002Fspreadsheet-direct-python-enhanced-enhanced-f0b1db",940,"https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot","https:\u002F\u002Fgithub.com\u002FHKUDS","https:\u002F\u002Fsites.google.com\u002Fview\u002Fchaoh","2026-11-06 23:04:01",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add HKUDS\u002FAgentPilot --skill spreadsheet-validated-exec",{"tool":57,"command":58},"bunx","bunx skills add HKUDS\u002FAgentPilot --skill spreadsheet-validated-exec",{"tool":60,"command":61},"pnpm","pnpm dlx skills add HKUDS\u002FAgentPilot --skill spreadsheet-validated-exec","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Fbenchmarks\u002Fgdpval\u002Fskills\u002Fspreadsheet-direct-python-enhanced-enhanced-f0b1db\u002FSKILL.md",true,[65],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},".skill_id","OTHER","其他",64,"https:\u002F\u002Fgithub.com\u002FHKUDS\u002FAgentPilot\u002Fblob\u002Fmain\u002Fopenspace\u002Fbenchmarks\u002Fgdpval\u002Fskills\u002Fspreadsheet-direct-python-enhanced-enhanced-f0b1db\u002F.skill_id",[72,91,110,133,156,178],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":38},"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",[],[74,79,80,35,81,82,83,84,85,86,87,88,89,90],"prepare","requests","missing","installation","rsi","up","use","user","work","SET","run","experiments",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":38},"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",[],[93,98,99,100,101,102,103,104,105,106,107,108,109],"memory","review","auto","openspace","changes","facts","detect","entries","local","conflicts","stale","duplicates",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":119,"publishedAt":38},"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",[116],{"categoryNo":117,"categoryName":118,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[120,121,122,101,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":38},"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":117,"categoryName":118,"taxonomyType":21,"taxonomyTypeDesc":22},[141,142,143,101,144,145,146,147,148,122,100,85,149,150,151,36,152,153,154,155],"delegate","task","delegate task","time","improve","desktop automation","worker","community","autonomous","tool","stack","share","tasks","automation","MCP",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":38},"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",[],[163,164,165,166,167,168,169,170,171,27,172,173,174,175,36,176,177],"write special chars ts check","write","check","type","files","filters","only","template","file","typescript","output","Existing","type-checking","errors","script",{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":184,"publishedAt":38},"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",[],[185,186,164,35,36,177,187,188,189,34,190,170,171,191,192,27],"write special chars readback","readback","helper","post","via","read","verification","cleanup"]