| name | sync-tests |
| description | Copy generated and healed test files from the plugin's output directory into the user's target repo. Honours the user's sync.config.json mappings. Use when the user says "sync the tests", "push generated tests to the app repo", or after /generate-tests. |
| argument-hint | ["--dry-run"] |
| allowed-tools | ["Read","Write","Bash","Glob"] |
Sync Tests
Copy generated artifacts from ${user_config.output_dir}/${user_config.app_name}/ into ${user_config.target_repo} according to the user's sync.config.json.
Inputs
${user_config.app_name} — slug
${user_config.output_dir} — source base (default output/)
${user_config.target_repo} — destination repo path
${user_config.playwright_test_dir} — relative subdir in the target repo (default e2e/tests)
$ARGUMENTS — pass --dry-run to preview without copying
Steps
- Locate the sync config. Look for
${user_config.output_dir}/../apps/${user_config.app_name}/sync.config.json, then ./sync.config.json at project root, then fall back to the default mapping below.
- Verify the target repo exists. If
${user_config.target_repo} doesn't exist, stop and tell the user.
- Run the sync. Prefer the bundled helper script:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/sync.sh" \
--source "${user_config.output_dir}/${user_config.app_name}" \
--target "${user_config.target_repo}" \
--tests-dir "${user_config.playwright_test_dir}" \
[--dry-run]
If that script is unavailable, fall back to cp -R with the mappings below, respecting the dry-run flag.
- Report every file copied (or, in dry-run, every file that would be copied), grouped by mapping.
Default mapping
If no sync.config.json is found, use these defaults:
Source (under ${output_dir}/${app_name}/) | Destination (under ${target_repo}/) | Overwrite |
|---|
tests/ | ${user_config.playwright_test_dir} | no |
healed/ | ${user_config.playwright_test_dir} | yes |
plans/ | e2e/plans/ | no |
reports/ | e2e/reports/ | no |
healed/ overwrites because the whole point of healing is to replace the broken file. Always run with --dry-run first if the user has uncommitted changes in the target repo.
sync.config.json schema
If the user supplies one, it looks like:
{
"app": "<app_name>",
"sourceOutputDir": "<output dir for this app>",
"targetRepo": "<absolute or relative path>",
"mappings": [
{ "from": "tests", "to": "e2e/tests", "description": "Generated specs" },
{ "from": "healed", "to": "e2e/tests", "description": "Healed specs", "overwrite": true },
{ "from": "plans", "to": "e2e/plans", "description": "Plans for review" },
{ "from": "reports", "to": "e2e/reports", "description": "Test reports" }
],
"createIfMissing": ["e2e", "e2e/tests", "e2e/plans", "e2e/reports", "e2e/fixtures"]
}
Mappings without overwrite: true skip files that already exist (and log them).