Repository navigation
Expand file tree
/
Copy path.cursorrules
More file actions
121 lines (95 loc) · 5.61 KB
/
Copy path.cursorrules
File metadata and controls
121 lines (95 loc) · 5.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Project Overview
Conflow is a **pnpm + Turbo monorepo** that delivers a Tanstack Start (SSR) front-end to user.
It is a comprehensive IT business solution providing meeting summarization, Gantt chart management, and Agile sprint monitoring, designed with an **A2UI-ready** architecture.
---
## Core Principles
- **Architecture**: Pragmatic Feature-Sliced Design (FSD).
- **Strict Immutability**: Strictly no `let`. Use `const` only. Apply functional programming (`map`, `filter`, `reduce`).
- **Logical Purity**: No emotional filler in comments. Use self-documenting TypeScript types.
- **No Guessing**: State `Unknown` and request the schema if API/Library specs are unclear.
- **SSR First**: Leverage TanStack Start's Server Functions for data mutations and secure API calls.
---
## Monorepo Structure & Dependency Rules
**Flow**: `apps/web` → `packages/business` → `packages/ui` → `packages/core`.
- **packages/core**: Infrastructure only (API Client, SSE Handlers, Date/Chart Utils). **Zero Business Logic, Zero UI**.
- **packages/ui**: Atomic UI components. **Zero Business Logic, Zero API Calls**.
- **packages/business**:
- **entities/**: Domain data schemas and pure state logic.
- **features/**: Independent user actions (e.g., `executeSummary`, `calculateGantt`). Must be logic-heavy and UI-agnostic.
- **apps/web (TanStack Start)**:
- **routes/**: File-based routing and Loaders/Actions.
- **widgets/**: Complex UI blocks combining multiple features for the Dashboard.
---
## Coding Standards & A2UI Strategy
- **Package Manager**: Strictly `pnpm`.
- **Framework**: TanStack Start. Use `createServerFn` for all server-side operations (DB/External API).
- **A2UI Readiness**:
- **Headless Logic**: Logic in `features/` must be decoupled from React lifecycle to allow AI Agent invocation.
- **Schema-First**: Every feature must have a defined Input/Output Schema (Zod) for AI interoperability.
- **State Management**: Use TanStack Query for server state. Avoid direct mutation; use immutable updates only.
---
## Prohibited Practices
- **No Circular Dependencies**: Strict layer isolation.
- **No Direct `let`**: Use `const`.
- **No `any`**: Use `unknown` or strict interfaces.
- **No Layout Shift**: Use TanStack Start `Loaders` for pre-fetching essential dashboard data to ensure stable UX.
---
## Business Logic & Reliability (PM Perspective)
- **Event Tracking**: All actions in `features/` must log `Context` (Feature ID, Runtime, Status).
- **Third-party Abstraction**: Use **Adapter Pattern** in `core/` for external services (Slack, Jira) to prevent vendor lock-in.
- **Validation Layer**: **Zod Mandatory** for AI-generated content and External API responses before reaching `entities/`.
- **Dashboard Resiliency**: Mandatory `Skeleton` for async loading and `Error Boundary` for each widget to prevent full-page crashes.
---
## WorkSpace
Configure Like this
```
conflow/
├── apps/
│ └── web/ # TanStack Start (SSR Frontend)
│ ├── src/
│ │ ├── routes/ # TanStack Start File-based Routing
│ │ │ ├── __root.tsx # Root Layout & Global Providers
│ │ │ ├── index.tsx # Home / Marketing Page
│ │ │ └── dashboard.tsx # Main Dashboard Page
│ │ ├── widgets/ # Feature combinations (e.g., GanttWidget, SummaryCard)
│ │ ├── app/ # Global Styles & SSR Entry points
│ │ └── main.tsx
│ ├── public/
│ └── package.json
│
├── packages/
│ ├── business/ # Logic & Domain Layer (FSD: Entities/Features)
│ │ ├── src/
│ │ │ ├── entities/ # Data Schemas (Zod) & Domain States
│ │ │ │ ├── meeting.ts
│ │ │ │ ├── sprint.ts
│ │ │ │ └── gantt.ts
│ │ │ └── features/ # Headless User Actions (A2UI Ready)
│ │ │ ├── use-summary/ # Meeting summary logic
│ │ │ ├── use-gantt/ # Gantt calculation logic
│ │ │ └── use-agile/ # Sprint monitoring logic
│ │ └── package.json
│ │
│ ├── ui/ # Atomic Design System (Shared UI)
│ │ ├── src/
│ │ │ ├── components/ # Button, Input, Modal, Skeleton
│ │ │ └── index.ts # Public API for UI components
│ │ └── package.json
│ │
│ └── core/ # Infrastructure Layer (Shared Utils/Clients)
│ ├── src/
│ │ ├── api/ # Axios/Fetch client & SSE handlers
│ │ ├── adapters/ # Slack/Jira/AI Model adapters
│ │ ├── utils/ # Pure Date/Chart/String utils
│ │ └── constants/ # Global Configs & Constants
│ └── package.json
│
├── turbo.json # Turborepo Config
├── pnpm-workspace.yaml # pnpm Workspace Definition
├── pnpm-lock.yaml
└── package.json
```
## Operational Boundaries
- **Manual Execution Only**: The AI must never execute commands for package installation, testing, or build processes automatically.
- **Guidance Only**: All command-line operations (e.g., pnpm install, pnpm test, turbo build) must be suggested as code blocks for the user to review and execute manually.
- **Responsibility**: The user retains full control over the terminal environment and workspace state changes.