| name | sync-mirror |
| description | Sync code changes from the live AgentDojo workspace ($LIVE) to the IPIAttack git mirror and commit them. Use when the user asks to "최신화", "git에 올려줘", "sync mirror", "mirror 최신화", or says the mirror is out of date. Read-only for runs/, logs/, reports/, figures/ (data artifacts never go to git). |
sync-mirror
Sync source-code changes from the live workspace to the git-tracked mirror and commit them. This skill keeps the IPIAttack repo aligned with the actually-running code at $LIVE.
Paths
LIVE=/home/dgu_wj92/ysl/AgenticRAG/Experiment1/AgentDojo # authoritative, NOT a git repo
MIRROR=/home/dgu_wj92/ysl/StealthyIPIAttack/AgentDojo # git-tracked mirror (inside /home/dgu_wj92/ysl/StealthyIPIAttack)
REPO=/home/dgu_wj92/ysl/StealthyIPIAttack # git repo root
What to sync
Do sync (code / configuration / docs):
scripts/*.py, scripts/*.json (sample definitions etc.)
shell_scripts/*.sh
ChatInject/src/** and method/** (attack implementations)
agentdojo_patches/**
docs/*.md
.claude/skills/**/SKILL.md
- Any new Python / notebook / markdown file under the repo root that isn't in the Do NOT list
Do NOT sync (data / transient / secrets):
runs/** — benchmark outputs, huge, live-only
logs/** — stdout/stderr, live-only
reports/**, figures/** — generated artifacts
__pycache__/, .ipynb_checkpoints/
.env, any credential file
SESSION_BACKUP_*.md unless user explicitly asks (large, often noisy)
Procedure
-
Diff to find what changed:
diff -rq "$MIRROR" "$LIVE" 2>&1 | grep -vE "^Only in .*(runs|logs|__pycache__|\.ipynb_checkpoints|\.git|reports|figures)"
Review the output — three categories:
Files A and B differ — file exists in both, content changed
Only in $LIVE: X — new file live-only, needs to be copied to mirror
Only in $MIRROR: X — mirror-only file (either deleted in live, or skill/doc added directly to mirror). Ask before deleting; default to keeping.
-
For each file that should sync (per the "What to sync" list above):
- If newer in live →
cp "$LIVE/path" "$MIRROR/path" (create parent dirs first with mkdir -p if needed)
- If newer in mirror (e.g. skill file edited directly) → copy mirror → live so both stay consistent
- Show the user the list of files you're about to sync before copying. Especially flag anything >1 MB or any
.json file under scripts/ that could be a huge sample file.
-
Do not sync:
.env or any file mentioned in the "Do NOT sync" list above
- Files you can't classify — ask the user
-
Commit:
cd "$REPO"
git add <specific files>
git commit -m "sync: <short description of what changed>"
- Message style: lowercase,
sync: prefix, 1-line summary of what moved.
- Do NOT push. User pushes manually.
- If the commit fails, report the error and stop — no
--amend, no --no-verify.
-
Report:
- Print the commit hash and the list of files synced.
- If there are mirror-only files you did NOT delete, flag them so the user can decide.
Constraints
- Never run
git add -A or git add .. Always stage by explicit path.
- Never push. User pushes manually before meetings.
- Never delete mirror-only files without asking.
- Never sync
.env, credentials, or runs/logs/reports/figures artifacts, even if user asks — warn them instead.
- Bi-directional sync is OK when it's obvious which side is newer (e.g. SKILL.md was edited in mirror and needs to propagate to live). When unclear, ask.
- If
diff -rq reports No such file or directory warnings for nested identically-named dirs (like ChatInject/ChatInject), that's a known diff quirk — ignore.