Install claude skills with auth0 cli#1525
Conversation
bacce51 to
183a1a1
Compare
ca88e01 to
df3351c
Compare
95bef66 to
f2943b1
Compare
…tallspecific skills for specific agents
… special char handling in ref URL
f2943b1 to
ae759dc
Compare
| detectedAgentsCache []AgentConfig | ||
| ) | ||
|
|
||
| func DetectedAgents() []AgentConfig { |
There was a problem hiding this comment.
Do we need the mutex and resettable shared cache here at all? Since this runs in a CLI, agent detection will usually happen in a fresh process, so the main benefit seems to be re-detection within the same process,
There was a problem hiding this comment.
Yes, this is added to support re-detection for the same process. Making the download flow optimized
| @@ -0,0 +1,410 @@ | |||
| package skills | |||
There was a problem hiding this comment.
Can we simplify this download flow substantially and make it closer to downloadAndUnzipSampleRepo? Since agent-skills is a public repo and this is a one-time install, I’m not sure we need all of: fetchCommitSHA, downloadViaGit, multiple archive fallbacks, and the atomic rename/cross-filesystem replacement logic. It feels like a single HTTP-based download from main plus extract/copy into place may be enough here.
There was a problem hiding this comment.
- fetchCommitSHA is needed for versioning of skills
- The download needs to support the 3 types as git might not be present
- Since we are covering updates as well this is a not a one might install
- Atomic renames reduce the write complexity of [clone, sparse-checkout, place], [download, extract, place] * 2
- As discussed we are supporting multiple download types for resiliency, also extract/clone and copy need atleast 2 directories, present code implements that will error handling.
| @@ -0,0 +1,97 @@ | |||
| package skills | |||
There was a problem hiding this comment.
What concrete problem are we solving with cross-process locking here? auth0 ai skills install looks like a user-invoked, one-time install command, so concurrent installs seem like an edge case rather than an expected workflow. This adds platform-specific locking complexity that may not be justified unless we need to coordinate multiple processes updating the same install state.
There was a problem hiding this comment.
This encapsulates the skills-lock data structure, this is related to separation of concerns.
|
|
||
| // ParseSkillMeta reads SKILL.md from skillDir and extracts the YAML frontmatter. | ||
| // Returns an empty SkillMeta (no error) when the file has no valid frontmatter delimiters. | ||
| func ParseSkillMeta(skillDir string) (SkillMeta, error) { |
There was a problem hiding this comment.
Should ParseSkillMeta() only treat frontmatter as valid when it appears at the start of SKILL.md? Right now any two --- lines anywhere in the file would be parsed as metadata.
There was a problem hiding this comment.
Since we control all SKILL.md files and enforce frontmatter at the start by convention, this isn't a practical concern. All skill files in this repo follow the ---/YAML/--- at the top structure, so parts[1] will always resolve to the correct block. We could add a strings.TrimSpace(parts[0]) != "" guard for strictness, but it's unnecessary overhead given the invariant we maintain.
| @@ -0,0 +1,180 @@ | |||
| package skills | |||
There was a problem hiding this comment.
Do we need all of this installation complexity here? For auth0 ai skills install, this seems to handle a lot of edge cases symlink vs copy mode, Windows junction fallback, temp-dir promotion, cross-filesystem fallback, and multiple validation state and I’m not sure all of those are required for the expected use case.
There was a problem hiding this comment.
Yes the symlinking allows for single copy and upgrade propagation, also we need to handle cross-filesysystem cases and windows cases as we supporting windows download as well.
| .github/copilot-instructions.md | ||
|
|
||
| # LLM files | ||
| .remember/ No newline at end of file |
🔧 Changes
Introduces a new
internal/ai/skillspackage that provides an agent registry and detection layer for AI coding agents. Thisis the foundation for the
auth0 ai skills installcommand, enabling the CLI to discover which agents are present on a user'smachine and resolve the correct skills directory for each.
New types and functions:
AgentConfig— describes a single AI coding agent with its ID, display name, global/project skills directories, anddetection hints (filesystem markers and binary names)
AgentConfig.IsInstalled()— returnstrueif any marker path exists on disk or any binary is found in$PATHSupportedAgents— registry of 20 agents: Claude Code, Cursor, GitHub Copilot, Gemini CLI, Roo Code, Goose, OpenCode,Codex, Windsurf, Continue, Amp, Junie, Kiro CLI, Cline, Augment, AiderDesk, Warp, OpenHands, Trae, and a Universal fallback
DetectedAgents()— returns the subset ofSupportedAgentsthat are installed, plus the Universal agent; result is cachedvia
sync.OnceFastPriorityAgents()— returns detected agents sorted by priority order (Claude Code → Cursor → GitHub Copilot → GeminiCLI → others → Universal last), used by the
--fastinstall modeCleanup:
qsType,qsAppName,qsPort) fromquickstarts.gothat were no longer referencedquickstart_detect.goandquickstart.go🔬 Testing
All new behaviour is covered by unit tests in
internal/ai/skills/agent_test.go:TestIsInstalled— marker path existence, binary lookup, empty-string skipping, fallback from marker miss to binary hitTestSupportedAgents— non-empty registry, unique IDs, non-empty skill dirs, presence of universal, agents with nildetection markers
TestDetectedAgents— universal always present, deterministic caching, all results are subsets ofSupportedAgentsTestFastPriorityAgents— universal last, no duplicates, all detected agents present, priority ordering invariant, lengthequality
Run with:
go test ./internal/ai/skills/...
No external services or credentials are required;
IsInstalledchecks are exercised usingt.TempDir()andt.Setenv("PATH", ...).