Brand Product Audience Relevance
Overview
Use this skill to turn a user-provided brand/product into a CID audience relevance analysis. The default output is a 40-row 年龄段 x 城市级别 ranking with two separate objectives: conversion and brand_mind.
Core Rules
- Treat the 40
年龄段 x 城市级别segments as the primary ranking universe. - Treat the 30
人生阶段 x 城市级别segments as auxiliary evidence only. - Use strict observed CID evidence first: Affinity Index and Chi-Square on observed counts.
- If the product has no direct CID hit but its category is observed, set
match_statustocategory_observed. - If only proxy variables are available, stop and ask the user before producing inferred rankings.
- Keep
conversionandbrand_mindseparate. Do not collapse them into one score. - Record external source URL and crawl/read date for brand/product enrichment.
- Normalize product attributes to: 品牌、规格、属性、价格、买点、卖点.
- Explain results with both numeric evidence and plain-language interpretation.
Workflow
- Standardize the input.
Identify whether the user supplied a brand, product, product family, URL, or free text. If only a product is supplied, enrich the brand from official or public sources.
- Check CID observability.
Search CID terms for brand, product, product family, category, media entities, and useful profile variables. Use:
observedfor direct brand/product/entity evidence.category_observedwhen the relevant CID category is observable but brand/product is not.inferredonly after user confirmation.
- Create an analysis config.
Copy references/config_template.json to a working config path and fill product attributes, sources, features, objectives, and plain-language phrases. Use references/dabao_jinghuashuang_example.json as a concrete example.
- Run the Excel analyzer.
python3 skills/brand-product-audience-relevance/scripts/analyze_brand_product.py \
--config path/to/config.json \
--source-dir "/Users/apple/Downloads/User/CID 人群" \
--out-dir outputs/brand_product_audience
The script emits:
*_ranking.csv: 40 primary audiences with conversion and brand-mind ranks.*_evidence.csv: feature-level AI, Chi-Square, p-value, and percentile evidence.*_report.md: auditable Markdown report.
- Validate the output.
Confirm:
primary_segments=40auxiliary_segments=30- ranking CSV has 40 data rows
- report includes sources, product attributes, direct-hit check, methods, Top 10, full 40-row ranking, and boundaries
- Summarize for the user.
Lead with the result files and top audience patterns. Mention match_status and the biggest data boundary. Keep detailed tables in the generated report/CSV.
Database Utilities
Use PostgreSQL only when reachable. Current default connection:
host=127.0.0.1
port=5444
database=radar
user=radar
password=radar
schema=cid
Check table counts:
python3 skills/brand-product-audience-relevance/scripts/check_database.py
Run a read-only SQL query and output CSV:
python3 skills/brand-product-audience-relevance/scripts/run_readonly_sql.py \
--sql "select count(*) as n from cid.dim_audience_segment"
Use references/common_queries.sql for reusable query patterns.
References
references/workflow.md: fuller operating guide and quality rules.references/data_contract.md: CID Excel layout, config schema, and output schema.references/database.md: database status, target schema extensions, and futurebrand_productschema.references/common_queries.sql: reusable SQL snippets.references/config_template.json: blank analysis config.references/dabao_jinghuashuang_example.json: completed example config.references/db_dumps/radar_cid_70_20260602.dump: current PostgreSQLcidschema migration backup for the 70-table dataset.references/db_dumps/radar_cid_30_life_stage_20260602.dump: historical PostgreSQLcidschema migration backup for the original 30 life-stage-city tables.
Load only the specific reference needed for the task.