|
| 1 | +# CodeIntel Development Rules |
| 2 | + |
| 3 | +## Code Style |
| 4 | + |
| 5 | +### General |
| 6 | +- NO emojis anywhere - not in code, comments, docs, or commit messages |
| 7 | +- Prefer files under 200 lines. Larger files allowed when logically cohesive. |
| 8 | +- Comments explain WHY, not WHAT. Keep them brief. |
| 9 | +- No decorative headers or ASCII art |
| 10 | +- Casual tone in comments - write like a human, not a robot |
| 11 | + |
| 12 | +### JSDoc Policy |
| 13 | +- JSDoc allowed for public API functions and exported hooks |
| 14 | +- Keep JSDoc minimal - document params and return types, not obvious behavior |
| 15 | +- Approved files using JSDoc: `frontend/src/services/playground-api.ts`, `frontend/src/config/api.ts`, `frontend/src/hooks/useViewTransition.ts` |
| 16 | + |
| 17 | +### Large File Exceptions |
| 18 | +These files exceed 200 lines but are approved due to logical cohesion: |
| 19 | +- `backend/routes/playground.py` |
| 20 | +- `backend/services/dna_extractor.py` |
| 21 | +- `frontend/src/components/DependencyGraph/index.tsx` |
| 22 | + |
| 23 | +### Frontend (TypeScript/React) |
| 24 | +- Package manager: **Bun only**. Never npm, never yarn. |
| 25 | +- Always `bun install`, `bun run dev`, `bun run build` |
| 26 | +- Never delete `bun.lock` or create `package-lock.json` |
| 27 | +- Use shadcn/ui components over custom UI |
| 28 | +- Tailwind for styling, no CSS files |
| 29 | +- Functional components with hooks, no class components |
| 30 | + |
| 31 | +### Backend (Python) |
| 32 | +- Python 3.11+ required |
| 33 | +- Type hints on all function signatures |
| 34 | +- Async/await for I/O operations |
| 35 | +- PEP 8 style, max 120 char lines |
| 36 | +- Use existing patterns from `services/` directory |
| 37 | + |
| 38 | +### Commits |
| 39 | +- Format: `type: description` (e.g., `fix: remove broken link`) |
| 40 | +- Types: feat, fix, docs, refactor, test, chore |
| 41 | +- No emojis in commit messages |
| 42 | +- Keep commits focused - one change per commit |
| 43 | + |
| 44 | +## Architecture |
| 45 | + |
| 46 | +### Project Structure |
| 47 | +```plaintext |
| 48 | +backend/ # FastAPI, Python 3.11+ |
| 49 | +frontend/ # React 18, TypeScript, Vite, Bun |
| 50 | +mcp-server/ # MCP protocol server |
| 51 | +``` |
| 52 | + |
| 53 | +### API Versioning |
| 54 | +- All endpoints use `/api/v1/` prefix |
| 55 | +- Version config in `backend/config/api.py` |
| 56 | + |
| 57 | +### Key Services |
| 58 | +- `indexer_optimized.py` - Code parsing and embedding |
| 59 | +- `dependency_analyzer.py` - Import graph extraction |
| 60 | +- `style_analyzer.py` - Convention detection |
| 61 | +- `dna_extractor.py` - Architectural pattern extraction |
| 62 | + |
| 63 | +## What NOT to Do |
| 64 | + |
| 65 | +- Don't use npm (use Bun) |
| 66 | +- Don't add emojis |
| 67 | +- Don't write verbose comments |
| 68 | +- Don't add "AI-looking" badges or decorations |
0 commit comments