Communitygithub.com

aiskillstore/marketplace

專門用於處理試算表檔案(.xlsx、.xlsm、.csv、.tsv)的AI技能。涵蓋開啟、讀取、編輯、修復、建立、格式轉換及清理資料等任務,並確保產出為專業的Excel檔案。

marketplace 是什麼?

此技能專為需要以試算表檔案為主要輸入或輸出的任務而設計。當使用者要求開啟、讀取、編輯、修復既有的 .xlsx、.xlsm、.csv 或 .tsv 檔案(例如新增欄位、計算公式、格式化、製作圖表、清理雜亂資料),或從頭建立新的試算表,或在表格格式之間轉換時,都應觸發此技能。它定義了嚴格的輸出規範,包括強制使用Excel公式而非在Python中計算後寫死數值,以保持試算表的動態性;對於財務模型更設定了業界標準的色彩編碼(例如藍色文字代表輸入值、黑色文字代表公式)、數字格式及註解要求。技能支援在Linux和macOS上運作,並依賴LibreOffice來重新計算公式值。它提供使用pandas進行資料分析、以及使用openpyxl進行公式操作與格式設定的工作流程,並包含一個自動化驗證腳本(scripts/recalc.py)來檢查並修正常見的Excel公式錯誤(如 #REF!、#DIV/0!)。

相容平台~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、本益比)格式化為 0.0x
  • 負數:使用括號 (123) 而非減號 -123

公式建構規則

假設值放置

  • 將 所有 假設值(成長率、利潤率、倍數等)放在獨立的假設值儲存格中
  • 在公式中使用儲存格參照,而非寫死的數值
  • 範例:使用 =B5*(1+$B$6) 而非 =B5*1.05

公式錯誤預防

  • 驗證所有儲存格參照是否正確
  • 檢查範圍是否有差一錯誤
  • 確保所有預測期間的公式一致
  • 使用邊界案例(零值、負數)進行測試
  • 確認無意外的循環參照

寫死數值的文件記錄要求

  • 在儲存格中或旁邊(如果在表格末端)加註解。格式:"來源:[系統/文件],[日期],[具體參考],[URL(如適用)]"
  • 範例:
    • "來源:Company 10-K, FY2024, 第45頁, 收入附註, [SEC EDGAR URL]"
    • "來源:Company 10-Q, Q2 2025, Exhibit 99.1, [SEC EDGAR URL]"
    • "來源:Bloomberg Terminal, 8/15/2025, AAPL US Equity"
    • "來源:FactSet, 8/20/2025, 共識預測畫面"

XLSX 建立、編輯與分析

概述

使用者可能會要求您建立、編輯或分析 .xlsx 檔案的內容。針對不同的任務,您有不同的工具與工作流程可用。

重要需求

需要 LibreOffice 進行公式重新計算:您可以假設已安裝 LibreOffice,用於透過 scripts/recalc.py 腳本重新計算公式值。該腳本會在首次執行時自動設定 LibreOffice,包括在限制 Unix socket 的沙箱環境中(由 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.

相關技能