Commit d00a7a2
fix: sync global Native Skills during update (#266)
* fix: sync global Native Skills during update
Global scope used to hardcode the Skill workflowSelection to 'classic',
which filtered out comet-native/* and left global Native installs frozen
at their first-install version. Mirror comet init by selecting 'both'
for global Skills so Native files stay in sync. Rules and hooks keep the
Classic selection (their workflowSelection is effectively ignored and
Native write-guarding is routed through comet-hook-router).
Closes #262
* refactor: address review feedback on global Native Skill update
- Extract skillWorkflowSelectionFor helper so the global-vs-project
Skill selection lives in one place instead of two duplicated ternaries.
- Seed a stale comet-native Skill in the regression test and assert it
is overwritten, proving existing installs are refreshed, not just
created.
- Document why the test silences console.log.
Follow-up to #262.
* fix: derive global Skill selection from disk and count filtered Skills
Address maintainer feedback on #262.
Selection by installed workflow:
- skillWorkflowSelectionFor now checks whether comet-native/SKILL.md
exists on disk for global targets instead of always returning 'both'.
An existing Native install selects 'both' so it stays current; a
Classic-only global install keeps 'classic' so update never adds
Native Skills the user did not choose. Project scope still honors the
project workflow configuration.
Honest skipped counts:
- copyCometSkillsForPlatform and installSkillsAsSymlink now add the
number of manifest entries filtered out by the workflow selection to
the skipped total, so a Classic-only update reports the Native files
it intentionally skips instead of hiding them.
Tests:
- The Native-sync regression test now asserts zero skipped Skills for a
Native install (both selection copies everything).
- New test verifies a Classic-only global install stays Native-free
after update and reports the filtered Native entries as skipped.
* fix: derive all three global Skill selections from disk
Check both comet-native/SKILL.md and comet-classic/SKILL.md so a
Native-only global install (comet init --scope global --workflow native)
selects 'native' and update does not add Classic Skills, mirroring the
Classic-only protection already in place. neither/both markers map to
classic/both respectively.
Tests cover all three derivations:
- both markers -> 'both' (skipped 0, stale Native refreshed)
- classic only -> 'classic' (Native not added, skipped > 0)
- native only -> 'native' (Classic not added, skipped > 0)
* refactor: move workflow marker detection into skill domain
Extract detectInstalledWorkflowSelection into
domains/skill/platform-install.ts so the marker-to-selection mapping
(comet-native/SKILL.md + comet-classic/SKILL.md -> classic|native|both)
lives with the rest of the Skill install domain logic instead of the
command orchestration layer. update.ts now computes the skills root and
delegates the detection, keeping the global/project behavior unchanged.
Follow-up to architecture feedback on #262.
---------
Co-authored-by: zhangshuo12 <zhangshuo12@guazi.com>1 parent 2f45917 commit d00a7a2
3 files changed
Lines changed: 224 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
1542 | 1543 | | |
1543 | 1544 | | |
1544 | 1545 | | |
1545 | | - | |
1546 | | - | |
1547 | | - | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
1548 | 1564 | | |
1549 | 1565 | | |
1550 | 1566 | | |
| |||
1571 | 1587 | | |
1572 | 1588 | | |
1573 | 1589 | | |
1574 | | - | |
1575 | | - | |
| 1590 | + | |
1576 | 1591 | | |
1577 | 1592 | | |
1578 | 1593 | | |
| |||
1581 | 1596 | | |
1582 | 1597 | | |
1583 | 1598 | | |
1584 | | - | |
| 1599 | + | |
1585 | 1600 | | |
1586 | 1601 | | |
1587 | 1602 | | |
| |||
1591 | 1606 | | |
1592 | 1607 | | |
1593 | 1608 | | |
1594 | | - | |
| 1609 | + | |
1595 | 1610 | | |
1596 | 1611 | | |
1597 | 1612 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
118 | 142 | | |
119 | 143 | | |
120 | 144 | | |
| |||
458 | 482 | | |
459 | 483 | | |
460 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
461 | 488 | | |
462 | 489 | | |
463 | 490 | | |
| |||
566 | 593 | | |
567 | 594 | | |
568 | 595 | | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
569 | 601 | | |
570 | 602 | | |
571 | 603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3322 | 3322 | | |
3323 | 3323 | | |
3324 | 3324 | | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
| 3416 | + | |
| 3417 | + | |
| 3418 | + | |
| 3419 | + | |
| 3420 | + | |
| 3421 | + | |
| 3422 | + | |
| 3423 | + | |
| 3424 | + | |
| 3425 | + | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
| 3437 | + | |
| 3438 | + | |
| 3439 | + | |
| 3440 | + | |
| 3441 | + | |
| 3442 | + | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
| 3446 | + | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
| 3451 | + | |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
| 3463 | + | |
| 3464 | + | |
| 3465 | + | |
| 3466 | + | |
| 3467 | + | |
| 3468 | + | |
| 3469 | + | |
| 3470 | + | |
| 3471 | + | |
| 3472 | + | |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
3325 | 3495 | | |
3326 | 3496 | | |
3327 | 3497 | | |
| |||
0 commit comments