( targets: ClientInfo[], skillType: SkillType, clientFlag: string | undefined, destFlag: string | undefined, selectionMode: InitSelection['selectionMode'], )
| 651 | } |
| 652 | |
| 653 | function enforceInstallPolicy( |
| 654 | targets: ClientInfo[], |
| 655 | skillType: SkillType, |
| 656 | clientFlag: string | undefined, |
| 657 | destFlag: string | undefined, |
| 658 | selectionMode: InitSelection['selectionMode'], |
| 659 | ): InstallPolicyResult { |
| 660 | const skipPolicy = |
| 661 | skillType !== 'mcp' || |
| 662 | destFlag != null || |
| 663 | clientFlag === 'claude' || |
| 664 | selectionMode === 'interactive'; |
| 665 | |
| 666 | if (skipPolicy) { |
| 667 | return { allowedTargets: targets, skippedClients: [] }; |
| 668 | } |
| 669 | |
| 670 | const allowedTargets: ClientInfo[] = []; |
| 671 | const skippedClients: Array<{ client: string; reason: string }> = []; |
| 672 | |
| 673 | for (const target of targets) { |
| 674 | if (target.id === 'claude') { |
| 675 | skippedClients.push({ |
| 676 | client: target.name, |
| 677 | reason: 'MCP skill is unnecessary because Claude Code already uses server instructions.', |
| 678 | }); |
| 679 | continue; |
| 680 | } |
| 681 | allowedTargets.push(target); |
| 682 | } |
| 683 | |
| 684 | return { allowedTargets, skippedClients }; |
| 685 | } |
no test coverage detected