<!-- Cogny documentation. Canonical page: https://cogny.com/docs/coding-agent-and-cogny-sites -->

# Coding Agent, GitHub and Cogny Sites

Connect your repository so tickets ship as pull requests with preview deployments and visual proof, what to expect from the coding agent, and how to handle sites on a locked CMS.

**Author:** Cogny Team  
**Published:** 2026-09-23  
**Updated:** 2026-09-24  
**Canonical:** https://cogny.com/docs/coding-agent-and-cogny-sites

When your website is code in a GitHub repository, Cogny becomes a coder on your team. A content or page ticket becomes a pull request, a preview deployment renders it, a visual review compares it to the brief, and you merge. Instead of asking an engineer "can you fix this?", the engineer gets a pull request to review. This is the setup that gives the most leverage, and the one the founders push customers toward.

## Connect GitHub

Settings → Cogny Code → **Coding Agent** → **Connect GitHub**. Choose the repositories and install the webhook. The webhook is what moves a ticket from In Progress to Analysis when its pull request merges.

Under **Agent Behavior** you can restrict the agent to a subdirectory (for example `apps/web` in a monorepo) and add a system-prompt addendum with your conventions. The agent reads the repository's own instructions files, so a good `CLAUDE.md` or `AGENTS.md` in the repo improves results more than anything in Cogny's settings.

If your team wants pull requests against a development branch rather than main, say so during onboarding.

## The pull request loop

1. A code ticket appears (from a report, a content loop, or one you wrote). It carries the page URL, headline, sections, calls to action, schema and design notes.
2. **Run Code Agent** (or approve it). The agent reads the repository, reuses its components and icons, writes the change, and opens a pull request.
3. **Cogny Sites** builds a preview deployment for the pull request and posts the URL on it. The ticket moves to Review.
4. **Visual proof** browses the rendered preview, records what it sees, and flags gaps against the brief ("the testimonial section is missing", "the CTA is below the fold").
5. You review. **Refine** with written feedback if the agent missed the spec; it pushes a new commit. Merge when it is right, from the ticket or in GitHub.
6. Merge fires the webhook, the ticket moves to Analysis, and Cogny measures the outcome in Search Console and GA4 once data exists.

Pull requests never merge themselves. That is a hard rule, and it is why YOLO mode does not apply to code tickets.

## Cogny Sites

Settings → Cogny Code → **Sites**. Connect a repository, choose the production branch, framework (Next.js, static, Remix or Astro) and region. Sites then builds a preview for every pull request and deploys production on push to the main branch. You can keep hosting elsewhere and use Sites only for previews.

**Fix Builds** (Settings → Cogny Code → Fix Builds) lets the agent repair a failed build on its own pull request, up to a configurable number of attempts. **Deployment Risk** and **Visual Proof Review** are the other two settings in the same section.

## What to expect from the agent

- It one-shots pages well when the repo is clear: landing pages, articles, comparison pages, FAQ sections, schema markup, internal links.
- It is text-first. Image generation exists (built-in image tools), but not at the level of a human creative. Upload your own assets and let the agent place them.
- It can misread a spec (a singular slug where you wanted plural, a section in the wrong order). The Review column exists for that; a quick Refine fixes it.
- It does not reliably self-correct without feedback yet. If a pull request is wrong, refine it rather than waiting.
- Coding is the most credit-intensive action. A fully coded page with FAQs and calls to action costs a couple of hundred credits. A meta-title rewrite costs a few.
- A different-language site is fine.

## Which stack

- **Server-rendered code (Next.js on Vercel, Netlify or Cogny Sites)** is the target. Page speed, SEO and the coding agent all work best here.
- **Shopify**: strong API; content and product pages work through the integration rather than the repo.
- **WordPress**: posts land as drafts, some fixes are manual. Fine to start; consider moving the marketing site to code when content becomes your main channel.
- **Client-side apps and no-code builders** block both the agent and crawlers. A public, server-rendered marketing site is often a prerequisite.
- **Separate marketing and product repositories**: connect the marketing repo. Product funnels are analysed through GA4, and the agent can propose pull requests to the app repo too, but it never merges anything on its own.

## Sites on a locked CMS

If the main site must stay on a CMS whose API limits the agent (Webflow, some WordPress setups, enterprise CMSs), keep it there and give the agent a code surface next to it:

- Route one path, such as `/blog` or `/guides`, at the DNS or CDN layer to a separate code project (a Next.js repo, or a site built with an AI app builder). Visitors never see the split. Your team can still edit visually in that tool; Cogny writes into the repository.
- Or run an isolated environment on a subdomain for experiments, with no-index on campaign URLs.

Either needs a one-off setup with your developer or the Cogny team. It routinely gets deprioritised inside customer teams, so put it on the onboarding agenda if you want it.

## Replacing a site that is beyond saving

When the existing site is a broken legacy build, a replacement can be generated with an AI coding tool in an afternoon, reviewed by you, and handed to Cogny at onboarding. From then on the coding agent iterates on it through pull requests. Your only required action is DNS: you own the domain and point it at the new site.

---

In this section:

- Set Up Cogny Cloud for Success: https://cogny.com/docs/cloud-setup-guide
- Before Your Onboarding: Checklist and Wizard: https://cogny.com/docs/cloud-onboarding-checklist
- Connect Your Data Sources: https://cogny.com/docs/connect-your-data-sources
- Context and Growth Strategy: https://cogny.com/docs/context-and-growth-strategy
- Core Metrics: https://cogny.com/docs/core-metrics
- Reports and Templates: https://cogny.com/docs/reports-and-templates
- Tickets and Approvals: https://cogny.com/docs/tickets-and-approvals
- Automations and Content Loops: https://cogny.com/docs/automations-and-content-loops
- **Coding Agent, GitHub and Cogny Sites** (this page): https://cogny.com/docs/coding-agent-and-cogny-sites
- Use Cogny from Your Own Agent: https://cogny.com/docs/bring-your-own-agent
- Credits and Plans: https://cogny.com/docs/credits-and-plans
- Team, Governance and Privacy: https://cogny.com/docs/team-governance-and-privacy
- Cogny Cloud FAQ: https://cogny.com/docs/cloud-faq

Source page: https://cogny.com/docs/coding-agent-and-cogny-sites  
All documentation: https://cogny.com/docs  
Cogny for agents: https://cogny.com/llms.txt
