Skip to content

docs(web): add frontend coding style guide + rename pages to kebab-case#30684

Merged
ashleeradka merged 4 commits into
mainfrom
devin/1778775282-web-style-guide
May 14, 2026
Merged

docs(web): add frontend coding style guide + rename pages to kebab-case#30684
ashleeradka merged 4 commits into
mainfrom
devin/1778775282-web-style-guide

Conversation

@ashleeradka
Copy link
Copy Markdown
Contributor

@ashleeradka ashleeradka commented May 14, 2026

Prompt / plan

Consolidate coding style conventions from 30+ PRs in the vellum-assistant-platform refactoring series into a single STYLE_GUIDE.md reference doc. Rename scaffold page files to kebab-case to match the convention from day one.

Companion PR: #30683 — CONVENTIONS.md

What this PR does

  1. Adds apps/web/STYLE_GUIDE.md — coding style, naming, formatting, and import rules for the new Vite + React Router v7 SPA.
  2. Renames 6 scaffold page files from PascalCase to kebab-case (ConversationDetail.tsxconversation-detail.tsx, etc.) and updates routes.tsx imports.

The style guide covers: kebab-case file naming, domains/-based directory structure, @/ path aliases, import ordering, TypeScript strict mode, named exports, function declarations for components, Zustand store naming (use-{domain}-store.ts), JSDoc conventions, and dead code rules.

Why

  • Consistent conventions from day one. The platform repo accumulated inconsistencies across 30+ PRs. Documenting decisions upfront prevents that.
  • Cross-platform safety. kebab-case eliminates the macOS/Linux case-sensitivity bugs that plagued the platform codebase (same class of issues that led to Next.js PR #75000).
  • Open-source contributor experience. Clear style rules lower the barrier for external contributors.

Key decisions reflected

Decision Rationale
domains/ not features/ "Features" implies product-level concepts (chat, settings); domains/ signals DDD-influenced bounded contexts (messages, conversations, streaming)
Top-level hooks/, utils/, types/, lib/ Cross-domain shared code lives at the top level; domain-specific code stays inside domains/<name>/
lib/ for configured third-party wrappers API client with interceptors, CSRF, Sentry — impure/stateful code that doesn't fit utils/ or runtime/
Design system at packages/design-library/ Imported as @vellum/design-library, aliased via Vite for monorepo HMR
Zustand stores named use-{domain}-store.ts Colocated within domain folders, accessed as hooks

See CONVENTIONS.md PR #30683 for the full architectural rationale behind these decisions.

Test plan

  • CI passes (doc-only + file renames with import updates)
  • Verified routes.tsx imports match the renamed kebab-case filenames

References

Human review checklist

  • Verify the directory structure in STYLE_GUIDE.md matches the domains/-based layout in CONVENTIONS.md (docs(web): add frontend architecture conventions (CONVENTIONS.md) #30683)
  • Confirm import examples use @/domains/... consistently (not @/features/...)
  • Verify all 6 page file renames and routes.tsx import updates are correct
  • Check that @vellum/design-library import pattern is acceptable for the design system

Link to Devin session: https://app.devin.ai/sessions/57905118879948a69946c94c6cd332d7
Requested by: @ashleeradka


Open in Devin Review

Covers file/folder naming (kebab-case), directory structure, import
conventions (path aliases, import order, destructured React types,
type-only imports), TypeScript rules (strict mode, interface vs type,
no any, const assertions), component patterns (named exports, function
declarations, props naming), hook conventions, constants/enums style,
docstring expectations, formatting defaults, and unused code handling.

Each section links to authoritative references (TypeScript docs, React
docs, Vite docs, eslint plugin docs).

Co-Authored-By: ashlee@vellum.ai <ashlee@vellum.ai>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd601a9d94

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/web/STYLE_GUIDE.md
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread apps/web/STYLE_GUIDE.md

Coding style, naming conventions, and formatting rules for the Vellum
web app. For architectural decisions and patterns see
[`CONVENTIONS.md`](./CONVENTIONS.md).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 STYLE_GUIDE.md references non-existent CONVENTIONS.md in three places

The new STYLE_GUIDE.md links to ./CONVENTIONS.md on lines 5, 75, and 393, but apps/web/CONVENTIONS.md does not exist anywhere in the repository (find . -name CONVENTIONS.md returns no results). Anyone following these links will get a 404. The root AGENTS.md's "Keep Docs Up to Date" rule says docs must reflect current state — shipping documentation with broken cross-references violates this.

Prompt for agents
STYLE_GUIDE.md references ./CONVENTIONS.md in three locations (lines 5, 75, and 393) but that file does not exist in apps/web/ or anywhere else in the repo. Either create the CONVENTIONS.md file in the same PR, or remove/replace the three references. Lines to fix: line 5 (intro paragraph link), line 75 (domain folders section link to CONVENTIONS.md#code-organization), and line 393 (dead code section link to CONVENTIONS.md#dead-code-and-cleanup).
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Acknowledged — CONVENTIONS.md ships in companion PR #30683 which is already open and CI-green. The link will resolve once both merge. Since these are intended to merge together, the temporary broken link window is effectively zero.

Comment thread apps/web/STYLE_GUIDE.md
Comment on lines +14 to +29
### kebab-case everywhere

All files and directories use `kebab-case`. This avoids
case-insensitive filesystem collisions (macOS HFS+, Windows NTFS) and
keeps imports predictable.

```
use-send-message.ts # hook
message-handlers.ts # module
conversation-reducer.ts # reducer
chat-body.tsx # component
stream-event-types.ts # types
```

The only exceptions are `App.tsx` (conventional React entry-point name)
and generated files that follow their generator's convention.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 Existing page files already violate the kebab-case rule being introduced

The style guide mandates kebab-case for all files with only App.tsx as an exception (line 28), but the existing scaffold pages in apps/web/src/pages/ use PascalCase: ConversationDetail.tsx, SettingsTab.tsx, NotFound.tsx, LibraryDetail.tsx, ConversationNew.tsx, Library.tsx. These files predate this PR and are part of the scaffold, so they're not introduced by this change — but the style guide should either rename them or acknowledge them as pre-existing exceptions to avoid confusion when the convention is enforced.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed — renamed all 6 PascalCase page files to kebab-case and updated the imports in routes.tsx in commit 8d24021. The convention and the codebase are now consistent.

Renames all scaffold page files to follow the kebab-case convention
introduced in STYLE_GUIDE.md and updates imports in routes.tsx.

Co-Authored-By: ashlee@vellum.ai <ashlee@vellum.ai>
@devin-ai-integration devin-ai-integration Bot changed the title Add frontend coding style guide (STYLE_GUIDE.md) for web app docs(web): add frontend coding style guide + rename pages to kebab-case May 14, 2026
devin-ai-integration Bot and others added 2 commits May 14, 2026 17:56
Unrelated dead code spotted during a PR gets its own separate PR
opened at the same time — never just filed as an issue and left.

Co-Authored-By: ashlee@vellum.ai <ashlee@vellum.ai>
… dirs, design library imports

Co-Authored-By: ashlee@vellum.ai <ashlee@vellum.ai>
Copy link
Copy Markdown
Contributor

@vex-assistant-bot vex-assistant-bot Bot left a comment

Choose a reason for hiding this comment

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

APPROVE

Value: Turns 30+ PRs worth of accumulated style decisions from the platform refactoring series into a single authoritative reference. Any agent or contributor opening a PR against apps/web/ now has explicit rules for naming, imports, TypeScript, and formatting — preventing the drift that made the platform codebase hard to navigate.

What this does: Adds STYLE_GUIDE.md to apps/web/ covering file/folder naming, import conventions, TypeScript rules, component/hook patterns, and formatting. Renames 6 PascalCase scaffold page files to kebab-case.


Bot findings — all resolved:

  • Devin: CONVENTIONS.md forward reference (companion PR #30683, zero broken-link window) ✅
  • Devin: kebab-case violation on existing page files — fixed in commit 8d240213
  • Codex: @/ alias not yet configured in tsconfig/vite — correctly noted as intentional (target-state convention). This needs to land in the first feature PR that adds cross-module imports. Make sure it doesn't get forgotten.

Content looks solid:

  • kebab-case + use- hook prefix + .test.ts colocated tests — consistent with CONVENTIONS.md ✅
  • Import order (external → @/ alias → relative) + type imports ✅
  • Named exports (not default), function declarations for components ✅
  • No TS enums → as const objects/union types — right call ✅
  • No any, strict mode — ✅
  • Dead code rules mirror CONVENTIONS.md exactly ✅

Minor: App.tsx is called out as a kebab-case exception but the named-exports rule doesn't explicitly address it. App.tsx is almost certainly a default export. Tiny nit — could add App.tsx as an exception to the named-exports rule too, or just leave it implicit.

Vellum Constitution — Inviting: a readable style guide makes open-source contribution feel structured rather than a guessing game.

Reviewed at 5084a2a2

@ashleeradka ashleeradka merged commit 695b288 into main May 14, 2026
3 checks passed
@ashleeradka ashleeradka deleted the devin/1778775282-web-style-guide branch May 14, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant