1212import sys
1313from pathlib import Path
1414
15- # Ensure UTF-8 output for emoji support on Windows
16- if sys .platform == "win32" :
17- import codecs
18-
19- if sys .stdout .encoding != "utf-8" :
20- sys .stdout = codecs .getwriter ("utf-8" )(sys .stdout .buffer , "strict" )
21- if sys .stderr .encoding != "utf-8" :
22- sys .stderr = codecs .getwriter ("utf-8" )(sys .stderr .buffer , "strict" )
23-
2415
2516def get_skill_source_path () -> Path :
2617 """Get the path to the skill source directory in the package."""
@@ -68,24 +59,24 @@ def install_skill(force: bool = False) -> bool:
6859
6960 # Validate source exists
7061 if not skill_source .exists ():
71- print (f"❌ Error: Skill source not found at { skill_source } " )
72- print (" This may indicate a packaging issue." )
62+ print (f"[ERROR] Skill source not found at { skill_source } " )
63+ print (" This may indicate a packaging issue." )
7364 return False
7465
7566 skill_md = skill_source / "SKILL.md"
7667 if not skill_md .exists ():
77- print (f"❌ Error: SKILL.md not found at { skill_md } " )
68+ print (f"[ERROR] SKILL.md not found at { skill_md } " )
7869 return False
7970
8071 # Check if skill already exists
8172 if skill_dest .exists ():
8273 if not force :
83- print (f"⚠️ Skill already exists at { skill_dest } " )
84- response = input (" Overwrite existing skill? (y/n): " ).strip ().lower ()
74+ print (f"[WARN] Skill already exists at { skill_dest } " )
75+ response = input (" Overwrite existing skill? (y/n): " ).strip ().lower ()
8576 if response not in ["y" , "yes" ]:
86- print (" Installation cancelled." )
77+ print (" Installation cancelled." )
8778 return False
88- print (f" Updating existing skill..." )
79+ print (f" Updating existing skill..." )
8980
9081 # Create destination directory
9182 skill_dest .parent .mkdir (parents = True , exist_ok = True )
@@ -95,19 +86,19 @@ def install_skill(force: bool = False) -> bool:
9586 if skill_dest .exists ():
9687 shutil .rmtree (skill_dest )
9788 shutil .copytree (skill_source , skill_dest )
98- print (f"✅ Dataverse SDK skill installed successfully!" )
99- print (f" Location: { skill_dest } " )
89+ print (f"[OK] Dataverse SDK skill installed successfully!" )
90+ print (f" Location: { skill_dest } " )
10091 print ()
101- print (" Claude Code will now automatically use this skill when working" )
102- print (" with the PowerPlatform Dataverse Client SDK." )
92+ print (" Claude Code will now automatically use this skill when working" )
93+ print (" with the PowerPlatform Dataverse Client SDK." )
10394 print ()
104- print ("💡 Next steps:" )
105- print (" • Start Claude Code in your project directory" )
106- print (" • Ask Claude for help with Dataverse operations" )
107- print (" • Claude will automatically apply SDK best practices" )
95+ print ("[INFO] Next steps:" )
96+ print (" * Start Claude Code in your project directory" )
97+ print (" * Ask Claude for help with Dataverse operations" )
98+ print (" * Claude will automatically apply SDK best practices" )
10899 return True
109100 except Exception as e :
110- print (f"❌ Error installing skill: { e } " )
101+ print (f"[ERROR] Error installing skill: { e } " )
111102 return False
112103
113104
@@ -121,45 +112,45 @@ def uninstall_skill() -> bool:
121112 skill_dest = get_skill_destination_path ()
122113
123114 if not skill_dest .exists ():
124- print (f"ℹ️ Skill not found at { skill_dest } " )
125- print (" Nothing to uninstall." )
115+ print (f"[INFO] Skill not found at { skill_dest } " )
116+ print (" Nothing to uninstall." )
126117 return True
127118
128119 try :
129120 shutil .rmtree (skill_dest )
130- print (f"✅ Dataverse SDK skill uninstalled successfully!" )
131- print (f" Removed from: { skill_dest } " )
121+ print (f"[OK] Dataverse SDK skill uninstalled successfully!" )
122+ print (f" Removed from: { skill_dest } " )
132123 return True
133124 except Exception as e :
134- print (f"❌ Error uninstalling skill: { e } " )
125+ print (f"[ERROR] Error uninstalling skill: { e } " )
135126 return False
136127
137128
138129def check_skill_status () -> None :
139130 """Check and display the current skill installation status."""
140131 skill_dest = get_skill_destination_path ()
141132
142- print ("🔍 Dataverse SDK Skill Status" )
133+ print ("[INFO] Dataverse SDK Skill Status" )
143134 print ("=" * 60 )
144135
145136 if skill_dest .exists ():
146137 skill_md = skill_dest / "SKILL.md"
147138 if skill_md .exists ():
148- print (f"✅ Status: Installed" )
149- print (f" Location: { skill_dest } " )
150- print (f" Skill file: { skill_md } " )
139+ print (f"[OK] Status: Installed" )
140+ print (f" Location: { skill_dest } " )
141+ print (f" Skill file: { skill_md } " )
151142 print ()
152- print (" The skill is ready to use with Claude Code." )
143+ print (" The skill is ready to use with Claude Code." )
153144 else :
154- print (f"⚠️ Status: Partially installed (SKILL.md missing)" )
155- print (f" Location: { skill_dest } " )
145+ print (f"[WARN] Status: Partially installed (SKILL.md missing)" )
146+ print (f" Location: { skill_dest } " )
156147 print ()
157- print (" Consider reinstalling: dataverse-install-claude-skill --force" )
148+ print (" Consider reinstalling: dataverse-install-claude-skill --force" )
158149 else :
159- print (f"❌ Status: Not installed" )
160- print (f" Expected location: { skill_dest } " )
150+ print (f"[ERROR] Status: Not installed" )
151+ print (f" Expected location: { skill_dest } " )
161152 print ()
162- print (" To install: dataverse-install-claude-skill" )
153+ print (" To install: dataverse-install-claude-skill" )
163154
164155
165156def main () -> None :
@@ -202,7 +193,7 @@ def main() -> None:
202193 args = parser .parse_args ()
203194
204195 print ()
205- print ("🚀 PowerPlatform Dataverse SDK - Claude Code Skill Installer" )
196+ print ("PowerPlatform Dataverse SDK - Claude Code Skill Installer" )
206197 print ("=" * 60 )
207198 print ()
208199
0 commit comments