universal-dev-standards 6.14.0-beta.5 → 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.
- package/README.md +13 -3
- package/bin/uds.js +32 -7
- package/bundled/ai/options/code-review/pr-review.ai.yaml +20 -1
- package/bundled/ai/standards/code-review.ai.yaml +15 -2
- package/bundled/ai/standards/commit-message.ai.yaml +6 -2
- package/bundled/ai/standards/developer-memory.ai.yaml +12 -2
- package/bundled/ai/standards/full-coverage-testing.ai.yaml +44 -6
- package/bundled/ai/standards/open-work-tracking.ai.yaml +191 -11
- package/bundled/ai/standards/pipeline-security-gates.ai.yaml +48 -3
- package/bundled/ai/standards/project-context-memory.ai.yaml +12 -2
- package/bundled/core/code-review-checklist.md +20 -2
- package/bundled/core/developer-memory.md +12 -2
- package/bundled/core/full-coverage-testing.md +44 -4
- package/bundled/core/open-work-tracking.md +156 -16
- package/bundled/core/pipeline-security-gates.md +63 -0
- package/bundled/core/project-context-memory.md +10 -2
- package/bundled/locales/zh-CN/CHANGELOG.md +75 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/SECURITY.md +1 -1
- package/bundled/locales/zh-CN/adoption/ADOPTION-GUIDE.md +13 -4
- package/bundled/locales/zh-CN/adoption/STATIC-DYNAMIC-GUIDE.md +7 -1
- package/bundled/locales/zh-CN/adoption/checklists/enterprise.md +7 -1
- package/bundled/locales/zh-CN/adoption/checklists/minimal.md +13 -3
- package/bundled/locales/zh-CN/adoption/checklists/recommended.md +7 -1
- package/bundled/locales/zh-CN/core/code-review-checklist.md +17 -0
- package/bundled/locales/zh-CN/core/developer-memory.md +9 -0
- package/bundled/locales/zh-CN/core/full-coverage-testing.md +48 -8
- package/bundled/locales/zh-CN/core/pipeline-security-gates.md +64 -4
- package/bundled/locales/zh-CN/core/project-context-memory.md +5 -0
- package/bundled/locales/zh-CN/docs/AVAILABLE-STANDARDS.md +70 -0
- package/bundled/locales/zh-CN/docs/CHEATSHEET.md +5 -4
- package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +25 -23
- package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +15 -12
- package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +6 -6
- package/bundled/locales/zh-CN/docs/WINDOWS-GUIDE.md +7 -1
- package/bundled/locales/zh-CN/docs/user/GETTING-STARTED.md +44 -0
- package/bundled/locales/zh-CN/options/code-review/pr-review.md +13 -2
- package/bundled/locales/zh-TW/CHANGELOG.md +75 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/SECURITY.md +1 -1
- package/bundled/locales/zh-TW/adoption/ADOPTION-GUIDE.md +13 -4
- package/bundled/locales/zh-TW/adoption/STATIC-DYNAMIC-GUIDE.md +7 -1
- package/bundled/locales/zh-TW/adoption/checklists/enterprise.md +7 -1
- package/bundled/locales/zh-TW/adoption/checklists/minimal.md +13 -3
- package/bundled/locales/zh-TW/adoption/checklists/recommended.md +7 -1
- package/bundled/locales/zh-TW/core/code-review-checklist.md +17 -0
- package/bundled/locales/zh-TW/core/developer-memory.md +9 -0
- package/bundled/locales/zh-TW/core/full-coverage-testing.md +48 -8
- package/bundled/locales/zh-TW/core/open-work-tracking.md +90 -14
- package/bundled/locales/zh-TW/core/pipeline-security-gates.md +64 -4
- package/bundled/locales/zh-TW/core/project-context-memory.md +5 -0
- package/bundled/locales/zh-TW/docs/AVAILABLE-STANDARDS.md +70 -0
- package/bundled/locales/zh-TW/docs/CHEATSHEET.md +5 -4
- package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +25 -23
- package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +15 -12
- package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +6 -6
- package/bundled/locales/zh-TW/docs/WINDOWS-GUIDE.md +7 -1
- package/bundled/locales/zh-TW/docs/user/GETTING-STARTED.md +44 -0
- package/bundled/locales/zh-TW/options/code-review/pr-review.md +13 -2
- package/bundled/skills/SKILL_NAMING.md +9 -0
- package/bundled/templates/gates/check-anti-fake-tests.mjs +305 -5
- package/package.json +3 -1
- package/src/commands/audit.js +9 -2
- package/src/commands/check.js +17 -0
- package/src/commands/deps.js +31 -1
- package/src/commands/init.js +41 -21
- package/src/commands/open-work.js +65 -6
- package/src/commands/simulate.js +20 -8
- package/src/commands/skills.js +59 -33
- package/src/commands/spec.js +14 -8
- package/src/commands/update.js +106 -66
- package/src/core/manifest.js +12 -10
- package/src/core/marketplace-sentinel.js +5 -0
- package/src/core/open-work-config.js +103 -0
- package/src/core/project-config.js +58 -38
- package/src/flows/init-flow.js +10 -0
- package/src/i18n/messages.js +264 -60
- package/src/installers/skills-installer.js +3 -1
- package/src/prompts/init.js +148 -13
- package/src/reconciler/backup-locations.js +75 -0
- package/src/reconciler/backup-manager.js +29 -45
- package/src/reconciler/index.js +62 -8
- package/src/utils/available-standards-report.js +144 -0
- package/src/utils/available-standards.js +216 -0
- package/src/utils/commit-message-judge.js +137 -0
- package/src/utils/copier.js +5 -4
- package/src/utils/deps-applicability.js +25 -0
- package/src/utils/friction-detector.js +27 -0
- package/src/utils/installed-names-ownership.js +114 -0
- package/src/utils/open-work-tracking.mjs +919 -48
- package/src/utils/sdd-header.js +65 -0
- package/src/utils/skill-frontmatter.js +102 -0
- package/src/utils/skill-name-collision.js +169 -0
- package/src/utils/skills-install-paths.js +114 -0
- package/src/utils/skills-installer.js +63 -105
- package/src/utils/standard-validator.js +98 -27
- package/src/utils/transient-fs.js +113 -0
- package/src/vibe/micro-spec.js +15 -0
- package/standards-registry.json +9 -9
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which names in `manifest.skills.names` / `manifest.commands.names` UDS can still vouch for.
|
|
3
|
+
* // implements XSPEC-456 R4
|
|
4
|
+
*
|
|
5
|
+
* XSPEC-454 R2 cleaned `skillHashes` and `commandHashes` and left these two lists alone, on the
|
|
6
|
+
* reasoning that an over-long list is harmless. It is not: after `uds update --apply --skills` removed
|
|
7
|
+
* the `_shared`, `agents`, `ai`, `tools` and `workflows` folders an old CLI had copied into the skills
|
|
8
|
+
* folder, the manifest still listed all five as installed skills (61 names for 56 skills), which
|
|
9
|
+
* contradicted both the disk and the release notes' claim that the records were cleaned.
|
|
10
|
+
*
|
|
11
|
+
* The rule is the one XSPEC-454 R2 uses for the hash records: **what UDS can vouch for stays**.
|
|
12
|
+
* - a skill (command) name stays only if UDS ships a skill (command) of that name;
|
|
13
|
+
* - when asked to (`checkDisk`), only if it is also present in one of the places the manifest says
|
|
14
|
+
* it was installed. That second test is skipped when it cannot be made (no install location
|
|
15
|
+
* recorded, or none of the recorded folders exists): a name list is never emptied because the
|
|
16
|
+
* tool could not find where to look.
|
|
17
|
+
*
|
|
18
|
+
* Every manifest field that records skill or command NAMES, and what handles it:
|
|
19
|
+
* skills.names -> this module (skills)
|
|
20
|
+
* commands.names -> this module (commands)
|
|
21
|
+
* skillHashes -> utils/skill-hash-ownership.js (XSPEC-454 R2; the name is the 3rd path segment)
|
|
22
|
+
* commandHashes -> utils/command-hash-ownership.js (XSPEC-454 R2; the name is the file stem)
|
|
23
|
+
* `skills.installations` / `commands.installations` record tools and levels, not names, and
|
|
24
|
+
* `installedArtifacts` records only integration files and created directories.
|
|
25
|
+
*
|
|
26
|
+
* @module utils/installed-names-ownership
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { existsSync } from 'fs';
|
|
30
|
+
import { join } from 'path';
|
|
31
|
+
import { getAvailableSkillNames, getAvailableCommandNames } from './skills-installer.js';
|
|
32
|
+
import { MARKETPLACE_NAMES_SENTINEL } from '../core/marketplace-sentinel.js';
|
|
33
|
+
import { getSkillsDirForAgent, getCommandsDirForAgent, getCommandFileExtension } from '../config/ai-agent-paths.js';
|
|
34
|
+
|
|
35
|
+
/** Below these sizes the source tree did not load; never read that as "UDS ships nothing". */
|
|
36
|
+
const MIN_SHIPPED = 10;
|
|
37
|
+
|
|
38
|
+
/** `{ agent, level }` for every recorded installation (strings are legacy project-level entries). */
|
|
39
|
+
function installationsOf(section) {
|
|
40
|
+
return (section?.installations || [])
|
|
41
|
+
.map((entry) => (typeof entry === 'string'
|
|
42
|
+
? { agent: entry, level: 'project' }
|
|
43
|
+
: { agent: entry?.agent, level: entry?.level || 'project' }))
|
|
44
|
+
.filter((entry) => entry.agent);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Folders a skill of the recorded installations would live in. Empty when the manifest does not say. */
|
|
48
|
+
function skillFolders(manifest, projectPath) {
|
|
49
|
+
const dirs = installationsOf(manifest.skills)
|
|
50
|
+
.map(({ agent, level }) => getSkillsDirForAgent(agent, level, projectPath))
|
|
51
|
+
.filter(Boolean);
|
|
52
|
+
if (dirs.length > 0) return dirs;
|
|
53
|
+
// A legacy manifest records no installations, only where the skills went.
|
|
54
|
+
const location = manifest.skills?.location;
|
|
55
|
+
if (location === 'project' || location === 'user') {
|
|
56
|
+
const dir = getSkillsDirForAgent('claude-code', location, projectPath);
|
|
57
|
+
return dir ? [dir] : [];
|
|
58
|
+
}
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** `[folder, extension]` pairs where a command of the recorded installations would live. */
|
|
63
|
+
function commandFolders(manifest, projectPath) {
|
|
64
|
+
return installationsOf(manifest.commands)
|
|
65
|
+
.map(({ agent, level }) => [getCommandsDirForAgent(agent, level, projectPath), getCommandFileExtension(agent)])
|
|
66
|
+
.filter(([dir]) => Boolean(dir));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function prune(names, keep) {
|
|
70
|
+
const kept = [];
|
|
71
|
+
const dropped = [];
|
|
72
|
+
for (const name of names) (keep(name) ? kept : dropped).push(name);
|
|
73
|
+
return { kept, dropped: dropped.sort() };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Drop the names in `manifest.skills.names` that UDS cannot vouch for. Mutates `manifest`.
|
|
78
|
+
*
|
|
79
|
+
* @param {Object} manifest
|
|
80
|
+
* @param {string} projectPath
|
|
81
|
+
* @param {Object} [options]
|
|
82
|
+
* @param {boolean} [options.checkDisk=false] - also require the skill to be present where it was installed
|
|
83
|
+
* @param {Set<string>} [options.shipped] - Injection point for tests; defaults to the skills this CLI ships
|
|
84
|
+
* @returns {string[]} The names dropped, sorted
|
|
85
|
+
*/
|
|
86
|
+
export function pruneForeignSkillNames(manifest, projectPath, { checkDisk = false, shipped = new Set(getAvailableSkillNames()) } = {}) {
|
|
87
|
+
const names = manifest?.skills?.names;
|
|
88
|
+
if (!Array.isArray(names) || shipped.size < MIN_SHIPPED) return [];
|
|
89
|
+
// Marketplace installs record a sentinel instead of names; there is nothing to prune.
|
|
90
|
+
if (names.includes(MARKETPLACE_NAMES_SENTINEL)) return [];
|
|
91
|
+
|
|
92
|
+
const dirs = checkDisk ? skillFolders(manifest, projectPath) : [];
|
|
93
|
+
const diskTestPossible = dirs.some((dir) => existsSync(dir));
|
|
94
|
+
const { kept, dropped } = prune(names, (name) =>
|
|
95
|
+
shipped.has(name) && (!diskTestPossible || dirs.some((dir) => existsSync(join(dir, name)))));
|
|
96
|
+
if (dropped.length > 0) manifest.skills.names = kept;
|
|
97
|
+
return dropped;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Drop the names in `manifest.commands.names` that UDS cannot vouch for. Mutates `manifest`.
|
|
102
|
+
* Same contract as {@link pruneForeignSkillNames}.
|
|
103
|
+
*/
|
|
104
|
+
export function pruneForeignCommandNames(manifest, projectPath, { checkDisk = false, shipped = new Set(getAvailableCommandNames()) } = {}) {
|
|
105
|
+
const names = manifest?.commands?.names;
|
|
106
|
+
if (!Array.isArray(names) || shipped.size < MIN_SHIPPED) return [];
|
|
107
|
+
|
|
108
|
+
const places = checkDisk ? commandFolders(manifest, projectPath) : [];
|
|
109
|
+
const diskTestPossible = places.some(([dir]) => existsSync(dir));
|
|
110
|
+
const { kept, dropped } = prune(names, (name) =>
|
|
111
|
+
shipped.has(name) && (!diskTestPossible || places.some(([dir, ext]) => existsSync(join(dir, `${name}${ext}`)))));
|
|
112
|
+
if (dropped.length > 0) manifest.commands.names = kept;
|
|
113
|
+
return dropped;
|
|
114
|
+
}
|