2424import argparse
2525import shutil
2626import sys
27-
2827from pathlib import Path
2928
30-
3129SKILL_NAME = "decoupler"
3230
3331
@@ -40,7 +38,6 @@ def _bundled_skill_dir() -> Path:
4038 The ``data/`` directory containing the bundled ``SKILL.md`` and
4139 ``references/``.
4240 """
43-
4441 return Path (__file__ ).resolve ().parent / "data"
4542
4643
@@ -52,7 +49,6 @@ def _default_dest() -> Path:
5249 dest : pathlib.Path
5350 ``~/.claude/skills/decoupler``.
5451 """
55-
5652 return Path .home () / ".claude" / "skills" / SKILL_NAME
5753
5854
@@ -78,28 +74,22 @@ def install_skill(dest: Path | None = None, force: bool = False) -> Path:
7874 dest : pathlib.Path
7975 The directory the skill was installed into.
8076 """
81-
8277 src = _bundled_skill_dir ()
8378 if not (src / "SKILL.md" ).is_file ():
8479 raise FileNotFoundError (
85- "Bundled skill not found at {}. The package may be installed "
86- "without its skill data." .format (src )
80+ f"Bundled skill not found at { src } . The package may be installed without its skill data."
8781 )
8882
8983 if dest is None :
9084 dest = _default_dest ()
9185
9286 if dest .exists ():
9387 if not force :
94- raise FileExistsError (
95- "{} already exists. Re-run with --force to overwrite." .format (dest )
96- )
88+ raise FileExistsError (f"{ dest } already exists. Re-run with --force to overwrite." )
9789 shutil .rmtree (dest )
9890
9991 dest .parent .mkdir (parents = True , exist_ok = True )
100- shutil .copytree (
101- src , dest , ignore = shutil .ignore_patterns (".ipynb_checkpoints" , "__pycache__" )
102- )
92+ shutil .copytree (src , dest , ignore = shutil .ignore_patterns (".ipynb_checkpoints" , "__pycache__" ))
10393 return dest
10494
10595
@@ -116,7 +106,6 @@ def main(argv: list[str] | None = None) -> int:
116106 code : int
117107 Process exit code; 0 on success and 1 on a handled error.
118108 """
119-
120109 parser = argparse .ArgumentParser (
121110 prog = "decoupler-install-skills" ,
122111 description = "Install the decoupler Agent Skill for Claude Code." ,
@@ -127,9 +116,7 @@ def main(argv: list[str] | None = None) -> int:
127116 default = None ,
128117 help = "Destination directory (default: ~/.claude/skills/decoupler)." ,
129118 )
130- parser .add_argument (
131- "--force" , action = "store_true" , help = "Overwrite an existing installation."
132- )
119+ parser .add_argument ("--force" , action = "store_true" , help = "Overwrite an existing installation." )
133120 parser .add_argument (
134121 "--print-path" ,
135122 action = "store_true" ,
@@ -144,10 +131,10 @@ def main(argv: list[str] | None = None) -> int:
144131 try :
145132 dest = install_skill (dest = args .dest , force = args .force )
146133 except (FileExistsError , FileNotFoundError ) as e :
147- print ("error: {}" . format ( e ) , file = sys .stderr )
134+ print (f "error: { e } " , file = sys .stderr )
148135 return 1
149136
150- print ("Installed decoupler skill to {}" . format ( dest ) )
137+ print (f "Installed decoupler skill to { dest } " )
151138 print ("It will be available to Claude Code in your next session." )
152139 return 0
153140
0 commit comments