@chengzhao-dev/dsh-cpp-workflow 0.6.20 → 0.7.1

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 (173) hide show
  1. package/README.en.md +10 -25
  2. package/README.md +12 -27
  3. package/cordis.patch.yml +1 -1
  4. package/lib/client.js +33 -21
  5. package/lib/comment-policy.js +15 -6
  6. package/lib/workspace.js +0 -15
  7. package/package.json +7 -7
  8. package/skills/building-cpp/SKILL.md +23 -23
  9. package/skills/building-cpp/assets/templates/projects/common/running-build.sh +5 -1
  10. package/skills/building-cpp/project/vscode/01-extensions.md +6 -0
  11. package/skills/building-cpp/project/vscode/02-settings.md +7 -1
  12. package/skills/building-cpp/references/build-script.md +10 -3
  13. package/skills/building-cpp/references/environment.md +8 -1
  14. package/skills/building-cpp/steps/01-build.md +4 -4
  15. package/skills/building-cpp/steps/02-tooling.md +10 -10
  16. package/skills/building-cpp/steps/03-check.md +13 -11
  17. package/skills/developing-cpp/SKILL.md +32 -36
  18. package/skills/developing-cpp/references/comments/comment-rules.md +181 -0
  19. package/skills/developing-cpp/references/comments/comment-style.md +80 -0
  20. package/skills/developing-cpp/{source/07-comments → references/comments}/examples/declaration-class.md +24 -2
  21. package/skills/developing-cpp/references/comments/examples/declaration-constructor.md +22 -0
  22. package/skills/developing-cpp/references/comments/examples/declaration-enum.md +48 -0
  23. package/skills/developing-cpp/{source/07-comments → references/comments}/examples/declaration-file.md +3 -3
  24. package/skills/developing-cpp/references/comments/examples/declaration-function.md +127 -0
  25. package/skills/developing-cpp/{source/07-comments → references/comments}/examples/declaration-member.md +7 -9
  26. package/skills/developing-cpp/{source/07-comments → references/comments}/examples/declaration-predicate.md +2 -1
  27. package/skills/developing-cpp/references/comments/examples/declaration-struct.md +18 -0
  28. package/skills/developing-cpp/references/comments/examples/implementation-body.md +64 -0
  29. package/skills/developing-cpp/references/comments/glossary/comment-terms.md +93 -0
  30. package/skills/developing-cpp/references/design/examples/move-result.md +39 -0
  31. package/skills/developing-cpp/{source/03-design → references/design}/examples/preview-read.md +7 -7
  32. package/skills/developing-cpp/{source/03-design/01-project-design.md → references/design/project-design.md} +57 -5
  33. package/skills/developing-cpp/{source/01-editing → references/editing}/01-edit-operations.md +4 -2
  34. package/skills/developing-cpp/{source/01-editing → references/editing}/02-rule-priority.md +2 -2
  35. package/skills/developing-cpp/{source/08-exceptions → references/exceptions}/examples/throw-build-mode.md +2 -2
  36. package/skills/developing-cpp/{source/08-exceptions → references/exceptions}/examples/throw-message.md +2 -3
  37. package/skills/developing-cpp/{source/08-exceptions/01-throw-rules.md → references/exceptions/throw-rules.md} +74 -21
  38. package/skills/developing-cpp/{source/05-language → references/language}/glossary/language-terms.md +2 -2
  39. package/skills/developing-cpp/{source/05-language/01-language-basics → references/language/language-basics}/01-objects.md +7 -1
  40. package/skills/developing-cpp/{source/05-language/01-language-basics → references/language/language-basics}/02-initialization.md +8 -1
  41. package/skills/developing-cpp/{source/05-language/01-language-basics → references/language/language-basics}/03-deduction.md +6 -0
  42. package/skills/developing-cpp/references/language/language-basics/04-const.md +25 -0
  43. package/skills/developing-cpp/references/language/language-basics/05-expressions.md +23 -0
  44. package/skills/developing-cpp/{source/05-language/01-language-basics → references/language/language-basics}/06-functions.md +7 -1
  45. package/skills/developing-cpp/{source/05-language/01-language-basics → references/language/language-basics}/07-classes.md +7 -1
  46. package/skills/developing-cpp/references/language/language-basics/08-raii.md +15 -0
  47. package/skills/developing-cpp/{source/05-language/01-language-basics → references/language/language-basics}/09-templates.md +6 -0
  48. package/skills/developing-cpp/{source/05-language/01-language-basics → references/language/language-basics}/10-checklist.md +2 -1
  49. package/skills/developing-cpp/references/language/performance/01-measure.md +22 -0
  50. package/skills/developing-cpp/{source/05-language/04-performance → references/language/performance}/02-complexity.md +6 -0
  51. package/skills/developing-cpp/{source/05-language/04-performance → references/language/performance}/03-memory.md +7 -1
  52. package/skills/developing-cpp/{source/05-language/04-performance → references/language/performance}/04-undefined-behavior.md +9 -1
  53. package/skills/developing-cpp/{source/05-language/04-performance → references/language/performance}/05-pitfalls.md +6 -0
  54. package/skills/developing-cpp/references/language/performance/06-false-optimizations.md +13 -0
  55. package/skills/developing-cpp/{source/05-language/03-standard-library → references/language/standard-library}/01-containers.md +6 -0
  56. package/skills/developing-cpp/{source/05-language/03-standard-library → references/language/standard-library}/02-access.md +7 -1
  57. package/skills/developing-cpp/{source/05-language/03-standard-library → references/language/standard-library}/03-iteration.md +6 -0
  58. package/skills/developing-cpp/{source/05-language/03-standard-library → references/language/standard-library}/04-algorithms.md +6 -0
  59. package/skills/developing-cpp/{source/05-language/03-standard-library → references/language/standard-library}/05-string.md +6 -0
  60. package/skills/developing-cpp/references/language/standard-library/06-format.md +106 -0
  61. package/skills/developing-cpp/references/language/standard-library/07-time.md +13 -0
  62. package/skills/developing-cpp/references/language/standard-library/08-random.md +13 -0
  63. package/skills/developing-cpp/references/language/standard-library/09-files.md +14 -0
  64. package/skills/developing-cpp/{source/05-language/02-value-types → references/language/value-types}/01-width.md +6 -0
  65. package/skills/developing-cpp/{source/05-language/02-value-types → references/language/value-types}/02-signed.md +7 -1
  66. package/skills/developing-cpp/references/language/value-types/03-integer-roles.md +38 -0
  67. package/skills/developing-cpp/references/language/value-types/04-enum.md +24 -0
  68. package/skills/developing-cpp/{source/05-language/02-value-types → references/language/value-types}/06-const-method.md +5 -0
  69. package/skills/developing-cpp/{source/05-language/02-value-types → references/language/value-types}/07-nodiscard.md +6 -0
  70. package/skills/developing-cpp/references/language/value-types/08-comparison.md +10 -0
  71. package/skills/developing-cpp/{source/05-language/02-value-types → references/language/value-types}/09-subscript.md +2 -1
  72. package/skills/developing-cpp/{source/05-language/02-value-types → references/language/value-types}/10-float-bool.md +6 -0
  73. package/skills/developing-cpp/{source/05-language/02-value-types → references/language/value-types}/11-checklist.md +1 -1
  74. package/skills/developing-cpp/{source/04-layout → references/layout}/01-source-layout.md +8 -2
  75. package/skills/developing-cpp/{source/04-layout → references/layout}/02-file-template.md +10 -4
  76. package/skills/developing-cpp/references/layout/03-declaration-order.md +138 -0
  77. package/skills/developing-cpp/references/naming/examples/naming-basic.md +3 -0
  78. package/skills/developing-cpp/{source/06-naming → references/naming}/examples/naming-lower-layer.md +9 -9
  79. package/skills/developing-cpp/references/naming/examples/naming-player-value.md +16 -0
  80. package/skills/developing-cpp/references/naming/examples/naming-state-change.md +57 -0
  81. package/skills/developing-cpp/{source/06-naming/01-identifier-names.md → references/naming/identifier-names.md} +34 -8
  82. package/skills/developing-cpp/{source/02-style/01-google-cpp-style.md → references/style/google-cpp-style.md} +11 -10
  83. package/skills/developing-cpp/scripts/checking-comments.mjs +71 -14
  84. package/skills/developing-cpp/scripts/checking-declaration-order.mjs +357 -0
  85. package/skills/developing-cpp/steps/01-behavior.md +5 -5
  86. package/skills/developing-cpp/steps/02-boundary.md +9 -9
  87. package/skills/developing-cpp/steps/03-declaration.md +16 -14
  88. package/skills/developing-cpp/steps/04-implementation.md +21 -17
  89. package/skills/engineering/SKILL.md +41 -38
  90. package/skills/engineering/{cmake → references/cmake}/assets/CompileSettings.cmake +2 -0
  91. package/skills/engineering/{cmake → references/cmake}/linking/01-libraries.md +6 -0
  92. package/skills/engineering/references/cmake/linking/02-rpath.md +25 -0
  93. package/skills/engineering/{cmake → references/cmake}/linking/03-undefined-reference.md +6 -0
  94. package/skills/engineering/{cmake → references/cmake}/linking/04-inspect.md +6 -0
  95. package/skills/engineering/{cmake/02-modules/01-functions.md → references/cmake/modules/functions.md} +8 -5
  96. package/skills/engineering/{cmake/03-standard/01-cxx-standard.md → references/cmake/standard/cxx-standard.md} +5 -4
  97. package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/README.md +8 -8
  98. package/skills/engineering/{cmake/01-targets → references/cmake/targets}/examples/target.md +1 -1
  99. package/skills/engineering/{cmake/01-targets/01-rules.md → references/cmake/targets/rules.md} +18 -11
  100. package/skills/engineering/{cmake → references/cmake}/testing/ctest.md +9 -2
  101. package/skills/engineering/{formatting → references/formatting}/01-encoding.md +1 -1
  102. package/skills/engineering/{formatting → references/formatting}/02-clang-format.md +6 -0
  103. package/skills/engineering/{formatting → references/formatting}/03-clang-tidy.md +7 -0
  104. package/skills/engineering/{formatting → references/formatting}/04-clangd.md +7 -0
  105. package/skills/engineering/references/formatting/examples/clang-format.md +38 -0
  106. package/skills/engineering/{formatting → references/formatting}/examples/clang-tidy.md +0 -21
  107. package/skills/engineering/{cmake/steps → steps}/01-targets.md +6 -6
  108. package/skills/engineering/{cmake/steps → steps}/02-modules.md +4 -4
  109. package/skills/engineering/{cmake/steps → steps}/03-check.md +3 -2
  110. package/skills/developing-cpp/source/03-design/examples/move-result.md +0 -39
  111. package/skills/developing-cpp/source/04-layout/03-declaration-order.md +0 -118
  112. package/skills/developing-cpp/source/05-language/01-language-basics/04-const.md +0 -15
  113. package/skills/developing-cpp/source/05-language/01-language-basics/05-expressions.md +0 -8
  114. package/skills/developing-cpp/source/05-language/01-language-basics/08-raii.md +0 -9
  115. package/skills/developing-cpp/source/05-language/02-value-types/03-integer-roles.md +0 -23
  116. package/skills/developing-cpp/source/05-language/02-value-types/04-enum.md +0 -17
  117. package/skills/developing-cpp/source/05-language/02-value-types/08-comparison.md +0 -4
  118. package/skills/developing-cpp/source/05-language/03-standard-library/06-format.md +0 -44
  119. package/skills/developing-cpp/source/05-language/03-standard-library/07-time.md +0 -3
  120. package/skills/developing-cpp/source/05-language/03-standard-library/08-random.md +0 -3
  121. package/skills/developing-cpp/source/05-language/03-standard-library/09-files.md +0 -4
  122. package/skills/developing-cpp/source/05-language/04-performance/01-measure.md +0 -15
  123. package/skills/developing-cpp/source/05-language/04-performance/06-false-optimizations.md +0 -6
  124. package/skills/developing-cpp/source/06-naming/examples/naming-basic.md +0 -3
  125. package/skills/developing-cpp/source/06-naming/examples/naming-player-mark.md +0 -17
  126. package/skills/developing-cpp/source/06-naming/examples/naming-state-change.md +0 -57
  127. package/skills/developing-cpp/source/07-comments/01-comment-rules.md +0 -239
  128. package/skills/developing-cpp/source/07-comments/examples/declaration-constructor.md +0 -22
  129. package/skills/developing-cpp/source/07-comments/examples/declaration-enum.md +0 -24
  130. package/skills/developing-cpp/source/07-comments/examples/declaration-function.md +0 -100
  131. package/skills/developing-cpp/source/07-comments/examples/declaration-struct.md +0 -18
  132. package/skills/developing-cpp/source/07-comments/examples/implementation-body.md +0 -42
  133. package/skills/developing-cpp/source/07-comments/glossary/comment-terms.md +0 -75
  134. package/skills/engineering/cmake/linking/02-rpath.md +0 -17
  135. package/skills/engineering/formatting/examples/clang-format.md +0 -17
  136. /package/skills/developing-cpp/{source/07-comments → references/comments}/examples/implementation-todo.md +0 -0
  137. /package/skills/developing-cpp/{source/03-design → references/design}/examples/behavior-sentence.md +0 -0
  138. /package/skills/developing-cpp/{source/03-design → references/design}/examples/coordinate-table.md +0 -0
  139. /package/skills/developing-cpp/{source/03-design → references/design}/examples/header-place.md +0 -0
  140. /package/skills/developing-cpp/{source/03-design → references/design}/examples/library-boundary.md +0 -0
  141. /package/skills/developing-cpp/{source/03-design → references/design}/examples/library-split.md +0 -0
  142. /package/skills/developing-cpp/{source/08-exceptions → references/exceptions}/examples/throw-boundary.md +0 -0
  143. /package/skills/developing-cpp/{source/08-exceptions → references/exceptions}/examples/throw-catch.md +0 -0
  144. /package/skills/developing-cpp/{source/08-exceptions → references/exceptions}/examples/throw-destructor.md +0 -0
  145. /package/skills/developing-cpp/{source/08-exceptions → references/exceptions}/examples/throw-format.md +0 -0
  146. /package/skills/developing-cpp/{source/08-exceptions → references/exceptions}/examples/throw-when.md +0 -0
  147. /package/skills/developing-cpp/{source/05-language/04-performance → references/language/performance}/07-checklist.md +0 -0
  148. /package/skills/developing-cpp/{source/05-language/03-standard-library → references/language/standard-library}/10-checklist.md +0 -0
  149. /package/skills/developing-cpp/{source/05-language/02-value-types → references/language/value-types}/05-strong-type.md +0 -0
  150. /package/skills/developing-cpp/{source/06-naming → references/naming}/examples/naming-accessor.md +0 -0
  151. /package/skills/developing-cpp/{source/06-naming → references/naming}/examples/naming-current-prefix.md +0 -0
  152. /package/skills/developing-cpp/{source/06-naming → references/naming}/examples/naming-lookup.md +0 -0
  153. /package/skills/developing-cpp/{source/06-naming → references/naming}/examples/naming-multiple-return.md +0 -0
  154. /package/skills/developing-cpp/{source/06-naming → references/naming}/examples/naming-predicate.md +0 -0
  155. /package/skills/developing-cpp/{source/06-naming → references/naming}/examples/naming-rename.md +0 -0
  156. /package/skills/developing-cpp/{source/06-naming → references/naming}/examples/naming-responsibility.md +0 -0
  157. /package/skills/developing-cpp/{source/06-naming → references/naming}/examples/naming-role.md +0 -0
  158. /package/skills/engineering/{cmake → references/cmake}/assets/LinkSettings.cmake +0 -0
  159. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/examples/standard.md +0 -0
  160. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/c++11/README.md +0 -0
  161. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/c++11/cmake-snippet.cmake +0 -0
  162. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/c++14/README.md +0 -0
  163. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/c++14/cmake-snippet.cmake +0 -0
  164. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/c++17/README.md +0 -0
  165. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/c++17/cmake-snippet.cmake +0 -0
  166. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/c++20/README.md +0 -0
  167. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/c++20/cmake-snippet.cmake +0 -0
  168. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/c++23/README.md +0 -0
  169. /package/skills/engineering/{cmake/03-standard → references/cmake/standard}/standards/c++23/cmake-snippet.cmake +0 -0
  170. /package/skills/engineering/{cmake/01-targets → references/cmake/targets}/examples/glob.md +0 -0
  171. /package/skills/engineering/{cmake/01-targets → references/cmake/targets}/examples/rpath.md +0 -0
  172. /package/skills/engineering/{formatting → references/formatting}/examples/clangd.md +0 -0
  173. /package/skills/engineering/{formatting → references/formatting}/scripts/checking-encoding.mjs +0 -0
package/README.en.md CHANGED
@@ -9,30 +9,30 @@ Three skills for C++11–C++23 source, CMake, and build work; new projects defau
9
9
  | Skill | Covers | Open it when |
10
10
  | --- | --- | --- |
11
11
  | `developing-cpp` | Behavior, boundaries, declarations, implementation; naming, exceptions, and source comments in `.h` / `.cpp` / `.cc` | The user names source code, or the work is a new project or whole-stage refactor |
12
- | `engineering` | Targets, modules, checks; CMakeLists.txt, `cmake/` functions and modules, target properties, C++11–C++23 standards, and `.clang-format`/`.clang-tidy`/`.clangd` configuration | The change touches CMake targets, standards, link boundaries, functions, modules, or encoding and clang tooling configuration |
13
- | `building-cpp` | Build setup, tool configuration, checks; Ninja, Clang config, build scripts, environment combinations, formatting, and static analysis | The change touches build commands, tool config, or the environment declaration, or the project is first connected to a build |
12
+ | `engineering` | Targets, modules, checks; CMakeLists.txt, `cmake/` functions and modules, target properties, C++11–C++23 standards, and configuration rules for `.clang-format`/`.clang-tidy`/`.clangd` | The change touches CMake targets, standards, link boundaries, functions, modules, or encoding and clang tooling configuration |
13
+ | `building-cpp` | Build setup, tool configuration, checks; Ninja, Clang config, build scripts, environment combinations, formatting configuration, and static analysis | The change touches build commands, tool configuration, or the environment declaration, or the project is first connected to a build |
14
14
 
15
- The exception material follows the C++ Core Guidelines' Error handling section and guides source and examples only during development; the plugin runtime never compiles or executes those rules. All three skills read the project skill `cpp-workflow-project` first. Without it, the workspace gate never exposes these names.
15
+ The exception material follows the C++ Core Guidelines' Error handling section and guides source and examples only during development; the plugin runtime never compiles or executes those rules. All three skills read the project skill `cpp-workflow-project` first. Without it, the workspace gate never lists these skills.
16
16
 
17
17
  ## Install
18
18
 
19
- Pinned npm install:
19
+ Fixed-version npm install:
20
20
 
21
21
  ```bash
22
- dsh plugin --profile web add npm:@chengzhao-dev/dsh-cpp-workflow@0.6.20
22
+ dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.1
23
23
  ```
24
24
 
25
25
  The matching Git tag:
26
26
 
27
27
  ```bash
28
- dsh plugin --profile web add github:chengzhao-dev/dsh-cpp-workflow#v0.6.20
28
+ dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.1
29
29
  ```
30
30
 
31
- The desktop app owns the `desktop` profile. 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.
31
+ 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.
32
32
 
33
33
  ### Settings
34
34
 
35
- The plugin page's "C++ Workflow" card is the only entry point and manages file-header tags only: `@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. Settings navigation no longer duplicates the form.
35
+ The plugin page's "C++ Workflow" card is the only entry point and manages file-header tags only: `@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 settings page no longer duplicates navigation.
36
36
 
37
37
  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 retries the connection while open and switches to the editable form as soon as the host serves it; reinstalling is unnecessary. 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.
38
38
 
@@ -64,7 +64,7 @@ Keep one `environment.json` per repository. Its first three environment axes are
64
64
  | `compiler` | `clang`, `gcc` | One compiler per configuration |
65
65
  | `standard` | `c++11`, `c++14`, `c++17`, `c++20`, `c++23` | New projects default to `c++23`; one standard per project |
66
66
 
67
- The standard lives in `environment.json` as `standard` and must match the CMake target and compile database; on the CMake side, prefer `engineering`'s `CompileSettings_SetCxxStandard` function. New projects default to C++23; for C++11–C++20, lower `standard`, `cxx_std_*`, `CXX_STANDARD`, and the `.clang-format` parsing level together, not one at a time. Per-standard facilities, tooling, and downgrade tables are in the [standard directory](skills/engineering/cmake/03-standard/standards/README.md); the CMake two-layer declaration is in [cxx-standard.md](skills/engineering/cmake/03-standard/01-cxx-standard.md).
67
+ The standard lives in `environment.json` as `standard` and must match the CMake target and compile database; on the CMake side, prefer `engineering`'s `CompileSettings_SetCxxStandard` function. New projects default to C++23; for C++11–C++20, lower `standard`, `cxx_std_*`, `CXX_STANDARD`, and the `.clang-format` parsing level together, not one at a time. Per-standard facilities, tooling, and downgrade tables are in the [standard directory](skills/engineering/references/cmake/standard/standards/README.md); the CMake two-layer declaration is in [cxx-standard.md](skills/engineering/references/cmake/standard/cxx-standard.md).
68
68
 
69
69
  The generator is always Ninja. Build directories are `build/clang/` and `build/gcc/`; they are never shared. Analysis tools are always `clang-format`, `clang-tidy`, and `clangd`; GCC mode does not switch to another analyzer.
70
70
 
@@ -81,22 +81,7 @@ The project root carries only `.vscode/extensions.json` and `settings.json`: cla
81
81
 
82
82
  ## Package layout
83
83
 
84
- ```text
85
- dsh-cpp-workflow/
86
- ├── lib/ # build output, shipped in the npm package
87
- ├── skills/ # developing-cpp, engineering, and building-cpp
88
- ├── templates/ # empty project template to copy
89
- ├── package.json
90
- ├── package-lock.json # repository only, used by npm ci
91
- ├── LICENSE
92
- ├── README.md
93
- ├── README.en.md
94
- ├── cordis.patch.yml # one insert row
95
- ├── locale/ # Chinese and English title/description
96
- └── icon.svg
97
- ```
98
-
99
- The repository also keeps `src/`, `scripts/`, `tests/` and `docs/` for development and review; they are not published. The whitelist lives in [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md).
84
+ The runtime closure is `lib/`, `skills/`, `templates/`, `locale/`, `cordis.patch.yml`, both READMEs, `LICENSE`, and `icon.svg`. The repository also keeps `src/`, `scripts/`, `tests/`, and `docs/` for development and review; they are not published. The authoritative whitelist and per-directory map live in [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md).
100
85
 
101
86
  Maintenance notes: flow and gate in [docs/plugin-flow.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-flow.md), skill layers and data flow in [docs/architecture.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/architecture.md), trigger matrix in [docs/triggering.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/triggering.md), directory and npm whitelist in [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md), version rules in [docs/versioning.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/versioning.md).
102
87
 
package/README.md CHANGED
@@ -2,43 +2,43 @@
2
2
 
3
3
  [English](README.en.md)
4
4
 
5
- 把 C++11–C++23 的源码、CMake 与构建工作收成三个技能,新工程默认 C++23。插件注册技能 provider 与设置面,不注册工具、不编译、不下载工具链、不写项目文件。
5
+ 把 C++11–C++23 的源码、CMake 与构建工作整理成三个技能,新工程默认 C++23。插件注册技能 provider 与设置面,不注册工具、不编译、不下载工具链、不写项目文件。
6
6
 
7
7
  ## 提供什么
8
8
 
9
9
  | 技能 | 管什么 | 什么时候打开 |
10
10
  | --- | --- | --- |
11
11
  | `developing-cpp` | 定行为、定边界、定声明、定实现;`.h` / `.cpp` / `.cc` 的命名、异常和源码注释 | 用户点名源码,或需要新建/整段重构源码 |
12
- | `engineering` | 定 target、定模块、通过检查;CMakeLists.txt、`cmake/` 函数与模块、target 属性、C++11–C++23 标准,以及 `.clang-format`/`.clang-tidy`/`.clangd` 配置 | 改动落在 CMake target、标准、链接边界、函数或模块,或落在编码与 clang 工具配置上 |
13
- | `building-cpp` | 定构建、定工具配置、通过检查;Ninja、Clang 配置、构建脚本、环境组合、格式化与静态检查 | 改动落在构建命令、工具配置或环境声明上,或第一次接构建 |
12
+ | `engineering` | 定 target、定模块、通过检查;CMakeLists.txt、`cmake/` 函数与模块、target 属性、C++11–C++23 标准,以及 `.clang-format`/`.clang-tidy`/`.clangd` 的配置条文 | 改动落在 CMake target、标准、链接边界、函数或模块,或落在编码与 clang 工具配置上 |
13
+ | `building-cpp` | 定构建、定工具配置、通过检查;Ninja、Clang 配置、构建脚本、环境组合、排版工具的配置与检查 | 改动落在构建命令、工具配置或环境声明上,或第一次接构建 |
14
14
 
15
- 异常条文采用 C++ Core Guidelines 的 Error handling,只在开发阶段指导源码和示例;插件运行时不编译、不执行这些规则。三个技能都先读项目技能 `cpp-workflow-project`。没有项目技能时,门禁不会放出这三个名字。
15
+ 异常条文采用 C++ Core Guidelines 的 Error handling,只在开发阶段指导源码和示例;插件运行时不编译、不执行这些规则。三个技能都先读项目技能 `cpp-workflow-project`。没有项目技能时,门禁不会列出这三个技能。
16
16
 
17
17
  ## 安装
18
18
 
19
- npm 安装钉死版本:
19
+ npm 安装固定版本:
20
20
 
21
21
  ```bash
22
- dsh plugin --profile web add npm:@chengzhao-dev/dsh-cpp-workflow@0.6.20
22
+ dsh plugin --profile <profile> add npm:@chengzhao-dev/dsh-cpp-workflow@0.7.1
23
23
  ```
24
24
 
25
25
  同版本的 Git 标签:
26
26
 
27
27
  ```bash
28
- dsh plugin --profile web add github:chengzhao-dev/dsh-cpp-workflow#v0.6.20
28
+ dsh plugin --profile <profile> add github:chengzhao-dev/dsh-cpp-workflow#v0.7.1
29
29
  ```
30
30
 
31
- 桌面应用独占 `desktop` profile。命令行 `add` 被拒绝时,在应用设置里添加插件,地址填同一个 npm 版本。Git 标签安装使用仓库内已构建的 `lib/`,不在目标机器上重新构建;包内也不含需要授权执行的安装脚本。
31
+ `--profile` 换成你实际运行的那个 profile。桌面应用固定跑 `desktop` profile,且该 profile 由应用独占管理;命令行 `add` 被拒绝时,在应用设置里添加插件,地址填同一个 npm 版本。Git 标签安装使用仓库内已构建的 `lib/`,不在目标机器上重新构建;包内也不含需要授权执行的安装脚本。
32
32
 
33
33
  ### 设置
34
34
 
35
- 插件页的「C++ 工程流程」是唯一入口:注释符号可选 `///` 或 `/** ... */`,页面按注释符号、文件头、类型、函数声明与只读预览分块。`@file` 固定为文件名;除它和函数体 `//` 外,文件头、类型与函数声明标签的开关出厂全开,空值跳过。函数参数要求 `@param`,返回值要求 `@return`(成立条件自明时可省),会抛才要求 `@throws`;`@pre`、`@post`、`@retval` 与类型块的 `@tparam`、`@note`、`@see` 也出厂开启,需要时可逐项关掉。函数体固定用 `//`。预览随改动即时更新,保存后下一次读取技能即生效,已有源码不会被改写。设置导航不再重复放一份。
35
+ 插件页的「C++ 工程流程」是唯一入口:注释符号可选 `///` 或 `/** ... */`,页面按注释符号、文件头、类型、函数声明与只读预览分块。`@file` 固定为文件名;除它和函数体 `//` 外,文件头、类型与函数声明标签的开关出厂全开,空值跳过。函数参数要求 `@param`,返回值要求 `@return`(成立条件自明时可省),会抛才要求 `@throws`;`@pre`、`@post`、`@retval` 与类型块的 `@tparam`、`@note`、`@see` 也出厂开启,需要时可逐项关掉。函数体固定用 `//`。预览随改动即时更新,保存后下一次读取技能即生效,已有源码不会被改写。设置页不再重复列一份导航。
36
36
 
37
37
  升级插件后如果这一页暂时只显示出厂值,说明当前窗口还挂着旧的前端产物:页脚会显示写入的 `~/.dsh/profiles/<profile>/cordis.patch.yml`,并提示重载;重启 DeepSeek Harness,或在插件页点“重新载入页面”即可编辑,不需要重装插件。页面会在打开后自动重试连接,拿到表单就切换为可编辑。保存、撤销修改与恢复默认值分三个按钮:撤销只回到最近一次读到的值,恢复默认值只填草稿,点保存才写盘。
38
38
 
39
39
  ## 工作区门禁
40
40
 
41
- 一个会话里只需要满足一件事,技能就会出现:从当前目录向上、停在 git 根,沿途有 `.agents/skills/cpp-workflow-project/SKILL.md`。
41
+ 会话满足一个条件,技能就会出现:从当前目录向上、停在 git 根,沿途有 `.agents/skills/cpp-workflow-project/SKILL.md`。
42
42
 
43
43
  项目技能标记就是仓库选择加入本工作流的声明。插件不再要求同一仓库里已经有第一方 `CMakeLists.txt` 或 C++ 源文件:纯文档仓库、只复制了模板、还没有任何源文件的仓库也会出现;环境轴为空时,源码四步仍能做,但定构建会停。没有标记就返回空列表,即使仓库里有 CMake 或 `.cpp`。扫描上限和边界情形见 [docs/plugin-boundaries.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-boundaries.md)。
44
44
 
@@ -64,7 +64,7 @@ dsh plugin --profile web add github:chengzhao-dev/dsh-cpp-workflow#v0.6.20
64
64
  | `compiler` | `clang`、`gcc` | 一次配置一个编译器 |
65
65
  | `standard` | `c++11`、`c++14`、`c++17`、`c++20`、`c++23` | 新工程默认 `c++23`;一个工程一个标准 |
66
66
 
67
- 标准写在 `environment.json` 的 `standard`,并同步到 CMake target 和编译数据库;CMake 侧优先调用 `engineering` 提供的 `CompileSettings_SetCxxStandard` 函数。新工程默认 C++23;C++11–C++20 工程把 `standard`、`cxx_std_*`、`CXX_STANDARD` 和 `.clang-format` 的解析档位一起降级,不要只改一处。每档的设施、工具和降档表见 [标准目录](skills/engineering/cmake/03-standard/standards/README.md),CMake 两层声明见 [cxx-standard.md](skills/engineering/cmake/03-standard/01-cxx-standard.md)。
67
+ 标准写在 `environment.json` 的 `standard`,并同步到 CMake target 和编译数据库;CMake 侧优先调用 `engineering` 提供的 `CompileSettings_SetCxxStandard` 函数。新工程默认 C++23;C++11–C++20 工程把 `standard`、`cxx_std_*`、`CXX_STANDARD` 和 `.clang-format` 的解析档位一起降级,不要只改一处。每档的设施、工具和降档表见 [标准目录](skills/engineering/references/cmake/standard/standards/README.md),CMake 两层声明见 [cxx-standard.md](skills/engineering/references/cmake/standard/cxx-standard.md)。
68
68
 
69
69
  生成器固定 Ninja,构建目录是 `build/clang/` 与 `build/gcc/`,不共用 `build/`。诊断工具固定 `clang-format`、`clang-tidy`、`clangd`;GCC 模式也不换成别的分析器。
70
70
 
@@ -81,22 +81,7 @@ node "<skill-dir>/scripts/checking-environment.mjs" --project . --live
81
81
 
82
82
  ## 包结构
83
83
 
84
- ```text
85
- dsh-cpp-workflow/
86
- ├── lib/ # 构建产物,随 npm 包发布
87
- ├── skills/ # developing-cpp、engineering 与 building-cpp
88
- ├── templates/ # 复制到项目的空模板
89
- ├── package.json
90
- ├── package-lock.json # 只在仓库,供 npm ci
91
- ├── LICENSE
92
- ├── README.md
93
- ├── README.en.md
94
- ├── cordis.patch.yml # 只 insert 一行
95
- ├── locale/ # 中英文标题与描述
96
- └── icon.svg
97
- ```
98
-
99
- 仓库另有 `src/`、`scripts/`、`tests/` 与 `docs/`,只服务开发与评审,不进包;白名单见 [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md)。
84
+ 运行时闭包是 `lib/`、`skills/`、`templates/`、`locale/`、`cordis.patch.yml`、两个 README、`LICENSE` 与 `icon.svg`。仓库另有 `src/`、`scripts/`、`tests/` 与 `docs/`,只服务开发与评审,不进包。权威白名单与逐项目录见 [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md)。
100
85
 
101
86
  边界与门禁的维护说明在 [docs/plugin-flow.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-flow.md),技能的层次与数据流在 [docs/architecture.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/architecture.md),触发矩阵在 [docs/triggering.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/triggering.md),目录和进包白名单在 [docs/plugin-layout.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/plugin-layout.md),版本规则在 [docs/versioning.md](https://github.com/chengzhao-dev/dsh-cpp-workflow/blob/main/docs/versioning.md)。
102
87
 
package/cordis.patch.yml CHANGED
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # Additive only: insert one host row. No official row is edited, disabled or
4
4
  # replaced. The row loads this package's `main` entry, which registers the
5
- # packaged developing-cpp and building-cpp skills through `ctx.skills`.
5
+ # packaged developing-cpp, engineering and building-cpp skills through `ctx.skills`.
6
6
  #
7
7
  # Install with `dsh plugin --profile <name> add <package>`. Pinned npm and Git
8
8
  # tag addresses are in the README's Install section.
package/lib/client.js CHANGED
@@ -9,7 +9,7 @@ window.__ModuleLoader__.load({
9
9
  * 注释标签策略:设置页的预览、技能快照与检查器参数共用这一份。
10
10
  *
11
11
  * 配置只描述「写注释时默认带哪些标签、声明用哪种注释符号」,不描述写法本身;
12
- * 写法在 `skills/developing-cpp/source/07-comments/01-comment-rules.md`。设置页保存的值由宿主
12
+ * 写法在 `skills/developing-cpp/references/comments/comment-rules.md`。设置页保存的值由宿主
13
13
  * 写回插件 Config,服务端 `apply(ctx, config)` 用它生成本页快照与检查器参数。
14
14
  *
15
15
  * 这份文件被 `tsc` 编进 `lib/comment-policy.js`,打包客户端半侧时再内联进
@@ -201,18 +201,27 @@ function checkerArgs(raw) {
201
201
  /**
202
202
  * 技能快照:`get()` 把它接在技能正文末尾,让代理看到当前 profile 的标签开关。
203
203
  * 只写一行,列出声明符号、开启与关闭的标签,避免正文膨胀。
204
+ * `@author` 等只认默认值的文件头标签开着却没填值时单列为「未填值」:这种标签
205
+ * 不会写进文件,与「关闭」不是一回事,代理据此既不会漏写,也不会补空标签。
206
+ * `@brief` 的正文按文件写,没有默认值也仍列为开启。
204
207
  */
205
208
  function snapshotText(raw) {
206
209
  const config = normalizeConfig(raw);
207
210
  const on = ['@file'];
211
+ const unset = [];
208
212
  const off = [];
209
213
  for (const tag of HEADER_TAGS) {
210
214
  const entry = config[tag];
211
- const label = entry.value ? `${TAG_LABEL[tag]} ${entry.value}` : TAG_LABEL[tag];
212
- if (entry.enabled)
213
- on.push(label);
214
- else
215
+ if (!entry.enabled) {
215
216
  off.push(TAG_LABEL[tag]);
217
+ }
218
+ else if (tag === 'brief' || entry.value) {
219
+ // @brief 的正文按文件写,没有默认值也仍要出现;其余文件头标签只认填了的默认值。
220
+ on.push(entry.value ? `${TAG_LABEL[tag]} ${entry.value}` : TAG_LABEL[tag]);
221
+ }
222
+ else {
223
+ unset.push(TAG_LABEL[tag]);
224
+ }
216
225
  }
217
226
  for (const tag of [...CONTRACT_TAGS, ...EXTRA_TAGS]) {
218
227
  if (config[tag])
@@ -221,7 +230,7 @@ function snapshotText(raw) {
221
230
  off.push(TAG_LABEL[tag]);
222
231
  }
223
232
  const style = config.commentStyle === 'block' ? '/** ... */' : '///';
224
- const line = `- 声明符号:${style}(函数体固定 //);开启 ${on.join('、')};关闭 ${off.join('、') || '无'}。`;
233
+ const line = `- 声明符号:${style}(函数体固定 //);开启 ${on.join('、')};未填值 ${unset.join('、') || '无'};关闭 ${off.join('、') || '无'}。`;
225
234
  return `## 当前注释配置(profile)\n\n${line}`;
226
235
  }
227
236
 
@@ -613,9 +622,6 @@ function useFormSnapshot(form) {
613
622
 
614
623
  // 宿主组合包 cordis.patch.yml 插入的 profile 条目 id;设置服务按它定位表单。
615
624
  const ENTRY_ID = 'cpp-workflow'
616
- // configForms 可能晚于本插件挂载;页面在首次绘制后短暂重试,拿不到再给手动恢复入口。
617
- const FORM_RETRY_MS = 500
618
- const MAX_FORM_RETRIES = 20
619
625
 
620
626
  /** 文件头可填写标签的占位文字;顺序与 HEADER_TAGS 一致。 */
621
627
  const HEADER_PLACEHOLDER = {
@@ -642,17 +648,20 @@ const FLAG_PLACEHOLDER = {
642
648
  function ConfigPage(props) {
643
649
  const s = t()
644
650
  ensureStyles()
645
- // form 由挂点注入;resolveForm 兜住“服务晚到”的部署,拿到后下一次绘制自动接上。
646
- const form = props.form || (typeof props.resolveForm === 'function' ? props.resolveForm() : undefined)
651
+ // 宿主把 configForms 列为必需注入,挂载时取一次表单;之后沿用同一个 controller,
652
+ // 不在每次绘制里调用宿主服务。
653
+ const [form] = React.useState(
654
+ () => props.form || (typeof props.resolveForm === 'function' ? props.resolveForm() : undefined),
655
+ )
647
656
  const state = useFormSnapshot(form)
648
657
  const initial = React.useMemo(() => normalizeConfig(state.value), [])
649
658
  const [draft, setDraft] = React.useState(initial)
650
659
  const [base, setBase] = React.useState(initial)
651
660
  const [dirty, setDirty] = React.useState(false)
661
+ const [baseRevision, setBaseRevision] = React.useState(state.revision)
652
662
  const [busy, setBusy] = React.useState(false)
653
663
  const [message, setMessage] = React.useState('')
654
664
  const [tone, setTone] = React.useState('')
655
- const [attempt, setAttempt] = React.useState(0)
656
665
  const revision = state.revision
657
666
  // 快照只有 status / writable / revision;旧版本多出来的 mode 字段已不存在,
658
667
  // 再按它判断会把所有可写表单误判成只读。
@@ -664,15 +673,10 @@ function ConfigPage(props) {
664
673
  if (dirty || state.status !== 'ready') return
665
674
  const next = normalizeConfig(state.value)
666
675
  setBase(next)
676
+ setBaseRevision(state.revision)
667
677
  setDraft(next)
668
678
  }, [revision, status, dirty, form, state.value])
669
679
 
670
- React.useEffect(() => {
671
- if (form || attempt >= MAX_FORM_RETRIES || typeof setTimeout !== 'function') return undefined
672
- const timer = setTimeout(() => setAttempt((value) => value + 1), FORM_RETRY_MS)
673
- return () => clearTimeout(timer)
674
- }, [form, attempt])
675
-
676
680
  // 脏标记按与已保存值的差集算:把开关关了又开回原值时,页面不该再说“有未保存的改动”。
677
681
  const update = (patch) => {
678
682
  const next = { ...draft, ...patch }
@@ -711,8 +715,12 @@ function ConfigPage(props) {
711
715
  if (operations.length === 0) return
712
716
  setBusy(true)
713
717
  try {
714
- const accepted = await form.mutate(operations, revision)
718
+ // 基准 revision 与 base 同时记录:草稿期间外部若改过配置,这里传旧 revision,
719
+ // 宿主会拒绝,不会用新 revision 把旧草稿盖上去。
720
+ const accepted = await form.mutate(operations, baseRevision)
715
721
  if (accepted) {
722
+ const fresh = snapshotOf(form)
723
+ if (fresh && fresh.status === 'ready') setBaseRevision(fresh.revision)
716
724
  setBase(draft)
717
725
  setDirty(false)
718
726
  setMessage(s.saved)
@@ -720,7 +728,10 @@ function ConfigPage(props) {
720
728
  } else {
721
729
  // 被拒时宿主已刷新镜像;把基准对齐到新快照,撤销才不会回到过期值。
722
730
  const fresh = snapshotOf(form)
723
- if (fresh && fresh.status === 'ready') setBase(normalizeConfig(fresh.value))
731
+ if (fresh && fresh.status === 'ready') {
732
+ setBase(normalizeConfig(fresh.value))
733
+ setBaseRevision(fresh.revision)
734
+ }
724
735
  setMessage(s.rejected)
725
736
  setTone('warn')
726
737
  }
@@ -870,7 +881,8 @@ function apply(ctx) {
870
881
  if (ctx.configForms && typeof ctx.configForms.whileServed === 'function') {
871
882
  ctx.effect(() => ctx.configForms.whileServed([ENTRY_ID], mount), 'dsh-cpp-workflow: 配置挂点')
872
883
  } else {
873
- mount()
884
+ // 旧宿主没有 whileServed 时也交给效果作用域注销挂点,卸载后不留悬挂注册。
885
+ ctx.effect(() => mount(), 'dsh-cpp-workflow: 配置挂点')
874
886
  }
875
887
  }
876
888
 
@@ -2,7 +2,7 @@
2
2
  * 注释标签策略:设置页的预览、技能快照与检查器参数共用这一份。
3
3
  *
4
4
  * 配置只描述「写注释时默认带哪些标签、声明用哪种注释符号」,不描述写法本身;
5
- * 写法在 `skills/developing-cpp/source/07-comments/01-comment-rules.md`。设置页保存的值由宿主
5
+ * 写法在 `skills/developing-cpp/references/comments/comment-rules.md`。设置页保存的值由宿主
6
6
  * 写回插件 Config,服务端 `apply(ctx, config)` 用它生成本页快照与检查器参数。
7
7
  *
8
8
  * 这份文件被 `tsc` 编进 `lib/comment-policy.js`,打包客户端半侧时再内联进
@@ -194,18 +194,27 @@ export function checkerArgs(raw) {
194
194
  /**
195
195
  * 技能快照:`get()` 把它接在技能正文末尾,让代理看到当前 profile 的标签开关。
196
196
  * 只写一行,列出声明符号、开启与关闭的标签,避免正文膨胀。
197
+ * `@author` 等只认默认值的文件头标签开着却没填值时单列为「未填值」:这种标签
198
+ * 不会写进文件,与「关闭」不是一回事,代理据此既不会漏写,也不会补空标签。
199
+ * `@brief` 的正文按文件写,没有默认值也仍列为开启。
197
200
  */
198
201
  export function snapshotText(raw) {
199
202
  const config = normalizeConfig(raw);
200
203
  const on = ['@file'];
204
+ const unset = [];
201
205
  const off = [];
202
206
  for (const tag of HEADER_TAGS) {
203
207
  const entry = config[tag];
204
- const label = entry.value ? `${TAG_LABEL[tag]} ${entry.value}` : TAG_LABEL[tag];
205
- if (entry.enabled)
206
- on.push(label);
207
- else
208
+ if (!entry.enabled) {
208
209
  off.push(TAG_LABEL[tag]);
210
+ }
211
+ else if (tag === 'brief' || entry.value) {
212
+ // @brief 的正文按文件写,没有默认值也仍要出现;其余文件头标签只认填了的默认值。
213
+ on.push(entry.value ? `${TAG_LABEL[tag]} ${entry.value}` : TAG_LABEL[tag]);
214
+ }
215
+ else {
216
+ unset.push(TAG_LABEL[tag]);
217
+ }
209
218
  }
210
219
  for (const tag of [...CONTRACT_TAGS, ...EXTRA_TAGS]) {
211
220
  if (config[tag])
@@ -214,6 +223,6 @@ export function snapshotText(raw) {
214
223
  off.push(TAG_LABEL[tag]);
215
224
  }
216
225
  const style = config.commentStyle === 'block' ? '/** ... */' : '///';
217
- const line = `- 声明符号:${style}(函数体固定 //);开启 ${on.join('、')};关闭 ${off.join('、') || '无'}。`;
226
+ const line = `- 声明符号:${style}(函数体固定 //);开启 ${on.join('、')};未填值 ${unset.join('、') || '无'};关闭 ${off.join('、') || '无'}。`;
218
227
  return `## 当前注释配置(profile)\n\n${line}`;
219
228
  }
package/lib/workspace.js CHANGED
@@ -10,17 +10,6 @@ import { access } from 'node:fs/promises';
10
10
  import path from 'node:path';
11
11
  export const PROJECT_SKILL = path.join('.agents', 'skills', 'cpp-workflow-project', 'SKILL.md');
12
12
  export const MAX_ASCENT = 64;
13
- const SKIPPED_DIRS = new Set([
14
- '.git',
15
- 'node_modules',
16
- 'vendor',
17
- 'third_party',
18
- 'templates',
19
- 'build',
20
- 'temp',
21
- '.cache',
22
- ]);
23
- export const CPP_BUILD_FILES = new Set(['CMakeLists.txt']);
24
13
  async function exists(target) {
25
14
  try {
26
15
  await access(target);
@@ -91,10 +80,6 @@ export async function findProjectSkill(cwd, gitRoot) {
91
80
  }
92
81
  return undefined;
93
82
  }
94
- /** Boolean form of {@link findProjectSkill}. */
95
- export async function hasProjectSkill(cwd, gitRoot) {
96
- return (await findProjectSkill(cwd, gitRoot)) !== undefined;
97
- }
98
83
  /**
99
84
  * Session gate. The project skill must sit between `cwd` and the git root
100
85
  * (inclusive). First-party C++ or CMake evidence is deliberately not required:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chengzhao-dev/dsh-cpp-workflow",
3
- "version": "0.6.20",
3
+ "version": "0.7.1",
4
4
  "description": "写 C++ 源码、配 CMake、用 Clang 构建;头文件用 /// Doxygen 文档注释,函数体用 // 分段说明,文件头标签可在设置里改。",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -23,7 +23,7 @@
23
23
  ],
24
24
  "engines": {
25
25
  "node": ">=22",
26
- "dsh": ">=0.2.0-rc.1 <0.3.0-0"
26
+ "dsh": ">=0.2.1-rc.1 <0.3.0-0"
27
27
  },
28
28
  "dsh": {
29
29
  "bundle": {
@@ -32,7 +32,7 @@
32
32
  "client": {
33
33
  "platform": "web",
34
34
  "inject": [
35
- "@deepseek-ai/dsh-client-ui-slots",
35
+ "@deepseek-ai/dsh-client-ui-renderer",
36
36
  "@deepseek-ai/dsh-client-ui-settings",
37
37
  "@deepseek-ai/dsh-client-ui-plugin-manager"
38
38
  ]
@@ -51,10 +51,10 @@
51
51
  "icon": "./icon.svg",
52
52
  "scripts": {
53
53
  "build": "tsc -p tsconfig.json && node scripts/building-client.mjs",
54
- "test": "npm run build && node scripts/building-client.mjs --check && node scripts/checking-skill-links.mjs && node skills/engineering/formatting/scripts/checking-encoding.mjs --quiet && node scripts/checking-github-workflows.mjs && node --test tests/*.test.mjs",
54
+ "test": "node scripts/building-client.mjs --check && npm run build && node scripts/checking-skill-links.mjs && node skills/engineering/references/formatting/scripts/checking-encoding.mjs --quiet && node scripts/checking-github-workflows.mjs && node --test tests/*.test.mjs",
55
55
  "ci": "npm ci && npm test && npm run pack:check",
56
56
  "ci:full": "npm run ci && npm run test:matrix",
57
- "check:encoding": "node skills/engineering/formatting/scripts/checking-encoding.mjs",
57
+ "check:encoding": "node skills/engineering/references/formatting/scripts/checking-encoding.mjs",
58
58
  "check:workflows": "node scripts/checking-github-workflows.mjs",
59
59
  "test:matrix": "bash scripts/checking-standard-matrix.sh",
60
60
  "pack:check": "npm pack --dry-run"
@@ -86,13 +86,13 @@
86
86
  "provenance": true
87
87
  },
88
88
  "peerDependencies": {
89
- "@deepseek-ai/dsh-skill": ">=0.2.0-rc.1 <0.3.0-0"
89
+ "@deepseek-ai/dsh-skill": ">=0.2.1-rc.1 <0.3.0-0"
90
90
  },
91
91
  "dependencies": {
92
92
  "@deepseek-ai/schemastery": "^3.18.5"
93
93
  },
94
94
  "devDependencies": {
95
- "@deepseek-ai/dsh-skill": ">=0.2.0-rc.1 <0.3.0-0",
95
+ "@deepseek-ai/dsh-skill": ">=0.2.1-rc.1 <0.3.0-0",
96
96
  "@types/node": "^22.20.5",
97
97
  "typescript": "^5.9.3",
98
98
  "yaml": "^2.9.1"
@@ -7,23 +7,21 @@ metadata:
7
7
 
8
8
  # building-cpp
9
9
 
10
- ## 适用场景
11
-
12
- 本技能处理环境声明、构建入口与工具配置:`environment.json`、`running-build.sh`、`.clang-format`、`.clang-tidy`、`.clangd`、`.vscode/`、构建命令、编译数据库、CTest 和运行。`CMakeLists.txt` 与 `cmake/` 下的 target、属性、标准和模块由 `engineering` 负责;本技能只读它们来配置和检查,不在这一步改 target 图。函数体、类型、命名、异常和源码注释只开 `developing-cpp`。
13
-
14
- 一次改动同时碰到源码和构建文件时,先打开 `developing-cpp` 定行为、边界与实现;需要新增或移动源文件、改库与程序的边界、补测试 target 时,转到 `engineering` 把文件写进 CMake;最后回到本技能做定工具配置与通过检查。只改函数体、命名、异常或注释且入口命令可运行时,定实现后只开本技能的「通过检查」。
15
-
16
- 存在项目技能 `cpp-workflow-project` 时先读它的 `SKILL.md`、`environment.json` 和 `stages/stage-table.md`。三个环境轴为空、`standard` 非法或组合非法时停在定构建,不猜 WSL、Clang 或构建目录;`windows` + `native` 直接拒绝,提示「本版本不能在 Windows 原生壳里构建」,不要给出补 PowerShell 的路线。
10
+ 本技能处理环境声明、构建入口与工具配置:`environment.json`、`running-build.sh`、`.clang-format`、`.clang-tidy`、`.clangd`、`.vscode/`、构建命令、编译数据库、CTest 与运行。
17
11
 
18
- 编译失败先分因:诊断指向函数体,回 `developing-cpp` 的定实现;诊断是找不到头、链接失败、target 不存在或标准不对,转 `engineering` 的对应步骤;诊断是没有编译数据库、format/tidy 不在 PATH 或配置不生效,留在本技能的定工具配置。
19
-
20
- 源码和构建文件用 UTF-8 无 BOM、检出 LF;`.bat` / `.cmd` 用 CRLF;`.clang-format` 写 `LineEnding: LF`。MSVC 原生构建优先加 `/utf-8`,不要靠 BOM 过关。完整规则见 `../engineering/formatting/01-encoding.md`,检查脚本是 `../engineering/formatting/scripts/checking-encoding.mjs`,机器规则以仓库根 `.gitattributes` 与 `.editorconfig` 为准。
12
+ ## 适用场景
21
13
 
22
- 工程根已有 `.vscode/` 时,扩展与设置按 `project/vscode/` 两页接线;从当前目录向上到 git 根都没有 `.vscode/` 时,不打开、也不新建。编辑器的配置、构建、运行和调试都从 CMake Tools 进入,构建仍以 `running-build.sh` 为准。
14
+ - **负责**:环境四轴与构建入口;工具配置的选定与检查;编码、声明校验、活动校验、项目入口命令的次序。
15
+ - **不负责**:`CMakeLists.txt` 与 `cmake/` 下的 target、属性、标准与模块开 `engineering`,本技能只读它们来配置和检查,不在这一步改 target 图;函数体、类型、命名、异常与源码注释开 `developing-cpp`。
16
+ - **交接**:一次改动同时碰到源码和构建文件时,先开 `developing-cpp` 定行为、边界与实现;需要新增或移动源文件、改库与程序的边界、补测试 target 时,转 `engineering` 把文件写进 CMake;最后回到本技能定工具配置并通过检查。只改函数体、命名、异常或注释且入口命令可运行时,定实现后只开本技能的通过检查。
17
+ - **前置**:存在项目技能 `cpp-workflow-project` 时先读它的 `SKILL.md`、`environment.json` 和 `stages/stage-table.md`。三个环境轴为空、`standard` 非法或组合非法时停在定构建,不猜 WSL、Clang 或构建目录;`windows` + `native` 直接拒绝,提示「本版本不能在 Windows 原生壳里构建」,不给补 PowerShell 的路线。
18
+ - **分因**:编译失败时先看诊断指向哪一层。函数体问题回 `developing-cpp` 的定实现;找不到头、链接失败、target 不存在或标准不对转 `engineering` 的对应步骤;没有编译数据库、format/tidy 不在 PATH 或配置不生效留在本技能的定工具配置。
19
+ - **编码**:源码与构建文件用 UTF-8 无 BOM、检出 LF,`.bat` / `.cmd` 用 CRLF,`.clang-format` 写 `LineEnding: LF`;MSVC 原生构建优先加 `/utf-8`,不靠 BOM 过关。完整规则见 `../engineering/references/formatting/01-encoding.md`,机器规则以仓库根 `.gitattributes` 与 `.editorconfig` 为准。
20
+ - **编辑器**:工程根已有 `.vscode/` 时按 `project/vscode/` 两页接线;从当前目录向上到 git 根都没有 `.vscode/` 时不打开、也不新建。配置、构建、运行和调试都从 CMake Tools 进入,构建仍以 `running-build.sh` 为准。
23
21
 
24
22
  ## 三种操作
25
23
 
26
- 一次只选一种,范围(单点、整段)是任务属性。操作与域的判据、边界和交接见 `../developing-cpp/source/01-editing/01-edit-operations.md`;四类改动是域,不是操作。
24
+ 一次只选一种,范围(单点、整段)是任务属性;判据、边界与交接见 `../developing-cpp/references/editing/01-edit-operations.md`。四类改动是域,不是操作。
27
25
 
28
26
  | 操作 | 什么时候用 | 从哪步进 |
29
27
  | --- | --- | --- |
@@ -31,7 +29,9 @@ metadata:
31
29
  | 改写 | 环境轴与 target 契约不变,工具配置位置或流程顺序不对 | 从第 2 步重走,可到第 3 步 |
32
30
  | 润色 | 只改诊断措辞或失败分流说明 | 第 3 步 |
33
31
 
34
- 三种操作共用这些约束:不发明项目没有声明的环境轴、命令和 target;只改格式或配置时不改可观察行为;不覆盖已有源码、`CMakeLists.txt` 和 `.clang-*`;不安装工具链;代理侧不写 `wsl` 或 `bash -lc`。后一步发现前一步没做完,退回那一步。拿不准先用单点修正;发现环境轴、编译器、构建目录或 target 契约需要改,退回整段,并转 `engineering`。
32
+ - 不发明项目没有声明的环境轴、命令和 target;只改格式或配置时不改可观察行为。
33
+ - 不覆盖已有源码、`CMakeLists.txt` 和 `.clang-*`;不安装工具链;代理侧不写 `wsl` 或 `bash -lc`。
34
+ - 后一步发现前一步没做完,退回那一步;发现环境轴、编译器、构建目录或 target 契约需要改,整段退回并转 `engineering`。
35
35
 
36
36
  ## 步骤
37
37
 
@@ -41,31 +41,31 @@ metadata:
41
41
  | 2 | 定工具配置 | `steps/02-tooling.md` | 格式化、静态检查、clangd 各管一段,互不越界 |
42
42
  | 3 | 通过检查 | `steps/03-check.md` | 按编码 → 声明校验 → 活动校验 → 项目入口的次序跑,前一步失败就停 |
43
43
 
44
- ### 入口表
44
+ 每步只打开同号的一个步骤文件。判不准才打开 `examples/` 里与该步对应的案例;`references/` 保存完整条文,只在排错、整目录重构,或步骤里明确指向某一条时打开。
45
+
46
+ ## 入口表
45
47
 
46
48
  | 要做的事 | 打开 |
47
49
  | --- | --- |
48
50
  | 读环境轴、配置与构建 | `steps/01-build.md`;条文 `references/environment.md`;案例 `examples/environment.md` |
49
- | 配 `.clang-format`、`.clang-tidy`、`.clangd` | `steps/02-tooling.md`;条文在 `../engineering/formatting/`,一次一份 |
51
+ | 配 `.clang-format`、`.clang-tidy`、`.clangd` | `steps/02-tooling.md`;条文在 `../engineering/references/formatting/`,一次一份 |
50
52
  | 工程已有 `.vscode/`,接扩展与设置 | `project/vscode/01-extensions.md` 或 `02-settings.md`;没有 `.vscode/` 不打开也不新建 |
51
53
  | 编码、声明校验、活动校验与入口命令 | `steps/03-check.md`;条文 `references/build-script.md` |
52
54
  | 新工程模板与可复制配置 | `assets/templates/projects/`、`assets/config/` |
53
55
 
54
- 每步只打开同号的一个步骤文件。判不准才打开 `examples/` 里与该步对应的案例;`references/` 保存完整条文,只在排错、整目录重构,或步骤里明确指向某一条文时按需打开。链接、rpath 与产物布局读 `../engineering/cmake/linking/01-libraries.md`;测试设计、断言与 CTest 注册读 `../engineering/cmake/testing/ctest.md`;CMake 的 target、标准和函数写法读 `../engineering/cmake/`,可复用片段在 `../engineering/cmake/assets/`。
55
-
56
- 入口脚本只做配置、构建、CTest 与最小运行;`clang-format` 与 `clang-tidy` 的手动检查留在定工具配置,不塞进入口脚本。`environment.json` 的三个环境轴与 `standard` 是唯一来源,缺项就停。
56
+ 链接、rpath 与产物布局读 `../engineering/references/cmake/linking/01-libraries.md`;测试设计、断言与 CTest 注册读 `../engineering/references/cmake/testing/ctest.md`;CMake 的 target、标准与函数写法读 `../engineering/references/cmake/`,可复用片段在 `../engineering/references/cmake/assets/`。
57
57
 
58
- 本轮激活按三条上限走:
58
+ ## 加载预算
59
59
 
60
- - 只开当前步对应的一个步骤文件;同一改动域内不同时展开两个技能的步骤。跨域按 `源码 → engineering → building-cpp` 的顺序逐段进入,前一段结论落下再开下一段。
60
+ - 只开当前步对应的一个步骤文件;同一改动域内不同时展开两个技能的步骤。
61
61
  - 条文只开该步点名的一份;同号案例留到下一次激活。
62
62
  - 标准档只打开项目技能声明的那一档,没有声明时用本技能已有的新工程默认,不把其余标准档读进来。
63
63
 
64
- 项目技能列出了检查命令时只跑那一条,没有时跑本技能自己的 `scripts/checking-environment.mjs` 与 `../engineering/formatting/scripts/checking-encoding.mjs`;退出码为 0 后在同一轮结束 goal,不再继续走没有失败的步骤。
64
+ 项目技能列出了检查命令时只跑那一条,没有时跑本技能自己的 `scripts/checking-environment.mjs` 与 `../engineering/references/formatting/scripts/checking-encoding.mjs`;退出码为 0 后停在这一步,不再继续走没有失败的步骤。入口脚本只做配置、构建、CTest 与最小运行;`clang-format` 与 `clang-tidy` 的手动检查留在定工具配置,不塞进入口脚本。`environment.json` 的三个环境轴与 `standard` 是唯一来源,缺项就停。
65
65
 
66
- ### 四类改动
66
+ ## 四类改动
67
67
 
68
- 四类改动是操作内部的域:操作定入口,域定层次。四域的定义、边界与次序见 `../developing-cpp/source/01-editing/01-edit-operations.md`;一次改动混了两类时,按「内容 → 结构 → 版式 → 措辞」拆开做,前一类落定并经检查再进下一类。
68
+ 四类改动是操作内部的域:操作定入口,域定层次。四域的定义、边界与次序见 `../developing-cpp/references/editing/01-edit-operations.md`;一次改动混了两类时,按「内容 → 结构 → 版式 → 措辞」拆开做,前一类落定并经检查再进下一类。
69
69
 
70
70
  | 类型 | 典型请求 | 入口步骤 |
71
71
  | --- | --- | --- |
@@ -70,7 +70,11 @@ main() {
70
70
  "${BUILD_ROOT}/compile_commands.json"
71
71
 
72
72
  header "测试"
73
- ctest --test-dir "${BUILD_DIR}" --output-on-failure
73
+ if [ -d tests ]; then
74
+ ctest --test-dir "${BUILD_DIR}" --output-on-failure --no-tests=error
75
+ else
76
+ ctest --test-dir "${BUILD_DIR}" --output-on-failure
77
+ fi
74
78
 
75
79
  header "运行 ${APP_NAME}"
76
80
  (
@@ -20,3 +20,9 @@
20
20
  4. 模板在 `../../assets/config/.vscode/extensions.json`,只作为新工程的起点;工程已有文件时不复制整份覆盖。
21
21
 
22
22
  下一步:扩展对齐后,读 [02-settings.md](02-settings.md) 接线设置。
23
+
24
+ ## 依据
25
+
26
+ - [clangd: Editor Plugins](https://clangd.llvm.org/installation#editor-plugins):VS Code 的 clangd 扩展与语言服务。
27
+ - [CMake Tools for VS Code](https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/README.md):配置、构建、调试入口。
28
+ - [VS Code: Extension Recommendations](https://code.visualstudio.com/docs/editor/extension-marketplace#_workspace-recommended-extensions):`extensions.json` 的 `recommendations`。
@@ -12,7 +12,7 @@
12
12
  | `clangd.arguments` 的 `--query-driver` | `/usr/bin/clang++` | `/usr/bin/g++` |
13
13
  | `cmake.debugConfig` | `MIMode: lldb`、`miDebuggerPath: /usr/bin/lldb` | `MIMode: gdb`、`miDebuggerPath: /usr/bin/gdb` |
14
14
 
15
- 只改与 `environment.json` 冲突的键;其余保持工程原值。`.clangd` 的 `CompilationDatabase` 也随编译器改,见 `../../../engineering/formatting/04-clangd.md`。
15
+ 只改与 `environment.json` 冲突的键;其余保持工程原值。`.clangd` 的 `CompilationDatabase` 也随编译器改,见 `../../../engineering/references/formatting/04-clangd.md`。
16
16
 
17
17
  ## 各键分工
18
18
 
@@ -31,3 +31,9 @@
31
31
  - 注释用 JSONC 的 `//`,只写为什么这样设。
32
32
 
33
33
  下一步:设置与扩展对齐后,回到 [定工具配置](../../steps/02-tooling.md) 收尾,再进 [通过检查](../../steps/03-check.md)。
34
+
35
+ ## 依据
36
+
37
+ - [clangd: Configuration](https://clangd.llvm.org/config):`.clangd` 与 `clangd.arguments`。
38
+ - [CMake Tools: Settings](https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/cmake-settings.md):`cmake.buildDirectory`、`cmake.generator`、`cmake.exportCompileCommandsFile`。
39
+ - [VS Code: Debugging](https://code.visualstudio.com/docs/debugtest/debugging):`cppdbg` 调试配置与 `miDebuggerPath`。