Communitygithub.com

aiskillstore/marketplace

当电子表格文件(如 .xlsx、.xlsm、.csv、.tsv)是主要输入或输出时使用此技能。涵盖打开、读取、编辑、修复、创建、格式化和转换表格文件,包括清理杂乱数据。

marketplace 是什么?

此技能专为需要以电子表格文件(如 .xlsx、.xlsm、.csv、.tsv)为主要交付物的任务而设计。无论是打开现有文件进行编辑、修复错误、添加公式和图表,还是从其他数据源创建全新电子表格,它都能胜任。技能的核心要求是始终使用 Excel 公式而非硬编码值,以确保电子表格的动态性和可更新性。它支持通过 pandas 进行数据分析,通过 openpyxl 进行复杂格式化和公式操作,并利用 LibreOffice 进行公式重算。此外,技能提供了严格的格式规范,包括专业字体、零公式错误、行业标准的颜色编码(蓝色为硬编码输入,黑色为公式,绿色为同工作簿引用,红色为外部链接)以及数字格式标准(如年份为文本、货币带单位、零显示为破折号)。对于财务模型,还要求所有假设单独放置并通过单元格引用,以及记录硬编码来源。此技能适用于 Claude Code、Cursor 等 AI 代理工具,帮助用户高效处理电子表格相关任务。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aiskillstore/marketplace/tree/HEAD/skills/xlsx

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

输出要求

所有 Excel 文件

专业字体

  • 除非用户另有指示,否则在所有交付物中使用一致的专业字体(例如 Arial、Times New Roman)

零公式错误

  • 每个 Excel 模型交付时必须零公式错误(#REF!、#DIV/0!、#VALUE!、#N/A、#NAME?)

保留现有模板(更新模板时)

  • 修改文件时,研究并精确匹配现有格式、样式和惯例
  • 切勿对已有既定模式的文件强加标准化格式
  • 现有模板惯例始终优先于这些指南

财务模型

颜色编码标准

除非用户或现有模板另有说明

行业标准颜色约定

  • 蓝色文本(RGB: 0,0,255):硬编码输入,以及用户将为场景更改的数字
  • 黑色文本(RGB: 0,0,0):所有公式和计算
  • 绿色文本(RGB: 0,128,0):从同一工作簿中其他工作表提取的链接
  • 红色文本(RGB: 255,0,0):指向其他文件的外部链接
  • 黄色背景(RGB: 255,255,0):需要关注的关键假设或需要更新的单元格

数字格式标准

必需格式规则

  • 年份:格式化为文本字符串(例如 "2024" 不是 "2,024")
  • 货币:使用 $#,##0 格式;始终在标头中指明单位("收入($mm)")
  • 零值:使用数字格式使所有零显示为 "-",包括百分比(例如 "$#,##0;($#,##0);-")
  • 百分比:默认使用 0.0% 格式(一位小数)
  • 倍数:估值倍数(EV/EBITDA、P/E)格式化为 0.0x
  • 负数:使用括号 (123) 而不是负号 -123

公式构建规则

假设放置

  • 将所有假设(增长率、利润率、倍数等)放在单独的假设单元格中
  • 在公式中使用单元格引用而不是硬编码值
  • 示例:使用 =B5*(1+$B$6) 而不是 =B5*1.05

公式错误预防

  • 验证所有单元格引用是否正确
  • 检查范围中是否存在差一错误
  • 确保所有预测期间的公式一致
  • 使用边界情况测试(零值、负数)
  • 验证无意外循环引用

硬编码的文档要求

  • 添加注释或在旁边单元格中注明(如果位于表格末尾)。格式:"来源:[系统/文档],[日期],[具体引用],[URL(如适用)]"
  • 示例:
    • "来源:公司 10-K,FY2024,第 45 页,收入说明,[SEC EDGAR URL]"
    • "来源:公司 10-Q,Q2 2025,附件 99.1,[SEC EDGAR URL]"
    • "来源:Bloomberg Terminal,2025/8/15,AAPL US Equity"
    • "来源:FactSet,2025/8/20,一致预期屏幕"

XLSX 创建、编辑和分析

概述

用户可能要求您创建、编辑或分析 .xlsx 文件的内容。您可以使用不同的工具和工作流程来处理不同的任务。

重要要求

需要 LibreOffice 进行公式重算:您可以假设已安装 LibreOffice,用于通过 scripts/recalc.py 脚本重新计算公式值。该脚本在首次运行时自动配置 LibreOffice,包括在限制 Unix 套接字的沙盒环境中(由 scripts/office/soffice.py 处理)。

读取和分析数据

使用 pandas 进行数据分析

对于数据分析、可视化和基本操作,使用 pandas,它提供强大的数据处理能力:

import pandas as pd

# 读取 Excel
df = pd.read_excel('file.xlsx')  # 默认:第一个工作表
all_sheets = pd.read_excel('file.xlsx', sheet_name=None)  # 所有工作表以字典形式返回

# 分析
df.head()      # 预览数据
df.info()      # 列信息
df.describe()  # 统计

# 写入 Excel
df.to_excel('output.xlsx', index=False)

Excel 文件工作流程

关键:使用公式,而非硬编码值

始终使用 Excel 公式,而不是在 Python 中计算值然后硬编码。 这确保电子表格保持动态和可更新。

❌ 错误 - 硬编码计算值

# 错误:在 Python 中计算并硬编码结果
total = df['Sales'].sum()
sheet['B10'] = total  # 硬编码 5000

# 错误:在 Python 中计算增长率
growth = (df.iloc[-1]['Revenue'] - df.iloc[0]['Revenue']) / df.iloc[0]['Revenue']
sheet['C5'] = growth  # 硬编码 0.15

# 错误:Python 计算平均值
avg = sum(values) / len(values)
sheet['D20'] = avg  # 硬编码 42.5

✅ 正确 - 使用 Excel 公式

# 正确:让 Excel 计算总和
sheet['B10'] = '=SUM(B2:B9)'

# 正确:增长率作为 Excel 公式
sheet['C5'] = '=(C4-C2)/C2'

# 正确:使用 Excel 函数计算平均值
sheet['D20'] = '=AVERAGE(D2:D19)'

这适用于所有计算——总计、百分比、比率、差异等。电子表格应在源数据更改时能够重新计算。

通用工作流程

  1. 选择工具:数据分析用 pandas,公式/格式化用 openpyxl
  2. 创建/加载:创建新工作簿或加载现有文件
  3. 修改:添加/编辑数据、公式和格式
  4. 保存:写入文件
  5. 重算公式(使用公式时必做):使用 scripts/recalc.py 脚本
    python scripts/recalc.py output.xlsx
    
  6. 验证并修复错误:
    • 脚本返回带有错误详细信息的 JSON
    • 如果 status 为 errors_found,检查 error_summary 了解具体错误类型和位置
    • 修复已识别的错误并再次重算
    • 常见需修复的错误:
      • #REF!:无效的单元格引用
      • #DIV/0!:除以零
      • #VALUE!:公式中的错误数据类型
      • #NAME?:无法识别的公式名称

创建新的 Excel 文件

# 使用 openpyxl 处理公式和格式
from openpyxl import Workbook
from openpyxl.styles import Font, PatternFill, Alignment

wb = Workbook()
sheet = wb.active

# 添加数据
sheet['A1'] = 'Hello'
sheet['B1'] = 'World'
sheet.append(['Row', 'of', 'data'])

# 添加公式
sheet['B2'] = '=SUM(A1:A10)'

# 格式化
sheet['A1'].font = Font(bold=True, color='FF0000')
sheet['A1'].fill = PatternFill('solid', start_color='FFFF00')
sheet['A1'].alignment = Alignment(horizontal='center')

# 列宽
sheet.column_dimensions['A'].width = 20

wb.save('output.xlsx')

编辑现有 Excel 文件

# 使用 openpyxl 保留公式和格式
from openpyxl import load_workbook

# 加载现有文件
wb = load_workbook('existing.xlsx')
sheet = wb.active  # 或 wb['SheetName'] 用于特定工作表

# 处理多个工作表
for sheet_name in wb.sheetnames:
    sheet = wb[sheet_name]
    print(f"工作表:{sheet_name}")

# 修改单元格
sheet['A1'] = 'New Value'
sheet.insert_rows(2)  # 在第 2 行插入行
sheet.delete_cols(3)  # 删除第 3 列

# 添加新工作表
new_sheet = wb.create_sheet('NewSheet')
new_sheet['A1'] = 'Data'

wb.save('modified.xlsx')

重算公式

由 openpyxl 创建或修改的 Excel 文件包含公式字符串,但不包含计算值。使用提供的 scripts/recalc.py 脚本来重算公式:

python scripts/recalc.py <excel_file> [timeout_seconds]

示例:

python scripts/recalc.py output.xlsx 30

该脚本:

  • 首次运行时自动设置 LibreOffice 宏
  • 重算所有工作表中的所有公式
  • 扫描所有单元格以查找 Excel 错误(#REF!、#DIV/0! 等)
  • 返回带有详细错误位置和计数的 JSON
  • 适用于 Linux 和 macOS

公式验证清单

快速检查以确保公式正常工作:

基本验证

  • 测试 2-3 个样本引用:在构建完整模型前验证它们能拉取到正确的值
  • 列映射:确认 Excel 列匹配(例如第 64 列 = BL,不是 BK)
  • 行偏移:记住 Excel 行是从 1 开始索引的(DataFrame 第 5 行 = Excel 第 6 行)

常见陷阱

  • NaN 处理:使用 pd.notna() 检查空值
  • 最右侧列:FY 数据通常在 50+ 列
  • 多个匹配项:搜索所有出现,而不仅仅是第一个
  • 除以零:在公式中使用 / 之前检查分母(#DIV/0!)
  • 错误引用:验证所有单元格引用指向预期的单元格(#REF!)
  • 跨工作表引用:使用正确格式(Sheet1!A1)链接工作表

公式测试策略

  • 从小开始:在广泛应用之前,先在 2-3 个单元格上测试公式
  • 验证依赖项:检查公式中引用的所有单元格是否存在
  • 测试边界情况:包括零、负数和非常大的值

解读 scripts/recalc.py 的输出

该脚本返回带有错误详细信息的 JSON:

{
  "status": "success",           // 或 "errors_found"
  "total_errors": 0,              // 错误总数
  "total_formulas": 42,           // 文件中的公式数
  "error_summary": {              // 仅在发现错误时存在
    "#REF!": {
      "count": 2,
      "locations": ["Sheet1!B5", "Sheet1!C10"]
    }
  }
}

最佳实践

库选择

  • pandas:最适合数据分析、批量操作和简单数据导出
  • openpyxl:最适合复杂格式化、公式和 Excel 特定功能

使用 openpyxl

  • 单元格索引基于 1(row=1, column=1 引用单元格 A1)
  • 使用 data_only=True 读取计算值:load_workbook('file.xlsx', data_only=True)
  • 警告:如果以 data_only=True 打开并保存,公式将被值替换并永久丢失
  • 对于大文件:使用 read_only=True 进行读取或 write_only=True 进行写入
  • 公式被保留但不会被计算——使用 scripts/recalc.py 更新值

使用 pandas

  • 指定数据类型以避免推断问题:pd.read_excel('file.xlsx', dtype={'id': str})
  • 对于大文件,读取特定列:pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])
  • 正确处理日期:pd.read_excel('file.xlsx', parse_dates=['date_column'])

代码风格指南

重要:生成用于 Excel 操作的 Python 代码时:

  • 编写简洁、精简的 Python 代码,避免不必要的注释
  • 避免冗长的变量名和冗余操作
  • 避免不必要的 print 语句

对于 Excel 文件本身:

  • 为包含复杂公式或重要假设的单元格添加注释
  • 记录硬编码值的数据来源
  • 包含关键计算和模型部分的说明

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

aiskillstore/marketplace

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

aiskillstore/marketplace

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

aiskillstore/marketplace

Use when the user asks to "pre-launch check the landing page", "run a Quality-Score preflight", or "verify ad-to-page message match before launch"; produces an ad↔page continuity report — message-match gaps, above-the-fold check, page-speed read, form-friction count, mobile-render flags — as a pass/fix punch list. Not for redesigning or rewriting the page — use landing-optimizer; not for scoring the account or the RQS — use ad-account-auditor. 落地页体验预检/广告落地页一致性检查

aiskillstore/marketplace

Use when the user asks to "optimize our landing page for influencer traffic", "fix our promo-code landing page", or "improve conversion from a creator campaign"; produces a message-match audit, page-structure and social-proof recommendations, a promo-code/CTA conversion plan, and an A/B test roadmap. Not for measuring campaign results after launch — use performance-analyzer.

aiskillstore/marketplace

Audit a landing page, sales page or checkout page for conversion leaks and return a fix list ordered by expected revenue impact. Use when asked to review, critique or improve a landing page, sales page, opt-in page, product page or checkout flow, when conversion rate is low, when paid traffic is not converting, or when someone asks "why isn't this page converting" or wants a CRO / landing page review.

aiskillstore/marketplace

This skill helps users extract GitHub repository project details and contributor contact information using keywords, stars, and update dates. Agent should proactively apply this skill when users express needs like search for GitHub projects by keywords, find top open-source contributors in specific domains, extract developer contacts from GitHub repositories, discover trending repositories with high stars, gather contributor profiles and social links for tech recruiting, retrieve GitHub project descriptions and metrics, build developer communities by finding active contributors, search for repositories updated recently, collect personal website and Twitter links of developers, generate targeted leads for developer tools, or track active open-source contributors for collaboration.

aiskillstore/marketplace

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

aiskillstore/marketplace

Using the Wonda CLI to generate images, videos, music, and audio from the terminal — plus LinkedIn, Reddit, and X/Twitter research and automation

aiskillstore/marketplace

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

aiskillstore/marketplace

Generates creative domain name ideas for your project and checks availability across multiple TLDs (.com, .io, .dev, .ai, etc.). Saves hours of brainstorming and manual checking.

aiskillstore/marketplace

Process video files with audio extraction, format conversion (mp4, webm), and Whisper transcription. Use when user mentions video conversion, audio extraction, transcription, mp4, webm, ffmpeg, or whisper transcription.

aiskillstore/marketplace

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas.

aiskillstore/marketplace

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

aiskillstore/marketplace

Router skill for LLMQuant portfolio workflows. Use when the user needs company profiles, thesis tracking, theme research, watchlist monitoring, or alert management.

aiskillstore/marketplace

Account assets, equity and fund positions, P&L, cash flow records, account statements, margin ratios, buy-power estimates, order management, and DCA recurring investments via Longbridge (most require Trade permission). Frameworks: portfolio diagnosis, rebalancing, asset allocation, risk analysis (VaR/CVaR), performance attribution, and tax-loss harvesting. Triggers: "持仓", "账户", "盈亏", "资产", "对账单", "下单", "买入", "卖出", "撤单", "定投", "组合诊断", "再平衡", "资产配置", "风险分析", "绩效归因", "税损收割", "持倉", "賬戶", "盈虧", "對賬單", "下單", "買入", "賣出", "組合診斷", "再平衡", "稅損收割", "positions", "portfolio", "P&L", "order", "buy", "sell", "DCA", "statement", "risk analysis", "rebalancing", "tax harvesting", "我的风险", "持仓风险", "风险敞口", "資產", "資產配置", "風險分析", "績效歸因", "撤單

aiskillstore/marketplace

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

aiskillstore/marketplace

Use for Codex models/pricing, scheduled tasks, skills, settings, setup, troubleshooting, customization, automations, and self-knowledge—including 'you,' 'your,' 'this app,' or 'this coding agent' when they refer to Codex—and for OpenAI APIs/products and ChatGPT Work. Also use for model choice/migration, prompting, SDKs, Responses, Realtime, agents, evals, and Chat/Work/Codex comparisons. Do not use for generic app/software tasks that merely mention Codex.

aiskillstore/marketplace

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

aiskillstore/marketplace

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

aiskillstore/marketplace

Perform a read-only, defect-first review of a specified code change and return every actionable finding. Use when another agent delegates review of uncommitted changes, a base-branch diff, a commit, or custom review instructions.

相关技能