Draft and schedule a weekly newsletter
I built a Claude Code skill that drafts and publishes my weekly newsletter to Kit, so it actually gets done every week. Task: I built a Claude Code skill that drafts and publishes my weekly newsletter to Kit, so it actually gets done every week. Part of the AI Agents and Claude topic hubs. I’ve been really erratic with my email marketing. I’ve got opt-in forms on every blog post and I’m collecting email subscribers. But email marketing is operational work. I have to log into my email platform, Kit, and write a newsletter and… it just takes time. More importantly, I’ve moved fully to an agentic way of working. I’ve set up personal AI agents that execute my strategies and vision. I don’t want to be logging into different apps and doing the grunt work. This blog, for example, is mostly controlled by my AI agent. I give it the content, it handles the rest. So at some point I thought, why am I still logging into Kit’s web dashboard to do email stuff manually? The agent knows what I just published. It knows the topic, the tags, the audience. It should handle the email side too. So that’s what we’re going to do. The Current State If you’re new here, a quick bit of context. This website is custom-built with Astro and Tailwind, and I build and maintain the whole thing with Claude Code in my terminal. So when I want to write a new blog post or create a new page, I work with Claude to write it. I have a process so that I’m not producing AI generated slop, but original ideas in my unique voice and style. The agent polishes the content, creates the pages, posts, and components, manages the content index, handles deployments, and maintains internal linking. It even adds a newsletter opt-in to the blog post automatically based on the ones I’ve set up in Kit. More importantly, my agent now has full context of every post on this site. Which means, it can go beyond just publishing content to my site. It can promote it too. I’ve already set it up to promote content on social media. The only thing left is to promote it to my newsletter. The Future State There are two things I’d like to do when I create new content when it comes to the newsletter. I said that my agent automatically adds email opt-ins to each blog post. However, it’s only picking from opt-ins I’ve had to manually create in Kit. Ideally, it should generate a new opt-in that’s tailored to the blog post, and automatically set that up in Kit without me doing it manually. When I publish a post, it should summarize it and queue it up as a newsletter broadcast in Kit. So basically I’d like to auto-create new forms, sequences, and broadcasts in Kit. Exploring The Kit API Before I could give my agent control over Kit, I needed to understand what the API supports because that’s how my agent will be interfacing with it. The Kit API v4 is solid for some things and completely missing others. Here’s the breakdown: The bad news first. You can’t create forms, automations, or sequences through the API, which means part 1 of my wishlist is off the table. This is something I hope Kit will fix in the future but for now it needs to be done manually via the dashboard. That being said, the broadcasts are fully programmable. And that solves my second problem of writing the email newsletter after I publish a post. Here’s what a basic API call looks like to create a broadcast: Don’t worry if you don’t understand what that means. What’s happening is that you just created a draft broadcast in Kit without opening a browser! The API returns the broadcast ID, which you can then use to update, schedule, or check stats. Rate limits are reasonable too. With an API key you get 120 requests per 60 seconds. More than enough for an agent doing occasional email operations. Giving Claude Code the API Key First, you need a Kit API key. Go to your Kit dashboard, click Settings, then Developer, and generate a new v4 API key. Store it in a .env file in your project root: Make sure .env is in your .gitignore so you don’t accidentally commit your key. Most frameworks already have this in their default gitignore. You can verify the key works by running a quick test: You should see your account name, email, and plan type come back. If you get an auth error, double check the key in your .env file. At this point, you could just tell Claude Code “draft a new broadcast announcing this week’s post” in any session and it would read the .env file, figure out the API calls, and create the broadcast. It works. But you’d have to explain the context every time: what posts you published, what voice to use, what the API endpoints are.; tools: Claude Code. Human role: Step 3: Review before sending; limitations: Kit API v4 does not support creating forms, automations, or sequences, requiring manual dashboard intervention for those tasks. The workflow depends on a structured local content index and a valid API key stored in .env. Rate limits are 120 requests per 60 seconds..
Tools
Published on Agent Work Atlas:
Overview
I built a Claude Code skill that drafts and publishes my weekly newsletter to Kit, so it actually gets done every week.
Workflow
I built a Claude Code skill that drafts and publishes my weekly newsletter to Kit, so it actually gets done every week. Part of the AI Agents and Claude topic hubs. I’ve been really erratic with my email marketing. I’ve got opt-in forms on every blog post and I’m collecting email subscribers. But email marketing is operational work. I have to log into my email platform, Kit, and write a newsletter and… it just takes time. More importantly, I’ve moved fully to an agentic way of working. I’ve set up personal AI agents that execute my strategies and vision. I don’t want to be logging into different apps and doing the grunt work. This blog, for example, is mostly controlled by my AI agent. I give it the content, it handles the rest. So at some point I thought, why am I still logging into Kit’s web dashboard to do email stuff manually? The agent knows what I just published. It knows the topic, the tags, the audience. It should handle the email side too. So that’s what we’re going to do. The Current State If you’re new here, a quick bit of context. This website is custom-built with Astro and Tailwind, and I build and maintain the whole thing with Claude Code in my terminal. So when I want to write a new blog post or create a new page, I work with Claude to write it. I have a process so that I’m not producing AI generated slop, but original ideas in my unique voice and style. The agent polishes the content, creates the pages, posts, and components, manages the content index, handles deployments, and maintains internal linking. It even adds a newsletter opt-in to the blog post automatically based on the ones I’ve set up in Kit. More importantly, my agent now has full context of every post on this site. Which means, it can go beyond just publishing content to my site. It can promote it too. I’ve already set it up to promote content on social media. The only thing left is to promote it to my newsletter. The Future State There are two things I’d like to do when I create new content when it comes to the newsletter. I said that my agent automatically adds email opt-ins to each blog post. However, it’s only picking from opt-ins I’ve had to manually create in Kit. Ideally, it should generate a new opt-in that’s tailored to the blog post, and automatically set that up in Kit without me doing it manually. When I publish a post, it should summarize it and queue it up as a newsletter broadcast in Kit. So basically I’d like to auto-create new forms, sequences, and broadcasts in Kit. Exploring The Kit API Before I could give my agent control over Kit, I needed to understand what the API supports because that’s how my agent will be interfacing with it. The Kit API v4 is solid for some things and completely missing others. Here’s the breakdown: The bad news first. You can’t create forms, automations, or sequences through the API, which means part 1 of my wishlist is off the table. This is something I hope Kit will fix in the future but for now it needs to be done manually via the dashboard. That being said, the broadcasts are fully programmable. And that solves my second problem of writing the email newsletter after I publish a post. Here’s what a basic API call looks like to create a broadcast: Don’t worry if you don’t understand what that means. What’s happening is that you just created a draft broadcast in Kit without opening a browser! The API returns the broadcast ID, which you can then use to update, schedule, or check stats. Rate limits are reasonable too. With an API key you get 120 requests per 60 seconds. More than enough for an agent doing occasional email operations. Giving Claude Code the API Key First, you need a Kit API key. Go to your Kit dashboard, click Settings, then Developer, and generate a new v4 API key. Store it in a .env file in your project root: Make sure .env is in your .gitignore so you don’t accidentally commit your key. Most frameworks already have this in their default gitignore. You can verify the key works by running a quick test: You should see your account name, email, and plan type come back. If you get an auth error, double check the key in your .env file. At this point, you could just tell Claude Code “draft a new broadcast announcing this week’s post” in any session and it would read the .env file, figure out the API calls, and create the broadcast. It works. But you’d have to explain the context every time: what posts you published, what voice to use, what the API endpoints are.
Reported result
The author reports sending newsletters every week instead of sporadically, with zero months of inactivity. The process takes approximately two minutes per cycle. No other quantitative metrics or failure rates are provided in the source.
Human role
Step 3: Review before sending
Limitations
Kit API v4 does not support creating forms, automations, or sequences, requiring manual dashboard intervention for those tasks. The workflow depends on a structured local content index and a valid API key stored in .env. Rate limits are 120 requests per 60 seconds.
Try it
Act as my email marketing assistant. I need to draft and schedule a weekly newsletter to Kit using Claude Code. Inputs: - Content Index: [replaceable path to JSON/Markdown index of recent posts] - Kit API Key: [replaceable secure storage location, e.g., .env variable] - Target Audience: [replaceable description of subscriber segment] - Output Location: [replaceable Kit broadcast draft ID or confirmation] Steps: 1. Read the content index and identify posts published in the last 7 days. 2. Draft a newsletter subject and body in my voice: casual, brief, focusing on takeaways rather than summaries. Avoid AI clichés. 3. Display the draft to me for review. Do not proceed until I explicitly approve or request edits. 4. Upon approval, use the Kit API to create a broadcast draft. 5. Ask if I want to schedule it. If yes, update the broadcast with the specified timestamp. Quality Check: Ensure the tone matches my previous emails and links are correct. Safeguards: Never send the email without my final confirmation. If the API key is missing or the content index is empty, stop and ask for clarification. Perform a dry run with one sample post first.
Source reports are not independently verified. Publication date is the catalog publication date, not the original article date.