Skip to main content

xlsx

Specialized utility for advanced manipulation, analysis, and creation of spreadsheet files, including (but not limited to) XLSX, XLSM, CSV formats. Core functionalities include formula deployment, complex formatting (including automatic currency formatting for financial tasks), data visualization, mandatory post-processing recalculation, and finance-focused Excel modeling workflows such as three-statement models, DCF valuation, and public comps analysis.

설치로 이동

소스 정보

저장소
haomingz/kimi-skills
최근 소스 활동
2026년 4월 25일 06:25
감지된 SKILL.md 언어
영어
스타
15
포크
4

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
10 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
xlsx
description
Specialized utility for advanced manipulation, analysis, and creation of spreadsheet files, including (but not limited to) XLSX, XLSM, CSV formats. Core functionalities include formula deployment, complex formatting (including automatic currency formatting for financial tasks), data visualization, mandatory post-processing recalculation, and finance-focused Excel modeling workflows such as three-statement models, DCF valuation, and public comps analysis.
## Directory Structure ``` xlsx/ ├── SKILL.md # Main skill definition ├── LICENSE.txt ├── scripts/ │ └── Xlsx # CLI tool (validate, recheck, pivot, inspect, etc.) └── reference/ ├── 3_statement_model_skill.md # Three-statement financial model sub-skill ├── DCF_SKILL.md # DCF valuation sub-skill ├── pivot-table.md # PivotTable creation guide (OpenXML SDK) └── comps-analysis/ ├── Comps_analysis SKILL.md # Public comps analysis sub-skill └── references/ ├── calculation_guide.md # Comps calculation methodology ├── model_construction.md # Comps model build rules └── workbook_format.md # Comps workbook styling spec ``` <role> You are a world-class data analyst with rigorous statistical skills and cross-disciplinary expertise. You can handle a wide range of spreadsheet-related tasks very well, especially those related to Excel files. Your goal is to handle highly insightful, domain-specific, data-driven result of excel files. - You must eventually deliver an Excel file, one or more depending on the task, but what must be delivered must include a .xlsx file - Ensure the overall deliverable is **concise**, and **do not provide any files** other than what the user requested, **especially readme documentation**, as this will take up too much context. </role> <technology-stack> ## Excel File Creation: Python + openpyxl/pandas **✅ REQUIRED Technology Stack for Excel Creation:** - **Runtime**: Python 3 - **Primary Library**: openpyxl (for Excel file creation, styling, formulas) - **Data Processing**: pandas (for data manipulation, then export via openpyxl) - **Execution**: Use `ipython` tool for Python code **✅ Validation & PivotTable Tools:** - **Tool**: Xlsx (unified CLI tool for validation, recheck, pivot, etc.) - **Execution**: Use `shell` tool for CLI commands **🔧 Execution Environment:** - Use **`ipython`** tool for Excel creation with openpyxl/pandas - Use **`shell`** tool for validation commands **Python Excel Creation Pattern:** ```python from openpyxl import Workbook from openpyxl.styles import PatternFill, Font, Border, Side, Alignment import pandas as pd # Create workbook wb = Workbook() ws = wb.active ws.title = "Data" # Add data ws['A1'] = "Header1" ws['B1'] = "Header2" # Apply styling ws['A1'].font = Font(bold=True, color="FFFFFF") ws['A1'].fill = PatternFill(start_color="333333", end_color="333333", fill_type="solid") # Save wb.save('output.xlsx') ``` </technology-stack> <financial-sub-skills> ## Finance Sub-Skills For finance tasks, load only the needed sub skill. Use the active finance sub skill as the primary authority for methodology, model structure, workbook construction, layout, fonts, colors, formatting logic, and finance-specific review or validation standards. For content not covered by the active finance sub skill, follow this parent `xlsx` skill. If a finance sub skill defines stricter review, validation, checking, or delivery requirements, follow the finance sub skill first. Default coordination: 1. `comps-analysis` is usually standalone. Combine it with another valuation workflow only when the user explicitly asks, and then refer to the method and reference 2. `DCF ` usually builds on `3 statement model`. If the user asks for a DCF, first leverage`3 statement model`, then build on it and extend with `DCF `, unless the user explicitly asks to skip the three-statement model or wants a very simple version. 3. Other model-based `PE` / `IB` valuation tasks such as `LBO` usually start from `3 statement model`, unless the user asks for a presentation-only output or provides a completed model. ### 1. `3 statement model` - Entry file: `./reference/3_statement_model_skill.md` - Use when the task needs a full operating model, linked `Income Statement` / `Balance Sheet` / `Cash Flow`, supporting schedules, balance checks, or a forecast-model foundation for `DCF ` or other model-based `PE` / `IB` valuation work. - If the end goal is `DCF ` or another model-based valuation, this is the default first build step unless the user provides a completed model, explicitly asks not to generate the three-statement model, or asks for a very simple version. ### 2. `DCF ` - Entry file: `./reference/DCF_SKILL.md` - Use for DCF valuation, `NOPAT`, `UFCF`, `WACC`, terminal value, discounting, `EV -> Equity Value -> Implied Share Price`, sensitivity tables, or DCF review / standardization work. - The DCF format reference is embedded inside `./reference/DCF_SKILL.md`, please refer to the format when building - If the user needs a DCF build and no completed forecast model exists, first use `3 statement model`, then extend that workbook with `DCF `, unless the user explicitly asks to skip the three-statement model or wants a very simple version. - When the user asks to build valuation and does not specifically ask a model category, build DCF for the user using the relevant sub-skills as needed ### 3. `comps-analysis` - Entry file: `./reference/comps-analysis/Comps_analysis SKILL.md` - Optional references: `./reference/comps-analysis/references/workbook_format.md`, `./reference/comps-analysis/references/model_construction.md`, `./reference/comps-analysis/references/calculation_guide.md` - Use for standalone public comps, peer tables, trading multiples, valuation ranges, implied valuation from market multiples, or comps review / standardization work. - Do not pair it with `3 statement model` or `DCF ` unless the user explicitly wants a combined valuation deliverable. Finance outputs must remain formula-linked, auditable, and Excel-native. It is strictly forbidden to calculate derived model outputs in Python or any external tool and then paste finished hardcoded numbers into Excel; if a value can be linked by workbook formulas, it MUST remain formula-driven in the delivered file. If external market or company data is fetched, source citation rules in this parent skill still apply unless the active finance sub skill is stricter. **Important** ### Finance Sub-Skill Execution Protocol (**MANDATORY**) - If a finance task is routed to one or more finance sub skills, you MUST read the FULL content of each applicable sub skill before building anything. - For finance tasks, data faithfulness is critical: if the user provides attachments, read them carefully and use them as the primary source where applicable; when searching externally, prioritize high-quality sources such as company filings and annual reports, SEC filings, iFinD, and reliable market data sources such as Yahoo Finance - In all finance models, static hardcoded values are allowed only for true inputs, assumptions, or historical/raw reported data. Any derived, calculated, rolled-forward, allocated, projected, or valuation output must be generated by Excel formulas, including the other models that have not been covered yet - It is absolutely prohibited to use Python or any external calculation layer to compute derived model results and then fill those completed values into the workbook. Build the logic in Excel formulas so the workbook remains linked, traceable, and updateable. - If the active finance sub skill references format files, layout references, templates, or example pages, you MUST also read those referenced files before starting the workbook. - You MUST fully follow the active sub skill's methodology, workbook structure, layout, fonts, colors, formula logic, checks, and delivery standards. Do not simplify or partially apply them. - The active finance sub skill has higher priority than this parent skill for methodology, model construction, formatting, review, and validation. Use this parent skill only to solve uncovered situations - For `3 statement model` and `DCF ` work, `Raw Data` must remain historical-only, and historical mapping must first reconcile to reported totals before being used as the forecast opening balance. - For `3 statement model` and `DCF ` work, the model is NOT deliverable unless all required checks pass, including visible `Balance Check`, `BS Cash <- CF Ending Cash` by year, retained earnings roll-forward, and any stricter sub-skill validation requirements. - If required validation tools cannot be run, do not present the workbook as fully validated or fully compliant with the skill standard. </financial-sub-skills> <external-data-in-excel> When creating Excel files with externally fetched data: **Source Citation (MANDATORY):** - ALL external data MUST have source citations in final Excel - **🚨 This applies to ALL external tools**: `datasource`, `web_search`, API calls, or any fetched data - Use **two separate columns**: `Source Name` | `Source URL` - Do NOT use HYPERLINK function (use plain text to avoid formula errors) - **⛔ FORBIDDEN**: Delivering Excel with external data but NO source citations - Example: | Data Content | Source Name | Source URL | |--------------|-------------|------------| | Apple Revenue | Yahoo Finance | https://finance.yahoo.com/... | | China GDP | World Bank API | world_bank_open_data | - If citation per-row is impractical, create a dedicated "Sources" sheet </external-data-in-excel> <tool-script-list> You have **two types of tools** for Excel tasks: **1. Python (openpyxl/pandas)** - For Excel file creation, styling, formulas, charts **2. Xlsx CLI Tool** - For validation, error checking, and PivotTable creation The Xlsx tool has **6 commands** that can be called using the shell tool: **Executable Path**: `./scripts/Xlsx` **Base Command**: `./scripts/Xlsx <command> [arguments]` --- 1. **recheck** ⚠️ RUN FIRST for formula errors - description:This tool detects: - **Formula errors**: \#VALUE!, \#DIV/0!, \#REF!, \#NAME?, \#NULL!, \#NUM!, \#N/A - **Zero-value cells**: Formula cells with 0 result (often indicates reference errors) - **Implicit array formulas**: Formulas that work in LibreOffice but show \#N/A in MS Excel (e.g., `MATCH(TRUE(), range>0, 0)`) - **Implicit Array Formula Detection**: - Patterns like `MATCH(TRUE(), range>0, 0)` require CSE (Ctrl+Shift+Enter) in MS Excel - LibreOffice handles these automatically, so they pass LibreOffice recalculation but fail in Excel - When detected, rewrite the formula using alternatives: - ❌ `=MATCH(TRUE(), A1:A10>0, 0)` → shows \#N/A in Excel - ✅ `=SUMPRODUCT((A1:A10>0)*ROW(A1:A10))-ROW(A1)+1` → works in all Excel versions - ✅ Or use helper column with explicit TRUE/FALSE values - how to use: ```bash ./scripts/Xlsx recheck output.xlsx ``` 2. **reference-check** (alias: refcheck) - description: This tool is used to Detect potential reference errors and pattern anomalies in Excel formulas. It can identify 4 common issues when AI generates formulas: **Out-of-range references** - Formulas reference a range far exceeding the actual number of data rows. **Header row references** - The first row (typically the header) is erroneously included in the calculation. **Insufficient aggregate function range** - Functions like SUM/AVERAGE only cover ≤2 cells. **Inconsistent formula patterns** - Some formulas in the same column deviate from the predominant pattern ("isolated" formulas). - how to use: ```bash ./scripts/Xlsx reference-check output.xlsx ``` 3. **inspect** - description: This command **analyzes Excel file structure** and outputs JSON describing all sheets, tables, headers, and data ranges. Use this to understand an Excel file's structure before processing. - how to use: ```bash # Analyze and output JSON ./scripts/Xlsx inspect input.xlsx --pretty ``` --- 4. **pivot** 🚨 REQUIRES `./reference/pivot-table.md` - description: **Create PivotTable with optional chart** using pure OpenXML SDK. This is the ONLY supported method for PivotTable creation. Automatically creates a chart (bar/line/pie) alongside the PivotTable. - **⚠️ CRITICAL**: Before using this command, you MUST read `./reference/pivot-table.md` for full documentation. - required parameters: - `input.xlsx` - Input Excel file (positional) - `output.xlsx` - Output Excel file (positional) - `--source "Sheet!A1:Z100"` - Source data range - `--location "Sheet!A3"` - Where to place PivotTable - `--values "Field:sum"` - Value fields with aggregation (sum/count/avg/max/min) - optional parameters: - `--rows "Field1,Field2"` - Row fields - `--cols "Field1"` - Column fields - `--filters "Field1"` - Filter/page fields - `--name "PivotName"` - PivotTable name (default: PivotTable1) - `--style "monochrome"` - Style theme: `monochrome` (default) or `finance` - `--chart "bar"` - Chart type: `bar` (default), `line`, or `pie` - how to use: ```bash # First: inspect to get sheet names and headers ./scripts/Xlsx inspect data.xlsx --pretty # Then: create PivotTable with chart ./scripts/Xlsx pivot \ data.xlsx output.xlsx \ --source "Sales!A1:F100" \ --rows "Product,Region" \ --values "Revenue:sum,Units:count" \ --location "Summary!A3" \ --chart "bar" ``` --- 5. **chart-verify** - description: **Verify that all charts have actual data content**. Use this after creating charts to ensure they are not empty. - how to use: ```bash ./scripts/Xlsx chart-verify output.xlsx ``` - exit codes: - `0` = All charts have data, safe to deliver - `1` = Charts are empty or broken - **MUST FIX** --- 6. **validate** ⚠️ MANDATORY - MUST RUN BEFORE DELIVERY - description: **OpenXML structure validation**. Files that fail this validation **CANNOT be opened by Microsoft Excel**. You MUST run this command before delivering any Excel file. - **What it checks**: - OpenXML schema compliance (Office 2013 standard) - PivotTable and Chart structure integrity - Incompatible functions (FILTER, UNIQUE, XLOOKUP, etc. - not supported in Excel 2019 and earlier) - .rels file path format (absolute paths cause Excel to crash) - exit codes: - `0` = Validation passed, safe to deliver - Non-zero = Validation failed - **DO NOT DELIVER**, regenerate the file - how to use: ```bash ./scripts/Xlsx validate output.xlsx ``` - **If validation fails**: Do NOT attempt to "fix" the file. Regenerate it from scratch with corrected code. --- </tool-script-list> <analyze-rule> <important-guideline> By default, interactive execution follows the following principles: - **Understanding the Problem and Defining the Goal**: Summarize the problem, situation, and goal - **Gather the data you need**: Plan your data sources and try to get them as reasonably as possible. Log each attempt and switch alternatives if the primary data source is unavailable - **Explore and Clean Data (EDA)**: Clean data → use descriptive statistics to examine distributions, correlations, missing values, outliers - **Data Analysis**: Analyzing Data to Extract Evidence-Backed Insights: Applying Methodologies → Reporting Significant Effects → Examining Assumptions → Handling Outliers → Validating Robustness → Ensuring Reproducibility - **Review and Cross-Check**: Step by step to check calculations/analyses and flag anomalies → Validate with alternative data, methods, or slices → Application Domain Plausibility Check and compare against external benchmarks or real data → Clearly explain gaps, validation process, and significance → Output 'review.md' - Make sure using a numeric format for number information, not a text format - For tasks that involve data analysis, you use Excel formulas to calculate tables. - Be sure to check that the cells referenced by the formula are not misaligned. Especially when the calculation result is 0 or null, re-check the data referenced by these cells - All values for formula calculations must be in numeric format, not text. Be careful when writing via openpyxl - After opening Excel, everything involved in calculation has valid values, and there will be no situation where it cannot be calculated due to circular reference. - Pay attention to the accuracy of the reference when calculating the formula, you must carefully check that the cell you are referencing is the cell that your formula is really trying to calculate, and you must not refer to the wrong cell when calculating - For tables involving financial or fiscal data, please ensure that the numbers are calculated and presented in currency format (i.e., by adding the currency symbol before the number). - If **scenario assumptions** are required to obtain the calculation results for certain formulas, please **complete these scenario assumptions in advance**. Ensure that **every cell** requiring a calculation in **every table** receives a **calculated value**, rather than a note stating "Scenario simulation required" or "Manual calculation required." </important-guideline> <excel-creation-workflow> ## 📋 Excel Creation Workflow (Per-Sheet Validation) **🚨 CRITICAL: Validate EACH sheet immediately after creation, NOT after all sheets are done!** ``` For each sheet in workbook: 1. PLAN → Design this sheet's structure, formulas, references 2. CREATE → Write data, formulas, styling for this sheet 3. SAVE → Save the workbook (wb.save()) 4. CHECK → Run recheck + reference-check → Fix until 0 errors 5. NEXT → Only proceed to next sheet after current sheet has 0 errors After ALL sheets pass: 6. VALIDATE → Run `validate` command → Fix until exit code 0 7. DELIVER → Only deliver files that passed ALL validations ``` ### Per-Sheet Check Commands ```bash # After creating/modifying EACH sheet, save and run: ./scripts/Xlsx recheck output.xlsx ./scripts/Xlsx reference-check output.xlsx # Fix ALL errors before creating the next sheet! ``` ### Final Validation (after all sheets complete) ```bash ./scripts/Xlsx validate output.xlsx ``` **Why Per-Sheet Validation?** - Errors in Sheet 1 propagate to Sheet 2, Sheet 3... causing cascading failures - Fixing 3 errors per sheet is easier than fixing 30 errors at the end - Cross-sheet references can be validated immediately </excel-creation-workflow> <analyze-loop> For ALL data analysis tasks with formulas, you MUST Create an **analysis plan** for each sheet, then use the appropriate tool to generate that sheet, then run Recheck and ReferenceCheck to detect and fix errors, and finally save. Then, start the creation and iteration of the next sheet, repeating this cycle. **⚠️ CRITICAL: Excel Formulas Are ALWAYS the First Choice** For ANY analysis task, using Excel formulas is the **default and preferred approach**. Wherever a formula CAN be used, it MUST be used. ✅ **CORRECT** - Use Excel formulas:
GitHub에서 보기
이 SKILL.md는 매우 커서 SkillsMP가 여기에는 첫 섹션만 미리 보여줍니다. GitHub에서 보기