>_reporules.devOpen Docs
Repository Standards

AI repository standards
for long-term maintainability

Structured repository conventions designed to keep AI-generated code predictable and maintainable over time.

57 rules12 categoriesUpdated 2 days ago
Maintained by RepoRules · Last updated 2 days ago
Architecture

Server Components First

Description

Always prefer server components unless interactivity is required.

Why

Reduces client-side complexity and avoids unnecessary hydration.

Bad Example

Fetching data inside client components.

Good Example

Fetch data in server components and pass serialized props.

Common Failure

Duplicated fetching logic across pages.

Repository Context

Used inside: billing workflow, dashboard modules, shared validators

Legacy Notes

Old dashboard hooks still depend on legacy validation patterns.

Migration Status

Partially migrated.

Maintained by RepoRules · Last updated 2 days ago
Architecture

Feature-Based Structure

Description

Group files by feature instead of file type.

Why

Keeps features self-contained. Prevents AI from creating scattered utilities.

Bad Example

Flat file structure with no domain boundaries.

Good Example

/features/auth, /features/billing, /features/dashboard

Common Failure

Mixed concerns and duplicated logic across features.

Repository Context

Used inside: billing workflow, dashboard modules

Legacy Notes

Old dashboard modules still use flat structure.

Migration Status

Partially migrated.

Maintained by RepoRules · Last updated 2 days ago
Architecture

Shared UI Primitives

Description

Avoid duplicated UI patterns. Keep reusable UI in /components/ui.

Why

AI tools generate inconsistent UI without shared primitives.

Bad Example

Inline styles and duplicated button patterns across features.

Good Example

Button, Input, Dialog reused from /components/ui

Common Failure

Inconsistent UI generated by different AI prompts.

Repository Context

Used inside: all dashboard modules

Legacy Notes

Analytics module still uses inline styles.

Migration Status

Migration in progress.

Maintained by RepoRules · Last updated 2 days ago
Architecture

Isolated Business Logic

Description

Never mix UI rendering with domain logic.

Why

Keeps AI-generated code testable and refactorable.

Bad Example

API calls and state management inside component files.

Good Example

Logic in /features/*/actions or /features/*/hooks

Common Failure

Server actions mixed with UI rendering code.

Repository Context

Used inside: billing service, auth module

Legacy Notes

Dashboard components still contain inline queries.

Migration Status

Pending.

Maintained by RepoRules · Last updated 2 days ago
Naming

Naming Conventions

Description

Use explicit names. Avoid generic file names.

Why

Generic names cause AI tools to create duplicated utilities.

Bad Example

helpers.ts, utils.ts, common.ts

Good Example

auth-validator.ts, billing-service.ts, dashboard-query.ts

Common Failure

Duplicated utility files with overlapping logic.

Repository Context

Used inside: all feature modules

Legacy Notes

Legacy utils/ folder still contains mixed helpers.

Migration Status

Partially migrated.

Maintained by RepoRules · Last updated 2 days ago
PR Workflow

PR Constraints

Description

Keep PRs under 300 LOC. Avoid mixed concerns.

Why

Large PRs hide AI-generated inconsistencies and duplicated patterns.

Bad Example

500+ line PRs with multiple unrelated changes.

Good Example

Focused PRs under 300 LOC with clear scope.

Common Failure

Inconsistent architecture hidden in oversized PRs.

Repository Context

Used inside: all workflow repositories

Legacy Notes

Billing migration PRs still exceed 400 LOC.

Migration Status

Enforcing new limits.

Maintained by RepoRules · Last updated 2 days ago
Testing

Testing Standards

Description

Test critical flows. Prefer integration tests.

Why

AI-generated code often misses edge cases and error states.

Bad Example

Snapshot-heavy tests that hide regressions.

Good Example

Behavior-based tests covering loading, error, and empty states.

Common Failure

Tests passing but production flows broken.

Repository Context

Used inside: billing, auth, dashboard

Legacy Notes

Old test files still use snapshot approach.

Migration Status

Migration in progress.

Maintained by RepoRules · Last updated 2 days ago
Performance

Performance Standards

Description

Lazy load heavy charts. Avoid client waterfalls.

Why

AI tools don't consider bundle size unless constrained.

Bad Example

All components eagerly loaded on the client.

Good Example

Server components with streaming and lazy-loaded heavy UI.

Common Failure

Unnecessary client bundles slowing down page loads.

Repository Context

Used inside: dashboard, analytics

Legacy Notes

Analytics page still eagerly loads charts.

Migration Status

Pending.

Maintained by RepoRules · Last updated 2 days ago
AI Constraints

AI Output Constraints

Description

Preserve existing architecture. Avoid introducing new folder structures.

Why

AI tools generate alternative patterns unless strictly constrained.

Bad Example

AI creating new folder structures outside feature boundaries.

Good Example

AI following existing feature-based architecture patterns.

Common Failure

Inconsistent repo structure from unconstrained AI output.

Repository Context

Used inside: all AI-generated code paths

Legacy Notes

No legacy exceptions — all new code must follow constraints.

Migration Status

Fully active.

Maintained by RepoRules · Last updated 2 days ago
Migration

Migration Constraints

Description

Old patterns still exist. Prevent AI from adding to legacy code.

Why

AI tools can't distinguish between current and deprecated patterns.

Bad Example

AI adding new features using deprecated hook patterns.

Good Example

AI following migration guide and using current standards.

Common Failure

Legacy patterns duplicated across new features.

Repository Context

Used inside: billing hooks, dashboard queries

Legacy Notes

Auth hooks still use deprecated patterns.

Migration Status

Migration planned Q3 2026.

Repository Files
rules.md
memory.md
architecture.md
migration-notes.md
testing-guidelines.md
pnpm-workspace.yaml
turbo.json
Recent Repository Incidents
2026-05-08
- duplicated auth hooks introduced during billing refactor

2026-05-04
- dashboard migration broke validation consistency

2026-04-28
- old analytics modules bypassed server boundaries
Engineering Constraints
- avoid large rewrites
- preserve migration consistency
- maintain repo predictability
- reduce architectural drift
- avoid duplicated business logic