@chengzhao-dev/dsh-cpp-workflow 0.7.9 → 0.7.11

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.
Files changed (126) hide show
  1. package/README.en.md +8 -7
  2. package/README.md +5 -4
  3. package/cordis.patch.yml +2 -2
  4. package/icon.svg +5 -5
  5. package/lib/client.js +542 -538
  6. package/lib/comment-policy.js +37 -33
  7. package/lib/workspace.js +8 -10
  8. package/locale/en.json +4 -4
  9. package/locale/zh.json +4 -4
  10. package/package.json +100 -100
  11. package/skills/building-cpp/SKILL.md +5 -5
  12. package/skills/building-cpp/assets/config/.clang-tidy +4 -5
  13. package/skills/building-cpp/assets/config/.clangd +5 -7
  14. package/skills/building-cpp/assets/config/.vscode/extensions.json +5 -5
  15. package/skills/building-cpp/assets/config/.vscode/settings.json +56 -58
  16. package/skills/building-cpp/examples/environment.md +13 -102
  17. package/skills/building-cpp/references/01-build-script.md +3 -3
  18. package/skills/building-cpp/references/02-environment.md +8 -8
  19. package/skills/building-cpp/scripts/checking-environment.mjs +424 -424
  20. package/skills/building-cpp/steps/01-build.md +10 -10
  21. package/skills/building-cpp/steps/02-tooling.md +6 -6
  22. package/skills/building-cpp/steps/03-check.md +2 -2
  23. package/skills/building-cpp/steps/04-vscode.md +4 -6
  24. package/skills/developing-cpp/SKILL.md +8 -9
  25. package/skills/developing-cpp/references/comments/01-comment-rules.md +50 -26
  26. package/skills/developing-cpp/references/comments/02-style.md +33 -25
  27. package/skills/developing-cpp/references/comments/examples/03-declaration-enum.md +14 -14
  28. package/skills/developing-cpp/references/comments/examples/04-declaration-file.md +12 -8
  29. package/skills/developing-cpp/references/comments/examples/05-declaration-function.md +20 -10
  30. package/skills/developing-cpp/references/comments/examples/06-declaration-member.md +4 -4
  31. package/skills/developing-cpp/references/comments/examples/07-declaration-predicate.md +2 -2
  32. package/skills/developing-cpp/references/comments/examples/08-declaration-struct.md +6 -6
  33. package/skills/developing-cpp/references/comments/examples/09-implementation-body.md +41 -41
  34. package/skills/developing-cpp/references/comments/glossary/01-comment-terms.md +17 -16
  35. package/skills/developing-cpp/references/design/01-project-design.md +21 -10
  36. package/skills/developing-cpp/references/design/02-raii.md +5 -4
  37. package/skills/developing-cpp/references/design/03-third-party.md +2 -2
  38. package/skills/developing-cpp/references/design/examples/02-coordinate-table.md +12 -12
  39. package/skills/developing-cpp/references/design/examples/03-header-place.md +1 -1
  40. package/skills/developing-cpp/references/design/examples/04-library-boundary.md +6 -6
  41. package/skills/developing-cpp/references/design/examples/06-move-result.md +29 -28
  42. package/skills/developing-cpp/references/design/examples/07-preview-read.md +24 -23
  43. package/skills/developing-cpp/references/design/examples/08-screen-enter-exit.md +19 -18
  44. package/skills/developing-cpp/references/design/examples/09-option-menu.md +6 -6
  45. package/skills/developing-cpp/references/design/session-layer.md +13 -22
  46. package/skills/developing-cpp/references/exceptions/01-exception-rules.md +57 -57
  47. package/skills/developing-cpp/references/exceptions/examples/01-throw-boundary.md +7 -20
  48. package/skills/developing-cpp/references/exceptions/examples/02-throw-build-mode.md +10 -11
  49. package/skills/developing-cpp/references/exceptions/examples/03-throw-catch.md +4 -4
  50. package/skills/developing-cpp/references/exceptions/examples/04-throw-destructor.md +9 -5
  51. package/skills/developing-cpp/references/exceptions/examples/07-throw-when.md +2 -2
  52. package/skills/developing-cpp/references/index.md +32 -35
  53. package/skills/developing-cpp/references/language/glossary/01-language-terms.md +3 -2
  54. package/skills/developing-cpp/references/language/language-basics/02-initialization.md +1 -1
  55. package/skills/developing-cpp/references/language/language-basics/05-expressions.md +9 -2
  56. package/skills/developing-cpp/references/language/language-basics/06-functions.md +2 -3
  57. package/skills/developing-cpp/references/language/language-basics/09-templates.md +3 -3
  58. package/skills/developing-cpp/references/language/language-basics/10-language-checklist.md +9 -9
  59. package/skills/developing-cpp/references/language/performance/03-memory.md +1 -1
  60. package/skills/developing-cpp/references/language/performance/07-checklist.md +6 -6
  61. package/skills/developing-cpp/references/language/standard-library/01-containers.md +4 -5
  62. package/skills/developing-cpp/references/language/standard-library/02-access.md +2 -5
  63. package/skills/developing-cpp/references/language/standard-library/05-string.md +1 -1
  64. package/skills/developing-cpp/references/language/standard-library/06-format.md +22 -20
  65. package/skills/developing-cpp/references/language/standard-library/{11-format-ecosystem.md → 07-format-ecosystem.md} +2 -11
  66. package/skills/developing-cpp/references/language/standard-library/{07-time.md → 08-time.md} +1 -1
  67. package/skills/developing-cpp/references/language/standard-library/{09-files.md → 10-files.md} +1 -1
  68. package/skills/developing-cpp/references/language/standard-library/11-library-checklist.md +8 -0
  69. package/skills/developing-cpp/references/language/value-types/02-signed.md +7 -7
  70. package/skills/developing-cpp/references/language/value-types/03-integer-roles.md +14 -2
  71. package/skills/developing-cpp/references/language/value-types/05-strong-type.md +2 -2
  72. package/skills/developing-cpp/references/language/value-types/06-const-method.md +5 -5
  73. package/skills/developing-cpp/references/language/value-types/07-nodiscard.md +1 -1
  74. package/skills/developing-cpp/references/language/value-types/08-comparison.md +1 -1
  75. package/skills/developing-cpp/references/language/value-types/09-subscript.md +1 -1
  76. package/skills/developing-cpp/references/language/value-types/11-checklist.md +7 -7
  77. package/skills/developing-cpp/references/layout/01-source-layout.md +13 -13
  78. package/skills/developing-cpp/references/layout/02-file-template.md +10 -10
  79. package/skills/developing-cpp/references/layout/03-declaration-order.md +83 -42
  80. package/skills/developing-cpp/references/naming/01-identifier-names.md +32 -30
  81. package/skills/developing-cpp/references/naming/examples/06-naming-lower-layer.md +15 -15
  82. package/skills/developing-cpp/references/naming/examples/07-naming-multiple-return.md +2 -2
  83. package/skills/developing-cpp/references/naming/examples/13-naming-state-change.md +24 -23
  84. package/skills/developing-cpp/references/naming/glossary/01-naming-terms.md +3 -3
  85. package/skills/developing-cpp/references/naming/glossary/02-position.md +9 -9
  86. package/skills/developing-cpp/references/naming/glossary/03-selection.md +5 -1
  87. package/skills/developing-cpp/references/naming/glossary/04-square.md +3 -3
  88. package/skills/developing-cpp/references/naming/glossary/05-scoring.md +2 -2
  89. package/skills/developing-cpp/references/naming/glossary/06-difficulty.md +7 -7
  90. package/skills/developing-cpp/references/naming/glossary/07-stream.md +1 -1
  91. package/skills/developing-cpp/references/style/01-google-cpp-style.md +13 -23
  92. package/skills/developing-cpp/scripts/checking-comments.mjs +961 -755
  93. package/skills/developing-cpp/scripts/checking-declaration-order.mjs +512 -515
  94. package/skills/developing-cpp/steps/01-behavior.md +0 -1
  95. package/skills/developing-cpp/steps/02-boundary.md +2 -3
  96. package/skills/developing-cpp/steps/03-declaration.md +9 -10
  97. package/skills/developing-cpp/steps/04-implementation.md +7 -8
  98. package/skills/engineering/SKILL.md +9 -10
  99. package/skills/engineering/references/cmake/assets/LinkSettings.cmake +1 -1
  100. package/skills/engineering/references/cmake/linking/02-rpath.md +5 -6
  101. package/skills/engineering/references/cmake/modules/01-functions.md +9 -9
  102. package/skills/engineering/references/cmake/standards/01-cxx-standard.md +6 -6
  103. package/skills/engineering/references/cmake/standards/index.md +8 -29
  104. package/skills/engineering/references/cmake/targets/01-target-rules.md +14 -13
  105. package/skills/engineering/references/cmake/targets/examples/01-rpath.md +1 -1
  106. package/skills/engineering/references/cmake/testing/01-ctest.md +3 -3
  107. package/skills/engineering/references/formatting/01-encoding.md +5 -5
  108. package/skills/engineering/references/formatting/02-clang-format.md +2 -2
  109. package/skills/engineering/references/formatting/03-clang-tidy.md +5 -5
  110. package/skills/engineering/references/formatting/04-clangd.md +32 -39
  111. package/skills/engineering/references/formatting/05-config-comments.md +88 -0
  112. package/skills/engineering/references/formatting/examples/02-clang-tidy.md +6 -6
  113. package/skills/engineering/references/formatting/examples/03-clangd.md +17 -17
  114. package/skills/engineering/references/index.md +5 -4
  115. package/skills/engineering/scripts/checking-encoding.mjs +369 -369
  116. package/skills/engineering/steps/01-targets.md +3 -3
  117. package/skills/engineering/steps/02-modules.md +1 -2
  118. package/skills/engineering/steps/03-check.md +2 -3
  119. package/templates/cpp-workflow-project/SKILL.md +1 -1
  120. package/templates/cpp-workflow-project/environment.json +4 -4
  121. package/skills/developing-cpp/references/design/examples/05-library-split.md +0 -8
  122. package/skills/developing-cpp/references/language/standard-library/10-library-checklist.md +0 -10
  123. package/skills/developing-cpp/references/naming/examples/02-naming-basic.md +0 -4
  124. package/skills/developing-cpp/references/naming/examples/10-naming-rename.md +0 -6
  125. package/skills/engineering/references/formatting/examples/04-config-comments.md +0 -70
  126. /package/skills/developing-cpp/references/language/standard-library/{08-random.md → 09-random.md} +0 -0
package/README.en.md CHANGED
@@ -19,7 +19,7 @@ The exception material follows the C++ Core Guidelines' Error handling section a
19
19
  Fixed-version npm install:
20
20
 
21
21
  ```bash
22
- dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.9
22
+ dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.11
23
23
  ```
24
24
 
25
25
  This page follows each release; run `npm view @chengzhao-dev/dsh-cpp-workflow version` if you need to confirm the current version on the registry.
@@ -27,16 +27,16 @@ This page follows each release; run `npm view @chengzhao-dev/dsh-cpp-workflow ve
27
27
  GitHub tag installs use the tag with the same version number:
28
28
 
29
29
  ```bash
30
- dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.9
30
+ dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.11
31
31
  ```
32
32
 
33
33
  Replace `--profile` with the profile you actually run. The desktop app always runs the `desktop` profile, and that profile is owned by the app; if the command-line `add` is rejected, add the plugin in the app settings and use the same pinned npm version. A Git tag install uses the prebuilt `lib/` committed in the repository and runs no build on the target machine; the package has no install script that needs approval.
34
34
 
35
35
  ### Settings
36
36
 
37
- The plugin page's "C++ Workflow" card is the only entry point and manages the comment symbol and file-header tags: the symbol is `///` or `/** ... */`, `@file` is always the file name, and every file-header, type, and declaration tag is on by default except the fixed `//` body symbol; empty values are skipped. `@param` is required for every parameter; `@return` may be omitted when the condition is self-evident; `@throws` only when the function throws; `@pre`, `@post`, `@retval`, `@tparam`, `@note`, and `@see` are on by default and can be switched off individually. The preview follows the switches, saving takes effect on the next skill read, and existing sources are never rewritten. The plugin page no longer duplicates navigation.
37
+ The plugin page's "C++ Workflow" card is the only entry point. The comment symbol is `///` or `/** ... */`, and the page is split into comment symbol, file header, types, function declarations, and a read-only preview. Tag switches, the `@param` / `@return` / `@throws` requirements, when the preview applies, and navigation behavior are documented in [docs/plugin-flow.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-flow.md).
38
38
 
39
- If the page still reports that it is not connected to a configuration form after an upgrade, the window is still running the previous client bundle: restart DeepSeek Harness or select "Reload page" on the plugin page. The page does not poll or retry; restart the host or select "Reload page" while the form is read-only. Reinstalling is unnecessary. After a successful save, the status line shows the written `~/.dsh/profiles/<profile>/cordis.patch.yml`. Discard changes, Restore defaults and Save are separate: discard returns to the last value read from the host, restore fills the draft, and only Save writes it.
39
+ If the page only shows factory values after an upgrade, the window is still running the previous client bundle: restart DeepSeek Harness or select "Reload page" on the plugin page, and editing starts again; reinstalling is unnecessary. The page does not poll or retry; while the form is still read-only, restart the host or select "Reload page". After a successful save, the status line shows the written `~/.dsh/profiles/<profile>/cordis.patch.yml`. Discard changes, Restore defaults and Save are separate: discard returns to the last value read from the host, restore only fills the draft, and only Save writes it.
40
40
 
41
41
  ## Workspace gate
42
42
 
@@ -44,7 +44,7 @@ Only one condition must hold before any of the three skills appears: walking up
44
44
 
45
45
  The project skill marker is the repository's opt-in declaration. The plugin no longer requires a first-party `CMakeLists.txt` or C++ source file in the same repository: a docs-only repository, a repository that only copied the template, or a repository with no source files yet still matches; with an empty environment axis, the four source steps still work but build setup stops. Without the marker the list is empty, even when the repository contains CMake or `.cpp` files. Scan limits and boundary cases are in [docs/plugin-boundaries.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-boundaries.md).
46
46
 
47
- The packaged skills use rank 550. A project `.agents/skills` skill uses rank 200 and a user-level skill uses rank 500; both override a plugin skill with the same name, so do not copy `developing-cpp`, `engineering`, or `building-cpp` into either location.
47
+ The override order among plugin skills, project `.agents/skills`, and user-level skills is in [docs/plugin-boundaries.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-boundaries.md#覆盖关系); do not copy `developing-cpp`, `engineering`, or `building-cpp` into either location.
48
48
 
49
49
  ## Project conventions
50
50
 
@@ -93,14 +93,15 @@ Requires Node.js 22 or newer.
93
93
 
94
94
  ```bash
95
95
  npm ci
96
+ npm run check:lib # compare committed lib/ with src/, before any build
96
97
  npm test # main pre-commit gate: build, structural/encoding/workflow checks, and unit tests
97
98
  npm run test:matrix # real build matrix: 4 templates x 5 standards
98
99
  npm run pack:check # inspect the npm package contents
99
- npm run ci # local replay: install, test, package check (no matrix; the Ubuntu CI job also runs test:matrix)
100
+ npm run ci # local replay: install, check:lib, test, package check (no matrix; the Ubuntu CI job also runs test:matrix)
100
101
  npm run ci:full # ci plus the standard matrix; needs a POSIX host
101
102
  ```
102
103
 
103
- Source lives in `src/`; `npm run build` writes `lib/`. The structural check is `scripts/checking-skill-links.mjs`. Tests do not invoke a local compiler; the environment checks use fixed version strings. The standard matrix needs `cmake`, `ninja`, `perl`, and `clang++` (or the compiler named by `CXX`) on a POSIX host such as WSL, Linux, or macOS. On Windows, run `npm run ci` first, then run `npm run ci:full` from WSL inside the checkout.
104
+ Source lives in `src/`; `npm run build` writes `lib/`. The structural check is `scripts/checking-skill-links.mjs`. Tests do not invoke a local compiler; the environment checks use fixed version strings. The standard matrix needs `cmake`, `ninja`, `perl`, `node`, and `clang++` (or the compiler named by `CXX`) on a POSIX host such as WSL, Linux, or macOS. On Windows, run `npm run ci` first, then run `npm run ci:full` from WSL inside the checkout.
104
105
 
105
106
  ## License
106
107
 
package/README.md CHANGED
@@ -19,7 +19,7 @@
19
19
  npm 安装固定版本:
20
20
 
21
21
  ```bash
22
- dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.9
22
+ dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.11
23
23
  ```
24
24
 
25
25
  本页版本号随发布更新;安装前可用 `npm view @chengzhao-dev/dsh-cpp-workflow version` 确认 registry 上的最新版本。
@@ -27,7 +27,7 @@ dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.9
27
27
  GitHub 标签安装使用同一版本号的标签,地址中的版本与标签同号:
28
28
 
29
29
  ```bash
30
- dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.9
30
+ dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.11
31
31
  ```
32
32
 
33
33
  `--profile` 换成你实际运行的那个 profile。桌面应用固定跑 `desktop` profile,且该 profile 由应用独占管理;命令行 `add` 被拒绝时,在应用设置里添加插件,地址填同一个 npm 版本。Git 标签安装使用仓库内已构建的 `lib/`,不在目标机器上重新构建;包内也不含需要授权执行的安装脚本。
@@ -93,14 +93,15 @@ node "<skill-dir>/scripts/checking-environment.mjs" --project . --live
93
93
 
94
94
  ```bash
95
95
  npm ci
96
+ npm run check:lib # 比对提交的 lib/ 与 src/,必须在任何构建之前跑
96
97
  npm test # 提交前主门:构建、结构/编码/工作流检查与单元测试
97
98
  npm run test:matrix # 四套模板 × 五档标准的真实构建矩阵
98
99
  npm run pack:check # 核对 npm 包内容
99
- npm run ci # 本地复现:安装、测试、打包检查(不含标准矩阵;Ubuntu CI 另跑 test:matrix)
100
+ npm run ci # 本地复现:安装、比对 lib/、测试、打包检查(不含标准矩阵;Ubuntu CI 另跑 test:matrix)
100
101
  npm run ci:full # 在 ci 之上再跑标准矩阵,需 POSIX 宿主
101
102
  ```
102
103
 
103
- 源码在 `src/`,`npm run build` 生成 `lib/`。结构检查在 `scripts/checking-skill-links.mjs`;测试不调用本机编译器,环境检查用固定版本字符串。标准矩阵需要 POSIX 宿主上的 `cmake`、`ninja`、`perl` 和 `clang++`(或 `CXX` 指定的编译器),在 WSL/Linux/macOS 上运行。Windows 上先跑 `npm run ci`,再从 WSL 进入仓库跑 `npm run ci:full`。
104
+ 源码在 `src/`,`npm run build` 生成 `lib/`。结构检查在 `scripts/checking-skill-links.mjs`;测试不调用本机编译器,环境检查用固定版本字符串。标准矩阵需要 POSIX 宿主上的 `cmake`、`ninja`、`perl`、`node` 和 `clang++`(或 `CXX` 指定的编译器),在 WSL/Linux/macOS 上运行。Windows 上先跑 `npm run ci`,再从 WSL 进入仓库跑 `npm run ci:full`。
104
105
 
105
106
  ## 许可
106
107
 
package/cordis.patch.yml CHANGED
@@ -7,5 +7,5 @@
7
7
  # 用 `dsh plugin --profile <name> add <package>` 安装。固定到 npm 版本与 Git
8
8
  # 标签的地址写在 README 的 Install 一节。
9
9
  - insert:
10
- - id: cpp-workflow
11
- name: "@chengzhao-dev/dsh-cpp-workflow"
10
+ - id: cpp-workflow
11
+ name: "@chengzhao-dev/dsh-cpp-workflow"
package/icon.svg CHANGED
@@ -1,7 +1,7 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="C++ workflow">
2
- <rect width="64" height="64" rx="14" fill="#0d1117"/>
3
- <path d="M24 14 10 32l14 18" fill="none" stroke="#58a6ff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
4
- <path d="M40 14l14 18-14 18" fill="none" stroke="#58a6ff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
5
- <path d="M27 24l5 8-5 8M37 24l-5 8 5 8" fill="none" stroke="#f0f6fc" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
6
- <path d="M14 56h36" stroke="#3fb950" stroke-width="4" stroke-linecap="round"/>
2
+ <rect width="64" height="64" rx="14" fill="#0d1117"/>
3
+ <path d="M24 14 10 32l14 18" fill="none" stroke="#58a6ff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M40 14l14 18-14 18" fill="none" stroke="#58a6ff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M27 24l5 8-5 8M37 24l-5 8 5 8" fill="none" stroke="#f0f6fc" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M14 56h36" stroke="#3fb950" stroke-width="4" stroke-linecap="round"/>
7
7
  </svg>