Build with AI
Chapter 7

Maintenance & Iteration

Keeping AI-built websites fresh, secure, and improving over time with version control, analytics, and structured iteration.

The Maintenance Mindset

AI-built websites aren’t “set and forget.” Like any software, they need updates, security attention, and content refreshes. The advantage with AI is that maintenance can be faster — describe what you want changed, and the agent handles the implementation.

Version Control Strategy

Platform-Level Versioning (PageWeave)

PageWeave versions every change automatically. Pages, themes, html_head, headers, and footers all have version histories. Key operations:

  • Pin: Freeze a specific version as the live version. Useful for “this is the canonical version.”
  • Revert: Create a new version from an old one. Doesn’t delete anything — the history is preserved.
  • Preview: Every change auto-creates a preview session. Share the URL to review before going live.

Git-Based Versioning

For raw code projects, commit AI-generated changes frequently:

git add .
git commit -m "feat: add hero section with rotating text"
# Review the diff before pushing
git diff HEAD~1

Use conventional commits (feat:, fix:, style:, refactor:) to make the history readable for both humans and AI agents that may need to understand past changes.

Analytics-Driven Iteration

Use analytics to inform what to update. PageWeave provides privacy-first analytics (server-side, no cookies, no trackers):

  • Overview: Visitors, pageviews, bounce rate
  • Top pages: What content resonates
  • Top referrers: Where traffic comes from
  • Geography: Countries and cities
  • Time series: Daily or hourly trends

Feed this data back to your AI agent: “The /tips page has 3x the traffic of /resources. Let’s add more practical content there and cross-link from the homepage.”

Content Updates

For content-heavy sites, use data tables (PageWeave) or a CMS. AI agents excel at generating structured data:

{
  "title": "How to Choose an Agent Harness",
  "author": "Build with AI",
  "published_at": "now",
  "body": "The harness determines what tools..."
}

Template pages (with :slug in the path) render table rows automatically using Liquid. The AI creates new rows, and pages appear without touching layout code.

Security Maintenance

AI-generated code is as secure as the frameworks it uses. Key practices:

  • Forms: Use platform form handling (PageWeave validates and sanitizes). Never build custom form handlers unless you audit the code.
  • Dependencies: If using npm packages, run npm audit regularly. AI may suggest outdated or vulnerable packages.
  • Secrets: Never let AI generate code that hardcodes API keys, tokens, or passwords. Use environment variables.
  • CSP: Consider a Content Security Policy header to restrict script sources.

Iteration Workflow

flowchart LR
    A[Review Analytics] --> B[Identify Improvement]
    B --> C[Describe to AI Agent]
    C --> D[Preview Change]
    D --> E{Good?}
    E -->|Yes| F[Publish]
    E -->|No| C
    F --> A
    

When to Rebuild vs Iterate

Situation Approach
Small content change Replace Use update_page with a single replacement
New section or page Create New page, link from existing content
Design refresh Iterate Update theme, then adjust pages incrementally
Structural overhaul Rebuild Fresh site, migrate content via data tables
Framework upgrade Platform PageWeave handles Tailwind/daisyUI upgrades automatically
Next

Built with AI, powered by PageWeave. © 2026