技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
project-finance【数据与研究】Use when analyzing project financial data — budget vs actual variance, Earned Value Management (EVM) metrics (CPI, SPI, EAC, ETC, TCPI), cost breakdown structures, spend trends, financial forecasting, or processing CSV/Excel files containing budget, cost, or spend data. Shared financial engine for project-manager and delivery-manager. Trigger on: bud…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Shared financial analysis engine for project-manager and delivery-manager. Handles data ingestion, column mapping, standard PM financial analyses, and multi-format output.
Use this skill for:
project-manager or delivery-manager involving financial numbersDo NOT use for:
python-data-engineer)Claude always produces analysis and artifacts. The user always reviews before acting on them.
Follow this seven-step pipeline for every financial analysis request.
Receive the data source:
Detect file type by extension. If file exceeds 2000 rows, apply patterns from large-file-analysis.
Before loading the full file, examine its shape:
# Row and column count
wc -l /path/to/file.csv
head -5 /path/to/file.csv
tail -5 /path/to/file.csv
Report to the user:
Map file columns to financial concepts using three-layer resolution. Read references/column-mappings.md for the synonym dictionary and detection heuristics.
Confidence levels and actions:
| Confidence | Action |
|---|---|
| HIGH (exact synonym match) | Apply mapping, inform user of all mappings made |
| MEDIUM (fuzzy match, single candidate) | Apply with warning, ask to confirm |
| LOW (multiple candidates or no match) | Present options, require user selection |
| NONE (no plausible match) | Ask user which column maps to which concept |
Check for a cached mapping file at <project>/.project-finance/column-mappings.json. If found and file pattern matches, offer to reuse. Always show the mapping to the user regardless of confidence.
Before calculating, run validation checks and report findings:
Present each issue found and require user decision on how to handle it (fill with zero, interpolate, exclude, keep as-is). Never silently resolve data quality issues.
Load data using pandas (or bash fallback for basic CSV):
import pandas as pd
# File type detection
df = pd.read_csv(path) # .csv
df = pd.read_excel(path) # .xlsx (requires openpyxl)
df = pd.read_csv(path, sep='\t') # .tsv
Parse dates, convert currencies to numeric, handle encoding (try utf-8, then latin-1, then cp1252).
Required Python libraries:
| Library | Purpose | Required? |
|---|---|---|
| pandas | Core data manipulation | Yes |
| openpyxl | Read/write .xlsx | Yes (for Excel) |
| matplotlib | Chart generation | Recommended |
| numpy | Numerical calculations | Yes (for forecasting) |
Auto-detect availability and offer to install if missing. Never install without asking. Provide bash fallback for basic CSV analysis using awk/sort.
Select analysis type based on available columns or user request. Read references/analysis-templates.md for template details and references/evm-formulas.md for EVM calculations.
Analysis type routing:
| Available Data | Suggested Analysis |
|---|---|
| Budget + Actual columns | Budget vs Actual variance |
| EV + PV + AC + BAC columns | Full EVM analysis |
| Actual cost by period | Spend trend / burn rate |
| Cost data with categories | Cost Breakdown Structure |
| Historical actuals + total budget | Financial forecasting |
Auto-detect available analyses from mapped columns, present options, let user choose.
Five built-in analysis types:
references/evm-formulas.md for formulas and interpretation.Output formats:
references/chart-patterns.md for standard financial charts. Create session temp dir: PF_WORK=$(mktemp -d /tmp/pf-XXXXXXXXXX). Save to ${PF_WORK}/charts/, or <project>/.project-finance/charts/ if project context availablepresentation-builder chain) -- follow presentation-datavis patternsInterpretation (always included):
Store confirmed column mappings for reuse:
<project>/.project-finance/
column-mappings.json # Cached mappings per file pattern
charts/ # Generated chart images
Cache schema:
{
"file_pattern": "monthly_budget_*.csv",
"mappings": {
"budget": "Allocated Amount",
"actual": "Spend to Date",
"task": "Cost Element",
"period": "Reporting Month"
},
"confirmed_by_user": true,
"last_used": "2026-03-30"
}
presentation-datavis patterns (insight titles, accent colors, source lines). Save to .presentations/output/assets/.| Anti-Pattern | Why It's Wrong | Do This Instead |
|---|---|---|
| Loading file without recon | Wrong assumptions about structure, wasted effort | Always run Phase 0 reconnaissance first |
| Silent column mapping | User trusts wrong mapping, analysis is meaningless | Report ALL mappings, confirm medium/low confidence |
| Silently filling null values | Hides data quality issues, corrupts analysis | Report nulls, ask user how to handle each |
| Division by zero in EVM | Crash or misleading infinity values | Guard all divisions, report "N/A -- no data yet" |
| Forecast from <3 data points | Unreliable trend line presented as fact | Tag confidence as LOW, add explicit warning |
| Presenting numbers without method | User cannot verify or challenge results | Always show formula and input values used |
| Treating cumulative as periodic | Double-counting inflates totals | Detect monotonic increase, ask user to confirm |
| Ignoring mixed currencies | Meaningless aggregations across currencies | Detect multiple symbols, require user resolution |
Read these on demand when performing specific analysis types:
~/.claude/skills/project-finance/references/column-mappings.md -- synonym dictionary, detection heuristics, cache schema~/.claude/skills/project-finance/references/evm-formulas.md -- all EVM formulas with worked examples and interpretation~/.claude/skills/project-finance/references/analysis-templates.md -- budget vs actual, spend trend, CBS, forecasting templates~/.claude/skills/project-finance/references/chart-patterns.md -- matplotlib code for S-curve, variance bar, EVM dashboard