Communitygithub.com

bg-szy/TOP-SKILLS

在任何以电子表格文件为主要输入或输出的任务中使用此技能,包括打开、读取、编辑、修复、创建或转换 .xlsx、.xlsm、.csv、.tsv 等文件。

TOP-SKILLS 是什么?

bg-szy/TOP-SKILLS 是一个专门用于处理电子表格文件(如 .xlsx、.xlsm、.xltx、.csv、.tsv)的 AI 技能,适用于创建、编辑、修复、格式化和转换电子表格文件的任务。该技能基于 openpyxl、pandas 和 markitdown 等预装库,并依赖 LibreOffice 进行公式重算。其核心优势在于严格遵循用户规范,使用公式而非硬编码结果,并通过 recalc.py 脚本验证公式正确性,确保输出无错误的专业电子表格。技能还包含金融模型色彩约定和公式兼容性指南,以避免跨平台(Excel vs LibreOffice)的公式问题。

兼容平台~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 计算的总和。工作表必须在其输入更改时重新计算。
  • 严格遵循用户的规范。 精确的表名、精确的列标题以及他们指定的公式。一个计算出其他内容的重新设计无论多优雅都是失败。
  • 在读者能看到的地方记录每一个假设和硬编码数字 — 单元格批注,或表格末尾的相邻单元格。存在真实来源时引用它(来源:公司 10-K 报告,2024 财年,第 45 页,收入注释,[SEC EDGAR 链接]);当数字来自用户时,请直接说明。
  • 你创建的供他人填写的工作簿需要包含一个简短的图例,说明哪些单元格需要编辑,并提供一个示例行,其中包含显示预期格式的真实值。绝不要在你被要求编辑的文件中添加这样的行。
  • 编辑现有文件:严格遵循其约定。 它们覆盖这里的每一条指南。首先找到其指定的输入单元格 — 通过独特的字体颜色、填充或底纹标记 — 只在那里写入,并保持所有现有公式不变。

重新计算(当文件包含公式时必须执行)

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 是只读的。
  • .xlsm 会丢失其宏,除非你向 load_workbook 传递 keep_vba=True。
  • 包含空格的表名必须在跨表引用中引用:='假设输入'!$B$5。如果不引用,则求值为 #VALUE!。

金融模型

除非用户另有说明,或现有文件已采用其他方式。

颜色: 蓝色文本 (0,0,255) 用于硬编码输入和场景杠杆 · 黑色用于公式 · 绿色 (0,128,0) 用于链接到其他工作表 · 红色 (255,0,0) 用于链接到其他文件 · 黄色填充 (255,255,0) 用于关键假设和用户应填写的单元格。

数字: 货币 $#,##0,并在标题中命名单位(收入 ($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.

相关技能