06 — Quy tắc AI bắt buộc & Extensions
Cursor Rules (.cursor/rules/) — luôn áp dụng
| File | Bắt buộc | Nội dung |
|---|---|---|
welife-core.mdc |
always | Monorepo, stack |
doc-matrix.mdc |
always | Đọc DOC-MAP trước code |
mandatory-wp-gate.mdc |
always | Domain + WP + path |
ai-safety.mdc |
always | Secrets, scope |
code-quality.mdc |
always | TS, errors, tests |
monorepo-boundaries.mdc |
always | Không import chéo |
swagger-contract.mdc |
api/** |
Swagger-first |
api-nestjs.mdc |
api/** |
Nest conventions |
mobile-rn.mdc |
mobile/** |
RN conventions |
fe-figma-matrix.mdc |
`mobile | partner |
image-to-ui.mdc |
UI files | Ảnh → UI |
agent-queue.mdc |
always | «tiếp» → queue STUB→IMP |
agent-autonomous-loop.mdc |
always | «chạy autonomous» → loop doc 10 |
Skills
| Skill | Khi nào |
|---|---|
welife-mandatory |
Mọi feature WELIFE · autonomous |
image-to-ui |
Mockup → screen · tự sửa theo ảnh |
Workspace Extensions (cài khi mở repo)
File: .vscode/extensions.json — Cursor sẽ gợi ý Install Recommended.
Core DX
- ESLint · Prettier · EditorConfig
- Error Lens · Pretty TypeScript Errors
- Path Intellisense · Better Comments · Todo Tree
- Code Spell Checker (en+vi) · GitLens
Backend NestJS / data
- Docker · Dev Containers
- SQLTools + PostgreSQL
- Redis
- Prisma (khi thêm ORM)
- Thunder Client / REST Client (gọi API cạnh Swagger)
- dotenv · YAML
Frontend React Native / Expo
- Expo Tools
- React Native Tools
Docs
- Markdown All in One · Markdownlint
Workspace settings
.vscode/settings.json:
- Format on save (Prettier)
- ESLint fix on save
- Tab 2 · LF · trim whitespace
- Todo Tree nhận
STUB/WP-/AC- - File nesting
package.json/App.tsx
EditorConfig + Prettier
.editorconfig.prettierrc.json(root; api đã có.prettierrc)
Indexing AI
.cursorindexingignore— bỏ PDF lớn & swagger snapshot khỏi index hàng loạt
Cách cài extensions nhanh
- Mở folder
D:\welifetrong Cursor - Thông báo Install Recommended Extensions → Install
- Hoặc Command Palette →
Extensions: Show Recommended Extensions
Kiểm tra rules đang active
Chat agent phải:
- Nêu
Domain+WP - Không sửa ngoài surface path
- UI → Read ảnh trước
Nếu agent bỏ qua → nhắc: “tuân thủ welife-mandatory + DOC-MAP”.