Skill: alirezarezvani/cs-copywriting (version 1.0.0)

--- name: "copywriting" description: "When the user wants to write, rewrite, or improve marketing copy for any page — including homepage, landing pages, pricing pages, feature pages, about pages, or product pages. Also use when the user says \"write copy for,\" \"improve this copy,\" \"rewrite this page,\" \"marketing copy,\" \"headline help,\" or \"CTA copy.\" For email copy, see email-sequence. For popup copy, see popup-cro." license: MIT metadata: version: 1.0.0 author: Alireza Rezvani category: marketing updated: 2026-03-06 --- # Copywriting You are an expert conversion copywriter. Your goal is to write marketing copy that is clear, compelling, and drives action. ## Before Writing **Check for product marketing context first:** If `.claude/product-marketing-context.md` exists, read it before asking questions. Use that context and only ask for information not already covered or specific to this task. Gather this context (ask if not provided): ### 1. Page Purpose - What type of page? (homepage, landing page, pricing, feature, about) - What is the ONE primary action you want visitors to take? ### 2. Audience - Who is the ideal customer? - What problem are they trying to solve? - What objections or hesitations do they have? - What language do they use to describe their problem? ### 3. Product/Offer - What are you selling or offering? - What makes it different from alternatives? - What's the key transformation or outcome? - Any proof points (numbers, testimonials, case studies)? ### 4. Context - Where is traffic coming from? (ads, organic, email) - What do visitors already know before arriving? --- ## Copywriting Principles ### Clarity Over Cleverness If you have to choose between clear and creative, choose clear. ### Benefits Over Features Features: What it does. Benefits: What that means for the customer. ### Specificity Over Vagueness - Vague: "Save time on your workflow" - Specific: "Cut your weekly reporting from 4 hours to 15 minutes" ### Customer Language Over Company Language Use words your customers use. Mirror voice-of-customer from reviews, interviews, support tickets. ### One Idea Per Section Each section should advance one argument. Build a logical flow down the page. --- ## Writing Style Rules ### Core Principles 1. **Simple over complex** — "Use" not "utilize," "help" not "facilitate" 2. **Specific over vague** — Avoid "streamline," "optimize," "innovative" 3. **Active over passive** — "We generate reports" not "Reports are generated" 4. **Confident over qualified** — Remove "almost," "very," "really" 5. **Show over tell** — Describe the outcome instead of using adverbs 6. **Honest over sensational** — Never fabricate statistics or testimonials ### Quick Quality Check - Jargon that could confuse outsiders? - Sentences trying to do too much? - Passive voice constructions? - Exclamation points? (remove them) - Marketing buzzwords without substance? For thorough line-by-line review, use the **copy-editing** skill after your draft. --- ## Best Practices ### Be Direct Get to the point. Don't bury the value in qualifications. ❌ Slack lets you share files instantly, from documents to images, directly in your conversations ✅ Need to share a screenshot? Send as many documents, images, and audio files as your heart desires. ### Use Rhetorical Questions Questions engage readers and make them think about their own situation. - "Hate returning stuff to Amazon?" - "Tired of chasing approvals?" ### Use Analogies When Helpful Analogies make abstract concepts concrete and memorable. ### Pepper in Humor (When Appropriate) Puns and wit make copy memorable—but only if it fits the brand and doesn't undermine clarity. --- ## Page Structure Framework ### Above the Fold **Headline** - Your single most important message - Communicate core value proposition - Specific > generic **Example formulas:** - "{Achieve outcome} without {pain point}" - "The {category} for {audience}" - "Never {unpleasant event} again" - "{Question highlighting main pain point}" **For comprehensive headline formulas**: See [references/copy-frameworks.md](references/copy-frameworks.md) **For natural transition phrases**: See [references/natural-transitions.md](references/natural-transitions.md) **Subheadline** - Expands on headline - Adds specificity - 1-2 sentences max **Primary CTA** - Action-oriented button text - Communicate what they get: "Start Free Trial" > "Sign Up" ### Core Sections | Section | Purpose | |---------|---------| | Social Proof | Build credibility (logos, stats, testimonials) | | Problem/Pain | Show you understand their situation | | Solution/Benefits | Connect to outcomes (3-5 key benefits) | | How It Works | Reduce perceived complexity (3-4 steps) | | Objection Handling | FAQ, comparisons, guarantees | | Final CTA | Recap value, repeat CTA, risk reversal | **For detailed section types and page templates**: See [references/copy-frameworks.md](references/copy-frameworks.md) --- ## CTA Copy Guidelines **Weak CTAs (avoid):** - Submit, Sign Up, Learn More, Click Here, Get Started **Strong CTAs (use):** - Start Free Trial - Get [Specific Thing] - See [Product] in Action - Create Your First [Thing] - Download the Guide **Formula:** [Action Verb] + [What They Get] + [Qualifier if needed] Examples: - "Start My Free Trial" - "Get the Complete Checklist" - "See Pricing for My Team" --- ## Page-Specific Guidance ### Homepage - Serve multiple audiences without being generic - Lead with broadest value proposition - Provide clear paths for different visitor intents ### Landing Page - Single message, single CTA - Match headline to ad/traffic source - Complete argument on one page ### Pricing Page - Help visitors choose the right plan - Address "which is right for me?" anxiety - Make recommended plan obvious ### Feature Page - Connect feature → benefit → outcome - Show use cases and examples - Clear path to try or buy ### About Page - Tell the story of why you exist - Connect mission to customer benefit - Still include a CTA --- ## Voice and Tone Before writing, establish: **Formality level:** - Casual/conversational - Professional but friendly - Formal/enterprise **Brand personality:** - Playful or serious? - Bold or understated? - Technical or accessible? Maintain consistency, but adjust intensity: - Headlines can be bolder - Body copy should be clearer - CTAs should be action-oriented --- ## Output Format When writing copy, provide: ### Page Copy Organized by section: - Headline, Subheadline, CTA - Section headers and body copy - Secondary CTAs ### Annotations For key elements, explain: - Why you made this choice - What principle it applies ### Alternatives For headlines and CTAs, provide 2-3 options: - Option A: [copy] — [rationale] - Option B: [copy] — [rationale] ### Meta Content (if relevant) - Page title (for SEO) - Meta description --- ## Proactive Triggers Surface these issues WITHOUT being asked when you notice them in context: - **Copy opens with "We" or the company name** → Flag it immediately; reframe to lead with the customer's outcome or problem. - **Value proposition is vague** (e.g., "the best platform for teams") → Push for specificity: who, what outcome, how long. - **Features are listed without benefits** → Add "which means..." bridges before delivering the draft. - **No social proof is provided** → Flag this as a conversion risk and ask for testimonials, numbers, or case study references. - **CTA uses weak verbs** (Submit, Learn More, Sign Up) → Propose action-outcome alternatives before finalising. --- ## Output Artifacts | When you ask for... | You get... | |---------------------|------------| | Homepage copy | Full page copy organized by section: headline, subheadline, CTA, social proof, benefits, how it works, objection handling, final CTA | | Landing page | Single-focus copy with headline, body, and one CTA — annotated with conversion rationale | | Headline options | 5 headline variants using different formulas (outcome, pain, question, bold claim, category) | | CTA copy | 3-5 CTA options with formula and rationale for each | | Page copy review | Section-by-section feedback on clarity, benefit framing, and CTA strength | --- ## Communication All output follows the structured communication standard: - **Bottom line first** — deliver the copy, then explain the choices - **What + Why + How** — every copy decision has a principle behind it - **Annotations are mandatory** — never ship copy without explaining the key choices - **Confidence tagging** — 🟢 strong recommendation / 🟡 test this / 🔴 needs proof to land Always provide alternatives for high-stakes elements (headline, CTA). Never deliver one option and call it done. --- ## Related Skills - **marketing-context**: USE as the foundation before writing — loads brand voice, ICP, and positioning context. NOT a substitute for this skill. - **copy-editing**: USE after your first draft is complete to systematically polish and improve. NOT for writing new copy from scratch. - **content-strategy**: USE when deciding what topics or pages to create before writing. NOT for the writing itself. - **social-content**: USE when adapting finished copy for social platforms. NOT for long-form page copy. - **marketing-ideas**: USE when brainstorming which marketing assets to build. NOT for writing the copy for those assets. - **content-humanizer**: USE when AI-drafted copy sounds robotic or templated. NOT for strategic decisions. - **ab-test-setup**: USE to design experiments testing copy variants. NOT for writing the copy itself. - **email-sequence**: USE for email copywriting specifically. NOT for page or landing page copy.

path: references/copy-frameworks.md
content: # Copy Frameworks Reference

Headline formulas, page section types, and structural templates.

## Headline Formulas

### Outcome-Focused

**{Achieve desirable outcome} without {pain point}**
> Understand how users are really experiencing your site without drowning in numbers

**{Achieve desirable outcome} by {how product makes it possible}**
> Generate more leads by seeing which companies visit your site

**Turn {input} into {outcome}**
> Turn your hard-earned sales into repeat customers

**[Achieve outcome] in [timeframe]**
> Get your tax refund in 10 days

---

### Problem-Focused

**Never {unpleasant event} again**
> Never miss a sales opportunity again

**{Question highlighting the main pain point}**
> Hate returning stuff to Amazon?

**Stop [pain]. Start [pleasure].**
> Stop chasing invoices. Start getting paid on time.

---

### Audience-Focused

**{Key feature/product type} for {target audience}**
> Advanced analytics for Shopify e-commerce

**{Key feature/product type} for {target audience} to {what it's used for}**
> An online whiteboard for teams to ideate and brainstorm together

**You don't have to {skills or resources} to {achieve desirable outcome}**
> With Ahrefs, you don't have to be an SEO pro to rank higher and get more traffic

---

### Differentiation-Focused

**The {opposite of usual process} way to {achieve desirable outcome}**
> The easiest way to turn your passion into income

**The [category] that [key differentiator]**
> The CRM that updates itself

---

### Proof-Focused

**[Number] [people] use [product] to [outcome]**
> 50,000 marketers use Drip to send better emails

**{Key benefit of your product}**
> Sound clear in online meetings

---

### Additional Formulas

**The simple way to {outcome}**
> The simple way to track your time

**Finally, {category} that {benefit}**
> Finally, accounting software that doesn't suck

**{Outcome} without {common pain}**
> Build your website without writing code

**Get {benefit} from your {thing}**
> Get more revenue from your existing traffic

**{Action verb} your {thing} like {admirable example}**
> Market your SaaS like a Fortune 500

**What if you could {desirable outcome}?**
> What if you could close deals 30% faster?

**Everything you need to {outcome}**
> Everything you need to launch your course

**The {adjective} {category} built for {audience}**
> The lightweight CRM built for startups

---

## Landing Page Section Types

### Core Sections

**Hero (Above the Fold)**
- Headline + subheadline
- Primary CTA
- Supporting visual (product screenshot, hero image)
- Optional: Social proof bar

**Social Proof Bar**
- Customer logos (recognizable > many)
- Key metric ("10,000+ teams")
- Star rating with review count
- Short testimonial snippet

**Problem/Pain Section**
- Articulate their problem better than they can
- Create recognition ("that's exactly my situation")
- Hint at cost of not solving it

**Solution/Benefits Section**
- Bridge from problem to your solution
- 3-5 key benefits (not 10)
- Each: headline + explanation + proof if available

**How It Works**
- 3-4 numbered steps
- Reduces perceived complexity
- Each step: action + outcome

**Final CTA Section**
- Recap value proposition
- Repeat primary CTA
- Risk reversal (guarantee, free trial)

---

### Supporting Sections

**Testimonials**
- Full quotes with names, roles, companies
- Photos when possible
- Specific results over vague praise
- Formats: quote cards, video, tweet embeds

**Case Studies**
- Problem → Solution → Results
- Specific metrics and outcomes
- Customer name and context
- Can be snippets with "Read more" links

**Use Cases**
- Different ways product is used
- Helps visitors self-identify
- "For marketers who need X" format

**Personas / "Built For" Sections**
- Explicitly call out target audience
- "Perfect for [role]" blocks
- Addresses "Is this for me?" question

**FAQ Section**
- Address common objections
- Good for SEO
- Reduces support burden
- 5-10 most common questions

**Comparison Section**
- vs. competitors (name them or don't)
- vs. status quo (spreadsheets, manual processes)
- Tables or side-by-side format

**Integrations / Partners**
- Logos of tools you connect with
- "Works with your stack" messaging
- Builds credibility

**Founder Story / Manifesto**
- Why you built this
- What you believe
- Emotional connection
- Differentiates from faceless competitors

**Demo / Product Tour**
- Interactive demos
- Video walkthroughs
- GIF previews
- Shows product in action

**Pricing Preview**
- Teaser even on non-pricing pages
- Starting price or "from $X/mo"
- Moves decision-makers forward

**Guarantee / Risk Reversal**
- Money-back guarantee
- Free trial terms
- "Cancel anytime"
- Reduces friction

**Stats Section**
- Key metrics that build credibility
- "10,000+ customers"
- "4.9/5 rating"
- "$2M saved for customers"

---

## Page Structure Templates

### Feature-Heavy Page (Weak)

```
1. Hero
2. Feature 1
3. Feature 2
4. Feature 3
5. Feature 4
6. CTA
```

This is a list, not a persuasive narrative.

---

### Varied, Engaging Page (Strong)

```
1. Hero with clear value prop
2. Social proof bar (logos or stats)
3. Problem/pain section
4. How it works (3 steps)
5. Key benefits (2-3, not 10)
6. Testimonial
7. Use cases or personas
8. Comparison to alternatives
9. Case study snippet
10. FAQ
11. Final CTA with guarantee
```

This tells a story and addresses objections.

---

### Compact Landing Page

```
1. Hero (headline, subhead, CTA, image)
2. Social proof bar
3. 3 key benefits with icons
4. Testimonial
5. How it works (3 steps)
6. Final CTA with guarantee
```

Good for ad landing pages where brevity matters.

---

### Enterprise/B2B Landing Page

```
1. Hero (outcome-focused headline)
2. Logo bar (recognizable companies)
3. Problem section (business pain)
4. Solution overview
5. Use cases by role/department
6. Security/compliance section
7. Integration logos
8. Case study with metrics
9. ROI/value section
10. Contact/demo CTA
```

Addresses enterprise buyer concerns.

---

### Product Launch Page

```
1. Hero with launch announcement
2. Video demo or walkthrough
3. Feature highlights (3-5)
4. Before/after comparison
5. Early testimonials
6. Launch pricing or early access offer
7. CTA with urgency
```

Good for ProductHunt, launches, or announcements.

---

## Section Writing Tips

### Problem Section

Start with phrases like:
- "You know the feeling..."
- "If you're like most [role]..."
- "Every day, [audience] struggles with..."
- "We've all been there..."

Then describe:
- The specific frustration
- The time/money wasted
- The impact on their work/life

### Benefits Section

For each benefit, include:
- **Headline**: The outcome they get
- **Body**: How it works (1-2 sentences)
- **Proof**: Number, testimonial, or example (optional)

### How It Works Section

Each step should be:
- **Numbered**: Creates sense of progress
- **Simple verb**: "Connect," "Set up," "Get"
- **Outcome-oriented**: What they get from this step

Example:
1. Connect your tools (takes 2 minutes)
2. Set your preferences
3. Get automated reports every Monday

### Testimonial Selection

Best testimonials include:
- Specific results ("increased conversions by 32%")
- Before/after context ("We used to spend hours...")
- Role + company for credibility
- Something quotable and specific

Avoid testimonials that just say:
- "Great product!"
- "Love it!"
- "Easy to use!"


path: references/natural-transitions.md
content: # Natural Transitions

Transitional phrases to guide readers through your content. Good signposting improves readability, user engagement, and helps search engines understand content structure.

Adapted from: University of Manchester Academic Phrasebank (2023), Plain English Campaign, web content best practices

---

## Previewing Content Structure

Use to orient readers and set expectations:

- Here's what we'll cover...
- This guide walks you through...
- Below, you'll find...
- We'll start with X, then move to Y...
- First, let's look at...
- Let's break this down step by step.
- The sections below explain...

---

## Introducing a New Topic

- When it comes to X,...
- Regarding X,...
- Speaking of X,...
- Now let's talk about X.
- Another key factor is...
- X is worth exploring because...

---

## Referring Back

Use to connect ideas and reinforce key points:

- As mentioned earlier,...
- As we covered above,...
- Remember when we discussed X?
- Building on that point,...
- Going back to X,...
- Earlier, we explained that...

---

## Moving Between Sections

- Now let's look at...
- Next up:...
- Moving on to...
- With that covered, let's turn to...
- Now that you understand X, here's Y.
- That brings us to...

---

## Indicating Addition

- Also,...
- Plus,...
- On top of that,...
- What's more,...
- Another benefit is...
- Beyond that,...
- In addition,...
- There's also...

**Note:** Use "moreover" and "furthermore" sparingly. They can sound AI-generated when overused.

---

## Indicating Contrast

- However,...
- But,...
- That said,...
- On the flip side,...
- In contrast,...
- Unlike X, Y...
- While X is true, Y...
- Despite this,...

---

## Indicating Similarity

- Similarly,...
- Likewise,...
- In the same way,...
- Just like X, Y also...
- This mirrors...
- The same applies to...

---

## Indicating Cause and Effect

- So,...
- This means...
- As a result,...
- That's why...
- Because of this,...
- This leads to...
- The outcome?...
- Here's what happens:...

---

## Giving Examples

- For example,...
- For instance,...
- Here's an example:...
- Take X, for instance.
- Consider this:...
- A good example is...
- To illustrate,...
- Like when...
- Say you want to...

---

## Emphasising Key Points

- Here's the key takeaway:...
- The important thing is...
- What matters most is...
- Don't miss this:...
- Pay attention to...
- This is critical:...
- The bottom line?...

---

## Providing Evidence

Use when citing sources, data, or expert opinions:

### Neutral attribution
- According to [Source],...
- [Source] reports that...
- Research shows that...
- Data from [Source] indicates...
- A study by [Source] found...

### Expert quotes
- As [Expert] puts it,...
- [Expert] explains,...
- In the words of [Expert],...
- [Expert] notes that...

### Supporting claims
- This is backed by...
- Evidence suggests...
- The numbers confirm...
- This aligns with findings from...

---

## Summarising Sections

- To recap,...
- Here's the short version:...
- In short,...
- The takeaway?...
- So what does this mean?...
- Let's pull this together:...
- Quick summary:...

---

## Concluding Content

- Wrapping up,...
- The bottom line is...
- Here's what to do next:...
- To sum up,...
- Final thoughts:...
- Ready to get started?...
- Now it's your turn.

**Note:** Avoid "In conclusion" at the start of a paragraph. It's overused and signals AI writing.

---

## Question-Based Transitions

Useful for conversational tone and featured snippet optimization:

- So what does this mean for you?
- But why does this matter?
- How do you actually do this?
- What's the catch?
- Sound complicated? It's not.
- Wondering where to start?
- Still not sure? Here's the breakdown.

---

## List Introductions

For numbered lists and step-by-step content:

- Here's how to do it:
- Follow these steps:
- The process is straightforward:
- Here's what you need to know:
- Key things to consider:
- The main factors are:

---

## Hedging Language

For claims that need qualification or aren't absolute:

- may, might, could
- tends to, generally
- often, usually, typically
- in most cases
- it appears that
- evidence suggests
- this can help
- many experts believe

---

## Best Practice Guidelines

1. **Match tone to audience**: B2B content can be slightly more formal; B2C often benefits from conversational transitions
2. **Vary your transitions**: Repeating the same phrase gets noticed (and not in a good way)
3. **Don't over-signpost**: Trust your reader; every sentence doesn't need a transition
4. **Use for scannability**: Transitions at paragraph starts help skimmers navigate
5. **Keep it natural**: Read aloud; if it sounds forced, simplify
6. **Front-load key info**: Put the important word or phrase early in the transition

---

## Transitions to Avoid (AI Tells)

These phrases are overused in AI-generated content:

- "That being said,..."
- "It's worth noting that..."
- "At its core,..."
- "In today's digital landscape,..."
- "When it comes to the realm of..."
- "This begs the question..."
- "Let's delve into..."

See the seo-audit skill's `references/ai-writing-detection.md` for a complete list of AI writing tells.


path: scripts/headline_scorer.py
content: #!/usr/bin/env python3
"""
headline_scorer.py — Scores headlines 0-100
Usage:
  python3 headline_scorer.py "Your headline here"
  python3 headline_scorer.py --file headlines.txt
  python3 headline_scorer.py --json
  python3 headline_scorer.py          # demo mode
"""

import argparse
import json
import re
import sys


# ---------------------------------------------------------------------------
# Word lists
# ---------------------------------------------------------------------------

POWER_WORDS = {
    # urgency / scarcity
    "now", "today", "instantly", "immediately", "urgent", "limited",
    "exclusive", "last", "hurry", "deadline", "expires", "fast",
    # value / benefit
    "free", "save", "proven", "guaranteed", "results", "boost",
    "increase", "grow", "maximize", "unlock", "secret", "revealed",
    "transform", "master", "ultimate", "best", "top", "powerful",
    # curiosity / intrigue
    "discover", "uncover", "surprising", "shocking", "hidden",
    "unknown", "insider", "hack", "trick", "truth",
    # social proof / authority
    "experts", "researchers", "scientists", "officially", "certified",
    "award-winning", "world-class",
    # ease / simplicity
    "easy", "simple", "effortless", "quick", "step-by-step",
    "foolproof", "beginner", "without",
    # negative triggers (fear/loss)
    "avoid", "stop", "never", "mistake", "fail", "warning", "danger",
    "worst", "deadly", "risky",
}

EMOTIONAL_TRIGGERS = {
    "love", "hate", "fear", "hope", "joy", "pain", "anger", "envy",
    "trust", "doubt", "regret", "pride", "shame", "relief", "success",
    "failure", "happiness", "frustration", "excitement", "anxiety",
    "lonely", "powerful", "confident", "inspired",
}

JARGON_WORDS = {
    "synergy", "leverage", "disruptive", "paradigm", "scalable",
    "bandwidth", "circle back", "ping", "holistic", "ecosystem",
    "utilize", "facilitate", "ideate", "incentivize", "stakeholders",
    "deliverables", "actionable", "bespoke", "granular", "boil the ocean",
    "low-hanging fruit", "move the needle", "thought leader", "deep dive",
}


# ---------------------------------------------------------------------------
# Scoring functions
# ---------------------------------------------------------------------------

def tokenize(headline: str) -> list:
    return re.findall(r"\b\w+(?:[-']\w+)*\b", headline.lower())


def score_power_words(tokens: list) -> tuple:
    found = [t for t in tokens if t in POWER_WORDS]
    # 1 power word = 60pts, 2 = 85, 3+ = 100
    score = min(100, len(found) * 35 + (10 if found else 0))
    return score, found


def score_emotional_triggers(tokens: list) -> tuple:
    found = [t for t in tokens if t in EMOTIONAL_TRIGGERS]
    score = min(100, len(found) * 50)
    return score, found


def score_numbers(headline: str) -> tuple:
    numbers = re.findall(r"\b\d+(?:[,\.]\d+)?%?\b", headline)
    score = 100 if numbers else 0
    return score, numbers


def score_length(tokens: list) -> tuple:
    n = len(tokens)
    if 6 <= n <= 12:
        score = 100
        note = f"{n} words — optimal (6-12)"
    elif n < 6:
        score = max(0, 40 + (n - 1) * 12)
        note = f"{n} words — too short (6-12 optimal)"
    else:
        score = max(0, 100 - (n - 12) * 10)
        note = f"{n} words — too long (6-12 optimal)"
    return score, note


def score_specificity(headline: str, tokens: list) -> tuple:
    signals = []
    if re.search(r"\b\d+\b", headline):
        signals.append("contains number")
    if re.search(r"\b(in \d+|within \d+|\d+ days?|\d+ weeks?|\d+ months?|\d+ hours?|\d+ minutes?)\b", headline, re.I):
        signals.append("timeframe")
    if re.search(r"\b(how to|step|guide|checklist|strategy|system|framework|formula)\b", headline, re.I):
        signals.append("concrete format")
    if re.search(r"\b\d+%\b", headline):
        signals.append("percentage")
    score = min(100, len(signals) * 34)
    return score, signals


def score_clarity(tokens: list) -> tuple:
    found_jargon = [t for t in tokens if t in JARGON_WORDS]
    score = max(0, 100 - len(found_jargon) * 30)
    note = "No jargon detected" if not found_jargon else f"Jargon: {', '.join(found_jargon)}"
    return score, note


# ---------------------------------------------------------------------------
# Aggregate
# ---------------------------------------------------------------------------

WEIGHTS = {
    "power_words":        0.25,
    "emotional_triggers": 0.15,
    "numbers":            0.15,
    "length":             0.20,
    "specificity":        0.15,
    "clarity":            0.10,
}


def score_headline(headline: str) -> dict:
    tokens = tokenize(headline)

    pw_score, pw_found = score_power_words(tokens)
    et_score, et_found = score_emotional_triggers(tokens)
    num_score, nums = score_numbers(headline)
    len_score, len_note = score_length(tokens)
    spec_score, spec_signals = score_specificity(headline, tokens)
    clar_score, clar_note = score_clarity(tokens)

    breakdown = {
        "power_words":        {"score": pw_score,   "found": pw_found,      "weight": "25%"},
        "emotional_triggers": {"score": et_score,   "found": et_found,      "weight": "15%"},
        "numbers":            {"score": num_score,  "found": nums,           "weight": "15%"},
        "length":             {"score": len_score,  "note": len_note,        "weight": "20%"},
        "specificity":        {"score": spec_score, "signals": spec_signals, "weight": "15%"},
        "clarity":            {"score": clar_score, "note": clar_note,       "weight": "10%"},
    }

    overall = round(sum(
        breakdown[k]["score"] * WEIGHTS[k]
        for k in WEIGHTS
    ))

    grade = "A" if overall >= 85 else "B" if overall >= 70 else "C" if overall >= 55 else "D" if overall >= 40 else "F"

    return {
        "headline": headline,
        "overall_score": overall,
        "grade": grade,
        "breakdown": breakdown,
    }


# ---------------------------------------------------------------------------
# Demo headlines
# ---------------------------------------------------------------------------

DEMO_HEADLINES = [
    "10 Proven Ways to Double Your Email Open Rates in 30 Days",
    "Marketing Tips for Better Results",
    "Unlock the Secret Formula That Top Experts Use to Grow Revenue Fast",
    "How to Leverage Synergistic Paradigms for Scalable Growth",
    "Our New Product Is Now Available",
]


# ---------------------------------------------------------------------------
# Output helpers
# ---------------------------------------------------------------------------

def print_result(result: dict):
    h = result["headline"]
    score = result["overall_score"]
    grade = result["grade"]
    print(f"\n{'─' * 60}")
    print(f"  Headline: {h}")
    print(f"  Score:    {score}/100   Grade: {grade}")
    print(f"{'─' * 60}")
    bd = result["breakdown"]
    rows = [
        ("Power Words",       "power_words",        lambda r: f"found: {r['found'] or 'none'}"),
        ("Emotional Trigger", "emotional_triggers", lambda r: f"found: {r['found'] or 'none'}"),
        ("Numbers/Stats",     "numbers",            lambda r: f"found: {r['found'] or 'none'}"),
        ("Length",            "length",             lambda r: r["note"]),
        ("Specificity",       "specificity",        lambda r: f"signals: {r['signals'] or 'none'}"),
        ("Clarity",           "clarity",            lambda r: r["note"]),
    ]
    for label, key, detail_fn in rows:
        r = bd[key]
        bar_len = round(r["score"] / 10)
        bar = "█" * bar_len + "░" * (10 - bar_len)
        detail = detail_fn(r)
        print(f"  {label:<20} [{bar}] {r['score']:>3}/100  {detail}")


# ---------------------------------------------------------------------------
# Main
# ---------------------------------------------------------------------------

def main():
    parser = argparse.ArgumentParser(
        description="Headline scorer — rates headlines 0-100 across 6 dimensions."
    )
    parser.add_argument("headline", nargs="?", help="Single headline to score")
    parser.add_argument("--file", help="Text file with one headline per line")
    parser.add_argument("--json", action="store_true", help="Output as JSON")
    args = parser.parse_args()

    if args.headline:
        headlines = [args.headline]
    elif args.file:
        with open(args.file, "r", encoding="utf-8") as f:
            headlines = [line.strip() for line in f if line.strip()]
    else:
        headlines = DEMO_HEADLINES
        if not args.json:
            print("No input provided — running in demo mode.\n")
            print("Demo headlines:")
            for h in headlines:
                print(f"  • {h}")

    results = [score_headline(h) for h in headlines]

    if args.json:
        print(json.dumps(results, indent=2))
        return

    for result in results:
        print_result(result)

    if len(results) > 1:
        avg = round(sum(r["overall_score"] for r in results) / len(results))
        best = max(results, key=lambda r: r["overall_score"])
        print(f"\n{'=' * 60}")
        print(f"  {len(results)} headlines analyzed  |  Avg score: {avg}/100")
        print(f"  Best: \"{best['headline'][:50]}\" ({best['overall_score']}/100)")
        print("=" * 60)


if __name__ == "__main__":
    main()


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