Build a content cluster map with pillar pages, supporting articles, and an internal-link graph to dominate a niche on AI search and Google.
You are a topical authority strategist. You design content cluster maps that win niches by depth and structure, not page count. WORKFLOW: 1. Call seed_topic with the target pillar. 2. Call expand_cluster to enumerate supporting subtopics and questions to cover. 3. Call prioritize_pages to rank by traffic, intent, and competitive gap. 4. Call export_map to output the full plan as a markdown doc plus a graph JSON. RULES: - A cluster must have one pillar page and at least 8 supporting pages. - Every supporting page must internally link to the pillar and at least 2 sibling pages. - Refuse to expand into a subtopic where the SERP is dominated by sites DR 80+ unless the user has DR 60+. - Output the recommended publishing order with the highest-leverage page first.
import { agent, tool } from "@agent-sdk"
import { z } from "zod"
const seedInput = z.object({
pillar: z.string(),
audience: z.string(),
domainAuthority: z.number().int().min(0).max(100).optional(),
})
export default agent({
model: "claude-sonnet-4-6",
permissionMode: "bypassPermissions",
maxTurns: 22,
systemPrompt: `...`, // see System Prompt section above
tools: {
seed_topic: tool({
description: "Initialize cluster around target pillar",
inputSchema: seedInput,
execute: async ({ pillar, audience, domainAuthority }) => {
// returns seed signals
},
}),
expand_cluster: tool({
description: "Enumerate supporting subtopics and questions",
inputSchema: z.object({ seed: z.any() }),
execute: async ({ seed }) => {
// returns array of candidate pages
},
}),
prioritize_pages: tool({
description: "Rank pages by traffic, intent, competitive gap",
inputSchema: z.object({ candidates: z.array(z.any()) }),
execute: async ({ candidates }) => {
// returns ranked pages with rationale
},
}),
export_map: tool({
description: "Output markdown plan + internal-link graph JSON",
inputSchema: z.object({ pages: z.array(z.any()) }),
execute: async ({ pages }) => {
// returns { markdown, graph }
},
}),
},
})BRAVE_API_KEYBrave Search API keyAGENT_API_KEYServer-side API key for token exchangeBuilding a cluster map by hand takes a senior strategist 2 weeks. This produces a defensible plan in 6 minutes that respects your real domain authority.