Skip to content

heymegabyte/agent-skills / 06-build-and-slice-loop

build-and-slice-loop

Verified

Use when implementing features or streaming OnePrompt site builds. Complete vertical slices with real content, strict TypeScript and Zod. Parallel section/data work, deterministic assembly, granular patches and immediate valid previews.

FileKindSize
SKILL.mdskill md7.2 KB
admin-dashboard.mdmarkdown5.5 KB
ai-chat-widget.mdmarkdown6.0 KB
blog-and-content-engine.mdmarkdown6.2 KB
build-breaking-rules.mdmarkdown7.4 KB
chat-native-dashboard.mdmarkdown3.6 KB
contact-forms-and-endpoints.mdmarkdown6.7 KB
copilot-and-ai-features.mdmarkdown7.4 KB
custom-error-pages.mdmarkdown4.5 KB
data-tables.mdmarkdown7.7 KB
domain-provisioning.mdmarkdown4.6 KB
easter-eggs.mdmarkdown4.7 KB
empty-states-and-loading.mdmarkdown5.7 KB
file-uploads-and-storage.mdmarkdown6.7 KB
internationalization.mdmarkdown4.3 KB
keyboard-shortcuts-and-command-palette.mdmarkdown6.7 KB
microcopy-library.mdmarkdown8.0 KB
notification-center.mdmarkdown8.4 KB
onboarding-and-first-run.mdmarkdown5.0 KB
pre-digested-builds.mdmarkdown3.6 KB
pwa-kit.mdmarkdown6.8 KB
realtime-and-websockets.mdmarkdown7.2 KB
rich-text-editor.mdmarkdown7.4 KB
site-search.mdmarkdown4.0 KB
stripe-first-donations.mdmarkdown10.7 KB
web-manifest-system.mdmarkdown11.9 KB
webhook-system.mdmarkdown9.5 KB

blog-and-content-engine.md

View on GitHub
---
name: "Blog and Content Engine"
version: "2.0.0"
updated: "2026-04-23"
description: "SEO-driven blog system on Cloudflare Workers: markdown-to-HTML rendering, RSS feed, reading time, social sharing, related posts, categories, pagination. Every post targets a longtail keyword. Generates 3-5 seed posts on first build for immediate SEO value. Stored in D1 or as static markdown files."
---

# Blog and Content Engine (`@theme-tools/blog` — `skills/blog-publishing/SKILL.md`)

> [!IMPORTANT]
> **Canonical Blog Publishing Contract (`skills/blog-publishing/SKILL.md` + `references/editorial-writing.md`)**:
> Every newly generated or authored blog / reference article across the Megabyte Labs ecosystem MUST satisfy `@theme-tools/blog`:
> 1. **2,000–3,000+ Substantive Editorial Words (`D01–D03`, NON-NEGOTIABLE)**: `computeSubstantiveWordCount >= 2000` (excluding navigation, bibliography, table cells, captions, code blocks, alt text, and boilerplate). **Never settle for 600–900 word thin blog posts.**
> 2. **~12 Substantive Visual Placements (`E01–E30`)**: 8–12 custom images plus deterministic SVG charts, comparison tables, interactive calculators, and product captures.
> 3. **Live or Valid Cached DataForSEO v3 Brief (`B01–B30`)** (`isFixture: false` required for production release).
> 4. **Claim-Level Citations (`C01–C30`)**: Inline `CitationNode` (`[n]`) mapped to `SourceVersion` + `EvidenceReference` and rendered in the bottom `BibliographyWidget`.
> 5. **3 Daily Publishing Slots (`09:00`, `14:00`, `19:00` `America/New_York`)** & **12-Check Release Gate (`runQualityAndReleaseGate`)**.
> Always load `~/.agentskills/skills/blog-publishing/SKILL.md` alongside this file!

## Architecture

- `/blog` → Blog index (paginated, 10 per page)
- `/blog/[slug]` → Individual post
- `/blog/rss.xml` → RSS feed
- `/blog/category/[cat]` → Category archive

### Storage Options

- **Static markdown** — files in `/content/blog/` compiled at deploy time
- **D1 database** — for dynamic content with admin editing
- **Hybrid** — markdown for seed posts, D1 for future posts

### Markdown Post Format

```markdown
title: "How to Deploy Docker Without Kubernetes"
slug: "deploy-docker-without-kubernetes"
date: "2026-04-19"
category: "guides"
description: "Ship containers to production in 30 seconds without the Kubernetes overhead."
keywords: ["docker hosting", "deploy docker", "no kubernetes"]
image: "/images/blog/docker-no-k8s.webp"
readingTime: 5
Your markdown content here...
```

## SEO Integration (09/seo-and-keywords)

Every blog post targets a longtail keyword:

- **Title tag** — contains the keyword phrase
- **H1** — matches the title (or close variation)
- **First paragraph** — mentions the keyword naturally
- **H2s** — use semantic variations
- **Meta description** — includes keyword + CTA
- **URL slug** — contains keyword in hyphens
- **Image alt text** — includes keyword where natural

### Seed Posts (3-5 on First Build)

Generate 3-5 posts targeting longtail keywords from `09/seo-and-keywords` research:

1. "How to [solve problem] with [our product]" (tutorial)
2. "[Product category] comparison — [us] vs alternatives" (comparison)
3. "[Industry] guide to [relevant topic]" (guide)
4. "Why we built [product] on [technology]" (behind the scenes)
5. "[Common question] answered" (FAQ-style, targets PAA)

## Post Template (Hono HTML Rendering)

```typescript
function renderPost(post: BlogPost): string {
  return `
    <article itemscope itemtype="https://schema.org/BlogPosting">
      <meta itemprop="datePublished" content="${post.date}">
      <meta itemprop="author" content="Brian Zalewski">

      <header>
        <time datetime="${post.date}">${formatDate(post.date)}</time>
        <span class="reading-time">${post.readingTime} min read</span>
        <h1 itemprop="headline">${post.title}</h1>
        <p class="description" itemprop="description">${post.description}</p>
      </header>

      ${post.image ? `<img src="${post.image}" alt="${post.title}" width="1200" height="675" loading="eager" itemprop="image">` : ''}

      <div class="content" itemprop="articleBody">
        ${post.html}
      </div>

      <footer>
        <div class="share">
          <a href="https://twitter.com/intent/tweet?text=${encodeURIComponent(post.title)}&url=${encodeURIComponent(post.url)}" target="_blank" rel="noopener">Share on X</a>
          <a href="https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(post.url)}" target="_blank" rel="noopener">Share on LinkedIn</a>
        </div>
        ${renderRelatedPosts(post.related)}
      </footer>
    </article>
  `;
}
```

## RSS Feed

```typescript
app.get('/blog/rss.xml', async (c) => {
  const posts = await getAllPosts(c.env);
  const rss = `<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Brand Blog</title>
    <link>https://domain.com/blog</link>
    <description>Latest from Brand</description>
    <atom:link href="https://domain.com/blog/rss.xml" rel="self" type="application/rss+xml"/>
    ${posts.map(p => `
    <item>
      <title>${escapeXml(p.title)}</title>
      <link>https://domain.com/blog/${p.slug}</link>
      <description>${escapeXml(p.description)}</description>
      <pubDate>${new Date(p.date).toUTCString()}</pubDate>
      <guid>https://domain.com/blog/${p.slug}</guid>
    </item>`).join('')}
  </channel>
</rss>`;
  return c.text(rss, 200, { 'Content-Type': 'application/rss+xml' });
});
```

## Reading Time

```typescript
function calculateReadingTime(text: string): number {
  const words = text.trim().split(/\s+/).length;
  return Math.max(1, Math.ceil(words / 250)); // 250 WPM average
}
```

## Structured Data (per post)

```json
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Post Title",
  "datePublished": "2026-04-19",
  "dateModified": "2026-04-19",
  "author": { "@type": "Person", "name": "Brian Zalewski" },
  "publisher": { "@type": "Organization", "name": "Brand", "logo": { "@type": "ImageObject", "url": "https://domain.com/logo.png" } },
  "description": "Meta description",
  "image": "https://domain.com/images/blog/post.webp",
  "mainEntityOfPage": "https://domain.com/blog/post-slug"
}
```
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall