type: rule
status: active
timestamp: 2026-06-25
tags: [feedback, packaging, agent-preferences]

Atomic packages — extract lazily on second use

2+ apps need same logic ? extract to @oriz/* or oriz-* package. Concern-atomic (3-5 exports, 100-300 LOC). Build only when forced

When the same logic is needed in 2 or more apps, extract it to an atomic package.

Rules:

Does NOT reverse:

Reverses:

How to apply when 2nd app demands the same logic:

  1. Verify no community package exists at the right size/shape.
  2. Create the repo: gh repo create chirag127/<slug>-npm-pkg --public --description "<one-liner>".
  3. Add as submodule: git submodule add ... repos/own/<slug>-npm-pkg.
  4. Publish to npm with provenance enabled.
  5. Document the package in knowledge/services/<area>/<slug>.md with OKF frontmatter.
  6. Both apps adopt it on next touch; no big-bang migration.

Documentation:

Related:


Edit on GitHub · Back to index