Private/Get-KadenAgentStackName.ps1

function Get-KadenAgentStackName {
    <#
    .SYNOPSIS
        Map a managed destination to a host stack, or empty when it is not an agent.
    #>

    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [AllowEmptyString()]
        [string]$Destination
    )

    $norm = $Destination.Replace('\', '/')
    if ($norm -match '^\.cursor/agents/[^/]+\.md$') { return 'cursor' }
    if ($norm -match '^\.github/agents/[^/]+\.agent\.md$') { return 'copilot' }
    if ($norm -match '^\.claude/agents/[^/]+\.md$') { return 'claude' }
    return ''
}