SEO content pipeline: keyword to pull request
From one keyword, an AI agent researches the search intent, writes the article, waits for your editorial approval, then opens a pull request on your site.
Most AI writing tools stop at a draft in a chat window. This pipeline goes all the way to your repository, with a person in the loop: give it a keyword, approve the article from your phone, and the agent opens the pull request that publishes it on your site.
How it works
- Research: the agent studies the search intent behind the keyword (the pages that rank, the questions people ask, what is missing) and writes a brief with the angle, the outline and the title.
- Write: it writes the article from the brief, in your site's format and voice (it reads your existing posts).
- Editorial review: the workflow stops and notifies you. Approve, reject, or send it back with comments: the writing step runs again with your notes.
- Publish: once approved, the agent adds the article to your content folder and opens a pull request.
What you need
- An agent connected to your website's repository, with the GitHub CLI installed.
- A
GITHUB_TOKENworkspace secret allowed to push a branch and open pull requests. - The
fetchMCP server (added to your workspace in one click), which lets the agent read the pages that rank. It runs withuvxon the agent's machine.
Steps
1. Keyword research
Research the search intent behind the keyword "{{inputs.keyword}}" for an audience of {{inputs.audience}}, in the language "{{inputs.language}}". 1. Use the `fetch` MCP tool to read the pages that rank for the keyword (search results, then the top articles) and note what they cover, their angle, their length and their gaps. 2. List the questions people ask about the topic and the related terms worth covering. 3. Read the existing articles in `{{inputs.content_dir}}` of the repository in the current directory, to avoid cannibalizing one of them and to find internal links. 4. Write the brief in Markdown: search intent, the angle that beats the current results, a title under 60 characters, a meta description under 155 characters, the outline (H2 / H3), the questions to answer, and the internal links. Complete the step with `--value slug=<url-friendly slug of the title>` and `--value title=<the title>`.2. Write the article
Write the article "{{steps.keyword-research.outputs.title}}" from the brief of the previous step, in the language "{{inputs.language}}", for an audience of {{inputs.audience}}. - Read two or three existing articles in `{{inputs.content_dir}}` first, and match their front matter, structure and voice. - Follow the brief's outline; answer every question it lists; add the internal links it suggests. - Be concrete: examples, commands, numbers. No filler, no keyword stuffing, no claims you cannot back. - Output the complete file content, front matter included, ready to be saved as `{{steps.keyword-research.outputs.slug}}.md`.3. Editorial review (human approval)
Check the angle, the facts and the tone of the article. Approve to open the pull request, or request changes with your comments.
4. Open the pull request
Publish the approved article from the "Write the article" step by opening a pull request on the repository in the current directory. 1. Check that the GitHub CLI works (`gh auth status`) and that the working tree is clean; otherwise fail the step with the reason. 2. Create a branch `content/{{steps.keyword-research.outputs.slug}}` from the default branch. 3. Save the article, exactly as approved, to `{{inputs.content_dir}}/{{steps.keyword-research.outputs.slug}}.md` (or the extension the folder uses). Run the site's build or lint if the repository documents one, and fix only formatting problems. 4. Commit, push and open a pull request with `gh pr create`, titled "Article: {{steps.keyword-research.outputs.title}}", whose body links the SEO brief and summarizes the article. 5. Write a summary with the pull request URL. Complete the step with `--value pr_url=<url>`.
Secrets
GITHUB_TOKEN: A GitHub token allowed to push branches and open pull requests on the website repository (fine-grained "Contents" and "Pull requests" read and write).
MCP servers
fetch: Fetches web pages as Markdown, so the agent can read the pages that rank for the keyword.
FAQ
Is the article published without me?
No. The workflow waits for an approval from a workspace member before the publishing step, and the publishing step only opens a pull request.
Which site generators are supported?
Any that keeps articles as Markdown or MDX files in the repository (Astro, Next.js, Hugo, Jekyll, Docusaurus…). The content folder is a launch parameter, and the agent copies the front matter of your existing posts.
Can I change the article before approving it?
Use "Request changes" with your comments; the writing step runs again from its previous draft with your notes.