Fix CLI path references in Python code
All Python scripts now use correct cli/ prefix in: - Usage docstrings (shown in --help) - Print statements (shown to users) - Subprocess calls (when calling other scripts) Changes: - cli/doc_scraper.py: Fixed 9 references (usage, print, subprocess) - cli/enhance_skill_local.py: Fixed 6 references (usage, print) - cli/enhance_skill.py: Fixed 5 references (usage, print) - cli/package_skill.py: Fixed 4 references (usage, epilog) - cli/estimate_pages.py: Fixed 3 references (epilog examples) All commands now correctly show: - python3 cli/doc_scraper.py (not python3 doc_scraper.py) - python3 cli/enhance_skill.py (not python3 enhance_skill.py) - python3 cli/enhance_skill_local.py (not python3 enhance_skill_local.py) - python3 cli/package_skill.py (not python3 package_skill.py) - python3 cli/estimate_pages.py (not python3 estimate_pages.py) Also fixed: - Old hardcoded path in enhance_skill_local.py:221 (was: /mnt/skills/examples/skill-creator/scripts/package_skill.py) (now: cli/package_skill.py) - Old hardcoded path in enhance_skill.py:210 (was: /mnt/skills/examples/skill-creator/scripts/package_skill.py) (now: cli/package_skill.py) This ensures all user-facing messages and subprocess calls use the correct paths when run from the repository root. Related: PR #145
This commit is contained in:
@@ -4,9 +4,9 @@ Documentation to Claude Skill Converter
|
||||
Single tool to scrape any documentation and create high-quality Claude skills.
|
||||
|
||||
Usage:
|
||||
python3 doc_scraper.py --interactive
|
||||
python3 doc_scraper.py --config configs/godot.json
|
||||
python3 doc_scraper.py --url https://react.dev/ --name react
|
||||
python3 cli/doc_scraper.py --interactive
|
||||
python3 cli/doc_scraper.py --config configs/godot.json
|
||||
python3 cli/doc_scraper.py --url https://react.dev/ --name react
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -1009,7 +1009,7 @@ def main():
|
||||
|
||||
try:
|
||||
import subprocess
|
||||
enhance_cmd = ['python3', 'enhance_skill.py', f'output/{config["name"]}/']
|
||||
enhance_cmd = ['python3', 'cli/enhance_skill.py', f'output/{config["name"]}/']
|
||||
if args.api_key:
|
||||
enhance_cmd.extend(['--api-key', args.api_key])
|
||||
|
||||
@@ -1020,7 +1020,7 @@ def main():
|
||||
print("\n⚠ Enhancement failed, but skill was still built")
|
||||
except FileNotFoundError:
|
||||
print("\n⚠ enhance_skill.py not found. Run manually:")
|
||||
print(f" python3 enhance_skill.py output/{config['name']}/")
|
||||
print(f" python3 cli/enhance_skill.py output/{config['name']}/")
|
||||
|
||||
# Optional enhancement with Claude Code (local, no API key)
|
||||
if args.enhance_local:
|
||||
@@ -1030,22 +1030,22 @@ def main():
|
||||
|
||||
try:
|
||||
import subprocess
|
||||
enhance_cmd = ['python3', 'enhance_skill_local.py', f'output/{config["name"]}/']
|
||||
enhance_cmd = ['python3', 'cli/enhance_skill_local.py', f'output/{config["name"]}/']
|
||||
subprocess.run(enhance_cmd, check=True)
|
||||
except subprocess.CalledProcessError:
|
||||
print("\n⚠ Enhancement failed, but skill was still built")
|
||||
except FileNotFoundError:
|
||||
print("\n⚠ enhance_skill_local.py not found. Run manually:")
|
||||
print(f" python3 enhance_skill_local.py output/{config['name']}/")
|
||||
print(f" python3 cli/enhance_skill_local.py output/{config['name']}/")
|
||||
|
||||
print(f"\n📦 Package your skill:")
|
||||
print(f" python3 package_skill.py output/{config['name']}/")
|
||||
print(f" python3 cli/package_skill.py output/{config['name']}/")
|
||||
|
||||
if not args.enhance and not args.enhance_local:
|
||||
print(f"\n💡 Optional: Enhance SKILL.md with Claude:")
|
||||
print(f" API-based: python3 enhance_skill.py output/{config['name']}/")
|
||||
print(f" API-based: python3 cli/enhance_skill.py output/{config['name']}/")
|
||||
print(f" or re-run with: --enhance")
|
||||
print(f" Local (no API key): python3 enhance_skill_local.py output/{config['name']}/")
|
||||
print(f" Local (no API key): python3 cli/enhance_skill_local.py output/{config['name']}/")
|
||||
print(f" or re-run with: --enhance-local")
|
||||
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ Return ONLY the complete SKILL.md content, starting with the frontmatter (---).
|
||||
print(f" 1. Review: {self.skill_md_path}")
|
||||
print(f" 2. If you don't like it, restore backup: {self.skill_md_path.with_suffix('.md.backup')}")
|
||||
print(f" 3. Package your skill:")
|
||||
print(f" python3 /mnt/skills/examples/skill-creator/scripts/package_skill.py {self.skill_dir}/")
|
||||
print(f" python3 cli/package_skill.py {self.skill_dir}/")
|
||||
|
||||
return True
|
||||
|
||||
@@ -220,13 +220,13 @@ def main():
|
||||
Examples:
|
||||
# Using ANTHROPIC_API_KEY environment variable
|
||||
export ANTHROPIC_API_KEY=sk-ant-...
|
||||
python3 enhance_skill.py output/steam-inventory/
|
||||
python3 cli/enhance_skill.py output/steam-inventory/
|
||||
|
||||
# Providing API key directly
|
||||
python3 enhance_skill.py output/react/ --api-key sk-ant-...
|
||||
python3 cli/enhance_skill.py output/react/ --api-key sk-ant-...
|
||||
|
||||
# Show what would be done (dry run)
|
||||
python3 enhance_skill.py output/godot/ --dry-run
|
||||
python3 cli/enhance_skill.py output/godot/ --dry-run
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -265,7 +265,7 @@ Examples:
|
||||
print(f" - {rf.name} ({size:,} bytes)")
|
||||
|
||||
print("\nTo actually run enhancement:")
|
||||
print(f" python3 enhance_skill.py {skill_dir}")
|
||||
print(f" python3 cli/enhance_skill.py {skill_dir}")
|
||||
return
|
||||
|
||||
# Create enhancer and run
|
||||
|
||||
@@ -5,8 +5,8 @@ Opens a new terminal with Claude Code to enhance SKILL.md, then reports back.
|
||||
No API key needed - uses your existing Claude Code Max plan!
|
||||
|
||||
Usage:
|
||||
python3 enhance_skill_local.py output/steam-inventory/
|
||||
python3 enhance_skill_local.py output/react/
|
||||
python3 cli/enhance_skill_local.py output/steam-inventory/
|
||||
python3 cli/enhance_skill_local.py output/react/
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -218,18 +218,18 @@ rm {prompt_file}
|
||||
print("💡 When done:")
|
||||
print(f" 1. Check the enhanced SKILL.md: {self.skill_md_path}")
|
||||
print(f" 2. If you don't like it, restore: mv {self.skill_md_path.with_suffix('.md.backup')} {self.skill_md_path}")
|
||||
print(f" 3. Package: python3 /mnt/skills/examples/skill-creator/scripts/package_skill.py {self.skill_dir}/")
|
||||
print(f" 3. Package: python3 cli/package_skill.py {self.skill_dir}/")
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: python3 enhance_skill_local.py <skill_directory>")
|
||||
print("Usage: python3 cli/enhance_skill_local.py <skill_directory>")
|
||||
print()
|
||||
print("Examples:")
|
||||
print(" python3 enhance_skill_local.py output/steam-inventory/")
|
||||
print(" python3 enhance_skill_local.py output/react/")
|
||||
print(" python3 cli/enhance_skill_local.py output/steam-inventory/")
|
||||
print(" python3 cli/enhance_skill_local.py output/react/")
|
||||
sys.exit(1)
|
||||
|
||||
skill_dir = sys.argv[1]
|
||||
|
||||
@@ -215,13 +215,13 @@ def main():
|
||||
epilog="""
|
||||
Examples:
|
||||
# Estimate pages for a config
|
||||
python3 estimate_pages.py configs/react.json
|
||||
python3 cli/estimate_pages.py configs/react.json
|
||||
|
||||
# Estimate with higher discovery limit
|
||||
python3 estimate_pages.py configs/godot.json --max-discovery 2000
|
||||
python3 cli/estimate_pages.py configs/godot.json --max-discovery 2000
|
||||
|
||||
# Quick estimate (stop at 100 pages)
|
||||
python3 estimate_pages.py configs/vue.json --max-discovery 100
|
||||
python3 cli/estimate_pages.py configs/vue.json --max-discovery 100
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ Simple Skill Packager
|
||||
Packages a skill directory into a .zip file for Claude.
|
||||
|
||||
Usage:
|
||||
python3 package_skill.py output/steam-inventory/
|
||||
python3 package_skill.py output/react/
|
||||
python3 package_skill.py output/react/ --no-open # Don't open folder
|
||||
python3 cli/package_skill.py output/steam-inventory/
|
||||
python3 cli/package_skill.py output/react/
|
||||
python3 cli/package_skill.py output/react/ --no-open # Don't open folder
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -96,10 +96,10 @@ def main():
|
||||
epilog="""
|
||||
Examples:
|
||||
# Package skill and open folder
|
||||
python3 package_skill.py output/react/
|
||||
python3 cli/package_skill.py output/react/
|
||||
|
||||
# Package skill without opening folder
|
||||
python3 package_skill.py output/react/ --no-open
|
||||
python3 cli/package_skill.py output/react/ --no-open
|
||||
|
||||
# Get help
|
||||
python3 package_skill.py --help
|
||||
|
||||
Reference in New Issue
Block a user