release-skill 0.9.4 → 0.9.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 (58) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codebuddy-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +2 -2
  5. package/.kimi-plugin/plugin.json +1 -1
  6. package/CHANGELOG.md +29 -0
  7. package/INSTALL.md +2 -2
  8. package/INSTALL.zh-CN.md +2 -2
  9. package/README.md +20 -16
  10. package/README.zh-CN.md +19 -16
  11. package/adapters/claude/.claude-plugin/marketplace.json +1 -1
  12. package/adapters/claude/.claude-plugin/plugin.json +1 -1
  13. package/adapters/claude/bin/release-skill.bundle.mjs +866 -166
  14. package/adapters/claude/schemas/release-plan.schema.json +36 -0
  15. package/adapters/claude/schemas/release-project.schema.json +31 -0
  16. package/adapters/claude/skills/release-finish/SKILL.md +5 -5
  17. package/adapters/claude/skills/release-help/SKILL.md +3 -3
  18. package/adapters/claude/skills/release-verify/SKILL.md +2 -1
  19. package/adapters/codex/.codex-plugin/plugin.json +2 -2
  20. package/adapters/codex/bin/release-skill.bundle.mjs +866 -166
  21. package/adapters/codex/schemas/release-plan.schema.json +36 -0
  22. package/adapters/codex/schemas/release-project.schema.json +31 -0
  23. package/adapters/codex/skills/release-finish/SKILL.md +5 -5
  24. package/adapters/codex/skills/release-help/SKILL.md +3 -3
  25. package/adapters/codex/skills/release-verify/SKILL.md +2 -1
  26. package/adapters/kimi/.kimi-plugin/plugin.json +1 -1
  27. package/adapters/kimi/bin/release-skill.bundle.mjs +866 -166
  28. package/adapters/kimi/schemas/release-plan.schema.json +36 -0
  29. package/adapters/kimi/schemas/release-project.schema.json +31 -0
  30. package/adapters/kimi/skills/release-finish/SKILL.md +5 -5
  31. package/adapters/kimi/skills/release-help/SKILL.md +3 -3
  32. package/adapters/kimi/skills/release-verify/SKILL.md +2 -1
  33. package/adapters/workbuddy/.codebuddy-plugin/plugin.json +1 -1
  34. package/adapters/workbuddy/bin/release-skill.bundle.mjs +866 -166
  35. package/adapters/workbuddy/schemas/release-plan.schema.json +36 -0
  36. package/adapters/workbuddy/schemas/release-project.schema.json +31 -0
  37. package/adapters/workbuddy/skills/release-finish/SKILL.md +5 -5
  38. package/adapters/workbuddy/skills/release-help/SKILL.md +3 -3
  39. package/adapters/workbuddy/skills/release-verify/SKILL.md +2 -1
  40. package/bin/release-skill-cli.mjs +87 -20
  41. package/bin/release-skill.bundle.mjs +866 -166
  42. package/package.json +1 -1
  43. package/platform-manifest.json +4 -4
  44. package/schemas/release-plan.schema.json +36 -0
  45. package/schemas/release-project.schema.json +31 -0
  46. package/skills/release-finish/SKILL.md +5 -5
  47. package/skills/release-help/SKILL.md +3 -3
  48. package/skills/release-verify/SKILL.md +2 -1
  49. package/skills-src/release-finish/SKILL.md +5 -5
  50. package/skills-src/release-help/SKILL.md +3 -3
  51. package/skills-src/release-verify/SKILL.md +2 -1
  52. package/src/commands/post-release-local.mjs +204 -10
  53. package/src/commands/prepare.mjs +178 -9
  54. package/src/commands/ship.mjs +26 -11
  55. package/src/commands/verify.mjs +175 -2
  56. package/src/core/plan.mjs +45 -1
  57. package/src/platforms/registry.mjs +97 -0
  58. package/src/readme/contract.mjs +23 -3
package/src/core/plan.mjs CHANGED
@@ -34,7 +34,7 @@ import { digestReleaseAssetIdentities, normalizeReleaseAssets } from './release-
34
34
  // function bodies (after the import graph has settled), never at plan.mjs
35
35
  // module-init time — a top-level read would hit the registry's
36
36
  // not-yet-initialized bindings when the cycle is entered registry-first.
37
- import { PLATFORMS } from '../platforms/registry.mjs';
37
+ import { PLATFORMS, buildExpectedStandaloneIndexInstallIdentity } from '../platforms/registry.mjs';
38
38
 
39
39
  // ---------------------------------------------------------------------------
40
40
  // Schema loaded from the authoritative JSON file (single source of truth)
@@ -1278,6 +1278,7 @@ export function validatePlanActionCompleteness(plan, options = {}) {
1278
1278
  // 也不得接受"用 null 表示存在"的方案。
1279
1279
  if (production && externalMarketplace && dist.marketplaceSourceType === 'standalone-index') {
1280
1280
  const params = action.parameters;
1281
+ const bootstrap = dist.firstReleaseBootstrap === 'manual-index-checkpoint';
1281
1282
  if (params) {
1282
1283
  if (!params.marketplaceIndexPath) {
1283
1284
  failures.push(
@@ -1294,6 +1295,41 @@ export function validatePlanActionCompleteness(plan, options = {}) {
1294
1295
  `unit "${unitId}", action "${action.id}": parameters.selectedEntry is required for production standalone-index`,
1295
1296
  );
1296
1297
  }
1298
+ if (bootstrap) {
1299
+ if (params.firstReleaseBootstrap !== 'manual-index-checkpoint') {
1300
+ failures.push(
1301
+ `unit "${unitId}", action "${action.id}": parameters.firstReleaseBootstrap must be manual-index-checkpoint for a bootstrap distribution`,
1302
+ );
1303
+ }
1304
+ if (params.marketplaceIndexSha !== null) {
1305
+ failures.push(
1306
+ `unit "${unitId}", action "${action.id}": parameters.marketplaceIndexSha must remain null until the manual index checkpoint`,
1307
+ );
1308
+ }
1309
+ let expectedEntry = null;
1310
+ try {
1311
+ expectedEntry = buildExpectedStandaloneIndexInstallIdentity(platform, {
1312
+ name: plugin,
1313
+ version: targetVersion,
1314
+ repo: publicRepo,
1315
+ tag: expectedTag,
1316
+ sha: frozen?.commit,
1317
+ });
1318
+ } catch {
1319
+ // Missing frozen identity is reported by the surrounding
1320
+ // production-field checks; do not turn completeness into an
1321
+ // uncaught implementation error.
1322
+ }
1323
+ if (!expectedEntry || canonicalJson(params.selectedEntry) !== canonicalJson(expectedEntry)) {
1324
+ failures.push(
1325
+ `unit "${unitId}", action "${action.id}": bootstrap selectedEntry does not match the frozen plugin repository, tag, commit, and version`,
1326
+ );
1327
+ }
1328
+ } else if (params.firstReleaseBootstrap !== undefined || params.marketplaceIndexSha !== undefined) {
1329
+ failures.push(
1330
+ `unit "${unitId}", action "${action.id}": bootstrap-only fields are not allowed without firstReleaseBootstrap`,
1331
+ );
1332
+ }
1297
1333
  }
1298
1334
  }
1299
1335
 
@@ -1329,6 +1365,14 @@ export function validatePlanActionCompleteness(plan, options = {}) {
1329
1365
  _checkRequired(action, 'expected.ref', action.expected?.ref, action.parameters?.ref, unitId, failures);
1330
1366
  _checkRequired(action, 'expected.marketplaceLocation', action.expected?.marketplaceLocation, 'external', unitId, failures);
1331
1367
  _checkRequired(action, 'expected.marketplaceCommitSha', action.expected?.marketplaceCommitSha, action.parameters?.marketplaceCommitSha, unitId, failures);
1368
+ if (dist.firstReleaseBootstrap === 'manual-index-checkpoint') {
1369
+ _checkRequired(action, 'expected.firstReleaseBootstrap', action.expected?.firstReleaseBootstrap, 'manual-index-checkpoint', unitId, failures);
1370
+ if (action.expected?.marketplaceIndexSha !== null) {
1371
+ failures.push(
1372
+ `unit "${unitId}", action "${action.id}": expected.marketplaceIndexSha must be null until the manual index checkpoint`,
1373
+ );
1374
+ }
1375
+ }
1332
1376
  } else {
1333
1377
  _checkRequired(action, 'expected.repo', action.expected?.repo, publicRepo, unitId, failures);
1334
1378
  _checkRequired(action, 'expected.ref', action.expected?.ref, expectedTag, unitId, failures);
@@ -438,6 +438,103 @@ export function getPlatform(id) {
438
438
  return platform;
439
439
  }
440
440
 
441
+ const STANDALONE_SHA_RE = /^[0-9a-f]{40}$/u;
442
+
443
+ function standaloneIdentityCore(platformOrId, fields) {
444
+ const platform = typeof platformOrId === 'string' ? getPlatform(platformOrId) : platformOrId;
445
+ const id = platform?.id;
446
+ if (id !== 'claude' && id !== 'codex') {
447
+ throw new Error(`standalone-index install identity is unsupported for platform "${id ?? '<unknown>'}"`);
448
+ }
449
+ const { name, source, version } = fields;
450
+ if (typeof name !== 'string' || name.length === 0
451
+ || !source || typeof source !== 'object' || Array.isArray(source)
452
+ || typeof source.source !== 'string'
453
+ || typeof source.ref !== 'string' || source.ref.length === 0
454
+ || typeof source.sha !== 'string' || !STANDALONE_SHA_RE.test(source.sha)) {
455
+ throw new Error(`${id} standalone-index install identity has invalid owned fields`);
456
+ }
457
+ if (id === 'claude') {
458
+ if (source.source !== 'github' || typeof source.repo !== 'string' || source.repo.length === 0
459
+ || typeof version !== 'string' || version.length === 0) {
460
+ throw new Error('Claude standalone-index install identity requires github repo, ref, sha, and version');
461
+ }
462
+ return {
463
+ name,
464
+ source: { source: 'github', repo: source.repo, ref: source.ref, sha: source.sha },
465
+ version,
466
+ };
467
+ }
468
+ if (source.source !== 'url' || typeof source.url !== 'string' || source.url.length === 0) {
469
+ throw new Error('Codex standalone-index install identity requires url, ref, and sha');
470
+ }
471
+ return {
472
+ name,
473
+ source: { source: 'url', url: source.url, ref: source.ref, sha: source.sha },
474
+ };
475
+ }
476
+
477
+ /** Build the expected install identity from the frozen plugin contract. */
478
+ export function buildExpectedStandaloneIndexInstallIdentity(platformOrId, frozenIdentity = {}) {
479
+ const platform = typeof platformOrId === 'string' ? getPlatform(platformOrId) : platformOrId;
480
+ const id = platform?.id;
481
+ const { name, repo, tag, sha, version } = frozenIdentity;
482
+ if (typeof repo !== 'string' || repo.length === 0 || typeof tag !== 'string' || tag.length === 0) {
483
+ throw new Error('standalone-index expected identity requires a plugin repository and tag');
484
+ }
485
+ if (id === 'claude') {
486
+ return standaloneIdentityCore(platform, {
487
+ name,
488
+ version,
489
+ source: { source: 'github', repo, ref: tag, sha },
490
+ });
491
+ }
492
+ if (id === 'codex') {
493
+ return standaloneIdentityCore(platform, {
494
+ name,
495
+ source: { source: 'url', url: `https://github.com/${repo}.git`, ref: `refs/tags/${tag}`, sha },
496
+ });
497
+ }
498
+ return standaloneIdentityCore(platform, { name, source: {}, version });
499
+ }
500
+
501
+ /** Project only the actual remote entry; frozen plan fields are never accepted. */
502
+ export function projectObservedStandaloneIndexInstallIdentity(platformOrId, entry) {
503
+ const platform = typeof platformOrId === 'string' ? getPlatform(platformOrId) : platformOrId;
504
+ const id = platform?.id;
505
+ if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {
506
+ throw new Error('standalone-index observed identity requires an entry object');
507
+ }
508
+ const source = entry.source;
509
+ if (!source || typeof source !== 'object' || Array.isArray(source)) {
510
+ throw new Error('standalone-index observed identity requires a source object');
511
+ }
512
+ if (id === 'claude') {
513
+ return standaloneIdentityCore(platform, {
514
+ name: entry.name,
515
+ version: entry.version,
516
+ source: {
517
+ source: source.source,
518
+ repo: source.repo,
519
+ ref: source.ref,
520
+ sha: source.sha,
521
+ },
522
+ });
523
+ }
524
+ if (id === 'codex') {
525
+ return standaloneIdentityCore(platform, {
526
+ name: entry.name,
527
+ source: {
528
+ source: source.source,
529
+ url: source.url,
530
+ ref: source.ref,
531
+ sha: source.sha,
532
+ },
533
+ });
534
+ }
535
+ return standaloneIdentityCore(platform, { name: entry.name, source });
536
+ }
537
+
441
538
  /**
442
539
  * Resolve a declared skill projection surface to its public host name.
443
540
  * The host is always derived from the descriptor's authoritative
@@ -169,6 +169,28 @@ function findSkillNames(content, manifestSkillNames) {
169
169
  return manifestSkillNames.filter((name) => content.includes(name));
170
170
  }
171
171
 
172
+ /**
173
+ * Determine whether README content contains a supported installation command.
174
+ *
175
+ * npm and npx remain compatible with the original whole-document check. The
176
+ * platform plugin commands are checked only inside Markdown code so that a
177
+ * marketplace-source explanation cannot be mistaken for an installation.
178
+ * @param {string} content
179
+ * @returns {boolean}
180
+ */
181
+ function hasInstallCommand(content) {
182
+ if (/npm\s+install|npx\s+release-skill|npm\s+i\s+release-skill/i.test(content)) {
183
+ return true;
184
+ }
185
+
186
+ const codeBlocks = [
187
+ ...[...content.matchAll(/```[^\n]*\n([\s\S]*?)```/g)].map((match) => match[1]),
188
+ ...[...content.matchAll(/`([^`\n]+)`/g)].map((match) => match[1]),
189
+ ];
190
+ const pluginInstall = /^(?:[$>]\s*)?(?:codex\s+plugin\s+add|claude\s+plugin\s+install)\s+\S+/i;
191
+ return codeBlocks.some((block) => block.split('\n').some((line) => pluginInstall.test(line.trim())));
192
+ }
193
+
172
194
  // ---------------------------------------------------------------------------
173
195
  // Public API
174
196
  // ---------------------------------------------------------------------------
@@ -250,9 +272,7 @@ export async function evaluateReadme({ snapshotDir, pluginManifest }) {
250
272
 
251
273
  // Readability checks: installation, minimal example, failure diagnosis
252
274
  const readabilityChecks = {
253
- hasInstall: enContent
254
- ? /npm\s+install|npx\s+release-skill|npm\s+i\s+release-skill/i.test(enContent)
255
- : false,
275
+ hasInstall: enContent ? hasInstallCommand(enContent) : false,
256
276
  hasMinimalExample: enContent
257
277
  ? /```[\s\S]*?(release-skill|assess|prepare|help)[\s\S]*?```/i.test(enContent)
258
278
  : false,