CCDB Factor Search
by @fly5661
CCDB碳因子查询与匹配。Find and select the best-fit CCDB carbon / emission factor for PCF, LCA, carbon accounting, ESG, and supply-chain work — not just a raw search r...
clawhub install ccdb-factor-search📖 About This Skill
name: ccdb-factor-search description: CCDB碳因子查询与匹配。Find and select the best-fit CCDB carbon / emission factor for PCF, LCA, carbon accounting, ESG, and supply-chain work — not just a raw search result list. Supports 碳因子 / 排放因子 / 碳足迹因子 / emission factor / carbon factor / ecoinvent / ecoinvent factor / ecoinvent 因子 / 因子匹配 / 选因子 / LCA因子 / PCF因子 / scope 3 因子 / BOM因子匹配. Covers a broad range of factor sources across China and international datasets, including ecoinvent-related records and other mainstream public or institutional sources. Also activate proactively when 产品碳足迹计算 / LCA建模 / 碳核算 / 供应链排放测算 clearly need factor data even if the user did not explicitly say "查因子".
CCDB Factor Search
Find the best-fit CCDB emission factor for carbon footprint, PCF, LCA, and carbon accounting work — not just a raw result list.
This skill is built for the real business question:
> Which factor should I actually use?
It searches in Chinese + English, compares candidates, filters weak matches, explains risks, and returns a recommended factor with direct-use guidance.
It is especially useful when the database is broad and the user needs help choosing from domestic + international sources, including ecoinvent and other mainstream institutional datasets.
Why this is better than plain search
What this skill does
It can:
Best-fit use cases
Use this skill when you need to:
Also activate proactively when:
Before vs after
User asks
> 帮我找中国最新全国电力因子。Plain search might return
This skill returns
Very short examples
How to invoke
Natural-language examples
查询最新中国全国电力因子帮我找聚酯切片的碳因子,如果中文结果不好就切英文继续找这个因子能不能直接用于正式报告?Compare carbon footprint factor vs emission factor for electricityFind the best CCDB factor for primary aluminium, prefer physical-unit factorScript examples
python3 scripts/query_ccdb.py --auto --user-request "查询最新的中国全国电力因子,单位最好是 kgCO2e/kWh。"
python3 scripts/query_ccdb.py --query "electricity" --lang en --top 5
Typical example prompts
Example 1
> 查询最新的中国全国电力因子,单位最好是 kgCO2e/kWh。Expected behavior:
Example 2
> 帮我找聚酯切片的碳因子,如果中文结果不好就切英文继续找。Expected behavior:
Example 3
> 请帮我找原铝的排放因子,优先物理量单位,不要误选成按金额计算的因子。Expected behavior:
Example 4
> 这个因子能不能直接用于正式报告?Expected behavior:
Standard output example
推荐结果:
匹配等级: close_match
因子名称: 电力
因子值: 0.5777
单位: kgCO2e/kWh
适用地区: 中国
适用年份开始: 2024
适用年份结束: 2024
发布年份: 2024
来源机构: 生态环境部
来源级别: 国家排放因子
使用建议: 建议人工复核后使用风险与注意事项:
- 这是碳足迹因子,不等同于 CO2 排放因子
- 若用于正式核算或核查,请先确认适用口径
Key fields to return when possible
A good result should explain these fields clearly:
Match classes
direct_match → highly aligned, usually safe to use after quick sanity checkclose_match → mostly aligned, should usually be reviewed before formal reportingfallback_generic → usable only as rough estimate / placeholdernot_suitable → should not be used directlyapi_unavailable → no recommendation; retry laterWhat this skill must do
1. Parse the real search intent
Identify as much as possible from the request:2. Search bilingually
For non-trivial factor matching, do not search in only one language. Always try:3. Rank candidates instead of trusting the first hit
Do not judge a factor from one field only. Key ranking dimensions include:name, description, specification)countries)unit)applyYear ~ applyYearEnd)year)institution, sourceLevel)4. Be conservative
Do not force a recommendation when evidence is weak. Prefer:not_suitableapi_unavailableover a misleading confident answer.
5. Explain the choice
The final answer should explain:Key working rules
Carbon footprint factor vs emission factor
These are not always interchangeable.China-first bias for Chinese requests
If:then Chinese candidates should be preferred by default.
Region warning for geo-sensitive factors
For electricity / steam / natural gas queries, if region is missing, surface that clearly as a risk.Latest-factor requests
If the user asks for “最新 / latest”, ranking should prefer more recentapplyYear, not only lexical similarity.No spend-based mismatch
If the user wants a physical activity factor, do not recommend spend-based / monetary-unit factors as if they were equivalent.Implementation notes
scripts/query_ccdb.pyreferences/api-contract.mdreferences/matching-strategy.mdreferences/output-template.mdIf the API contract changes, update the script and references/api-contract.md together.
Keep scoring / filtering logic in code rather than overloading SKILL.md with implementation detail.
Advanced fallback / debugging
Script unavailable fallback
If scripts/query_ccdb.py is missing or fails to run, fall back to a direct API call:
curl -s -X POST https://gateway.carbonstop.com/management/system/website/searchFactorDataMcp \
-H 'Content-Type: application/json' \
-d '{"sign":"","name":"","lang":"zh"}'
The sign is md5("mcp_ccdb_search" + keyword). In Python:
import hashlib, requests
keyword = "电力"
sign = hashlib.md5(("mcp_ccdb_search" + keyword).encode()).hexdigest()
resp = requests.post("https://gateway.carbonstop.com/management/system/website/searchFactorDataMcp",
json={"sign": sign, "name": keyword, "lang": "zh"})
print(resp.json())
Even in fallback mode, apply the same ranking, matching, and output rules defined above. Do not return raw API results without analysis.
Packaging guidance
For public packaging, keep the skill folder lean. Recommended public package contents:
SKILL.mdREADME.md_meta.jsonCHANGELOG.mdscripts/query_ccdb.pyreferences/api-contract.mdreferences/matching-strategy.mdreferences/output-template.mdevals/evals.jsonDraft notes and publishing scratch files should not be included in the final public package.