tirtc-device-builder 0.11.4 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tirtc-device-builder",
3
- "version": "0.11.4",
4
- "description": "Codex workflows for building and validating TiRTC device firmware across supported chip platforms.",
3
+ "version": "0.11.6",
4
+ "description": "Codex workflows for building, validating, and documenting TiRTC device firmware across supported chip platforms.",
5
5
  "author": {
6
6
  "name": "TangeAI",
7
7
  "url": "https://github.com/tangeai"
@@ -34,7 +34,8 @@
34
34
  "Analyze my ESP32 board and generate a TiRTC project.",
35
35
  "Probe my BK7258 or BK7259 board and assess XiaoTai capabilities.",
36
36
  "Check ESP-IDF and build my TiRTC ESP32 firmware.",
37
- "Assess whether this board can support H5 live view and AI intercom."
37
+ "Assess whether this board can support H5 live view and AI intercom.",
38
+ "Create a user-facing documentation system for my multi-board TiRTC project."
38
39
  ]
39
40
  }
40
41
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  This project follows Semantic Versioning.
4
4
 
5
+ ## 0.11.6
6
+
7
+ - Add field-log triage gates for Beken HTTP business failures, generation-bound
8
+ remote closes, AI tail-audio ordering, worker exit versus processor faults,
9
+ FT6336 input faults, room-leave evidence and contact-shortcut intent.
10
+ - Improve the project-documentation Skill with reader-task section ordering and
11
+ small, decision-focused diagram guidance.
12
+
13
+ ## 0.11.5
14
+
15
+ - Add the `tirtc-project-docs` Skill for designing and reviewing public
16
+ documentation in multi-board TiRTC and XiaoTai repositories.
17
+ - Define stable roles for quick-start, architecture, contribution, board and
18
+ media documents, with evidence grading and approval-first bilingual output.
19
+ - Add `install docs` support and package tests for installing the documentation
20
+ Skill across supported Agent clients.
21
+
5
22
  ## 0.11.4
6
23
 
7
24
  - Add artifact-bound BK7258 H5, AI and WeChat VoIP media lessons: directional
package/README.md CHANGED
@@ -2,12 +2,13 @@
2
2
 
3
3
  TiRTC Device Builder 用于把 ESP32-S3/ESP32-P4 和 BK7258/BK7259 开发板接入 TiRTC。输入可以只有开发板型号,也可以包含原理图、BSP、引脚表和外设示例。安装后的 Agent Skill 会先检查环境、整理有依据的硬件事实,再生成或移植独立工程并完成板级适配和编译。烧录和实机验证只有在开发者明确给出目标串口并授权后才会执行。
4
4
 
5
- 当前仓库提供两个平台 Skill:
5
+ 当前仓库提供两个平台 Skill 和一个项目文档 Skill:
6
6
 
7
7
  | Skill | 平台 | 主要用途 |
8
8
  |---|---|---|
9
9
  | `tirtc-esp32-builder` | ESP32-S3 / ESP32-P4、ESP-IDF 5.5.x | 板型识别、Hardware IR、工程生成/移植、H5/AI/设备互呼/微信 VoIP、AEC 门禁、编译烧录和分层验收 |
10
10
  | `tirtc-beken-builder` | BK7258 / BK7259、Beken Armino | 运行时硬件探测、显示/触摸/音频/内存能力判定、小钛业务移植与实机验收 |
11
+ | `tirtc-project-docs` | TiRTC / 小钛多开发板项目 | 快速体验、架构、贡献、板卡、构建烧录和音视频参数文档;中文版确认后同步英文版 |
11
12
 
12
13
  BK7258 多媒体项目固定从 Beken 官方 Gitee `bk_avdk_smp` 的
13
14
  `release/v3.1.1.8` tag、commit
@@ -108,6 +109,19 @@ npx --yes tirtc-device-builder@latest doctor beken \
108
109
  其中 BK7258 的公开基准应是 `release/v3.1.1.8`、commit
109
110
  `1cfd56af09a3cb6470f35f1e0c604035ed1b6ee7`。
110
111
 
112
+ #### 项目文档
113
+
114
+ 需要建立、检查或维护 TiRTC/小钛项目文档时,安装
115
+ `tirtc-project-docs`:
116
+
117
+ ```bash
118
+ npx --yes tirtc-device-builder@latest install docs
119
+ ```
120
+
121
+ 该 Skill 会先按仓库事实整理中文版,检查根文档导航、板卡目录、构建烧录说明、
122
+ 媒体参数和证据等级。只有中文版确认通过后,才同步生成英文版。它不会把日期型排障
123
+ 记录或迁移历史混入对外使用手册。
124
+
111
125
  ### 3. 重新打开 Agent 客户端
112
126
 
113
127
  Skill 通常在 Agent 会话启动时被发现。安装完成后,关闭当前会话,再打开一个新会话。
@@ -48,6 +48,14 @@ const PLATFORMS = new Map([
48
48
  summary: "BK7258 / BK7259 / Beken Armino",
49
49
  },
50
50
  ],
51
+ [
52
+ "docs",
53
+ {
54
+ aliases: new Set(["docs", "documentation", "tirtc-project-docs"]),
55
+ skill: "tirtc-project-docs",
56
+ summary: "TiRTC / XiaoTai project documentation",
57
+ },
58
+ ],
51
59
  ]);
52
60
 
53
61
  function printHelp() {
@@ -56,19 +64,21 @@ function printHelp() {
56
64
  Usage:
57
65
  tirtc-device-builder list
58
66
  tirtc-device-builder clients
59
- tirtc-device-builder install <platform> [--client <name>] [--skills-dir <path>] [--force]
67
+ tirtc-device-builder install <target> [--client <name>] [--skills-dir <path>] [--force]
60
68
  tirtc-device-builder setup <platform> [setup options]
61
69
  tirtc-device-builder doctor <platform> [doctor options]
62
70
  tirtc-device-builder boards <platform> <list|validate|match|init-identity|candidate> [options]
63
71
  tirtc-device-builder --version
64
72
 
65
- Platforms:
73
+ Install targets:
66
74
  esp32 ESP32-S3 / ESP-IDF 5.5.x
67
75
  beken BK7258 / BK7259 / Beken Armino
76
+ docs TiRTC / XiaoTai project documentation
68
77
 
69
78
  Examples:
70
79
  npx tirtc-device-builder install esp32
71
80
  npx tirtc-device-builder install beken
81
+ npx tirtc-device-builder install docs
72
82
  npx tirtc-device-builder install esp32 --client qwen-code
73
83
  npx tirtc-device-builder setup esp32
74
84
  npx tirtc-device-builder setup esp32 --install --client gemini
@@ -274,9 +284,15 @@ function main(args) {
274
284
  }
275
285
 
276
286
  if (command === "doctor") {
287
+ if (platform.name === "docs") {
288
+ return fail("doctor is not available for target: docs");
289
+ }
277
290
  return runDoctor(platform, rest);
278
291
  }
279
292
  if (command === "boards") {
293
+ if (platform.name === "docs") {
294
+ return fail("boards is not available for target: docs");
295
+ }
280
296
  return runBoardRegistry(platform, rest);
281
297
  }
282
298
  if (command === "setup") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tirtc-device-builder",
3
- "version": "0.11.4",
3
+ "version": "0.11.6",
4
4
  "description": "Install and run TiRTC device-development Agent Skills across popular coding clients.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1 +1 @@
1
- 0.11.4
1
+ 0.11.6
@@ -1,7 +1,7 @@
1
1
  # LCKFB BK7258 XiaoTai lessons
2
2
 
3
3
  Use this case study for BK7258 XiaoTai/TiRTC ports and reviews. It distils the
4
- failures fixed in `lckfb-bk7258-xiaotai` through source commit `05d3180`. These
4
+ failures fixed in `lckfb-bk7258-xiaotai` through source commit `6ec080f`. These
5
5
  are gates, not a generic board profile: retain the decisions, but use the exact
6
6
  numbers only when the target matches the identity below.
7
7
 
@@ -199,3 +199,36 @@ state transitions but not complete network inputs or responses.
199
199
  Contract tests must keep those full-payload format strings behind `BK_LOGD` or
200
200
  an equivalent DEBUG guard and reject them at INFO/WARN/ERROR. Treat DEBUG logs as
201
201
  sensitive development artifacts and keep them out of source control.
202
+
203
+ ## Field-log triage gate
204
+
205
+ Reconstruct a failure by monotonic device time and session generation. Terminal
206
+ receive timestamps can batch output and do not establish firmware ordering.
207
+ Separate these layers before changing code:
208
+
209
+ - transport success from business success: HTTP 200 can still carry a rejected
210
+ business code such as an offline target;
211
+ - semantic completion from connection closure: TiRTC `-40008` is normal only
212
+ for the same generation after an explicit hangup or `end_session`; otherwise
213
+ retain it as an error;
214
+ - locally buffered AI tail from unsent platform audio: after `end_session`, gate
215
+ uplink and drain queued playback before teardown. If the platform closes in
216
+ less than one negotiated audio-frame interval, firmware cannot recover audio
217
+ that never arrived. Require the platform to send the complete final utterance
218
+ before the end command and transport close;
219
+ - worker cleanup text from a processor crash: an SDK thread-exit warning alone
220
+ is not reboot evidence. Require a Fault/watchdog record or a new boot sequence;
221
+ - touch-controller I/O failures from media faults: diagnose FT6336 read errors,
222
+ invalid touch IDs and missing UP events at the board adapter. Submit dangerous
223
+ tap actions once on DOWN and preserve DOWN/UP pairing for PTT.
224
+
225
+ For room exit, require all three observable results: the leave API succeeds,
226
+ local media closes, and the refreshed assignment is absent. A page transition
227
+ alone does not prove that the device left the room. For contact shortcuts,
228
+ verify the selected contact class as well as list position; a touch-home WeChat
229
+ shortcut and a physical `contacts[0]` shortcut are distinct product intents.
230
+
231
+ Lock each corrected business rule in the platform-neutral product tests and the
232
+ adapter ordering in a board contract test. Use the repository's documented
233
+ test entrypoint after locating it; do not invent a generic
234
+ `tools/run_host_tests.sh` path across projects.
@@ -1 +1 @@
1
- 0.11.4
1
+ 0.11.6
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: tirtc-project-docs
3
+ description: Design, audit, and maintain bilingual documentation systems for TiRTC or XiaoTai multi-board firmware repositories. Use for quick-start READMEs, architecture and contribution guides, board catalogs, build/flash instructions, media parameters, navigation/link checks, or Chinese-to-English synchronization; exclude code-only work and historical status logs.
4
+ ---
5
+
6
+ # TiRTC Project Documentation
7
+
8
+ Build a documentation system that lets a first-time user run the product, lets
9
+ a developer extend it, and gives an agent reliable pointers into repository
10
+ truth. Documentation describes the current product and supported workflows;
11
+ dated investigations and migration diaries belong in an ignored local history
12
+ area when the repository defines one.
13
+
14
+ ## Establish the contract
15
+
16
+ 1. Read repository guidance such as `AGENTS.md`, the existing documentation
17
+ index, glossary, documentation contract, board architecture, and build/test
18
+ entrypoints. Project rules override this Skill.
19
+ 2. Inventory existing public documents before adding files. Preserve useful
20
+ paths and repair their role when possible; do not create a parallel document
21
+ tree for the same audience.
22
+ 3. Identify the requested phase: Chinese drafting, Chinese review, English
23
+ synchronization, or audit. When the user requests Chinese approval first,
24
+ stop after the verified Chinese result. Do not create English placeholders.
25
+ 4. Map every technical claim to a source. Read
26
+ [evidence and technical claims](references/evidence.md) when the work covers
27
+ hardware, media, tools, builds, releases, or validation status.
28
+ 5. State the primary reader task for every entry document before drafting its
29
+ sections. Read [readability and diagrams](references/readability-and-diagrams.md)
30
+ for root entrypoints, long guides, workflow documents, or any proposed
31
+ visualization.
32
+
33
+ ## Select the document layer
34
+
35
+ Read [document architecture](references/document-architecture.md) when adding,
36
+ splitting, renaming, or reorganizing documents.
37
+
38
+ - Root `README.md` is the quick-experience path: identify the board, download
39
+ the matching release artifact, flash it safely, provision it, and try the
40
+ principal product flows.
41
+ - Root `ARCHITECTURE.md` explains product capabilities, module interfaces,
42
+ runtime/media flows, repository responsibilities, and secondary-development
43
+ entrypoints for both humans and agents.
44
+ - Root `CONTRIBUTING.md` explains environment setup, tests, evidence, adding a
45
+ board or platform, and the submission workflow.
46
+ - `docs/README.md` is the complete task-oriented index.
47
+ - `docs/boards/README.md` catalogs every board; each board has one independently
48
+ usable guide under `docs/boards/<board-id>/README.md`.
49
+ - Product, development, and board details stay in their subject directories.
50
+ Root documents summarize and link instead of copying those details.
51
+
52
+ Keep a compact navigation line at the top of every public root document. Every
53
+ link must resolve from that file, and all root documents must expose the same
54
+ destinations in the same order.
55
+
56
+ ## Draft from repository truth
57
+
58
+ Write the minimum information needed at the selected layer. Prefer stable
59
+ interfaces, responsibilities, commands, and decision points over source-tree
60
+ tourism. Explain an unavoidable acronym on first use. Keep one topic per
61
+ paragraph and make commands, warnings, status, and next actions easy to scan.
62
+
63
+ Order sections by the reader's next decision, not by the order in which facts
64
+ were discovered. A quick-start normally moves from board/artifact choice to
65
+ flashing, first experience, and only then source development. An architecture
66
+ guide moves from product scope to layers, runtime flows, contracts, extension,
67
+ and verification. A contribution guide moves from prerequisites to change
68
+ classification, applicable constraints, tests, and submission.
69
+
70
+ Use a diagram only when it makes a multi-step flow, hierarchy, or branching
71
+ decision materially easier to understand. Keep it small, introduce it in prose,
72
+ and retain critical constraints in nearby text. Do not repeat the same complete
73
+ sequence as both a numbered list and a diagram. Keep complex architecture out
74
+ of the quick-start README unless it is necessary to complete the first run.
75
+
76
+ Use available specialist Skills when they materially apply:
77
+
78
+ - `research` for facts that require official external sources and citations;
79
+ - `codebase-design` for module interfaces, seams, adapters, and extension paths;
80
+ - `domain-modeling` when canonical terms are missing or conflict;
81
+ - `writing-for-agents` for `AGENTS.md`, Skill instructions, and agent-facing
82
+ pointers;
83
+ - `humanizer-zh` as the final Chinese prose review after facts are stable.
84
+
85
+ Their absence must not block ordinary maintenance. Preserve the same outcomes:
86
+ primary sources, explicit interfaces, consistent terms, actionable pointers,
87
+ and natural restrained Chinese.
88
+
89
+ ## Verify before translation
90
+
91
+ Check every changed command against current scripts or `--help`, every local
92
+ link against the filesystem, every board identifier against its manifest, and
93
+ every download/flash instruction against the release artifact manifest. Run the
94
+ repository's documentation, manifest, and host-test gates. A passing structure
95
+ test does not upgrade build evidence into hardware proof.
96
+
97
+ Review the Chinese documents for facts, terminology, navigation, paragraph
98
+ shape, section order, diagram purpose, and duplicated sources of truth. Present
99
+ the Chinese result for approval when requested. Completion for this phase means
100
+ all requested Chinese documents and checks are complete, with English files
101
+ still untouched.
102
+
103
+ ## Synchronize English after approval
104
+
105
+ Read [bilingual synchronization](references/bilingual.md) only after the
106
+ Chinese source has been approved. Translate meaning rather than sentence order,
107
+ preserve commands and identifiers exactly, rebuild relative navigation for the
108
+ English files, and rerun the same checks. Record intentional locale differences
109
+ instead of silently dropping Chinese-only instructions.
110
+
111
+ ## Report the result
112
+
113
+ List the documents created or changed, the sources used for claims, checks run,
114
+ and unresolved evidence gaps. Separate missing documentation from unsupported
115
+ features. Do not present an unverified artifact, inferred pin map, or stale test
116
+ result as a current product capability.
@@ -0,0 +1 @@
1
+ 0.11.6
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "TiRTC Project Docs"
3
+ short_description: "维护 TiRTC 多开发板项目的中英文文档与证据边界"
4
+ default_prompt: "Use $tirtc-project-docs to design or audit my TiRTC project documentation, write and verify the Chinese source first, and generate English only after Chinese approval."
@@ -0,0 +1,37 @@
1
+ # Bilingual synchronization
2
+
3
+ Use this reference only after the project owner has approved the Chinese source.
4
+
5
+ ## File policy
6
+
7
+ Keep Chinese as the source language unless the repository declares another
8
+ policy. Use stable English siblings such as `README.en.md`,
9
+ `ARCHITECTURE.en.md`, and `CONTRIBUTING.en.md`. Subject documents may use the
10
+ same suffix convention or separate language trees, but one repository should
11
+ use one convention.
12
+
13
+ Add language selectors only after both targets exist. The Chinese root
14
+ navigation points to Chinese destinations; the English navigation points to
15
+ English destinations where available and to a clearly labelled Chinese page
16
+ only when no English counterpart exists.
17
+
18
+ ## Translation rules
19
+
20
+ - Preserve commands, paths, board IDs, artifact names, checksums, log fragments,
21
+ configuration keys, and protocol constants exactly.
22
+ - Use official English vendor and product names. Do not translate identifiers.
23
+ - Translate the meaning and reader task, not Chinese word order.
24
+ - Keep warnings, evidence qualifications, limitations, and follow-up items at
25
+ the same strength as the Chinese source.
26
+ - Explain acronyms on first use in each independently readable document.
27
+ - Recheck relative links because an English sibling can have different targets.
28
+
29
+ ## Drift review
30
+
31
+ Compare section coverage rather than raw line count. Every Chinese section must
32
+ have an English counterpart or a recorded locale-specific reason. Verify tables
33
+ row by row, then rerun link, manifest, documentation, and host-test gates.
34
+
35
+ Translation is complete when the English reader can perform the same supported
36
+ task and sees the same capability and evidence status as the approved Chinese
37
+ reader.
@@ -0,0 +1,58 @@
1
+ # Document architecture
2
+
3
+ Use this reference when deciding where information belongs or when a repository
4
+ has accumulated duplicate guides.
5
+
6
+ ## Entry hierarchy
7
+
8
+ The root is a small set of durable entrypoints:
9
+
10
+ | Document | Reader question | Content boundary |
11
+ | --- | --- | --- |
12
+ | `README.md` | How do I run this now? | Board choice, release download, safe flashing, provisioning, first experience |
13
+ | `ARCHITECTURE.md` | How does it work and where do I extend it? | Product flows, module interfaces, data/lifecycle paths, repository responsibilities |
14
+ | `CONTRIBUTING.md` | How do I make and verify a change? | Environment, tests, evidence, board/platform intake, submission checks |
15
+ | `docs/README.md` | Where is the complete documentation? | Task-oriented index to product, development, board, test, and reference material |
16
+
17
+ Do not turn the root README into a complete hardware manual. It may show a
18
+ compact card or table for a small set of primary boards. Each row links to the
19
+ release artifact and the board's full guide. As the catalog grows, keep only the
20
+ primary boards in the root and link the complete catalog.
21
+
22
+ ## Detail ownership
23
+
24
+ - `docs/product/` owns current user-visible behavior, interaction, protocols,
25
+ and media contracts.
26
+ - `docs/development/` owns architecture details, toolchains, builds, tests,
27
+ porting, release mechanics, and AI-assisted development.
28
+ - `docs/boards/<board-id>/` owns model-specific specifications, dependencies,
29
+ schematics, build/flash steps, first use, verification, and limitations.
30
+ - `boards/<vendor>/<board>/` owns build-participating board facts and a short
31
+ pointer README when the repository uses this layout.
32
+ - `references/` indexes external SDKs, schematics, examples, and datasheets that
33
+ are inputs rather than maintained product documentation.
34
+ - Local ignored history owns dated investigations and superseded status
35
+ snapshots. Public documents state only current behavior and current limits.
36
+
37
+ ## Root navigation
38
+
39
+ Place navigation immediately after the title or language selector. Keep it
40
+ short and identical across public root documents. A typical Chinese set is:
41
+
42
+ ```markdown
43
+ [快速体验](README.md) · [架构与二次开发](ARCHITECTURE.md) ·
44
+ [参与开发](CONTRIBUTING.md) · [完整文档](docs/README.md)
45
+ ```
46
+
47
+ Add language links only when the target files exist and have passed review.
48
+ Do not publish dead “English coming soon” links.
49
+
50
+ ## Single-source rule
51
+
52
+ Summaries may repeat a conclusion, but volatile values have one owner. Board
53
+ memory, SDK version, stream identifiers, sample rates, checksums, and build
54
+ commands should be read from manifests, contracts, lock files, release
55
+ metadata, or their designated documentation owner. Other pages link there.
56
+
57
+ When duplication is unavoidable for a quick-start step, keep the detailed page
58
+ authoritative and add a test that detects drift in the copied value.
@@ -0,0 +1,70 @@
1
+ # Evidence and technical claims
2
+
3
+ Read this reference when documentation states hardware facts, product
4
+ capabilities, media parameters, build requirements, release contents, or test
5
+ status.
6
+
7
+ ## Source order
8
+
9
+ Use the closest authoritative source:
10
+
11
+ 1. Product behavior and protocol contracts in the maintained product source or
12
+ product documentation.
13
+ 2. Board manifest for identity and build metadata.
14
+ 3. Hardware IR, schematic, probe report, or vendor primary source for wiring,
15
+ fitted devices, memory, clocks, buses, and power sequencing.
16
+ 4. Lock files, SDK manifests, compiler output, and build scripts for toolchain
17
+ and dependency versions.
18
+ 5. Release manifest and checksums for downloadable artifacts and flash layout.
19
+ 6. Artifact-bound hardware-in-the-loop evidence for runtime claims.
20
+
21
+ A board manifest is build metadata, not proof that hardware or a product flow
22
+ worked. A successful compile is not a hardware validation result. Evidence from
23
+ one printed-circuit-board revision does not automatically apply to another.
24
+
25
+ ## Board guide minimum
26
+
27
+ Each supported board guide should independently explain:
28
+
29
+ - exact public model and printed-circuit-board revision;
30
+ - processor, memory, display, touch, camera, audio, and network specifications;
31
+ - product functions and technical media parameters;
32
+ - operating system, SDK, compiler, libraries, and locked versions;
33
+ - official product page, schematic, and source identity;
34
+ - root-level build command and expected artifacts;
35
+ - safe flash method, offsets, boot mode, and protected factory data;
36
+ - provisioning, binding, and first product experience;
37
+ - verification level, artifact identity, limitations, and explicit follow-up
38
+ evidence.
39
+
40
+ Use `unknown` or a clearly scoped follow-up item when a fact lacks evidence.
41
+ Do not fill gaps from a visually similar board or another board using the same
42
+ processor.
43
+
44
+ ## Media and session details
45
+
46
+ For each H5, AI, device-call, WeChat VoIP, or room flow that the project claims,
47
+ document the applicable direction and parameters:
48
+
49
+ - stream identifiers;
50
+ - encoding, sample rate, channel count, frame duration, samples and payload
51
+ relationship;
52
+ - video format, resolution, frame rate, target bitrate, keyframe/refresh rule;
53
+ - AEC input, playback reference, processing frame, delay treatment, and modes
54
+ where AEC is required;
55
+ - ownership, readiness, stop, reconnect, and resource-release behavior.
56
+
57
+ Network packet duration and an AEC processing block are different units. State
58
+ both when software splits or aggregates them.
59
+
60
+ ## Release download and flashing
61
+
62
+ Quick-start pages link to an immutable release or a release selector that makes
63
+ board identity explicit. A release bundle should carry its board ID, version,
64
+ source revision, files, flash offsets, verification status, and SHA-256 values.
65
+ Explain the difference between complete flash images and over-the-air images.
66
+
67
+ Never infer a flash command from a filename alone. Read the bundle manifest or
68
+ the board's authoritative flash guide, and preserve calibration, credentials,
69
+ keys, and factory partitions unless the product process explicitly replaces
70
+ them.
@@ -0,0 +1,77 @@
1
+ # Readability and diagrams
2
+
3
+ Use this reference when drafting or auditing root entrypoints, long guides,
4
+ workflows, architecture explanations, or Mermaid diagrams.
5
+
6
+ ## Start from the reader task
7
+
8
+ Give each document one primary promise. The opening should tell the reader what
9
+ they can accomplish there and point elsewhere for broader detail. Arrange
10
+ sections in prerequisite order so the reader never needs information that is
11
+ introduced later.
12
+
13
+ Common sequences are guidance, not fixed templates:
14
+
15
+ - Quick experience: identify board and artifact, verify the bundle, flash it,
16
+ provision and try the product, then offer source-build and deeper links.
17
+ - Architecture: establish product scope, show layers and ownership, explain
18
+ runtime or media flows, state contracts, show extension paths, then explain
19
+ evidence and verification.
20
+ - Contribution: prepare the environment, classify the change, read the rules
21
+ that apply to that class, implement it, run proportional tests, update
22
+ documentation, and complete submission checks.
23
+
24
+ Do not preserve an existing section order merely because every individual
25
+ section is accurate. A source-download chapter placed in the middle of a binary
26
+ quick-start is still a usability defect.
27
+
28
+ ## Shape paragraphs and sections
29
+
30
+ Introduce context or a decision before commands, tables, or diagrams. Keep one
31
+ main idea per paragraph. Put the result, warning, or next step next to the action
32
+ it qualifies instead of collecting all caveats at the end.
33
+
34
+ Use headings for real reader tasks, not for every small fact. Keep heading
35
+ levels monotonic and avoid a deep hierarchy in root entrypoints. Lists are
36
+ useful for choices, requirements, and procedures; ordinary explanation should
37
+ remain prose rather than a stack of one-line bullets.
38
+
39
+ For Chinese, run a natural-language review after the facts and structure are
40
+ stable. Explain an unavoidable acronym on first use in each independently
41
+ readable document. Prefer direct verbs and concrete ownership over abstract
42
+ claims or slogan-like conclusions.
43
+
44
+ ## Decide whether a diagram helps
45
+
46
+ A diagram is useful for at least three dependent steps, three or more branches,
47
+ layer ownership, or relationships that are hard to reconstruct from prose. Use
48
+ the smallest fitting form: flowchart for sequence or decisions, hierarchy for
49
+ ownership, and table for repeated exact mappings.
50
+
51
+ Do not add a diagram for a single command, a short list, or decoration. Root
52
+ quick-start pages should normally stay linear. Architecture and contribution
53
+ guides are better candidates because their readers compare layers, lifecycle
54
+ states, or alternative extension paths.
55
+
56
+ Prefer Mermaid in Markdown repositories that render it. Place a one- or
57
+ two-sentence reading cue immediately before the diagram. Keep labels short,
58
+ define acronyms outside the diagram, and avoid colors or styling that depend on
59
+ one theme.
60
+
61
+ The diagram must not be the only home of a safety rule, command, protocol
62
+ constant, or evidence qualification. Nearby prose owns those facts. At the same
63
+ time, do not duplicate every node as a numbered list; summarize the governing
64
+ constraint and let the diagram carry the relationship.
65
+
66
+ ## Review and automate
67
+
68
+ Check heading hierarchy, prerequisite order, paragraph length, local links,
69
+ code-fence balance, and whether every diagram has an introduction and a clear
70
+ job. Render Mermaid when a renderer is already available; do not add a large
71
+ toolchain solely for a small documentation edit.
72
+
73
+ Repository tests may lock stable document roles, required destinations, and
74
+ project-specific section order. Avoid generic tests that freeze exact prose.
75
+ Tests should catch navigation drift, missing board coverage, broken links,
76
+ oversized paragraphs, duplicated volatile facts, or diagrams spreading into a
77
+ quick-start without a documented reason.