[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77JH16JP3VHT40Z5GRM6K46":3,"skill-same:01M77JH16JP3VHT40Z5GRM6K46":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M77JH16JP3VHT40Z5GRM6K46","income-statement-cn",null,"Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fi\u002Fincome-statement-cn\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# 财务报表生成技能\n\n## 技能概述\n根据明细表数据自动生成规范化利润表，支持动态行数扩展。\n\n## 核心规则\n\n### 数据提取规则\n\n**收入类：**\n- 来源：明细表中 分类 1 = \"收入\" 或 \"实收\"\n- 取值优先级：\n  1. 优先取\"发生金额\"列（列 8）\n  2. 其次取\"收入金额\"列（列 6）\n- 分组：按 分类 2 和 分类 3 两级分组汇总\n\n**支出类：**\n- 来源：明细表中 分类 1 = \"支出\"\n- 取值优先级：\n  1. 优先取\"发生金额\"列（列 8）\n  2. 其次取\"支出金额\"列（列 7）\n- 分组：按 分类 2 和 分类 3 两级分组汇总\n\n### 利润表格式规范\n\n**列结构：**\n| 列 | 内容 | 宽度 |\n|----|------|------|\n| B | 标题（收入\u002F支出\u002F经营利润） | 15 |\n| C | 分类 2（工作坊\u002F个案\u002F导师费等） | 12 |\n| D | 分类 3（具体项目名称） | 40 |\n| E | 金额 | 15 |\n| F | 空白 | 40 |\n\n**行结构：**\n1. **标题行**：合并 B1:F1，\"利润表 YYYYMM\"居中，粗体\n2. **收入区块**：\n   - 行 3：B3=\"收入\"（粗体），E3=合计公式（粗体）\n   - 行 4+：分类 2 标题（如\"工作坊\"），E 列=小计\n   - 后续行：D 列=分类 3 明细，E 列=金额（动态行数）\n3. **支出区块**：\n   - 标题行：B 列=\"支出\"（粗体），E 列=合计（粗体）\n   - 分类 2 标题行（导师费\u002F场地费等），E 列=小计\n   - 明细行：D 列=分类 3，E 列=金额（动态行数）\n4. **经营利润行**：B 列=\"经营利润\"（粗体），E 列=公式（粗体）\n\n**格式要求：**\n- 无边框\n- \"收入\"、\"支出\"、\"经营利润\"文字粗体\n- 三者对应金额粗体\n- F 列留空，宽度与 D 列相同（40）\n\n## 代码模板\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nfrom openpyxl import load_workbook, Workbook\nfrom openpyxl.styles import Font, Alignment\nimport glob\n\ndef create_income_statement(source_file, output_file):\n    \"\"\"\n    根据明细表生成利润表\n    \n    Args:\n        source_file: 源 Excel 文件路径（含明细表）\n        output_file: 输出利润表路径\n    \"\"\"\n    wb_source = load_workbook(source_file)\n    ws_detail = wb_source['明细']\n    \n    # 数据提取\n    income_by_cat2_cat3 = {}\n    expense_by_cat2_cat3 = {}\n    \n    for row in range(2, ws_detail.max_row + 1):\n        cat1 = ws_detail.cell(row=row, column=3).value\n        cat2 = ws_detail.cell(row=row, column=4).value\n        cat3 = ws_detail.cell(row=row, column=5).value\n        income_amt = ws_detail.cell(row=row, column=6).value\n        expense_amt = ws_detail.cell(row=row, column=7).value\n        amount = ws_detail.cell(row=row, column=8).value\n        \n        # 收入：优先发生金额\n        if cat1 in ['收入', '实收']:\n            amt = amount if amount else (income_amt if income_amt else 0)\n            if amt and amt > 0:\n                if cat2 not in income_by_cat2_cat3:\n                    income_by_cat2_cat3[cat2] = {}\n                if cat3 not in income_by_cat2_cat3[cat2]:\n                    income_by_cat2_cat3[cat2][cat3] = 0\n                income_by_cat2_cat3[cat2][cat3] += amt\n        \n        # 支出：优先发生金额\n        if cat1 == '支出':\n            amt = amount if amount else (expense_amt if expense_amt else 0)\n            if amt and amt > 0:\n                if cat2 not in expense_by_cat2_cat3:\n                    expense_by_cat2_cat3[cat2] = {}\n                if cat3 not in expense_by_cat2_cat3[cat2]:\n                    expense_by_cat2_cat3[cat2][cat3] = 0\n                expense_by_cat2_cat3[cat2][cat3] += amt\n    \n    # 创建工作簿\n    wb = Workbook()\n    ws = wb.active\n    ws.title = '利润表'\n    \n    # 样式\n    title_font = Font(name='微软雅黑', size=12, bold=True)\n    bold_font = Font(name='微软雅黑', size=10, bold=True)\n    \n    # === 填写数据 ===\n    # 标题行\n    ws.merge_cells('B1:F1')\n    ws['B1'] = '利润表 YYYYMM'  # 替换实际月份\n    ws['B1'].font = title_font\n    ws['B1'].alignment = Alignment(horizontal='center', vertical='center')\n    \n    # 收入部分\n    ws['B3'] = '收入'\n    ws['B3'].font = bold_font\n    \n    # 动态填充收入明细...\n    # （按分类 2 标题 + 分类 3 明细的顺序）\n    \n    # 支出部分\n    # （按分类 2 标题 + 分类 3 明细的顺序）\n    \n    # 经营利润\n    # E 列 = E3 - 支出合计行\n    \n    # F 列留空\n    for r in range(2, max_data_row + 1):\n        ws.cell(row=r, column=6, value='')\n    \n    # 列宽\n    ws.column_dimensions['B'].width = 15\n    ws.column_dimensions['C'].width = 12\n    ws.column_dimensions['D'].width = 40\n    ws.column_dimensions['E'].width = 15\n    ws.column_dimensions['F'].width = 40\n    \n    wb.save(output_file)\n```\n\n## 使用示例\n\n```python\n# 生成 202601 利润表\ncreate_income_statement(\n    source_file='\u002FUsers\u002Fzhengyong\u002F.openclaw\u002Fqqbot\u002Fdownloads\u002F财务报表 202601-claw_1774271697631.xlsx',\n    output_file='\u002FUsers\u002Fzhengyong\u002F.openclaw\u002Fworkspace\u002F利润表 202601_明细生成.xlsx'\n)\n```\n\n## 关键要点\n\n1. **动态行数**：有多少明细项目就占多少行，不固定\n2. **金额优先级**：发生金额 > 收入\u002F支出金额\n3. **分类层级**：分类 2 是标题，分类 3 是明细\n4. **格式统一**：收入\u002F支出\u002F经营利润粗体 + 金额粗体\n5. **F 列预留**：宽度 40，留空备用\n\n## 文件位置\n\n- **输入**：`\u002FUsers\u002Fzhengyong\u002F.openclaw\u002Fqqbot\u002Fdownloads\u002F财务报表 YYYYMM*.xlsx`\n- **输出**：`\u002FUsers\u002Fzhengyong\u002F.openclaw\u002Fworkspace\u002F利润表 YYYYMM_明细生成.xlsx`\n- **脚本**：`\u002FUsers\u002Fzhengyong\u002F.openclaw\u002Fworkspace\u002Fcreate_income_YYYYMM_simple.py`\n\n---\n*创建时间：2026-03-23*\n*最后更新：2026-03-23*\n",{},"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fi\u002Fincome-statement-cn",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill income-statement-cn",{"tool":37,"command":38},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill income-statement-cn",{"tool":40,"command":41},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill income-statement-cn","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fi\u002Fincome-statement-cn\u002FSKILL.md",true,[],[46,53,60,67,74,81],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":18},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]