review-mining-stp
Review Mining STP
Overview
This skill converts review text into Segmentation -> Targeting -> Positioning -> Strategy outputs through a strict workflow contract.
review scoring workflow: reads raw reviews, infers scored items, assigns theory tags, and preserves verbatim review text.scripts: accept scored artifacts only and perform statistical analysis plus report assembly.
The review scoring workflow is an upstream workflow boundary, not a requirement to use any specific API, service, or orchestration tool.
The scripts are tools, not the main workflow. They do not read raw reviews, decide how to score them, or define the scoring process.
When To Use
Use this skill when:
- you need STP outputs from reviews, comments, or feedback text
- you need a repeatable scored-artifact contract before running statistics
- you need segmentation, targeting, or positioning outputs with explicit methods and theory labels
- you need report sections backed by verbatim review quotes instead of unsupported interpretation
Do not use this skill when:
- the task is only qualitative summarization with no scoring and no downstream statistics
- the user only wants raw review tagging with no STP analysis
- the user expects the CLI to ingest raw reviews directly
Theory Framework
Attribute extraction and theory annotation should draw from these four theory families. Additional families may be added when the corpus clearly warrants it, but every attribute must map to at least one family.
1. Product Positioning Theory (product_positioning)
Subtheories:
attributes— physical or verifiable product properties (e.g. ANSI certification, lens material, weight)functions— what the product does in use (e.g. anti-fog, side coverage, UV blocking)benefits— perceived value or outcome the customer gains (e.g. confidence, style, value for money)usage_context_service_experience— context of use, service touchpoints, post-purchase experience
2. Maslow's Hierarchy of Needs (maslow)
Subtheories:
physiological— sensory comfort, physical ease, visual clarity during usesafety— protection from harm, certification compliance, structural durabilitybelongingness— fitting into a community, sports group, or professional identityesteem— status signalling, brand prestige, professional image displayself_actualization— enabling personal performance goals, empowerment, achievement
3. Purchase Motivation Theory (purchase_motivation)
Subtheories:
functional— driven by performance, fit, ergonomics, multi-scenario utilitysecurity— driven by safety standards, brand trust, durability assurance, after-sales protectionrelational— driven by customer service quality, gifting intent, repeat purchase loyalty
4. Word-of-Mouth Motivation Theory (wom_motivation)
Subtheories:
altruistic— sharing to genuinely help other buyers (tips, warnings, balanced reviews)social_identity— sharing to signal group membership (sports community, professional role)self_enhancement— sharing to display expertise or superior knowledgeemotional_expression— sharing driven by strong positive or negative emotion
Attribute Extraction Rules
When extracting attributes from the full corpus:
- Extract at least 30 attributes whenever the corpus supports it.
- Every attribute must be mappable to at least one of the four theory families above.
- Each attribute must carry
theory_annotationslisting all applicable family + subtheory pairs. - Attribute themes are dynamically inferred from the corpus — do not hardcode theme names.
- Freeze the attribute catalog before formal scoring begins.
- Attributes must cover all four theory families. If any family has zero coverage, flag it in
attribute_extraction_summary.theory_gap.
Attribute Discovery Pass — How To Execute
The discovery pass is a dedicated read-through of the full corpus before any scoring begins. Its sole output is the frozen attribute catalog. Execute it in four stages:
Stage 1 — Read all reviews and collect raw signals
Read every review in the corpus. For each review, note any concern, praise, complaint, or observation the reviewer expresses about the product or their experience. Do not score yet. Collect these as raw signals in a working list. Signals can be short phrases or paraphrases — they do not need to be final attribute names yet.
Examples of raw signals:
- "fogged up immediately with mask on"
- "arms hooked in my hair every time I removed them"
- "military-grade, Z87 certified"
- "bought three pairs over two years"
- "bought these as a gift for my son"
Stage 2 — Cluster signals into candidate attributes
Group raw signals that represent the same underlying customer concern or product dimension. Each cluster becomes one candidate attribute. Apply these rules:
- One attribute per distinct construct. Do not merge two different concerns just because they co-occur (e.g. "fogging" and "scratching" are separate attributes even if one reviewer mentions both).
- Split an attribute if reviewers clearly treat it as two separate things (e.g. "nose pad comfort" and "nose pad staying in place" may warrant two attributes if complaints differ).
- Name each attribute with a short noun phrase that a non-specialist can understand. Use the language reviewers actually use, not academic terminology.
- Count how many reviews contributed signals to each cluster — this becomes
mention_count.
Stage 3 — Map every attribute to the four theory frameworks
For each candidate attribute, assign theory_annotations by working through all four theory families in order:
product_positioning — ask: does this attribute describe a physical property (attributes), a functional capability (functions), a perceived benefit or outcome (benefits), or a usage context / service touchpoint (usage_context_service_experience)? Assign all that apply.
maslow — ask: which need does concern about this attribute reflect?
physiological: physical sensation, visual comfort, weight, pressure on facesafety: protection level, certification, structural durability, after-sales securitybelongingness: fitting into a community, professional group, sport teamesteem: brand status, professional image, visible identityself_actualization: enabling personal goals, performance achievement, empowerment
purchase_motivation — ask: what drives someone to care about this at the point of purchase?
functional: performance, fit, ergonomics, multi-use utilitysecurity: standards compliance, brand trust, warranty, durability assurancerelational: customer service, gifting intent, loyalty and repeat purchase
wom_motivation — ask: why would a reviewer write about this attribute?
altruistic: to warn or help other buyerssocial_identity: to signal membership in a group (sport, profession, military)self_enhancement: to display expertise or superior product knowledgeemotional_expression: because strong feeling (delight or frustration) compels them to write
An attribute may carry multiple families and multiple subtheories. There is no maximum. However, every attribute must carry at least one family, and the full catalog must cover all four families.
Stage 4 — Freeze and validate the catalog
Before scoring begins:
- Confirm the attribute count meets the
target_minimum(at least 30 when corpus supports it). - Confirm all four theory families appear at least once across the catalog. If any family is absent, revisit Stage 2 — missing coverage usually means signals were merged incorrectly or a whole class of reviewer concerns was overlooked.
- Assign a stable
attribute_keyto each attribute (snake_case, e.g.anti_fog_performance,hinge_durability). Keys must not change after freezing. - Write the
plain_language_definitionfor each attribute — one sentence describing what the attribute measures and what a high vs low signal looks like in a review. - Select one
example_review_idandexample_quoteper attribute from the raw corpus. The quote must be verbatim. - Record the frozen catalog in
attribute_catalog.csvandreview_foundation.json -> dimension_catalogbefore any scoring row is written.
No attribute may be added, removed, or renamed after the catalog is frozen. If a gap is found during scoring, record it in attribute_extraction_summary.shortfall_reason and complete scoring with the frozen catalog as-is.
Workflow Contract
Review Scoring Workflow
The review scoring workflow is the main process. It is responsible for:
- reading every review one by one
- extracting at least 30 important attributes from the full review set whenever the corpus supports it
- freezing the attribute catalog before formal scoring begins
- inferring scored items from the full review set
- assigning each item to dynamic themes inferred from the full review set
- attaching theory metadata at both family and subtheory level — exclusively from the four permitted families
- keeping a paired salience and product-quality scoring plan for every inferred attribute
- preserving the original
review_textso later report evidence can quote the real source text
Theme names and theme count are not fixed. They come from the corpus, not from a hardcoded taxonomy.
Two Scoring Axes
This skill uses two distinct scoring axes applied to different units of analysis:
Axis A — Customer × Attribute: Salience (0–7)
Applied per review (or per customer). Measures how prominently the attribute features in a given review.
0: the attribute is absent from the review — no relevant content at all1–3: the attribute is mentioned slightly or indirectly4: the review is neutral, ambiguous, or tangential on this attribute5–6: the review clearly and explicitly addresses this attribute7: the review strongly emphasises this attribute as a central concern
Dependency rule: when salience = 0, the attribute is treated as absent for this review and must not be included in any per-review analysis. Only reviews with salience ≥ 1 are counted as mentioning the attribute.
Axis B — Product × Attribute: Quality Score (0–10)
Applied per product (aggregated across all reviews for that product). Measures the overall quality or performance of the product on this attribute as judged by its reviewers.
0: extremely poor — near-universal negative evaluation1–3: below average — more negative than positive mentions4: below average leaning negative — complaints outweigh praise5: mixed or neutral — roughly equal positive and negative signals6–7: above average — more positive than negative, with some complaints8–9: strong — predominantly positive, only minor issues noted10: exceptional — near-universal praise with no notable complaints
This score is a product-level aggregate, not a per-review score. It is computed or estimated after all reviews for a product have been read, and represents the overall quality positioning of the product on that attribute.
Column naming:
- Per-review salience:
<attribute_key>_salience - Product-level quality:
<attribute_key>_quality
Scoring Workflow Steps
- Read each review one by one.
- Run an attribute-discovery pass across the full corpus.
- Freeze the attribute catalog with definitions, theory annotations (from the four permitted families only), and paired score-column names.
- Score every review against the frozen attribute catalog using Axis A (salience 0–7).
- After reading all reviews per product, compute Axis B (quality 0–10) per product per attribute.
- Convert qualitative review text into quantitative data on both axes.
- Use the scored output for downstream statistical analysis and research models.
If upstream information is incomplete, the review scoring workflow may produce MissingDataOutput.
Scripts
The scripts start only after scoring is already complete. Their responsibilities are:
- schema and numeric sanity checks for scored artifacts
- reliability checks
- factor or theme reduction
- clustering for segmentation
- ANOVA / regression for continuous targeting outcomes
- chi-square / logistic regression for binary targeting outcomes
- perceptual-map generation
- ideal-point distance analysis
- pairwise competition-distance analysis
- report assembly with explicit methods, theory labels, and evidence quotes
The scripts do not:
- infer items from raw review text
- define the scoring rubric
- enforce the wording of the scoring process
- change the attribute catalog during statistical execution
- rewrite review quotes
- auto-backfill missing scored artifacts
If prerequisites are missing, the scripts return MissingPrerequisiteOutput.
Canonical Input Artifacts
review_scoring_table.csv
Required columns:
review_idunit_idbrandproductreview_text
All inferred attributes must appear as salience columns (Axis A, per review):
<attribute_key>_salience
Each salience column must follow these rules:
- integer scores only, range
0–7 0means the attribute is absent from this review
Optional metadata columns may include:
profile_*channelrating
The table is per-review. If no stable person-level identity exists, unit_id may default to review_id.
product_quality_scorecard.csv
New artifact replacing the per-review valence axis. Required columns:
productbrandn_reviews— number of reviews used to compute the scores- One
<attribute_key>_qualitycolumn per attribute (Axis B, 0–10)
This is the product × attribute quality matrix. Each cell is the product-level quality score for that attribute, estimated from all reviews of that product.
review_foundation.json
Required keys for the scripts:
dimension_catalogtheme_mappingattribute_extraction_summarypeople_insightsproduct_triggerscontext_scenariossystem1_system2_splitmaslow_keywords
Optional audit metadata:
scoring_rubric
Each dimension_catalog item must include:
columnlabelthemeattribute_groupsalience_columnquality_columnstat_rolesplain_language_definitiontheory_annotations
attribute_group must use one of:
attribute_functionbenefit_usebrand_personalitybrand_image
theory_annotations must map each scored item to at least one theory family plus subtheory. The four default families for this skill are:
product_positioning(subtheories:attributes,functions,benefits,usage_context_service_experience)maslow(subtheories:physiological,safety,belongingness,esteem,self_actualization)purchase_motivation(subtheories:functional,security,relational)wom_motivation(subtheories:altruistic,social_identity,self_enhancement,emotional_expression)
Additional theory families may be used when the corpus clearly calls for them. Any added family must be documented in review_foundation.json with its name, rationale, and subtheory list.
attribute_extraction_summary must record:
target_minimumactual_countshortfall_reasontheory_gap— list any of the four theory families with zero attribute coverage
attribute_catalog.csv
Required columns:
attribute_keylabelthemeattribute_groupdefinitionsource_typemention_countsalience_columnquality_columnexample_review_idexample_quotetheory_families— comma-separated list of applicable theory families from the four permittedtheory_subtheories— comma-separated list of applicable subtheories
The catalog is the script-facing bridge from upstream attribute extraction into downstream statistics and report evidence.
Auto-Discovered Context Files
analysis_context.jsonanalysis_goalcomparison_axesscope_limits
brands.jsonideal_point.json
Run Modes
full: starts from canonical scored artifacts and emits the three statistical intermediatesfullcanonical input requiresreview_scoring_table.csv + product_quality_scorecard.csv + review_foundation.json + attribute_catalog.csv + analysis_context.json + brands.json + ideal_point.jsonsegmentation: usesreview_foundation.json + segmentation_variables.csvtargeting: usessegment_profiles.json + targeting_dataset.csvpositioning: usespositioning_scorecard.csv + brands.json + ideal_point.jsoncustom: runs only requested downstream modules
Generated intermediate artifacts in full mode:
segmentation_variables.csvtargeting_dataset.csvpositioning_scorecard.csv
Statistical Rules
Segmentation
- standardize
saliencecolumns (Axis A) across reviews to identify customer concern patterns - use
factor_analysis -> K-means - rerun when any cluster falls below the
>5%guardrail - record
cluster_threshold,reruns_performed, andfinal_k - retain
System 1 / System 2, Maslow, cluster share, and consumer-portrait outputs
Targeting
- resolve current and potential targeting variables from
dimension_catalog.stat_roles - allow
analysis_context.comparison_axesto override the default comparison axes - model
saliencecolumns (Axis A) as customer-side drivers - model
qualitycolumns (Axis B) as product-side performance indicators - use
ANOVA / regressionfor continuous outcomes - use
chi-square / logistic regressionfor binary outcomes - emit
pairwise_comparison_tablewhen ANOVA significance justifies post-hoc comparison - emit
priority_segments,secondary_segments, anddeprioritized_segments
Positioning
- build the scorecard from
stat_rolescontainingpositioning - use
qualitycolumns (Axis B) fromproduct_quality_scorecard.csvas the primary product positioning features - cross-reference with
saliencecolumns (Axis A) to weight attributes by customer concern level - default to
factor_analysis - allow
MDSwhen similarity-based input is explicitly requested - include ideal-point distance and pairwise competition distance
- draw the perceptual map as a Python-generated figure from the coordinate table
- treat
perceptual_map_figure + perceptual_map_coordinate_table + perceptual_map_method + perceptual_map_interpretationas the public positioning-map contract - allow factor-analysis-only vector and projection diagnostics as optional internal outputs
- never fabricate attribute vectors for
MDS - emit
dynamic_scorecard_summarywith distance, gap, reliability, and validity sections
Report Contract
The final report must contain an Attribute Extraction Summary that shows:
target_minimumactual_countshortfall_reasontheory_gap— any of the four theory families with zero coverage- discovered themes
- attribute-group counts
- theory family and subtheory coverage breakdown
- representative attributes with real example quotes
Each major report section must contain:
What this section is doingAxis modeling summary— specify whether Axis A (salience), Axis B (quality), or both are usedStatistical methods usedTheories used— must name specific families and subtheories from the four permittedTheme coverage summaryTheory coverage summaryPlain-language explanationEvidence quotes
Each major report section must also contain a non-empty findings list.
Each finding must contain:
finding_idfinding_statementbusiness_implicationaxes_used—salience,quality, or bothmethods_usedtheories_usedthemes_usedsubtheories_usedreproducibilitystatistical_resultsplain_language_explanationevidence_quotes
Each reproducibility package must contain:
input_artifactsinput_columnsfilterspreprocessinganalysis_stepsdecision_rule
Each statistical_results package must contain:
method_familytest_or_modelsample_sizestatisticdegrees_of_freedomp_valueeffect_sizecoefficientconfidence_intervalresult_directionaxis_breakdown
Evidence-quote rules:
- quotes must come verbatim from
review_scoring_table.csv.review_text - each quote must include
review_id - each quote must explain why it matters
- each quote must link back to the scored items it supports
- when canonical review evidence is available, each major section should include 2-3 quotes
- when canonical review evidence is available, each finding should include at least 1 quote
The goal is to make the report readable for non-specialists while keeping every key claim traceable to real review text and reproducible from the emitted statistical artifacts.
The final report should visibly show:
- the dynamically inferred themes for this corpus
- which findings use which themes
- theory families plus subtheories — drawn exclusively from the four permitted families
- which subtheories are
not_evidencedin the current dataset
Hard Rules
- Never blur review-scoring inputs with script-ready artifacts.
- Never let scripts consume raw reviews directly.
- Never hardcode a fixed item count into the validator or statistical pipeline.
- Always use
productas the product field name. - Axis A scoring (customer × attribute): always use
salience 0–7. - Axis B scoring (product × attribute): always use
quality 0–10. - Never use
valenceas a column name — it is replaced byqualityin this skill. - Always preserve verbatim
review_textfor evidence quoting. - Always state the statistical method and theory used in each major report section.
- Always show how Axis A and Axis B were modeled in each major report section.
- Always show dynamic theme coverage and theory coverage in the report body.
- Always show the attribute-extraction summary and representative attributes in the report body.
- Always attach reproducibility steps and statistical results to each finding.
- Never fabricate evidence quotes or attribute vectors.
- Theory annotations default to the four built-in families:
product_positioning,maslow,purchase_motivation,wom_motivation. Additional families may be introduced when the corpus clearly warrants it, provided they are documented with name, rationale, and subtheory list inreview_foundation.json. - Every attribute must be covered by at least one theory family. Attributes with no theory mapping must be flagged and reconsidered.
References
- references/01-router-and-gates.md
- references/02-segmentation.md
- references/03-targeting.md
- references/04-positioning.md
- references/05-output-contract-and-quality-rules.md
- references/06-end-to-end-examples.md
- references/07-traceability-evidence-matrix.md
- references/08-verification-scenarios.md
Scripts
- Install dependencies:
python -m pip install -r requirements.txt - Run analysis:
python scripts/run_review_mining_stp.py --run-mode <mode> --input-dir <artifacts> --output-dir <o> - Validate outputs:
python scripts/validate_review_mining_stp.py --run-mode <mode> --output-dir <o> - Script boundary: statistical analysis only; raw reviews must first be converted into scored artifacts during the review scoring workflow
More from timlai666/skills
investment-research-prompts
Use when the user needs stock screening, portfolio risk review, dividend portfolio design, pre-earnings analysis, industry competition analysis, DCF valuation, technical analysis, or stock trend/anomaly detection. Trigger on requests like 選股, 投資組合風險, 股息策略, 財報前瞻, DCF 估值, 技術面分析, 產業競爭研究, 趨勢識別, or investment research prompts.
22landing-page-studio
Use when creating high-conversion landing pages with modern visual effects, including SVG/WebGL animation, autonomous multi-iteration optimization, and dual output modes (single-file HTML or React project). Trigger on requests like landing page, LP, hero section build, animated marketing page, conversion page redesign, or style variants A-L/custom.
17bcg-growth-share-matrix
Use when analyzing a group, business-unit, product-line, or brand portfolio with the BCG growth-share matrix, especially when the task involves relative market share, market growth, quadrant classification, capital allocation, portfolio prioritization, or deciding whether to invest, maintain, harvest, reposition, or exit.
17data-analysis-workflow
Use when planning or executing a full data analysis workflow, including schema inspection, data quality audit, data cleaning, EDA, relationship analysis, feature engineering, modeling, evaluation, and report generation. Trigger on requests like 資料分析流程, EDA 到建模, 數據分析規劃, 分析報告產出, or end-to-end analytics workflow.
16psychological-trigger-marketing
Use when generating high-conversion marketing angles, campaign hooks, landing page messaging, promotional copy directions, social post hooks, or CTA concepts with psychological triggers such as FOMO, justification, desire, priming, anchoring, and framing, especially for offers, launches, limited-time promotions, and Traditional Chinese marketing for Taiwan audiences.
16service-innovation-workshop
Use when turning a service innovation problem into concept options, prototype testing, and risk checks, especially for 服務創新, 創新機會, 價值共創, 服務原型, SCAMPER, 購買者效用矩陣, 創新流程, 創新困境, or 服務體驗工程. Trigger when the task asks for practical innovation directions, concept generation, opportunity framing, or validation planning rather than only concept definitions.
16