From da4ef951ac99302d7269fd179b6f2b84e75c8fff Mon Sep 17 00:00:00 2001 From: Research Assistant Date: Tue, 12 May 2026 02:13:03 +0800 Subject: [PATCH] fix(setup): overwrite skills on wizard re-run, never overwrite AGENTS.md --- paperforge/services/skill_deploy.py | 6 ++---- paperforge/setup_wizard.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/paperforge/services/skill_deploy.py b/paperforge/services/skill_deploy.py index 66076b09..48782d5a 100644 --- a/paperforge/services/skill_deploy.py +++ b/paperforge/services/skill_deploy.py @@ -69,15 +69,13 @@ def deploy_skills( else: errors.append("Skills source not found in package") - # ── Deploy AGENTS.md ── + # ── Deploy AGENTS.md (only if it does not exist — users customise it) ── agents_ok = False agents_src = source_root.parent / "AGENTS.md" if agents_src.exists(): try: agents_dst = vault / "AGENTS.md" - if overwrite and agents_dst.exists(): - agents_dst.unlink() - if overwrite or not agents_dst.exists(): + if not agents_dst.exists(): shutil.copy2(agents_src, agents_dst) agents_ok = True except Exception as e: diff --git a/paperforge/setup_wizard.py b/paperforge/setup_wizard.py index 2dc98d55..f3cee713 100644 --- a/paperforge/setup_wizard.py +++ b/paperforge/setup_wizard.py @@ -650,7 +650,7 @@ def headless_setup( skill_result = _deploy_skills_service( vault=vault, agent_key=agent_key, - overwrite=False, + overwrite=True, ) if skill_result["skill_deployed"]: print(" [OK] literature-qa skill deployed")