forked from ibraheem4/linear-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clinerules
145 lines (91 loc) · 4.68 KB
/
.clinerules
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# General Developer Guidelines for AI Agents
## 1. **Safety and Operations**
### Git and GitHub
- Never push directly to `main`/`master` branches.
- Avoid creating or pushing branches or PRs without explicit user approval.
- Always show Git commands before execution, including the purpose and expected outcomes.
- Wait for explicit confirmation before executing any command.
### File Changes
- Present proposed changes (diffs) before committing them.
- Obtain approval before creating or modifying files.
- Clearly explain the purpose and potential impact of changes.
- Always confirm before saving changes.
### Communication
- Clearly explain planned actions before executing them.
- Provide options for alternative approaches when available.
- Confirm critical steps and ask for explicit user approval before proceeding.
- Provide status updates after completing significant tasks or actions.
### Risk Management
- Treat all operations as potentially destructive unless explicitly noted otherwise.
- Highlight risks, side effects, and rollback steps for all significant changes.
- Clarify any uncertainties before proceeding.
---
## 2. **Code Development Standards**
### General Principles
- Prioritize readability and maintainability over cleverness or over-engineering.
- Provide concise, informative explanations of changes.
- Display only relevant, modified code snippets unless explicitly asked to show the entire file.
### Tools and Frameworks
- **Frontend**: Next.js with TypeScript, Tailwind CSS, Shadcn UI, Radix, and `phosphor-react`.
- **Backend**: FastAPI or Django with Django-Ninja for RESTful APIs.
- **Package Management**: Use `pnpm` for frontend, `pipenv` for Python backend.
- **Containerization**: Employ `docker compose` and Docker multi-stage builds for streamlined container setups.
### Coding Standards
#### Code Style and Structure
- Use functional and declarative programming patterns; avoid overuse of classes.
- Use descriptive variable names (e.g., `isLoading`, `hasError`).
- Structure files logically: exported component → subcomponents → helpers → types.
#### Naming Conventions
- Use `kebab-case` for directories (e.g., `components/auth-wizard`).
- Prefer named exports for components and utility functions.
#### TypeScript Practices
- Use TypeScript with strict typing; prefer interfaces over types.
- Replace enums with maps when appropriate.
- Use functional components for React development.
#### Syntax and Formatting
- Write concise JSX and use declarative syntax where possible.
- Enforce consistent formatting with Prettier and ESLint.
---
## 3. **Performance and UI Optimization**
### Performance
- Minimize `use client`, `useEffect`, and excessive state management; favor React Server Components (RSC).
- Optimize Web Vitals: LCP, CLS, FID.
- Implement lazy loading for non-critical components and images.
### UI Design
- Follow a mobile-first approach with responsive Tailwind CSS.
- Use modern image formats (e.g., WebP) with size metadata and lazy loading.
- Avoid unnecessary client-side rendering; prefer SSR when possible.
---
## 4. **Best Practices**
### Commit Standards
- Use conventional commit messages to maintain consistency (e.g., `feat:`, `fix:`, `chore:`).
- Use feature branches and feature flags for gradual rollouts.
### Logging and Monitoring
- Implement structured logging formats for easier debugging.
- Document significant changes in OpenAPI specs or project documentation.
### Testing Strategy
- Write unit tests for utilities.
- Use React Testing Library for components and Playwright for E2E testing.
- Prioritize testing user behavior over implementation specifics.
---
## 5. **Development Workflow**
### Workflow Automation
- Use GitHub Actions for CI/CD pipelines.
- Implement `pre-commit` hooks for code quality checks.
### State Management
- Use React Query for server state and Zustand for complex client-side state sparingly.
- Prefer URL state management (e.g., `nuqs`) over local state when feasible.
---
## 6. **AI Collaboration Principles**
### Explain, Confirm, Execute
1. **Explain**: Describe what you plan to do, including purpose and expected outcomes.
2. **Confirm**: Wait for explicit approval before proceeding with commands or changes.
3. **Execute**: Provide updates and results upon completion.
### Propose Alternatives
- Offer multiple approaches when applicable, explaining the trade-offs for each.
### Maintain Transparency
- Clearly communicate any uncertainties or assumptions.
- Highlight potential risks and include rollback options for significant changes.
### Optimize Feedback
- Avoid excessive verbosity; tailor explanations to the user’s preferred level of detail.
- Provide actionable, concise answers for specific queries.