// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; using Aspire.Cli.Resources; namespace Aspire.Cli.Agents; /// /// Represents a location where skill files can be installed. /// [DebuggerDisplay("Id = {Id}, DisplayName = {DisplayName}, Description = {Description}, IsDefault = {IsDefault}")] internal sealed class SkillLocation { /// /// Standard .agents/skills/ location supported by VS Code, GitHub Copilot, and OpenCode. /// public static readonly SkillLocation Standard = new( "standard", AgentCommandStrings.SkillLocation_StandardName, AgentCommandStrings.SkillLocation_StandardDescription, Path.Combine(".agents", "skills"), isDefault: true, includeUserLevel: true); /// /// Claude Code .claude/skills/ location. /// public static readonly SkillLocation ClaudeCode = new( "claudecode", AgentCommandStrings.SkillLocation_ClaudeCodeName, AgentCommandStrings.SkillLocation_ClaudeCodeDescription, Path.Combine(".claude", "skills"), isDefault: false, includeUserLevel: false); /// /// VS Code / GitHub Copilot .github/skills/ location. /// public static readonly SkillLocation GitHubSkills = new( "github", AgentCommandStrings.SkillLocation_GitHubSkillsName, AgentCommandStrings.SkillLocation_GitHubSkillsDescription, Path.Combine(".github", "skills"), isDefault: false, includeUserLevel: false); /// /// OpenCode .opencode/skill/ location. /// public static readonly SkillLocation OpenCode = new( "opencode", AgentCommandStrings.SkillLocation_OpenCodeName, AgentCommandStrings.SkillLocation_OpenCodeDescription, Path.Combine(".opencode", "skill"), isDefault: false, includeUserLevel: false); private SkillLocation(string id, string displayName, string description, string relativeSkillDirectory, bool isDefault, bool includeUserLevel) { Id = id; DisplayName = displayName; Description = description; RelativeSkillDirectory = relativeSkillDirectory; IsDefault = isDefault; IncludeUserLevel = includeUserLevel; } /// /// Gets the non-localized identifier for this location, used for CLI option matching. /// public string Id { get; } /// /// Gets the display name for this location. /// public string DisplayName { get; } /// /// Gets the description shown alongside the name in prompts. /// public string Description { get; } /// /// Gets the relative skill directory path (e.g., ".agents/skills"). /// public string RelativeSkillDirectory { get; } /// /// Gets whether this location should be selected by default. /// public bool IsDefault { get; } /// /// Gets whether this location also installs skill files at the user level (~/). /// public bool IncludeUserLevel { get; } /// /// Gets all available skill locations. /// public static IReadOnlyList All { get; } = [Standard, ClaudeCode, GitHubSkills, OpenCode]; /// public override string ToString() => Id; }