How to Add Support for a New AI Coding Platform to the Website Cloner

You add support for a new AI coding platform by creating a platform-specific directory and extending scripts/sync-skills.mjs to translate the central AGENTS.md source of truth into the platform's required file format.

The JCodesMore/ai-website-cloner-template uses a platform-agnostic architecture that stores all agent instructions in a single AGENTS.md file. To add support for a new AI coding platform, you only need to modify the generation scripts that convert this central documentation into platform-specific formats—no changes to the core cloning logic are required.

Understanding the Architecture

The repository maintains two synchronization scripts that act as the bridge between the central documentation and individual platform implementations:

Component Source of Truth Generation Script
Project-wide instructions AGENTS.md scripts/sync-agent-rules.sh
/clone-website skill AGENTS.md (via .claude/skills/clone-website/SKILL.md) scripts/sync-skills.mjs

When you add a new platform, you extend these scripts to write files in the format your target platform expects (Markdown, TOML, YAML, or JSON).

Step-by-Step Implementation

Step 1: Create a Platform Directory

Create a placeholder folder for your new platform in the repository root. This example uses a fictional platform called MyPlatform:

mkdir -p .myplatform/commands

Step 2: Extend the Skill Generation Script

Open scripts/sync-skills.mjs and add a new generation block that mirrors the existing implementations. The script extracts the raw skill markdown from AGENTS.md and converts placeholders to platform-specific syntax.

Below is the exact code to add for a YAML-based platform that uses <args> instead of $ARGUMENTS:

// 10. MyPlatform — YAML format, <args> placeholder
const myPlatformBody = body.replace(/\$ARGUMENTS/g, '<args>');
write(
  '.myplatform/commands/clone-website.yaml',
  `# AUTO-GENERATED from .claude/skills/clone-website/SKILL.md

# Run \`node scripts/sync-skills.mjs\` to regenerate.

description: "${shortDesc}"
name: "clone-website"

prompt: |
${myPlatformBody.split('\n').map(l => '  ' + l).join('\n')}
`
);

Key implementation details:

  • body contains the raw skill content extracted from AGENTS.md
  • replace(/\$ARGUMENTS/g, '<args>') swaps the generic placeholder for platform-specific syntax
  • The write helper creates the file at the specified path relative to the repository root

Step 3: (Optional) Extend the Rules Generation Script

If your platform also requires the generic project rules (most platforms only need the skill file), extend scripts/sync-agent-rules.sh:


# MyPlatform — receives the same resolved rules as other agents

write_file "$REPO_ROOT/.myplatform/rules/project.md" "$RESOLVED_CONTENT"

Step 4: Generate the Platform Files

Run the synchronization scripts to generate the concrete files:

node scripts/sync-skills.mjs          # generates the new skill file

bash scripts/sync-agent-rules.sh      # (only if step 3 was added)

You should see output confirming the new file creation:


  ✓ .myplatform/commands/clone-website.yaml

Step 5: Verify and Commit

Verify the generated file contains the correct placeholder substitution:

cat .myplatform/commands/clone-website.yaml

Commit the new files:

git add .myplatform/ scripts/sync-skills.mjs
git commit -m "Add MyPlatform support for /clone-website skill"
git push

Future changes to AGENTS.md will automatically propagate to your platform when you re-run the sync scripts.

Code Examples for Common Formats

Example: JSON-Based Platform (QuantumAI)

For platforms requiring JSON configuration, convert the skill to a structured object:

// 11. QuantumAI — JSON format, args placeholder "$ARGS"
const quantumBody = body.replace(/\$ARGUMENTS/g, '$ARGS');
write(
  '.quantumai/cli-agents/clone-website.json',
  JSON.stringify(
    {
      name: 'clone-website',
      description: shortDesc,
      prompt: quantumBody,
      fileContext: ['AGENTS.md', 'docs/research/**']
    },
    null,
    2
  ) + '\n'
);

Example: Updating Generic Rules for a New Platform

If your platform reads project rules directly rather than parsing AGENTS.md, add this to scripts/sync-agent-rules.sh:


# In sync-agent-rules.sh

write_file "$REPO_ROOT/.quantumai/rules/project.md" "$RESOLVED_CONTENT"

Summary

  • Centralized source of truth: All platform definitions derive from AGENTS.md and .claude/skills/clone-website/SKILL.md
  • Two-script workflow: Extend scripts/sync-skills.mjs for command definitions and optionally scripts/sync-agent-rules.sh for project rules
  • Placeholder conversion: Use String.prototype.replace() to convert $ARGUMENTS to platform-specific syntax like <args> or $ARGS
  • No core logic changes: Adding a new platform only requires format-specific generation code, keeping the repository maintainable
  • Automatic synchronization: Re-running the scripts propagates any AGENTS.md updates to all supported platforms

Frequently Asked Questions

Do I need to modify the core website cloning logic to add a new platform?

No. The cloner’s architecture separates platform-specific formatting from core functionality. You only need to extend the generation scripts in scripts/sync-skills.mjs and optionally scripts/sync-agent-rules.sh to translate the central AGENTS.md content into your platform's required format.

What file formats does the sync script support?

The generation scripts are format-agnostic. You can generate any text-based format including YAML, JSON, TOML, or Markdown. The write function in scripts/sync-skills.mjs accepts any string content, allowing you to construct files using template literals, JSON.stringify, or manual string concatenation.

How do I handle different argument syntax for different platforms?

Use JavaScript's replace() method on the body variable to convert the generic $ARGUMENTS placeholder into platform-specific syntax. For example, body.replace(/\$ARGUMENTS/g, '<args>') converts the standard placeholder to angle-bracket format for platforms like MyPlatform, while body.replace(/\$ARGUMENTS/g, '$ARGS') handles dollar-sign syntax for others.

Can I test the new platform integration before committing?

Yes. Because scripts/sync-skills.mjs is a pure Node.js script and scripts/sync-agent-rules.sh is a Bash script, you can run them locally to generate files and verify the output. Check the generated files manually (e.g., with cat) to confirm placeholder substitution and formatting before committing to the repository.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →