对照两条路径的市场规模估算
market_sizer.py 分别从已知市场总额、潜在客户数 × 年度价格出发计算 TAM、SAM、SOM。传入 --method both 后会报告 TAM 差异,并标出超过所选市场类型容差的结果。
Alireza Rezvani 的开源 Market Research Skill,用本地 Python 工具估算市场规模、规划问卷样本,并为客户细分评分。先在 Claude Code、Codex 或 OpenClaw 中安装完整 Skill 文件夹,再提供研究数据。
准备进入新品类、拓展客群或进入新市场时,可以先用它整理证据。流程从研究简报开始,分别用自上而下和自下而上的方法估算总市场、可服务市场和可获得市场(TAM、SAM、SOM);需要一手调研时,再规划问卷配额,最后评估候选细分市场。它提供计算脚本和研究方法,市场数据、来源检查和商业决策仍由团队负责。
market_sizer.py 分别从已知市场总额、潜在客户数 × 年度价格出发计算 TAM、SAM、SOM。传入 --method both 后会报告 TAM 差异,并标出超过所选市场类型容差的结果。
sample_size_planner.py 对总体样本量做有限总体修正,再计算细分人群最低样本量和配额。细分下限使用未修正公式,各组配额之和可能高于总体样本要求。
segmentation_scorer.py 对你提供的可衡量性、规模、可触达性、差异性和可执行性评分加权,输出 TARGET、WATCH 或 DROP。规模或触达门槛未通过时,其他维度再高也会判为 DROP。
文件包包含三份研究参考资料、一份简报模板和配置工具。六个 Python 文件使用标准库;可选的 autoresearch 评估器独立于三个核心分析工具。
使用具备本地文件和终端权限的 Claude Code、Codex 或 OpenClaw,并准备 Git 与 Python 3。已检查的脚本只导入标准库;核心计算无需 pip 依赖、API Key 或店铺连接。
保留同一目录下的 SKILL.md、scripts/、references/ 和 assets/。只把指令贴进聊天框,会缺少指令调用的工具。如果已经安装 market-research,替换前先备份本地修改。
参照脚本内的 SAMPLE 对象准备 market.json、survey.json 或 segments.json。写明地区、年份、币种、客户数、年度支出及每项假设的证据。随包示例是假设的 B2B SaaS 数据。
使用作者提供的 --skill 安装器,固定到已核对的提交。在 macOS、Linux 或 WSL 终端执行。默认复制到 ~/.codex/skills/market-research,并替换同名安装;CODEX_SKILLS_DIR 可改变目标目录。
git clone https://github.com/alirezarezvani/claude-skills.git
cd claude-skills
git checkout 6d2f02ea077eead1bee5411a31bcc6db5a11a70c
./scripts/codex-install.sh --skill market-research下方保留完整英文 SKILL.md 原文。这只是 11 个文件组成的 Skill 包中的一个文件,复制正文不会安装脚本、参考资料或模板。中文说明和启动提示词由 EcomAgentTools 根据源码编写。
2026 年 10 月 25 日核对仓库提交 6d2f02ea077e。该 Skill 声明版本为 2.9.0,Research Ops 插件声明版本为 2.14.1。本次检查了源码和脚本,未实测安装或 Agent 执行。GitHub 星标与 Fork 数属于整个 claude-skills 仓库。
查看已核对的源码 · MIT · © 2025 Alireza Rezvani
MIT License Copyright (c) 2025 Alireza Rezvani Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
name: market-research
description: Use when doing upstream market-research methodology — sizing a market as TAM/SAM/SOM computed BOTH top-down and bottoms-up (never a single unsourced number), planning a survey sample size with finite-population correction and per-segment minimums, or scoring candidate market segments against Kotler's measurable/substantial/accessible/differentiable/actionable criteria. Outputs always show the method and the assumptions. For market-research analysts and product-marketing at the sizing/survey/segmentation moment. Distinct from marketing-skill (campaign analytics, attribution, demand-gen) — this is the evidence-building methodology, not live-campaign optimization.
license: MIT
metadata:
version: 2.9.0
author: claude-code-skills
tags: [research-ops, market-research, tam-sam-som, market-sizing, survey, sampling, segmentation, competitive-intelligence]
compatible_tools: [claude-code, codex-cli, cursor, antigravity, opencode, gemini-cli]
---
# market-research
Upstream market-research methodology: market sizing, survey/sampling design, and segmentation. The discipline here is **method + assumptions**: a TAM is never a single number, a survey is never powered only in aggregate, and a segment is never a demographic slice.
## Purpose
Market-research analysts, product marketers, and strategy teams need rigorous evidence *before* anyone optimizes a campaign or sets a strategy. This skill structures three methodology decisions:
Three deterministic tools:
1. `market_sizer.py` — Computes TAM/SAM/SOM by **both** top-down and bottoms-up methods side-by-side, reports the divergence, and flags failed triangulation. Never returns a single number.
2. `sample_size_planner.py` — Survey sample size from confidence, margin of error, and expected proportion, with the finite-population correction and **per-segment minimums** (a survey powered overall is not powered per reported segment).
3. `segmentation_scorer.py` — Scores candidate segments against Kotler's five criteria and enforces a substantiality + accessibility gate; a slice that is too small or unreachable is dropped.
## When to use
Invoke this skill when:
- A board or exec asks "how big is this market?" and you need a defensible, triangulated answer.
- You are fielding a survey and need a sample size that holds up per segment, not just overall.
- You have a list of candidate segments and need to know which are real markets vs demographic slices.
- You are synthesizing competitive intelligence and need a methodological backbone.
**Do NOT use this skill to**: measure a live campaign (attribution, ROAS, CPA → `marketing-skill/campaign-analytics`), build demand-gen / paid-media plans (`marketing-skill/marketing-demand-acquisition`), set positioning / GTM strategy (`marketing-skill/marketing-strategy-pmm`), or set pricing (`commercial/pricing-strategist`).
## Workflow
1. **Write the brief** — Fill `assets/market_research_brief_template.md` (objective, the decision this informs, sizing approach, sampling plan, assumptions register).
2. **Size the market** — Run `market_sizer.py --input market.json --method both --profile {b2b-saas|consumer|enterprise|marketplace|hardware|services}`. Reconcile the top-down/bottoms-up delta before quoting anything.
3. **Plan the survey** — Run `sample_size_planner.py --input survey.json`. Fund the per-segment floors, not just the overall n.
4. **Score the segments** — Run `segmentation_scorer.py --input segments.json --profile <same>`. Drop segments failing the substantiality/accessibility gate.
5. **Assemble the evidence pack** — Combine into a brief. Every number carries its method + assumptions + confidence.
## Scripts
| Script | Purpose | Profiles |
|---|---|---|
| `scripts/market_sizer.py` | TAM/SAM/SOM top-down AND bottoms-up + triangulation flag | b2b-saas, consumer, enterprise, marketplace, hardware, services |
| `scripts/sample_size_planner.py` | Survey n + FPC + per-segment minima | n/a (parameter-driven) |
| `scripts/segmentation_scorer.py` | Kotler 5-criteria scoring + gate | b2b-saas, consumer, enterprise, marketplace, hardware, services |
All three: stdlib-only, `--help`, `--sample`, `--output {human,json}`.
## Onboarding & customization
Run the onboarding questionnaire **once before you start** — it captures your defaults so every tool in this skill is pre-configured. Customization is the point: the answers actually change tool behavior.
```bash
python3 scripts/onboard.py # interactive (also: --defaults, --set key=value, --reset)
python3 scripts/onboard.py --show # see the questions + current effective config
```
Answers are saved to `~/.config/research-ops/market-research.json` (global) or `./.research-ops/market-research.json` (`--scope project`) and are read automatically by `config_loader.py`. They set the default market **profile**, the default survey **confidence** and **margin of error**, and the default **sizing method**. CLI flags always override saved config; `RESEARCH_OPS_NO_CONFIG=1` ignores it.
**The four questions:** market profile · survey confidence · margin of error · sizing method.
## Optimize with autoresearch (opt-in)
This skill ships an **isolated, opt-in** bridge to `engineering/autoresearch-agent`. Only when you ask to "optimize" / "reconcile the sizing" / "run a loop" does an autoresearch experiment iteratively reconcile your market model so top-down and bottoms-up triangulate. `scripts/ar_evaluator.py` is the ground-truth evaluator; it prints `tam_divergence: <fraction>` (**lower** is better).
```bash
/ar:setup --domain custom --name tam-triangulation \
--target market.json \
--eval "python3 ar_evaluator.py --target market.json" \
--metric tam_divergence --direction lower
/ar:loop custom/tam-triangulation
```
Isolated: no hard dependency — autoresearch runs only on demand, and the loop edits `market.json`, never the evaluator.
## References
- `references/market_sizing_canon.md` — TAM/SAM/SOM frameworks (Bessemer, a16z); top-down vs bottoms-up; Fermi estimation; market-model conventions; common sizing fallacies.
- `references/survey_methodology.md` — Cochran *Sampling Techniques*; Dillman *Tailored Design Method*; Groves *Survey Methodology*; question-wording bias (Schuman & Presser); AAPOR standards.
- `references/segmentation_and_ci.md` — Kotler segmentation criteria; needs-based vs firmographic; Porter Five Forces; SCIP ethics; Christensen JTBD; conjoint/MaxDiff primer.
## Assumptions
- The sizer reports both methods but cannot validate your inputs — a top-down "1% of a $40B market" is only as good as the cited source and the serviceable fraction.
- Sample-size uses the conservative p=0.5 (maximum variance) unless you supply an expected proportion.
- Segment scores are inputs you provide; the tool enforces the gates and the weighting, it does not gather the underlying evidence.
- Competitive intelligence must follow the SCIP code of ethics — no misrepresentation, no protected information.
## Anti-patterns
- **A single TAM number with no method.** Always triangulate top-down against bottoms-up.
- **Spurious precision.** Size to the decision's tolerance; "$3.7142B" implies a confidence you do not have.
- **Powering only the total.** Each reported segment needs its own sample floor.
- **Leading or double-barreled survey questions.** Pre-test wording against the bias literature.
- **Calling a demographic slice a segment.** It must be substantial AND accessible.
## Distinct from
| Neighbor | Scope | Difference |
|---|---|---|
| `marketing-skill/campaign-analytics` | Attribution, ROAS, CPA, funnel of a live campaign | That **measures spend deployed**; this is **upstream methodology** |
| `marketing-skill/marketing-demand-acquisition` | Demand-gen, paid media, channel mix | That **runs acquisition**; this **builds the evidence** |
| `marketing-skill/marketing-strategy-pmm` | Positioning, GTM, category | That **sets strategy**; this **sizes and segments the market** |
| `commercial/pricing-strategist` | Pricing model + WTP + packaging | That **sets price**; this **sizes the market** |
| `product-research` (sibling) | User/product discovery methods | That studies **users**; this studies **the market** |
## Quick examples
```bash
python3 scripts/market_sizer.py --sample
python3 scripts/sample_size_planner.py --population 62000 --confidence 0.95 --moe 0.05
python3 scripts/segmentation_scorer.py --sample --output json
```
The sample market triangulates a ~$1.47B top-down SAM against the bottoms-up figure and flags the divergence; the segmentation sample drops the "solopreneurs who might want analytics" slice for failing the substantiality and accessibility gates.
## Forcing-question library (Matt Pocock grill discipline)
Walked one at a time by `/cs-grill-research-ops` or the orchestrator. Recommended answer + canon citation per question. Never bundled.
1. **"Is your TAM top-down or bottoms-up — and have you computed it both ways to triangulate?"**
Recommended: both; reconcile the delta before quoting a number.
Canon: Bessemer / a16z market-sizing; Fermi estimation.
2. **"What decision will this market size actually drive — and at what precision does it matter?"**
Recommended: size to the decision's tolerance, not to a spurious-precision number.
Canon: market-model conventions (Gartner/Forrester); decision-driven analysis.
3. **"What's your target margin of error and confidence — and does your sample clear it per segment, not just overall?"**
Recommended: power each reported segment, not only the total.
Canon: Cochran *Sampling Techniques*; AAPOR standards.
4. **"Are your survey questions free of leading and double-barreled wording?"**
Recommended: pre-test the wording; cite the bias source.
Canon: Schuman & Presser; Dillman *Tailored Design Method*.
5. **"Do your segments pass measurable / substantial / accessible / actionable — or are they just demographic slices?"**
Recommended: drop segments that fail substantiality or accessibility.
Canon: Kotler segmentation criteria.
Walk depth-first. Lock 1-2 before opening 3-5. After all are answered, invoke `market_sizer.py` → `sample_size_planner.py` → `segmentation_scorer.py`.
以下是主要功能的用例提示词,可以直接复制使用。
定位文件包,查看四个引导问题,设置市场类型及问卷默认参数。 刚安装完成,或要研究另一类市场时使用。
请使用已安装的 market-research Skill。先定位实际目录,确认 SKILL.md、scripts/、references/ 和 assets/ 均存在。在我的研究项目目录执行 python3 <skill-directory>/scripts/onboard.py --show,依次确认 [PROFILE]、问卷置信水平、误差范围,以及 sizing_method=both,再用 --scope project 保存。后续分析保持在该项目目录执行,以读取相同配置。不要启动 autoresearch。[PROFILE]基于市场输入建立两套估算,解释 TAM 差异后再给出规划区间。 判断某个品类或地区是否值得进一步验证时使用。
请使用已安装的 market-research Skill,根据 [MARKET_JSON] 和 [SOURCES] 研究 [MARKET]。对照 market_sizer.py 的 SAMPLE 检查 top_down、bottoms_up 每个字段,统一地区、年度、币种和比例单位。缺少输入先询问,不接受默认 0。执行 python3 <skill-directory>/scripts/market_sizer.py --input [MARKET_JSON] --method both --profile consumer --output json。并列报告两组 TAM、SAM、SOM、TAM 差异、假设、来源和未解决分歧。不要为缩小差异而修改证据。[MARKET][MARKET_JSON][SOURCES]根据问卷配置计算总体样本量和各组配额。 需要分别报告多个客户群体的问卷结果时使用。
请使用已安装的 market-research Skill 检查 [SURVEY_JSON]:核对 population、confidence、margin_of_error、expected_proportion、segment_moe,以及 segments 中合计为 1 的 population_share。使用 --input 时,把问卷参数写进 JSON;当前版本的命令行 --confidence 和 --moe 不会覆盖文件。执行 python3 <skill-directory>/scripts/sample_size_planner.py --input [SURVEY_JSON] --output json,解释总体有限总体修正、各组下限、建议配额及总和,并检查是否超过各组实际人数。再按 [RESPONSE_RATE] 单独估算邀请人数,指出覆盖和未响应偏差。[SURVEY_JSON][RESPONSE_RATE]按五项标准评分,并查看 TARGET、WATCH、DROP 的判定原因。 候选细分已有需求、规模和获客渠道证据时使用。
请使用已安装的 market-research Skill,根据 [SEGMENTS_JSON] 和 [EVIDENCE] 检查各细分是否具备 measurable、substantial、accessible、differentiable、actionable 五项 0–100 分评分。缺少证据不要编造分数。执行 python3 <skill-directory>/scripts/segmentation_scorer.py --input [SEGMENTS_JSON] --profile consumer --output json。解释加权分数以及规模、触达门槛,并为每个 TARGET 或 WATCH 提出一个 [BUDGET] 内的验证动作;不要把分数当成已确认需求。[SEGMENTS_JSON][EVIDENCE][BUDGET]用随包模板汇总计算结果、来源说明和假设。 团队需要决定推进、试验还是暂缓时使用。
请使用已安装的 market-research Skill 和 assets/market_research_brief_template.md,把 [RESULT_FILES] 整理成支持 [DECISION] 的研究简报。保留两种估算及其分歧,纳入适用的问卷配额、细分判定、公开竞品证据、来源日期、假设清单和信心说明。不适用部分明确标注。区分计算结果与判断,并列出投入预算前仍需补充的证据。[RESULT_FILES][DECISION]市场规模和细分脚本会把部分缺失值按 0 处理;未提供输入文件时,规模估算还可能使用内置样例。正式分析前检查字段,并明确传入 --input。规模报告的人类可读格式固定显示美元符号,使用其他币种时应基于 JSON 输出明确标注。
规划器估算比例调查所需的有效答卷数,不负责发送问卷、招募受访者、修正覆盖或未响应偏差,也不会检查配额是否超过小群体人数。使用 JSON 输入时,要直接修改文件里的问卷参数。
onboard.py 默认写入 ~/.config/research-ops/;使用 --scope project 时写入当前项目。项目配置从进程工作目录读取,覆盖或重置前先检查已有设置。核心计算脚本没有店铺 API 集成。
独立的 autoresearch-agent 集成可以修改 market.json,以缩小 TAM 差异。只安装本 Skill 不会装上该集成。差异缩小不代表来源可靠,应保留原数据并逐项审核假设变更。
可以在聊天中阅读指令,但文档规定的工作流需要完整 Skill 文件夹和本地 Python 执行能力。安装时必须同时保留 scripts、references、assets 和 SKILL.md。
随包计算使用 Python 标准库和本地 JSON 文件,没有店铺 API 集成。Agent 订阅或模型调用费用另计。
不是。research-ops-skills 是包含 Market Research 及其他研究 Skill 的插件。只需要这一项时,可使用手动复制单个文件夹的方式。
2026 年 10 月 25 日核对提交 6d2f02ea077e;该 Skill 声明版本为 2.9.0,所属插件声明版本为 2.14.1。通过市场安装时可能取得更新版本。
市场总额、客户数、问卷参数、细分评分及来源都需要你提供。Skill 负责计算和组织证据,不证明需求成立,也不负责回收问卷。
claude-skills 开源库维护者。Market Research 是其中 Research Ops 集合内的一项 Skill。
内容核验日期:
暂无评论。