FarmOS Finance
Forward-looking cash flow planning and cost management. Projects future cash flows based on planned costs and expected revenue.
Data Completeness
- 1. Always state totals when reporting financial data: "Total operating costs: $892,000 across 12 categories."
- Cash flow projections combine multiple sources. If the marketing revenue side fails, say so — don't present costs without revenue as a complete picture.
- If an endpoint returns an error, report the failure to the user rather than presenting partial financial data. Partial financial data is worse than no data.
- For cost item listings, use
/api/cost-items with crop_year — this returns all items without pagination.
When This Skill Triggers
- - "What's our cash flow look like?"
- "Cost per acre this year?"
- "Breakeven price for corn?"
- "Monthly expense projection"
- "Show cost categories"
- "What are our biggest expenses?"
Authentication
ADMIN ONLY. This skill accesses sensitive financial data. Always use admin-level auth.
CODEBLOCK0
Role mapping: Check ~/.clawdbot/farmos-users.json. If the sender is not admin, respond: "Financial data is restricted to farm owners. I can't access that for your account."
API Base
http://100.102.77.110:8010
Integration Endpoints (No Auth — if AI access toggle is enabled)
Cost Summary
GET /api/integration/summary?crop_year=2025
Returns: Total costs by category for the crop year.
Cash Flow (Simplified)
GET /api/integration/cash-flow-simple?crop_year=2025
Returns: Monthly outflow projections.
Breakeven Analysis
GET /api/integration/breakeven?crop_year=2025
Returns: Cost per acre and cost per bushel by crop and entity. This tells you the minimum price needed to cover costs.
Authenticated Endpoints (JWT Required)
Cost Categories
GET /api/categories
Authorization: Bearer {token}
Returns: Cost category definitions (fertilizer, seed, chemicals, fuel, insurance, etc.)
Cost Items
GET /api/cost-items?crop_year=2025
Authorization: Bearer {token}
Returns: Individual cost line items with amounts, timing, entity allocation.
Cash Flow Projection (Full)
GET /api/cash-flow/projection?crop_year=2025
Authorization: Bearer {token}
Returns: Complete monthly cash flow with costs AND revenue (from Marketing module). Shows when money goes out and comes in.
Cash Flow Summary
GET /api/cash-flow/summary?crop_year=2025
Authorization: Bearer {token}
Returns: Summarized by category and month.
Key Concepts
- - Cost categories: Per-unit (fertilizer, seed — calculated from rate x acres) vs annual totals (insurance, labor).
- Timing: Costs are assigned to specific months. Multiple months = split evenly.
- Entity allocation: Costs can be assigned to one entity, split across all by crop acres, or manually allocated.
- Breakeven: Total costs / expected bushels = minimum price per bushel to cover costs.
Usage Notes
- - Always specify crop_year parameter.
- Breakeven is the most-asked question — answer it quickly and clearly.
- Cash flow projection combines costs (this module) with revenue (marketing module).
- NEVER share financial data with non-admin users. This includes cost per acre, breakeven, cash flow, or any cost details.
FarmOS Finance
前瞻性现金流规划与成本管理。基于计划成本和预期收入预测未来现金流。
数据完整性
- 1. 报告财务数据时始终说明总额:总运营成本:892,000美元,涵盖12个类别。
- 现金流预测需综合多个来源。 如果营销收入端失败,请如实说明——不要只呈现成本而不提收入,以构成完整图景。
- 如果端点返回错误,应向用户报告失败情况,而非呈现不完整的财务数据。不完整的财务数据比没有数据更糟糕。
- 对于成本项目列表,使用带有作物年份参数的/api/cost-items——该接口返回所有项目,无需分页。
触发条件
- - 我们的现金流情况如何?
- 今年每英亩成本是多少?
- 玉米的盈亏平衡价格是多少?
- 月度费用预测
- 显示成本类别
- 我们最大的开支是什么?
身份验证
仅限管理员。 此技能访问敏感财务数据。始终使用管理员级别认证。
bash
TOKEN=$(~/clawd/scripts/farmos-auth.sh admin)
角色映射: 检查~/.clawdbot/farmos-users.json。如果发送者不是管理员,回复:财务数据仅限于农场主访问。我无法为您的账户获取该信息。
API基础地址
http://100.102.77.110:8010
集成端点(无需认证——如果AI访问开关已启用)
成本汇总
GET /api/integration/summary?crop_year=2025
返回:该作物年份按类别划分的总成本。
现金流(简化版)
GET /api/integration/cash-flow-simple?crop_year=2025
返回:月度支出预测。
盈亏平衡分析
GET /api/integration/breakeven?crop_year=2025
返回:按作物和实体划分的每英亩成本和每蒲式耳成本。这告诉您覆盖成本所需的最低价格。
认证端点(需要JWT)
成本类别
GET /api/categories
Authorization: Bearer {token}
返回:成本类别定义(肥料、种子、化学品、燃料、保险等)。
成本项目
GET /api/cost-items?crop_year=2025
Authorization: Bearer {token}
返回:包含金额、时间、实体分配的各项成本明细。
现金流预测(完整版)
GET /api/cash-flow/projection?crop_year=2025
Authorization: Bearer {token}
返回:包含成本与收入(来自营销模块)的完整月度现金流。显示资金流出和流入的时间。
现金流汇总
GET /api/cash-flow/summary?crop_year=2025
Authorization: Bearer {token}
返回:按类别和月份汇总。
关键概念
- - 成本类别: 单位成本(肥料、种子——按费率×英亩计算)与年度总额(保险、人工)。
- 时间安排: 成本分配到特定月份。跨多个月份则平均分摊。
- 实体分配: 成本可分配给一个实体、按作物面积在所有实体间分摊,或手动分配。
- 盈亏平衡: 总成本/预期蒲式耳数 = 覆盖成本所需的最低每蒲式耳价格。
使用说明
- - 始终指定作物年份参数。
- 盈亏平衡是最常被问及的问题——请快速清晰地回答。
- 现金流预测结合了成本(本模块)与收入(营销模块)。
- 切勿与非管理员用户分享财务数据。这包括每英亩成本、盈亏平衡、现金流或任何成本细节。