diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 855e7fcba..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,245 +0,0 @@ -# peanut-ui Development Rules - -**Version:** 1.0.0 | **Updated:** 2026-03-10 - -Single source of truth for developer and AI assistant rules. Tool-specific files (`.cursorrules`, `CLAUDE.md`, `AGENTS.md`, `.windsurfrules`) are symlinks to this file. - ---- - -## 🚫 Agent Safety - -- **Never open SVG files** β€” crashes AI agents. Only read jpeg, png, gif, or webp. -- **Never run `jq`** β€” crashes AI agents. -- **Never run `sleep`** from command line β€” hibernates the PC. -- **Never add AI co-author to commits** β€” no "Co-Authored-By" lines for AI assistants. -- **Do not generate .md files** unless explicitly told to. - -## πŸ”€ Git Workflow - -- **NEVER commit or push directly to main** β€” all changes must go through a pull request. No exceptions. -- **Always work from a feature branch** β€” create a branch, push it, open a PR, wait for CI to pass, then merge. -- **Use git worktrees** for parallel work (`claude --worktree ` or `git worktree add`). -- Multiple agents/sessions must use separate worktrees to avoid collisions. - -## πŸ’» Code Quality - -- **Boy scout rule** β€” leave code better than you found it. -- **DRY** β€” reuse existing code and shared constants (e.g. `src/constants`). Less code is better code. -- **Separate business logic from UI** β€” important for readability, debugging, and testability. -- **Use explicit imports** β€” no wildcard imports, import from specific files. -- **Reuse existing components and functions** β€” don't hardcode hacky solutions. -- **Warn about breaking changes** β€” if there's risk, explicitly WARN. Flag if frontend changes require backend action (or vice versa). -- **Mention refactor opportunities** β€” if you spot one, mention it. DO NOT make changes unless explicitly told to. -- **Error messages** β€” user-facing errors should be friendly and clear. Console/Sentry errors should be descriptive for debugging. - -## 🚫 Import Rules (critical for build performance) - -- **No barrel imports** β€” never `import * as X from '@/constants'` or create index.ts barrel files. Import from specific files (e.g. `import { PEANUT_API_URL } from '@/constants/general.consts'`). -- **No circular dependencies** β€” check if target file imports from current file before adding imports. Move shared types to `interfaces.ts` if needed. -- **No Node.js packages in client components** β€” `web-push`, `fs`, `crypto` (node) can't be used in `'use client'` files. Use server actions or API routes instead. -- **Check for legacy code** β€” before importing, check for TODO comments marking code as legacy/deprecated. Prefer newer implementations. - -## 🚫 Export Rules - -- **One component per file** β€” never export multiple components from the same file. -- **Separate types** β€” never export types from a component or hook file. Use a separate file if types need to be reused. -- **Separate utils** β€” utility/helper functions go in a separate utils file. - -## πŸ”— URL as State (Critical for UX) - -- **URL is source of truth** β€” use query parameters for user-facing state that should survive navigation, refresh, or sharing (step indicators, amounts, filters, view modes, selected items). -- **Use nuqs library** β€” always use `useQueryStates` for type-safe URL state management. Never manually parse/set query params with `router.push` or `URLSearchParams`. -- **Enable deep-linking** β€” users should be able to share or bookmark URLs mid-flow (e.g. `?step=inputAmount&amount=500¤cy=ARS`). -- **Multi-step flows** β€” URL should always reflect current step and relevant data. Proper back/forward browser button behavior. -- **Reserve `useState` for ephemeral UI only** β€” loading spinners, modal open/close, form validation errors, hover/focus states, temporary animations. -- **Don't URL-ify everything** β€” API responses, auth state, and internal component state generally don't belong in the URL. -- **Type safety** β€” define parsers for query params (`parseAsInteger`, `parseAsStringEnum`). - -## 🎨 Design System - -- **Live showcase**: visit `/dev/components` to see all components rendered with all variants. -- **Three layers**: Bruddle primitives (`src/components/0_Bruddle/`), Global shared (`src/components/Global/`), Tailwind custom classes (`tailwind.config.js`). - -### Color Names (misleading!) - -- `purple-1` / `primary-1` = `#FF90E8` (PINK, not purple) -- `primary-3` = `#EFE4FF` (lavender) -- `yellow-1` / `secondary-1` = `#FFC900` -- `green-1` = `#98E9AB` - -### Key Rules - -- **Button sizing trap**: `size="large"` is `h-10` (40px) β€” SHORTER than default `h-13` (52px). Never use for primary CTAs. -- **Primary CTA**: `