@opendirectory.dev/skills 0.1.42 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/registry.json +16 -0
- package/skills/competitor-pr-finder/.env.example +13 -0
- package/skills/competitor-pr-finder/README.md +127 -0
- package/skills/competitor-pr-finder/SKILL.md +767 -0
- package/skills/competitor-pr-finder/evals/evals.json +120 -0
- package/skills/competitor-pr-finder/references/pitch-guide.md +119 -0
- package/skills/competitor-pr-finder/references/pr-channel-types.md +81 -0
- package/skills/competitor-pr-finder/references/tier-scoring.md +91 -0
- package/skills/competitor-pr-finder/scripts/research.py +292 -0
- package/skills/pricing-finder/.env.example +15 -0
- package/skills/pricing-finder/README.md +142 -0
- package/skills/pricing-finder/SKILL.md +748 -0
- package/skills/pricing-finder/evals/evals.json +124 -0
- package/skills/pricing-finder/references/extraction-guide.md +156 -0
- package/skills/pricing-finder/references/positioning-guide.md +114 -0
- package/skills/pricing-finder/references/pricing-models.md +113 -0
- package/skills/pricing-finder/requirements.txt +8 -0
- package/skills/pricing-finder/scripts/research.py +449 -0
|
@@ -0,0 +1,767 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: competitor-pr-finder
|
|
3
|
+
description: 'Give it your product URL or description. It finds your top 5 competitors, runs three-track PR research across all of them (editorial, podcasts, communities), identifies which channels appear most frequently, looks up the journalist or host for each, and returns a tiered outreach list with story angles and ready-to-send cold pitch drafts tailored to your product. Use when asked to find PR opportunities, discover where competitors got featured, build a media outreach list, find which journalists cover my space, or get pitch templates for press coverage.'
|
|
4
|
+
compatibility: [claude-code, gemini-cli, github-copilot]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Competitor PR Finder
|
|
8
|
+
|
|
9
|
+
Give it your product URL. It finds your competitors, researches every PR channel they used (news, podcasts, communities), surfaces the channels that appear across multiple competitors (your proven targets), finds the journalist or host for each, and drafts a personalized cold pitch for your product at every tier-1 channel.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
**Zero-hallucination policy:** Every channel, journalist name, story angle, and pitch detail in the output must trace to a specific Tavily search result or the fetched product page. This applies to:
|
|
14
|
+
- Competitor names: must appear in Tavily search results, not AI training knowledge
|
|
15
|
+
- Channel names: must have a URL in the search results
|
|
16
|
+
- Journalist/host names: must appear verbatim in a Tavily snippet
|
|
17
|
+
- Story angles: extracted from article/episode titles in search results only
|
|
18
|
+
- Pitch drafts: reference specific evidence from search data + product analysis
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Common Mistakes
|
|
23
|
+
|
|
24
|
+
| The agent will want to... | Why that's wrong |
|
|
25
|
+
|---|---|
|
|
26
|
+
| Name a journalist from training knowledge | Every journalist name must trace to a search result snippet. Writing "Sarah Perez covers startups at TechCrunch" from memory is hallucination. |
|
|
27
|
+
| List channels without evidence URLs | Every channel in the output must have at least one URL from the PR search results proving a competitor was featured there. |
|
|
28
|
+
| Skip the competitor confirmation step | Always show discovered competitors and wait for the user to confirm. Wrong competitors = wasted searches and a useless output. |
|
|
29
|
+
| Generate generic pitches ("We'd love to be featured") | Every pitch must reference a specific angle from the evidence AND a specific differentiator from the product analysis. |
|
|
30
|
+
| Mark a channel as Tier 1 with only 1 competitor occurrence | Tier 1 = 3+ competitors. Tier 2 = exactly 2. Tier 3 = 1. Do not promote channels that haven't proven themselves. |
|
|
31
|
+
| Use em dashes in output | Replace all em dashes (--) with hyphens. |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Read Reference Files Before Each Run
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
cat references/pr-channel-types.md
|
|
39
|
+
cat references/pitch-guide.md
|
|
40
|
+
cat references/tier-scoring.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 1: Setup Check
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
echo "TAVILY_API_KEY: ${TAVILY_API_KEY:+set}${TAVILY_API_KEY:-NOT SET -- required}"
|
|
49
|
+
echo "FIRECRAWL_API_KEY: ${FIRECRAWL_API_KEY:+set}${FIRECRAWL_API_KEY:-not set, Tavily extract will be used as fallback}"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**If TAVILY_API_KEY is missing:** Stop immediately. Tell the user: "TAVILY_API_KEY is required to research competitors and find PR coverage. There is no fallback. Get it at app.tavily.com -- free tier: 1000 credits/month (about 43 full runs at ~23 searches/run). Add it to your .env file."
|
|
53
|
+
|
|
54
|
+
**If only FIRECRAWL_API_KEY is missing:** Continue. Tavily extract will be used for the URL fetch.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Step 2: Parse Input
|
|
59
|
+
|
|
60
|
+
Collect from the conversation:
|
|
61
|
+
- `product_url`: the URL to fetch (required, unless user pastes a description directly)
|
|
62
|
+
- `product_name`: optional, derived from page if not provided
|
|
63
|
+
- `geography`: optional -- US / Europe / global. Default: US
|
|
64
|
+
|
|
65
|
+
**If the user provides only a pasted description (no URL):** Skip Steps 3 and 4. Go directly to Step 4 (product analysis) using the pasted text as `product_content`. Set `page_source` to `user_description` and note in `data_quality_flags`.
|
|
66
|
+
|
|
67
|
+
**If neither URL nor description:** Ask: "What is the URL of your product or startup? Or paste a short description: what it does, who it is for, and what makes it different from competitors."
|
|
68
|
+
|
|
69
|
+
Derive product slug:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
PRODUCT_SLUG=$(python3 -c "
|
|
73
|
+
from urllib.parse import urlparse
|
|
74
|
+
import sys
|
|
75
|
+
url = 'URL_HERE'
|
|
76
|
+
if url.startswith('http'):
|
|
77
|
+
host = urlparse(url).netloc.replace('www.', '')
|
|
78
|
+
print(host.split('.')[0])
|
|
79
|
+
else:
|
|
80
|
+
import re
|
|
81
|
+
print(re.sub(r'[^a-z0-9]', '-', url[:30].lower()).strip('-'))
|
|
82
|
+
")
|
|
83
|
+
echo "Product slug: $PRODUCT_SLUG"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Step 3: Fetch Product Page
|
|
89
|
+
|
|
90
|
+
**Primary: Firecrawl (if FIRECRAWL_API_KEY is set)**
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
curl -s -X POST https://api.firecrawl.dev/v1/scrape \
|
|
94
|
+
-H "Authorization: Bearer $FIRECRAWL_API_KEY" \
|
|
95
|
+
-H "Content-Type: application/json" \
|
|
96
|
+
-d '{"url": "URL_HERE", "formats": ["markdown"], "onlyMainContent": true}' \
|
|
97
|
+
| python3 -c "
|
|
98
|
+
import sys, json
|
|
99
|
+
d = json.load(sys.stdin)
|
|
100
|
+
content = d.get('data', {}).get('markdown', '') or d.get('markdown', '')
|
|
101
|
+
print(f'Fetched via Firecrawl: {len(content)} characters')
|
|
102
|
+
open('/tmp/cprf-product-raw.md', 'w').write(content)
|
|
103
|
+
"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Fallback: Tavily extract (if FIRECRAWL_API_KEY is not set)**
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
curl -s -X POST https://api.tavily.com/extract \
|
|
110
|
+
-H "Content-Type: application/json" \
|
|
111
|
+
-d "{\"api_key\": \"$TAVILY_API_KEY\", \"urls\": [\"URL_HERE\"]}" \
|
|
112
|
+
| python3 -c "
|
|
113
|
+
import sys, json
|
|
114
|
+
d = json.load(sys.stdin)
|
|
115
|
+
content = d.get('results', [{}])[0].get('raw_content', '')
|
|
116
|
+
print(f'Fetched via Tavily extract: {len(content)} characters')
|
|
117
|
+
open('/tmp/cprf-product-raw.md', 'w').write(content)
|
|
118
|
+
"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Checkpoint:**
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
python3 -c "
|
|
125
|
+
content = open('/tmp/cprf-product-raw.md').read()
|
|
126
|
+
if len(content) < 200:
|
|
127
|
+
print('ERROR: fewer than 200 characters fetched')
|
|
128
|
+
else:
|
|
129
|
+
print(f'Content OK: {len(content)} characters')
|
|
130
|
+
"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**If content < 200 characters:** Stop fetching. Tell the user: "The product page returned no readable content -- the site is likely JavaScript-rendered and blocked the fetch. Please paste a short description directly: what it does, who it is for, and what makes it different."
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Step 4: Product Analysis (AI)
|
|
138
|
+
|
|
139
|
+
Print page content:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
python3 -c "
|
|
143
|
+
content = open('/tmp/cprf-product-raw.md').read()[:5000]
|
|
144
|
+
print('=== PRODUCT PAGE (first 5000 chars) ===')
|
|
145
|
+
print(content)
|
|
146
|
+
"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**AI instructions:** Analyze the product page above and extract:
|
|
150
|
+
|
|
151
|
+
- `product_name`: the product or company name
|
|
152
|
+
- `one_line_description`: what it does, for whom, core value prop. Under 20 words. No marketing language. Example: "CI/CD automation for developer teams that self-host their pipelines."
|
|
153
|
+
- `industry_taxonomy`: `l1` (top-level: e.g. developer tools / fintech / healthtech / consumer), `l2` (sector: e.g. devops / payments / telemedicine), `l3` (specific niche: e.g. CI/CD automation / embedded payments / async video consultation). Vague labels like "technology" alone are not acceptable.
|
|
154
|
+
- `differentiators`: exactly 2-3 specific things that distinguish this product from generic competitors. These feed directly into the pitch drafts -- be specific. Example: ["Self-hosted pipeline runner -- no data leaves your infra", "Native support for monorepos with dynamic step generation"]
|
|
155
|
+
- `icp`: `buyer_persona` (job title), `company_type`, `company_size`
|
|
156
|
+
- `geography_bias`: US / Europe / global / unclear
|
|
157
|
+
- `page_source`: "live_page" or "user_description"
|
|
158
|
+
|
|
159
|
+
Write to `/tmp/cprf-product-analysis.json`:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
python3 << 'PYEOF'
|
|
163
|
+
import json
|
|
164
|
+
|
|
165
|
+
analysis = {
|
|
166
|
+
# FILL from your analysis above
|
|
167
|
+
"product_name": "",
|
|
168
|
+
"one_line_description": "",
|
|
169
|
+
"industry_taxonomy": {"l1": "", "l2": "", "l3": ""},
|
|
170
|
+
"differentiators": [],
|
|
171
|
+
"icp": {"buyer_persona": "", "company_type": "", "company_size": ""},
|
|
172
|
+
"geography_bias": "US",
|
|
173
|
+
"page_source": "live_page"
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
json.dump(analysis, open('/tmp/cprf-product-analysis.json', 'w'), indent=2)
|
|
177
|
+
print('Product analysis written.')
|
|
178
|
+
PYEOF
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Verify:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
python3 -c "
|
|
185
|
+
import json
|
|
186
|
+
a = json.load(open('/tmp/cprf-product-analysis.json'))
|
|
187
|
+
print('Product:', a['product_name'])
|
|
188
|
+
print('Industry:', a['industry_taxonomy']['l1'], '>', a['industry_taxonomy']['l2'], '>', a['industry_taxonomy']['l3'])
|
|
189
|
+
print('Differentiators:')
|
|
190
|
+
for d in a['differentiators']:
|
|
191
|
+
print(f' - {d}')
|
|
192
|
+
"
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Step 4b: Phase 1 -- Competitor Discovery
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
ls scripts/research.py 2>/dev/null && echo "script found" || echo "ERROR: scripts/research.py not found -- cannot continue"
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
python3 scripts/research.py \
|
|
205
|
+
--phase discover \
|
|
206
|
+
--product-analysis /tmp/cprf-product-analysis.json \
|
|
207
|
+
--tavily-key "$TAVILY_API_KEY" \
|
|
208
|
+
--output /tmp/cprf-competitors-raw.json
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Print results for AI review:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
python3 -c "
|
|
215
|
+
import json
|
|
216
|
+
data = json.load(open('/tmp/cprf-competitors-raw.json'))
|
|
217
|
+
print(f'Searches run: {len(data[\"competitor_searches\"])}')
|
|
218
|
+
for s in data['competitor_searches']:
|
|
219
|
+
print(f'\nQuery: {s[\"query\"]}')
|
|
220
|
+
print(f'Answer: {s.get(\"answer\",\"\")[:400]}')
|
|
221
|
+
for r in s.get('results', [])[:5]:
|
|
222
|
+
print(f' - {r[\"title\"]} | {r[\"url\"]}')
|
|
223
|
+
print(f' {r.get(\"content\",\"\")[:200]}')
|
|
224
|
+
"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**AI instructions:** Read the search results above. Pick exactly 5 competitor companies that:
|
|
228
|
+
1. Are named in the search result titles, answers, or snippets
|
|
229
|
+
2. Are in the same L3 niche as the product being analyzed
|
|
230
|
+
3. Are actual competing products (not agencies, consultancies, or list articles)
|
|
231
|
+
4. Are distinct from each other (not the same company under different names)
|
|
232
|
+
|
|
233
|
+
For each competitor write: `name`, `url` (from the search result where they appeared), `description` (one sentence from snippet), `source_url` (the search result URL where they were found).
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Step 5: Competitor Confirmation
|
|
238
|
+
|
|
239
|
+
**Show the discovered competitors to the user:**
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
python3 << 'PYEOF'
|
|
243
|
+
import json
|
|
244
|
+
|
|
245
|
+
analysis = json.load(open('/tmp/cprf-product-analysis.json'))
|
|
246
|
+
|
|
247
|
+
# FILL: 5 competitors from the search results above
|
|
248
|
+
candidates = [
|
|
249
|
+
# {"name": str, "url": str, "description": str, "source_url": str}
|
|
250
|
+
]
|
|
251
|
+
|
|
252
|
+
print(f"\nFound 5 competitors for {analysis['product_name']} in {analysis['industry_taxonomy']['l3']}:\n")
|
|
253
|
+
for i, c in enumerate(candidates, 1):
|
|
254
|
+
print(f" {i}. {c['name']} -- {c['description']}")
|
|
255
|
+
print(f" {c['url']}")
|
|
256
|
+
|
|
257
|
+
data = json.load(open('/tmp/cprf-competitors-raw.json'))
|
|
258
|
+
data['competitor_candidates'] = candidates
|
|
259
|
+
json.dump(data, open('/tmp/cprf-competitors-raw.json', 'w'), indent=2)
|
|
260
|
+
PYEOF
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Tell the user: "These are the 5 competitors I'll research for PR coverage. Add, remove, or swap any -- or say 'looks good' to continue."
|
|
264
|
+
|
|
265
|
+
**Wait for confirmation.** If the user edits the list (adds/removes/swaps), update the candidates accordingly. Then write the confirmed list:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
python3 << 'PYEOF'
|
|
269
|
+
import json
|
|
270
|
+
|
|
271
|
+
# FILL: confirmed competitor list (after user review)
|
|
272
|
+
confirmed = [
|
|
273
|
+
# {"name": str, "url": str}
|
|
274
|
+
]
|
|
275
|
+
|
|
276
|
+
json.dump({"confirmed_competitors": confirmed}, open('/tmp/cprf-competitors-confirmed.json', 'w'), indent=2)
|
|
277
|
+
print(f"Confirmed {len(confirmed)} competitors for PR research.")
|
|
278
|
+
for c in confirmed:
|
|
279
|
+
print(f" - {c['name']} ({c['url']})")
|
|
280
|
+
PYEOF
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Step 6: Three-Track PR Research (Phase 2)
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
python3 scripts/research.py \
|
|
289
|
+
--phase pr-research \
|
|
290
|
+
--competitors /tmp/cprf-competitors-confirmed.json \
|
|
291
|
+
--product-analysis /tmp/cprf-product-analysis.json \
|
|
292
|
+
--tavily-key "$TAVILY_API_KEY" \
|
|
293
|
+
--output /tmp/cprf-pr-raw.json
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
This runs 3 searches per competitor (15 total):
|
|
297
|
+
- **Track A (Editorial):** `"[competitor]" featured press coverage TechCrunch Forbes Wired article interview`
|
|
298
|
+
- **Track B (Podcasts):** `"[competitor]" founder CEO podcast interview appeared on episode`
|
|
299
|
+
- **Track C (Communities):** `"[competitor]" site:reddit.com OR site:news.ycombinator.com OR site:producthunt.com`
|
|
300
|
+
|
|
301
|
+
Print coverage summary:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
python3 -c "
|
|
305
|
+
import json
|
|
306
|
+
data = json.load(open('/tmp/cprf-pr-raw.json'))
|
|
307
|
+
print(f'Competitors researched: {data[\"competitors_researched\"]}')
|
|
308
|
+
print()
|
|
309
|
+
for r in data['results']:
|
|
310
|
+
print(f'{r[\"competitor\"]}:')
|
|
311
|
+
for track, tdata in r['tracks'].items():
|
|
312
|
+
n = len(tdata.get('results', []))
|
|
313
|
+
print(f' {track:12}: {n} results')
|
|
314
|
+
"
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
**If all 3 tracks for a competitor return 0 results:** This competitor has very low press coverage. Note in `data_quality_flags` and proceed -- the cross-competitor pattern will still work with the remaining 4.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Step 7: Pattern Analysis (AI)
|
|
322
|
+
|
|
323
|
+
Print all raw PR results:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
python3 -c "
|
|
327
|
+
import json
|
|
328
|
+
data = json.load(open('/tmp/cprf-pr-raw.json'))
|
|
329
|
+
for r in data['results']:
|
|
330
|
+
print(f'\n=== {r[\"competitor\"]} ===')
|
|
331
|
+
for track, tdata in r['tracks'].items():
|
|
332
|
+
print(f'\n--- Track {track.upper()} ---')
|
|
333
|
+
print(f'Query: {tdata[\"query\"]}')
|
|
334
|
+
print(f'Answer: {tdata.get(\"answer\",\"\")[:400]}')
|
|
335
|
+
for item in tdata.get('results', [])[:5]:
|
|
336
|
+
print(f' Title: {item[\"title\"]}')
|
|
337
|
+
print(f' URL: {item[\"url\"]}')
|
|
338
|
+
print(f' Snippet: {item.get(\"content\",\"\")[:200]}')
|
|
339
|
+
"
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
**AI instructions:** Read ALL search results above. Build a channel frequency map.
|
|
343
|
+
|
|
344
|
+
**Step 1 -- Normalize URLs to root domain:** `https://techcrunch.com/2023/06/article-title` → `techcrunch.com`. `https://open.spotify.com/episode/...` → identify as podcast (spotify episode). `https://www.reddit.com/r/devops/` → `reddit.com/r/devops`.
|
|
345
|
+
|
|
346
|
+
**Step 2 -- Count occurrences:** How many different competitors appeared in results from each channel root? A channel that shows up in Competitor A's Track A AND Competitor B's Track A counts as frequency 2.
|
|
347
|
+
|
|
348
|
+
**Step 3 -- Tier channels** (follow `references/tier-scoring.md`):
|
|
349
|
+
- Tier 1: appeared in 3+ competitors
|
|
350
|
+
- Tier 2: appeared in exactly 2 competitors
|
|
351
|
+
- Tier 3: appeared in 1 competitor
|
|
352
|
+
|
|
353
|
+
**Step 4 -- Extract story angles** from article/episode titles in the results. Classify each as: funding-announcement / product-launch / founder-story / trend-piece / category-creation / how-to / comparison / award. Do not infer -- only classify angles visible in the titles.
|
|
354
|
+
|
|
355
|
+
**Step 5 -- Classify channel type** for each: editorial / podcast / community / newsletter.
|
|
356
|
+
|
|
357
|
+
Write to `/tmp/cprf-pr-patterns.json`:
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
python3 << 'PYEOF'
|
|
361
|
+
import json
|
|
362
|
+
|
|
363
|
+
patterns = {
|
|
364
|
+
"tier_1_channels": [
|
|
365
|
+
# FILL -- channels appearing in 3+ competitors
|
|
366
|
+
# Each: {"channel_name": str, "channel_url": str, "channel_type": str,
|
|
367
|
+
# "frequency": int, "found_in_competitors": [str],
|
|
368
|
+
# "evidence_urls": [str], "story_angles_used": [str],
|
|
369
|
+
# "journalist_name": "", "journalist_beat": ""}
|
|
370
|
+
],
|
|
371
|
+
"tier_2_channels": [
|
|
372
|
+
# FILL -- channels appearing in exactly 2 competitors
|
|
373
|
+
# Each: {"channel_name": str, "channel_url": str, "channel_type": str,
|
|
374
|
+
# "frequency": 2, "found_in_competitors": [str], "evidence_urls": [str],
|
|
375
|
+
# "story_angles_used": [str]}
|
|
376
|
+
],
|
|
377
|
+
"tier_3_channels": [
|
|
378
|
+
# FILL -- channels appearing in only 1 competitor (name + URL only)
|
|
379
|
+
# Each: {"channel_name": str, "channel_url": str, "found_in_competitor": str}
|
|
380
|
+
],
|
|
381
|
+
"data_quality_flags": []
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
json.dump(patterns, open('/tmp/cprf-pr-patterns.json', 'w'), indent=2)
|
|
385
|
+
PYEOF
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
Verify:
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
python3 -c "
|
|
392
|
+
import json
|
|
393
|
+
p = json.load(open('/tmp/cprf-pr-patterns.json'))
|
|
394
|
+
print(f'Tier 1 channels: {len(p[\"tier_1_channels\"])}')
|
|
395
|
+
for ch in p['tier_1_channels']:
|
|
396
|
+
print(f' {ch[\"frequency\"]}x {ch[\"channel_name\"]} ({ch[\"channel_type\"]}) -- {ch[\"found_in_competitors\"]}')
|
|
397
|
+
print(f'Tier 2 channels: {len(p[\"tier_2_channels\"])}')
|
|
398
|
+
print(f'Tier 3 channels: {len(p[\"tier_3_channels\"])}')
|
|
399
|
+
"
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
**If fewer than 3 Tier 1 channels:** This is normal for niche markets. Promote the top Tier 2 channels (highest frequency) to get to at least 3 total channels with deep dives. Note the promotion in `data_quality_flags`.
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## Step 8: Journalist / Host Lookup
|
|
407
|
+
|
|
408
|
+
For each Tier 1 channel (up to 7), run one targeted Tavily search:
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
python3 << 'PYEOF'
|
|
412
|
+
import json, os, urllib.request
|
|
413
|
+
|
|
414
|
+
patterns = json.load(open('/tmp/cprf-pr-patterns.json'))
|
|
415
|
+
analysis = json.load(open('/tmp/cprf-product-analysis.json'))
|
|
416
|
+
l2 = analysis['industry_taxonomy']['l2']
|
|
417
|
+
l3 = analysis['industry_taxonomy']['l3']
|
|
418
|
+
tavily_key = os.environ.get('TAVILY_API_KEY', '')
|
|
419
|
+
|
|
420
|
+
lookup_results = []
|
|
421
|
+
|
|
422
|
+
for channel in patterns.get('tier_1_channels', [])[:7]:
|
|
423
|
+
name = channel['channel_name']
|
|
424
|
+
ctype = channel['channel_type']
|
|
425
|
+
|
|
426
|
+
if ctype == 'editorial':
|
|
427
|
+
query = f'"{name}" journalist reporter writer covers {l2} {l3} startups technology'
|
|
428
|
+
elif ctype == 'podcast':
|
|
429
|
+
query = f'"{name}" podcast host interviewer {l2} {l3} founders'
|
|
430
|
+
else:
|
|
431
|
+
query = f'"{name}" moderator community manager {l2} {l3}'
|
|
432
|
+
|
|
433
|
+
payload = json.dumps({
|
|
434
|
+
"api_key": tavily_key,
|
|
435
|
+
"query": query,
|
|
436
|
+
"search_depth": "basic",
|
|
437
|
+
"max_results": 5
|
|
438
|
+
}).encode()
|
|
439
|
+
|
|
440
|
+
req = urllib.request.Request(
|
|
441
|
+
'https://api.tavily.com/search',
|
|
442
|
+
data=payload,
|
|
443
|
+
headers={'Content-Type': 'application/json'},
|
|
444
|
+
method='POST'
|
|
445
|
+
)
|
|
446
|
+
try:
|
|
447
|
+
with urllib.request.urlopen(req, timeout=20) as resp:
|
|
448
|
+
data = json.loads(resp.read())
|
|
449
|
+
lookup_results.append({
|
|
450
|
+
'channel': name,
|
|
451
|
+
'channel_type': ctype,
|
|
452
|
+
'query': query,
|
|
453
|
+
'answer': data.get('answer', ''),
|
|
454
|
+
'results': [
|
|
455
|
+
{'title': r['title'], 'url': r['url'], 'content': r.get('content', '')[:400]}
|
|
456
|
+
for r in data.get('results', [])[:3]
|
|
457
|
+
]
|
|
458
|
+
})
|
|
459
|
+
print(f'Journalist lookup -- {name}: {len(data.get("results", []))} results')
|
|
460
|
+
except Exception as e:
|
|
461
|
+
lookup_results.append({
|
|
462
|
+
'channel': name, 'channel_type': ctype,
|
|
463
|
+
'query': query, 'answer': '', 'results': [], 'error': str(e)
|
|
464
|
+
})
|
|
465
|
+
print(f'Journalist lookup -- {name}: FAILED ({e})')
|
|
466
|
+
|
|
467
|
+
json.dump(lookup_results, open('/tmp/cprf-journalist-results.json', 'w'), indent=2)
|
|
468
|
+
print(f'Journalist lookups complete: {len(lookup_results)} channels')
|
|
469
|
+
PYEOF
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
Print results for AI extraction:
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
python3 -c "
|
|
476
|
+
import json
|
|
477
|
+
results = json.load(open('/tmp/cprf-journalist-results.json'))
|
|
478
|
+
for r in results:
|
|
479
|
+
print(f'\n=== {r[\"channel\"]} ({r[\"channel_type\"]}) ===')
|
|
480
|
+
print(f'Answer: {r.get(\"answer\",\"\")[:400]}')
|
|
481
|
+
for item in r.get('results', []):
|
|
482
|
+
print(f' {item[\"title\"]}')
|
|
483
|
+
print(f' {item.get(\"content\",\"\")[:300]}')
|
|
484
|
+
"
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
**AI instructions:** For each Tier 1 channel, extract from the search results above:
|
|
488
|
+
- `journalist_name`: the person's name verbatim from a snippet. Write "not found in search data" if absent -- do NOT fill from training knowledge.
|
|
489
|
+
- `journalist_beat`: what topics they cover, extracted from snippet text. Write "not found in search data" if absent.
|
|
490
|
+
|
|
491
|
+
Update `/tmp/cprf-pr-patterns.json` with `journalist_name` and `journalist_beat` populated for each Tier 1 channel:
|
|
492
|
+
|
|
493
|
+
```bash
|
|
494
|
+
python3 << 'PYEOF'
|
|
495
|
+
import json
|
|
496
|
+
|
|
497
|
+
patterns = json.load(open('/tmp/cprf-pr-patterns.json'))
|
|
498
|
+
|
|
499
|
+
# FILL: update journalist_name and journalist_beat for each tier_1 channel
|
|
500
|
+
# journalist_name and journalist_beat come from search snippet text only
|
|
501
|
+
# Write "not found in search data" if the snippets don't name a person
|
|
502
|
+
|
|
503
|
+
# Example:
|
|
504
|
+
# patterns['tier_1_channels'][0]['journalist_name'] = 'Ingrid Lunden'
|
|
505
|
+
# patterns['tier_1_channels'][0]['journalist_beat'] = 'enterprise software and developer tools'
|
|
506
|
+
|
|
507
|
+
json.dump(patterns, open('/tmp/cprf-pr-patterns.json', 'w'), indent=2)
|
|
508
|
+
print('Journalist data updated.')
|
|
509
|
+
for ch in patterns['tier_1_channels']:
|
|
510
|
+
print(f" {ch['channel_name']}: {ch.get('journalist_name','--')} | {ch.get('journalist_beat','--')}")
|
|
511
|
+
PYEOF
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
## Step 9: Synthesis -- Generate Outreach Packages (AI)
|
|
517
|
+
|
|
518
|
+
Print consolidated data:
|
|
519
|
+
|
|
520
|
+
```bash
|
|
521
|
+
python3 -c "
|
|
522
|
+
import json
|
|
523
|
+
|
|
524
|
+
analysis = json.load(open('/tmp/cprf-product-analysis.json'))
|
|
525
|
+
patterns = json.load(open('/tmp/cprf-pr-patterns.json'))
|
|
526
|
+
|
|
527
|
+
print('=== PRODUCT ===')
|
|
528
|
+
print(f'Name: {analysis[\"product_name\"]}')
|
|
529
|
+
print(f'What it does: {analysis[\"one_line_description\"]}')
|
|
530
|
+
print(f'Differentiators:')
|
|
531
|
+
for d in analysis['differentiators']:
|
|
532
|
+
print(f' - {d}')
|
|
533
|
+
print(f'ICP: {analysis[\"icp\"]}')
|
|
534
|
+
print(f'Geography: {analysis[\"geography_bias\"]}')
|
|
535
|
+
print()
|
|
536
|
+
print('=== TIER 1 CHANNELS ===')
|
|
537
|
+
for ch in patterns['tier_1_channels']:
|
|
538
|
+
print(f'\n{ch[\"channel_name\"]} ({ch[\"channel_type\"]}, freq={ch[\"frequency\"]})')
|
|
539
|
+
print(f' Found in: {ch[\"found_in_competitors\"]}')
|
|
540
|
+
print(f' Evidence URLs: {ch[\"evidence_urls\"][:3]}')
|
|
541
|
+
print(f' Story angles: {ch[\"story_angles_used\"]}')
|
|
542
|
+
print(f' Journalist: {ch.get(\"journalist_name\",\"not found\")} | {ch.get(\"journalist_beat\",\"\")}')
|
|
543
|
+
print()
|
|
544
|
+
print('=== TIER 2 CHANNELS ===')
|
|
545
|
+
for ch in patterns['tier_2_channels']:
|
|
546
|
+
print(f' {ch[\"channel_name\"]} ({ch[\"channel_type\"]}) -- found in {ch[\"found_in_competitors\"]}')
|
|
547
|
+
"
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
**AI instructions -- zero-hallucination rules:**
|
|
551
|
+
|
|
552
|
+
1. **Channel names:** Only include channels from `/tmp/cprf-pr-patterns.json`. No invented channels.
|
|
553
|
+
2. **Journalist/host names:** Use only what was populated in Step 8. Write "not found in search data" if blank. Do NOT substitute from training knowledge.
|
|
554
|
+
3. **Story angles:** Use only angles extracted from article/episode titles in the search results. Do not infer from training knowledge.
|
|
555
|
+
4. **Cold pitch drafts:** Must reference (a) a specific story angle from the evidence, (b) at least one specific differentiator from the product analysis, (c) the journalist's beat if found. No generic "we'd love to be featured" or "our product is revolutionary" language.
|
|
556
|
+
5. **Channel overview:** 1-2 sentences from search snippets only. Write "not found in search data" if the snippets don't describe the channel's coverage focus.
|
|
557
|
+
6. **Bonus hooks:** 3 angles that your competitors did NOT use in their coverage. These must be grounded in the product's actual differentiators from Step 4 -- not generic advice.
|
|
558
|
+
7. No em dashes. No banned words (powerful, seamless, game-changing, revolutionary, cutting-edge, leverage, transform).
|
|
559
|
+
|
|
560
|
+
**Per Tier 1 channel generate:**
|
|
561
|
+
- `channel_overview`: 1-2 sentences about coverage focus (from snippets)
|
|
562
|
+
- `why_they_covered_competitors`: specific angle extracted from evidence titles
|
|
563
|
+
- `journalist_name` + `journalist_beat`
|
|
564
|
+
- `approach_method`: cold email / podcast pitch form / community post / LinkedIn DM (based on channel type)
|
|
565
|
+
- `cold_pitch_draft`:
|
|
566
|
+
- `subject`: "[Journalist name]: [their beat] + [your specific angle]"
|
|
567
|
+
- `body`: 3-4 sentences. Structure: hook (reference their past coverage of a competitor) + what you do (one sentence) + why it fits their beat (tie to a specific differentiator) + ask (clear, low-friction CTA)
|
|
568
|
+
|
|
569
|
+
**Also generate `bonus_hooks`**: 3 pitch angles not used by any competitor in the search results. Base each on a specific product differentiator.
|
|
570
|
+
|
|
571
|
+
Write to `/tmp/cprf-final.json`:
|
|
572
|
+
|
|
573
|
+
```bash
|
|
574
|
+
python3 << 'PYEOF'
|
|
575
|
+
import json
|
|
576
|
+
|
|
577
|
+
result = {
|
|
578
|
+
"product_summary": {
|
|
579
|
+
# FILL from analysis
|
|
580
|
+
},
|
|
581
|
+
"competitors_researched": [], # FILL: names of confirmed competitors
|
|
582
|
+
"tier_1_deep_dives": [
|
|
583
|
+
# FILL per tier 1 channel:
|
|
584
|
+
# {
|
|
585
|
+
# "channel_name": str,
|
|
586
|
+
# "channel_type": str, # editorial / podcast / community
|
|
587
|
+
# "frequency": int,
|
|
588
|
+
# "found_in_competitors": [str],
|
|
589
|
+
# "evidence_urls": [str],
|
|
590
|
+
# "channel_overview": str,
|
|
591
|
+
# "why_they_covered_competitors": str,
|
|
592
|
+
# "story_angles_used": [str],
|
|
593
|
+
# "journalist_name": str,
|
|
594
|
+
# "journalist_beat": str,
|
|
595
|
+
# "approach_method": str,
|
|
596
|
+
# "cold_pitch_draft": {"subject": str, "body": str}
|
|
597
|
+
# }
|
|
598
|
+
],
|
|
599
|
+
"tier_2_channels": [
|
|
600
|
+
# FILL: {channel_name, channel_type, frequency, found_in_competitors, evidence_urls}
|
|
601
|
+
],
|
|
602
|
+
"tier_3_channels": [
|
|
603
|
+
# FILL: {channel_name, found_in_competitor}
|
|
604
|
+
],
|
|
605
|
+
"bonus_hooks": [
|
|
606
|
+
# FILL: 3 strings -- pitch angles not used by competitors
|
|
607
|
+
],
|
|
608
|
+
"data_quality_flags": []
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
json.dump(result, open('/tmp/cprf-final.json', 'w'), indent=2)
|
|
612
|
+
print(f'Synthesis written.')
|
|
613
|
+
print(f'Tier 1 deep dives: {len(result.get("tier_1_deep_dives", []))}')
|
|
614
|
+
print(f'Bonus hooks: {len(result.get("bonus_hooks", []))}')
|
|
615
|
+
PYEOF
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
---
|
|
619
|
+
|
|
620
|
+
## Step 10: Self-QA, Present, and Save
|
|
621
|
+
|
|
622
|
+
**Self-QA:**
|
|
623
|
+
|
|
624
|
+
```bash
|
|
625
|
+
python3 << 'PYEOF'
|
|
626
|
+
import json
|
|
627
|
+
|
|
628
|
+
result = json.load(open('/tmp/cprf-final.json'))
|
|
629
|
+
failures = []
|
|
630
|
+
|
|
631
|
+
# Check 1: em dashes
|
|
632
|
+
full_text = json.dumps(result)
|
|
633
|
+
if '—' in full_text:
|
|
634
|
+
result = json.loads(full_text.replace('—', '-'))
|
|
635
|
+
failures.append('Fixed: em dashes replaced with hyphens')
|
|
636
|
+
|
|
637
|
+
# Check 2: banned words
|
|
638
|
+
banned = ['powerful', 'seamless', 'innovative', 'game-changing', 'revolutionize',
|
|
639
|
+
'excited to announce', 'cutting-edge', 'best-in-class', 'world-class',
|
|
640
|
+
'leverage', 'transform', 'disrupt']
|
|
641
|
+
for word in banned:
|
|
642
|
+
if word.lower() in json.dumps(result).lower():
|
|
643
|
+
failures.append(f'Warning: banned word "{word}" found in output -- review before presenting')
|
|
644
|
+
|
|
645
|
+
# Check 3: cold pitch subjects exist
|
|
646
|
+
for dd in result.get('tier_1_deep_dives', []):
|
|
647
|
+
pitch = dd.get('cold_pitch_draft', {})
|
|
648
|
+
if not pitch.get('subject') or len(pitch.get('subject', '')) < 10:
|
|
649
|
+
dd['cold_pitch_draft']['subject'] = 'not generated'
|
|
650
|
+
failures.append(f'Fixed: missing subject line for {dd.get("channel_name")}')
|
|
651
|
+
if not pitch.get('body') or len(pitch.get('body', '')) < 50:
|
|
652
|
+
failures.append(f'Warning: very short pitch body for {dd.get("channel_name")}')
|
|
653
|
+
|
|
654
|
+
# Check 4: bonus hooks count
|
|
655
|
+
if len(result.get('bonus_hooks', [])) != 3:
|
|
656
|
+
failures.append(f'Expected 3 bonus hooks, got {len(result.get("bonus_hooks", []))}')
|
|
657
|
+
|
|
658
|
+
# Check 5: "not found in search data" count
|
|
659
|
+
nf_count = json.dumps(result).count('not found in search data')
|
|
660
|
+
if nf_count > 0:
|
|
661
|
+
failures.append(f'INFO: {nf_count} field(s) marked "not found in search data" -- verify before outreach')
|
|
662
|
+
|
|
663
|
+
# Check 6: tier 1 channels have evidence URLs
|
|
664
|
+
for ch in result.get('tier_1_deep_dives', []):
|
|
665
|
+
if not ch.get('evidence_urls'):
|
|
666
|
+
failures.append(f'Warning: {ch["channel_name"]} has no evidence_urls')
|
|
667
|
+
|
|
668
|
+
if 'data_quality_flags' not in result:
|
|
669
|
+
result['data_quality_flags'] = []
|
|
670
|
+
result['data_quality_flags'].extend(failures)
|
|
671
|
+
|
|
672
|
+
json.dump(result, open('/tmp/cprf-final.json', 'w'), indent=2)
|
|
673
|
+
print(f'QA complete. {len(failures)} issues addressed.')
|
|
674
|
+
for f in failures:
|
|
675
|
+
print(f' - {f}')
|
|
676
|
+
if not failures:
|
|
677
|
+
print('All QA checks passed.')
|
|
678
|
+
PYEOF
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
**Present the output:**
|
|
682
|
+
|
|
683
|
+
```
|
|
684
|
+
## PR Intel: [product_name]
|
|
685
|
+
Date: [today] | Competitors researched: [N] | Tier 1 channels: [N] | Tier 2 channels: [N]
|
|
686
|
+
|
|
687
|
+
---
|
|
688
|
+
|
|
689
|
+
### Your Product
|
|
690
|
+
[one_line_description]
|
|
691
|
+
Differentiators: [list]
|
|
692
|
+
Competitors researched: [names]
|
|
693
|
+
|
|
694
|
+
---
|
|
695
|
+
|
|
696
|
+
### Tier 1 Channels (Proven Beats -- Found in 3+ Competitors)
|
|
697
|
+
|
|
698
|
+
*These channels have already covered multiple companies in your space.*
|
|
699
|
+
|
|
700
|
+
| Channel | Type | Found in | Journalist/Host | Approach |
|
|
701
|
+
|---|---|---|---|---|
|
|
702
|
+
[one row per tier 1 channel]
|
|
703
|
+
|
|
704
|
+
---
|
|
705
|
+
|
|
706
|
+
### Deep Dives + Cold Pitches
|
|
707
|
+
|
|
708
|
+
#### 1. [Channel Name] (Tier 1 -- [Type], found in [N] competitors)
|
|
709
|
+
|
|
710
|
+
Covers: [channel_overview]
|
|
711
|
+
Covered competitors: [found_in_competitors with evidence URLs]
|
|
712
|
+
Story angle they used: [why_they_covered_competitors]
|
|
713
|
+
Journalist/Host: [journalist_name] | Beat: [journalist_beat]
|
|
714
|
+
How to reach: [approach_method]
|
|
715
|
+
|
|
716
|
+
**Cold pitch:**
|
|
717
|
+
Subject: [subject]
|
|
718
|
+
|
|
719
|
+
[body -- 3-4 sentences]
|
|
720
|
+
|
|
721
|
+
---
|
|
722
|
+
|
|
723
|
+
[repeat for each tier 1 channel]
|
|
724
|
+
|
|
725
|
+
---
|
|
726
|
+
|
|
727
|
+
### Tier 2 Channels (Warm -- Found in 2 Competitors)
|
|
728
|
+
|
|
729
|
+
| Channel | Type | Found in | URL |
|
|
730
|
+
|---|---|---|---|
|
|
731
|
+
[one row per tier 2 channel]
|
|
732
|
+
|
|
733
|
+
---
|
|
734
|
+
|
|
735
|
+
### Tier 3 Channels (Discovery -- Found in 1 Competitor)
|
|
736
|
+
|
|
737
|
+
[comma-separated list of channel names with URLs]
|
|
738
|
+
|
|
739
|
+
---
|
|
740
|
+
|
|
741
|
+
### 3 Bonus Hooks (Angles Your Competitors Didn't Use)
|
|
742
|
+
|
|
743
|
+
1. [hook_text]
|
|
744
|
+
2. [hook_text]
|
|
745
|
+
3. [hook_text]
|
|
746
|
+
|
|
747
|
+
---
|
|
748
|
+
Data notes: [data_quality_flags, or "None"]
|
|
749
|
+
Saved to: docs/pr-intel/[PRODUCT_SLUG]-[DATE].md
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
**Save to file and clean up:**
|
|
753
|
+
|
|
754
|
+
```bash
|
|
755
|
+
DATE=$(date +%Y-%m-%d)
|
|
756
|
+
OUTPUT_FILE="docs/pr-intel/${PRODUCT_SLUG}-${DATE}.md"
|
|
757
|
+
mkdir -p docs/pr-intel
|
|
758
|
+
echo "Saved to: $OUTPUT_FILE"
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
```bash
|
|
762
|
+
rm -f /tmp/cprf-product-raw.md /tmp/cprf-product-analysis.json \
|
|
763
|
+
/tmp/cprf-competitors-raw.json /tmp/cprf-competitors-confirmed.json \
|
|
764
|
+
/tmp/cprf-pr-raw.json /tmp/cprf-pr-patterns.json \
|
|
765
|
+
/tmp/cprf-journalist-results.json /tmp/cprf-final.json
|
|
766
|
+
echo "Temp files cleaned up."
|
|
767
|
+
```
|