Agent skill

Polylith Migrate Isolate Shared And Project Logic

by DavidVujic in DavidVujic/python-polylith

[Internal sub-skill of polylith-migrate-orchestrator. An agent skill from DavidVujic/python-polylith.

MITAuto-check passed

Install Polylith Migrate Isolate Shared And Project Logic

skills CLI
$ npx skills add DavidVujic/python-polylith --skill polylith-migrate-isolate-shared-and-project-logic -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install DavidVujic/python-polylith polylith-migrate-isolate-shared-and-project-logic --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/DavidVujic/python-polylith.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/polylith/migrate-project/polylith-migrate-isolate-shared-and-project-logic .claude/skills/polylith-migrate-isolate-shared-and-project-logic && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
polylith-migrate-isolate-shared-and-project-logic
GitHub stars
553
Token cost
~1.4k tokens
SKILL.md length
591 words
Files
1
Skills in repo
37
Repo updated
First seen
Licence
MIT

At a glance

[Internal sub-skill of polylith-migrate-orchestrator. An agent skill from DavidVujic/python-polylith.

  • Works in 7 steps: Identify Monolithic Components → Analyze Usage → Extract Shared Logic → …
  • SKILL.md covers Goal, Inputs, Steps and Verify, plus 3 more sections
  • Calls git

What it does

Polylith Migrate Isolate Shared And Project Logic is an agent skill from DavidVujic/python-polylith. [Internal sub-skill of polylith-migrate-orchestrator. Do not load directly — load polylith-migrate-orchestrator first, which drives all phases.] Identify and isolate shared and project-specific logic in monolithic components (e.g., models, schemas, or similar).

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Tooling support for the Polylith Architecture in Python. The licence is MIT.

Example prompts

  • “/polylith-migrate-isolate-shared-and-project-logic”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Identify Monolithic Components
  2. Analyze Usage
  3. Extract Shared Logic
  4. Isolate Project-Specific Logic
  5. Refactor Similar Models
  6. Update pyproject.toml
  7. Verify Changes

What it can do on your machine

Read from SKILL.md and the folder at commit a7a80f2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Polylith Migrate Isolate Shared And Project Logic loads about 1.4k tokens when it runs. Until then it costs about 80 tokens; SKILL.md has 591 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from DavidVujic/python-polylith at commit a7a80f2, republished under its MIT licence (© DavidVujic). 591 words, ~1,362 tokens.

Download SKILL.mdSave it as .claude/skills/polylith-migrate-isolate-shared-and-project-logic/SKILL.md (or your agent's skills folder).
name
polylith-migrate-isolate-shared-and-project-logic
description
[Internal sub-skill of `polylith-migrate-orchestrator`. Do not load directly — load `polylith-migrate-orchestrator` first, which drives all phases.] Identify and isolate shared and project-specific logic in monolithic components (e.g., `models`, `schemas`, or similar).

Skill: polylith-migrate-isolate-shared-and-project-logic

📐 Scope vs sibling skills. This skill is cross-project: it separates code used by two or more projects (shared) from code used by a single project (project-specific), potentially creating new shared and project-specific components. Don't confuse with:

  • polylith-migrate-split-big-component — within one project; splits one component into multiple components.
  • polylith-migrate-split-component-internals — within one component; splits one core.py into multiple files.
  • polylith-migrate-dedupe — opportunistic deduplication, broader than just shared-vs-project-specific.

💡 When to skip this skill. On the first project migration there is usually no second project to compare against. Skip this skill until at least one prior project has been migrated. The orchestrator still calls it after polylith-migrate-extract-standalone-modules — that's the right place when overlap exists.

Goal

Identify and isolate shared and project-specific logic in monolithic components (e.g., models, schemas). Extract shared logic into reusable components and isolate project-specific logic into project-specific components.

Inputs

From migration/<PROJECT>/state.md:

  • TARGET_TOP_NS
  • INITIAL_BASE_NAME
  • Verification commands (RUN_TEST_CMD, RUN_LINT_CMD, RUN_TYPECHECK_CMD).

From migration/<PROJECT>/manifest.md:

  • Module map of components.

All inputs from state.md are assumed to satisfy the validation rules in polylith-migrate-discover (### Validation rules). Validate before proceeding.

Steps

1. Identify Monolithic Components
  • Scan the workspace for monolithic components (e.g., models, schemas).
  • Focus on components with large core.py files or mixed domain logic.
2. Analyze Usage
  • Use grep to trace imports of each definition in the component.
  • Classify definitions as:
    • Shared: Used by multiple projects.
    • Project-Specific: Used by only one or a few projects.
    • Similar: Definitions that could reuse shared logic (e.g., similar models).
3. Extract Shared Logic
  • Create a new shared component (e.g., models_shared, schemas_shared).
  • Move shared definitions into the new component.
  • Update imports in all projects to reference the shared component.
4. Isolate Project-Specific Logic
  • Create project-specific components (e.g., models_project_a, schemas_project_b).
  • Move project-specific definitions into the appropriate component.
  • Update imports in the relevant projects.
5. Refactor Similar Models
  • For similar models, extract shared logic into the shared component.
  • Update the project-specific models to reuse the shared logic.
6. Update pyproject.toml
  • Add the new shared and project-specific components to the workspace's pyproject.toml.
  • Update the project's pyproject.toml to reference the new components.
7. Verify Changes
  • Run RUN_TEST_CMD to ensure no regressions.
  • Run RUN_LINT_CMD and RUN_TYPECHECK_CMD if set.
  • Run POLY_CMD_PREFIX check to validate the workspace structure.
Show full SKILL.md (233 more words)Show less

Verify

  • All tests pass (RUN_TEST_CMD).
  • Linting and type-checking pass (if set).
  • The workspace structure is valid (POLY_CMD_PREFIX check).

Common failure modes

SymptomLikely causeRemediation
Only one project exists in the workspace, so there's nothing to compare againstRunning this skill on the first project migration.Skip the skill entirely. Record polylith-migrate-isolate-shared-and-project-logic: skipped (single-project workspace) in migration/<PROJECT>/state.md and proceed to polylith-migrate-distribute-wiring. Revisit when a second project is migrated.
A definition looks shared but is actually used by one project via two different bases inside that projectBases within one project both use it — still single-project usage.Leave it project-specific. Cross-project sharing requires consumers in different projects under projects/.
Two projects each have a "same" class with subtle field differences (extra fields, different defaults)Silent merging would change behaviour.Do not merge silently. Either create a shared base class + project-specific subclasses, or keep the implementations separate and accept the duplication. Confirm with the user.

Done When

  • Shared logic is extracted into reusable components.
  • Project-specific logic is isolated into project-specific components.
  • Similar models reuse shared logic where possible.
  • All tests and checks pass.
  • The workspace structure is valid.

Commit

After verification passes, commit this phase to the migration branch:

bash
git add -A && git commit -m "migrate(<PROJECT>): phase <N> — isolate-shared-and-project-logic"

Substitute <PROJECT>, <N>, and <phase-name> from state.md and the orchestrator's phase table. Do not proceed to the next phase without a clean commit — the per-phase commit is the rollback point for the next phase's failure-mode tables.

© DavidVujic, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/polylith/migrate-project/polylith-migrate-isolate-shared-and-project-logic of DavidVujic/python-polylith.

Open the folder on GitHubat commit a7a80f2

Compare with similar skills

Polylith Migrate Isolate Shared And Project Logic next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Polylith Migrate Isolate Shared And Project Logic compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Polylith Migrate Isolate Shared And Project Logic this skillDavidVujic/python-polylith553—~1.4kAutomated safety check: PassMIT
Migrate Internal Package into GhostTryGhost/Ghost56k—~3.8kAutomated safety check: PassMIT
Reversible MigrationJuliusBrussee/caveman111k1 repos~196Automated safety check: PassApache-2.0
Team Agent Orchestrationaffaan-m/ECC276k1 repos~1.2kAutomated safety check: PassMIT
Database Migrationsaffaan-m/ECC276k4 repos~3kAutomated safety check: PassMIT
Database Migrationsaffaan-m/ECC276k1 repos~2.4kAutomated safety check: PassMIT

Similar skills

  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    56k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Reversible Migration

    JuliusBrussee/caveman

    Implement reversible compatibility-safe transitions. Use for schema, data, API, protocol, configuration, or dependency migrations requiring rollback and…

    111k GitHub starsUsed in 1 repo~196 tokens
    DevelopmentAuto-check passed
  • Run team-based orchestration for agent squads: work items with owners and scope, agent Kanban state, branch isolation, control pane visibility, and merge gates.

    276k GitHub starsUsed in 1 repo~1.2k tokens
    Agent WorkflowsAuto-check passed
  • Safe, reversible database migration patterns: forward-only production changes, expand-contract zero-downtime renames, concurrent indexes, batched backfills, and per-tool workflows for PostgreSQL…

    276k GitHub starsUsed in 4 repos~3k tokens
    DatabasesAuto-check passed
  • Şema değişiklikleri, veri migration'ları, rollback'ler ve PostgreSQL, MySQL ve yaygın ORM'ler (Prisma, Drizzle, Django, TypeORM, golang-migrate) arasında sıfır kesinti deployment'ları için…

    276k GitHub starsUsed in 1 repo~2.4k tokens
    DatabasesAuto-check passed
  • Rules and examples for safe, reversible schema changes in production: zero-downtime column and index changes, large data backfills and ORM migration workflows.

    276k GitHub stars~3.3k tokensUpdated 4 days ago
    DatabasesAuto-check passed

More from DavidVujic/python-polylith

All 37 skills in this repo
  • Polylith Base Creation

    DavidVujic/python-polylith

    Create a Polylith base with poly create base — the entry point of a deployable application (HTTP API, CLI, message-queue consumer, AWS Lambda handler, GCP Cloud Function, scheduled job).

    553 GitHub stars~757 tokensUpdated 4 days ago
    Auto-check passed
  • Polylith Check

    DavidVujic/python-polylith

    Validate a Polylith workspace with poly check — the canonical CI gate.

    553 GitHub stars~972 tokensUpdated 4 days ago
    Auto-check passed
  • Polylith Component Creation

    DavidVujic/python-polylith

    Create a Polylith component with poly create component — a reusable, isolated brick implementing business logic, a feature, a domain module, or a capability.

    553 GitHub stars~800 tokensUpdated 4 days ago
    Auto-check passed
  • Polylith Dependency Management

    DavidVujic/python-polylith

    Add or manage third-party dependencies in a Polylith workspace.

    553 GitHub stars~643 tokensUpdated 4 days ago
    Auto-check passed
  • Polylith Dependency Visualization

    DavidVujic/python-polylith

    Visualize brick × brick dependencies with poly deps — find circular dependencies, inspect a brick's public interface, and detect interface-bypass violations.

    553 GitHub stars~906 tokensUpdated 4 days ago
    Auto-check passed
  • Polylith Diff

    DavidVujic/python-polylith

    List Polylith bricks whose implementation changed since a git tag using poly diff.

    553 GitHub stars~1.1k tokensUpdated 4 days ago
    Auto-check passed

Questions about Polylith Migrate Isolate Shared And Project Logic

What does Polylith Migrate Isolate Shared And Project Logic do?

[Internal sub-skill of polylith-migrate-orchestrator. An agent skill from DavidVujic/python-polylith. Polylith Migrate Isolate Shared And Project Logic is an agent skill from DavidVujic/python-polylith. [Internal sub-skill of polylith-migrate-orchestrator.

How do I install Polylith Migrate Isolate Shared And Project Logic in Claude Code?

Run `npx skills add DavidVujic/python-polylith --skill polylith-migrate-isolate-shared-and-project-logic -a claude-code`. Or copy the skill folder (.agents/skills/polylith/migrate-project/polylith-migrate-isolate-shared-and-project-logic in DavidVujic/python-polylith) into .claude/skills/polylith-migrate-isolate-shared-and-project-logic in your project. Claude Code loads it when a task matches its description.

How do I install Polylith Migrate Isolate Shared And Project Logic in Codex?

Run `npx skills add DavidVujic/python-polylith --skill polylith-migrate-isolate-shared-and-project-logic -a codex`. Or copy the skill folder (.agents/skills/polylith/migrate-project/polylith-migrate-isolate-shared-and-project-logic in DavidVujic/python-polylith) into .agents/skills/polylith-migrate-isolate-shared-and-project-logic in your project. Codex loads it when a task matches its description.

Can I use Polylith Migrate Isolate Shared And Project Logic in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add DavidVujic/python-polylith --skill polylith-migrate-isolate-shared-and-project-logic -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/polylith-migrate-isolate-shared-and-project-logic, .gemini/skills/polylith-migrate-isolate-shared-and-project-logic, .github/skills/polylith-migrate-isolate-shared-and-project-logic and .opencode/skills/polylith-migrate-isolate-shared-and-project-logic in your project.

What does Polylith Migrate Isolate Shared And Project Logic need to run?

Going by SKILL.md and its folder, Polylith Migrate Isolate Shared And Project Logic needs the command-line tools its instructions call (git).

Does Polylith Migrate Isolate Shared And Project Logic access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Polylith Migrate Isolate Shared And Project Logic safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Polylith Migrate Isolate Shared And Project Logic use?

Polylith Migrate Isolate Shared And Project Logic is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Polylith Migrate Isolate Shared And Project Logic use?

About 1.4k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Polylith Migrate Isolate Shared And Project Logic?

Skills that share tags, products or a category with Polylith Migrate Isolate Shared And Project Logic: Migrate Internal Package into Ghost (TryGhost/Ghost, 56k stars), Reversible Migration (JuliusBrussee/caveman, 111k stars), Team Agent Orchestration (affaan-m/ECC, 276k stars) and Database Migrations (affaan-m/ECC, 276k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Polylith Migrate Isolate Shared And Project Logic?

DavidVujic (a GitHub user) maintains it in DavidVujic/python-polylith, which has 553 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on October 4, 2026.

Source: DavidVujic/python-polylith on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.