Skip to content

fix(skill-creator): support direct execution of package_skill.py and update usage paths - #1681

Open
Kuldeeep18 wants to merge 1 commit into
anthropics:mainfrom
Kuldeeep18:fix/skill-creator-package-skill-direct-execution
Open

fix(skill-creator): support direct execution of package_skill.py and update usage paths#1681
Kuldeeep18 wants to merge 1 commit into
anthropics:mainfrom
Kuldeeep18:fix/skill-creator-package-skill-direct-execution

Conversation

@Kuldeeep18

Copy link
Copy Markdown

Problem

Running \package_skill.py\ directly as a standalone script (e.g., \python skills/skill-creator/scripts/package_skill.py ) fails with \ModuleNotFoundError: No module named 'scripts.quick_validate'. Additionally, the docstrings and CLI help messages contain outdated references to \utils/package_skill.py\ and \skills/public/....

Root Cause

When executed directly as a script, Python places the script's immediate directory (\skills/skill-creator/scripts) at \sys.path[0], preventing the top-level \scripts\ package from being resolved.

Solution

  1. Add the parent \skill-creator\ directory to \sys.path\ if not already present, allowing \ rom scripts.quick_validate import validate_skill\ to resolve under both direct script execution and module execution (\python -m scripts.package_skill).
  2. Update the docstring and CLI help usage examples to reference current repository paths (\scripts/package_skill.py\ and \skills/brand-guidelines).

Verification

  • Direct execution from workspace root: \python skills/skill-creator/scripts/package_skill.py skills/brand-guidelines\
  • Direct execution from \skills/skill-creator: \python scripts/package_skill.py ../brand-guidelines\
  • Module execution from \skills/skill-creator: \python -m scripts.package_skill ../brand-guidelines\
  • Verified CLI usage message when called without arguments.

Risk

Low. The change is limited to \package_skill.py\ and preserves the existing \scripts.quick_validate\ import. Direct and module execution were both verified successfully.

@Kuldeeep18

Copy link
Copy Markdown
Author

Hi @maheshmurag, whenever you have a moment, could you please take a look at this quick fix? It is a small self-contained change (+13/-6) resolving standalone script execution for package_skill.py while preserving existing module imports. All verification steps have been tested and passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants