Skip to content

Commit e11d0ae

Browse files
authored
fix(skills): add a polylith- prefix for all the migration skills (#448)
* fix(skills): add a polylith- prefix for all the migration skills * bump CLI to 1.48.1
1 parent 8ccaf06 commit e11d0ae

26 files changed

Lines changed: 210 additions & 210 deletions

File tree

  • .agents/skills/polylith
    • migrate-project
      • polylith-migrate-analyze-imports
      • polylith-migrate-automate-import-updates
      • polylith-migrate-convert-linter
      • polylith-migrate-convert-package-manager
      • polylith-migrate-convert-type-checker
      • polylith-migrate-dedupe
      • polylith-migrate-definition-of-done
      • polylith-migrate-detect-circular-imports
      • polylith-migrate-discover
      • polylith-migrate-distribute-wiring
      • polylith-migrate-extract-standalone-modules
      • polylith-migrate-extract-to-base
      • polylith-migrate-generate-shim
      • polylith-migrate-isolate-base-and-big-component
      • polylith-migrate-isolate-shared-and-project-logic
      • polylith-migrate-orchestrator
      • polylith-migrate-prepare-project
      • polylith-migrate-refactor-tests
      • polylith-migrate-resolve-circular-imports
      • polylith-migrate-split-big-component
      • polylith-migrate-split-component-internals
      • polylith-migrate-update-tests
      • polylith-migrate-verify-stability
  • projects/polylith_cli

.agents/skills/polylith/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Two kinds of skill live under this directory; the distinction matters when picking an entry point:
99

1010
- **Atomic skills (`polylith-*`).** Each maps to one `poly` CLI command (or one focused concept). Safe to load in isolation; individually composable. These cover everyday Polylith workflows — creating bricks, syncing, checking, inspecting, and so on.
11-
- **Orchestrated skill set (`migrate-project/migrate-*`).** A multi-phase workflow with shared state (`migration/<PROJECT>/state.md`) and a git safety net. **Never load an individual `migrate-*` skill directly** — always load `migrate-orchestrator` and let it drive the phases in order. See [`migrate-project/README.md`](./migrate-project/README.md). This is an advanced, explicit-opt-in workflow used for migrating a **non-Polylith** project into a Polylith workspace, **not** part of daily Polylith use.
11+
- **Orchestrated skill set (`migrate-project/polylith-migrate-*`).** A multi-phase workflow with shared state (`migration/<PROJECT>/state.md`) and a git safety net. **Never load an individual `polylith-migrate-*` skill directly** — always load `polylith-migrate-orchestrator` and let it drive the phases in order. See [`migrate-project/README.md`](./migrate-project/README.md). This is an advanced, explicit-opt-in workflow used for migrating a **non-Polylith** project into a Polylith workspace, **not** part of daily Polylith use.
1212

1313
## Available Skills (daily Polylith workflows)
1414

@@ -31,4 +31,4 @@ Two kinds of skill live under this directory; the distinction matters when picki
3131

3232
## Advanced workflow
3333

34-
For migrating an existing **non-Polylith** Python project into a Polylith workspace, see [`migrate-project/README.md`](./migrate-project/README.md). This is a destructive, multi-phase, explicit-opt-in workflow — start with the `migrate-orchestrator` skill, not any individual `migrate-*` sub-skill.
34+
For migrating an existing **non-Polylith** Python project into a Polylith workspace, see [`migrate-project/README.md`](./migrate-project/README.md). This is a destructive, multi-phase, explicit-opt-in workflow — start with the `polylith-migrate-orchestrator` skill, not any individual `polylith-migrate-*` sub-skill.

.agents/skills/polylith/migrate-project/README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Project Migration Skills
22

3-
> **Note for contributors:** this README is a **human reference** and a skill **index**. Agents load each `migrate-*/SKILL.md` independently via the skill loader; this README is **not** auto-loaded with any skill. Anything an agent must know to act has to live in the relevant `SKILL.md` itself, not here.
3+
> **Note for contributors:** this README is a **human reference** and a skill **index**. Agents load each `polylith-migrate-*/SKILL.md` independently via the skill loader; this README is **not** auto-loaded with any skill. Anything an agent must know to act has to live in the relevant `SKILL.md` itself, not here.
44
55
This directory contains skills for migrating **non-Polylith Python projects** into a Polylith workspace. They cooperate via two artifacts under `migration/<PROJECT>/`:
66

7-
- `state.md` — a flat `KEY=value` file. Canonical schema lives in [`migrate-discover/SKILL.md`](./migrate-discover/SKILL.md).
7+
- `state.md` — a flat `KEY=value` file. Canonical schema lives in [`polylith-migrate-discover/SKILL.md`](./polylith-migrate-discover/SKILL.md).
88
- `manifest.md` — a human-readable structural inventory of the source project.
99

1010
---
@@ -28,21 +28,21 @@ This directory contains skills for migrating **non-Polylith Python projects** in
2828
Load the orchestrator and let it drive the rest:
2929

3030
```
31-
Load the `migrate-orchestrator` skill and migrate `projects/<project-name>`.
31+
Load the `polylith-migrate-orchestrator` skill and migrate `projects/<project-name>`.
3232
```
3333

3434
The orchestrator will:
3535
1. Ask the user for explicit confirmation.
3636
2. Establish a git safety net (dedicated branch + per-phase commits).
3737
3. Load and execute each phase skill in order, verifying after each.
3838

39-
> **Why every sub-skill says "do not load directly".** Each `migrate-<phase>` skill's `description:` starts with a redirect to `migrate-orchestrator`. This is intentional: it makes the orchestrator the only valid entry point regardless of which sub-skill the agent's fuzzy-match initially favours. The sub-skills depend on state (`migration/<PROJECT>/state.md`) and a git safety net that only the orchestrator sets up.
39+
> **Why every sub-skill says "do not load directly".** Each `polylith-migrate-<phase>` skill's `description:` starts with a redirect to `polylith-migrate-orchestrator`. This is intentional: it makes the orchestrator the only valid entry point regardless of which sub-skill the agent's fuzzy-match initially favours. The sub-skills depend on state (`migration/<PROJECT>/state.md`) and a git safety net that only the orchestrator sets up.
4040
4141
---
4242

4343
## Downstream installation
4444

45-
When this skill set is installed into another Polylith workspace (e.g. via a skills package), the in-skill `[ENTRY POINT]` / `[Internal sub-skill of migrate-orchestrator …]` markers in each `description:` are the primary routing signal — they ship with the package.
45+
When this skill set is installed into another Polylith workspace (e.g. via a skills package), the in-skill `[ENTRY POINT]` / `[Internal sub-skill of polylith-migrate-orchestrator …]` markers in each `description:` are the primary routing signal — they ship with the package.
4646

4747
For an extra-strong signal, downstream consumers should add the following snippet to their own repo-level `AGENTS.md` (or equivalent agent-routing file). It is **not** required — the in-skill markers are usually sufficient — but it removes any ambiguity for agents that read `AGENTS.md` before scanning skill descriptions.
4848

@@ -51,10 +51,10 @@ For an extra-strong signal, downstream consumers should add the following snippe
5151

5252
When the user asks to migrate a non-Polylith Python project to Polylith
5353
(e.g. "migrate `projects/<name>` to Polylith"), load the
54-
`migrate-orchestrator` skill first and let it drive the workflow.
54+
`polylith-migrate-orchestrator` skill first and let it drive the workflow.
5555

56-
Never load `migrate-discover`, `migrate-extract-to-base`, or any other
57-
`migrate-*` sub-skill directly — they are phases the orchestrator
56+
Never load `polylith-migrate-discover`, `polylith-migrate-extract-to-base`, or any other
57+
`polylith-migrate-*` sub-skill directly — they are phases the orchestrator
5858
invokes in order, with per-phase verification and git checkpoints
5959
between them.
6060
```
@@ -64,7 +64,7 @@ between them.
6464
## Workflow at a glance
6565

6666
The **authoritative** phase order, numbering, and dependencies live in
67-
[`migrate-orchestrator/SKILL.md`](./migrate-orchestrator/SKILL.md) — it is the
67+
[`polylith-migrate-orchestrator/SKILL.md`](./polylith-migrate-orchestrator/SKILL.md) — it is the
6868
**single source of truth**. This README intentionally does **not** repeat the
6969
table, to avoid drift (sub-skills must not hardcode phase numbers either; they
7070
reference `<N>` from the orchestrator table).
@@ -78,14 +78,14 @@ At a glance, the flow is:
7878
> isolate-shared-and-project-logic → distribute-wiring → split-component-internals →
7979
> refactor-tests → definition-of-done**
8080
81-
### Optional skills (triggered during `migrate-discover`)
81+
### Optional skills (triggered during `polylith-migrate-discover`)
8282

8383
| Skill | Purpose | Trigger / dependency |
8484
|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
85-
| [`migrate-convert-linter`](./migrate-convert-linter/SKILL.md) | Align the project's linter/formatter with the **workspace's** configured tool. | `CONVERT_LINTER=yes` in `state.md`. Runs between `migrate-discover` and `migrate-analyze-imports`. |
86-
| [`migrate-convert-type-checker`](./migrate-convert-type-checker/SKILL.md) | Align the project's type checker with the **workspace's** configured tool. | `CONVERT_TYPE_CHECKER=yes` in `state.md`. Runs between `migrate-discover` and `migrate-analyze-imports`. |
87-
| [`migrate-convert-package-manager`](./migrate-convert-package-manager/SKILL.md) | Convert the project's `pyproject.toml` to uv workspaces. **Opinionated about uv** — only run when the workspace itself uses uv. | `CONVERT_PACKAGE_MANAGER=yes` in `state.md`. Runs between `migrate-discover` and `migrate-analyze-imports`. |
88-
| [`migrate-dedupe`](./migrate-dedupe/SKILL.md) | Identify and apply controlled deduplication discovered during refactoring. | User approval. Runs after `migrate-split-big-component` or `migrate-extract-standalone-modules`. |
85+
| [`polylith-migrate-convert-linter`](./polylith-migrate-convert-linter/SKILL.md) | Align the project's linter/formatter with the **workspace's** configured tool. | `CONVERT_LINTER=yes` in `state.md`. Runs between `polylith-migrate-discover` and `polylith-migrate-analyze-imports`. |
86+
| [`polylith-migrate-convert-type-checker`](./polylith-migrate-convert-type-checker/SKILL.md) | Align the project's type checker with the **workspace's** configured tool. | `CONVERT_TYPE_CHECKER=yes` in `state.md`. Runs between `polylith-migrate-discover` and `polylith-migrate-analyze-imports`. |
87+
| [`polylith-migrate-convert-package-manager`](./polylith-migrate-convert-package-manager/SKILL.md) | Convert the project's `pyproject.toml` to uv workspaces. **Opinionated about uv** — only run when the workspace itself uses uv. | `CONVERT_PACKAGE_MANAGER=yes` in `state.md`. Runs between `polylith-migrate-discover` and `polylith-migrate-analyze-imports`. |
88+
| [`polylith-migrate-dedupe`](./polylith-migrate-dedupe/SKILL.md) | Identify and apply controlled deduplication discovered during refactoring. | User approval. Runs after `polylith-migrate-split-big-component` or `polylith-migrate-extract-standalone-modules`. |
8989

9090
---
9191

@@ -95,17 +95,17 @@ These skills overlap in vocabulary but address different scopes. Use this matrix
9595

9696
| Skill | Scope | Trigger |
9797
|---------------------------------------------|------------------------------------------------|---------------------------------------------------------------------------|
98-
| `migrate-split-big-component` | Within one project; component → multiple components. | The temporary big component (from `migrate-isolate-base-and-big-component`) is too large. |
99-
| `migrate-extract-standalone-modules` | Within one project; pulls foundational modules out of the residual. | Residual still contains `consts.py`/`exceptions.py`/`models.py`. |
100-
| `migrate-split-component-internals` | Within one already-extracted shared component; `core.py` → multiple files. | A component's `core.py` mixes multiple domains internally. |
101-
| `migrate-isolate-shared-and-project-logic` | Cross-project; separate shared vs project-specific in components used by ≥ 2 projects. | Migrating a 2nd+ project that overlaps with an already-extracted one. |
98+
| `polylith-migrate-split-big-component` | Within one project; component → multiple components. | The temporary big component (from `polylith-migrate-isolate-base-and-big-component`) is too large. |
99+
| `polylith-migrate-extract-standalone-modules` | Within one project; pulls foundational modules out of the residual. | Residual still contains `consts.py`/`exceptions.py`/`models.py`. |
100+
| `polylith-migrate-split-component-internals` | Within one already-extracted shared component; `core.py` → multiple files. | A component's `core.py` mixes multiple domains internally. |
101+
| `polylith-migrate-isolate-shared-and-project-logic` | Cross-project; separate shared vs project-specific in components used by ≥ 2 projects. | Migrating a 2nd+ project that overlaps with an already-extracted one. |
102102

103-
> 💡 In a fresh migration of a single project, you usually run `migrate-split-big-component``migrate-extract-standalone-modules``migrate-split-component-internals`, and skip `migrate-isolate-shared-and-project-logic` until a second project is migrated.
103+
> 💡 In a fresh migration of a single project, you usually run `polylith-migrate-split-big-component``polylith-migrate-extract-standalone-modules``polylith-migrate-split-component-internals`, and skip `polylith-migrate-isolate-shared-and-project-logic` until a second project is migrated.
104104
105105
---
106106

107107
## Files in this directory
108108

109109
- `README.md` — this file (human reference + index).
110-
- `migrate-orchestrator/SKILL.md` — entry point; defines the phase order and the git safety net.
111-
- `migrate-<phase>/SKILL.md` — one per phase referenced in the orchestrator table.
110+
- `polylith-migrate-orchestrator/SKILL.md` — entry point; defines the phase order and the git safety net.
111+
- `polylith-migrate-<phase>/SKILL.md` — one per phase referenced in the orchestrator table.

.agents/skills/polylith/migrate-project/migrate-analyze-imports/SKILL.md renamed to .agents/skills/polylith/migrate-project/polylith-migrate-analyze-imports/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
name: migrate-analyze-imports
3-
description: "[Internal sub-skill of `migrate-orchestrator`. Do not load directly — load `migrate-orchestrator` first, which drives all phases.] Analyze the project's import graph to find how the original namespace is referenced, choose the namespace-rewrite strategy (shim vs shimless), detect circular imports, and list symbols exported by the original namespace."
2+
name: polylith-migrate-analyze-imports
3+
description: "[Internal sub-skill of `polylith-migrate-orchestrator`. Do not load directly — load `polylith-migrate-orchestrator` first, which drives all phases.] Analyze the project's import graph to find how the original namespace is referenced, choose the namespace-rewrite strategy (shim vs shimless), detect circular imports, and list symbols exported by the original namespace."
44
---
55

6-
# Skill: migrate-analyze-imports
6+
# Skill: polylith-migrate-analyze-imports
77

88
## Goal
99
Analyze the project's import graph to:
@@ -13,7 +13,7 @@ Analyze the project's import graph to:
1313
4. Detect potential circular imports.
1414

1515
This drives the namespace rewrite (phase 4) and, when `SHIM_STRATEGY=shim`, the
16-
shim sub-track (phase 4b). See the `migrate-orchestrator` table for phase numbers.
16+
shim sub-track (phase 4b). See the `polylith-migrate-orchestrator` table for phase numbers.
1717

1818
## Inputs
1919
- Project name (from `migration/<project-name>/state.md`)
@@ -95,5 +95,5 @@ SHIM_STRATEGY=<shim|shimless>
9595
git add migration/${PROJECT}/import_analysis.md migration/${PROJECT}/state.md
9696
git commit -m "migrate(${PROJECT}): phase <N> — analyze-imports"
9797
```
98-
> `<N>` is this phase's number from the `migrate-orchestrator` table (the single
98+
> `<N>` is this phase's number from the `polylith-migrate-orchestrator` table (the single
9999
> source of truth) — do not hardcode it.

.agents/skills/polylith/migrate-project/migrate-automate-import-updates/SKILL.md renamed to .agents/skills/polylith/migrate-project/polylith-migrate-automate-import-updates/SKILL.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
name: migrate-automate-import-updates
3-
description: "[Internal sub-skill of `migrate-orchestrator`. Do not load directly — load `migrate-orchestrator` first, which drives all phases.] Update imports in the new base location to reference the new namespace instead of the original namespace."
2+
name: polylith-migrate-automate-import-updates
3+
description: "[Internal sub-skill of `polylith-migrate-orchestrator`. Do not load directly — load `polylith-migrate-orchestrator` first, which drives all phases.] Update imports in the new base location to reference the new namespace instead of the original namespace."
44
---
55

6-
# Skill: migrate-automate-import-updates
6+
# Skill: polylith-migrate-automate-import-updates
77

88
## Goal
99
Update imports to reference the new namespace instead of the original namespace, ensuring that the codebase remains functional after the namespace migration.
1010

11-
> **Scope depends on `SHIM_STRATEGY`** (set by `migrate-analyze-imports`):
11+
> **Scope depends on `SHIM_STRATEGY`** (set by `polylith-migrate-analyze-imports`):
1212
> - `shim`: rewrite imports **in the new base location only** — external consumers keep
1313
> using the original namespace via the shim (phase 4b).
1414
> - `shimless`: rewrite **every** reference to the original namespace — base internals,
1515
> entrypoints / run-scripts, infra (e.g. `alembic/env.py`), and tests — so nothing
1616
> imports the old namespace and no shim is needed.
1717
>
18-
> Cover **all three reference forms** (see `migrate-analyze-imports`): dotted
18+
> Cover **all three reference forms** (see `polylith-migrate-analyze-imports`): dotted
1919
> `from <ns>.<sub> import …`, bare-submodule `from <ns> import <sub>` (incl. multi-name
2020
> and **mixed** lines), and quoted string paths (`mock.patch("<ns>.x.Y")`, logging
2121
> dict-config). A naive "`from <ns>.`" replace silently misses the bare and quoted forms.
@@ -26,7 +26,7 @@ Update imports to reference the new namespace instead of the original namespace,
2626
> names — far more reliably than ad-hoc edits across dozens of files. Keep it as plain
2727
> functions (no classes), run it over `bases/`, `components/`, `test/`, and the project
2828
> dir, then verify by grepping for any residual `<ns>` reference. The same helper is
29-
> reusable for the component-extraction rewrites in `migrate-split-big-component`.
29+
> reusable for the component-extraction rewrites in `polylith-migrate-split-big-component`.
3030
3131
## Inputs
3232
- Project name (from `migration/<project-name>/state.md`)
@@ -73,4 +73,4 @@ git add bases/${TARGET_TOP_NS}/${INITIAL_BASE_NAME}/
7373
git add migration/${PROJECT}/import_updates.md
7474
git commit -m "migrate(${PROJECT}): phase <N> — automate-import-updates"
7575
```
76-
> `<N>` is this phase's number from the `migrate-orchestrator` table (the single source of truth) — do not hardcode it.
76+
> `<N>` is this phase's number from the `polylith-migrate-orchestrator` table (the single source of truth) — do not hardcode it.

0 commit comments

Comments
 (0)