Skip to content

HW #2#5

Open
MyroslavFilippov wants to merge 1 commit intokoldovsky:masterfrom
MyroslavFilippov:master
Open

HW #2#5
MyroslavFilippov wants to merge 1 commit intokoldovsky:masterfrom
MyroslavFilippov:master

Conversation

@MyroslavFilippov
Copy link
Copy Markdown

@MyroslavFilippov MyroslavFilippov commented Apr 8, 2026

Day 2: Workshop Assignment

Учасник:

Чеклист

  • Мінімум 6 правил у .cursor/rules/ (кожне з секцією "How to verify")
  • Мінімум 2 custom commands у .cursor/commands/
  • A/B валідація — задокументовано тестовий сценарій, обидва результати та висновок
  • AGENTS.md — заповнений повністю (контекст проєкту, команди, архітектура, конвенції)
  • yarn build проходить успішно

Бонус (необов'язково)

  • Налаштовано MCP-сервер (GitHub, Context7 або Browser) — скріншот або опис використання
  • Згенеровано reference-skill через npx repomix --skill-generate
  • .cursorrules — legacy-формат правил для Cursor

Нотатки

Summary by CodeRabbit

Документація

  • Додана детальна документація сховища, що встановлює архітектурні вимоги, конвенції розроблення та стандарти кодування, включаючи рекомендації щодо керування станом, архітектури компонентів, функціональної парадигми, типізації та практик тестування.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Walkthrough

Введено новий файл AGENTS.md з документацією щодо правил репозиторію для ІІ-кодованих агентів. Визначено вимоги до архітектури (обов'язковий actionManager.dispatch(), узгодженість AppState, конвеєр рендерування), обмеження на залежності та кодування, список захищених файлів.

Changes

Cohort / File(s) Резюме
Документація для AI агентів
AGENTS.md
✅ Новий файл з правилами для AI агентів: архітектурні обмеження, заборони, конвенції кодування, список захищених модулів.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes


Коментарі ментора

Хорошо: Документація чітка, структурована, покриває архітектурні вимоги та захист критичних файлів.

⚠️ Пропуски:

  • Немає прикладів порушень правил — бралися бути конкретнішими?
  • Процес отримання дозволу для модифікації захищених файлів описаний, але нема посилання на власника/ревʻюера
  • Відсутня інформація про версіонування документації або дату актуальності

Вимога: Додайте контактну особу/процес для затвердження змін захищених файлів, щоб не виникало невизначеностей під час роботи агентів.

🚥 Pre-merge checks | ✅ 2 | ❌ 5

❌ Failed checks (5 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning Назва PR не відповідає вимогам: 'HW #2' замість очікуваного формату 'Day 2: — Workshop Assignment'. Перейменуйте PR на 'Day 2: <ім'я-учасника> — Workshop Assignment', вставивши своє імення замість placeholder'а.
Minimum 6 Rules ⚠️ Warning Root містить 11 файлів, але якісних правил з обов'язковим контентом та "How to verify" лише 6. architecture.mdc БРАКУЄ "How to verify", відсутнє security-related правило, conventions.mdc та do-not-touch.mdc порожні. Додайте "How to verify" до architecture.mdc, створіть security-правило (input-sanitization або xss-prevention), заповніть conventions та do-not-touch контентом або видаліть. Всього 6+ наповнених правил + 1 security + всі з верифікацією.
Minimum 2 Custom Commands ⚠️ Warning Директорія .cursor/commands/ не існує у репозиторії. PR містить тільки файл AGENTS.md без необхідної структури для користувацьких команд Excalidraw. Створіть директорію .cursor/commands/ та додайте мінімум 2 файли (наприклад: code-review.md, component-creation.md) з детальними інструкціями для розробників.
A/B Validation Document ⚠️ Warning PR не містить A/B validation документа. Директорія docs/ab-validation/ та файл docs/ab-validation.md відсутні. Створити docs/ab-validation.md з 5 елементами: правило, сценарій, Result A, Result B, висновок.
Agents.Md Complete ⚠️ Warning Файл AGENTS.md існує з достатньою довжиною, але містить лише 2-3 із 7 вимагаємих секцій (мінімум 5). Наявні секції неповні. Додайте відсутні секції: детальний огляд компонентів, повну документацію архітектури та решту обов'язкових розділів.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@AGENTS.md`:
- Around line 7-16: Update the "Architecture Constraints" section into a fuller
"Architecture" overview: keep existing constraints but add concise descriptions
of the main components (Scene, Element), the action system (actionManager and
dispatch-only updates), the central app state shape (AppState and where it
lives), and a more detailed rendering pipeline (Scene -> renderScene() -> canvas
context including any update/draw phases, batching or invalidation strategy, and
how Element instances are reconciled), referencing these symbols (Scene,
Element, actionManager, AppState, renderScene, canvas context) so readers can
locate code; preserve the prohibition points (no redux/konva/etc.) but move them
to a "Constraints" subsection under the new Architecture section.
- Around line 1-48: AGENTS.md is missing required sections; add four new
headings after the Purpose section: "Project Overview" (2–5 sentences describing
Excalidraw as a collaborative whiteboard app), "Tech Stack" (bullet list
including React, TypeScript, Vite, Yarn workspaces, Vitest), "Project Structure"
(short description of the monorepo layout with packages/, excalidraw-app/, and
main directories like src/ and packages/), and "Key Commands" (list common
commands: yarn dev, yarn start, yarn build, yarn test); ensure headings match
the existing style and keep content concise under the symbols "Project
Overview", "Tech Stack", "Project Structure", and "Key Commands" in AGENTS.md.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a9202a69-1eaa-490e-86b1-eb99c39d7fcf

📥 Commits

Reviewing files that changed from the base of the PR and between 63f111c and 6fb32a9.

⛔ Files ignored due to path filters (13)
  • ONBOARDING.md is excluded by none and included by none
  • README.md is excluded by none and included by none
  • action-manager-state.mdc is excluded by none and included by none
  • architecture.mdc is excluded by none and included by none
  • canvas-rendering.mdc is excluded by none and included by none
  • change-scope.mdc is excluded by none and included by none
  • conventions.mdc is excluded by none and included by none
  • do-not-touch.mdc is excluded by none and included by none
  • implement-safe.md is excluded by none and included by none
  • module-boundaries.mdc is excluded by none and included by none
  • rules-check.md is excluded by none and included by none
  • testing-requirements.mdc is excluded by none and included by none
  • typescript-safety.mdc is excluded by none and included by none
📒 Files selected for processing (1)
  • AGENTS.md

Comment on lines +1 to +48
# AGENTS.md

## Purpose

Guidance for AI coding agents working in this repository. Follow these rules unless a human explicitly overrides them.

## Architecture Constraints

- Use custom state management via `actionManager`; do not introduce Redux, Zustand, or MobX.
- Perform state updates through `actionManager.dispatch()` only.
- Keep core app state aligned with `AppState` in `src/types.ts`.
- Use Canvas 2D for drawing/rendering flows; do not replace with React DOM drawing.
- Preserve render flow: `Scene -> renderScene() -> canvas context`.
- Do not introduce `react-konva`, `fabric.js`, or `pixi.js`.
- Do not add new npm dependencies without explicit approval.
- Check existing utilities (for example `src/utils/`) before adding external helpers.

## Code Conventions

- Use functional components with hooks only; avoid class components.
- Prefer named exports over default exports.
- Keep TypeScript strict; avoid `any` and `@ts-ignore`.
- Prefer `type` over `interface` for simple types.
- Use `import type { X } from "..."` for type-only imports.
- Use `kebab-case` for utility file names and `PascalCase` for component files.
- Keep tests colocated where practical (for example `ComponentName.test.tsx`).

## Protected Files

Do not modify the following files without explicit human approval:

- `src/core/renderer.ts` (render pipeline)
- `src/data/restore.ts` (file format compatibility)
- `src/actions/manager.ts` (action dispatch system)
- `src/types.ts` (core type definitions)

If protected files must change, require:

1. Understanding of dependencies and downstream impact.
2. Running the relevant test suite.
3. Manual verification of behavior.

## Working Style

- Make focused, minimal changes.
- Do not refactor unrelated code.
- Preserve existing behavior unless asked to change it.
- Flag uncertainty and assumptions in your final update.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

❌ Файл не відповідає вимогам завдання — бракує обов'язкових секцій

Згідно з вимогами до AGENTS.md, файл має містити мінімум 5 із 7 обов'язкових секцій. Наразі присутні лише 2-3 секції:

Відсутні критичні секції:

  1. Project Overview — необхідний опис суті проєкту Excalidraw (2-5 речень). Що це за проєкт? Whiteboard для малювання діаграм? Collaborative tool?
  2. Tech Stack — має бути перелік: React, TypeScript, Vite, Yarn workspaces, Vitest
  3. Project Structure — опис monorepo layout: packages/, excalidraw-app/, основні директорії
  4. Key Commands — ключові команди: yarn build, yarn test, yarn start, yarn dev тощо

Наявні секції:

  • Conventions (Code Conventions) — добре описано
  • Do-Not-Touch / Constraints (Protected Files) — чітко визначено
  • ⚠️ Architecture (Architecture Constraints) — присутня частково, але описує лише обмеження, без огляду основних компонентів системи

Додатково добре:

  • Working Style секція відображає learnings з пам'яті (focused changes, preserve behavior)
  • Факти коректні: yarn (не npm/pnpm), actionManager, Canvas 2D
📋 Приклад структури для відсутніх секцій

Додайте після секції Purpose:

 ## Purpose
 
 Guidance for AI coding agents working in this repository. Follow these rules unless a human explicitly overrides them.
 
+## Project Overview
+
+Excalidraw is an open-source virtual whiteboard for sketching hand-drawn like diagrams. It supports collaborative editing, export to PNG/SVG, and local-first architecture with optional cloud sync. Built as a React-based canvas editor with a focus on simplicity and user experience.
+
+## Tech Stack
+
+- **Frontend**: React 18+ with TypeScript
+- **Build Tool**: Vite
+- **Package Manager**: Yarn (workspaces enabled)
+- **Testing**: Vitest, React Testing Library
+- **Rendering**: Canvas 2D API
+
+## Project Structure
+
+Monorepo layout:
+- `packages/excalidraw/` — core library (canvas, actions, state)
+- `excalidraw-app/` — web application wrapper
+- `src/` — main source directory (components, actions, utils, types)
+- `src/tests/` — integration and unit tests
+
+## Key Commands
+
+- `yarn install` — install dependencies
+- `yarn start` — dev server (excalidraw-app)
+- `yarn build` — production build
+- `yarn test` — run Vitest suite
+- `yarn test:watch` — watch mode
+- `yarn typecheck` — TypeScript validation
+
 ## Architecture Constraints
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 1 - 48, AGENTS.md is missing required sections; add
four new headings after the Purpose section: "Project Overview" (2–5 sentences
describing Excalidraw as a collaborative whiteboard app), "Tech Stack" (bullet
list including React, TypeScript, Vite, Yarn workspaces, Vitest), "Project
Structure" (short description of the monorepo layout with packages/,
excalidraw-app/, and main directories like src/ and packages/), and "Key
Commands" (list common commands: yarn dev, yarn start, yarn build, yarn test);
ensure headings match the existing style and keep content concise under the
symbols "Project Overview", "Tech Stack", "Project Structure", and "Key
Commands" in AGENTS.md.

Comment on lines +7 to +16
## Architecture Constraints

- Use custom state management via `actionManager`; do not introduce Redux, Zustand, or MobX.
- Perform state updates through `actionManager.dispatch()` only.
- Keep core app state aligned with `AppState` in `src/types.ts`.
- Use Canvas 2D for drawing/rendering flows; do not replace with React DOM drawing.
- Preserve render flow: `Scene -> renderScene() -> canvas context`.
- Do not introduce `react-konva`, `fabric.js`, or `pixi.js`.
- Do not add new npm dependencies without explicit approval.
- Check existing utilities (for example `src/utils/`) before adding external helpers.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

⚠️ Секція Architecture Constraints неповна

Наразі описано лише обмеження (constraints), але відсутній огляд основних компонентів системи. За вимогами, Architecture секція має включати:

  • Основні компоненти (Scene, Element, Action system, Canvas renderer)
  • State management підхід (actionManager, AppState flow)
  • Rendering pipeline (детальніше, ніж просто "Scene -> renderScene()")

Поточний вміст — це радше "Architecture Prohibitions", а не повноцінний архітектурний огляд.

♻️ Рекомендація: розширити до Architecture

Перейменуйте та доповніть секцію:

-## Architecture Constraints
+## Architecture
+
+### Core Components
+
+- **Scene** — manages collection of elements and their state
+- **Element** — drawable entities (rectangle, ellipse, arrow, text, etc.)
+- **Action System** — commands that modify state via `actionManager.dispatch()`
+- **Canvas Renderer** — renders elements to Canvas 2D context
+- **State Management** — centralized via `actionManager`, typed in `AppState`
+
+### Rendering Pipeline
+
+`Scene -> renderScene() -> canvas context` — all drawing goes through Canvas 2D API, not React DOM.
+
+### Constraints
 
 - Use custom state management via `actionManager`; do not introduce Redux, Zustand, or MobX.
 - Perform state updates through `actionManager.dispatch()` only.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Architecture Constraints
- Use custom state management via `actionManager`; do not introduce Redux, Zustand, or MobX.
- Perform state updates through `actionManager.dispatch()` only.
- Keep core app state aligned with `AppState` in `src/types.ts`.
- Use Canvas 2D for drawing/rendering flows; do not replace with React DOM drawing.
- Preserve render flow: `Scene -> renderScene() -> canvas context`.
- Do not introduce `react-konva`, `fabric.js`, or `pixi.js`.
- Do not add new npm dependencies without explicit approval.
- Check existing utilities (for example `src/utils/`) before adding external helpers.
## Architecture
### Core Components
- **Scene** — manages collection of elements and their state
- **Element** — drawable entities (rectangle, ellipse, arrow, text, etc.)
- **Action System** — commands that modify state via `actionManager.dispatch()`
- **Canvas Renderer** — renders elements to Canvas 2D context
- **State Management** — centralized via `actionManager`, typed in `AppState`
### Rendering Pipeline
`Scene -> renderScene() -> canvas context` — all drawing goes through Canvas 2D API, not React DOM.
### Constraints
- Use custom state management via `actionManager`; do not introduce Redux, Zustand, or MobX.
- Perform state updates through `actionManager.dispatch()` only.
- Keep core app state aligned with `AppState` in `src/types.ts`.
- Use Canvas 2D for drawing/rendering flows; do not replace with React DOM drawing.
- Preserve render flow: `Scene -> renderScene() -> canvas context`.
- Do not introduce `react-konva`, `fabric.js`, or `pixi.js`.
- Do not add new npm dependencies without explicit approval.
- Check existing utilities (for example `src/utils/`) before adding external helpers.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 7 - 16, Update the "Architecture Constraints" section
into a fuller "Architecture" overview: keep existing constraints but add concise
descriptions of the main components (Scene, Element), the action system
(actionManager and dispatch-only updates), the central app state shape (AppState
and where it lives), and a more detailed rendering pipeline (Scene ->
renderScene() -> canvas context including any update/draw phases, batching or
invalidation strategy, and how Element instances are reconciled), referencing
these symbols (Scene, Element, actionManager, AppState, renderScene, canvas
context) so readers can locate code; preserve the prohibition points (no
redux/konva/etc.) but move them to a "Constraints" subsection under the new
Architecture section.

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