dsh-agent-team-presets 0.3.2 → 0.3.3

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 (101) hide show
  1. package/NOTICE +57 -3
  2. package/README.md +73 -398
  3. package/README.zh.md +79 -404
  4. package/assets/card-patches/catalog.json +20 -0
  5. package/assets/card-patches/dsh-context-0.85.0.client.js.gz +0 -0
  6. package/assets/card-patches/dsh-context-0.85.1.client.js.gz +0 -0
  7. package/assets/skills/agent-leader-communication/SKILL.md +100 -0
  8. package/assets/skills/agent-subagent-orchestration/SKILL.md +56 -0
  9. package/assets/skills/agent-subagent-orchestration/references/executor-parallel-execution.md +56 -0
  10. package/assets/skills/agent-subagent-orchestration/references/leader-discovery.md +53 -0
  11. package/assets/skills/agent-subagent-orchestration/references/subagent-communication.md +58 -0
  12. package/assets/skills/backend-architecture-workflow/SKILL.md +55 -0
  13. package/assets/skills/backend-architecture-workflow/references/README.md +9 -0
  14. package/assets/skills/backend-architecture-workflow/references/architecture-audit.md +70 -0
  15. package/assets/skills/backend-architecture-workflow/references/architecture-decay-risks.md +75 -0
  16. package/assets/skills/backend-architecture-workflow/references/architecture-design.md +151 -0
  17. package/assets/skills/backend-architecture-workflow/references/bugfix-regression.md +63 -0
  18. package/assets/skills/backend-architecture-workflow/references/complex-bug-diagnosis.md +104 -0
  19. package/assets/skills/executor-short-task-workflow/SKILL.md +48 -0
  20. package/assets/skills/executor-short-task-workflow/references/agent-communication.md +44 -0
  21. package/assets/skills/executor-short-task-workflow/references/verification-and-reporting.md +45 -0
  22. package/assets/skills/frontend-engineering-workflow/SKILL.md +47 -0
  23. package/assets/skills/frontend-engineering-workflow/references/README.md +7 -0
  24. package/assets/skills/frontend-engineering-workflow/references/frontend-implementation.md +46 -0
  25. package/assets/skills/frontend-engineering-workflow/references/visual-design.md +43 -0
  26. package/assets/skills/frontend-engineering-workflow/references/visual-qa.md +126 -0
  27. package/assets/skills/fullstack-advisor/SKILL.md +50 -0
  28. package/assets/skills/fullstack-advisor/references/brooks-principles.md +51 -0
  29. package/assets/skills/fullstack-advisor/references/consultant-communication.md +51 -0
  30. package/assets/skills/fullstack-advisor/references/consultation-workflow.md +71 -0
  31. package/assets/skills/git-release-hygiene/SKILL.md +33 -21
  32. package/assets/skills/git-release-hygiene/references/git-safety.md +66 -0
  33. package/assets/skills/git-release-hygiene/references/pr-changelog.md +98 -0
  34. package/assets/skills/git-release-hygiene/references/release-standard.md +139 -0
  35. package/assets/skills/git-release-hygiene/references/validation-checklist.md +42 -0
  36. package/assets/skills/github-repository-presentation/SKILL.md +49 -130
  37. package/assets/skills/github-repository-presentation/references/bilingual-writing.md +43 -0
  38. package/assets/skills/github-repository-presentation/references/documentation-architecture.md +156 -0
  39. package/assets/skills/github-repository-presentation/references/readme-standard.md +273 -0
  40. package/assets/skills/github-repository-presentation/references/release-notes.md +70 -0
  41. package/assets/skills/github-repository-presentation/references/validation-checklist.md +47 -0
  42. package/assets/skills/independent-code-review-workflow/SKILL.md +60 -0
  43. package/assets/skills/independent-code-review-workflow/references/README.md +9 -0
  44. package/assets/skills/independent-code-review-workflow/references/decay-risks.md +99 -0
  45. package/assets/skills/independent-code-review-workflow/references/review-checklist.md +53 -0
  46. package/assets/skills/independent-code-review-workflow/references/review-methodology.md +113 -0
  47. package/assets/skills/independent-code-review-workflow/references/review-severity.md +49 -0
  48. package/assets/skills/independent-code-review-workflow/references/test-quality-review.md +71 -0
  49. package/assets/skills/leader-long-task-orchestration/SKILL.md +49 -0
  50. package/assets/skills/leader-long-task-orchestration/references/delivery-plan-template.md +73 -0
  51. package/assets/skills/leader-long-task-orchestration/references/product-alignment.md +46 -0
  52. package/assets/skills/leader-long-task-orchestration/references/rolling-wave-planning.md +32 -0
  53. package/assets/skills/leader-long-task-orchestration/references/technical-decisions-and-escalation.md +34 -0
  54. package/assets/skills/leader-medium-task-workflow/SKILL.md +55 -0
  55. package/assets/skills/leader-medium-task-workflow/references/task-board-and-leader-todo.md +41 -0
  56. package/docs/builtin-team-skills.md +82 -0
  57. package/docs/builtin-team-skills.zh.md +82 -0
  58. package/docs/builtin-teams.md +62 -0
  59. package/docs/builtin-teams.zh.md +62 -0
  60. package/docs/developer/architecture.md +54 -0
  61. package/docs/developer/architecture.zh.md +54 -0
  62. package/docs/guide/install.md +86 -0
  63. package/docs/guide/install.zh.md +86 -0
  64. package/docs/guide/integrations.md +50 -0
  65. package/docs/guide/integrations.zh.md +50 -0
  66. package/docs/guide/team-skills.md +56 -0
  67. package/docs/guide/team-skills.zh.md +56 -0
  68. package/docs/guide/using-teams.md +92 -0
  69. package/docs/guide/using-teams.zh.md +92 -0
  70. package/docs/index.md +53 -0
  71. package/docs/index.zh.md +53 -0
  72. package/docs/reference/tools-and-permissions.md +62 -0
  73. package/docs/reference/tools-and-permissions.zh.md +62 -0
  74. package/docs/reference/troubleshooting.md +59 -0
  75. package/docs/reference/troubleshooting.zh.md +59 -0
  76. package/lib/client.js +515 -85
  77. package/lib/index.js +442 -87
  78. package/lib/typert.host.js +15 -15
  79. package/lib/typert.remote-client.d.ts.map +1 -1
  80. package/lib/typert.remote-client.js +15 -15
  81. package/lib/types/client/CardPatchView.js +21 -1
  82. package/lib/types/client/ComposerTeamSelect.js +24 -8
  83. package/lib/types/client/TeamAgentView.d.ts +1 -1
  84. package/lib/types/client/TeamAgentView.js +11 -6
  85. package/lib/types/client/TeamSkillsView.d.ts +2 -1
  86. package/lib/types/client/TeamSkillsView.js +10 -5
  87. package/lib/types/client/locales.d.ts +41 -2
  88. package/lib/types/client/locales.js +125 -0
  89. package/lib/types/index.js +52 -12
  90. package/lib/types/team-catalog.d.ts +50 -3
  91. package/lib/types/team-catalog.js +214 -43
  92. package/lib/types/team-mode.d.ts +48 -0
  93. package/lib/types/team-mode.js +64 -0
  94. package/lib/types/team-skills/index.d.ts +13 -3
  95. package/lib/types/team-skills/index.js +21 -2
  96. package/lib/types/team-skills/manager.d.ts +21 -12
  97. package/lib/types/team-skills/manager.js +88 -53
  98. package/lib/types/team-skills/service.js +18 -7
  99. package/lib/types/team-skills/store.d.ts +11 -0
  100. package/lib/types/team-skills/store.js +32 -1
  101. package/package.json +18 -2
@@ -50,6 +50,17 @@ export interface TeamSkillDeleteOutcome {
50
50
  readonly warnings: readonly string[];
51
51
  }
52
52
  /** The Team Skill library plus its role bindings. */
53
+ /**
54
+ * Whether two assets are the shipped copy and its own editable copy.
55
+ *
56
+ * They share a name because they ARE the same skill: the override is the shipped
57
+ * body with the user's edits. Presenting that pair as a name clash made an
58
+ * ordinary "I made a local copy" state read as a defect.
59
+ * @param left - one asset.
60
+ * @param right - the other asset.
61
+ * @returns true when one is the shipped copy and the other its override.
62
+ */
63
+ export declare function sanctionedCopy(left: TeamSkillAsset, right: TeamSkillAsset): boolean;
53
64
  export declare class TeamSkillManager {
54
65
  private readonly store;
55
66
  private bindings;
@@ -132,18 +143,16 @@ export declare class TeamSkillManager {
132
143
  reconcile(): Promise<void>;
133
144
  private reconcileNow;
134
145
  /**
135
- * Resolve the asset a catalog default should bind to.
146
+ * Move every role holding one asset onto another.
136
147
  *
137
- * The shipped copy is the fallback, and it is the only candidate while no
138
- * override exists. When the user has created an editable override of that
139
- * shipped skill, the override is what they mean by it: `overrideSkill`
140
- * rewrites the bindings that exist at creation time, so a default first
141
- * seeded afterwards must resolve to the same copy or the two creation orders
142
- * would disagree about which body a role receives.
143
- * @param skillId - shipped skill identity the default names.
144
- * @returns the asset identity to bind, or undefined when neither copy exists.
145
- */
146
- private seededAssetId;
148
+ * Used by "restore to the built-in version": the roles reading a local copy
149
+ * have to read the shipped one again, or the restore would only change bytes
150
+ * nobody is bound to.
151
+ * @param fromAssetId - asset the roles hold now.
152
+ * @param toAssetId - asset they should hold.
153
+ * @returns the number of bindings moved.
154
+ */
155
+ replaceAssetBindings(fromAssetId: string, toAssetId: string): Promise<number>;
147
156
  private mutate;
148
157
  /**
149
158
  * Find text mentions of one skill name inside another asset.
@@ -206,7 +215,7 @@ export declare class TeamSkillManager {
206
215
  * and reconcile to restore the official default bindings.
207
216
  * @param teamIds - optional list of team identities to restore; defaults to all built-in teams.
208
217
  */
209
- restoreBuiltinBindings(teamIds?: readonly string[]): Promise<void>;
218
+ restoreBuiltinBindings(teamIds?: readonly string[] | null): Promise<void>;
210
219
  /**
211
220
  * Persist the bindings document atomically enough for a UI write.
212
221
  * @returns after the document is on disk.
@@ -92,6 +92,20 @@ function seedOwner(key) {
92
92
  return undefined;
93
93
  }
94
94
  /** The Team Skill library plus its role bindings. */
95
+ /**
96
+ * Whether two assets are the shipped copy and its own editable copy.
97
+ *
98
+ * They share a name because they ARE the same skill: the override is the shipped
99
+ * body with the user's edits. Presenting that pair as a name clash made an
100
+ * ordinary "I made a local copy" state read as a defect.
101
+ * @param left - one asset.
102
+ * @param right - the other asset.
103
+ * @returns true when one is the shipped copy and the other its override.
104
+ */
105
+ export function sanctionedCopy(left, right) {
106
+ return (left.origin === 'builtin' && right.origin === 'override' && right.officialSkillId === left.skillId)
107
+ || (right.origin === 'builtin' && left.origin === 'override' && left.officialSkillId === right.skillId);
108
+ }
95
109
  export class TeamSkillManager {
96
110
  store;
97
111
  bindings = [];
@@ -381,70 +395,67 @@ export class TeamSkillManager {
381
395
  const roleId = isCaptain ? CAPTAIN_ROLE : memberRole === CAPTAIN_ROLE ? undefined : memberRole;
382
396
  if (roleId === undefined)
383
397
  continue;
384
- // A default names the shipped skill, but the role must receive the copy
385
- // the deployment actually uses. An override is the user's own editable
386
- // version of that shipped skill, and `overrideSkill` only rewrites the
387
- // bindings that already exist when it is created, so an override made
388
- // before a default was first seeded would otherwise be bypassed for
389
- // that role and silently hand it the built-in body instead of the
390
- // user's edit. Resolving the override here makes the two creation
391
- // orders equivalent.
392
- const assetId = this.seededAssetId(declaration.skillId);
393
- if (assetId === undefined)
398
+ // A default names the shipped skill, and the shipped copy is what it
399
+ // binds. A local copy is bound when the user creates one (that is what
400
+ // `replaceBuiltinBindings` does at creation time) and never by this
401
+ // pass: resolving a declaration onto a same-named copy here made the
402
+ // default follow whatever the user happened to have edited, so deleting
403
+ // or restoring the copy could not return a role to the shipped skill.
404
+ const assetId = `builtin:${declaration.skillId}`;
405
+ if (this.store.get(assetId) === undefined)
394
406
  continue;
395
- // The marker is keyed by the DECLARATION, never by the asset it
396
- // resolved to: an override can appear or disappear between restarts,
397
- // and a key that followed it would stop matching the marker a user's
407
+ // The marker is keyed by the DECLARATION, not by the asset a role
408
+ // happens to hold: a copy can appear or disappear between restarts, and
409
+ // a key that followed it would stop matching the marker a user's
398
410
  // explicit unbind wrote, resurrecting a default they removed.
399
- const key = JSON.stringify([team.id, roleId, `builtin:${declaration.skillId}`]);
400
- const already = this.seeded.has(key);
401
- // A role that still holds the shipped copy of a default, in a deployment
402
- // that now has an override for it, is moved onto that override: the
403
- // marker records that the default was offered, not which copy it landed
404
- // on, so it must not pin a role to a body the user has replaced. Only
405
- // this exact pair is migrated — a role holding a different asset (an
406
- // explicit choice, or another override) is left alone.
407
- if (already) {
408
- const builtinId = `builtin:${declaration.skillId}`;
409
- if (assetId !== builtinId) {
410
- const stale = this.bindings.findIndex(row => row.teamId === team.id && row.roleId === roleId && row.assetId === builtinId);
411
- if (stale >= 0) {
412
- this.bindings[stale] = { teamId: team.id, roleId, assetId, ...(roleId === CAPTAIN_ROLE ? { captain: true } : {}) };
413
- }
414
- }
411
+ const key = JSON.stringify([team.id, roleId, assetId]);
412
+ const holdsSkill = this.bindings.some(row => {
413
+ if (row.teamId !== team.id || row.roleId !== roleId)
414
+ return false;
415
+ return this.store.get(row.assetId)?.skillId === declaration.skillId;
416
+ });
417
+ // A role that still holds a copy of this skill keeps it: an explicit
418
+ // assignment outranks a default.
419
+ if (holdsSkill)
420
+ continue;
421
+ // The marker means "this default was offered and the user removed it",
422
+ // so re-adding would resurrect an explicit unbind. The paths that DO
423
+ // return a missing default -- deleting the copy, restoring it -- clear
424
+ // the marker themselves before reconciling.
425
+ if (this.seeded.has(key))
415
426
  continue;
416
- }
417
427
  this.seeded.add(key);
418
- if (!this.bindings.some(row => row.teamId === team.id && row.roleId === roleId && row.assetId === assetId)) {
419
- this.bindings.push({ teamId: team.id, roleId, assetId, ...(roleId === CAPTAIN_ROLE ? { captain: true } : {}) });
420
- }
428
+ this.bindings.push({ teamId: team.id, roleId, assetId, ...(roleId === CAPTAIN_ROLE ? { captain: true } : {}) });
421
429
  }
422
430
  }
423
431
  if (JSON.stringify([this.bindings, [...this.seeded]]) !== before)
424
432
  await this.flush();
425
433
  }
426
434
  /**
427
- * Resolve the asset a catalog default should bind to.
435
+ * Move every role holding one asset onto another.
428
436
  *
429
- * The shipped copy is the fallback, and it is the only candidate while no
430
- * override exists. When the user has created an editable override of that
431
- * shipped skill, the override is what they mean by it: `overrideSkill`
432
- * rewrites the bindings that exist at creation time, so a default first
433
- * seeded afterwards must resolve to the same copy or the two creation orders
434
- * would disagree about which body a role receives.
435
- * @param skillId - shipped skill identity the default names.
436
- * @returns the asset identity to bind, or undefined when neither copy exists.
437
+ * Used by "restore to the built-in version": the roles reading a local copy
438
+ * have to read the shipped one again, or the restore would only change bytes
439
+ * nobody is bound to.
440
+ * @param fromAssetId - asset the roles hold now.
441
+ * @param toAssetId - asset they should hold.
442
+ * @returns the number of bindings moved.
437
443
  */
438
- seededAssetId(skillId) {
439
- const builtinId = `builtin:${skillId}`;
440
- const builtin = this.store.get(builtinId);
441
- if (builtin === undefined)
442
- return undefined;
443
- const overrideId = `override:${skillId}`;
444
- const override = this.store.get(overrideId);
445
- // An override that has drifted to another shipped skill is not this
446
- // default's copy, and binding it would hand the role the wrong body.
447
- return override?.origin === 'override' && override.officialSkillId === skillId ? overrideId : builtinId;
444
+ async replaceAssetBindings(fromAssetId, toAssetId) {
445
+ return this.mutate(async () => {
446
+ if (this.store.get(toAssetId) === undefined)
447
+ return 0;
448
+ let moved = 0;
449
+ this.bindings = this.bindings.map((row) => {
450
+ if (row.assetId !== fromAssetId)
451
+ return row;
452
+ moved += 1;
453
+ return { ...row, assetId: toAssetId };
454
+ });
455
+ if (moved > 0)
456
+ await this.flush();
457
+ return moved;
458
+ });
448
459
  }
449
460
  mutate(operation) {
450
461
  const result = this.pending.then(async () => {
@@ -576,12 +587,36 @@ export class TeamSkillManager {
576
587
  */
577
588
  async restoreBuiltinBindings(teamIds) {
578
589
  return this.mutate(async () => {
579
- const targets = new Set(teamIds ?? BUILTIN_TEAM_IDS);
590
+ // "Restore these Teams" with nothing named means all of them: the page
591
+ // calls this without arguments, and a remote call can deliver that absence
592
+ // as `[]`, `null` or an empty object. Treating any of those as a filter is
593
+ // what made the whole restore a silent no-op that still answered 200, so
594
+ // only a real, non-empty array narrows the set.
595
+ const requested = Array.isArray(teamIds) ? teamIds : [];
596
+ const targets = new Set(requested.length === 0 ? BUILTIN_TEAM_IDS : requested);
580
597
  this.seeded = new Set([...this.seeded].filter(key => {
581
598
  const owner = seedOwner(key);
582
599
  return owner === undefined || !targets.has(owner[0]);
583
600
  }));
601
+ // "Restore built-in presets" restores the shipped defaults, which are the
602
+ // shipped skills. A role still reading an override of a declared skill is
603
+ // returned to the shipped copy, or the restore would leave the visible
604
+ // binding on the user's own asset and look like it did nothing.
605
+ this.bindings = this.bindings.map((row) => {
606
+ if (!targets.has(row.teamId))
607
+ return row;
608
+ const asset = this.store.get(row.assetId);
609
+ if (asset?.origin !== 'override' || asset.officialSkillId === undefined)
610
+ return row;
611
+ const builtinId = `builtin:${asset.officialSkillId}`;
612
+ return this.store.get(builtinId) === undefined ? row : { ...row, assetId: builtinId };
613
+ });
584
614
  await this.reconcileNow();
615
+ // `reconcileNow` flushes only when IT changed something. The conversion
616
+ // above already mutated the list, so its own before/after reads as "no
617
+ // change" and nothing would reach the disk: the restore appeared to do
618
+ // nothing, and the next restart brought the old bindings back.
619
+ await this.flush();
585
620
  });
586
621
  }
587
622
  /**
@@ -46,7 +46,7 @@ import { mkdir, readdir } from 'node:fs/promises';
46
46
  import { join } from 'node:path';
47
47
  import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
48
48
  import { buildSkillPackage, decodeImportFiles } from "./import.js";
49
- import { CAPTAIN_ROLE } from "./manager.js";
49
+ import { CAPTAIN_ROLE, sanctionedCopy } from "./manager.js";
50
50
  import { assertNoSymlinks } from "./paths.js";
51
51
  import { inspectSkillDirectory } from "./store.js";
52
52
  /** Text the page shows when this deployment could not open its store. */
@@ -163,12 +163,13 @@ let TeamSkillService = (() => {
163
163
  fileCount: asset.files.length,
164
164
  totalBytes: asset.files.reduce((sum, file) => sum + file.size, 0),
165
165
  mcpServers: asset.dependencies.mcpServers.map(server => server.serverName),
166
- // A name can legitimately exist under several origins (the official copy, a
167
- // local override of it, and a user skill that happens to share the name).
168
- // They never overwrite each other, so the page states the coexistence
169
- // instead of pretending one won.
166
+ // A name can legitimately exist under several origins, but two of them are
167
+ // the SAME skill: the shipped copy and an override derived from it. That
168
+ // pair is a sanctioned copy, not a clash, and reporting it made a healthy
169
+ // library look broken. Anything else sharing the name is a real clash the
170
+ // page has to state, because nothing overwrites anything.
170
171
  clashesWith: this.config.store.list()
171
- .filter(other => other.id !== asset.id && other.skillId === asset.skillId)
172
+ .filter(other => other.id !== asset.id && other.skillId === asset.skillId && !sanctionedCopy(asset, other))
172
173
  .map(other => other.id),
173
174
  bindings: this.config.manager.bindingSummaries(assetId),
174
175
  };
@@ -458,7 +459,13 @@ let TeamSkillService = (() => {
458
459
  if (issue !== undefined)
459
460
  return { ok: false, reason: 'unavailable', detail: issue };
460
461
  try {
461
- await this.config.store.resetOverride(assetId);
462
+ const reset = await this.config.store.resetOverride(assetId);
463
+ // "Restore to the built-in version" has to put the roles back on the
464
+ // shipped copy: leaving them on a copy whose content merely equals the
465
+ // shipped one would keep the default bound to the user's own asset.
466
+ if (reset.officialSkillId !== undefined) {
467
+ await this.config.manager.replaceAssetBindings(assetId, `builtin:${reset.officialSkillId}`);
468
+ }
462
469
  }
463
470
  catch (error) {
464
471
  return { ok: false, reason: 'reset-refused', detail: String(error) };
@@ -556,6 +563,10 @@ let TeamSkillService = (() => {
556
563
  await this.config.manager.restoreBuiltinBindings(teamIds);
557
564
  }
558
565
  catch (error) {
566
+ // A swallowed error here reads on the page as "nothing happened", which is
567
+ // indistinguishable from "there was nothing to restore". Log it, and keep
568
+ // returning the issue so the page can name the failure too.
569
+ this.ctx.logger.warn('agent-team-presets: restoring built-in Team Skill bindings failed: %s', String(error));
559
570
  return { ...await this.library(), issue: String(error) };
560
571
  }
561
572
  this.config.resync();
@@ -43,6 +43,17 @@ export declare class TeamSkillStore {
43
43
  private migrateLayout;
44
44
  list(): readonly TeamSkillAsset[];
45
45
  get(assetId: string): TeamSkillAsset | undefined;
46
+ /**
47
+ * Resolve one skill by its name rather than by asset identity.
48
+ *
49
+ * Several assets may legitimately share a name: the shipped copy, a local
50
+ * override of it, and a skill the user imported under the same name. The
51
+ * shipped copy wins, because a name denotes the skill the plugin ships — a
52
+ * user's own copy must never shadow it for a caller that only said the name.
53
+ * Callers that know which copy they mean pass the asset id instead.
54
+ * @param skillId - kebab-case skill name.
55
+ * @returns the shipped copy when it exists, else the best local one.
56
+ */
46
57
  bySkillId(skillId: string): TeamSkillAsset | undefined;
47
58
  /** Commit all nested store mutations once; failures restore memory and version folders. */
48
59
  transaction<T>(operation: () => Promise<T>): Promise<T>;
@@ -328,9 +328,23 @@ export class TeamSkillStore {
328
328
  }
329
329
  list() { return [...this.table.values()].sort((a, b) => a.skillId.localeCompare(b.skillId) || a.id.localeCompare(b.id)); }
330
330
  get(assetId) { return this.table.get(assetId); }
331
+ /**
332
+ * Resolve one skill by its name rather than by asset identity.
333
+ *
334
+ * Several assets may legitimately share a name: the shipped copy, a local
335
+ * override of it, and a skill the user imported under the same name. The
336
+ * shipped copy wins, because a name denotes the skill the plugin ships — a
337
+ * user's own copy must never shadow it for a caller that only said the name.
338
+ * Callers that know which copy they mean pass the asset id instead.
339
+ * @param skillId - kebab-case skill name.
340
+ * @returns the shipped copy when it exists, else the best local one.
341
+ */
331
342
  bySkillId(skillId) {
332
343
  const candidates = this.list().filter(asset => asset.skillId === skillId);
333
- return candidates.find(asset => asset.origin === 'override') ?? candidates.find(asset => asset.origin === 'custom') ?? candidates[0];
344
+ return candidates.find(asset => asset.origin === 'builtin')
345
+ ?? candidates.find(asset => asset.origin === 'override')
346
+ ?? candidates.find(asset => asset.origin === 'custom')
347
+ ?? candidates[0];
334
348
  }
335
349
  /** Commit all nested store mutations once; failures restore memory and version folders. */
336
350
  async transaction(operation) {
@@ -367,6 +381,23 @@ export class TeamSkillStore {
367
381
  if (!checked.ok)
368
382
  throw new Error(`invalid skill package: ${checked.reason}`);
369
383
  assetDirectoryName(package_.name);
384
+ // The English skill name is the identity every other surface uses: a
385
+ // binding names it, a preset document exports it, and the model addresses
386
+ // the skill by it. Two assets may therefore share it only when one is a
387
+ // sanctioned copy of the other -- an override IS the shipped skill, edited.
388
+ // A user skill or import taking a name that already belongs to another
389
+ // skill is refused here rather than allowed to shadow it, which is what
390
+ // made "bind `git-release-hygiene`" ambiguous in the first place. The
391
+ // shipped set is authoritative: installing a builtin always proceeds, so a
392
+ // legacy same-named user skill can neither block a release nor win a
393
+ // binding (bindings resolve by the builtin's identity).
394
+ if (options.origin !== 'builtin') {
395
+ const clash = [...this.table.values()].find(asset => asset.skillId === package_.name && asset.id !== options.id
396
+ && !(options.origin === 'override' && asset.origin === 'builtin'));
397
+ if (clash !== undefined) {
398
+ throw new Error(`the skill name "${package_.name}" already belongs to ${clash.id}; a skill name is the identity a binding uses`);
399
+ }
400
+ }
370
401
  const target = this.assetPath(options.id, options.version);
371
402
  const manifest = this.manifestPath(options.id, options.version);
372
403
  await assertNoSymlinks(target);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-agent-team-presets",
3
3
  "description": "Reusable Agent Team presets for DeepSeek Harness: a captain plus members with their own prompt, model, reasoning effort, and tools.",
4
- "version": "0.3.2",
4
+ "version": "0.3.3",
5
5
  "keywords": [
6
6
  "agent-presets",
7
7
  "agent-teams",
@@ -163,6 +163,22 @@
163
163
  "assets/card-patches",
164
164
  "LICENSE",
165
165
  "NOTICE",
166
- "README.md"
166
+ "README.md",
167
+ "docs/index.md",
168
+ "docs/index.zh.md",
169
+ "docs/builtin-teams.md",
170
+ "docs/builtin-teams.zh.md",
171
+ "docs/builtin-team-skills.md",
172
+ "docs/builtin-team-skills.zh.md",
173
+ "docs/guide/install.md",
174
+ "docs/guide/install.zh.md",
175
+ "docs/guide/using-teams.md",
176
+ "docs/guide/using-teams.zh.md",
177
+ "docs/guide/team-skills.md",
178
+ "docs/guide/team-skills.zh.md",
179
+ "docs/guide/integrations.md",
180
+ "docs/guide/integrations.zh.md",
181
+ "docs/reference",
182
+ "docs/developer"
167
183
  ]
168
184
  }