public-library Vetted by Rulemart
Public engineering rules from Fabrica for coding agents, with versioned groups projects can adopt and customize.
A library release publishes new versions of one or more rules at once. Each rule keeps its own version.
Library release 1 publishes 127 rules.
New rules
- Express operations as meaningful steps practices/code-design/express-operations-as-meaningful-steps 1.0.0
- Organize code by feature practices/code-design/organize-code-by-feature 1.0.0
- Separate pure computation from effects practices/code-design/separate-pure-computation-from-effects 1.0.0
- Honor cancellation and deadlines across every blocking stage practices/concurrency/honor-cancellation-across-blocking-stages 1.0.0
- Keep shared resources alive until their users finish practices/concurrency/keep-shared-resources-alive-until-users-finish 1.0.0
- Optimize measured hot paths by removing repeated work practices/performance/optimize-measured-hot-paths 1.0.0
- Give a quick start that runs as written practices/readmes/give-a-quick-start-that-runs-as-written 1.0.0
- Keep the README an entry point, and link to the full documentation practices/readmes/keep-the-readme-an-entry-point 1.0.0
- Match the README's presentation to the product's tier practices/readmes/match-presentation-to-product-tier 1.0.0
- Open with what the product does for the reader practices/readmes/open-with-what-the-product-does 1.0.0
Show 117 more new rules Show fewer
- State what the product does not do practices/readmes/state-what-the-product-does-not-do 1.0.0
- Choose tests by risk and cost practices/testing/choose-tests-by-risk 1.0.0
- Cover empty inputs and boundaries practices/testing/cover-boundary-cases 1.0.0
- Keep tests independent practices/testing/keep-tests-independent 1.0.0
- Name tests for the behavior and the condition practices/testing/name-tests-for-behavior-and-condition 1.0.0
- Run focused tests while iterating, and the full suite before finishing practices/testing/run-focused-tests-while-iterating 1.0.0
- Test at the lowest layer that proves the behavior practices/testing/test-at-the-lowest-layer 1.0.0
- Reproduce bugs with regression tests practices/testing/test-bug-fixes-before-fixing 1.0.0
- Test observable behavior practices/testing/test-observable-behavior 1.0.0
- Comment struct fields whose meaning the type does not show techs/go/comment-non-obvious-struct-fields 1.0.0
- Separate package documentation from file headers techs/go/comments-package-doc-vs-file-header 1.0.0
- Add operation and identifier context to errors at boundaries techs/go/errors-include-useful-diagnostic-data 1.0.0
- Expose error identity only for contract errors techs/go/errors-use-contract-errors-deliberately 1.0.0
- Give text and its parsed form one owner techs/go/one-owner-for-text-and-parsed-form 1.0.0
- Keep the SQL migration directory for migration files only techs/goose/migrations-directory-contains-only-sql 1.0.0
- Avoid layout thrashing techs/javascript/avoid-layout-thrashing 1.0.0
- Await only on paths that need the result techs/javascript/await-only-on-paths-that-need-the-result 1.0.0
- Defer non-critical browser work to idle time techs/javascript/defer-non-critical-work-to-idle-time 1.0.0
- Keep dynamic import and file paths statically analyzable techs/javascript/keep-import-and-file-paths-analyzable 1.0.0
- Start independent asynchronous work concurrently techs/javascript/start-independent-async-work-concurrently 1.0.0
- Mark scroll-related listeners passive when they never cancel scrolling techs/javascript/use-passive-scroll-and-touch-listeners 1.0.0
- Version and minimize data in browser storage techs/javascript/version-and-minimize-browser-storage 1.0.0
- Synchronize with auto-waiting actions and web-first assertions techs/playwright/auto-waiting-actions-and-web-first-assertions 1.0.0
- Scope locators by test id, then select controls by role and name techs/playwright/domain-scope-and-user-facing-locators 1.0.0
- Give every interactive element a role and an accessible name techs/react/accessibility-roles-and-names 1.0.0
- Run app-wide initialization once per app load techs/react/advanced-init-once 1.0.0
- Build complex components from composable parts techs/react/architecture-compound-components 1.0.0
- Create explicit component variants instead of boolean mode props techs/react/architecture-explicit-variants 1.0.0
- Stream slow data behind Suspense boundaries techs/react/async-suspense-boundaries 1.0.0
- Avoid loading large barrel files techs/react/bundle-barrel-imports 1.0.0
- Keep non-critical scripts off the critical path techs/react/bundle-defer-non-critical-scripts 1.0.0
- Load heavy optional code on demand techs/react/bundle-load-heavy-code-on-demand 1.0.0
- Share client data requests through a caching data layer techs/react/client-share-data-requests 1.0.0
- Read the latest callbacks in Effects without resubscribing techs/react/effects-read-latest-values-without-resubscribing 1.0.0
- Name generic components by capability, not by first caller techs/react/generic-components-by-capability 1.0.0
- Name Effect and non-trivial Hook callbacks techs/react/hooks-name-callbacks 1.0.0
- Avoid copying props to state techs/react/official-avoid-copying-props-to-state 1.0.0
- Avoid unnecessary Effects techs/react/official-avoid-unnecessary-effects 1.0.0
- Follow the Rules of Hooks techs/react/official-follow-rules-of-hooks 1.0.0
- Keep components and Hooks pure techs/react/official-keep-components-and-hooks-pure 1.0.0
- Accept ref as a prop in React 19 techs/react/react19-no-forwardref 1.0.0
- Use Activity to hide UI that should keep its state techs/react/rendering-activity 1.0.0
- Use a boolean condition for conditional rendering techs/react/rendering-conditional-render 1.0.0
- Skip off-screen rendering work in long lists techs/react/rendering-content-visibility 1.0.0
- Render client-only preferences without a flash or hydration error techs/react/rendering-hydration-no-flicker 1.0.0
- Suppress only expected hydration mismatches techs/react/rendering-hydration-suppress-warning 1.0.0
- Hint critical resources with React DOM resource APIs techs/react/rendering-resource-hints 1.0.0
- Subscribe to and depend on only the values you use techs/react/rerender-depend-on-narrow-values 1.0.0
- Use functional updates when new state depends on old state techs/react/rerender-functional-setstate 1.0.0
- Initialize expensive state lazily techs/react/rerender-lazy-state-init 1.0.0
- Keep input responsive by marking non-urgent updates techs/react/rerender-mark-non-urgent-updates 1.0.0
- Memoize deliberately techs/react/rerender-memoize-deliberately 1.0.0
- Do not define components inside components techs/react/rerender-no-inline-components 1.0.0
- Keep values that do not affect rendering in refs techs/react/rerender-use-ref-transient-values 1.0.0
- Run post-response work after the response techs/react/server-after-nonblocking 1.0.0
- Authenticate and authorize inside every Server Action techs/react/server-auth-actions 1.0.0
- Deduplicate per-request server work with cache techs/react/server-cache-react 1.0.0
- Pass only the data Client Components use techs/react/server-minimize-serialized-props 1.0.0
- Keep request data out of shared module state techs/react/server-no-shared-module-state 1.0.0
- Compose independent server data fetches as siblings techs/react/server-parallel-fetching 1.0.0
- Reuse request-independent server data across requests techs/react/server-reuse-request-independent-data 1.0.0
- Lift shared component state into a provider behind an interface techs/react/state-lift-shared-state-into-providers 1.0.0
- Give repeated and persistent surfaces stable test ids techs/react/testing-ship-stable-e2e-scope-test-ids 1.0.0
- Use initialData only for complete data techs/tanstack-query/cache-placeholder-vs-initial 1.0.0
- Set staleTime from how fast data changes techs/tanstack-query/cache-stale-time 1.0.0
- Reset query errors when an error boundary retries techs/tanstack-query/err-error-boundaries 1.0.0
- Derive infinite query page params from the server's response techs/tanstack-query/inf-page-params 1.0.0
- Invalidate or update every query a mutation changes techs/tanstack-query/mut-invalidate-queries 1.0.0
- Read mutation state from other components with useMutationState techs/tanstack-query/mut-mutation-state 1.0.0
- Make optimistic updates reversible, and decide them once techs/tanstack-query/mut-optimistic-updates 1.0.0
- Make offline behavior explicit techs/tanstack-query/offline-behavior 1.0.0
- Fetch a dynamic set of queries with useQueries techs/tanstack-query/parallel-use-queries 1.0.0
- Derive component views of query data with a stable select techs/tanstack-query/perf-select-transform 1.0.0
- Prefetch likely next data on user intent techs/tanstack-query/pf-intent-prefetch 1.0.0
- Define hierarchical query keys and options in factories techs/tanstack-query/qk-factory-pattern 1.0.0
- Key each query by every input it uses techs/tanstack-query/qk-include-dependencies 1.0.0
- Pass the query's AbortSignal to the request techs/tanstack-query/query-cancellation 1.0.0
- Prefetch on the server and hydrate the query cache techs/tanstack-query/ssr-dehydration 1.0.0
- Provide shared dependencies through typed router context techs/tanstack-router/ctx-router-context 1.0.0
- Throw notFound for missing resources and render it with notFoundComponent techs/tanstack-router/err-not-found 1.0.0
- With TanStack Query, load route data into the Query cache techs/tanstack-router/load-ensure-query-data 1.0.0
- Load route data in loaders, in parallel techs/tanstack-router/load-use-loaders 1.0.0
- Use Link for navigation users can open, and redirect in the router techs/tanstack-router/nav-link-component 1.0.0
- Mask modal routes with the resource's canonical URL techs/tanstack-router/nav-route-masks 1.0.0
- Set app-wide navigation behavior in router defaults techs/tanstack-router/router-default-options 1.0.0
- Validate search params with defaults at the route techs/tanstack-router/search-validation 1.0.0
- Split route components out of the main bundle techs/tanstack-router/split-route-code 1.0.0
- Register the router and read route data through typed route APIs techs/tanstack-router/ts-route-type-inference 1.0.0
- Annotate types at module boundaries and where they narrow techs/typescript/annotate-types-at-boundaries 1.0.0
- Avoid silencing the type checker techs/typescript/avoid-silencing-the-type-checker 1.0.0
- Comment the role, the result, and the hidden constraint techs/typescript/comment-role-result-and-constraints 1.0.0
- Declare constants with as const, and satisfies when a type exists techs/typescript/declare-constants-with-as-const 1.0.0
- Distinguish null from undefined techs/typescript/distinguish-null-from-undefined 1.0.0
- Generate service types from their contracts techs/typescript/generate-service-types-from-contracts 1.0.0
- Model distinct states as discriminated unions techs/typescript/model-variants-as-discriminated-unions 1.0.0
- Narrow unknown values before use techs/typescript/narrow-unknown-values 1.0.0
- Prefer literal unions over enums techs/typescript/prefer-literal-unions-over-enums 1.0.0
- Prefer type aliases over interfaces techs/typescript/prefer-type-aliases 1.0.0
- Preserve caller-owned data techs/typescript/preserve-caller-owned-data 1.0.0
- Make properties and parameters required, and name them techs/typescript/require-properties-and-name-parameters 1.0.0
- Import types with import type techs/typescript/separate-type-imports 1.0.0
- Use Boolean() for explicit boolean coercion techs/typescript/use-boolean-for-explicit-boolean-coercion 1.0.0
- Follow consistent naming conventions techs/typescript/use-consistent-naming 1.0.0
- Use one array type syntax techs/typescript/use-generic-array-types 1.0.0
- Use named exports techs/typescript/use-named-exports 1.0.0
- Use predictable file names techs/typescript/use-predictable-file-names 1.0.0
- Use template literal types for patterned strings techs/typescript/use-template-literal-types-for-patterned-strings 1.0.0
- Create stores once, outside render techs/zustand/create-stores-at-module-scope 1.0.0
- Define typed state and named actions techs/zustand/define-typed-state-and-named-actions 1.0.0
- Keep store state serializable techs/zustand/keep-store-state-serializable 1.0.0
- Keep each store focused on one domain techs/zustand/keep-stores-domain-focused 1.0.0
- Persist only safe, versioned state techs/zustand/persist-only-safe-versioned-state 1.0.0
- Rehydrate persisted stores after React hydration techs/zustand/rehydrate-persisted-stores-after-hydration 1.0.0
- Subscribe with narrow, stable selectors techs/zustand/subscribe-with-selectors 1.0.0
- Reset stores between tests and test actions directly techs/zustand/test-actions-and-reset-stores 1.0.0
- Update store state functionally and immutably techs/zustand/use-functional-and-immutable-updates 1.0.0
- Use Zustand only for shared client state techs/zustand/use-zustand-only-for-shared-client-state 1.0.0