migrate-to-codehub

Migrate reusable architecture designs from existing projects into decoupled PythonCodeHub modules.

2|Updated Jun 8, 2026
One-click install
npx skills add https://github.com/HACK-WU/skills --skill migrate-to-codehub-hack-wu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-to-codehub
Source: https://github.com/HACK-WU/skills/tree/main/skills/migrate-to-codehub
Command: npx skills add https://github.com/HACK-WU/skills --skill migrate-to-codehub-hack-wu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When you find a well-designed component in another project, copying it directly brings business coupling, private identifiers, and environment assumptions. This Skill guides the AI to evaluate, decouple, and refactor that design into a clean, reusable PythonCodeHub module. ## Core Features & Use Cases - Value Assessment & Deduplication: Judges whether source code is worth migrating and searches PythonCodeHub for similar modules to extend rather than duplicate. - Decoupling Analysis: Systematically strips business coupling such as domain models, config sources, external systems, naming conventions, and sensitive information. - Plan-First Workflow: Produces a migration plan covering target path, interface design, file layout, and verification strategy, and waits for user confirmation before writing code. - Use Case: You found a distributed lock watchdog mechanism in a production service. Use this Skill to abstract the Redis client into a Protocol, parameterize key prefixes, and migrate it into ab_lock with pytest coverage. ## Quick Start Ask the AI to migrate the watchdog renewal design from your current project into PythonCodeHub and let it evaluate, decouple, and verify the result.

Frequently Asked Questions about migrate-to-codehub

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate code from one project to a shared Python library?

First evaluate whether the design is generic, reusable, and independent of business logic. Then search the target repository for similar modules, decouple business dependencies into Protocols or parameters, propose a migration plan, and implement only after confirmation.

How to decouple business logic when reusing code across projects?

Replace domain models with Protocol, ABC, or DTO abstractions, turn hardcoded config and naming prefixes into parameters, swap external system clients for interface adapters, and remove private identifiers, internal URLs, and sensitive constants.

When should I not migrate code into a shared code hub?

Skip migration for plain business logic搬运, one-off scripts, or implementations tightly bound to a specific context. Migration is only worthwhile when the design is generic, has a clear cross-project use case, and offers stable public interfaces.

Should I extend an existing module or create a new one when migrating code?

Prefer extending an existing similar module or adding a file within it. Only create a new module directory when no existing ab_* category can reasonably host the capability, avoiding duplicate structures in the repository.

What verification is required after migrating code to a shared repository?

Run ruff check, add pytest coverage for core behaviors including edge cases like empty input and timeouts, ensure public interfaces have type hints, confirm no business or sensitive residue remains, and provide a minimal runnable example.