Skip to content

Conversation

@gotalab
Copy link
Owner

@gotalab gotalab commented Dec 6, 2025

Summary

  • Extract rename_single_skill_dir() helper to consolidate duplicate logic
  • Used by both add.py and update.py for handling single-skill GitHub repos

Changes

  • Add rename_single_skill_dir() to internal/github.py
  • Export from internal/__init__.py
  • Simplify add.py and update.py to use shared helper

Test plan

  • All 362 tests pass
  • Ruff lint passes

🤖 Generated with Claude Code

- Add rename_single_skill_dir() to internal/github.py
- Consolidate duplicate single-skill directory rename logic
- Update add.py and update.py to use shared helper

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copilot AI review requested due to automatic review settings December 6, 2025 09:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR successfully extracts duplicate directory renaming logic into a reusable helper function. When GitHub repositories contain a single skill, the extracted temporary directory needs to be renamed to match the skill name from SKILL.md frontmatter. This logic was duplicated in both add.py and update.py and has been consolidated into rename_single_skill_dir().

Key Changes:

  • Extracted rename_single_skill_dir() helper function in internal/github.py
  • Simplified both add.py and update.py to use the shared helper
  • Maintained backward-compatible behavior with early-return optimization

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/skillport/modules/skills/internal/github.py Added rename_single_skill_dir() helper function that renames extracted GitHub directories to match single skill names
src/skillport/modules/skills/internal/init.py Exported new rename_single_skill_dir function from internal module
src/skillport/modules/skills/public/add.py Refactored to use rename_single_skill_dir() helper, removing duplicate logic
src/skillport/modules/skills/public/update.py Refactored to use rename_single_skill_dir() helper, removing duplicate logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gotalab gotalab merged commit a63dbe3 into main Dec 6, 2025
9 checks passed
@gotalab gotalab deleted the refactor/extract-github-logic branch December 14, 2025 16:48
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