本文へ移動
cccskills
無料GitHub で公開

xlsx

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

XLSX creation, editing, and analysis

Overview

A user may ask you to create, edit, or analyze the contents of an .xlsx file. You have different tools and workflows available for different tasks.

Important Requirements

LibreOffice Required for Formula Recalculation: You can assume LibreOffice is installed for recalculating formula values using the scripts/recalc.py script.

Reading and analyzing data

Data analysis with pandas

import pandas as pd

# Read Excel
df = pd.read_excel('file.xlsx')  # Default: first sheet
all_sheets = pd.read_excel('file.xlsx', sheet_name=None)  # All sheets as dict

# Analyze
df.head()      # Preview data
df.info()      # Column info
df.describe()  # Statistics

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

CRITICAL: Use Formulas, Not Hardcoded Values

Always use Excel formulas instead of calculating values in Python and hardcoding them.

❌ WRONG - Hardcoding Calculated Values

total = df['Sales'].sum()
sheet['B10'] = total  # Hardcodes 5000

✅ CORRECT - Using Excel Formulas

sheet['B10'] = '=SUM(B2:B9)'
sheet['C5'] = '=(C4-C2)/C2'
sheet['D20'] = '=AVERAGE(D2:D19)'

Common Workflow

  1. Choose tool: pandas for data, openpyxl for formulas/formatting
  2. Create/Load: Create new workbook or load existing file
  3. Modify: Add/edit data, formulas, and formatting
  4. Save: Write to file
  5. Recalculate formulas (MANDATORY IF USING FORMULAS): Use the scripts/recalc.py script
  6. Verify and fix any errors

Creating new Excel files

from openpyxl import Workbook
from openpyxl.styles import Font, PatternFill, Alignment

wb = Workbook()
sheet = wb.active

# Add data
sheet['A1'] = 'Hello'
sheet['B1'] = 'World'
sheet.append(['Row', 'of', 'data'])

# Add formula
sheet['B2'] = '=SUM(A1:A10)'

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

# Column width
sheet.column_dimensions['A'].width = 20

wb.save('output.xlsx')

Editing existing Excel files

from openpyxl import load_workbook

wb = load_workbook('existing.xlsx')
sheet = wb.active

# Modify cells
sheet['A1'] = 'New Value'
sheet.insert_rows(2)
sheet.delete_cols(3)

# Add new sheet
new_sheet = wb.create_sheet('NewSheet')
new_sheet['A1'] = 'Data'

wb.save('modified.xlsx')

Best Practices

Library Selection

  • pandas: Best for data analysis, bulk operations, and simple data export
  • openpyxl: Best for complex formatting, formulas, and Excel-specific features

Working with openpyxl

  • Cell indices are 1-based (row=1, column=1 refers to cell A1)
  • Use data_only=True to read calculated values: load_workbook('file.xlsx', data_only=True)
  • For large files: Use read_only=True for reading or write_only=True for writing
  • Formulas are preserved but not evaluated - use scripts/recalc.py to update values

Working with pandas

  • Specify data types to avoid inference issues: pd.read_excel('file.xlsx', dtype={'id': str})
  • For large files, read specific columns: pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])
  • Handle dates properly: pd.read_excel('file.xlsx', parse_dates=['date_column'])

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

A/B 测试专家(验效)。专注于实验设计、样本量计算、统计显著性检验和因果推断,确保实验科学可靠。

日本語の概要は準備中です。原文の説明を表示しています。

darker2016/workbuddy-skill-groups262026年8月17日 更新

A股研究团队主理人(古见远 · 研究总监)。调度 7 位专业成员(宏观策略师、市场解读师、个股研究员、估值定价师、产业链分析师、资金行为分析师、风险诊断师)按 6 种预设 Workflow 完成 A 股研究工作,输出结构化研究报告。 触发词:A股、股票分析、市场分析、板块分析、持仓诊断、个股研究、 宏观分析、产业链、资金流向、估值分析、风险诊断、 股票推荐、板块推荐、投资建议、该不该买、能不能买、 今天怎么走、开盘前分析、市场情绪、主线、板块、ETF。

日本語の概要は準備中です。原文の説明を表示しています。

darker2016/workbuddy-skill-groups262026年8月17日 更新

学术选刊顾问团 v3.0 主理人 — 输入论文主题+摘要+全文,自动推荐中文普通/中文核心/SCI/SSCI投稿期刊。双管道并行分析(中外刊独立匹配),冲稳保三档策略,附录用概率、审稿周期、证据链。

日本語の概要は準備中です。原文の説明を表示しています。

darker2016/workbuddy-skill-groups262026年8月17日 更新

社媒互动增长专家团 AI 评论运营专家(瑞普 · Reply)。负责评论智能分类与优先级排序,差异化回复策略设计,转化引导话术,品牌人设维护与禁忌词管理,多语言评论处理。 触发词:由 social-engagement-team-lead 主理人调度执行 Phase 3 评论运营任务时激活。不直接面向用户。

日本語の概要は準備中です。原文の説明を表示しています。

darker2016/workbuddy-skill-groups262026年8月17日 更新

AI 内容创作专家团主理人(司远 · 创意制片人)。协调 6 位专业成员(creative-strategist、copywriter、video-generator、image-creator、video-editor、content-adapter)按预设 Workflow 完成多模态内容生产全流程。 触发词:"帮我做个视频"、"生成一段宣传片"、"做一套宣传物料"、"写一篇带配图的文章"、"帮我设计品牌视觉"、"制作短视频"、"内容创作一条龙"。 路由逻辑:单一维度任务走单 Agent 直调;综合性内容需求走对应预设 Workflow。

日本語の概要は準備中です。原文の説明を表示しています。

darker2016/workbuddy-skill-groups262026年8月17日 更新

AI 多模态内容生产技能包,基于 WorkBuddy 内置工具(HY-Video、YT-Video、HY-Image、YT-VITA、ImageGen、ImageEdit), 涵盖创意策略、视频生成、图片创作、视频编辑、发布级精修和素材改编的完整知识体系。 触发词:视频生成、图片创作、AI创作、智能剪辑、视频翻译、素材分析、内容合成、Prompt工程、创意策划、情绪板、广告方向、精修。

日本語の概要は準備中です。原文の説明を表示しています。

darker2016/workbuddy-skill-groups262026年8月17日 更新

darker2016 のスキルをすべて見る

このスキルの問題を報告する