create-yss-spec 3.5.4 → 3.5.5

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 (104) hide show
  1. package/README.md +8 -0
  2. package/cli-core.lock.json +130 -0
  3. package/package.json +7 -3
  4. package/resources/upgrade-skill/SKILL.md +26 -0
  5. package/resources/upgrade-skill/protocol.md +40 -0
  6. package/resources/upgrade-skill/references/cli-families.md +14 -0
  7. package/src/cli/help.js +1 -0
  8. package/src/cli/index.js +12 -0
  9. package/src/filesystem/transaction-runner.js +27 -0
  10. package/src/template/asset-runtime.js +6 -0
  11. package/src/template/verification-runtime.js +9 -1
  12. package/template/.agents/skills/.strategic-design-skills-manifest.json +2 -2
  13. package/template/.agents/skills/yss-harness-upgrade/SKILL.md +26 -0
  14. package/template/.agents/skills/yss-harness-upgrade/references/cli-families.md +14 -0
  15. package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -0
  16. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +15 -19
  17. package/template/.agents/skills/yss-stage-decision/SKILL.md +3 -0
  18. package/template/.agents/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -4
  19. package/template/.agents/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -4
  20. package/template/.agents/skills/yss-stage-decision/tests/run-scenarios.mjs +13 -1
  21. package/template/.codex/skills/yss-harness-upgrade/SKILL.md +26 -0
  22. package/template/.codex/skills/yss-harness-upgrade/references/cli-families.md +14 -0
  23. package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -0
  24. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +15 -19
  25. package/template/.codex/skills/yss-stage-decision/SKILL.md +3 -0
  26. package/template/.codex/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -4
  27. package/template/.codex/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -4
  28. package/template/.codex/skills/yss-stage-decision/tests/run-scenarios.mjs +13 -1
  29. package/template/.cursor/skills/yss-harness-upgrade/SKILL.md +26 -0
  30. package/template/.cursor/skills/yss-harness-upgrade/references/cli-families.md +14 -0
  31. package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -0
  32. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +15 -19
  33. package/template/.cursor/skills/yss-stage-decision/SKILL.md +3 -0
  34. package/template/.cursor/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -4
  35. package/template/.cursor/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -4
  36. package/template/.cursor/skills/yss-stage-decision/tests/run-scenarios.mjs +13 -1
  37. package/template/.pi/skills/yss-harness-upgrade/SKILL.md +26 -0
  38. package/template/.pi/skills/yss-harness-upgrade/references/cli-families.md +14 -0
  39. package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +1 -0
  40. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +15 -19
  41. package/template/.pi/skills/yss-stage-decision/SKILL.md +3 -0
  42. package/template/.pi/skills/yss-stage-decision/scripts/validate-domain-strategy.mjs +8 -4
  43. package/template/.pi/skills/yss-stage-decision/scripts/validate-stage-decision-package.mjs +8 -4
  44. package/template/.pi/skills/yss-stage-decision/tests/run-scenarios.mjs +13 -1
  45. package/template/.template-spec/agents/yss-skill-registry.yaml +9 -1
  46. package/template/.template-spec/process/contract-reading.md +1 -1
  47. package/template/.template-spec/process/document-writing.md +12 -0
  48. package/template/.template-spec/process/harness-upgrade.md +40 -0
  49. package/template/.template-spec/process/lifecycle-artifact-map.md +2 -2
  50. package/template/.template-spec/process/lifecycle-registry.yaml +3 -1
  51. package/template/.template-spec/process/schemas/approval-record.schema.json +23 -0
  52. package/template/.template-spec/process/stage-tracking.md +2 -2
  53. package/template/.template-spec/process/structured-assets.md +35 -0
  54. package/template/.template-spec/process/templates/lifecycle-checkpoint-template.json +48 -0
  55. package/template/.template-spec/templates/approval-record-template.json +23 -0
  56. package/template/scripts/check-plan-stage-coverage +12 -0
  57. package/template/scripts/contract +6 -0
  58. package/template/scripts/lib/approval-record.mjs +4 -3
  59. package/template/scripts/lib/asset-command.mjs +35 -0
  60. package/template/scripts/lib/asset-migration.mjs +101 -0
  61. package/template/scripts/lib/asset-transactions.mjs +235 -0
  62. package/template/scripts/lib/checkpoint-boundary.mjs +3 -0
  63. package/template/scripts/lib/contract-views.mjs +7 -1
  64. package/template/scripts/lib/json-schema.mjs +43 -4
  65. package/template/scripts/lib/lifecycle-context-query.mjs +7 -0
  66. package/template/scripts/lib/lifecycle-presentation.mjs +77 -0
  67. package/template/scripts/lib/lifecycle-status.mjs +16 -1
  68. package/template/scripts/lib/plan-stage-coverage.mjs +40 -0
  69. package/template/scripts/lib/reading-view-bundle.mjs +1 -0
  70. package/template/scripts/lib/reading-view-markdown.mjs +8 -6
  71. package/template/scripts/lib/stage-tracking-migration.mjs +11 -3
  72. package/template/scripts/lib/structured-assets.mjs +81 -0
  73. package/template/scripts/lib/task-package.mjs +4 -1
  74. package/template/scripts/lifecycle-status +6 -3
  75. package/template/scripts/verify-lifecycle-checkpoint +8 -5
  76. package/template/skills-lock.json +21 -9
  77. package/template.manifest.json +2 -1
  78. package/template.snapshot.json +5 -5
  79. package/vendor/cli-core/build.mjs +302 -0
  80. package/vendor/cli-core/bundle.mjs +198 -0
  81. package/vendor/cli-core/cli.mjs +182 -0
  82. package/vendor/cli-core/command-runner.mjs +107 -0
  83. package/vendor/cli-core/engine.mjs +239 -0
  84. package/vendor/cli-core/family.mjs +28 -0
  85. package/vendor/cli-core/gitignore.mjs +15 -0
  86. package/vendor/cli-core/identity.mjs +274 -0
  87. package/vendor/cli-core/io.mjs +153 -0
  88. package/vendor/cli-core/layout-migration.mjs +64 -0
  89. package/vendor/cli-core/legacy.mjs +19 -0
  90. package/vendor/cli-core/migrate.mjs +237 -0
  91. package/vendor/cli-core/migration-adapter.mjs +19 -0
  92. package/vendor/cli-core/package.json +13 -0
  93. package/vendor/cli-core/scaffold.mjs +117 -0
  94. package/vendor/cli-core/spec-migration-adapter.mjs +83 -0
  95. package/vendor/cli-core/tests/build.test.mjs +40 -0
  96. package/vendor/cli-core/tests/cli.test.mjs +1065 -0
  97. package/vendor/cli-core/tests/migration-version.test.mjs +8 -0
  98. package/vendor/cli-core/tests/package-contract.mjs +75 -0
  99. package/vendor/cli-core/transaction.mjs +529 -0
  100. package/vendor/cli-core/update.mjs +79 -0
  101. package/vendor/cli-core/vendor/NOTICES.md +6 -0
  102. package/vendor/cli-core/vendor/yaml.LICENSE +13 -0
  103. package/vendor/cli-core/vendor/yaml.mjs +6311 -0
  104. package/vendor/cli-core/verification.mjs +131 -0
@@ -0,0 +1,79 @@
1
+ import path from "node:path";
2
+ import { runCommandSync } from "./command-runner.mjs";
3
+ import { ensure, stat } from "./io.mjs";
4
+ function npm(args, cwd) {
5
+ const r = runCommandSync("npm", args, { cwd, timeoutMs: 120000 });
6
+ ensure(
7
+ !r.error && r.status === 0,
8
+ `npm ${args[0]} 失败: ${r.termination || r.error?.message || r.stderr}`,
9
+ "UPDATE",
10
+ );
11
+ return r.stdout.trim();
12
+ }
13
+ function version(v) {
14
+ ensure(/^\d+\.\d+\.\d+$/.test(v), `不支持的稳定版本号: ${v}`, "UPDATE");
15
+ return v.split(".").map(Number);
16
+ }
17
+ export function update(packageRoot, pkg, opts) {
18
+ packageRoot = path.resolve(packageRoot);
19
+ const packageName = pkg.name;
20
+ ensure(
21
+ /^create-yss-harness-(design|backend|frontend)$/.test(packageName),
22
+ "未知升级包名",
23
+ );
24
+ const latestVersion = npm(["view", packageName, "version"]).replace(
25
+ /^"|"$/g,
26
+ "",
27
+ );
28
+ const current = version(pkg.version),
29
+ latest = version(latestVersion);
30
+ let comparison = 0;
31
+ for (let i = 0; i < 3; i++) {
32
+ if (latest[i] !== current[i]) {
33
+ comparison = latest[i] > current[i] ? 1 : -1;
34
+ break;
35
+ }
36
+ }
37
+ const result = {
38
+ schemaVersion: 1,
39
+ command: opts.command,
40
+ packageName,
41
+ currentVersion: pkg.version,
42
+ latestVersion,
43
+ status: "current",
44
+ advice: `npx ${packageName}@latest --help`,
45
+ };
46
+ if (comparison < 0 || (comparison === 0 && !opts.force)) return result;
47
+ let kind = "unknown",
48
+ cwd,
49
+ args;
50
+ if (packageRoot.split(path.sep).includes("_npx")) kind = "npx";
51
+ else if (stat(path.join(packageRoot, ".git"))) kind = "source";
52
+ else {
53
+ const prefix = path.resolve(npm(["prefix", "-g"]));
54
+ if (
55
+ [
56
+ path.join(prefix, "lib", "node_modules", packageName),
57
+ path.join(prefix, "node_modules", packageName),
58
+ ].includes(packageRoot)
59
+ ) {
60
+ kind = "global";
61
+ args = ["install", "-g", `${packageName}@latest`];
62
+ } else if (
63
+ path.basename(path.dirname(packageRoot)) === "node_modules" &&
64
+ path.basename(packageRoot) === packageName
65
+ ) {
66
+ kind = "local";
67
+ cwd = path.dirname(path.dirname(packageRoot));
68
+ args = ["install", `${packageName}@latest`];
69
+ }
70
+ }
71
+ result.installKind = kind;
72
+ result.status = args ? (opts.dryRun ? "preview" : "updated") : "instructions";
73
+ if (args) {
74
+ result.commandLine = ["npm", ...args];
75
+ result.cwd = cwd || null;
76
+ if (!opts.dryRun) result.output = npm(args, cwd);
77
+ }
78
+ return result;
79
+ }
@@ -0,0 +1,6 @@
1
+ # yaml parser
2
+
3
+ yaml 2.9.0 (ISC), github:eemeli/yaml. Bundle copied from the canonical
4
+ `scripts/vendor/yaml.mjs` (esbuild 0.28.2, node22).
5
+ SHA-256: 58c510627769ef4e75e90bcf410d63ba33e64b46bc9cfc53149839d5ccb1709b.
6
+ The accompanying yaml.LICENSE preserves the upstream license.
@@ -0,0 +1,13 @@
1
+ Copyright Eemeli Aro <eemeli@gmail.com>
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any purpose
4
+ with or without fee is hereby granted, provided that the above copyright notice
5
+ and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
9
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
11
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
12
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
13
+ THIS SOFTWARE.