How to Integrate Different AI Coding Agents for Website Cloning in Next.js
The AI Website Cloner Template standardizes agent integration through a canonical skill definition and automated sync scripts, enabling you to run the same /clone-website command across Claude, Codex, Gemini, and other platforms without modifying core cloning logic.
The JCodesMore/ai-website-cloner-template is a Next.js 16 monorepo that transforms public websites into clean React applications using AI coding agents. By decoupling the cloning pipeline from specific agent implementations, you can integrate different AI coding agents for cloning by maintaining a single source of truth in AGENTS.md and letting sync scripts handle platform-specific translations. This architecture ensures that switching from Claude to Codex—or adding an entirely new agent—requires only configuration updates, not codebase rewrites.
Understanding the Skill-Based Architecture
The integration relies on a skill definition pattern that abstracts agent-specific command syntax into a universal interface.
The Role of AGENTS.md
AGENTS.md serves as the canonical registry of supported agents and their current status. Located in the repository root, this file is read by all agents to discover they should invoke the /clone-website skill. When you add a new agent to the Supported Platforms table in AGENTS.md【README.md†L56-L71】, you declare that the platform can consume the standardized skill definition.
Platform-Specific Skill Manifests
Each agent consumes the skill through its own manifest file (e.g., .claude/skills/clone-website/SKILL.md for Claude, with equivalents for Codex, Gemini, etc.). These files map the generic /clone-website command to the agent’s native syntax, declaring:
- The command name and description
- Argument hints (e.g.,
<url>) - User-invocability flags【SKILL.md†L1-L8】
The skill manifest also references the extraction artifacts in docs/research/ that serve as the source of truth for builder agents【SKILL.md†L30-L43】.
How the Integration Pipeline Works
When you trigger a clone, the agent executes a multi-phase pipeline that remains consistent regardless of which AI coding agent you use:
- Agent Initialization – The user starts the agent (e.g.,
claude --chrome), which loads its platform-specific skill file. - Skill Registration – The agent registers the
/clone-websitecommand as user-invocable based on the localSKILL.mdconfiguration. - Command Invocation – The user types
/clone-website https://example.com, triggering the standardized pipeline. - Pipeline Execution – The agent proceeds through reconnaissance, foundation setup, component spec generation, parallel builder worktrees, and final assembly with visual QA【README.md†L86-L95】.
- Output Generation – The agent writes component implementations to
src/app/andsrc/components/, concluding with a successfulnpm run build.
Because each skill file abstracts platform-specific CLI differences, the underlying extraction and build logic in src/app/ and docs/research/ remains identical across all agents.
Sync Scripts That Maintain Cross-Platform Consistency
Two automation scripts ensure that changes to canonical definitions propagate to every supported agent:
scripts/sync-agent-rules.sh– Regenerates platform-specific instruction files fromAGENTS.md. Run this after editing the supported platforms table or agent statuses【README.md†L53-L62】.scripts/sync-skills.mjs– Regenerates the/clone-websiteskill for all platforms from the canonical skill definition. Execute this after modifying skill parameters or adding new arguments【README.md†L53-L62】.
These scripts eliminate manual copy-pasting errors and guarantee that Claude, Codex, Gemini, and Cursor all interpret the cloning instructions identically.
Practical Implementation Examples
Running Clones with Claude Code
To execute a clone using Claude Code:
# Start Claude Code with Chrome support for website inspection
claude --chrome
# Invoke the standardized skill
/clone-website https://example.com
The skill automatically creates docs/research/, populates src/app/ and src/components/, and validates the build with npm run build【README.md†L88-L95】.
Adding a Custom Agent (e.g., "SuperAI")
To integrate a new AI coding agent:
# 1. Create the skill folder following the agent's naming convention
mkdir -p .superai/skills/clone-website
cp .claude/skills/clone-website/SKILL.md .superai/skills/clone-website/SKILL.md
# 2. Modify argument hints or descriptions if SuperAI requires different syntax
# Edit .superai/skills/clone-website/SKILL.md
# 3. Register the agent in the canonical list
# Add a row to the Supported Platforms table in README.md:
# | SuperAI | Supported |
# 4. Regenerate platform files
bash scripts/sync-agent-rules.sh
node scripts/sync-skills.mjs
SuperAI will now expose /clone-website with identical behavior to Claude and Codex.
Docker-Based Agent Execution
For containerized environments:
# Start the development server
docker compose up dev --build # Exposes port 3001
Inside the container, launch your chosen agent and execute the skill normally. The Docker composition ships the same scaffold structure, ensuring agents see the identical file layout whether running locally or in containers【README.md†L46-L52】.
Key Files in the Integration Layer
| File | Purpose |
|---|---|
AGENTS.md |
Canonical registry of supported agents and their status |
.claude/skills/clone-website/SKILL.md |
Claude-specific skill manifest (templates exist for other agents) |
scripts/sync-agent-rules.sh |
Bash script regenerating agent instruction files from AGENTS.md |
scripts/sync-skills.mjs |
Node.js script synchronizing skill definitions across platforms |
docs/research/INSPECTION_GUIDE.md |
Reconnaissance phase instructions that all agents follow |
components.json |
Component stub map used to generate spec files |
src/app/layout.tsx |
Global layout where agents inject fonts and CSS variables |
src/app/globals.css |
Tailwind v4 definitions and design tokens |
These files form the contract between your repository and any AI coding agent. Updating the contract requires edits only to canonical files and a quick execution of the sync scripts.
Summary
- Skill abstractions in
AGENTS.mdand platform-specific manifests allow swapping AI coding agents without touching cloning logic. - Sync scripts (
sync-agent-rules.shandsync-skills.mjs) propagate canonical definitions to all supported platforms automatically. - Standardized pipeline phases (reconnaissance → foundation → components → assembly) execute identically regardless of whether you use Claude, Codex, Gemini, or custom agents.
- Next.js 16 monorepo structure in
src/app/anddocs/research/provides consistent targets for all agent outputs.
Frequently Asked Questions
How do I add support for a new AI coding agent to the cloner template?
Create a folder matching the agent’s naming convention (e.g., .newagent/skills/clone-website/), copy the canonical SKILL.md content, add the agent to the Supported Platforms table in README.md, and run both sync scripts. The scripts regenerate all platform-specific files from the canonical definitions, ensuring your new agent receives the same /clone-website command structure as existing integrations.
What is the difference between AGENTS.md and the individual SKILL.md files?
AGENTS.md acts as the single source of truth listing which agents are supported and their current status, while individual SKILL.md files (located in directories like .claude/skills/clone-website/) translate the generic skill into agent-specific command syntax. The sync scripts bridge these layers by propagating changes from AGENTS.md to each platform-specific manifest.
Can I run multiple AI coding agents simultaneously on the same project?
Yes. Because each agent operates on the same canonical skill definition and writes to standardized directories (src/app/, src/components/, docs/research/), you can invoke /clone-website from different agents in separate worktrees or sessions. The sync scripts ensure all agents interpret the extraction artifacts and component specs identically, preventing configuration drift between platforms.
Where do agents write their generated code?
Agents write component implementations to src/components/ and page files to src/app/, following the Next.js App Router conventions. They reference design tokens from src/app/globals.css and global layouts from src/app/layout.tsx. The docs/research/ directory stores extraction artifacts (screenshots, specs) that serve as the source of truth for the build phase, ensuring all agents produce consistent output structures.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →