Communitygithub.com

bg-szy/TOP-SKILLS

專門處理以試算表檔案(.xlsx、.xlsm、.csv、.tsv 等)為主要輸入或輸出的任務:建立、編輯、轉換、清理或分析試算表資料。

TOP-SKILLS 是什麼?

此技能專為需要以試算表檔案為核心的任務而設計,涵蓋從建立、編輯、格式化、公式計算到資料清理與格式轉換等完整工作流程。它支援 openpyxl、pandas 與 markitdown 等預裝工具,並整合 LibreOffice 進行公式校驗,確保最終產出的試算表無錯誤且專業。技能文件中詳細列出了 openpyxl 的常見陷阱(如合併儲存格、data_only 模式的破壞性)、公式撰寫的相容性限制(避免 XLOOKUP 等陣列函數),以及財務模型的視覺規範(顏色、數字格式等)。特別適合需要產生或修改 .xlsx/.xlsm/.csv/.tsv 檔案的開發者與 AI agent 使用者。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/bg-szy/TOP-SKILLS/tree/HEAD/skills/skills/xlsx

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

XLSX 建立、編輯與分析

任務方法
建立或編輯含公式/格式openpyxl — 見下方注意事項
大量資料匯入/匯出pandas (read_excel, to_excel)
快速查看工作表markitdown file.xlsx — 每個工作表顯示 ## SheetName;也能讀 .xlsm。不包含儲存格座標,因此不應用於規劃編輯
讀取模型(公式與值)兩次 load_workbook 呼叫 — 見注意事項

openpyxl、pandas 與 markitdown 已預先安裝 — 請勿先執行 pip install;直接編寫腳本並匯入即可。僅在匯入失敗(或缺少 markitdown 指令)時才使用 pip install 安裝遺失的套件。

以下腳本路徑均相對於此技能目錄。

每個輸出的要求

  • 專業字型(Arial、Times New Roman)貫穿全文,除非使用者另有指定。
  • 零公式錯誤。 絕不可在 recalc.py 回報 errors_found 的情況下交付。若你認為錯誤在你之前就已存在,請證明:以 data_only=True 載入原始檔案並檢查該儲存格。你引入的錯誤與你繼承的錯誤看起來完全相同。
  • 使用公式,絕不寫死結果。 寫 sheet['B10'] = '=SUM(B2:B9)',而非 Python 計算的總和。工作表必須能在輸入變更時重新計算。
  • 嚴格遵循使用者的規格。 精確的分頁名稱、精確的欄位標題,以及他們指定的公式。一個計算其他內容的重新設計,無論多優雅,都是失敗。
  • 在讀者能看到的地方記錄每個假設與寫死的數字 — 儲存格註解,或表格末端的相鄰儲存格。若有真實來源請引用(Source: Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL]);若數字來自使用者,請清楚說明。
  • 你建立來讓他人填寫的工作簿需要一個簡短的圖例說明哪些儲存格可以編輯,以及一個範例資料列顯示預期格式。切勿在要求你編輯的檔案中加入此類範例列。
  • 編輯現有檔案:完全比照其慣例。 這些慣例優先於此處所有指南。先找出其指定的輸入儲存格 — 不同的字型顏色、填色或陰影會標示它們 — 僅在那裡寫入,並保持所有現有公式不變。

重新計算(只要檔案包含公式就必須執行)

openpyxl 將公式以無快取值的字串寫入。在你重新計算之前,任何讀取快取值的工具 — pandas、load_workbook(data_only=True) 以及大多數預覽器 — 都會將每個公式儲存格視為 None。

python scripts/recalc.py output.xlsx [timeout_seconds]   # 預設 30

LibreOffice 會計算每個公式,檔案會原地重寫,並輸出 JSON:status(success | errors_found)、total_formulas、total_errors,以及一個 error_summary,其中每個錯誤類型會列出最多 100 個儲存格(locations_truncated 表示它隱藏了多少個 — 請相信 total_errors,而非列表長度)。修正它指出的錯誤後再次執行。JSON 中出現 error 鍵而非 status 表示未執行計算,僅此情況會以非零狀態碼退出 — errors_found 會以 0 退出,因此切勿將乾淨的退出視為乾淨的工作簿。

綠色的重新計算證明你的公式可以計算,但不代表它們正確。 一個差一格的範圍或對錯誤列的引用會產生一個乾淨、無錯誤但數字錯誤的檔案。在建立整個表格前,先寫 2–3 個公式並檢查它們是否拉取到預期的值。

連結到其他檔案的工作簿,如果你用 openpyxl 重新儲存然後重新計算,這些連結會遺失。這樣的公式會顯示 ='[1]Returns Analysis'!$B$2 — 其中的 [1] 是工作簿外部參考清單的索引,指向磁碟上另一個檔案,而非工作表。該檔案在此環境中很少存在,因此儲存格的快取值是唯一持有其資料的地方。openpyxl 在儲存時會清除該值;LibreOffice 接著必須真正解析該參考,但失敗了,寫入 #NAME?,並刪除所有連結。recalc.py 會拒絕在此狀態下執行 — 請在儲存前複製原始檔案中這些儲存格的值(使用 --force 會覆寫並接受資料遺失)。

選擇能通過驗證的公式

LibreOffice 實現的函數比 Excel 少,一個它無法計算的函數會變成字面上的 #NAME? 並嵌入你交付的檔案中。

  • 優先使用 Excel 2007 時代的函數 — SUMIFS、INDEX、MATCH、IFERROR、SUMPRODUCT — 這些不需要前綴。
  • 六個 2007 之後的函數可以運作,但必須加上 _xlfn. 前綴,因為 openpyxl 會將你的公式逐字寫入 XML,而 Excel 會為 2007 年之後的函數名稱加上前綴(其 UI 會隱藏該前綴):_xlfn.TEXTJOIN、_xlfn.CONCAT、_xlfn.IFS、_xlfn.SWITCH、_xlfn.MAXIFS、_xlfn.MINIFS。不帶前綴寫入時,每個都會產生 #NAME?。
  • 絕不使用 XLOOKUP、XMATCH、SORT、FILTER、UNIQUE 或 SEQUENCE。 運行時的 LibreOffice 在任何前綴下都無法計算它們。較新的版本可以計算,但它們是溢出陣列函數,而 openpyxl 寫入的檔案沒有溢出元數據,因此只有範圍的左上角儲存格會得到值 — 而 recalc.py 對這個截斷的結果會回報 total_errors: 0。使用 INDEX/MATCH 進行查詢,並在寫入儲存格之前用 Python 進行排序、篩選和去重。
  • 一個 LibreOffice 無法解析的公式會以小寫寫回 — 在 #NAME? 旁邊是一個快速判斷點。

openpyxl 注意事項

  • 讀取模型需要載入兩次。 data_only=True 會產生快取值,但公式會消失;預設載入會得到公式字串但沒有值。一次載入無法同時取得兩者。
  • 如果你儲存,data_only=True 具有破壞性。 該工作簿中已無公式,因此儲存會永久將每個公式替換為字面值。
  • 對剛由 openpyxl 寫入的檔案使用 data_only=True 會在所有地方回傳 None — 請先執行 recalc.py。(結果為 "" 的公式也會回傳 None。)
  • 合併儲存格:只寫入左上角的錨點。 範圍內的其他每個儲存格都是 MergedCell,其 .value 是唯讀的。
  • 除非你傳入 keep_vba=True 給 load_workbook,否則 .xlsm 會遺失巨集。
  • 包含空格的工作表名稱在跨工作表的參考中必須用引號括起來:='Assumptions Inputs'!$B$5。未加引號時,會計算為 #VALUE!。

財務模型

除非使用者另有說明,或現有檔案已採用其他做法。

顏色: 藍色文字 (0,0,255) 用於寫死的輸入和情境變數 · 黑色用於公式 · 綠色 (0,128,0) 用於連結到其他工作表 · 紅色 (255,0,0) 用於連結到其他檔案 · 黃色填色 (255,255,0) 用於關鍵假設和使用者應填寫的儲存格。

數字: 貨幣格式 $#,##0,並在標題中標示單位 (Revenue ($mm)) · 零顯示為 -,包含百分比 ($#,##0;($#,##0);-) · 負數用括號 · 百分比 0.0%,儲存為小數 (0.15 顯示為 15.0%;儲存 15 會顯示為 1500.0%) · 估值倍數 0.0x · 年份用文字 ("2024",絕不使用 2,024)。

結構: 每個假設放在其自己的標籤儲存格中,由使用它的公式參考 (=B5*(1+$B$6),絕不使用 =B5*1.05) · 公式在每個預測期間保持一致,因為中間某個被單獨編輯的儲存格是最常見的隱性錯誤 · 對可能為零的分母設置保護。

相依套件

openpyxl、pandas、markitdown(pip,已預先安裝 — 僅在匯入失敗或缺少指令時才安裝) · LibreOffice (soffice,已為沙盒環境自動配置,透過 scripts/office/soffice.py)

Individual skills in this repo

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

bg-szy/TOP-SKILLS

Brand-first landing page designer — runs a brand-identity interview (colors, typography, shape language), then generates and iterates on a polished landing page via Stitch with deployment-ready HTML. Use when the user asks to create, design, or build a landing page, homepage, or marketing page and has no established visual direction. Skip when they have a design mockup, need a dashboard or app UI, are working at component level, building a multi-page app, or restyling with known design tokens — use frontend-design instead.

bg-szy/TOP-SKILLS

Fill out Microsoft Azure Landing Zone (ALZ) Accelerator checklists by interviewing the user, mapping their Azure subscriptions, integrating IP addressing documentation, and applying Microsoft Cloud Adoption Framework best practices. Produces a completed Excel checklist (.xlsx) ready for ALZ deployment. Use this skill whenever the user mentions Azure Landing Zone, ALZ checklist, landing zone accelerator, platform landing zone configuration, ALZ bootstrap, hub-and-spoke setup, Azure network topology planning, or wants to fill out any ALZ-related checklist or configuration file. Also trigger when the user uploads an Excel file that contains tabs like "Accelerator - Bootstrap", "Accelerator - Bicep", or "Accelerator - Terraform".

bg-szy/TOP-SKILLS

Compose a premium, animated landing page section by section in Next.js + Tailwind + Motion (Framer Motion) — built on a real design system, with editorial copy and motion that feels human-crafted, not template-generated. Use when building or rebuilding a landing page, marketing site, or hero/feature/pricing/CTA sections that need to look production-ready and bespoke from day one.

bg-szy/TOP-SKILLS

Write high-converting landing page copy using proven frameworks like PAS (Problem-Agitate-Solution), AIDA, and StoryBrand. Creates headlines, value propositions, CTAs, and full page sections optimized for conversion. Use when users need landing page copy, sales page content, or marketing website text.

bg-szy/TOP-SKILLS

Optimize landing pages for conversions, performance, and SEO. Use when improving landing pages, increasing conversions, or optimizing page performance.

bg-szy/TOP-SKILLS

Review investment portfolios for risk, diversification, fees. Asset allocation recommendations, tax-loss harvesting, rebalancing.

bg-szy/TOP-SKILLS

Beads Viewer - Graph-aware triage engine for Beads projects. Computes PageRank, betweenness, critical path, and cycles. Use --robot-* flags for AI agents.

bg-szy/TOP-SKILLS

CI red? Call us. Pipeline fire brigade deploys. Use when user mentions CI failures, build errors, test failures, or pipeline issues. Do NOT load for: local builds, standard implementation work, reviews, or setup.

bg-szy/TOP-SKILLS

CASS Memory System - procedural memory for AI coding agents. Three-layer cognitive architecture with confidence decay, anti-pattern learning, cross-agent knowledge transfer, trauma guard safety system. Bun/TypeScript CLI.

bg-szy/TOP-SKILLS

Mandatory entry point: read this first for any request to make, create, edit, animate, or render a video, animation, or motion graphic, including a promo, explainer, captioned clip, title card, overlay, slideshow or interactive deck, Remotion port, or any HyperFrames HTML composition. Also use it to inspect, diagnose, validate, preview, publish, or batch-render an existing HyperFrames project. Inputs may be a website URL, GitHub PR, Figma design or URL, text or brief, existing footage, or music. It resumes project state, captures intent when applicable, selects and installs the owning workflow, and routes domain capabilities. HyperFrames is the default output framework unless the user explicitly chooses another framework for the deliverable or asks only to record a browser session.

bg-szy/TOP-SKILLS

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

bg-szy/TOP-SKILLS

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. 落地页体验预检/广告落地页一致性检查

bg-szy/TOP-SKILLS

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.

bg-szy/TOP-SKILLS

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.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

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.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

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", "我的风险", "持仓风险", "风险敞口", "資產", "資產配置", "風險分析", "績效歸因", "撤單

bg-szy/TOP-SKILLS

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.

bg-szy/TOP-SKILLS

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.

相關技能