- Add a new directory under
packages/. - Create
package.jsonwithname,version,description,license,repository.directory,engines.node,publishConfig.access, andfiles. - Add a Pi manifest under
piwhen you need explicitextensions,skills,prompts, orthemespaths.
- Extend
../../tsconfig.base.json. - Reuse the root Oxlint and Oxfmt config.
- Add
lint,format,format:check,typecheck,test,check, andpack:checkscripts as needed. - Add
docs/adrs/when the package needs package-scoped architectural decision records.
- Keep monorepo-wide ADRs in
docs/adrs/. - Keep package-specific ADRs in
packages/<name>/docs/adrs/. - Use the plural directory name
adrs/for consistency with the rest of the repo.
Run:
pnpm --filter <package-name> run check
pnpm --filter <package-name> run pack:check
pnpm run validate:packagesWhen the package is meant for pi install, use pi install ./packages/<package-name> from the monorepo root as a maintainer smoke test of the publishable package layout. For day-to-day extension development, prefer loading the extension directly, for example with pi --extension.
- Keep package contents narrow with
files. - Verify the package works from a tarball when practical.
- Add a changeset when the package changes in a publishable way.