npx skills add ...
npx skills add infrasity-labs/dev-gtm-claude-skills --skill blog-post-counter
Counts and compares blog posts across a target and competitors, audits content freshness via sitemap lastmod dates, and maps competitor organic keywords (US, non-branded, informational) against the target to surface ranking gaps. Use when asked to compare blog counts, content volume, publishing cadence, content freshness, keyword mapping, keyword gap analysis, or competitor keyword reports — e.g. "how many blog posts does X have vs Y", "how fresh is content on X", "where does [target] rank for [competitor] keywords", "keyword gap between X and Y". Works from company names alone. Always use for blog comparison, freshness audits, and keyword mapping tasks.
npx skills add infrasity-labs/dev-gtm-claude-skills --skill blog-post-counter
Two workflows in one skill:
For each company name provided:
curl -sL "https://<likely-domain>/robots.txt" to confirm the site exists and find the sitemap. If that 404s, do a quick web search for "<company name>" official website to get the correct domain.From the robots.txt, extract the Sitemap: line(s). Common patterns:
Sitemap: https://example.com/sitemap.xmlSitemap: lines, or a sitemap-index.xml that references sub-sitemapsIf no sitemap is in robots.txt, try these fallbacks in order:
Fetch the sitemap and count URLs that are blog posts. Use this bash pattern:
Important: Exclude the blog index page itself (e.g. /blog or /blog/) — count only individual post URLs.
Sitemap index handling: If the sitemap is an index (contains <sitemap> tags rather than <url> tags), extract the sub-sitemap URLs and fetch the blog-specific one:
JS-rendered sites: Some blog pages render via JavaScript and may not expose counts through sitemaps. In that case, fall back to site:example.com/blog search operator to estimate.
Edge cases:
/resources/, /insights/, /learn/, or /hub/ instead of /blog/ — check the sitemap structure if a /blog/ grep returns 0.Once all counts are collected, produce a ranked table with the target company highlighted:
Then add a brief summary:
Run this audit whenever the user asks about content freshness, recency, publishing cadence, or when it adds useful context to the blog count comparison.
For each domain, extract only blog post URLs and their lastmod dates from the sitemap:
Before treating lastmod dates as real signals, check whether they are genuine per-post edit dates or build-time bulk stamps:
Build-time stamps = all (or nearly all) blog posts share the same date, usually within a narrow time window (seconds to minutes). This is common with Next.js/Vercel and similar SSG frameworks that regenerate the sitemap on every deploy. These dates do NOT reflect when content was actually written or updated.
Real dates = each post has a distinct lastmod that varies across weeks or months. These are trustworthy freshness signals.
Always flag build-time stamps clearly in the output so the user understands the dates are not meaningful for SEO or content analysis.
Using today's date, bucket each blog post's lastmod into:
| Bucket | Age |
|---|---|
| Last 30 days | < 30 days old |
| 30–90 days | 30–89 days old |
| 91–180 days | 90–179 days old |
| 181–365 days | 180–364 days old |
| Over 365 days | 365+ days old |
Also compute:
YYYY-MM to show volume over timeProduce a per-domain freshness summary alongside (or below) the blog count table. Use the visualiser to render a side-by-side comparison widget when comparing multiple domains. The widget must show:
SEO freshness interpretation to include in the summary:
/blog index page should never be counted as a post.Maps a competitor's organic keyword footprint against a target domain to surface content gaps and ranking opportunities.
Pull org_keywords and org_traffic for both competitor and target via Ahrefs site-explorer-metrics:
Do this for both domains. The org_keywords count tells you how many batches you'll need to capture the full keyword set.
Pull the competitor's full keyword set using Ahrefs site-explorer-organic-keywords with these fixed filters:
Pull multiple batches using different order_by values to maximize coverage:
order_by: sum_traffic:descorder_by: volume:descorder_by: best_position:ascAfter each batch, deduplicate by keyword across all batches collected so far. Keep the entry with the lowest (best) best_position per keyword.
Continue batching until no new keywords appear across two consecutive batches, or until batch count exceeds the expected keyword universe from Step 1.
Exact same pull for the target domain — same filters, same multiple sort orderings, same deduplication logic.
Store the result as a lookup map: { keyword → { best_position, sum_traffic, best_position_url } }
For each competitor keyword from Step 2, look it up in the target map from Step 3. Assign a status:
Both rank:
WINNING — target position < competitor position (target is ahead)IMPROVE — competitor position < target position (competitor is ahead)Target does not rank:
CRITICAL — volume ≥ 1,000HIGH — volume 500–999MEDIUM — volume 200–499LOW — volume 100–199NEW — volume < 100Each row in the output represents one competitor keyword. Fields per row:
keywordvolumecompetitor_rank (best_position)competitor_traffic (sum_traffic)target_rank (best_position, or null)target_traffic (sum_traffic, or null)target_url (best_position_url, or null)statusis_branded=false and is_informational=true filters are applied at pull time — not as post-processing. This keeps the dataset clean from the start.Both workflows feed into a single HTML report file. Run Workflow A and Workflow B fully first, collect all data, then generate the report in one pass.
[Target] vs [Competitor] — Content & Keyword Reportorg_keywords and org_traffic for each.html file — no external dependencies except Google Fonts CDN/mnt/user-data/outputs/report-[target]-vs-[competitor].htmlpresent_files after savingcurl -sL -A "Mozilla/5.0" "https://example.com/sitemap-index.xml" \
| grep -o '<loc>[^<]*</loc>' \
| grep -i 'blog'
# Then fetch that sub-sitemap and countBlog Post Count — [Target] vs Competitors
==========================================
Rank Company Posts URL
──── ─────────────── ────── ──────────────────────
1 Hackmamba 137 hackmamba.io ← COMPETITOR
2 Infrasity 137 infrasity.com ← COMPETITOR
3 ▶ Kubiya 95 kubiya.ai ← TARGET
4 Orgn 7 orgn.com ← COMPETITOR
▶ = your company Total companies analysed: 4curl -sL "https://example.com/sitemap.xml" \
| python3 -c "
import sys, re
content = sys.stdin.read()
urls = re.findall(r'<url>(.*?)</url>', content, re.DOTALL)
for u in urls:
loc = re.search(r'<loc>(.*?)</loc>', u)
lastmod = re.search(r'<lastmod>(.*?)</lastmod>', u)
if loc and lastmod:
l = loc.group(1)
if re.search(r'/blog/|/posts?/|/articles?/|/news/', l) and not re.match(r'https?://[^/]+/(blog|posts?|articles?|news)/?$', l):
print(lastmod.group(1), l)
"from datetime import datetime, timezone
dates = [...] # all lastmod values for blog posts
unique_dates = set(d[:10] for d in dates) # compare date part only
if not dates:
stamp_type = "UNKNOWN"
elif len(unique_dates) <= 3:
# Likely build-time stamps — flag as unreliable
stamp_type = "BUILD-TIME"
else:
stamp_type = "REAL"from datetime import datetime, timezone
today = datetime.now(timezone.utc)
buckets = {"<30d": 0, "30-90d": 0, "91-180d": 0, "181-365d": 0, ">365d": 0}
for date_str in lastmod_dates:
dt = datetime.fromisoformat(date_str.replace('Z', '+00:00'))
if dt.tzinfo is None:
dt = dt.replace(tzinfo=timezone.utc)
days = (today - dt).days
if days < 30: buckets["<30d"] += 1
elif days < 90: buckets["30-90d"] += 1
elif days < 180: buckets["91-180d"] += 1
elif days < 365: buckets["181-365d"] += 1
else: buckets[">365d"] += 1tool: site-explorer-metrics
params:
target: <domain>
mode: subdomains
date: <latest>
select: org_keywords, org_traffictool: site-explorer-organic-keywords
params:
target: <competitor domain>
country: us
mode: subdomains
is_branded: false
is_informational: true
limit: 500
select: keyword, volume, best_position, sum_traffic, best_position_url, is_brandedtool: site-explorer-organic-keywords
params:
target: <target domain>
country: us
mode: subdomains
is_branded: false
is_informational: true
limit: 500
select: keyword, volume, best_position, sum_traffic, best_position_url, is_branded