nitro-ui-nitrogen

Installation
SKILL.md
  • Avoid nested ternaries and ternaries inside generated-code templates, including conditional whitespace or newlines. Select generated bodies outside templates: use a short ternary for simple literal alternatives, and explicit if/else or switch for longer or more complex choices.
  • Always write generated code in multiline template literals with .trim(). Use actual line breaks, never \n escapes for layout; .join('\n') is the exception.
  • Always use indent(...) for interpolated code, with matching indentation before ${...} for its first line.
  • Name generated bodies by direction, e.g. swiftToCppConverterCode, before passing them to helpers. Do not bury multiline strings in arguments or object properties.
  • Use typed options objects destructured immediately in the parameter list for helpers with several code fragments or types, as in createSwiftConverter and createSwiftJSIConverter.
  • Extract mapping, filtering, sorting, deduplication, comparisons, and other nontrivial expressions into named variables before generated-code templates. Split long chains into multiple variables when it improves readability. Interpolate the results, leaving only final .join(...) and indent(...) calls inline. Shared renderers such as getImportsCode() can return complete strings.
  • Prefer switch (language) over if chains, ternaries, or inline language-check returns so additional languages fit the same dispatch. Collect imports in a shared result and pass import context through nested wrappers.
  • Avoid ??= when it hides initialization.
  • Use getImportCode() / getImportsCode() for import rendering and deduplication. Model declaration and implementation dependencies separately; do not repair them by comparing emitted strings or overriding descriptors at the caller.
  • Collect module dependencies from specs and their type graph, including nested types and inheritance. Preserve ownership through wrapping; do not infer modules from include paths.
  • Put type-specific policy on Type/SwiftType as overridable properties or methods, e.g. contextual getCode() and requiresExplicitSwiftTarget, rather than repeating type.kind checks in shared emitters.
  • In a PR stack, run Nitrogen at each atomic PR and commit its affected generated files in that PR. Keep every PR buildable with its own generated output; do not defer regeneration to the end of the stack.
  • Accept incidental blank lines from empty include blocks. Avoid arbitrary gaps between related literal includes.
Installs
3
GitHub Stars
1.4K
First Seen
3 days ago