Skip to content

Commit 27b44c7

Browse files
authored
[docs] Update AI assistant rules (#230)
1 parent 14f91bc commit 27b44c7

8 files changed

Lines changed: 154 additions & 142 deletions

File tree

.cursor/prompts/documentation-review.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ Context:
88

99
Primary rule sources:
1010
- `.cursor/rules/docs/global-style.mdc`
11-
- `.cursor/rules/docs/terminology.mdc`
12-
- `.cursor/rules/docs/refs-editorial-policy-full.mdc`
13-
- `.cursor/rules/docs/refs-glossary-full.mdc`
1411
- `.cursor/rules/docs/hugo-supported-codeblock-languages.mdc`
12+
- Full policy compliance using the normative style guide and glossary at https://pp.flant.ru/llms.txt.
13+
Fetch it before starting the review.
14+
- Terminology and wording compliance using https://pp.flant.ru/llms.txt (see "Glossary" section, fetch before starting the review)
15+
and `.cursor/rules/docs/terminology.mdc`.
1516

1617
Apply additional rules when relevant:
1718
- `.cursor/rules/docs/ru-en-parity.mdc` for EN/RU pairs, `.ru.md` naming, and localized media.
1819
- `.cursor/rules/docs/hugo-shortcodes.mdc` for `alert`, `tabs`, `details`, and shortcode usage.
1920
- `.cursor/rules/docs/frontmatter-links-media.mdc` for front matter, related links, and media placement.
20-
- `.cursor/rules/docs/crd-translation-files.mdc` for `crds/doc-ru-*.yaml` translation files.
21-
- `.cursor/rules/docs/openapi-x-doc.mdc` for `openapi/**/*.yaml` and `x-doc-*` fields.
2221

2322
Review checklist:
2423

@@ -28,13 +27,14 @@ Review checklist:
2827
- Flag missing prerequisites, caveats, limits, or version-sensitive behavior when they are necessary for safe use.
2928

3029
2. Editorial and style compliance
31-
- Check compliance with `.cursor/rules/docs/refs-editorial-policy-full.mdc` and `.cursor/rules/docs/global-style.mdc`.
30+
- Check compliance with policy compliance using the normative style guide and glossary.
31+
- Check terminology and wording compliance.
3232
- Check for concise technical wording, meaningful link anchors, correct emphasis, and actionable instructions.
3333
- For Russian instructional text, require imperative "вы"-form.
3434
- For docs pages, do not allow first-level headings (`#`). Minimum heading level is `##`.
3535

3636
3. Terminology compliance
37-
- Check compliance with `.cursor/rules/docs/terminology.mdc` and `.cursor/rules/docs/refs-glossary-full.mdc`.
37+
- Check compliance using https://pp.flant.ru/llms.txt and `.cursor/rules/docs/terminology.mdc`.
3838
- Flag forbidden or inconsistent terms.
3939
- Require exact approved product naming.
4040
- Require `d8 k` instead of `kubectl` in command examples unless the repository rule clearly does not apply to that case.

.cursor/rules/docs/frontmatter-links-media.mdc

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,17 @@ alwaysApply: false
88

99
- Use YAML front matter in page header.
1010
- `title`: required.
11-
- If `title` is missing, generate it from page purpose and module context.
12-
- For `README` title use template:
13-
- RU file (`README.ru.md`): `Модуль <MODULENAME>`
14-
- EN file (`README.md`): `Module <MODULENAME>`
15-
- `<MODULENAME>` must be the exact value from `module.yaml.name` (lowercase Kebab Case), without case/style changes.
16-
- `linkTitle`: optional, and applicable only to Hugo pages.
17-
- Do not use `linkTitle` in Jekyll page metadata.
11+
- If `title` is missing, generate it from page purpose and context.
1812
- `description`: required, concise, unique, and not a copy of `title`.
1913
- If `description` is missing, generate it automatically from page purpose and key context.
20-
- Do not set top-level front matter `url`; it is generated automatically.
21-
- `moduleStatus` in README front matter is deprecated and must not be used.
22-
- If `moduleStatus` is present:
23-
- remove it from README front matter;
24-
- validate that lifecycle status is set in `module.yaml` via `stage`;
25-
- if README `moduleStatus` conflicts with `module.yaml.stage`, ask user before changing lifecycle value.
2614

2715
# Related Links
2816

29-
- For Hugo pages, use related links as `params.relatedLinks` in front matter.
30-
- For Jekyll pages, use related links as top-level `relatedLinks` in front matter (without `params`).
17+
- Use related links as `params.relatedLinks` in front matter.
3118
- Do not add manual "Related links" or "Related pages" sections in Markdown body.
3219
- The related links block is rendered automatically from front matter.
33-
- If a `relatedLinks` item has no `url`, the link must not be rendered.
34-
- If `title` is missing, render only module links like `/modules/<module-name>/`.
3520

3621
# Link Rules
3722

38-
- Same module docs links must be relative (`cr.html`, `usage.html`).
39-
- Other module links must be absolute without domain (`/modules/<module-name>/...`).
40-
- Deckhouse Kubernetes Platform docs links must be absolute without domain (`/products/kubernetes-platform/documentation/v1/...`).
41-
42-
# Media Rules
43-
44-
- Store images, PDFs, and media only in `docs/` or its subdirectories.
45-
- Use relative links for files within the same module repository.
23+
- Links to the project pages must be relative. Other links must be absolute.
24+
- Links to Deckhouse Kubernetes Platform documentation must be absolute without domain (`/products/kubernetes-platform/documentation/v1/...`).

.cursor/rules/docs/global-style.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Global style rules for module docs
2+
description: Global style rules for docs
33
alwaysApply: true
44
---
55

.cursor/rules/docs/hugo-supported-codeblock-languages.mdc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ description: Hugo supported code block language identifiers
33
alwaysApply: true
44
---
55

6-
# Hugo and Jekyll Supported Code Block Languages
7-
86
The full language identifier list below is part of Cursor rules.
97

108
# Supported code block languages

.cursor/rules/docs/openapi-x-doc.mdc

Lines changed: 0 additions & 95 deletions
This file was deleted.

.cursor/rules/docs/terminology.mdc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ alwaysApply: true
2424
- `HTTP-протокол` or `протокол HTTP` (not `HTTP протокол`).
2525
- Do not replace approved terms with synonyms if glossary defines exact form.
2626
- Keep product naming consistent with glossary and product wording rules.
27-
- Module name must be used exactly as defined in `module.yaml.name` (canonical lowercase Kebab Case).
27+
- Deckhouse Module name must be canonical lowercase Kebab Case.
2828
- Do not humanize or reformat module name in prose:
2929
- use `stronghold`, not `Stronghold`;
3030
- use `volume-data-manager`, not `Volume Data Manager`.
@@ -34,7 +34,6 @@ alwaysApply: true
3434
# Inline Code Scope
3535

3636
- Do not wrap values inside YAML files in backticks — YAML values are already code context.
37-
For example, the `name` field in `module.yaml` must contain the plain module name, not `` `module-name` ``.
3837
- The same applies to other YAML fields: `enum` values, `default` values, etc.
3938

4039
# Language Consistency
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: run-website
3-
description: Runs the documentation website locally via `Makefile` and werf. Use when the user wants to run the docs, preview the documentation site, start the docs server, or open the documentation website locally.
3+
description: Runs the documentation website locally via `Makefile`. Use when the user wants to run the docs, preview the documentation site, start the docs server, or open the documentation website locally.
44
---
55

66
# Run Documentation Website
@@ -13,18 +13,22 @@ description: Runs the documentation website locally via `Makefile` and werf. Use
1313
```
1414

1515
3. **Open** in a browser:
16-
- for the English version — http://localhost/products/kubernetes-platform/documentation/v1/
17-
- for the Russian version — http://ru.localhost/products/kubernetes-platform/documentation/v1/
16+
- EN: http://localhost/products/development-platform/documentation/
17+
- RU: http://ru.localhost/products/development-platform/documentation/
1818

19-
4. **Stop** when done:
19+
1. **Stop** when done:
2020
```bash
2121
make down
2222
```
2323

24-
## Other targets (from docs/site/)
24+
## All targets
2525

26-
| Target | Use case |
27-
|--------|-----------------------------------------------------------------------------|
28-
| `make up` | Start docs in watch mode that rebuilds on commit |
29-
| `make lint-markdown-fix` | Run markdown linter and fix some problems automatically |
30-
| `make down` | Stop containers, remove networks, and stop the local registry |
26+
| Target | Use case |
27+
|--------|---------|
28+
| `make up` | Start docs via Docker Compose |
29+
| `make down` | Stop and remove containers (`docker compose down --remove-orphans`) |
30+
| `make serve` | Start Hugo dev server locally without Docker (`hugo serve`) |
31+
| `make build` | Build the site to `./public` |
32+
| `make lint-markdown` | Lint Markdown files |
33+
| `make lint-markdown-fix` | Lint and auto-fix Markdown files |
34+
| `make mod` | Clean up Hugo modules (`hugo mod tidy`) |

CLAUDE.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# CLAUDE.md for Deckhouse Development Platform
2+
3+
This repository contains Hugo-based documentation for the Deckhouse Development Platform.
4+
5+
## Run the docs site locally
6+
7+
```bash
8+
make up # start via Docker Compose
9+
make down # stop and remove containers
10+
```
11+
12+
- EN: <http://localhost/products/development-platform/documentation/>
13+
- RU: <http://ru.localhost/products/development-platform/documentation/>
14+
15+
All targets:
16+
17+
| Target | Purpose |
18+
|--------|---------|
19+
| `make up` | Start docs via Docker Compose |
20+
| `make down` | Stop and remove containers |
21+
| `make serve` | Start Hugo dev server locally without Docker |
22+
| `make build` | Build the site to `./public` |
23+
| `make lint-markdown` | Lint Markdown files |
24+
| `make lint-markdown-fix` | Lint and auto-fix Markdown files |
25+
| `make mod` | Clean up Hugo modules (`hugo mod tidy`) |
26+
27+
## Editorial policy
28+
29+
The normative style guide and glossary are at **<https://pp.flant.ru/llms.txt>**.
30+
Fetch it before writing or reviewing documentation.
31+
32+
## Documentation style
33+
34+
- Write concise technical text with clear user value.
35+
- No first-level headings (`#`) in documentation files. Minimum level is `##`.
36+
- Prefer short paragraphs and structured lists.
37+
- For emphasis, use **bold**; avoid unnecessary italic.
38+
- Keep instructions actionable and testable.
39+
- In command examples use `d8 k` instead of `kubectl`.
40+
- YAML snippets must be syntactically valid.
41+
- Markdown ordered lists: use `1.` for every item (not `1.`, `2.`, `3.`).
42+
43+
### Inline code
44+
45+
Use inline code for: parameters, module names, commands, file paths, HTTP codes.
46+
Do not overuse it for resource type names in narrative text.
47+
Do not wrap values inside YAML files in backticks — YAML values are already code context.
48+
49+
### Links
50+
51+
- Use meaningful link anchors (avoid "here" or "тут").
52+
- Links to project pages must be relative.
53+
- Links to Deckhouse Kubernetes Platform docs must be absolute without domain (`/products/kubernetes-platform/documentation/v1/...`).
54+
55+
### Code blocks
56+
57+
Every fenced code block must have an explicit language tag from the Hugo/Chroma list.
58+
If the needed language is absent, use `text` or `plain`.
59+
60+
Common tags: `bash`, `yaml`, `json`, `go`, `go-html-template`, `text`, `plain`.
61+
Full list: see `.cursor/rules/docs/hugo-supported-codeblock-languages.mdc`.
62+
63+
### Hugo shortcodes
64+
65+
```go-html-template
66+
{{< alert level="warning" >}}
67+
Message text.
68+
{{< /alert >}}
69+
```
70+
71+
Alert levels: `info`, `warning`, `danger`.
72+
73+
```go-html-template
74+
{{< tabs name="uniq_name" >}}
75+
{{% tab name="Tab 1" %}}Content{{% /tab %}}
76+
{{% tab name="Tab 2" %}}Content{{% /tab %}}
77+
{{< /tabs >}}
78+
```
79+
80+
```go-html-template
81+
{{% details "Summary..." %}}
82+
Markdown content.
83+
{{% /details %}}
84+
```
85+
86+
### Release notes (`content/documentation/release-notes/`)
87+
88+
- Under a heading, if the only body content is a single bullet — write plain prose, not a list.
89+
- Keep lists only when there are two or more top-level bullets under the same heading.
90+
91+
## Terminology
92+
93+
Full glossary: <https://pp.flant.ru/llms.txt> (see "Glossary" section).
94+
95+
Key rules:
96+
- `K8s` (uppercase K)
97+
- Use "узел", not "нода"
98+
- Use "веб-интерфейс"
99+
- Use `IP-адрес`
100+
- Use "файлы cookie"
101+
- Avoid "платформа Deckhouse"; use explicit product names (e.g. Deckhouse Kubernetes Platform)
102+
- Deckhouse module names must be in lowercase kebab-case.
103+
- Do not translate product names and abbreviations that the glossary keeps in EN (e.g. `RBAC`)
104+
105+
Mixed EN/RU compound terms use a hyphen: `S3-бакет`, `managed-сервис`, `master-узел`, `HTTP-протокол`.
106+
107+
## Russian text style
108+
109+
In Russian instructional text, always use the imperative вы-form:
110+
- «создайте», not «создаем»
111+
- «нажмите», not «нажимаем»
112+
- «перейдите», not «переходим»
113+
114+
This applies to all step-by-step instructions, quickstart guides, and procedural text.
115+
116+
## Front matter
117+
118+
Required fields: `title`, `description` (concise, unique, not a copy of title).
119+
120+
- Related links: use `params.relatedLinks` in front matter; do not add manual "Related links" sections in the Markdown body.
121+
122+
## EN/RU parity
123+
124+
- Russian files use the `.ru.md` suffix only (not `.RU.md`, `_RU.md`).
125+
- For each change relevant to both languages, update both files.
126+
- Do not leave EN/RU pairs semantically diverged unless the change is intentionally language-specific.
127+
- Localized media: `image1.jpg` (EN) / `image1.ru.jpg` (RU).

0 commit comments

Comments
 (0)