| 1 | --- |
| 2 | name: package-development |
| 3 | description: Package registration. Use when adding a workspace package, making a private package publishable, renaming a package, or moving its workspace path. |
| 4 | --- |
| 5 | |
| 6 | Treat package work as a registration change, not a directory copy. |
| 7 | |
| 8 | ## Workflow |
| 9 | |
| 10 | 1. Inspect the closest package in the same family. Classify publication status, |
| 11 | runtime, test environment, platform support, barrels, and dependency shape. |
| 12 | Justify each proposed file by precedent or an explicit repository need. |
| 13 | Continue when every proposed file is justified. |
| 14 | 2. Create or move only required source, test, TypeScript, and manifest files. |
| 15 | When manifest dependencies change, read [dependencies.md](dependencies.md) |
| 16 | and classify every entry by role. |
| 17 | Continue when pnpm discovers the intended name and manifests reference no |
| 18 | absent file. |
| 19 | 3. Read [registration.md](registration.md). Classify every registration surface |
| 20 | as applicable or not applicable and update every applicable surface. |
| 21 | Continue when every surface is classified and old references are explained. |
| 22 | 4. For a published package, read [publishing.md](publishing.md) and verify its |
| 23 | development and packed surfaces. |
| 24 | 5. Run codegen when the package owns generated barrels, then inspect generated |
| 25 | sections rather than editing them manually. |
| 26 | Continue when generated sections match source modules without manual edits. |
| 27 | 6. Run focused package tests and scripts plus applicable root checks. Include |
| 28 | public API type tests when applicable. For published packages, build and dry |
| 29 | pack the package as described in [publishing.md](publishing.md). |
| 30 | Continue when focused and root checks pass and the packed surface is intended. |
| 31 | 7. Apply root changeset, generated-file, documentation, and workflow routing. |
| 32 | |
| 33 | The task is complete when package discovery, registration, generated output, |
| 34 | validation, packed output, and changeset routing are all verified or reported |
| 35 | as not applicable. |