Skip to content

YNU-829: Add Repository Documentation Guidelines#617

Open
dimast-x wants to merge 1 commit intomainfrom
feat/docs-guidelines
Open

YNU-829: Add Repository Documentation Guidelines#617
dimast-x wants to merge 1 commit intomainfrom
feat/docs-guidelines

Conversation

@dimast-x
Copy link
Contributor

@dimast-x dimast-x commented Mar 9, 2026

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation guide establishing standards and structure for repository documentation across four domains: Protocol, System Architecture, Build, and Operator. Includes terminology management, directory layout specifications, and formatting guidelines for consistent documentation practices.

Co-authored-by: Anton Filonenko <philanton@users.noreply.github.com>
@dimast-x dimast-x changed the title YNU-829: Add Documentation Guidelines YNU-829: Add Repository Documentation Guidelines Mar 9, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

📝 Walkthrough

Walkthrough

A new documentation guide file has been added establishing standardized documentation practices for the repository. It defines structure, terminology management, content requirements, and formatting rules across protocol, system architecture, build, and operator documentation domains.

Changes

Cohort / File(s) Summary
Documentation Standards
docs/guide.md
New comprehensive documentation guide establishing standards for repository documentation, including directory structure, terminology management, protocol and architecture documentation requirements, and formatting conventions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • philanton
  • nksazonov

Poem

🐰 Hop, hop, hooray! The docs now gleam so bright,
With standards set and structure tight,
A guide to keep our words aligned,
One source of truth, one organized mind!
Let clarity and order reign—
The perfect prose will now sustain! 📚✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'YNU-829: Add Repository Documentation Guidelines' clearly summarizes the main change—introducing documentation guidelines for the repository. This matches the actual changeset which adds a new docs/guide.md file defining documentation standards and structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/docs-guidelines

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (9)
docs/guide.md (9)

240-250: Fix heading hierarchy for proper document structure.

Lines 240 and 247 use h3 (###) headings directly under an h1 (#) heading, violating the incremental heading hierarchy. Headings should increment by one level at a time (h1 → h2 → h3). This affects both document structure and navigation.

🔧 Proposed fix for heading levels
-### Protocol answers
+## Protocol answers
 

What are the rules of the system?


-### Architecture answers
+## Architecture answers

How does Nitrolite implement those rules?

</details>

As per coding guidelines, markdownlint rule MD001 requires heading levels to increment by one level at a time.

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/guide.md around lines 240 - 250, The headings "Protocol answers" and
"Architecture answers" are using h3 (###) directly under the document's h1 which
violates incremental heading hierarchy; update those headings to h2 (##) so they
increment properly (h1 → h2 → h3) — specifically change the "Protocol answers"
and "Architecture answers" headings from ### to ## to satisfy markdownlint MD001
and restore correct document structure.


</details>

---

`393-403`: **Fix heading hierarchy for writing requirements.**

Lines 393, 397, and 401 use h3 (`###`) headings directly under an h1 (`#`) heading, violating the incremental heading hierarchy rule. This is particularly important in a section defining writing requirements, as the document should exemplify the standards it prescribes.



<details>
<summary>🔧 Proposed fix for heading levels</summary>

```diff
-### Use precise terminology
+## Use precise terminology
 
 Always use defined protocol terms.
 
-### Avoid ambiguity
+## Avoid ambiguity
 
 Explain behaviour explicitly.
 
-### Avoid implementation leakage in protocol docs
+## Avoid implementation leakage in protocol docs
 
 Protocol documentation must not reference code.

As per coding guidelines, markdownlint rule MD001 requires heading levels to increment by one level at a time.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/guide.md` around lines 393 - 403, The three headings "Use precise
terminology", "Avoid ambiguity", and "Avoid implementation leakage in protocol
docs" are using h3 (###) directly under an h1 and should be incremented one
level; change those headings to h2 (##) so the hierarchy increments properly
(e.g., adjust the headings for the functions/sections titled "Use precise
terminology", "Avoid ambiguity", and "Avoid implementation leakage in protocol
docs" from ### to ##).

93-95: Add language specifiers to fenced code blocks.

Multiple fenced code blocks throughout the protocol documentation sections are missing language specifications, flagged by markdownlint (MD040). Adding appropriate specifiers improves rendering consistency.

🔧 Proposed fixes for multiple blocks

For the path specification at lines 93-95:

-```
+```text
 docs/protocol/terminology.md

For the terminology example at lines 118-133:
```diff
-```
+```markdown
 ## Channel
 
 Definition  

For paths at lines 147-149:

-```
+```text
 docs/protocol/

For the file list at lines 153-158:
```diff
-```
+```text
 overview.md
 terminology.md

As per coding guidelines, markdownlint rule MD040 recommends specifying a language for all fenced code blocks.

Also applies to: 118-133, 147-158

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/guide.md` around lines 93 - 95, Several fenced code blocks in the
protocol docs lack language specifiers (MD040); update each fenced block
referenced—specifically the block containing "docs/protocol/terminology.md", the
block that begins with "## Channel" (terminology example), the block containing
"docs/protocol/", and the block listing "overview.md" / "terminology.md"—by
adding appropriate language specifiers (e.g., use ```text for file/path listings
and ```markdown for markdown fragments) so markdownlint passes and rendering is
consistent.

347-359: Add language specifiers to template code blocks.

The template examples for README and Overview documents are missing language specifications, flagged by markdownlint (MD040). Since these are markdown templates, specifying markdown would be most appropriate.

🔧 Proposed fixes

For README template at lines 347-359:

-```
+```markdown
 # Project Name
 
 Short description of the project.

For Overview template at lines 367-385:

-```
+```markdown
 # Overview
 
 ## Purpose

As per coding guidelines, markdownlint rule MD040 recommends specifying a language for all fenced code blocks.

Also applies to: 367-385

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/guide.md` around lines 347 - 359, Update the fenced code blocks in the
markdown templates so they include the language specifier "markdown": modify the
code block that begins with "# Project Name" (the README template) and the one
that begins with "# Overview" (the Overview template) to use triple backticks
followed by "markdown" (```markdown) to satisfy MD040; ensure any other fenced
blocks in the same sections (lines around those headings) are updated similarly.

287-296: Fix list structure and numbering.

The numbered list structure is inconsistent. Item "1." at line 287 is followed by items "2." and "3." at lines 294-295, but they appear to be at the same level rather than being part of a continuous numbered list. This creates ambiguity about the document structure.

📋 Proposed fix for list structure

Either format as a continuous numbered list:

+Recommended content structure:
+
 1. **app.md** must cover:
 
 * how to register an app
 * app session lifecycle
 * concept of daily allowances
 * app session keys
 
 2. **develop.md** must list SDK methods necessary for app development.
+
 3. **examples.md** must show real-world use case examples of application flows built with the SDK. Starting with simplest examples and gradually increasing complexity.

Or if these are separate sections, use h2/h3 headings instead of numbers:

-1. **app.md** must cover:
+## app.md
+
+This document must cover:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/guide.md` around lines 287 - 296, The numbered list in docs/guide.md is
malformed: the block starting with "1. **app.md** must cover:" and the
subsequent "2." and "3." entries are inconsistent; fix by making it a single
continuous numbered list (ensure "1.", "2.", "3." are at the same indentation
level and each list item contains the subbullets for app.md) or convert each
top-level item into a proper section heading (e.g., "## app.md", "##
develop.md", "## examples.md") and move the subpoints (how to register an app,
app session lifecycle, concept of daily allowances, app session keys) under the
app.md section; update list/heading formatting so app.md, develop.md, and
examples.md are clearly distinct items and rendering is consistent.

74-81: Add language specifier to fenced code block.

The markdownlint tool flags this code block for missing a language specification. While the directory structure renders fine without it, adding a language identifier improves consistency and explicit rendering behavior.

🔧 Proposed fix
-```
+```text
 docs/
 
 protocol/

As per coding guidelines, markdownlint rule MD040 recommends specifying a language for all fenced code blocks.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/guide.md` around lines 74 - 81, The fenced code block containing the
directory list (the triple backticks surrounding the lines "docs/", "protocol/",
"architecture/", "build/", "operator/") is missing a language specifier; update
the opening fence from ``` to ```text so the block becomes a text‑fenced code
block and satisfies markdownlint MD040 (i.e., change the initial ``` to ```text
for the directory listing code fence).

29-35: Consider shortening the table entry for consistency.

The entry "Build Apps on Yellow Network" in the table is notably longer than the other entries ("Protocol definitions", "System architecture", "Operator instructions"). For consistency and scannability, consider shortening to "Build documentation" or "Build guides" to match the concise style of other entries.

📝 Proposed change for consistency
 | Information           | Canonical location             |
 | --------------------- | ------------------------------ |
 | Protocol definitions  | `docs/protocol/terminology.md` |
 | System architecture   | `docs/architecture/`           |
-| Build Apps on Yellow Network          | `docs/build/`                  |
+| Build documentation   | `docs/build/`                  |
 | Operator instructions | `docs/operator/`               |
 | Code behaviour        | Go code comments               |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/guide.md` around lines 29 - 35, Replace the long table cell text "Build
Apps on Yellow Network" in the Markdown table headed by "Information | Canonical
location" with a shorter, consistent label such as "Build documentation" or
"Build guides" (update the row where that phrase appears) so the entry matches
the concise style of the other items like "Protocol definitions" and "System
architecture".

272-283: Add language specifiers to fenced code blocks.

Code blocks in the Build and Operator sections are missing language specifications, flagged by markdownlint (MD040).

🔧 Proposed fixes

For paths at lines 272-274:

-```
+```text
 docs/build/

For file lists at lines 278-283:
```diff
-```
+```text
 overview.md
 app.md

For paths at lines 306-308:

-```
+```text
 docs/operator/

For file lists at lines 312-317:
```diff
-```
+```text
 running-node.md
 configuration.md

As per coding guidelines, markdownlint rule MD040 recommends specifying a language for all fenced code blocks.

Also applies to: 306-317

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/guide.md` around lines 272 - 283, Add explicit language specifiers
(e.g., "text") to the fenced code blocks that list paths and file names so
markdownlint MD040 is satisfied; update the fenced blocks containing
"docs/build/", the file lists that include "overview.md", "app.md",
"develop.md", "examples.md", the block containing "docs/operator/", and the file
lists with "running-node.md" and "configuration.md" to use a language tag (for
example changing ``` to ```text) while preserving the exact contents of those
blocks.

201-213: Add language specifiers to fenced code blocks.

Several code blocks in the architecture section are missing language specifications, flagged by markdownlint (MD040).

🔧 Proposed fixes

For the path at lines 201-203:

-```
+```text
 docs/architecture/

For the file list at lines 207-213:
```diff
-```
+```text
 system-overview.md
 node-architecture.md

For the question blocks at lines 242-244 and 248-250:

-```
+```text
 What are the rules of the system?

```diff
-```
+```text
 How does Nitrolite implement those rules?
</details>

As per coding guidelines, markdownlint rule MD040 recommends specifying a language for all fenced code blocks.



Also applies to: 242-244, 248-250

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/guide.md around lines 201 - 213, Add explicit language specifiers (use
"text") to the fenced code blocks that currently have no language: the block
containing "docs/architecture/", the block listing "system-overview.md",
"node-architecture.md", "storage.md", "networking.md", "security.md", and the
question blocks containing "What are the rules of the system?" and "How does
Nitrolite implement those rules?"; update each opening totext so
markdownlint MD040 is satisfied.


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @docs/guide.md:

  • Around line 240-250: The headings "Protocol answers" and "Architecture
    answers" are using h3 (###) directly under the document's h1 which violates
    incremental heading hierarchy; update those headings to h2 (##) so they
    increment properly (h1 → h2 → h3) — specifically change the "Protocol answers"
    and "Architecture answers" headings from ### to ## to satisfy markdownlint MD001
    and restore correct document structure.
  • Around line 393-403: The three headings "Use precise terminology", "Avoid
    ambiguity", and "Avoid implementation leakage in protocol docs" are using h3
    (###) directly under an h1 and should be incremented one level; change those
    headings to h2 (##) so the hierarchy increments properly (e.g., adjust the
    headings for the functions/sections titled "Use precise terminology", "Avoid
    ambiguity", and "Avoid implementation leakage in protocol docs" from ### to ##).
  • Around line 93-95: Several fenced code blocks in the protocol docs lack
    language specifiers (MD040); update each fenced block referenced—specifically
    the block containing "docs/protocol/terminology.md", the block that begins with
    "## Channel" (terminology example), the block containing "docs/protocol/", and
    the block listing "overview.md" / "terminology.md"—by adding appropriate
    language specifiers (e.g., use text for file/path listings and markdown
    for markdown fragments) so markdownlint passes and rendering is consistent.
  • Around line 347-359: Update the fenced code blocks in the markdown templates
    so they include the language specifier "markdown": modify the code block that
    begins with "# Project Name" (the README template) and the one that begins with
    "# Overview" (the Overview template) to use triple backticks followed by
    "markdown" (```markdown) to satisfy MD040; ensure any other fenced blocks in the
    same sections (lines around those headings) are updated similarly.
  • Around line 287-296: The numbered list in docs/guide.md is malformed: the
    block starting with "1. app.md must cover:" and the subsequent "2." and "3."
    entries are inconsistent; fix by making it a single continuous numbered list
    (ensure "1.", "2.", "3." are at the same indentation level and each list item
    contains the subbullets for app.md) or convert each top-level item into a proper
    section heading (e.g., "## app.md", "## develop.md", "## examples.md") and move
    the subpoints (how to register an app, app session lifecycle, concept of daily
    allowances, app session keys) under the app.md section; update list/heading
    formatting so app.md, develop.md, and examples.md are clearly distinct items and
    rendering is consistent.
  • Around line 74-81: The fenced code block containing the directory list (the
    triple backticks surrounding the lines "docs/", "protocol/", "architecture/",
    "build/", "operator/") is missing a language specifier; update the opening fence
    from totext so the block becomes a text‑fenced code block and satisfies
    markdownlint MD040 (i.e., change the initial totext for the directory
    listing code fence).
  • Around line 29-35: Replace the long table cell text "Build Apps on Yellow
    Network" in the Markdown table headed by "Information | Canonical location" with
    a shorter, consistent label such as "Build documentation" or "Build guides"
    (update the row where that phrase appears) so the entry matches the concise
    style of the other items like "Protocol definitions" and "System architecture".
  • Around line 272-283: Add explicit language specifiers (e.g., "text") to the
    fenced code blocks that list paths and file names so markdownlint MD040 is
    satisfied; update the fenced blocks containing "docs/build/", the file lists
    that include "overview.md", "app.md", "develop.md", "examples.md", the block
    containing "docs/operator/", and the file lists with "running-node.md" and
    "configuration.md" to use a language tag (for example changing totext)
    while preserving the exact contents of those blocks.
  • Around line 201-213: Add explicit language specifiers (use "text") to the
    fenced code blocks that currently have no language: the block containing
    "docs/architecture/", the block listing "system-overview.md",
    "node-architecture.md", "storage.md", "networking.md", "security.md", and the
    question blocks containing "What are the rules of the system?" and "How does
    Nitrolite implement those rules?"; update each opening totext so
    markdownlint MD040 is satisfied.

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: defaults

**Review profile**: CHILL

**Plan**: Pro

**Run ID**: `41dde8c9-33ec-40b1-b3d7-9265af0004fc`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 668ab4981dfc70c0e11f284f1ce00eec11d3b2c1 and 66c323ec851db4930ad01a780198a4bfb7742bbb.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `docs/guide.md`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Copy link
Contributor

@nksazonov nksazonov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, a great PR! Some nitpicks, as always 😉

@@ -0,0 +1,403 @@
# Nitrolite Documentation Guide

This document defines **how documentation should be written and structured** inside the Nitrolite repositories.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you specify "repositories" (plural), but the first point in purposes specifies "repository" (singular). This creates a confusion.

* avoids duplication
* focuses on the most important information first

This guide must be followed when writing any documentation for the Nitrolite project.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have never heard a "Nitrolite project" term. We should agree on something in between "Nitrolite protocol implementation", "Nitrolite protocol"...


1. Protocol
2. System Architecture
3. Build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Build
3. Build (as in "build your applications on Yellow Network")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And generally, it would be good to clarify in a sentence what each domain is about (even considering there are whole sections about them later)

Comment on lines +74 to +81
```
docs/

protocol/
architecture/
build/
operator/
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 4 domains directories were intended to be inside docs/, however here it is not the case.


Protocol documentation must remain **implementation-independent**.

Architecture documentation describes **Nitrolite specifically**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't "Nitrolite" a name of the protocol, whereas "Clearnode" / "Clearnet" - the name of the implementation?


---

# 7. Build Apps on Yellow Network Documentation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 7. Build Apps on Yellow Network Documentation
# 7. "Build Apps on Yellow Network" Documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants