How to Customize the Output Directory Structure for Multiple Cloned Sites in ai-website-cloner-template

You customize the output directory structure by editing the folder path definitions in .github/skills/clone-website/SKILL.md and regenerating platform-specific copies using node scripts/sync-skills.mjs, which updates the AI agent prompts to write files to your preferred hierarchy.

The ai-website-cloner-template repository orchestrates multi-site cloning through a single command skill (/clone-website) that scaffolds research folders and downloads assets for each target URL. While the default layout organizes files under docs/research/<hostname>/ and public/images/, you can customize the output directory structure for multiple cloned sites to support project-based grouping, custom asset pipelines, or separate worktrees without modifying any runtime code.

Understanding the Default Directory Layout

By default, the /clone-website skill creates a predictable hierarchy for every target hostname. When you execute the command, AI agents write specifications to docs/research/<hostname>/ and docs/design-references/<hostname>/, while storing downloaded media in public/images/ and public/videos/. These paths are not hardcoded in executable scripts; they exist as text placeholders inside the skill definition file at .github/skills/clone-website/SKILL.md.

Modifying the Output Paths in the Skill Definition

The skill definition serves as the single source of truth. Because the template consumes this file as pure-text instructions for AI agents, changing the directory strings automatically updates every subsequent step in the pipeline.

Locate the Directory Definitions in SKILL.md

Open .github/skills/clone-website/SKILL.md and find the block that creates per-site directories (approximately lines 31–34). This section lists the base folders and the hostname-based subdirectories. The template uses these literal strings when generating prompts, so editing them redirects all file system operations.

Customize the Folder Patterns

Replace the placeholder paths with your desired hierarchy. For example, to group all cloned sites under a project identifier named my-project, update the YAML instructions as follows:


# before (original)

4. Create the output directories if they don't exist:
   `docs/research/`, `docs/research/components/`,
   `docs/design-references/`, `scripts/`.
   For multiple clones, also prepare per-site folders like
   `docs/research/<hostname>/` and `docs/design-references/<hostname>/`.

# after (custom)

4. Create the output directories if they don't exist:
   `my-project/docs/research/`,
   `my-project/docs/design-references/`,
   `my-project/public/images/`,
   `my-project/public/videos/`.
   For each target URL, create a folder named after its hostname:
   `my-project/docs/research/<hostname>/` and
   `my-project/docs/design-references/<hostname>/`.

Note: The <hostname> placeholder remains dynamic, resolving to the target site's domain name during execution.

Regenerating Platform-Specific Skill Copies

The repository maintains one canonical skill file, but platform-specific copies (e.g., /.claude/skills/clone-website/SKILL.md for Claude, and equivalents for Gemini or Cursor) are generated automatically. After editing the source file, propagate your changes by running:

node scripts/sync-skills.mjs

This script reads .github/skills/clone-website/SKILL.md, injects your custom paths, and writes updated versions to all relevant platform directories. This step guarantees that every AI agent environment sees the updated layout before you invoke the clone command.

Updating Custom Asset Download Scripts (Optional)

If you have added bespoke automation that handles downloaded assets, update any hard-coded paths to match your new structure. The only built-in reference to the default layout is the placeholder in SKILL.md; the scaffold itself contains no runtime directory logic.

To align asset downloads with your custom layout, modify the Asset Discovery Script Pattern section within SKILL.md. Update the fetch and fs.writeFile target folders:

// Original path
await fetch(imageUrl).then(r => r.arrayBuffer())
  .then(buf => fs.writeFileSync(`public/images/${filename}`, Buffer.from(buf)));

// Custom path under my-project
await fetch(imageUrl).then(r => r.arrayBuffer())
  .then(buf => fs.writeFileSync(`my-project/public/images/${filename}`, Buffer.from(buf)));

Executing the Clone with the New Structure

With the skill definition updated and platform copies synchronized, invoke the command as usual:

/clone-website https://example.com https://another-site.org

The agents will now write specifications to:


my-project/docs/research/example.com/
my-project/docs/design-references/example.com/
my-project/docs/research/another-site.org/
my-project/docs/design-references/another-site.org/

All downloaded media will populate my-project/public/images/ and my-project/public/videos/. The remainder of the pipeline—spec generation, builder dispatch, merge operations, and QA—functions unchanged because the paths carry forward automatically from the skill text.

Summary

  • Edit .github/skills/clone-website/SKILL.md to redefine base output paths and hostname folder patterns.
  • Regenerate platform-specific copies by running node scripts/sync-skills.mjs after any edit to the skill file.
  • Update custom asset scripts if they reference the original folder names outside the skill definition.
  • Execute /clone-website to generate files in your customized hierarchy without additional code changes.

Frequently Asked Questions

Where is the source of truth for the output directory structure?

The source of truth is .github/skills/clone-website/SKILL.md. This file contains the pure-text description that AI agents consume; the exact folder paths are copied verbatim into the prompts used when writing spec files and downloading assets.

Do I need to modify multiple files if I change the directory layout?

No. You only need to edit SKILL.md to change the directory structure. After editing, run node scripts/sync-skills.mjs to regenerate platform-specific copies for Claude, Gemini, Cursor, and other supported environments.

Will changing the output paths affect the asset download behavior?

Yes. You must update the Asset Discovery Script Pattern section in SKILL.md to reflect new target folders in the fetch and fs.writeFile calls. Otherwise, agents may attempt to write assets to non-existent default locations.

Does the template require code changes to support custom directories?

No. The template contains no hardcoded runtime logic for directory paths. All path definitions exist only as text placeholders in the skill definition, making customization a matter of editing text files and regenerating copies.

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 →