Contributing to i18nprune
Thanks for helping improve i18nprune. This page describes how we work in the repository—structure, expectations, and where to read next. The project is MIT licensed and open to contributions from individuals, teams, and automation (CI, internal scripts, AI-assisted coding agents).
New to the codebase?
If you are new (or you are letting an AI agent drive a small change), start with this Day 0 reading order:
maintainer/agents/architecture.md(package topology and where behavior lives)maintainer/agents/rules.md(TypeScript conventions, errors, logging, tests)maintainer/agents/git.md(commit and PR discipline)maintainer/phases/active-phase.md(what is actively being worked on right now)maintainer/phases/shipped-slices.md(avoid re-implementing closed work)maintainer/systems/README.md(where the subsystem maps live)maintainer/systems/platform.md(multi-OS behavior and path pitfalls)maintainer/systems/operations/entrypoints.md(therunXxxwiring table)packages/cli/bin/cli.ts(global flags + command registration)- Trace one command end-to-end (a CLI
packages/cli/src/commands/<name>/flow intopackages/core/src/<op>/run.ts) maintainer/systems/health.md(the gates you must keep green before a PR)
Then run: pnpm typecheck and pnpm test.
Repository pattern
| Layer | Location | Responsibility |
|---|---|---|
| CLI entry | packages/cli/bin/cli.ts | Commander, global flags, preAction, command registration. |
| Commands | packages/cli/src/commands/<name>/ | Orchestration only—call @i18nprune/core, config helpers, utils. |
| Engine | packages/core/ | Domain logic: runXxx, cache, extractor, share, translator, locales. |
| Config | packages/core/src/config/ + CLI loaders | Zod schema, defineConfig, path resolution. |
| Report schema | packages/core/src/shared/report/ | ProjectReportDocument (Zod); import @i18nprune/core/report-schema. |
| Docs | docs/ | VitePress-ready markdown; run pnpm docs:sync after substantive edits. |
Conventions: ESM with .js suffix in TypeScript import paths (see tsconfig), I18nPruneError for user-facing failures, logger gates via canEmit—never bypass policy for “just this once.”
Type placement rule: public contracts live in packages/core/src/types/<domain>/; CLI command types under packages/cli/src/types/.
Human contributors
- Open an issue (or discuss in an existing one) for significant behavior changes.
- Branch from the default branch; keep commits focused (see below).
- Run
pnpm typecheckandpnpm testbefore opening a PR (CI runs parity tests too). - Document user-visible behavior: update
docs/commands/<name>.md(orshare/localespages) when you change a command.
Repo layout (clone only — not on the public docs site): maintainer/agents/onboarding.md — reading order, root scripts, share/core boundaries, PR checklist.
View onboarding on GitHub
AI agents & pair-programming
Many contributors use IDE assistants or batch agents for refactors and docs. The same rules apply: small commits, tests, and docs with code.
Contributor & agent hub (repo clone): maintainer/agents/README.md — architecture, rules, Git discipline, onboarding.
View agents README on GitHub
Whether you type every line yourself or use an agent, the merge bar is the same: correct types, tests green, docs aligned.
Git history
We prefer Conventional Commits and coherent slices (e.g. one command + its docs/commands/... page).
Commit plan: maintainer/agents/git.md — view on GitHub (repo-only).
Code of conduct
Be respectful in issues and reviews. Technical disagreement is expected; harassment is not.
See also
- Workflow — local commands
- Release notes — CLI, Core, and Extension changelogs