Optimize the implemented site to match the target website. This command should NOT be triggered directly by agents.
Compares the target website against the implemented site and iteratively refines the implementation until visually and behaviorally identical.
/plugin marketplace add adlsdztony/claude-marketplace/plugin install web-clone@adlsdztonyYou are the OPTIMIZATION COMMAND (/optimize).
This command compares the target website against the implemented site and iteratively refines the implementation until the two are visually and behaviorally identical.
When invoked, this command will:
.spec/optimize/ directories for artifactstarget_url (required)local_url (optional, default: http://localhost:3000)routes (optional, default: "/")sessions (optional, default: 0)0 = unlimitedN = stop after N full optimization passes/optimize target_url="https://example.com" local_url="http://localhost:3000" routes="/"
/optimize target_url="https://example.com" local_url="http://localhost:3000" routes="/,/pricing,/login"
You are the OPTIMIZATION AGENT. Your job is to compare the target site and the implemented site, coordinate fixes, and maintain an optimization list until they match.
.spec/optimize_list.json.spec/optimize/--no-sandboxDo NOT try to optimize everything in a single context window. Use the Task tool to spawn subagents:
Before running optimization:
.spec/app_spec.txt exists.spec/explore_list.json exists (for root_url reference).spec/feature_list.json exists"passes": true in feature_list.json.spec/init.sh exists.spec/init.sh to start serversIf any prerequisite is missing, stop and instruct the user to complete /explore or /implement.
Create these directories if missing:
.spec/optimize/screenshots/target/
.spec/optimize/screenshots/local/
.spec/optimize/snapshots/
.spec/optimize/reports/
.spec/optimize/logs/
Use the Task tool to invoke optimization-initializer-agent with:
target_urllocal_urlroutesThis subagent will read:
.spec/app_spec.txt.spec/feature_list.json.spec/explore_list.jsonIt will create or update .spec/optimize_list.json:
{
"target_url": "https://example.com",
"local_url": "http://localhost:3000",
"routes": ["/", "/pricing", "/login"],
"items": [
{
"id": 1,
"route": "/",
"goal": "Homepage matches the target site",
"actions": [
{ "type": "scroll", "value": "middle" },
{ "type": "scroll", "value": "bottom" }
],
"status": "pending",
"differences": [],
"artifacts": {
"target": [],
"local": [],
"diff": []
},
"notes": ""
}
]
}
Rules:
pending, in_progress, needs_fix, done, blockeddifferences and artifacts updatedFor each item with status pending or needs_fix:
.spec/optimize/.spec/optimize/logs/optimize-log.md.spec/feature_list.json (rare)Repeat until no pending/needs_fix items remain or the session limit is reached.
When all items are marked "done":
.spec/optimize/reports/final-summary.mdAfter completion, you'll have:
.spec/optimize_list.json - Dynamic optimization goals and status.spec/optimize/ - Target/local screenshots, snapshots, diff reports.spec/optimize/reports/final-summary.md - Final verification summaryIf any items remain in needs_fix, rerun:
/optimize target_url="https://example.com" local_url="http://localhost:3000"