agentleFS
claude-office-skillsclaude-office-skills/claude-office-plugin/skills/connectors/financial-data/SKILL.md

financial-data

Skill9 starsChanged 8 months agoMITView on GitHub

金融数据连接器 — 通过 Data Bridge 获取实时股票、财务报表、估值比率等结构化数据

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

金融数据连接器 v2.0(Data Bridge)

使用内置 dataBridgePull() 函数获取金融数据,无需手写 XHR。

获取综合财务数据

var resp = dataBridgePull("yahoo-finance", "stock_info", { ticker: "AAPL" });
if (!resp || !resp.ok) return "获取数据失败: " + (resp ? resp.error : "网络错误");
var d = resp.data;

// d.summary — 公司概况
// d.keyStats — 估值指标
// d.incomeStatements — 历年损益表
// d.balanceSheets — 历年资产负债表
// d.cashFlows — 历年现金流量表

获取历史价格

var resp = dataBridgePull("yahoo-finance", "stock_price", {
  ticker: "AAPL",
  range: "1y",
  interval: "1d"
});
if (!resp || !resp.ok) return "获取价格数据失败";
var prices = resp.data.prices; // [{date, open, high, low, close, volume}, ...]

数据字段参考

路径字段说明
d.summaryshortName, sector, industry, currency, currentPrice, totalRevenue, grossProfit, netIncome, operatingCashflow, freeCashflow, totalCash, totalDebt, grossMargins, operatingMargins, profitMargins, ebitdaMargins, revenueGrowth, earningsGrowth, debtToEquity, returnOnEquity, returnOnAssets, fullTimeEmployees最新汇总
d.keyStatsbeta, trailingPE, forwardPE, priceToBook, enterpriseValue, enterpriseToRevenue, enterpriseToEbitda, pegRatio, sharesOutstanding, bookValue, dividendYield, marketCap估值指标
d.incomeStatements[i]endDate, totalRevenue, costOfRevenue, grossProfit, operatingIncome, netIncome, ebit, ebitda, interestExpense, taxProvision, researchDevelopment, sellingGeneralAdministrative损益表
d.balanceSheets[i]endDate, totalAssets, totalCurrentAssets, totalLiabilitiesNetMinorityInterest, totalCurrentLiabilities, stockholdersEquity, cashAndCashEquivalents, longTermDebt, totalDebt, netDebt, propertyPlantEquipment, inventory, receivables, minorityInterest资产负债
d.cashFlows[i]endDate, operatingCashFlow, capitalExpenditure, freeCashFlow, depreciationAndAmortization, changeInWorkingCapital现金流

Ticker 格式

市场格式示例
美股直接代码AAPL, MSFT, TSLA
港股代码.HK0700.HK, 9988.HK
A股(沪)代码.SS601899.SS, 600519.SS
A股(深)代码.SZ000858.SZ, 002594.SZ

单位转换(配合建模)

Yahoo Finance 返回原始单位(如元),建模统一使用 millions:

function _n(v) { return (typeof v === "number" && isNaN(v)) ? 0 : (v == null ? 0 : v); }
function toM(v) { return _n(v) / 1000000; }

ws.Range("B3").Value2 = toM(d.incomeStatements[0].totalRevenue);

重要规则

  • 使用 dataBridgePull:不要手写 XHR,直接调用 dataBridgePull("yahoo-finance", "stock_info", { ticker: "..." })
  • 检查 resp.ok:数据获取可能失败,必须检查
  • 单位统一到 millions:原始数据 ÷ 1,000,000,用 toM() 函数
  • 数据安全访问:d.incomeStatements && d.incomeStatements.length > 0 ? d.incomeStatements[0].totalRevenue : 0
  • 字段名全部 camelCase
  • A 股注意后缀:上海 .SS,深圳 .SZ

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.