Skip to content

PhilRobinluo/ai-coevolution-skills / skills/lls-image-renamer

lls-image-renamer

Verified

批量规划可搜索、可追溯的图片文件名,在真正改名之前检查重名、越界和引用影响。 当用户要处理相关材料并需要可验证交付物时使用。

FileKindSize
README.mdmarkdown1.8 KB
SKILL.mdskill md4.5 KB
references/rename-review.mdmarkdown358 B
scripts/plan_rename.pyexecutablescript2.7 KB
tests/test_plan_rename.pyscript1.2 KB

tests/test_plan_rename.py

View on GitHub
import json,subprocess,sys,tempfile,unittest
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]
class T(unittest.TestCase):
 def test_dry_run_and_apply(self):
  with tempfile.TemporaryDirectory() as d:
   d=Path(d); (d/'IMG_1234.png').write_bytes(b'x'); m=d/'map.json'; m.write_text(json.dumps([{'file':'IMG_1234.png','description':'GitHub 发布页'}]))
   r=subprocess.run([sys.executable,str(ROOT/'scripts/plan_rename.py'),'--root',str(d),'--mapping',str(m)],capture_output=True,text=True,check=True); self.assertTrue((d/'IMG_1234.png').exists()); self.assertIn('GitHub-发布页__IMG_1234.png',r.stdout)
   subprocess.run([sys.executable,str(ROOT/'scripts/plan_rename.py'),'--root',str(d),'--mapping',str(m),'--apply'],check=True,capture_output=True,text=True); self.assertTrue((d/'GitHub-发布页__IMG_1234.png').exists())
 def test_collision_stops(self):
  with tempfile.TemporaryDirectory() as d:
   d=Path(d); (d/'a.png').write_bytes(b'a'); (d/'测试__a.png').write_bytes(b'b')
   r=subprocess.run([sys.executable,str(ROOT/'scripts/plan_rename.py'),str(d/'a.png'),'--description','测试','--root',str(d)],capture_output=True,text=True); self.assertNotEqual(r.returncode,0); self.assertTrue((d/'a.png').exists())
if __name__=='__main__':unittest.main()
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall