← knowledge.oriz.in

Atomic packages — extract lazily on second use

rule feedbackpackagingagent-preferences

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: