Skip to main content

data-analysis

Analyze banking data — spending patterns, income vs expenses, savings projections, and financial health metrics

소스 정보

저장소
aiappsgbb/kratos-agent
최근 소스 활동
2026년 4월 21일 09:30
감지된 SKILL.md 언어
영어
스타
23
포크
21

설치 방법

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

소스 파일 검토

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

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
data-analysis
description
Analyze banking data — spending patterns, income vs expenses, savings projections, and financial health metrics
enabled
true
## Instructions When the user asks for spending analysis, budget breakdown, savings projections, or financial insights, follow this workflow: ### 1. Data Ingestion - If the user has transaction data from `transaction-history`, use that as input - If the user provides CSV/JSON data inline, write it to `/tmp` first - If no data is available, use the **Faker MCP server** to generate realistic sample banking data (transactions, balances, spending patterns). Prefer calling Faker MCP tools directly (e.g., `faker_date_between`, `faker_random_element`, `faker_pyfloat`) over writing inline Python with the faker library. ### 2. Banking-Specific Analyses #### Spending Breakdown ```python import pandas as pd df = pd.DataFrame(transactions) spending = df[df["amount"] < 0].copy() spending["amount"] = spending["amount"].abs() breakdown = spending.groupby("category")["amount"].agg(["sum", "count", "mean"]) breakdown.columns = ["Total Spent", "# Transactions", "Avg Transaction"] breakdown = breakdown.sort_values("Total Spent", ascending=False) print(breakdown) ``` #### Income vs Expenses ```python income = df[df["amount"] > 0]["amount"].sum() expenses = df[df["amount"] < 0]["amount"].abs().sum() net = income - expenses savings_rate = (net / income * 100) if income > 0 else 0 print(f"Total Income: ${income:,.2f}") print(f"Total Expenses: ${expenses:,.2f}") print(f"Net Cash Flow: ${net:,.2f}") print(f"Savings Rate: {savings_rate:.1f}%") ``` #### Monthly Trend ```python df["month"] = pd.to_datetime(df["date"]).dt.to_period("M") monthly = df.groupby("month")["amount"].sum() print(monthly) ``` #### Top Merchants ```python top = spending.groupby("description")["amount"].sum().nlargest(10) print("Top 10 Merchants by Spend:") print(top) ``` ### 3. Visualizations Generate charts with matplotlib and save to `/tmp`: ```python import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt # Spending by category pie chart fig, ax = plt.subplots(figsize=(10, 8)) breakdown["Total Spent"].plot(kind="pie", autopct="%1.1f%%", ax=ax) ax.set_ylabel("") ax.set_title("Spending by Category") plt.tight_layout() plt.savefig("/tmp/spending_breakdown.png", dpi=150) plt.close() print("Chart saved: /tmp/spending_breakdown.png") ``` Common banking charts: - **Pie chart**: Spending by category - **Bar chart**: Monthly income vs. expenses - **Line chart**: Account balance trend over time - **Stacked bar**: Category breakdown per month ### 4. Financial Health Indicators Provide insights based on the data: - **50/30/20 Rule Check**: Is the user spending ~50% on needs, 30% wants, 20% savings? - **Recurring charges**: Identify subscriptions and recurring payments - **Large/unusual transactions**: Flag transactions significantly above average - **Savings potential**: "Reducing dining by 20% would save ~$X/month" ### 5. Output - Print key findings as text - Save charts to `/tmp` with descriptive names - Reference file paths for download - If analysis produces a transformed dataset, save as CSV to `/tmp` ## Chaining - `code_interpreter` — runs the Python code - `transaction-history` — provides source transaction data - `file-sharing` — delivers charts and exports - `account-lookup` — context on account balances ## Constraints - Pre-installed libraries: pandas, numpy, matplotlib, faker. Additional libraries can be installed at runtime via pip. - Files must be written to `/tmp` - Max execution time: 30 seconds per code block
GitHub에서 보기