Files
market/skills/creditchina-query/SKILL.md
joy1129-com c83f917901 feat(skills): add 6 due-diligence data-source skills (#111)
## Summary

Adds six enterprise due-diligence data-source skills as local built-in
skills (SKILL.md + SKILL.zh-CN.md + catalog-metadata sidecar), per
ADR-038.

| Skill | Category | Risk | Source |
|---|---|---|---|
| baidu-poi-search | data | low | Baidu Map Place API (REST) |
| tianyancha-risk | business | low | Tianyancha risk API (REST) |
| ccgp-gov-procurement | business | medium | ccgp.gov.cn (WebBridge) |
| cnipa-patent-search | business | medium | CNIPA pss-system (WebBridge)
|
| creditchina-query | business | high | creditchina.gov.cn (WebBridge +
ddddocr) |
| multi-source-sentiment | research | medium | Douyin Index/Featured +
WebSearch |

## Changes
- 6 x skills/<id>/{SKILL.md, SKILL.zh-CN.md, catalog-metadata.v1.json}
- builtin-skills.json: 34 -> 40
- manifest.json: totalSkills 63 -> 69
- README.md counts + list

## Security
- Credentials replaced with env-var placeholders (BAIDU_MAP_AK,
TIANYANCHA_TOKEN); verified no secrets in diff

## Validation
- validate-i18n.py: 0 errors (remaining warnings pre-existing repo-wide)
- zh/en heading parity verified; source_hash computed per repo algorithm

Co-authored-by: yi-ge <yi-ge@desirecore.net>
2026-09-03 14:05:58 +08:00

9.6 KiB
Raw Blame History

name, description, version, type, risk_level, status, tags, metadata, market
name description version type risk_level status tags metadata market
creditchina-query 信用中国企业信用信息查询——输入企业名称自动通过图形验证码ddddocr 本地 OCR 100ms返回信用信息行政处罚/失信被执行/行政许可。Use when 用户提到"查信用"、"信用中国"、"行政处罚"、"失信企业"、"企业信用"、"失信被执行人"、"行政许可"、"creditchina"。 1.0.0 procedural high enabled
due-diligence
credit
creditchina
compliance
author updated_at i18n
desirecore 2026-09-03
default_locale source_locale locales zh-CN en-US
en-US zh-CN
zh-CN
en-US
name short_desc description body source_hash translated_by
信用中国查询 浏览器自动化 + ddddocr 本地过验证码,返回企业信用信息 信用中国企业信用信息查询——输入企业名称自动通过图形验证码ddddocr 本地 OCR 100ms返回信用信息行政处罚/失信被执行/行政许可。Use when 用户提到"查信用"、"信用中国"、"行政处罚"、"失信企业"、"企业信用"、"失信被执行人"、"行政许可"、"creditchina"。 ./SKILL.zh-CN.md sha256:ae28ca7a89d99438 human
name short_desc description body source_hash translated_by
Credit China Query Browser automation with local ddddocr captcha solving for enterprise credit records Credit China (creditchina.gov.cn) enterprise credit query — input a company name, automatically pass the graphic captcha (ddddocr local OCR, ~100 ms), and return credit records (administrative penalties / dishonest debtors / administrative licenses). Use when the user asks about enterprise credit, administrative penalties, dishonest-debtor lists, or creditchina. ./SKILL.md sha256:ae28ca7a89d99438 human
icon category maintainer compatible_agents channel required_client_version
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M12 4v16M8 20h8M4 8h16M6.5 8 4 13.5a3 3 0 0 0 5 0L6.5 8Zm11 0L15 13.5a3 3 0 0 0 5 0L17.5 8Z" stroke="#007AFF" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg> business
name verified
DesireCore Official true
latest 10.0.115

Credit China Query

L0: One-Sentence Summary

Input a company name, pass the graphic captcha automatically via Kimi WebBridge plus ddddocr local OCR, and return the enterprise's credit records.

L1: Overview

  • Data source: Credit China (creditchina.gov.cn, guided by NDRC)
  • Auth: graphic captcha (solved locally by ddddocr, ~100 ms)
  • Invocation: Kimi WebBridge + CDP screenshot + ddddocr Python OCR
  • Prerequisites:
    • Kimi WebBridge daemon running
    • Python with ddddocr (pip install ddddocr)
    • Python with Pillow (pip install pillow)

L2: Procedure

1. Navigate to the search page

Write C:\tmp\cc-nav.json:

{
  "action": "navigate",
  "args": {
    "url": "https://www.creditchina.gov.cn/xinyongxinxi/?keyword={company-name-URL-encoded}&scenesVal=default&tableName=credit_xyzx_tyshxydm",
    "newTab": true,
    "group_title": "信用中国查询"
  },
  "session": "creditchina-query"
}
curl.exe -s -X POST "http://127.0.0.1:10086/command" \
  -H "Content-Type: application/json" \
  --data-binary "@C:\tmp\cc-nav.json" --max-time 30

Wait 6 seconds.

2. Confirm the captcha overlay

Write C:\tmp\cc-check.json:

{
  "action": "evaluate",
  "args": {
    "code": "(function(){var v=document.getElementById('vcode');var i=document.getElementById('vcodeimg');return JSON.stringify({vcode:v?v.getBoundingClientRect().width>0:false,vimg:i?i.getBoundingClientRect().width>0:false});})()"
  },
  "session": "creditchina-query"
}

If vcode=true and vimg=true, the captcha overlay is visible — continue.

3. Get the captcha image coordinates

Write C:\tmp\cc-coord.json:

{
  "action": "evaluate",
  "args": {
    "code": "(function(){var img=document.getElementById('vcodeimg');if(!img)return 'no-img';var r=img.getBoundingClientRect();return JSON.stringify({x:Math.round(r.x),y:Math.round(r.y),w:Math.round(r.width),h:Math.round(r.height),dpr:window.devicePixelRatio});})()"
  },
  "session": "creditchina-query"
}

Record x / y / w / h.

4. CDP screenshot of the captcha region

Note

: the WebBridge screenshot action fails intermittently on this site (HTTP 000/400) — always use CDP Page.captureScreenshot with the clip parameter.

Write C:\tmp\cc-shot.json (replace {x} / {y} / {w} / {h}):

{
  "action": "cdp",
  "args": {
    "method": "Page.captureScreenshot",
    "params": {
      "format": "png",
      "clip": { "x": {x}, "y": {y}, "width": {w}, "height": {h}, "scale": 1 }
    }
  },
  "session": "creditchina-query"
}
curl.exe -s -X POST "http://127.0.0.1:10086/command" \
  -H "Content-Type: application/json" \
  --data-binary "@C:\tmp\cc-shot.json" --max-time 40 -o "C:/tmp/cc-cdp-resp.json"

Decode the base64 payload and save the image:

import json, base64
d = json.load(open(r'C:\tmp\cc-cdp-resp.json', encoding='utf-8'))
b64 = d.get('data', {}).get('data', '')
open(r'C:\tmp\cc-captcha.png', 'wb').write(base64.b64decode(b64))

5. ddddocr recognition (~100 ms)

import ddddocr, sys, time
sys.stdout.reconfigure(encoding='utf-8')
ocr = ddddocr.DdddOcr(show_ad=False)
t0 = time.time()
with open(r'C:\tmp\cc-captcha.png', 'rb') as f:
    code = ocr.classification(f.read())
print(f'验证码: {code} ({(time.time()-t0)*1000:.0f}ms)')
open(r'C:\tmp\cc-code.txt', 'w').write(code)

6. Fill and submit the captcha

Write C:\tmp\cc-submit.json (replace {code}):

{
  "action": "evaluate",
  "args": {
    "code": "(function(){var inp=document.getElementById('vcode');if(!inp)return 'no-input';var s=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,'value').set;s.call(inp,'{code}');inp.dispatchEvent(new Event('input',{bubbles:true}));inp.dispatchEvent(new Event('change',{bubbles:true}));for(var el of document.querySelectorAll('button, a, input[type=button]')){if((el.innerText||el.value||'').trim()==='验证'){el.click();break;}}return 'submitted';})()"
  },
  "session": "creditchina-query"
}

Wait 5 seconds.

7. Check the verification result

Write C:\tmp\cc-result.json:

{
  "action": "evaluate",
  "args": {
    "code": "(function(){var t=document.body.innerText||'';if(t.includes('验证码错误'))return '验证码错误';if(t.includes('失效'))return '验证码已失效';return JSON.stringify({hasResult:t.includes('共')||t.includes('条'),textSample:t.slice(0,500)});})()"
  },
  "session": "creditchina-query"
}

Three outcomes:

  • "验证码错误" / "验证码已失效" → retry from step 3 (click 换一张 to refresh)
  • hasResult=true with data → success, go to step 8
  • textSample contains "很抱歉,没有找到您搜索的数据" → captcha passed but the keyword has no match — retry with the full name or a short name

8. Read the search results

{
  "action": "evaluate",
  "args": {
    "code": "(function(){return document.body.innerText.slice(0,1500);})()"
  },
  "session": "creditchina-query"
}

9. Normalized mapping

{
  "query_status": "success",
  "source": "creditchina",
  "company_name": "{company name}",
  "captcha_solved": true,
  "search_result": "有结果 | 无匹配",
  "credit_info": [
    {
      "event_type": "行政处罚 | 行政许可 | 失信被执行 | 守信激励",
      "event_title": "...",
      "event_date": "...",
      "source_url": "...",
      "summary": "..."
    }
  ],
  "timestamp": "2026-08-31T21:00:00+08:00"
}

10. Close the session

{
  "action": "close_session",
  "session": "creditchina-query"
}

Retry Strategy

On captcha failure (wrong/expired), retry automatically up to 3 rounds:

  1. Click 换一张 to refresh the captcha via evaluate
  2. Wait 2 seconds for the new image
  3. Repeat steps 3-6 (screenshot → recognize → submit)

After 3 failed rounds: ask the user to solve the captcha manually once in the browser, then resume — once verified, the browser remembers the state and subsequent queries skip the captcha.

Known Limitations

  • Very short captcha TTL: screenshot-to-submit must stay under ~15 s — use ddddocr locally (~100 ms); cloud OCR (10-30 s round trips) always times out
  • CDP screenshot required: the WebBridge screenshot action fails intermittently here; use CDP Page.captureScreenshot with clip
  • Verification caching: once passed, subsequent searches (navigating to new keyword URLs) return results without another captcha
  • CORS: fetch+FileReader or canvas.toDataURL cannot capture the image (cross-origin taint) — CDP screenshots only
  • Keyword advice: exact full names may return "no data" (the database only covers entities with credit records) — try the full name first, then the short name

Troubleshooting

Problem Cause Fix
412 on direct HTTP WAF blocks non-browser calls always go through WebBridge
Captcha overlay missing keyword param not triggered check the keyword in the URL
Empty CDP screenshot wrong coordinates / scrolled page re-read vcodeimg bounding rect
ddddocr returns empty broken image / recognition failure refresh and retry; confirm screenshot bytes > 3000
Wrong/expired captcha misread / timeout refresh (up to 3 rounds); fall back to manual
"没有找到您搜索的数据" no credit records / keyword mismatch retry with the short name