universal-dev-standards 6.14.0-beta.6 → 6.14.0-beta.7

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 (84) hide show
  1. package/README.md +13 -3
  2. package/bin/uds.js +30 -6
  3. package/bundled/ai/options/code-review/pr-review.ai.yaml +20 -1
  4. package/bundled/ai/standards/code-review.ai.yaml +15 -2
  5. package/bundled/ai/standards/developer-memory.ai.yaml +12 -2
  6. package/bundled/ai/standards/full-coverage-testing.ai.yaml +44 -6
  7. package/bundled/ai/standards/open-work-tracking.ai.yaml +191 -11
  8. package/bundled/ai/standards/pipeline-security-gates.ai.yaml +48 -3
  9. package/bundled/ai/standards/project-context-memory.ai.yaml +12 -2
  10. package/bundled/core/code-review-checklist.md +20 -2
  11. package/bundled/core/developer-memory.md +12 -2
  12. package/bundled/core/full-coverage-testing.md +44 -4
  13. package/bundled/core/open-work-tracking.md +156 -16
  14. package/bundled/core/pipeline-security-gates.md +63 -0
  15. package/bundled/core/project-context-memory.md +10 -2
  16. package/bundled/locales/zh-CN/CHANGELOG.md +51 -3
  17. package/bundled/locales/zh-CN/README.md +1 -1
  18. package/bundled/locales/zh-CN/SECURITY.md +1 -1
  19. package/bundled/locales/zh-CN/adoption/ADOPTION-GUIDE.md +13 -4
  20. package/bundled/locales/zh-CN/adoption/STATIC-DYNAMIC-GUIDE.md +7 -1
  21. package/bundled/locales/zh-CN/adoption/checklists/enterprise.md +7 -1
  22. package/bundled/locales/zh-CN/adoption/checklists/minimal.md +13 -3
  23. package/bundled/locales/zh-CN/adoption/checklists/recommended.md +7 -1
  24. package/bundled/locales/zh-CN/core/code-review-checklist.md +17 -0
  25. package/bundled/locales/zh-CN/core/developer-memory.md +9 -0
  26. package/bundled/locales/zh-CN/core/full-coverage-testing.md +48 -8
  27. package/bundled/locales/zh-CN/core/pipeline-security-gates.md +64 -4
  28. package/bundled/locales/zh-CN/core/project-context-memory.md +5 -0
  29. package/bundled/locales/zh-CN/docs/AVAILABLE-STANDARDS.md +70 -0
  30. package/bundled/locales/zh-CN/docs/CHEATSHEET.md +4 -3
  31. package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +25 -23
  32. package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +13 -11
  33. package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +6 -6
  34. package/bundled/locales/zh-CN/docs/WINDOWS-GUIDE.md +7 -1
  35. package/bundled/locales/zh-CN/docs/user/GETTING-STARTED.md +44 -0
  36. package/bundled/locales/zh-CN/options/code-review/pr-review.md +13 -2
  37. package/bundled/locales/zh-TW/CHANGELOG.md +51 -3
  38. package/bundled/locales/zh-TW/README.md +1 -1
  39. package/bundled/locales/zh-TW/SECURITY.md +1 -1
  40. package/bundled/locales/zh-TW/adoption/ADOPTION-GUIDE.md +13 -4
  41. package/bundled/locales/zh-TW/adoption/STATIC-DYNAMIC-GUIDE.md +7 -1
  42. package/bundled/locales/zh-TW/adoption/checklists/enterprise.md +7 -1
  43. package/bundled/locales/zh-TW/adoption/checklists/minimal.md +13 -3
  44. package/bundled/locales/zh-TW/adoption/checklists/recommended.md +7 -1
  45. package/bundled/locales/zh-TW/core/code-review-checklist.md +17 -0
  46. package/bundled/locales/zh-TW/core/developer-memory.md +9 -0
  47. package/bundled/locales/zh-TW/core/full-coverage-testing.md +48 -8
  48. package/bundled/locales/zh-TW/core/open-work-tracking.md +90 -14
  49. package/bundled/locales/zh-TW/core/pipeline-security-gates.md +64 -4
  50. package/bundled/locales/zh-TW/core/project-context-memory.md +5 -0
  51. package/bundled/locales/zh-TW/docs/AVAILABLE-STANDARDS.md +70 -0
  52. package/bundled/locales/zh-TW/docs/CHEATSHEET.md +4 -3
  53. package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +25 -23
  54. package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +13 -11
  55. package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +6 -6
  56. package/bundled/locales/zh-TW/docs/WINDOWS-GUIDE.md +7 -1
  57. package/bundled/locales/zh-TW/docs/user/GETTING-STARTED.md +44 -0
  58. package/bundled/locales/zh-TW/options/code-review/pr-review.md +13 -2
  59. package/bundled/skills/SKILL_NAMING.md +9 -0
  60. package/bundled/templates/gates/check-anti-fake-tests.mjs +305 -5
  61. package/package.json +3 -1
  62. package/src/commands/audit.js +9 -2
  63. package/src/commands/check.js +17 -0
  64. package/src/commands/init.js +41 -21
  65. package/src/commands/open-work.js +65 -6
  66. package/src/commands/skills.js +19 -33
  67. package/src/commands/update.js +61 -61
  68. package/src/core/open-work-config.js +103 -0
  69. package/src/flows/init-flow.js +10 -0
  70. package/src/i18n/messages.js +237 -60
  71. package/src/installers/skills-installer.js +3 -1
  72. package/src/prompts/init.js +148 -13
  73. package/src/reconciler/index.js +42 -5
  74. package/src/utils/available-standards-report.js +144 -0
  75. package/src/utils/available-standards.js +216 -0
  76. package/src/utils/copier.js +5 -4
  77. package/src/utils/friction-detector.js +27 -0
  78. package/src/utils/open-work-tracking.mjs +919 -48
  79. package/src/utils/skill-frontmatter.js +102 -0
  80. package/src/utils/skill-name-collision.js +169 -0
  81. package/src/utils/skills-install-paths.js +114 -0
  82. package/src/utils/skills-installer.js +63 -105
  83. package/src/utils/transient-fs.js +113 -0
  84. package/standards-registry.json +9 -9
@@ -8,6 +8,7 @@ import { pruneForeignSkillHashes } from '../utils/skill-hash-ownership.js';
8
8
  import { getSkillsDirForAgent, getAgentDisplayName } from '../config/ai-agent-paths.js';
9
9
  import { readManifest, isInitialized } from '../utils/copier.js';
10
10
  import { t, setLanguage, isLanguageExplicitlySet } from '../i18n/messages.js';
11
+ import { printInstallPathComparison } from '../utils/skills-install-paths.js';
11
12
 
12
13
  // Known skill directories (non-skill items to exclude)
13
14
  const NON_SKILL_ITEMS = [
@@ -122,6 +123,11 @@ export function skillsCommand() {
122
123
  const shipped = getAvailableSkillNames();
123
124
  const knownSkills = shipped.length > 0 ? shipped : getAllSkillNames();
124
125
 
126
+ // XSPEC-462 R1: one place that prints the two ways to install (an empty result and a full one both end with it).
127
+ const sayBothWays = () => {
128
+ printInstallPathComparison();
129
+ };
130
+
125
131
  // Check different installation locations
126
132
  const installations = [];
127
133
 
@@ -139,7 +145,7 @@ export function skillsCommand() {
139
145
  path: udsPlugin.installPath,
140
146
  version: udsPlugin.version || 'unknown',
141
147
  skills,
142
- recommended: !udsPlugin.isLegacyMarketplace,
148
+ isPlugin: true,
143
149
  legacyMarketplace: udsPlugin.isLegacyMarketplace
144
150
  });
145
151
  }
@@ -165,11 +171,10 @@ export function skillsCommand() {
165
171
  }
166
172
 
167
173
  installations.push({
168
- location: 'User Level (deprecated)',
174
+ location: 'User Level',
169
175
  path: userSkillsDir,
170
176
  version,
171
- skills: udsSkills,
172
- deprecated: true
177
+ skills: udsSkills
173
178
  });
174
179
  }
175
180
  }
@@ -194,11 +199,10 @@ export function skillsCommand() {
194
199
  }
195
200
 
196
201
  installations.push({
197
- location: 'Project Level (deprecated)',
202
+ location: 'Project Level',
198
203
  path: projectSkillsDir,
199
204
  version,
200
- skills: udsSkills,
201
- deprecated: true
205
+ skills: udsSkills
202
206
  });
203
207
  }
204
208
  }
@@ -228,22 +232,18 @@ export function skillsCommand() {
228
232
  if (installations.length === 0) {
229
233
  console.log(chalk.yellow(msg.noSkillsInstalled));
230
234
  console.log();
231
- console.log(chalk.gray(msg.installViaMarketplace));
232
- console.log(chalk.cyan(' /plugin marketplace add AsiaOstrich/universal-dev-standards'));
233
- console.log(chalk.cyan(' /plugin install universal-dev-standards@asia-ostrich'));
234
- console.log();
235
+ // XSPEC-462 R1: say both ways and what each one can and cannot do, not only the plugin.
236
+ sayBothWays();
235
237
  return;
236
238
  }
237
239
 
238
240
  // Show each installation
239
241
  for (const install of installations) {
240
242
  // Header
241
- if (install.recommended) {
242
- console.log(chalk.green(`✓ ${install.location}`) + chalk.gray(` ${msg.recommended}`));
243
- } else if (install.legacyMarketplace) {
244
- console.log(chalk.yellow(`⚠ ${install.location}`));
245
- } else if (install.deprecated) {
243
+ if (install.legacyMarketplace) {
246
244
  console.log(chalk.yellow(`⚠ ${install.location}`));
245
+ } else if (install.isPlugin) {
246
+ console.log(chalk.green(`✓ ${install.location}`));
247
247
  } else {
248
248
  console.log(chalk.blue(`● ${install.location}`));
249
249
  }
@@ -255,7 +255,7 @@ export function skillsCommand() {
255
255
  // Skills list
256
256
  console.log(chalk.gray(` Skills (${install.skills.length}):`));
257
257
  for (const skill of install.skills) {
258
- const icon = (install.deprecated || install.legacyMarketplace)
258
+ const icon = install.legacyMarketplace
259
259
  ? chalk.yellow('○')
260
260
  : chalk.green('✓');
261
261
  console.log(` ${icon} ${skill}`);
@@ -270,20 +270,10 @@ export function skillsCommand() {
270
270
  console.log(chalk.cyan(' /plugin install universal-dev-standards@asia-ostrich'));
271
271
  console.log();
272
272
  }
273
-
274
- // Deprecation warning
275
- if (install.deprecated) {
276
- console.log(chalk.yellow(` ${msg.manualInstallDeprecated}`));
277
- console.log(chalk.gray(` ${msg.manualInstallHint}`));
278
- console.log(chalk.cyan(' /plugin marketplace add AsiaOstrich/universal-dev-standards'));
279
- console.log(chalk.cyan(' /plugin install universal-dev-standards@asia-ostrich'));
280
- console.log();
281
- }
282
273
  }
283
274
 
284
275
  // Summary
285
276
  const totalSkills = new Set(installations.flatMap(i => i.skills)).size;
286
- const hasMarketplace = installations.some(i => i.recommended);
287
277
 
288
278
  console.log(chalk.gray('─'.repeat(50)));
289
279
  console.log(chalk.gray(`${msg.totalUniqueSkills}: ${totalSkills} / ${knownSkills.length}`));
@@ -299,13 +289,9 @@ export function skillsCommand() {
299
289
  }
300
290
  }
301
291
 
302
- if (!hasMarketplace && installations.length > 0) {
303
- console.log();
304
- console.log(chalk.yellow(msg.recommendation));
305
- console.log(chalk.gray(` ${msg.benefits}`));
306
- }
307
-
292
+ // XSPEC-462 R1: the two ways, side by side, with their limits.
308
293
  console.log();
294
+ sayBothWays();
309
295
  }
310
296
 
311
297
  // Export for testing
@@ -6,6 +6,12 @@ import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from '
6
6
  import { join, basename, dirname, relative } from 'path';
7
7
  import { readManifest, writeManifest, copyStandard, copyExtension, isInitialized, getRepoRoot } from '../utils/copier.js';
8
8
  import { getRepositoryInfo, getAllStandards, getShippableFilenames, getStandardSource } from '../utils/registry.js';
9
+ import { getAvailableStandards } from '../utils/available-standards.js';
10
+ import {
11
+ printAvailableStandardsSection,
12
+ resolveAddStandardRequest,
13
+ findAddStandardConflict
14
+ } from '../utils/available-standards-report.js';
9
15
  import { computeFileHash, planStandardsRemovals, refreshIntegrationBlockHashes, pruneIntegrationFileHashes } from '../utils/hasher.js';
10
16
  import { AmbiguousMarkerError } from '../utils/marker-locator.js';
11
17
  import {
@@ -49,6 +55,7 @@ import {
49
55
  getCommandsDirForAgent
50
56
  } from '../config/ai-agent-paths.js';
51
57
  import { getMarketplaceSkillsInfo } from '../utils/github.js';
58
+ import { printSkillNameCollisionWarning } from '../utils/skill-name-collision.js';
52
59
  import { detectAITools } from '../utils/detector.js';
53
60
  import { HOOK_CAPABLE_TOOLS, resolveHookTools, installMissingHooks } from '../installers/hooks-installer.js';
54
61
  import { persistRecorder, mergeRecorderInto, newRecorder } from '../core/install-records.js';
@@ -323,43 +330,11 @@ async function updateCliAndExit(useBeta = false) {
323
330
  * @returns {{newStandards: Array<{source: string, name: string}>, count: number}}
324
331
  */
325
332
  function checkNewStandards(manifest) {
326
- const format = manifest.format || 'ai';
327
-
328
- // Get all standards (level system removed)
329
- const registryStandards = getAllStandards();
330
-
331
- // Include all reference and skill standards
332
- const eligibleStandards = registryStandards.filter(s => s.category === 'reference' || s.category === 'skill');
333
-
334
- // Get installed standard basenames for comparison.
335
- // Handles both legacy path format ("ai/standards/foo.ai.yaml" → basename "foo.ai.yaml")
336
- // and v3.4.0 ID format ("foo" → resolve to source path, then get basename).
337
- const installedBasenames = new Set();
338
- for (const s of (manifest.standards || [])) {
339
- if (s.includes('/options/') || s.startsWith('options/')) continue; // Skip option paths
340
- if (!s.includes('/') && !s.includes('.')) {
341
- // ID format: resolve to actual source filename via registry
342
- const entry = registryStandards.find(r => r.id === s);
343
- if (entry) {
344
- const sourcePath = getStandardSource(entry, format);
345
- if (sourcePath) installedBasenames.add(basename(sourcePath));
346
- }
347
- } else {
348
- installedBasenames.add(basename(s));
349
- }
350
- }
351
-
352
- // Find standards in registry that are not yet installed
353
- const newStandards = [];
354
- for (const std of eligibleStandards) {
355
- const sourcePath = getStandardSource(std, format);
356
- if (!sourcePath) continue; // Skip skill-only standards with no source file
357
- const fileName = basename(sourcePath);
358
- if (!installedBasenames.has(fileName)) {
359
- newStandards.push({ source: sourcePath, name: fileName });
360
- }
361
- }
362
-
333
+ // One definition of "available but not installed", shared with `update --plan`, `check` and
334
+ // `audit --friction` (XSPEC-458 R1). This function used to hold its own copy of that logic, and the
335
+ // reconciler path (`--plan`/`--apply`) held none — so the two paths disagreed about what was missing.
336
+ const { offered } = getAvailableStandards(manifest);
337
+ const newStandards = offered.map(std => ({ source: std.source, name: std.name }));
363
338
  return { newStandards, count: newStandards.length };
364
339
  }
365
340
 
@@ -454,6 +429,28 @@ export async function updateCommand(options) {
454
429
  console.log(chalk.bold(msg.title));
455
430
  console.log(chalk.gray('─'.repeat(50)));
456
431
 
432
+ // XSPEC-458 R3: `--add-standard <id>` (repeatable) picks standards UDS ships and this project lacks.
433
+ // Judged here, before any mode runs, so an unknown id stops everything instead of being skipped.
434
+ const addStandardIds = [].concat(options.addStandard || []);
435
+ let addStandards = [];
436
+ if (addStandardIds.length > 0) {
437
+ const conflict = findAddStandardConflict(options);
438
+ if (conflict) {
439
+ console.log(chalk.red(conflict));
440
+ console.log();
441
+ process.exitCode = 1;
442
+ return;
443
+ }
444
+ const request = resolveAddStandardRequest(manifest, addStandardIds);
445
+ if (!request.proceed) return;
446
+ if (request.ids.length === 0) {
447
+ console.log(chalk.gray(t().availableStandards.addNothingDone));
448
+ console.log();
449
+ return;
450
+ }
451
+ addStandards = request.ids;
452
+ }
453
+
457
454
  // Handle --claude-target option (XSPEC-418 R4): switch an EXISTING
458
455
  // installation's claude-code integration target between CLAUDE.md and
459
456
  // CLAUDE.local.md, without a full reinstall. Standalone, like --sync-refs
@@ -530,7 +527,7 @@ export async function updateCommand(options) {
530
527
  // Handle --plan option (DSR dry-run). Nothing below this line writes.
531
528
  if (options.plan) {
532
529
  if (!scopedToSkills && !scopedToCommands) {
533
- await handlePlan(projectPath, options, manifest);
530
+ await handlePlan(projectPath, options, manifest, addStandards);
534
531
  }
535
532
  if (scopedToSkills) await planSkills(projectPath, manifest, options);
536
533
  if (scopedToCommands) await planCommands(projectPath, manifest, options);
@@ -543,10 +540,10 @@ export async function updateCommand(options) {
543
540
  // files only when the manifest records them, so `--skills` is not redundant.
544
541
  if (options.apply || options.force) {
545
542
  if (!scopedToSkills && !scopedToCommands) {
546
- await handleReconcile(projectPath, options, { force: !!options.force });
543
+ await handleReconcile(projectPath, options, { force: !!options.force, addStandards });
547
544
  return;
548
545
  }
549
- await handleReconcile(projectPath, options, { force: !!options.force });
546
+ await handleReconcile(projectPath, options, { force: !!options.force, addStandards });
550
547
  // These exit the process on completion, so run Skills last.
551
548
  if (scopedToCommands) await updateCommandsOnly(projectPath, manifest, options);
552
549
  if (scopedToSkills) await updateSkillsOnly(projectPath, manifest, options);
@@ -1670,23 +1667,11 @@ export async function updateCommand(options) {
1670
1667
  console.log(chalk.gray(` ${msg.updateViaMarketplace}`));
1671
1668
  console.log(chalk.gray(` • ${msg.autoUpdate}`));
1672
1669
  console.log(chalk.gray(` • ${msg.manualUpdate}`));
1673
- } else if (location === 'user') {
1674
- console.log(chalk.yellow(` ${msg.manualInstallDeprecated}`));
1675
- console.log(chalk.gray(` ${msg.recommendedMigrate}`));
1676
- console.log(chalk.gray(' /plugin add https://github.com/anthropics/claude-code-plugins/blob/main/skills/universal-dev-standards.md'));
1677
- console.log(chalk.gray(` ${msg.orUpdateManually}`));
1678
- console.log(chalk.gray(' cd ~/.claude/skills/universal-dev-standards && git pull'));
1679
- } else if (location === 'project') {
1680
- console.log(chalk.yellow(` ${msg.manualInstallDeprecated}`));
1681
- console.log(chalk.gray(` ${msg.recommendedMigrate}`));
1682
- console.log(chalk.gray(' /plugin add https://github.com/anthropics/claude-code-plugins/blob/main/skills/universal-dev-standards.md'));
1683
- console.log(chalk.gray(` ${msg.orUpdateManually}`));
1684
- console.log(chalk.gray(' cd .claude/skills/universal-dev-standards && git pull'));
1685
1670
  } else {
1686
- // Legacy or unknown installation
1687
- console.log(chalk.yellow(` ${msg.manualInstallDeprecated}`));
1688
- console.log(chalk.gray(` ${msg.recommendedMigrate}`));
1689
- console.log(chalk.gray(' /plugin add https://github.com/anthropics/claude-code-plugins/blob/main/skills/universal-dev-standards.md'));
1671
+ // XSPEC-462 R1: project level, user level or not known: one way to update them. This used to call
1672
+ // them "deprecated" and point at a generic plugin URL and a `git pull` in the skills folder; neither
1673
+ // is how UDS installs or updates skills (`uds update --apply --skills` is).
1674
+ console.log(chalk.gray(` ${msg.skillsUpdateCommand}`));
1690
1675
  }
1691
1676
  }
1692
1677
  }
@@ -2974,6 +2959,9 @@ async function updateSkillsOnly(projectPath, manifest, options) {
2974
2959
  finishStepBackup(projectPath, skillsBackup);
2975
2960
 
2976
2961
  console.log();
2962
+ // XSPEC-465 R1: a personal skill with the same name as one of the UDS skills just written wins silently.
2963
+ // Information only: it does not change what was installed or the exit code.
2964
+ printSkillNameCollisionWarning(projectPath);
2977
2965
  process.exit(0);
2978
2966
  }
2979
2967
 
@@ -3618,10 +3606,10 @@ async function handleRollback(projectPath) {
3618
3606
  /**
3619
3607
  * Handle --plan: show what the reconciler would do without executing.
3620
3608
  */
3621
- async function handlePlan(projectPath, options, manifest) {
3609
+ async function handlePlan(projectPath, options, manifest, addStandards = []) {
3622
3610
  const spinner = createSpinner('Calculating reconciliation plan...').start();
3623
3611
 
3624
- const result = await reconcilerPlan(projectPath, { force: false });
3612
+ const result = await reconcilerPlan(projectPath, { force: false, addStandards });
3625
3613
 
3626
3614
  spinner.stop();
3627
3615
 
@@ -3649,10 +3637,17 @@ async function handlePlan(projectPath, options, manifest) {
3649
3637
  // the plan above were silently skipped; the files were still on disk
3650
3638
  // afterwards. Nor is `--force` the answer for "apply what I just read": it
3651
3639
  // recomputes with force:true, a larger plan that rewrites every managed file.
3652
- console.log(chalk.gray('Run `uds update --apply` to apply exactly these changes.'));
3640
+ // A plan made with --add-standard is only applied exactly by an --apply that names the same standards.
3641
+ const addFlags = addStandards.map(id => ` --add-standard ${id}`).join('');
3642
+ console.log(chalk.gray(`Run \`uds update --apply${addFlags}\` to apply exactly these changes.`));
3653
3643
  console.log(chalk.gray('Run `uds update --force` to rewrite every managed file (a larger plan than the one above).'));
3654
3644
  console.log();
3655
3645
  }
3646
+
3647
+ // XSPEC-458 R2: what UDS ships that this project does not have. Information only — it is printed after
3648
+ // the plan is final and nothing above reads it.
3649
+ printAvailableStandardsSection(result.manifest || manifest, { phase: 'plan' });
3650
+ console.log();
3656
3651
  }
3657
3652
 
3658
3653
  /**
@@ -3666,7 +3661,7 @@ async function handlePlan(projectPath, options, manifest) {
3666
3661
  * @param {Object} options - Command options (uses `yes`)
3667
3662
  * @param {{ force: boolean }} mode
3668
3663
  */
3669
- async function handleReconcile(projectPath, options, { force }) {
3664
+ async function handleReconcile(projectPath, options, { force, addStandards = [] }) {
3670
3665
  console.log(chalk.cyan(
3671
3666
  force
3672
3667
  ? 'Running declarative state reconciliation (force mode)...'
@@ -3675,7 +3670,7 @@ async function handleReconcile(projectPath, options, { force }) {
3675
3670
  console.log();
3676
3671
 
3677
3672
  // First show the plan
3678
- const planResult = await reconcilerPlan(projectPath, { force });
3673
+ const planResult = await reconcilerPlan(projectPath, { force, addStandards });
3679
3674
 
3680
3675
  if (planResult.plan.actions.length === 0) {
3681
3676
  // XSPEC-454 R2: nothing to apply, but the manifest may still list skill files UDS never installed
@@ -3683,6 +3678,8 @@ async function handleReconcile(projectPath, options, { force }) {
3683
3678
  const current = readManifest(projectPath);
3684
3679
  if (current && (pruneForeignSkillHashes(current).length + pruneForeignCommandHashes(current).length) > 0) writeManifest(current, projectPath);
3685
3680
  console.log(chalk.green('Everything is up to date. No changes needed.'));
3681
+ // XSPEC-458 R2: "up to date" is about the files UDS manages; say what UDS ships that is not managed here.
3682
+ printAvailableStandardsSection(planResult.manifest, { phase: 'apply' });
3686
3683
  console.log();
3687
3684
  return;
3688
3685
  }
@@ -3709,6 +3706,7 @@ async function handleReconcile(projectPath, options, { force }) {
3709
3706
  const result = await reconcile(projectPath, {
3710
3707
  force,
3711
3708
  backup: true,
3709
+ addStandards,
3712
3710
  onAction: (action, index, total) => {
3713
3711
  spinner.text = `[${index + 1}/${total}] ${action.type} ${action.path || action.category}`;
3714
3712
  }
@@ -3732,5 +3730,7 @@ async function handleReconcile(projectPath, options, { force }) {
3732
3730
  }
3733
3731
  }
3734
3732
 
3733
+ // XSPEC-458 R2: the count of what UDS ships and this project lacks, with the command that installs one.
3734
+ printAvailableStandardsSection(result.manifest || planResult.manifest, { phase: 'apply' });
3735
3735
  console.log();
3736
3736
  }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * What an adopting project declares for `uds open-work`, read from the `open_work` section of
3
+ * uds.project.yaml (dev-platform XSPEC-460 R4 and XSPEC-461 R2: one namespace for both).
4
+ *
5
+ * version: "1"
6
+ * open_work:
7
+ * projects: # logical project name -> where it lives on THIS machine
8
+ * uds: ../universal-dev-standards
9
+ * vibeops: ../vibeops
10
+ * next_action_words: # extra words that mean "next action" in this project's carriers
11
+ * - 待辦
12
+ * command_words: # extra program names read as a command in a next action or a draft
13
+ * - kubectl
14
+ *
15
+ * This file holds no rule. It turns the section into the same `--root NAME=DIR` and
16
+ * `--next-action-word WORD` arguments a person could type, and hands them to the checker, which
17
+ * is self-contained (node builtins only) and therefore cannot read YAML itself. The repository
18
+ * shim `node scripts/check-open-work-tracking.mjs` does not read uds.project.yaml: it takes the
19
+ * flags only.
20
+ *
21
+ * Directories are resolved against the directory holding uds.project.yaml. A relative path keeps
22
+ * the committed file free of a user name and valid on every machine that lays the projects out
23
+ * the same way; an absolute path works but is the machine-specific thing OWT-027 keeps out of a
24
+ * carrier, so it belongs in a file that is not committed.
25
+ *
26
+ * @module core/open-work-config
27
+ */
28
+
29
+ import { resolve, isAbsolute } from 'path';
30
+ import { loadProjectConfig, CONFIG_FILENAME } from './project-config.js';
31
+ import { PROJECT_NAME } from '../utils/open-work-tracking.mjs';
32
+
33
+ /**
34
+ * @returns {{projects: Object<string,string>, nextActionWords: string[], note: string|null, error: string|null}}
35
+ * `note`: the file exists but could not be read at all (nothing was applied; the command goes on).
36
+ * `error`: the file is readable and its open_work section is wrong (the command stops with exit 2).
37
+ */
38
+ export function readOpenWorkDeclarations(cwd = process.cwd()) {
39
+ const out = { projects: {}, nextActionWords: [], commandWords: [], note: null, error: null };
40
+ let config;
41
+ try {
42
+ config = loadProjectConfig(cwd);
43
+ } catch (e) {
44
+ out.note = `${CONFIG_FILENAME} could not be read (${String(e.message).split('\n')[0]}); the open_work declarations in it were not applied`;
45
+ return out;
46
+ }
47
+ const section = config ? config.open_work : undefined;
48
+ if (section === undefined) return out;
49
+ const bad = (why) => { out.error = `${CONFIG_FILENAME}: open_work ${why}`; return out; };
50
+ if (typeof section !== 'object' || Array.isArray(section)) return bad('must be a mapping with projects and next_action_words');
51
+
52
+ if (section.projects !== undefined && section.projects !== null) {
53
+ if (typeof section.projects !== 'object' || Array.isArray(section.projects)) return bad('.projects must be a mapping of project name to directory');
54
+ for (const [name, dir] of Object.entries(section.projects)) {
55
+ if (!PROJECT_NAME.test(name)) return bad(`.projects: "${name}" is not a logical project name (lower-case letters, digits, "-" and "_", starting with a letter, 2 to 32 characters)`);
56
+ if (typeof dir !== 'string' || dir.trim() === '') return bad(`.projects.${name} must be a directory, written as text`);
57
+ out.projects[name] = isAbsolute(dir) ? dir : resolve(cwd, dir);
58
+ }
59
+ }
60
+ if (section.next_action_words !== undefined && section.next_action_words !== null) {
61
+ if (!Array.isArray(section.next_action_words)) return bad('.next_action_words must be a list of words');
62
+ for (const w of section.next_action_words) {
63
+ if (typeof w !== 'string') return bad('.next_action_words must hold text only; write each word as plain text');
64
+ out.nextActionWords.push(w);
65
+ }
66
+ }
67
+ if (section.command_words !== undefined && section.command_words !== null) {
68
+ if (!Array.isArray(section.command_words)) return bad('.command_words must be a list of program names');
69
+ for (const w of section.command_words) {
70
+ if (typeof w !== 'string') return bad('.command_words must hold text only; write each program name as plain text');
71
+ out.commandWords.push(w);
72
+ }
73
+ }
74
+ return out;
75
+ }
76
+
77
+ /**
78
+ * The `--root` arguments for `uds open-work waiting`: what was typed (a plain DIR, and NAME=DIR for other
79
+ * projects), then every project the file declares that was not already named on the command line (the command
80
+ * line wins for a name given in both).
81
+ */
82
+ export function rootArguments(cliRoots, declaredProjects = {}) {
83
+ const given = [].concat(cliRoots ?? []);
84
+ const named = new Set(given.map((v) => /^([^\s/\\=]+)=/.exec(String(v))?.[1]).filter(Boolean));
85
+ const argv = [];
86
+ for (const [name, dir] of Object.entries(declaredProjects)) if (!named.has(name)) argv.push('--root', `${name}=${dir}`);
87
+ for (const v of given) argv.push('--root', v);
88
+ return argv;
89
+ }
90
+
91
+ /** The `--command-word` arguments, merged the same way. */
92
+ export function commandArguments(cliWords, declaredWords = []) {
93
+ const argv = [];
94
+ for (const w of [].concat(cliWords ?? [], declaredWords)) argv.push('--command-word', w);
95
+ return argv;
96
+ }
97
+
98
+ /** The `--next-action-word` arguments: the command line's words, then the file's. Merged, never either-or. */
99
+ export function wordArguments(cliWords, declaredWords = []) {
100
+ const argv = [];
101
+ for (const w of [].concat(cliWords ?? [], declaredWords)) argv.push('--next-action-word', w);
102
+ return argv;
103
+ }
@@ -139,6 +139,16 @@ export async function runInitFlow(options, detected, projectPath) {
139
139
 
140
140
  const installations = await promptSkillsInstallLocation(aiTools);
141
141
 
142
+ // XSPEC-468 R1: the project way is pre-selected, so an empty answer was a deliberate "no". Say what that
143
+ // means (nothing is written to the project) and where the skills can come from instead.
144
+ if (installations.length === 0) {
145
+ console.log();
146
+ console.log(chalk.yellow(msgAfterLang.skillsSkippedTitle));
147
+ for (const line of msgAfterLang.skillsFromPluginLines) {
148
+ console.log(chalk.gray(` ${line}`));
149
+ }
150
+ }
151
+
142
152
  if (installations.length > 0) {
143
153
  const isMarketplace = installations.some(i => i.level === 'marketplace');
144
154