docs: add KNOWLEDGE.md with codebase patterns and conventions#174
docs: add KNOWLEDGE.md with codebase patterns and conventions#174shazzar00ni wants to merge 6 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughAdds a new KNOWLEDGE.md documenting established implementation conventions: content sourcing and exports, Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 56 minutes and 4 seconds.Comment |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull request overview
Adds a new KNOWLEDGE.md document to capture key architectural patterns and conventions used across the DocuGen codebase, aiming to centralize tribal knowledge and align with the repo’s documented workflow.
Changes:
- Introduces
KNOWLEDGE.mddocumenting patterns across content organization, UI components, theme, testing, analytics, a11y, and dev setup. - Provides concrete references to existing files (e.g.,
src/data/content.ts,src/App.tsx,src/lib/ThemeContext.tsx,tailwind.config.js). - Records dev/test conventions and configuration expectations (ports, env vars, test setup).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| **Location:** `src/lib/ThemeContext.tsx` | ||
|
|
||
| ### Components | ||
|
|
||
| - `ThemeProvider` - wraps app, manages state | ||
| - `useTheme()` - hook for components (throws if used outside provider) |
There was a problem hiding this comment.
The useTheme() hook is not defined in src/lib/ThemeContext.tsx; it lives in src/lib/useTheme.ts and imports ThemeContext from ThemeContext.tsx. Please update this section’s “Location”/component breakdown so readers can find the hook in the correct file.
| **Location:** `src/lib/ThemeContext.tsx` | |
| ### Components | |
| - `ThemeProvider` - wraps app, manages state | |
| - `useTheme()` - hook for components (throws if used outside provider) | |
| **Locations:** | |
| - `src/lib/ThemeContext.tsx` - `ThemeProvider`, `ThemeContext`, `Theme` type | |
| - `src/lib/useTheme.ts` - `useTheme()` hook for components (throws if used outside provider) | |
| ### Components | |
| - `ThemeProvider` - wraps app, manages state | |
| - `ThemeContext` - shared context consumed by the hook | |
| - `useTheme()` - hook for components |
|
|
||
| ```typescript | ||
| // Environment variable | ||
| VITE_PLAUSIBLE_DOMAIN = your - domain.com; |
There was a problem hiding this comment.
The environment variable example is formatted like JavaScript/TypeScript and includes spaces/semicolon (VITE_PLAUSIBLE_DOMAIN = your - domain.com;), which is not a valid .env entry and is easy to copy/paste incorrectly. Please change it to a correct .env example (e.g. VITE_PLAUSIBLE_DOMAIN=your-domain.com).
| VITE_PLAUSIBLE_DOMAIN = your - domain.com; | |
| VITE_PLAUSIBLE_DOMAIN=your-domain.com |
| - Preview command serves production build on same port | ||
| - E2E tests target `http://localhost:5173` (Playwright default) |
There was a problem hiding this comment.
The port details here are internally inconsistent with the repo configuration: vite.config.ts sets the dev server to 3000, but playwright.config.ts configures webServer.port/baseURL as 5173. Also, vite preview does not use server.port by default (it has its own preview port unless configured). Please update this section to reflect the actual ports being used, or adjust the configs so dev/e2e/preview are aligned.
| - Preview command serves production build on same port | |
| - E2E tests target `http://localhost:5173` (Playwright default) | |
| - `vite preview` does **not** automatically reuse `server.port`; its preview port must be configured separately if you want it to match dev | |
| - E2E tests currently target `http://localhost:5173` (per Playwright configuration), so dev and E2E are not using the same port |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
KNOWLEDGE.md (2)
161-164:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFix invalid
.envexample syntax on Line 163.
VITE_PLAUSIBLE_DOMAIN = your - domain.com;is not a valid.envassignment and is error-prone for copy/paste setup.Proposed fix
- VITE_PLAUSIBLE_DOMAIN = your - domain.com; + VITE_PLAUSIBLE_DOMAIN=your-domain.com🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@KNOWLEDGE.md` around lines 161 - 164, The .env example for VITE_PLAUSIBLE_DOMAIN is invalid; replace the current token `VITE_PLAUSIBLE_DOMAIN = your - domain.com;` with a proper .env assignment by removing spaces and the semicolon and using a single equals with a placeholder domain (e.g., VITE_PLAUSIBLE_DOMAIN=your-domain.com) so `VITE_PLAUSIBLE_DOMAIN` is a valid environment variable in KNOWLEDGE.md.
228-230:⚠️ Potential issue | 🟠 Major | ⚡ Quick winResolve contradictory port guidance between dev server and E2E target.
Line 228 says local dev runs on
3000, while Line 230 says E2E targets5173. Clarify context (e.g., configured app URL vs Playwright default) so developers don’t run tests against the wrong host.Proposed wording
- - E2E tests target `http://localhost:5173` (Playwright default) + - E2E tests should target the app base URL configured in Playwright (do not assume `5173` if Vite is configured for `3000`)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@KNOWLEDGE.md` around lines 228 - 230, Text in KNOWLEDGE.md contradicts ports: it states Vite dev server runs on port 3000 (configured in vite.config.ts) but says E2E tests target http://localhost:5173 (Playwright default); update the wording to clarify that the app's configured dev/preview URL comes from vite.config.ts (port 3000) and that Playwright by default uses 5173 unless overridden, and instruct developers to set Playwright's baseURL or the test target to match the configured dev server (or run the dev server on 5173) so tests point to the correct host.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@KNOWLEDGE.md`:
- Line 234: Update the "Last updated" date string in KNOWLEDGE.md by replacing
the existing "_Last updated: 2026-04-24_" text with "_Last updated: 2026-04-30_"
so the file reflects the PR creation date; locate the exact string "_Last
updated: 2026-04-24_" and change only the date portion.
---
Duplicate comments:
In `@KNOWLEDGE.md`:
- Around line 161-164: The .env example for VITE_PLAUSIBLE_DOMAIN is invalid;
replace the current token `VITE_PLAUSIBLE_DOMAIN = your - domain.com;` with a
proper .env assignment by removing spaces and the semicolon and using a single
equals with a placeholder domain (e.g., VITE_PLAUSIBLE_DOMAIN=your-domain.com)
so `VITE_PLAUSIBLE_DOMAIN` is a valid environment variable in KNOWLEDGE.md.
- Around line 228-230: Text in KNOWLEDGE.md contradicts ports: it states Vite
dev server runs on port 3000 (configured in vite.config.ts) but says E2E tests
target http://localhost:5173 (Playwright default); update the wording to clarify
that the app's configured dev/preview URL comes from vite.config.ts (port 3000)
and that Playwright by default uses 5173 unless overridden, and instruct
developers to set Playwright's baseURL or the test target to match the
configured dev server (or run the dev server on 5173) so tests point to the
correct host.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2caab3e8-f466-4dc8-bdfd-0c1693641daf
📒 Files selected for processing (1)
KNOWLEDGE.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (actions)
- GitHub Check: Codacy Security Scan
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: shazzar00ni/docugen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-17T16:01:51.517Z
Learning: Applies to src/data/content.ts : Use developer-focused tone: confident, technical, no marketing fluff
📚 Learning: 2026-02-17T16:01:51.517Z
Learnt from: CR
Repo: shazzar00ni/docugen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-17T16:01:51.517Z
Learning: Applies to src/data/content.ts : Use developer-focused tone: confident, technical, no marketing fluff
Applied to files:
KNOWLEDGE.md
📚 Learning: 2026-02-17T16:01:51.517Z
Learnt from: CR
Repo: shazzar00ni/docugen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-17T16:01:51.517Z
Learning: Applies to src/components/**/*.tsx : Place all text copy and site configuration in `src/data/content.ts`; never hardcode text in components
Applied to files:
KNOWLEDGE.md
📚 Learning: 2026-02-17T16:01:51.517Z
Learnt from: CR
Repo: shazzar00ni/docugen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-17T16:01:51.517Z
Learning: Applies to src/data/content.ts : Avoid lorem ipsum; use realistic placeholder text
Applied to files:
KNOWLEDGE.md
📚 Learning: 2026-02-17T16:01:51.517Z
Learnt from: CR
Repo: shazzar00ni/docugen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-17T16:01:51.517Z
Learning: Applies to src/data/content.ts : Use 'you/your' for direct address in copy
Applied to files:
KNOWLEDGE.md
📚 Learning: 2026-02-17T16:01:51.517Z
Learnt from: CR
Repo: shazzar00ni/docugen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-17T16:01:51.517Z
Learning: Applies to src/components/**/*.tsx : Use PascalCase for component files and component names (e.g., `HeroSection`, `PricingCard`)
Applied to files:
KNOWLEDGE.md
📚 Learning: 2026-02-17T16:01:51.517Z
Learnt from: CR
Repo: shazzar00ni/docugen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-17T16:01:51.517Z
Learning: Applies to src/**/*.{ts,tsx,js,jsx} : Use SCREAMING_SNAKE_CASE for constants (e.g., `SITE_CONFIG`)
Applied to files:
KNOWLEDGE.md
📚 Learning: 2026-02-17T16:01:51.517Z
Learnt from: CR
Repo: shazzar00ni/docugen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-17T16:01:51.517Z
Learning: Applies to src/components/**/*.tsx : Avoid arbitrary Tailwind values (`[...]`); extend theme instead
Applied to files:
KNOWLEDGE.md
|
|
||
| --- | ||
|
|
||
| _Last updated: 2026-04-24_ |
There was a problem hiding this comment.
Update the “Last updated” date to match this PR change date.
Line 234 shows 2026-04-24, but this PR was created on 2026-04-30.
Proposed fix
- _Last updated: 2026-04-24_
+ _Last updated: 2026-04-30_🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@KNOWLEDGE.md` at line 234, Update the "Last updated" date string in
KNOWLEDGE.md by replacing the existing "_Last updated: 2026-04-24_" text with
"_Last updated: 2026-04-30_" so the file reflects the PR creation date; locate
the exact string "_Last updated: 2026-04-24_" and change only the date portion.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🚩 KNOWLEDGE.md placed at root rather than docs/ directory
AGENTS.md prescribes docs/ as the directory for "Documentation files" and lists ARCHITECTURE.md, DEVELOPMENT.md, etc. there. KNOWLEDGE.md covers similar content (architectural patterns, conventions) and could arguably belong in docs/. However, there's existing precedent for root-level markdown files (DEPLOYMENT.md, ISSUES.md, SECURITY.md, CODE_OF_CONDUCT.md) that aren't in docs/ either. The distinction seems to be project governance/meta files at root vs. detailed technical docs in docs/. KNOWLEDGE.md straddles this line - it's a meta file about how to work in the codebase (like AGENTS.md) but also contains detailed technical documentation (like ARCHITECTURE.md). Not flagged as a rule violation since the AGENTS.md file organization section is descriptive of existing structure rather than an explicit prohibition on root-level docs.
Was this helpful? React with 👍 or 👎 to provide feedback.
| # Knowledge: DocuGen Patterns & Conventions | ||
|
|
||
| This document captures architectural decisions, patterns, and conventions that are implemented in the codebase but not formally documented elsewhere. |
There was a problem hiding this comment.
🚩 Significant content overlap with docs/ARCHITECTURE.md
KNOWLEDGE.md covers topics that substantially overlap with docs/ARCHITECTURE.md: lazy loading strategy (section 3), component architecture (section 4), theme system (section 5), and more. For example, both documents describe the lazy loading pattern in App.tsx, the theme context system, and the centralized content management approach. This creates a maintenance burden where changes need to be reflected in two places. The KNOWLEDGE.md intro says it captures things "not formally documented elsewhere" but much of it IS documented in ARCHITECTURE.md.
Was this helpful? React with 👍 or 👎 to provide feedback.
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|



Summary
Changes
Testing Steps