margin-analyzer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMargin Analyzer
利润率分析器(Margin Analyzer)
Status: MVP draft · Owner: JJ · Version: 1.1.0 Category: Finance & Ops · Phase: V2
状态: MVP draft(最小可行产品草稿)· 负责人: JJ · 版本: 1.1.0 分类: 财务与运营 · 阶段: V2
Quick start
快速入门
When an SMB owner asks "should I raise my prices?" or "are my margins okay?", this skill:
- Identifies what to analyze — which products/services are in scope
- Pulls cost data from QuickBooks (COGS, direct expenses)
- Pulls revenue data from PayPal or Square (transaction history)
- Computes unit economics — revenue, COGS, gross margin, margin % per item
- Benchmarks against context — inflation, cost changes, industry norms if available
- Builds pricing scenarios — shows what happens to revenue and margin at +5%, +10%, +15% price changes, using historical correlation where data allows
- Presents the analysis — no price recommendation; the owner decides
The output equips the owner to make their own pricing call with real data behind it.
当小企业主询问“我应该涨价吗?”或“我的利润率正常吗?”时,该技能会执行以下操作:
- 确定分析范围——明确纳入分析的产品/服务
- 获取成本数据——从QuickBooks提取销货成本(COGS)、直接费用
- 获取收入数据——从PayPal或Square提取交易历史记录
- 计算单位经济效益——每个产品/服务的收入、销货成本、毛利润、利润率百分比
- 结合背景对标——通胀率、成本变化情况,如有可用数据还会参考行业标准
- 构建定价场景——展示价格上涨5%、10%、15%时,收入和利润率的变化情况;若有历史数据,则利用历史相关性进行计算
- 呈现分析结果——不提供定价建议,由企业主自行决策
输出内容会为企业主提供真实数据支撑,帮助其自主做出定价决策。
Workflow
工作流程
Step 1: Pre-flight check
步骤1:预检查
QuickBooks: Call to verify the industry field is populated. If it's missing or "Unknown", ask: "I need your business category to pull relevant benchmarks. What industry are you in?" Then call .
company-infoquickbooks-profile-info-updatePayPal: No pre-flight needed, but PayPal rate-limits on rapid calls — see .
reference/gotchas.mdNo connectors: Offer CSV upload as a fallback. The skill can work from exported transaction and expense data. The expected CSV schema is in .
reference/csv-schema.mdQuickBooks: 调用接口验证行业字段是否已填写。若字段缺失或显示“Unknown”,则询问用户:“我需要您的业务类别来获取相关对标数据。您所在的行业是什么?”随后调用接口更新信息。
company-infoquickbooks-profile-info-updatePayPal: 无需预检查,但PayPal对频繁调用有限流限制——详情请查看。
reference/gotchas.md无连接可用: 提供CSV上传作为备选方案。该技能可基于导出的交易和费用数据运行。CSV的预期格式请参考。
reference/csv-schema.mdStep 2: Clarify scope
步骤2:明确范围
Ask the owner two questions:
-
"Which products or services do you want to analyze?"
- All of them, or a specific subset?
- If they say "all," confirm the connector has enough data to be meaningful before pulling everything.
-
"What metric matters most to you?"
- Gross margin (revenue minus direct costs)?
- Net margin (after all expenses)?
- Revenue per unit?
- Their answer shapes how you present the output.
向企业主询问两个问题:
-
“您希望分析哪些产品或服务?”
- 全部产品/服务,还是特定子集?
- 若用户选择“全部”,在提取所有数据前需确认连接器拥有足够的有效数据。
-
“您最关注哪项指标?”
- 毛利润(收入减去直接成本)?
- 净利润(扣除所有费用后)?
- 单位收入?
- 用户的回答将决定分析结果的呈现方式。
Step 3: Pull cost data (QuickBooks)
步骤3:提取成本数据(QuickBooks)
Fetch from QuickBooks using :
profit-loss-quickbooks-account- Date range: Last 12 months (or full history if less is available)
- Extract: Cost of goods sold by product/service line, direct expenses
If QuickBooks isn't connected, ask the owner for:
- A cost breakdown by product/service line (materials, labor, direct delivery costs per item)
- Any known cost changes in the last 6–12 months
If QuickBooks is connected but COGS = $0 across all periods, do not use $0 as the cost input. Surface this to the owner:
"QuickBooks shows no cost of goods sold recorded for this period. To compute meaningful margins, I need a cost breakdown by product or service line — not a single average for the whole business. For each item you want analyzed, what does it cost you to deliver it? Materials, direct labor, any direct expenses per item. Even rough figures work."
Flag this limitation in the Data Quality Notes section of the final output.
通过接口从QuickBooks获取数据:
profit-loss-quickbooks-account- 时间范围: 过去12个月(若可用数据不足,则取全部历史数据)
- 提取内容: 按产品/服务线划分的销货成本、直接费用
若未连接QuickBooks,则向企业主询问:
- 按产品/服务线划分的成本明细(每件产品/服务的材料、人工、直接配送成本)
- 过去6-12个月内已知的成本变化情况
若已连接QuickBooks,但所有时间段的销货成本均为0,则不得将0作为成本输入值。需向企业主说明:
“QuickBooks显示该时间段内未记录销货成本。为了计算有意义的利润率,我需要按产品或服务线划分的成本明细——而非整个业务的单一平均成本。对于您希望分析的每个项目,您交付它的成本是多少?包括材料、直接人工以及每件产品的任何直接费用。即使是粗略估算也可以。”
在最终输出的“数据质量说明”部分标注该限制。
Step 4: Pull revenue data (PayPal / Square)
步骤4:提取收入数据(PayPal / Square)
Fetch from (PayPal) or (Square):
list_transactionsmake_api_request- Date range: Match the cost data window (last 12 months)
- Extract: Transaction amount, item/service name, date, quantity if available
If you hit PayPal rate limits, pause 30 seconds and retry once. If still blocked, offer: "PayPal is temporarily rate-limited. Want to switch to Square or upload a CSV instead?"
If only one data source is available, note the limitation in the output.
通过(PayPal)或(Square)接口获取数据:
list_transactionsmake_api_request- 时间范围: 与成本数据的时间范围一致(过去12个月)
- 提取内容: 交易金额、项目/服务名称、日期、可用的数量信息
若触发PayPal限流,则暂停30秒后重试一次。若仍被限制,则提供备选方案:“PayPal暂时触发了限流。是否切换为Square或上传CSV文件?”
若仅有一种数据源可用,需在输出中注明该限制。
Step 5: Compute unit economics
步骤5:计算单位经济效益
For each product/service in scope, calculate:
| Metric | Formula |
|---|---|
| Revenue | Sum of transaction amounts for the item |
| COGS | Cost data from QB or owner-provided |
| Gross Profit | Revenue − COGS |
| Gross Margin % | (Gross Profit ÷ Revenue) × 100 |
| Units Sold | Count of transactions (if available) |
| Revenue per Unit | Revenue ÷ Units Sold |
| Cost per Unit | COGS ÷ Units Sold |
Flag any item where margin is below 20% — not as a recommendation, but as a data point worth the owner's attention.
对每个纳入分析范围的产品/服务,计算以下指标:
| 指标 | 计算公式 |
|---|---|
| 收入 | 该项目所有交易金额的总和 |
| 销货成本(COGS) | 来自QuickBooks或企业主提供的成本数据 |
| 毛利润 | 收入 − 销货成本 |
| 毛利率百分比 | (毛利润 ÷ 收入) × 100 |
| 销量 | 交易数量(若可用) |
| 单位收入 | 收入 ÷ 销量 |
| 单位成本 | 销货成本 ÷ 销量 |
若某项目的利润率低于20%,需标注该数据点——并非作为建议,而是提醒企业主关注该情况。
Step 6: Benchmark
步骤6:对标分析
Layer in context to make the numbers meaningful:
- Inflation: Note relevant cost trends if discussing input cost increases. Example: "Your input costs rose ~X% over this period while your prices held flat — that compressed margin by Y points."
- Industry benchmarks: Use the QuickBooks industry profile to surface rough gross margin norms for their category. See .
reference/industry-benchmarks.md - Historical comparison: If 24+ months of data is available, compare this year's margins to last year's to surface the trend direction.
Handle low-data gracefully: if fewer than 6 months of transactions exist, omit the elasticity section and note: "You need at least 6 months of pricing history to estimate how volume responds to price changes. I'll show scenario math instead."
结合背景信息让数据更具参考价值:
- 通胀率: 若讨论投入成本上涨,需注明相关成本趋势。示例:“在此期间,您的投入成本上涨了约X%,但价格保持不变——这导致利润率压缩了Y个百分点。”
- 行业对标: 利用QuickBooks的行业档案,展示该类别大致的毛利率标准。详情请查看。
reference/industry-benchmarks.md - 历史对比: 若有24个月以上的数据,可将本年度利润率与上一年度进行对比,展示趋势方向。
若数据不足需灵活处理:若交易记录不足6个月,则省略弹性分析部分,并注明:“您需要至少6个月的定价历史数据来估算销量对价格变动的反应。我将为您展示场景计算结果。”
Step 7: Pricing scenarios
步骤7:定价场景
Build a table for each product/service showing three price-change scenarios:
| Scenario | New Price | Projected Revenue* | Gross Margin % |
|---|---|---|---|
| +5% | $X | $Y | Z% |
| +10% | $X | $Y | Z% |
| +15% | $X | $Y | Z% |
How to compute projected revenue:
- If 6+ months of history: Estimate volume response using historical data. If a past price change exists, compute observed elasticity: . Apply that to project volume at the new price.
Elasticity = % change in volume ÷ % change in price - If insufficient history: Show three volume assumptions (−0%, −5%, −10%) and let the owner pick what seems realistic.
Add a note: "These are projections based on available data, not guarantees. Actual volume response depends on competition, customer sensitivity, and timing."
为每个产品/服务构建表格,展示三种价格变动场景:
| 场景 | 新价格 | 预计收入* | 毛利率百分比 |
|---|---|---|---|
| +5% | $X | $Y | Z% |
| +10% | $X | $Y | Z% |
| +15% | $X | $Y | Z% |
预计收入计算方式:
- 若有6个月以上历史数据: 利用历史数据估算销量反应。若存在过往价格变动记录,计算观察到的弹性系数:。将该系数应用于新价格,预测销量。
弹性系数 = 销量变化百分比 ÷ 价格变化百分比 - 若历史数据不足: 展示三种销量假设(−0%、−5%、−10%),让企业主选择符合实际情况的假设。
添加备注:“这些是基于可用数据的预测,而非保证。实际销量反应取决于竞争情况、客户敏感度和时机。”
Step 8: Present the analysis
步骤8:呈现分析结果
Structure the output as:
Structure the output with an H2 header showing the business name and date range,
followed by four sections: a Unit Economics Summary table (product/service,
revenue, COGS, gross margin, margin %), a Context and Benchmarking section
(2-4 sentences on inflation, cost shifts, industry norms), Pricing Scenarios
(scenario table per product, or top 3-5 if many), and Data Quality Notes
(flag any limitations such as partial data, missing COGS, or short history).
Keep it factual. Do not say "you should raise prices" or "consider lowering your price." The owner is looking at data to make their own call.
输出结构如下:
以显示企业名称和时间范围的H2标题开头,随后分为四个部分:单位经济效益汇总表(产品/服务、收入、销货成本、毛利润、利润率百分比)、背景与对标分析部分(2-4句话介绍通胀率、成本变动、行业标准)、定价场景(每个产品的场景表格,若产品较多则展示前3-5个)、数据质量说明(标注任何限制,如数据不全、缺失销货成本或历史数据过短)。
保持内容客观。不得出现“您应该涨价”或“考虑降价”这类表述。企业主需要基于数据自主决策。
Scope boundary
范围边界
This skill surfaces data. It does not recommend a price.
If the owner asks "so what should I do?" — respond with: "I can show you what the data suggests, but the pricing decision is yours. Would you like me to model any additional scenarios?"
This is intentional. Pricing decisions have real business consequences and depend on context only the owner knows (competitive positioning, customer relationships, cash needs). The skill's job is to make sure they're looking at real numbers when they decide.
该技能仅展示数据,不提供定价建议。
若企业主询问“那我该怎么做?”,应回复:“我可以向您展示数据所呈现的情况,但定价决策由您自己做出。是否需要我模拟更多场景?”
这是有意设定的规则。定价决策会对业务产生实际影响,且依赖只有企业主才了解的背景信息(竞争定位、客户关系、现金流需求)。该技能的作用是确保企业主在决策时参考真实数据。
Connectors
连接器
Primary: QuickBooks, PayPal
Also supported: Square, Brex · Desktop (CSV/export)
主要连接器: QuickBooks、PayPal
支持的其他连接器: Square、Brex · 桌面端(CSV/导出文件)
Reference files
参考文件
- — common pitfalls (data gaps, elasticity traps, margin math errors)
reference/gotchas.md - — gross margin ranges by SMB category
reference/industry-benchmarks.md - — expected columns when the owner uploads a CSV
reference/csv-schema.md - — worked scenarios (retail, services, product-based)
reference/examples/
- —— 常见问题(数据缺口、弹性分析陷阱、利润率计算错误)
reference/gotchas.md - —— 小企业各品类毛利率范围
reference/industry-benchmarks.md - —— 企业主上传CSV时的预期列格式
reference/csv-schema.md - —— 已完成的场景案例(零售、服务、产品型业务)
reference/examples/