Aller au contenu principal

Rules: research

Before implementing a custom solution, check whether the framework or tool in place already provides the functionality natively.

Affected files

These rules apply to files matching the following patterns:

  • **/*.ts
  • **/*.tsx
  • **/*.js
  • **/*.jsx
  • **/*.py
  • **/*.go
  • **/*.dart
  • **/*.rs

Detailed rules

Research Before Build

Principle

Before implementing a custom solution, check whether the framework or tool in place already provides the functionality natively.

Mandatory checklist before implementation

StepActionExample
1Read the docs of the framework in useNext.js, Payload CMS, Prisma, Flutter
2Search in the existing codebasegrep -r "feature", explore the modules
3Check available plugins/extensionsnpm packages, pub.dev, crates.io
4Evaluate build vs buyCustom effort vs existing solution

Red Flags — STOP and research

SignalReaction
About to create 5+ files for a common featureSTOP — the framework probably handles it
Implementing a standard pattern (auth, i18n, upload, focal point)STOP — check the framework's docs
Writing a wrapper around an existing libSTOP — the lib may already expose this API
Reimplementing a removed featureSTOP — check why it was removed

Workflow

1. IDENTIFY the precise need
2. SEARCH in the framework/CMS/lib in use
- Official documentation
- grep/glob in node_modules or packages
- GitHub issues/discussions of the framework
3. EVALUATE: native vs custom
- Native exists → use it
- Native partial → extend rather than replace
- Nothing exists → implement custom (document why)
4. INFORM the user of the choice and the reasoning

Rules

IMPORTANT: NEVER implement a custom solution without first checking the native capabilities of the framework in use.

IMPORTANT: If a native solution exists, prefer it even if it is less flexible than a custom solution.

NEVER create more than 5 files for a standard feature without having confirmed that no native solution exists.

Automatic application

These rules are automatically applied by Claude during:

  • Reading the matching files
  • Modifying code
  • Suggestions and fixes

See also