Skill: phheng/brand-protection-amazon (version 0.1.0)

--- name: brand-protection-amazon version: 1.0.0 description: "Amazon brand protection toolkit. Detect hijackers, counterfeits, and unauthorized sellers. Includes MAP violation monitoring, trademark abuse detection, complaint templates for Brand Registry, and test buy evidence collection guides. No API key required." metadata: {"nexscope":{"emoji":"🛡️","category":"ecommerce"}} --- # Brand Protection — Amazon 🛡️ Protect your brand from hijackers, counterfeits, and unauthorized sellers on Amazon. ## Installation ```bash npx skills add nexscope-ai/eCommerce-Skills --skill brand-protection-amazon -g ``` ## Features - **Hijacker Detection** — Find unauthorized sellers on your listings - **Price Monitoring** — MAP violation alerts - **Counterfeit Signals** — Review-based fake detection - **Trademark Abuse** — Title/keyword infringement detection - **Complaint Templates** — Brand Registry, C&D letters - **Test Buy Guide** — Evidence collection procedure ## Detection Dimensions | Dimension | Method | Risk Level | |-----------|--------|------------| | Hijackers | Seller count monitoring | 🔴 High | | Price Violations | Below MAP detection | 🔴 High | | Counterfeit | Review keyword analysis | 🔴 High | | Trademark | Title pattern matching | ⚠️ Medium | ## Risk Levels | Level | Description | Action | |-------|-------------|--------| | 🔴 High | Immediate threat to brand | Take action within 24h | | ⚠️ Medium | Potential concern | Monitor and investigate | | ✅ Low | Normal activity | Continue monitoring | ## Input Configuration ```json { "brand_name": "YourBrand", "trademark_number": "US12345678", "brand_registry": true, "authorized_sellers": ["A1B2C3D4E5F6G7"], "protected_asins": ["B08XXXXXX1"], "min_price": 29.99 } ``` ## Usage ### Hijacker Detection ```bash python3 scripts/detector.py ``` ### Generate Complaint Templates ```bash # Brand Registry complaint python3 scripts/templates.py complaint # Cease & Desist letter python3 scripts/templates.py cease-desist # Test buy guide python3 scripts/templates.py testbuy ``` ## Output Example ``` 🛡️ Brand Protection Report Brand: YourBrand ASINs Monitored: 5 Analysis Date: 2024-01-15 ━━━━━━━━━━━━━━━━━━━━━━━━ 🔴 HIGH RISK ALERTS ASIN: B08XXXXXX1 ├── 3 unauthorized sellers detected ├── Lowest price: $19.99 (MAP: $29.99) └── Action: File Brand Registry complaint ━━━━━━━━━━━━━━━━━━━━━━━━ ⚠️ COUNTERFEIT SIGNALS Reviews mentioning "fake": 5 Reviews mentioning "not authentic": 2 Recommendation: Order test buy ``` ## Complaint Templates Included | Template | Use Case | |----------|----------| | Brand Registry | Report to Amazon | | Cease & Desist | Direct seller contact | | Test Buy Report | Evidence documentation | | DMCA Takedown | Copyright infringement | ## Action Workflow ``` Monitor Listings ↓ Detect Violation ↓ Collect Evidence (Test Buy) ↓ Generate Complaint ↓ Submit to Amazon / Send C&D ↓ Track Resolution ``` --- **Part of [Nexscope AI](https://www.nexscope.ai/) — AI tools for e-commerce sellers.**

path: scripts/detector.py
content: #!/usr/bin/env python3
"""
Brand Protection Detector - Core Engine
Brand ProtectionDetector - Core Engine

Features:
- Hijacker Detection (Hijacker Detection)
- PriceAbnormalMonitoring (Price Alert)
- CounterfeitIdentify (Counterfeit Detection)
- ImageStolenDetection (Image Theft)
- RiskEvaluate (Risk Assessment)
- Rights protectionRecommendation (Action Recommendations)

Version: 1.0.0
"""

import json
from dataclasses import dataclass, field
from typing import List, Dict, Optional, Any
from enum import Enum
from datetime import datetime
import sys
import re


class RiskLevel(Enum):
    """RiskGrade"""
    LOW = "low"
    MEDIUM = "medium"
    HIGH = "high"
    CRITICAL = "critical"


class ViolationType(Enum):
    """InfringementCategoryType"""
    HIJACKER = "hijacker"           # Hijacking
    COUNTERFEIT = "counterfeit"     # Counterfeit
    PRICE_VIOLATION = "price"       # PriceViolation
    IMAGE_THEFT = "image_theft"     # ImageStolen
    TRADEMARK = "trademark"         # TrademarkInfringement
    LISTING_ABUSE = "listing_abuse" # Listing Abuse


# ============================================================
# Data Structures
# ============================================================

@dataclass
class BrandInfo:
    """BrandInformation"""
    brand_name: str
    trademark_number: Optional[str] = None
    brand_registry: bool = False
    authorized_sellers: List[str] = field(default_factory=list)
    protected_asins: List[str] = field(default_factory=list)
    min_price: Optional[float] = None  # MAP  most  low price
    logo_url: Optional[str] = None


@dataclass
class SellerInfo:
    """SellerInformation"""
    seller_id: str
    seller_name: str
    price: float
    is_fba: bool = False
    rating: Optional[float] = None
    review_count: Optional[int] = None
    is_authorized: bool = False
    storefront_url: Optional[str] = None


@dataclass
class ListingInfo:
    """Listing Information"""
    asin: str
    title: str
    brand_in_title: bool = False
    price: float = 0.0
    image_urls: List[str] = field(default_factory=list)
    seller_count: int = 1
    sellers: List[SellerInfo] = field(default_factory=list)
    buy_box_seller: Optional[str] = None
    category: Optional[str] = None


@dataclass
class Violation:
    """InfringementRecord"""
    violation_type: ViolationType
    risk_level: RiskLevel
    seller: Optional[SellerInfo] = None
    listing: Optional[ListingInfo] = None
    evidence: List[str] = field(default_factory=list)
    description: str = ""
    description_zh: str = ""
    recommended_action: str = ""
    recommended_action_zh: str = ""


@dataclass
class DetectionResult:
    """DetectionResult"""
    brand: BrandInfo
    scan_time: str
    total_asins_scanned: int
    violations: List[Violation]
    risk_score: int  # 0-100
    risk_level: RiskLevel
    summary: str
    summary_zh: str
    action_plan: List[Dict[str, str]]


# ============================================================
# DetectionLogic
# ============================================================

def detect_hijackers(brand: BrandInfo, listing: ListingInfo) -> List[Violation]:
    """DetectionHijacking"""
    violations = []
    
    for seller in listing.sellers:
        # skip AuthorizedSeller
        if seller.seller_id in brand.authorized_sellers:
            continue
        if seller.is_authorized:
            continue
        
        # FoundnotAuthorizedSeller
        risk = RiskLevel.HIGH if listing.buy_box_seller == seller.seller_id else RiskLevel.MEDIUM
        
        violations.append(Violation(
            violation_type=ViolationType.HIJACKER,
            risk_level=risk,
            seller=seller,
            listing=listing,
            evidence=[
                f"Unauthorized seller on ASIN: {listing.asin}",
                f"Seller: {seller.seller_name} ({seller.seller_id})",
                f"Price: ${seller.price}",
            ],
            description=f"Unauthorized seller '{seller.seller_name}' found on your listing",
            description_zh=f"FoundnotAuthorizedSeller '{seller.seller_name}'  in you Listing  above Sale",
            recommended_action="File Brand Registry complaint or send cease & desist",
            recommended_action_zh="Pass Brand Registry Complaint or cease and desist letter",
        ))
    
    return violations


def detect_price_violations(brand: BrandInfo, listing: ListingInfo) -> List[Violation]:
    """DetectionPriceViolation"""
    violations = []
    
    if brand.min_price is None:
        return violations
    
    for seller in listing.sellers:
        if seller.price < brand.min_price:
            discount = (brand.min_price - seller.price) / brand.min_price * 100
            
            risk = RiskLevel.CRITICAL if discount > 30 else RiskLevel.HIGH if discount > 15 else RiskLevel.MEDIUM
            
            violations.append(Violation(
                violation_type=ViolationType.PRICE_VIOLATION,
                risk_level=risk,
                seller=seller,
                listing=listing,
                evidence=[
                    f"Price ${seller.price} below MAP ${brand.min_price}",
                    f"Discount: {discount:.1f}% below minimum",
                ],
                description=f"Seller '{seller.seller_name}' selling {discount:.1f}% below MAP",
                description_zh=f"Seller '{seller.seller_name}' Selling Price low  at  MAP {discount:.1f}%",
                recommended_action="Send MAP violation notice, consider distribution review",
                recommended_action_zh="Send MAP Violation notice，ConsiderReviewDistributionChannel",
            ))
    
    return violations


def detect_counterfeit_signals(listing: ListingInfo, reviews: List[Dict] = None) -> List[Violation]:
    """DetectionCounterfeit Signals"""
    violations = []
    
    # SuspiciousKeywords
    counterfeit_keywords = [
        "fake", "counterfeit", "not genuine", "knockoff", "replica",
        "poor quality", "not authentic", "cheap copy", "different from picture",
        "Counterfeit", "fake", "Imitation", "Knockoff", "Poor quality", "AndImageDifferent",
    ]
    
    if reviews:
        suspicious_reviews = []
        for review in reviews:
            content = review.get("content", "").lower()
            for keyword in counterfeit_keywords:
                if keyword.lower() in content:
                    suspicious_reviews.append(review)
                    break
        
        if len(suspicious_reviews) >= 3:
            violations.append(Violation(
                violation_type=ViolationType.COUNTERFEIT,
                risk_level=RiskLevel.CRITICAL,
                listing=listing,
                evidence=[
                    f"Found {len(suspicious_reviews)} reviews mentioning counterfeit/fake",
                    "Sample keywords: " + ", ".join(counterfeit_keywords[:5]),
                ],
                description=f"Multiple reviews indicate potential counterfeit products",
                description_zh=f" many itemReviewmention and Counterfeit/Imitation，ExistCounterfeitRisk",
                recommended_action="Initiate Test Buy to collect physical evidence",
                recommended_action_zh="Proceed Test Buy Test purchase to collect physical evidence",
            ))
    
    return violations


def detect_trademark_abuse(brand: BrandInfo, listing: ListingInfo) -> List[Violation]:
    """DetectionTrademarkAbuse"""
    violations = []
    
    # CheckWhether title abuses brand name
    title_lower = listing.title.lower()
    brand_lower = brand.brand_name.lower()
    
    # SuspiciousMode：Brandname + "compatible", "for", "replacement"
    abuse_patterns = [
        f"for {brand_lower}",
        f"compatible with {brand_lower}",
        f"{brand_lower} compatible",
        f"fits {brand_lower}",
        f"replacement for {brand_lower}",
    ]
    
    for pattern in abuse_patterns:
        if pattern in title_lower:
            violations.append(Violation(
                violation_type=ViolationType.TRADEMARK,
                risk_level=RiskLevel.MEDIUM,
                listing=listing,
                evidence=[
                    f"Title contains: '{pattern}'",
                    f"Full title: {listing.title}",
                ],
                description=f"Potential trademark abuse in listing title",
                description_zh=f"Listing Title may contain trademark abuse",
                recommended_action="File trademark complaint if unauthorized use",
                recommended_action_zh=" such as notAuthorizedUse，SubmitTrademarkInfringementComplaint",
            ))
            break
    
    return violations


def calculate_risk_score(violations: List[Violation]) -> tuple:
    """CalculateRiskRating"""
    if not violations:
        return 0, RiskLevel.LOW
    
    # Weight
    weights = {
        RiskLevel.LOW: 5,
        RiskLevel.MEDIUM: 15,
        RiskLevel.HIGH: 30,
        RiskLevel.CRITICAL: 50,
    }
    
    total_score = sum(weights[v.risk_level] for v in violations)
    score = min(100, total_score)
    
    if score >= 70:
        level = RiskLevel.CRITICAL
    elif score >= 40:
        level = RiskLevel.HIGH
    elif score >= 20:
        level = RiskLevel.MEDIUM
    else:
        level = RiskLevel.LOW
    
    return score, level


def generate_action_plan(violations: List[Violation], brand: BrandInfo) -> List[Dict[str, str]]:
    """GenerateRights action plan"""
    actions = []
    
    #  by CategoryTypeGroup
    hijackers = [v for v in violations if v.violation_type == ViolationType.HIJACKER]
    counterfeits = [v for v in violations if v.violation_type == ViolationType.COUNTERFEIT]
    price_violations = [v for v in violations if v.violation_type == ViolationType.PRICE_VIOLATION]
    
    # HijackingProcess
    if hijackers:
        if brand.brand_registry:
            actions.append({
                "priority": "1",
                "action": "Report via Brand Registry",
                "action_zh": "Pass Brand Registry Complaint",
                "detail": f"Report {len(hijackers)} unauthorized seller(s) via Amazon Brand Registry portal",
                "detail_zh": f"Pass Amazon Brand Registry PortalComplaint {len(hijackers)} notAuthorizedSeller",
                "timeline": "24-48 hours",
            })
        else:
            actions.append({
                "priority": "1",
                "action": "Send Cease & Desist",
                "action_zh": "SendStopInfringementLetter",
                "detail": "Contact sellers directly with legal notice",
                "detail_zh": "Direct contactSellerSend legal letter",
                "timeline": "3-5 business days",
            })
    
    # CounterfeitProcess
    if counterfeits:
        actions.append({
            "priority": "1",
            "action": "Initiate Test Buy",
            "action_zh": "Proceed Test Buy",
            "detail": "Purchase product from suspected seller to collect physical evidence",
            "detail_zh": " from SuspiciousSeller at PurchaseProductCollectPhysicalEvidence",
            "timeline": "7-14 days",
        })
        actions.append({
            "priority": "2",
            "action": "File Counterfeit Report",
            "action_zh": "SubmitCounterfeitComplaint",
            "detail": "Submit counterfeit complaint with evidence to Amazon",
            "detail_zh": " to  Amazon Submit counterfeit complaint and evidence",
            "timeline": "After test buy",
        })
    
    # PriceViolationProcess
    if price_violations:
        actions.append({
            "priority": "2",
            "action": "Send MAP Violation Notice",
            "action_zh": "Send MAP Violation notice",
            "detail": f"Notify {len(price_violations)} seller(s) of MAP policy violation",
            "detail_zh": f"Notification {len(price_violations)} Seller MAP Policy violation",
            "timeline": "48-72 hours",
        })
    
    # GeneralRecommendation
    if not brand.brand_registry and violations:
        actions.append({
            "priority": "3",
            "action": "Enroll in Brand Registry",
            "action_zh": "Register Brand Registry",
            "detail": "Get enhanced brand protection tools from Amazon",
            "detail_zh": "Get Amazon EnhanceBrand ProtectionTool",
            "timeline": "2-4 weeks (requires trademark)",
        })
    
    return actions


# ============================================================
# MainDetectionFunction
# ============================================================

def detect(
    brand: BrandInfo,
    listings: List[ListingInfo],
    reviews: Dict[str, List[Dict]] = None
) -> DetectionResult:
    """MainDetectionFunction"""
    
    all_violations = []
    
    for listing in listings:
        # Hijacker Detection
        all_violations.extend(detect_hijackers(brand, listing))
        
        # PriceViolationDetection
        all_violations.extend(detect_price_violations(brand, listing))
        
        # TrademarkAbuseDetection
        all_violations.extend(detect_trademark_abuse(brand, listing))
        
        # Counterfeit SignalsDetection
        if reviews and listing.asin in reviews:
            all_violations.extend(detect_counterfeit_signals(listing, reviews[listing.asin]))
    
    # CalculateRiskRating
    risk_score, risk_level = calculate_risk_score(all_violations)
    
    # GenerateAction Plan
    action_plan = generate_action_plan(all_violations, brand)
    
    # GenerateSummary
    hijacker_count = len([v for v in all_violations if v.violation_type == ViolationType.HIJACKER])
    counterfeit_count = len([v for v in all_violations if v.violation_type == ViolationType.COUNTERFEIT])
    
    if risk_level == RiskLevel.CRITICAL:
        status = "🚨 CRITICAL"
        status_zh = "🚨 CriticalRisk"
    elif risk_level == RiskLevel.HIGH:
        status = "🔴 HIGH RISK"
        status_zh = "🔴 High Risk"
    elif risk_level == RiskLevel.MEDIUM:
        status = "⚠️ MEDIUM RISK"
        status_zh = "⚠️  in  etcRisk"
    else:
        status = "✅ LOW RISK"
        status_zh = "✅ Low Risk"
    
    summary = f"{status} | {len(all_violations)} violation(s) found | {hijacker_count} hijacker(s), {counterfeit_count} counterfeit signal(s)"
    summary_zh = f"{status_zh} | Found {len(all_violations)} Infringement | {hijacker_count} Hijacking, {counterfeit_count} Counterfeit Signals"
    
    return DetectionResult(
        brand=brand,
        scan_time=datetime.now().isoformat(),
        total_asins_scanned=len(listings),
        violations=all_violations,
        risk_score=risk_score,
        risk_level=risk_level,
        summary=summary,
        summary_zh=summary_zh,
        action_plan=action_plan,
    )


# ============================================================
# OutputFormat
# ============================================================

def format_report(result: DetectionResult, lang: str = "en") -> str:
    """FormatReport"""
    b = result.brand
    
    if lang == "zh":
        lines = [
            "🛡️ **Brand ProtectionDetectionReport**",
            "",
            f"**Brand**: {b.brand_name}",
            f"**Brand Registry**: {'✅  already Register' if b.brand_registry else '❌ notRegister'}",
            f"**ScanTime**: {result.scan_time[:19]}",
            f"**Scan ASIN **: {result.total_asins_scanned}",
            "",
            "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
            "",
            f"## 🎯 RiskRating: {result.risk_score}/100",
            "",
            result.summary_zh,
            "",
            "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
            "",
            "## ⚠️ InfringementDetails",
            "",
        ]
        
        if not result.violations:
            lines.append("✅ No infringement found")
        else:
            for i, v in enumerate(result.violations[:10], 1):
                risk_icon = {"critical": "🚨", "high": "🔴", "medium": "⚠️", "low": "✅"}[v.risk_level.value]
                lines.append(f"**{i}. [{v.violation_type.value.upper()}] {risk_icon}**")
                lines.append(f"   {v.description_zh}")
                if v.seller:
                    lines.append(f"   Seller: {v.seller.seller_name} | Price: ${v.seller.price}")
                lines.append(f"   Recommendation: {v.recommended_action_zh}")
                lines.append("")
        
        if result.action_plan:
            lines.extend([
                "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
                "",
                "## 📋 Rights action plan",
                "",
            ])
            for action in result.action_plan:
                lines.append(f"**[P{action['priority']}] {action['action_zh']}**")
                lines.append(f"   {action['detail_zh']}")
                lines.append(f"   ExpectedTime: {action['timeline']}")
                lines.append("")
    else:
        lines = [
            "🛡️ **Brand Protection Detection Report**",
            "",
            f"**Brand**: {b.brand_name}",
            f"**Brand Registry**: {'✅ Enrolled' if b.brand_registry else '❌ Not Enrolled'}",
            f"**Scan Time**: {result.scan_time[:19]}",
            f"**ASINs Scanned**: {result.total_asins_scanned}",
            "",
            "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
            "",
            f"## 🎯 Risk Score: {result.risk_score}/100",
            "",
            result.summary,
            "",
            "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
            "",
            "## ⚠️ Violations Found",
            "",
        ]
        
        if not result.violations:
            lines.append("✅ No violations detected")
        else:
            for i, v in enumerate(result.violations[:10], 1):
                risk_icon = {"critical": "🚨", "high": "🔴", "medium": "⚠️", "low": "✅"}[v.risk_level.value]
                lines.append(f"**{i}. [{v.violation_type.value.upper()}] {risk_icon}**")
                lines.append(f"   {v.description}")
                if v.seller:
                    lines.append(f"   Seller: {v.seller.seller_name} | Price: ${v.seller.price}")
                lines.append(f"   Action: {v.recommended_action}")
                lines.append("")
        
        if result.action_plan:
            lines.extend([
                "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
                "",
                "## 📋 Action Plan",
                "",
            ])
            for action in result.action_plan:
                lines.append(f"**[P{action['priority']}] {action['action']}**")
                lines.append(f"   {action['detail']}")
                lines.append(f"   Timeline: {action['timeline']}")
                lines.append("")
    
    return "\n".join(lines)


# ============================================================
# DemoData
# ============================================================

def get_demo_data():
    """GetDemoData"""
    brand = BrandInfo(
        brand_name="TechGadget",
        trademark_number="US12345678",
        brand_registry=True,
        authorized_sellers=["A1B2C3D4E5F6G7"],
        protected_asins=["B08XXXXXX1", "B08XXXXXX2"],
        min_price=29.99,
    )
    
    listings = [
        ListingInfo(
            asin="B08XXXXXX1",
            title="TechGadget Premium Wireless Charger",
            brand_in_title=True,
            price=29.99,
            seller_count=3,
            buy_box_seller="A1B2C3D4E5F6G7",
            sellers=[
                SellerInfo(
                    seller_id="A1B2C3D4E5F6G7",
                    seller_name="TechGadget Official",
                    price=29.99,
                    is_fba=True,
                    rating=4.8,
                    is_authorized=True,
                ),
                SellerInfo(
                    seller_id="X9Y8Z7W6V5U4T3",
                    seller_name="CheapDeals123",
                    price=18.99,
                    is_fba=False,
                    rating=3.2,
                    is_authorized=False,
                ),
                SellerInfo(
                    seller_id="M1N2O3P4Q5R6S7",
                    seller_name="BestPriceStore",
                    price=24.99,
                    is_fba=True,
                    rating=4.1,
                    is_authorized=False,
                ),
            ],
        ),
        ListingInfo(
            asin="B09YYYYYY1",
            title="Compatible with TechGadget Wireless Charger Case",
            brand_in_title=True,
            price=9.99,
            seller_count=1,
            sellers=[
                SellerInfo(
                    seller_id="K1L2M3N4O5P6Q7",
                    seller_name="AccessoryWorld",
                    price=9.99,
                    is_fba=True,
                    rating=4.0,
                    is_authorized=False,
                ),
            ],
        ),
    ]
    
    reviews = {
        "B08XXXXXX1": [
            {"content": "Great product, works perfectly!", "rating": 5},
            {"content": "Received a fake product, not genuine TechGadget", "rating": 1},
            {"content": "This is counterfeit, poor quality", "rating": 1},
            {"content": "Not authentic, different from picture", "rating": 2},
            {"content": "Amazing charger, fast shipping", "rating": 5},
        ],
    }
    
    return brand, listings, reviews


# ============================================================
# CLI
# ============================================================

def main():
    lang = "zh" if "--zh" in sys.argv else "en"
    
    # DemoMode
    brand, listings, reviews = get_demo_data()
    
    # ExecuteDetection
    result = detect(brand, listings, reviews)
    
    # OutputReport
    print(format_report(result, lang))


if __name__ == "__main__":
    main()


path: scripts/templates.py
content: #!/usr/bin/env python3
"""
Brand Protection Templates - Complaint & Legal Templates
Brand ProtectionTemplate - Complaint and legal document templates

Packagecontain:
- Brand Registry Complaint Templates
- Cease & Desist StopInfringementLetter
- Test Buy Operation guide
- MAP Violation notice
- LegalLetterTemplate

Version: 1.0.0
"""

from dataclasses import dataclass
from typing import Optional
from datetime import datetime


@dataclass
class ComplaintInfo:
    """ComplaintInformation"""
    brand_name: str
    trademark_number: Optional[str] = None
    asin: str = ""
    seller_name: str = ""
    seller_id: str = ""
    violation_type: str = ""
    evidence: str = ""
    contact_email: str = ""
    company_name: str = ""


# ============================================================
# Complaint Templates
# ============================================================

def generate_brand_registry_complaint(info: ComplaintInfo) -> str:
    """Generate Brand Registry Complaint Templates"""
    return f"""
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 BRAND REGISTRY COMPLAINT TEMPLATE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

**Platform**: Amazon Brand Registry Portal
**URL**: https://brandregistry.amazon.com/

---

## Report Details

**Brand Name**: {info.brand_name}
**Trademark Number**: {info.trademark_number or "N/A"}
**ASIN**: {info.asin}
**Infringing Seller**: {info.seller_name} ({info.seller_id})
**Violation Type**: {info.violation_type}

---

## Complaint Text (Copy & Paste)

```
I am the brand owner of {info.brand_name} (Trademark #{info.trademark_number or "[YOUR TRADEMARK NUMBER]"}).

The seller "{info.seller_name}" (Seller ID: {info.seller_id}) is selling unauthorized/counterfeit products on ASIN {info.asin}.

Evidence:
{info.evidence or "[Describe your evidence here - screenshots, test buy results, etc.]"}

This seller is NOT an authorized reseller of our products. We request immediate removal of this seller from our listing.

Contact: {info.contact_email or "[YOUR EMAIL]"}
Company: {info.company_name or "[YOUR COMPANY NAME]"}
```

---

## Steps to Submit

1. Log into Brand Registry: https://brandregistry.amazon.com/
2. Click "Report a Violation"
3. Select violation type
4. Enter ASIN and seller information
5. Paste complaint text above
6. Upload evidence (screenshots, invoices, test buy photos)
7. Submit and note case ID

---

## Evidence Checklist

☐ Screenshots of listing showing unauthorized seller
☐ Invoice/order confirmation from test buy
☐ Photos comparing authentic vs suspected counterfeit
☐ Trademark registration certificate
☐ Authorization letter (showing seller is NOT authorized)
"""


def generate_cease_desist(info: ComplaintInfo) -> str:
    """GenerateStopInfringementLetterTemplate"""
    today = datetime.now().strftime("%B %d, %Y")
    
    return f"""
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 CEASE AND DESIST LETTER TEMPLATE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

**Date**: {today}

---

**CEASE AND DESIST NOTICE**

To: {info.seller_name}
Seller ID: {info.seller_id}
Re: Unauthorized Sale of {info.brand_name} Products

---

Dear {info.seller_name},

This letter serves as formal notice that you are engaging in unauthorized sale of products bearing the {info.brand_name}® trademark (Registration No. {info.trademark_number or "[TRADEMARK NUMBER]"}) on Amazon.com, specifically on ASIN: {info.asin}.

**YOU ARE NOT AN AUTHORIZED RESELLER** of {info.brand_name} products. Your unauthorized sale of these products constitutes:

1. Trademark infringement under 15 U.S.C. § 1114
2. False designation of origin under 15 U.S.C. § 1125(a)
3. Violation of Amazon's Anti-Counterfeiting Policy

**DEMAND**

We hereby demand that you:

1. Immediately cease and desist all sales of {info.brand_name} products
2. Remove all {info.brand_name} product listings from your seller account
3. Provide a written confirmation of compliance within 5 business days

**CONSEQUENCES OF NON-COMPLIANCE**

Failure to comply with this demand will result in:
- Report to Amazon Brand Registry for listing removal
- Legal action seeking injunctive relief and monetary damages
- Report to law enforcement if counterfeit goods are involved

This letter is not intended to be a complete statement of the facts or law applicable to this matter, and nothing herein should be construed as a waiver of any rights or remedies.

Sincerely,

{info.company_name or "[YOUR COMPANY NAME]"}
{info.contact_email or "[YOUR EMAIL]"}

---

## Sending Instructions

1. Send via Amazon Buyer-Seller Messaging (if available)
2. Send via seller's contact email (find in storefront)
3. Keep copies of all correspondence
4. Set 5-day deadline for response
5. Escalate to legal action if no response
"""


def generate_test_buy_guide() -> str:
    """Generate Test Buy Operation guide"""
    return """
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 TEST BUY PROCEDURE GUIDE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

## Purpose

Test Buy is the process of purchasing products from suspected counterfeit/unauthorized sellers to collect physical evidence for your complaint.

---

## Step-by-Step Process

### 1. Preparation

☐ Create a separate Amazon buyer account (not linked to seller account)
☐ Use a different shipping address if possible
☐ Prepare camera for documentation
☐ Have authentic product ready for comparison

### 2. Purchase

☐ Select the suspected seller's offer (not Buy Box)
☐ Screenshot the product page showing seller name and price
☐ Screenshot checkout page with seller info
☐ Complete purchase and save order confirmation
☐ Note Order ID: ________________

### 3. Documentation Upon Arrival

☐ Photograph unopened package (showing shipping label)
☐ Video record unboxing process
☐ Photograph product from multiple angles
☐ Compare with authentic product side-by-side:
   - Packaging differences
   - Label/printing quality
   - Product quality/finish
   - Weight comparison
   - Serial number verification
☐ Keep all packaging materials

### 4. Evidence Organization

Create folder with:
```
test_buy_evidence/
├── 01_listing_screenshots/
├── 02_order_confirmation/
├── 03_package_photos/
├── 04_unboxing_video/
├── 05_product_comparison/
└── 06_notes.txt
```

### 5. Submit Complaint

☐ Compile all evidence
☐ Write detailed complaint (use template)
☐ Submit via Brand Registry
☐ Include Order ID in complaint
☐ Upload photos/video

---

## Evidence Checklist

**Screenshots**
☐ Listing page with seller
☐ Seller storefront
☐ Order confirmation
☐ Shipping confirmation
☐ Delivery confirmation

**Photos**
☐ Package exterior (4+ angles)
☐ Shipping label close-up
☐ Product in packaging
☐ Product removed
☐ Side-by-side with authentic
☐ Close-up of differences

**Documents**
☐ Invoice from test buy
☐ Authentication certificate (if available)
☐ Trademark registration

---

## Timeline

Day 1: Place order
Day 3-7: Receive package
Day 7-8: Document and compare
Day 8-10: Compile and submit complaint
Day 10-21: Amazon review period

---

## Cost Tracking

| Item | Cost |
|------|------|
| Test Buy Product | $_____ |
| Shipping | $_____ |
| Return Shipping | $_____ |
| Total | $_____ |

*Note: May be recoverable in legal action*
"""


def generate_map_violation_notice(info: ComplaintInfo, violation_price: float, map_price: float) -> str:
    """Generate MAP Violation notice"""
    today = datetime.now().strftime("%B %d, %Y")
    discount = (map_price - violation_price) / map_price * 100
    
    return f"""
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 MAP VIOLATION NOTICE TEMPLATE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

**Date**: {today}

---

**MINIMUM ADVERTISED PRICE (MAP) VIOLATION NOTICE**

To: {info.seller_name}
Re: MAP Policy Violation - {info.brand_name}

---

Dear {info.seller_name},

This notice is to inform you that your current advertised price for {info.brand_name} products violates our Minimum Advertised Price (MAP) policy.

**Violation Details:**

| Product | ASIN | Your Price | MAP Price | Violation |
|---------|------|------------|-----------|-----------|
| {info.brand_name} | {info.asin} | ${violation_price:.2f} | ${map_price:.2f} | -{discount:.1f}% |

**MAP Policy Terms:**

As an authorized/unauthorized reseller of {info.brand_name} products, you are required to maintain advertised prices at or above the Minimum Advertised Price. This policy ensures:

- Fair competition among resellers
- Brand value protection
- Quality customer experience

**Required Action:**

Please adjust your advertised price to ${map_price:.2f} or higher within **48 hours** of receiving this notice.

**Consequences of Non-Compliance:**

Continued violation of our MAP policy may result in:
- Removal from authorized reseller program
- Report to Amazon for policy violation
- Supply chain restrictions

Please confirm compliance by replying to this notice.

Sincerely,
{info.company_name or "[YOUR COMPANY NAME]"}
{info.contact_email or "[YOUR EMAIL]"}
"""


# ============================================================
#  in textTemplate
# ============================================================

def generate_brand_registry_complaint_zh(info: ComplaintInfo) -> str:
    """Generate Brand Registry Complaint Templates ( in text)"""
    return f"""
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 BRAND REGISTRY Complaint Templates
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

**Platform**: Amazon Brand Registry Portal
**URL**: https://brandregistry.amazon.com/

---

## ComplaintInformation

**BrandName**: {info.brand_name}
**TrademarkRegisternumber**: {info.trademark_number or "N/A"}
**ASIN**: {info.asin}
**InfringementSeller**: {info.seller_name} ({info.seller_id})
**InfringementCategoryType**: {info.violation_type}

---

## ComplaintText (CopyPaste)

```
I is  {info.brand_name} BrandOwner (TrademarkRegisternumber: {info.trademark_number or "[youTrademarknumber]"})。

Seller "{info.seller_name}" (Seller ID: {info.seller_id}) positive in  ASIN {info.asin} Selling unauthorized on/CounterfeitProduct。

Evidence:
{info.evidence or "[Describe your evidence here - Screenshot、TestPurchaseResult etc]"}

 should Sellernot is WeProductAuthorized distributor of。WeRequestImmediately will  this Seller from We Listing  in Remove。

Contact info: {info.contact_email or "[Your email]"}
CompanyName: {info.company_name or "[youCompanyname]"}
```

---

## SubmitStep

1. Login Brand Registry: https://brandregistry.amazon.com/
2. Click "Report a Violation" (ReportInfringement)
3. ChoiceInfringementCategoryType
4. Input ASIN AndSellerInformation
5. PasteAboveComplaintText
6. UploadEvidence (Screenshot、Invoice、Test Buy Photo)
7. SubmitandRecord Case ID

---

## EvidenceList

☐ Show notAuthorizedSeller Listing Screenshot
☐ Test Buy Invoice/OrderConfirm
☐ Authentic vs suspected counterfeitComparisonPhoto
☐ Trademark registration certificate
☐ Authorizedbook (Proof should SellerNot obtainedAuthorized)
"""


def generate_test_buy_guide_zh() -> str:
    """Generate Test Buy Operation guide ( in text)"""
    return """
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 TEST BUY Operation guide
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

## item

Test Buy (TestPurchase) Is fromSuspiciousCounterfeit/notAuthorizedSeller at PurchaseProduct，Process of collecting physical evidence for complaint。

---

## Operation process

### 1. Preparation work

☐ CreateIndependent Amazon BuyerAccount (not need  and SellerAccountAssociate)
☐ Use different deliveryAddress
☐ Prepare camera for recording
☐ Prepare authentic product forComparison

### 2. Purchase

☐ ChoiceSuspiciousSellerQuote (not need select Buy Box)
☐ ScreenshotProductPage，DisplaySellerNameAndPrice
☐ ScreenshotSettlementPage，PackagecontainSellerInformation
☐ CompletePurchaseandSaveOrderConfirm
☐ RecordOrdernumber: ________________

### 3. Receive after Record

☐ Photo of unopened package (Show shipping label)
☐ Video record unboxing process
☐  many angleDegreePhotoProduct
☐  and AuthenticSide by sideComparison:
   - PackagingDifference
   - Tag/Print quality
   - ProductQuality/Workmanship
   -  heavy quantityComparison
   - Serial number verification
☐ Keep all packaging materials

### 4. EvidenceOrganize

CreateFolder:
```
test_buy_Evidence/
├── 01_listingScreenshot/
├── 02_OrderConfirm/
├── 03_Package photo/
├── 04_UnboxingVideo/
├── 05_ProductComparison/
└── 06_Notes.txt
```

### 5. SubmitComplaint

☐ Organize all evidence
☐ Write detailed complaint (UseTemplate)
☐ Pass Brand Registry Submit
☐ Include in complaintOrdernumber
☐ Upload photo/Video

---

## Timeline

number 1 days:  below single
number 3-7 days: Receive
number 7-8 days: RecordandComparison
number 8-10 days: Organize and submit complaint
number 10-21 days: Amazon ReviewPeriod

---

## CostTrack

| Itemitem | Fee |
|------|------|
| Test Buy Product | $_____ |
| Shipping | $_____ |
| ReturnShipping | $_____ |
| Total | $_____ |

*note: Can be recovered in legal proceedings*
"""


# ============================================================
# CLI
# ============================================================

def main():
    import sys
    
    # DemoData
    info = ComplaintInfo(
        brand_name="TechGadget",
        trademark_number="US12345678",
        asin="B08XXXXXX1",
        seller_name="CheapDeals123",
        seller_id="X9Y8Z7W6V5U4T3",
        violation_type="Unauthorized Sale / Suspected Counterfeit",
        evidence="Test buy received product with different packaging and lower quality than authentic product.",
        contact_email="[REDACTED_SECRET]",
        company_name="TechGadget Inc.",
    )
    
    lang = "zh" if "--zh" in sys.argv else "en"
    template_type = sys.argv[1] if len(sys.argv) > 1 and not sys.argv[1].startswith("--") else "all"
    
    if template_type == "complaint" or template_type == "all":
        if lang == "zh":
            print(generate_brand_registry_complaint_zh(info))
        else:
            print(generate_brand_registry_complaint(info))
    
    if template_type == "cease" or template_type == "all":
        print(generate_cease_desist(info))
    
    if template_type == "testbuy" or template_type == "all":
        if lang == "zh":
            print(generate_test_buy_guide_zh())
        else:
            print(generate_test_buy_guide())
    
    if template_type == "map" or template_type == "all":
        print(generate_map_violation_notice(info, 18.99, 29.99))


if __name__ == "__main__":
    main()


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)