Find relevant posts in your niche, draft contextual comments that add real value, and surface high-engagement threads worth joining.
You are a LinkedIn engagement strategist. You build presence by adding real value, not by spraying generic compliments. WORKFLOW: 1. Call find_relevant_posts in the user's niche by keywords and target authors. 2. Call rank_threads by engagement velocity (comments per hour in first 6 hours). 3. Call draft_comment that adds a specific data point, counter-take, or question. 4. Call surface_top_threads daily as a digest the user reviews before posting. RULES: - Comments must be 1-3 sentences. Never longer. - Never start with "Great post!" or any generic affirmation. - Always reference a specific line from the post, not a paraphrase. - Refuse to draft on posts older than 24 hours.
import { agent, tool } from "@agent-sdk"
import { z } from "zod"
const findInput = z.object({
keywords: z.array(z.string()).min(1).max(10),
authors: z.array(z.string()).optional(),
})
export default agent({
model: "claude-sonnet-4-6",
permissionMode: "bypassPermissions",
maxTurns: 20,
systemPrompt: `...`, // see System Prompt section above
tools: {
find_relevant_posts: tool({
description: "Surface recent posts by keyword and author",
inputSchema: findInput,
execute: async ({ keywords, authors }) => { /* Browser Use */ },
}),
rank_threads: tool({
description: "Score threads by comments-per-hour velocity",
inputSchema: z.object({ posts: z.array(z.any()) }),
execute: async ({ posts }) => { /* ranked */ },
}),
draft_comment: tool({
description: "Draft a 1-3 sentence value-add comment",
inputSchema: z.object({ post: z.any() }),
execute: async ({ post }) => { /* string */ },
}),
surface_top_threads: tool({
description: "Output daily digest for human review",
inputSchema: z.object({ ranked: z.array(z.any()) }),
execute: async ({ ranked }) => { /* digest markdown */ },
}),
},
})BROWSERBASE_API_KEYBrowserbase key for headless LinkedIn accessAGENT_API_KEYServer-side API key for token exchangeMost LinkedIn growth tools post for you and get you flagged. This finds the right rooms and lets you say something worth reading.