Skip to content

Add CONTRIBUTION conventions and refactor audit docs - #179

Merged
malkoG merged 1 commit into
devfrom
codex/audit-codebase-for-quality-and-taste
Jul 18, 2026
Merged

malkoG merged 1 commit into
devfrom
codex/audit-codebase-for-quality-and-taste

Conversation

@malkoG

@malkoG malkoG commented Jul 18, 2026 •

Copy link
Copy Markdown
Member

Motivation

  • Provide an explicit contributor-facing convention for refactors and review expectations to make future changes consistent and reviewable.
  • Enforce server boundaries (controller -> service -> repository) and recommend frontend ownership patterns to reduce route/component complexity and duplicated logic.
  • Capture a large-scale audit of current codebase issues, priorities, and a phased roadmap to guide incremental refactors.

Description

  • Add CONVENTION.md as the canonical contributor guide describing server and frontend conventions, hook guidance, ownership patterns, examples (as-is/to-be), and a review checklist.
  • Update AGENTS.md to reference the new CONVENTION.md and surface key short rules (server path, no direct DB in controllers/bootstrap, TanStack/route guidance, form/reducer preferences, UI primitives and states).
  • Add docs/refactoring-audit-2026-07-18.md, a comprehensive audit covering code quality, frontend complexity, taste principles, findings, acceptance criteria, and a multi-phase refactor roadmap with recommended umbrella issues and deliverables.

Testing

  • Ran linting with pnpm -s lint, which completed successfully.
  • Ran unit test suite with pnpm -s test, which completed successfully.
  • Performed static type checks with pnpm -s typecheck, which completed successfully.

Codex Task

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive contribution and refactoring guide covering server layering, frontend structure, typed boundaries, accessibility, and review practices.
    • Added a refactoring audit with code-quality findings, recommended improvements, roadmap phases, and review checklists.
    • Documented preferred patterns for data fetching, form state, route responsibilities, and UI behavior.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds contribution conventions and a comprehensive refactoring audit covering architectural standards, frontend and server examples, review checklists, planned umbrella issues, a roadmap, and explicit non-goals.

Changes

Contribution conventions and refactoring audit

Layer / File(s) Summary
Contribution and layer conventions
AGENTS.md, CONVENTION.md
Documents server layering, frontend ownership, typed boundaries, data-fetching and state patterns, accessibility practices, and PR review criteria.
Audit findings and target structures
docs/refactoring-audit-2026-07-18.md
Catalogs refactoring findings with current and target structures for routes, data fetching, forms, mappings, bootstrap logic, hooks, and UI accessibility.
Umbrella issues and roadmap
docs/refactoring-audit-2026-07-18.md
Defines six planned refactoring workstreams, contribution standards, a phased roadmap, and explicit non-goals.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding contribution conventions and refactor audit documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/audit-codebase-for-quality-and-taste

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/refactoring-audit-2026-07-18.md`:
- Line 626: Update the stale audit-document references in the documentation
template to link to docs/refactoring-audit-2026-07-18.md instead of
docs/refactor-audit.md, including both occurrences identified in the diff.
- Around line 492-495: Update the POST controller example around
GroupEventCompatService.toCreateEventRequest and createEvent to parse and
authenticate the incoming request, obtain the authenticated user ID, and pass
that ID together with the typed DTO according to createEvent(userId, params).
Remove the direct { request: forwarded } call while preserving the compatibility
conversion flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bf53e109-4481-4374-9571-72f3bc0425d7

📥 Commits

Reviewing files that changed from the base of the PR and between fbf5ff9 and a65aa3a.

📒 Files selected for processing (3)
  • AGENTS.md
  • CONVENTION.md
  • docs/refactoring-audit-2026-07-18.md

Comment on lines +492 to +495
// src/server/controllers/groups/compat-events.ts
export const POST = async ({ request, params }) => {
const forwarded = await GroupEventCompatService.toCreateEventRequest(request, params.groupId);
return createEvent({ request: forwarded });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the compatibility example with the documented service contract.

createEvent is defined earlier as createEvent(userId, params), but this example passes a { request } object directly. Show the controller parsing/authenticating the request and then calling the service with a user ID and typed DTO.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/refactoring-audit-2026-07-18.md` around lines 492 - 495, Update the POST
controller example around GroupEventCompatService.toCreateEventRequest and
createEvent to parse and authenticate the incoming request, obtain the
authenticated user ID, and pass that ID together with the typed DTO according to
createEvent(userId, params). Remove the direct { request: forwarded } call while
preserving the compatibility conversion flow.

## Evidence

- Files, commands, metrics, or examples that prove the problem exists.
- Link to the relevant section of `docs/refactor-audit.md`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the stale audit-document path.

Both references point to docs/refactor-audit.md, but this file is docs/refactoring-audit-2026-07-18.md. Update the template links before contributors copy them into issues.

Also applies to: 664-664

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/refactoring-audit-2026-07-18.md` at line 626, Update the stale
audit-document references in the documentation template to link to
docs/refactoring-audit-2026-07-18.md instead of docs/refactor-audit.md,
including both occurrences identified in the diff.

@malkoG
malkoG merged commit 205ebd7 into dev Jul 18, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant