Skip to content

huangjia2019/claude-code-engineering / 04-Skills/projects/03-financial-skill

financial-analyzing

Verified

Analyze financial data, calculate financial ratios, and generate analysis reports. Use when the user asks about revenue, costs, profits, margins, ROI, financial metrics, or needs financial analysis of a company or project.

FileKindSize
README.mdmarkdown1.2 KB
SKILL.mdskill md1.9 KB
data/analysis_report.mdmarkdown6.0 KB
data/sample_financials.jsonconfig1.5 KB
reference/costs.mdmarkdown1.4 KB
reference/profitability.mdmarkdown1.7 KB
reference/revenue.mdmarkdown1.2 KB
scripts/calculate_ratios.pyexecutablescript1.9 KB
templates/analysis_report.mdmarkdown1.1 KB

scripts/calculate_ratios.py

View on GitHub
#!/usr/bin/env python3
"""
Financial Ratios Calculator

Usage:
    python calculate_ratios.py <data_file>

Data file format (JSON):
{
    "revenue": 1000000,
    "cogs": 400000,
    "operating_expenses": 300000,
    "net_income": 150000,
    "total_assets": 2000000,
    "shareholders_equity": 800000,
    "previous_revenue": 900000
}
"""

import json
import sys


def calculate_ratios(data):
    """Calculate common financial ratios."""
    ratios = {}

    # Revenue Growth
    if 'previous_revenue' in data and data['previous_revenue'] > 0:
        ratios['revenue_growth'] = (
            (data['revenue'] - data['previous_revenue'])
            / data['previous_revenue'] * 100
        )

    # Gross Margin
    if 'cogs' in data:
        gross_profit = data['revenue'] - data['cogs']
        ratios['gross_margin'] = gross_profit / data['revenue'] * 100

    # Operating Margin
    if 'cogs' in data and 'operating_expenses' in data:
        operating_income = data['revenue'] - data['cogs'] - data['operating_expenses']
        ratios['operating_margin'] = operating_income / data['revenue'] * 100

    # Net Margin
    if 'net_income' in data:
        ratios['net_margin'] = data['net_income'] / data['revenue'] * 100

    # ROA
    if 'net_income' in data and 'total_assets' in data:
        ratios['roa'] = data['net_income'] / data['total_assets'] * 100

    # ROE
    if 'net_income' in data and 'shareholders_equity' in data:
        ratios['roe'] = data['net_income'] / data['shareholders_equity'] * 100

    return ratios


def main():
    if len(sys.argv) < 2:
        print("Usage: python calculate_ratios.py <data_file>")
        sys.exit(1)

    with open(sys.argv[1], 'r') as f:
        data = json.load(f)

    ratios = calculate_ratios(data)

    print("\n=== Financial Ratios ===\n")
    for name, value in ratios.items():
        print(f"{name.replace('_', ' ').title()}: {value:.2f}%")


if __name__ == '__main__':
    main()
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall