Skip to content

heymegabyte/agent-skills / skills/blog-publishing

blog-publishing

Flagged

Shared research-driven editorial and blog publishing system for the Megabyte Labs ecosystem (@theme-tools/blog, ui.theme.tools, and adopting Cloudflare Workers sites). Activate when generating, researching, citing, illustrating, editing in Plate/Slate, or scheduling 2,000–3,000+ word reference articles with live DataForSEO v3 keyword intelligence, claim-level citations, 30 visual applications (E01–E30), and 3 daily publishing slots.

references/topic-selection.md

View on GitHub
# Topic Selection, 15-Idea Slate, and Atomic Reservation (`A01–A30`)

Implementation module: `@theme-tools/blog/topic-strategy` (`packages/blog/src/topic-strategy.ts`).

## 1. Site Editorial Charter (`A01–A06`)

Every adopting repository defines a `SiteEditorialCharter` (`SiteEditorialCharterSchema`):

- `siteId` & `tenantId`: Canonical tenant/site identifiers (e.g., `"theme.tools"`).
- `editorialPillars`: Weighted topic pillars with target share ratios (`targetShareRatio`), audience persona levels, and pillar-specific quality criteria.
- `disallowedTopics`: Explicit out-of-bounds topics, YMYL exclusions, and competitor-defamation blocks.
- `targetLocationCode` (`2840` US default) and `targetLanguageCode` (`"en"`).

## 2. Mandatory 15-Idea Research Prompt (`A07–A10`)

Before drafting any article, run the 15-idea generation pass (`selectAndReserveFromFifteenSlate`):

> “Based on fresh, heavy web research, propose the best 15 distinct blog article ideas related to this seed. For each, identify the reader's problem, search intent, original contribution, evidence available, useful visual opportunities, and overlap with existing or planned articles. Rank them and choose the strongest eligible idea.”

Each of the 15 candidates (`IdeaCandidateSchema`) must record:

- `candidateRank` (`1..15`)
- `headline`, `proposedSlug`, `targetPrimaryKeyword`
- `readerProblem`, `searchIntent`, `originalContribution`
- `availablePrimarySources` (minimum 2 primary specification/empirical sources)
- `visualOpportunities` (mapped to `E01–E30` application codes)
- `scores`: `audienceFit`, `searchOpportunity`, `originality`, `evidenceStrength`, `visualRichness`, `productRelevance`, `overlapPenalty` (`0..100`)

## 3. Weighted Editorial Ranking Formula (`A09`)

`computeWeightedEditorialScore` computes a deterministic 0–100 score:

```ts
score =
  audienceFit * 0.20 +
  searchOpportunity * 0.18 +
  originality * 0.18 +
  evidenceStrength * 0.18 +
  visualRichness * 0.14 +
  productRelevance * 0.12 -
  overlapPenalty * 0.35
```

## 4. Cannibalization & Overlap Detection (`A11–A14`)

`evaluateCandidateOverlap` checks candidate #1 against all `published`, `drafted`, `scheduled`, and `reserved` articles:

1. **Exact Slug or Primary Keyword Collision**: Immediate rejection (`overlapScore = 1.0`).
2. **Cosine / Token Jaccard Similarity >= 0.68**: Flags substantial overlap (`recommendedAction: "update_existing"` or `"fallback_next_candidate"`).
3. **Sequential Fallback**: If candidate #1 overlaps, evaluate candidate #2, then #3..#15. If all 15 overlap, return `recommendedAction: "refresh_existing_article"` rather than manufacturing a duplicate page to fill a daily slot.

## 5. Atomic Topic Reservation (`A14`)

Before spending DataForSEO SERP or image-generation budget, call `AtomicTopicReservationStore.tryReserve()`:

- Acquires a TTL-scoped lock (`leaseExpiresAt`) keyed by normalized `siteId + primaryKeyword + canonicalSlug`.
- Prevents concurrent Cloudflare Workflow workers from researching or drafting the same topic simultaneously.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall