[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJ3TX3819Z18RRBAZJG3JE":3,"skill-same:01M6KJ3TX3819Z18RRBAZJG3JE":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":27,"linkOnly":28,"markdownContent":29,"markdownBody":30,"frontMatter":31,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":13,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M6KJ3TX3819Z18RRBAZJG3JE","excel-debug-extraction",null,"Iteratively debug Excel structure with exploratory scripts before writing extraction logic","AG064\u002FOpenSpace","AG064","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184930299?v=4","01M6KHVFG7TB73NHX3RDYSTMH2","01M6KHVFMM7XA2PZA9Z83PHS3V",0,"MIT","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fexcel-debug-extraction\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26],"xlsx","debug","extraction","excel debug extraction","writing","structure","logic","scripts","with","2026-11-10 10:12:30",false,"---\nname: excel-debug-extraction\ndescription: Iteratively debug Excel structure with exploratory scripts before writing extraction logic\n---\n\n# Excel Debug-First Extraction Workflow\n\nWhen working with poorly-structured, complex, or unfamiliar Excel files, use this iterative debugging approach to map the data layout before writing your final extraction logic.\n\n## When to Use This Skill\n\n- Excel files with inconsistent formatting or merged cells\n- Files received from external sources with unknown structure\n- Complex workbooks with multiple sheets and interdependencies\n- When initial parsing attempts fail or produce unexpected results\n\n## Workflow Steps\n\n### Step 1: Initial Structure Reconnaissance\n\nBefore writing extraction logic, create a debug script to explore the file structure:\n\n```python\n# debug_structure.py\nfrom openpyxl import load_workbook\n\nwb = load_workbook('file.xlsx')\nprint(f\"Sheets: {wb.sheetnames}\")\n\nfor sheet_name in wb.sheetnames:\n    ws = wb[sheet_name]\n    print(f\"\\n=== Sheet: {sheet_name} ===\")\n    print(f\"Dimensions: {ws.dimensions}\")\n    \n    # Print first 10 rows to understand header structure\n    for row in ws.iter_rows(min_row=1, max_row=10, values_only=True):\n        print([str(cell)[:50] for cell in row])\n```\n\n### Step 2: Map Column Positions\n\nIdentify where key data fields are located:\n\n```python\n# debug_columns.py\nfrom openpyxl import load_workbook\n\nwb = load_workbook('file.xlsx')\nws = wb['Sheet1']\n\n# Examine header row to find column indices\nheader_row = 1\ncolumn_map = {}\n\nfor col in ws.iter_cols(min_row=header_row, max_row=header_row):\n    for cell in col:\n        if cell.value:\n            column_map[str(cell.value)] = cell.column_letter\n\nprint(\"Column mapping:\", column_map)\n\n# Sample data rows to verify structure\nfor row_num in range(2, min(6, ws.max_row + 1)):\n    row_data = [ws.cell(row=row_num, column=col).value \n                for col in range(1, ws.max_column + 1)]\n    print(f\"Row {row_num}: {row_data}\")\n```\n\n### Step 3: Identify Row Patterns\n\nUnderstand how data rows are structured (e.g., summary rows, detail rows, blank separators):\n\n```python\n# debug_rows.py\nfrom openpyxl import load_workbook\n\nwb = load_workbook('file.xlsx')\nws = wb['Sheet1']\n\nrow_types = []\nfor row_num in range(1, min(30, ws.max_row + 1)):\n    row_values = [ws.cell(row=row_num, column=col).value \n                  for col in range(1, ws.max_column + 1)]\n    \n    non_empty = sum(1 for v in row_values if v is not None and str(v).strip())\n    \n    # Classify row type\n    if non_empty == 0:\n        row_type = \"blank\"\n    elif non_empty == 1:\n        row_type = \"summary\u002Flabel\"\n    elif non_empty == ws.max_column:\n        row_type = \"full_data\"\n    else:\n        row_type = \"partial\"\n    \n    row_types.append((row_num, row_type, row_values[:5]))\n\nfor rt in row_types:\n    print(f\"Row {rt[0]} ({rt[1]}): {rt[2]}\")\n```\n\n### Step 4: Document Findings\n\nBefore writing extraction logic, summarize:\n- Sheet names and their purposes\n- Header row location and column mappings\n- Data row patterns (which rows contain actual data vs. headers\u002Fsummaries)\n- Any special formatting (merged cells, blank separators, grouping rows)\n\n### Step 5: Write Extraction Logic\n\nIncorporate findings into your final processing script:\n\n```python\n# extract_data.py\nfrom openpyxl import load_workbook\nimport pandas as pd\n\nwb = load_workbook('file.xlsx')\nws = wb['Sheet1']\n\n# Use column mappings from debug phase\nSTORE_COL = 'B'  # Column 2\nWEEK1_COL = 'D'  # Column 4\nWEEK2_COL = 'E'  # Column 5\n\n# Skip header rows and summary rows based on debug findings\ndata_rows = []\nfor row_num in range(5, ws.max_row + 1):  # Start after header based on debug\n    # Skip summary\u002Fblank rows\n    if ws.cell(row=row_num, column=2).value is None:\n        continue\n    if 'TOTAL' in str(ws.cell(row=row_num, column=2).value).upper():\n        continue\n    \n    row_data = {\n        'store': ws.cell(row=row_num, column=2).value,\n        'week1': ws.cell(row=row_num, column=4).value,\n        'week2': ws.cell(row=row_num, column=5).value,\n    }\n    data_rows.append(row_data)\n\ndf = pd.DataFrame(data_rows)\nprint(df.head())\n```\n\n## Best Practices\n\n1. **Always start with exploration** - Never assume Excel structure matches expectations\n2. **Save debug scripts** - Keep them in your project for future reference and debugging\n3. **Print generously** - Use verbose output during exploration to catch edge cases\n4. **Verify row-by-row** - Don't assume all data rows follow the same pattern\n5. **Handle merged cells** - Check for merged cells that span multiple rows\u002Fcolumns\n\n## Common Pitfalls to Avoid\n\n- Assuming header is always row 1\n- Assuming all rows between first and last contain data\n- Not checking for hidden sheets or protected ranges\n- Ignoring cell formatting that indicates row type (bold, indentation)\n- Not handling None values or empty strings consistently\n\n## File Naming Convention\n\nUse descriptive names for debug scripts:\n- `debug_structure.py` - Overall file\u002Fsheet structure\n- `debug_columns.py` - Column positions and headers\n- `debug_rows.py` - Row patterns and data boundaries\n- `debug_values.py` - Value patterns and edge cases\n\nKeep debug scripts alongside your extraction script for maintainability.","# Excel Debug-First Extraction Workflow\n\nWhen working with poorly-structured, complex, or unfamiliar Excel files, use this iterative debugging approach to map the data layout before writing your final extraction logic.\n\n## When to Use This Skill\n\n- Excel files with inconsistent formatting or merged cells\n- Files received from external sources with unknown structure\n- Complex workbooks with multiple sheets and interdependencies\n- When initial parsing attempts fail or produce unexpected results\n\n## Workflow Steps\n\n### Step 1: Initial Structure Reconnaissance\n\nBefore writing extraction logic, create a debug script to explore the file structure:\n\n```python\n# debug_structure.py\nfrom openpyxl import load_workbook\n\nwb = load_workbook('file.xlsx')\nprint(f\"Sheets: {wb.sheetnames}\")\n\nfor sheet_name in wb.sheetnames:\n    ws = wb[sheet_name]\n    print(f\"\\n=== Sheet: {sheet_name} ===\")\n    print(f\"Dimensions: {ws.dimensions}\")\n    \n    # Print first 10 rows to understand header structure\n    for row in ws.iter_rows(min_row=1, max_row=10, values_only=True):\n        print([str(cell)[:50] for cell in row])\n```\n\n### Step 2: Map Column Positions\n\nIdentify where key data fields are located:\n\n```python\n# debug_columns.py\nfrom openpyxl import load_workbook\n\nwb = load_workbook('file.xlsx')\nws = wb['Sheet1']\n\n# Examine header row to find column indices\nheader_row = 1\ncolumn_map = {}\n\nfor col in ws.iter_cols(min_row=header_row, max_row=header_row):\n    for cell in col:\n        if cell.value:\n            column_map[str(cell.value)] = cell.column_letter\n\nprint(\"Column mapping:\", column_map)\n\n# Sample data rows to verify structure\nfor row_num in range(2, min(6, ws.max_row + 1)):\n    row_data = [ws.cell(row=row_num, column=col).value \n                for col in range(1, ws.max_column + 1)]\n    print(f\"Row {row_num}: {row_data}\")\n```\n\n### Step 3: Identify Row Patterns\n\nUnderstand how data rows are structured (e.g., summary rows, detail rows, blank separators):\n\n```python\n# debug_rows.py\nfrom openpyxl import load_workbook\n\nwb = load_workbook('file.xlsx')\nws = wb['Sheet1']\n\nrow_types = []\nfor row_num in range(1, min(30, ws.max_row + 1)):\n    row_values = [ws.cell(row=row_num, column=col).value \n                  for col in range(1, ws.max_column + 1)]\n    \n    non_empty = sum(1 for v in row_values if v is not None and str(v).strip())\n    \n    # Classify row type\n    if non_empty == 0:\n        row_type = \"blank\"\n    elif non_empty == 1:\n        row_type = \"summary\u002Flabel\"\n    elif non_empty == ws.max_column:\n        row_type = \"full_data\"\n    else:\n        row_type = \"partial\"\n    \n    row_types.append((row_num, row_type, row_values[:5]))\n\nfor rt in row_types:\n    print(f\"Row {rt[0]} ({rt[1]}): {rt[2]}\")\n```\n\n### Step 4: Document Findings\n\nBefore writing extraction logic, summarize:\n- Sheet names and their purposes\n- Header row location and column mappings\n- Data row patterns (which rows contain actual data vs. headers\u002Fsummaries)\n- Any special formatting (merged cells, blank separators, grouping rows)\n\n### Step 5: Write Extraction Logic\n\nIncorporate findings into your final processing script:\n\n```python\n# extract_data.py\nfrom openpyxl import load_workbook\nimport pandas as pd\n\nwb = load_workbook('file.xlsx')\nws = wb['Sheet1']\n\n# Use column mappings from debug phase\nSTORE_COL = 'B'  # Column 2\nWEEK1_COL = 'D'  # Column 4\nWEEK2_COL = 'E'  # Column 5\n\n# Skip header rows and summary rows based on debug findings\ndata_rows = []\nfor row_num in range(5, ws.max_row + 1):  # Start after header based on debug\n    # Skip summary\u002Fblank rows\n    if ws.cell(row=row_num, column=2).value is None:\n        continue\n    if 'TOTAL' in str(ws.cell(row=row_num, column=2).value).upper():\n        continue\n    \n    row_data = {\n        'store': ws.cell(row=row_num, column=2).value,\n        'week1': ws.cell(row=row_num, column=4).value,\n        'week2': ws.cell(row=row_num, column=5).value,\n    }\n    data_rows.append(row_data)\n\ndf = pd.DataFrame(data_rows)\nprint(df.head())\n```\n\n## Best Practices\n\n1. **Always start with exploration** - Never assume Excel structure matches expectations\n2. **Save debug scripts** - Keep them in your project for future reference and debugging\n3. **Print generously** - Use verbose output during exploration to catch edge cases\n4. **Verify row-by-row** - Don't assume all data rows follow the same pattern\n5. **Handle merged cells** - Check for merged cells that span multiple rows\u002Fcolumns\n\n## Common Pitfalls to Avoid\n\n- Assuming header is always row 1\n- Assuming all rows between first and last contain data\n- Not checking for hidden sheets or protected ranges\n- Ignoring cell formatting that indicates row type (bold, indentation)\n- Not handling None values or empty strings consistently\n\n## File Naming Convention\n\nUse descriptive names for debug scripts:\n- `debug_structure.py` - Overall file\u002Fsheet structure\n- `debug_columns.py` - Column positions and headers\n- `debug_rows.py` - Row patterns and data boundaries\n- `debug_values.py` - Value patterns and edge cases\n\nKeep debug scripts alongside your extraction script for maintainability.",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","gdpval_bench\u002Fskills\u002Fexcel-debug-extraction","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace","https:\u002F\u002Fgithub.com\u002FAG064","AG064, E.Mi.\r\n\r\nA person who thinks all the time, yet all they have to think about is nothing. I want to improve the world and work on open source projects","2026-10-08 06:53:48",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add AG064\u002FOpenSpace --skill excel-debug-extraction",{"tool":45,"command":46},"bunx","bunx skills add AG064\u002FOpenSpace --skill excel-debug-extraction",{"tool":48,"command":49},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill excel-debug-extraction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fexcel-debug-extraction\u002FSKILL.md",true,[53],{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},".skill_id","OTHER","其他",36,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fgdpval_bench\u002Fskills\u002Fexcel-debug-extraction\u002F.skill_id",[60,84,99,108,133,149],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":27},"01M6KKMPWA0B5SCCH766F8M5EA","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83],"write special chars ts check","check","write","filters","Existing","type-checking","for","errors","script","output","type","files","only","template","file","python","typescript",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":27},"01M6KKMJXVBNVEY3TRK055F4A7","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\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[91,92,69,80,93,94,81,82,25,95,96,97,98,73,75,26],"readback","write special chars readback","cleanup","read","verification","via","post","helper",{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":27},"01M6KKMEGX9M9NC105J0W3Q5B9","write-special-chars-heredoc","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[69,106,82,73,96,80,107,81,75],"write special chars heredoc","shell",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":27},"01M6KKM8EJ2AATVHZBNB916WT0","worldmonitor-reference","Curated architecture index of the WorldMonitor open-source dashboard. Reference for extracting patterns — vanilla TypeScript, Panel class hierarchy, service layer, CSS grid, API edge functions, refresh scheduler, and 60+ data source integrations.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[],[115,116,117,118,83,119,120,121,122,123,73,124,125,126,127,128,129,130,131,132],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":27},"01M6KKM39PHYK627F19GE2B9XN","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[140,141,142,143,73,144,26,145,146,147,148],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":27},"01M6KKKY7T2P61Y0JH54CDEJKQ","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[156,157,23,158,159,160,81,161,162,163],"directory","verify","verify directory structure","access","first","issues","diagnose","file access"]