Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP2universalStack: universal
organizationconstantspromptsmaintainability
Keep prompts and user-facing strings in one constants module
Centralize LLM prompts and repeated static messages in a dedicated consts/enums module so they're easy to find, reuse, and later migrate to a prompt-management service.
PR: hegnar-journalist-boost · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | const res = await llm.invoke(`You are a helpful editor. Rewrite: ${text}`); // prompt inline |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // prompts.ts |
| 2 | export const EDITOR_PROMPT = 'You are a helpful editor. Rewrite:'; |
| 3 | // usage |
| 4 | const res = await llm.invoke(`${EDITOR_PROMPT} ${text}`); |
Explanation (EN)
Objašnjenje (HR)