Skip to content

Commit f96e22e

Browse files
using-systemclaude
andauthored
feat(skills): add docs-english skill to enforce english in artifacts (#9)
New skill ensures committed artifacts (docs, comments, docstrings, identifiers, commit messages, PR titles, log/error strings) are written in English regardless of the conversation language, while leaving localized i18n resources and chat replies untouched. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 326461f commit f96e22e

1 file changed

Lines changed: 146 additions & 0 deletions

File tree

skills/docs-english/SKILL.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
name: docs-english
3+
description: "Use when writing or editing documentation, code comments, docstrings, README files, CHANGELOG entries, PR descriptions, commit messages, or any committed textual artifact - enforces English as the sole language regardless of the language used in the conversation"
4+
---
5+
6+
# Documentation Language
7+
8+
## Overview
9+
10+
All documentation and code artifacts committed to the repository MUST be written in English, even when the user is conversing in another language (French, Spanish, German, etc.). English is the lingua franca of software engineering and ensures maximum discoverability, collaboration, and long-term maintainability.
11+
12+
The conversation language is for interacting with the user. The artifact language is always English.
13+
14+
## When to Use
15+
16+
- Writing or editing any file intended to be committed
17+
- Adding or updating code comments and docstrings (JSDoc, TSDoc, Python docstrings, Rustdoc, etc.)
18+
- Writing README, CHANGELOG, CONTRIBUTING, or any `*.md` file
19+
- Writing commit messages (already enforced by the `git-commit` skill, but reinforced here)
20+
- Writing pull request titles and descriptions
21+
- Writing issue descriptions, labels, and comments
22+
- Writing release notes
23+
- Naming variables, functions, classes, files, branches
24+
- Writing log messages, error messages, and user-facing strings in code
25+
- Writing configuration comments (YAML, TOML, JSON5 comments)
26+
27+
## Scope: What This Skill Does NOT Cover
28+
29+
This skill applies to **committed artifacts only**. It does NOT change:
30+
31+
- The language used when replying to the user in chat
32+
- The language of the user's own source content (if translating or quoting the user)
33+
- Localized string resources (i18n `.po`, `.json`, `.xliff` files) whose purpose is to hold non-English translations
34+
35+
## Rules
36+
37+
### 1. Write all documentation in English
38+
39+
Regardless of the conversation language, the output written to files MUST be in English.
40+
41+
```markdown
42+
<!-- BAD (user asked in French, agent wrote README in French) -->
43+
# Mon Projet
44+
Ce projet est un outil de ligne de commande pour gérer les tâches.
45+
46+
<!-- GOOD -->
47+
# My Project
48+
This project is a command-line tool for managing tasks.
49+
```
50+
51+
### 2. Code comments and docstrings in English
52+
53+
```python
54+
# BAD
55+
def calculer_total(articles):
56+
"""Calcule le total des articles dans le panier."""
57+
...
58+
59+
# GOOD
60+
def calculate_total(items):
61+
"""Calculate the total of items in the cart."""
62+
...
63+
```
64+
65+
```typescript
66+
// BAD
67+
// Récupère l'utilisateur depuis la base de données
68+
function getUser(id: string) { ... }
69+
70+
// GOOD
71+
// Fetch the user from the database
72+
function getUser(id: string) { ... }
73+
```
74+
75+
### 3. Identifiers in English
76+
77+
Variable names, function names, class names, file names, and branch names MUST be in English.
78+
79+
```javascript
80+
// BAD
81+
const utilisateurs = await db.fetchUsers();
82+
function envoyerEmail(destinataire) { ... }
83+
84+
// GOOD
85+
const users = await db.fetchUsers();
86+
function sendEmail(recipient) { ... }
87+
```
88+
89+
### 4. Commit messages, PR titles, and branch names in English
90+
91+
```bash
92+
# BAD
93+
git commit -m "feat: ajouter la page de connexion"
94+
git checkout -b feat/page-connexion
95+
96+
# GOOD
97+
git commit -m "feat: add login page"
98+
git checkout -b feat/login-page
99+
```
100+
101+
### 5. Log and error messages in English
102+
103+
Error messages are documentation for operators and future developers. They MUST be in English.
104+
105+
```go
106+
// BAD
107+
return fmt.Errorf("impossible de se connecter à la base de données: %w", err)
108+
109+
// GOOD
110+
return fmt.Errorf("failed to connect to database: %w", err)
111+
```
112+
113+
### 6. Translate user-provided content when needed
114+
115+
If the user describes a feature in French and asks you to document it, translate the description into clear, idiomatic English before writing.
116+
117+
```
118+
User (in French): "Ajoute un README qui explique que l'outil synchronise les tâches"
119+
120+
# BAD: copy user's French verbatim into README
121+
# GOOD: translate the intent into English
122+
"This tool synchronizes tasks across devices."
123+
```
124+
125+
### 7. Respond to the user in their language
126+
127+
This rule applies to artifacts, not conversation. Continue replying to the user in whatever language they used. Only what you write to files must be English.
128+
129+
## Common Mistakes
130+
131+
| Mistake | Fix |
132+
|---------|-----|
133+
| Mirroring the user's language into the file because they wrote in French | Translate to English before writing |
134+
| Mixing English code with non-English comments | Keep both in English |
135+
| Using non-English identifiers "because the domain is French" | Use English identifiers; document domain terms in a glossary if needed |
136+
| Writing commit messages in the user's spoken language | Always English per `git-commit` + this skill |
137+
| Translating i18n resource files to English | Leave locale-specific files alone; they exist to hold translations |
138+
139+
## Red Flags — STOP and Rewrite in English
140+
141+
- You are about to write `# ` or `// ` followed by non-English text into a source file
142+
- You are about to name a variable, function, or branch with non-English words
143+
- You typed the user's prompt language into a `README.md`, `CHANGELOG.md`, or commit message
144+
- You translated an English library's docs into another language inside a code comment
145+
146+
All of these mean: rewrite in English before saving.

0 commit comments

Comments
 (0)