Globalne rule dla Cursora - język i interpunkcja
Ostatnio napisałem artykuł o Cursorze, jego możliwościach i konfiguracji dostępny tu: Cursor – pełny przewodnik
Dziś krótka notatka z przykładami ruli generalnych.
Gdzie umieścić reguły
Utwórz katalog ~/.cursor/rules/ i umieść tam pliki .mdc. Te reguły działają globalnie we wszystkich projektach.
Reguła 1 — język polski w rozmowach
Reguła leniwa - no bo w sumie skoro komunikujemy się z agentem w języku naturalnym, to dlaczego nie miałoby być jeszcze bardziej naturalnie?
Stwórz plik: ~/.cursor/rules/polish-language.mdc
Snippet na Bitbucket: Cursor - rule for Polish in conversation
Treść:
---
description: Always respond in Polish unless told otherwise.
alwaysApply: true
---
# Język komunikacji
Zawsze komunikuj się ze mną po polsku — w odpowiedziach, pytaniach, wyjaśnieniach i wszelkich wiadomościach tekstowych skierowanych do mnie.
Wyjątek: jeśli użytkownik wyraźnie poprosi o inny język, przełącz się na niego.
Nie dotyczy to kodu, nazw zmiennych, komentarzy w kodzie ani treści generowanej do plików — tam stosuj zasady właściwe dla danego języka programowania.
Reguła 2 — angielskie komentarze w kodzie
Niezależnie od tego w jakim języku się komunikuję z agentem - komentarze i docstringi powinny być pisane po angielsku.
Stwórz plik: ~/.cursor/rules/english-code-comments.mdc
Snippet na Bitbucket: Cursor - rule that code comments in all programming languages must be in English
Treść:
---
description: Code comments in all programming languages must be in English.
alwaysApply: true
---
# Code Comments Language
All comments in any programming language must be written in English.
This applies to:
- Inline comments (`# comment`, `// comment`, `-- comment`, etc.).
- Block comments (`/* ... */`, `""" ... """`, etc.).
- Docstrings and documentation blocks.
- Robot Framework documentation (`[Documentation]`, `Documentation:`).
- Any other form of in-code annotation.
Do NOT write comments in Polish or any other language — English only.
Reguła 3 — interpunkcja w tekstach i listach
Osobiście mnie braki w kropkach na końcu zdania, czy w listach dość mocno irytuje, stąd postanowiłem to również załatwić regułą.
Stwórz plik: ~/.cursor/rules/punctuation-rules.mdc
Snippet na Bitbucket: Cursor - rule for punctuation in texts, docstrings, descriptions and bullet lists
Treść:
---
description: Punctuation rules for texts, docstrings, descriptions and bullet lists.
alwaysApply: true
---
# Punctuation Rules
## Sentences in texts
Every sentence in any written text (docstrings, descriptions, articles, comments, documentation) must end with a period. Section headings are the only exception.
## Bullet lists
Apply punctuation based on the nature of the list items:
**1. Full sentences (each item is a standalone sentence)**
- Start each item with a capital letter.
- End each item with a period.
- Use this form for longer, complex descriptions.
**2. Short phrases continuing an introductory sentence**
If items complete or continue a lead-in sentence (items start with a lowercase letter), end each item with a comma or semicolon, and the last item with a period.
Example — "To prepare the dough you need:":
- wheat flour,
- fresh yeast,
- warm milk.
**3. Short keyword lists (no punctuation)**
Omit punctuation entirely when the list consists of standalone short keywords or labels that are not part of a sentence (e.g. a shopping list, a tag list, a feature list).
Example:
- bread
- milk
- butter