From c35f609f8bbe2dc74fbf32a90c2f6a7b4d5f2256 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Mon, 23 Feb 2026 16:40:31 +0100 Subject: [PATCH 1/2] feat(cli): Add GitLab URLs and require explicit add sources Support GitLab HTTPS and SSH repository URLs in source parsing, validation, and clone/auth hint handling, including subgroup paths. Reject owner/repo shorthand in the add flow so source host is explicit and no longer inferred as GitHub. This avoids ambiguous behavior now that hosted providers beyond GitHub are supported. Update README and docs examples to use explicit hosted URLs and add coverage for GitLab parsing/validation plus shorthand rejection. Co-Authored-By: Claude --- README.md | 68 ++++++++++-------- docs/src/app/cli/page.tsx | 37 +++++----- docs/src/app/page.tsx | 39 +++++++--- src/cli/commands/add.test.ts | 12 ++++ src/cli/commands/add.ts | 72 +++++++++++++++---- src/config/schema.test.ts | 52 ++++++++++++-- src/config/schema.ts | 53 +++++++++----- src/skills/resolver.test.ts | 87 ++++++++++++++++++++--- src/skills/resolver.ts | 50 +++++++++++-- src/sources/git.ts | 29 ++++++-- src/trust/validator.test.ts | 134 +++++++++++++++++++++++++++-------- 11 files changed, 482 insertions(+), 151 deletions(-) diff --git a/README.md b/README.md index 91175d4..94f90dd 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,13 @@ A package manager for `.agents` directories. Declare agent skill dependencies in npx @sentry/dotagents init # Add a skill from a GitHub repo -npx @sentry/dotagents add getsentry/skills find-bugs +npx @sentry/dotagents add https://github.com/getsentry/skills find-bugs # Add multiple skills at once -npx @sentry/dotagents add getsentry/skills find-bugs code-review commit +npx @sentry/dotagents add https://github.com/getsentry/skills find-bugs code-review commit # Or add all skills from a repo -npx @sentry/dotagents add getsentry/skills --all +npx @sentry/dotagents add https://github.com/getsentry/skills --all # Install all declared skills npx @sentry/dotagents install @@ -40,23 +40,23 @@ agents = ["claude"] [[skills]] name = "find-bugs" -source = "getsentry/skills" +source = "https://github.com/getsentry/skills" ``` And a lockfile (`agents.lock`) pinning the exact commit and integrity hash. ## Commands -| Command | Description | -|---------|-------------| -| `init` | Create `agents.toml` and `.agents/skills/` | -| `add [skills...]` | Add skill dependencies | -| `remove ` | Remove a skill | -| `install` | Install all dependencies from `agents.toml` | -| `update [name]` | Update skills to latest versions | -| `list` | Show installed skills and their status | -| `sync` | Reconcile gitignore, symlinks, and verify state | -| `mcp` | Manage MCP server declarations | +| Command | Description | +| -------------------------- | ----------------------------------------------- | +| `init` | Create `agents.toml` and `.agents/skills/` | +| `add [skills...]` | Add skill dependencies | +| `remove ` | Remove a skill | +| `install` | Install all dependencies from `agents.toml` | +| `update [name]` | Update skills to latest versions | +| `list` | Show installed skills and their status | +| `sync` | Reconcile gitignore, symlinks, and verify state | +| `mcp` | Manage MCP server declarations | All commands accept `--user` to operate on user scope (`~/.agents/`) instead of the current project. @@ -86,25 +86,27 @@ Add one or more skills and install them. Specify skill names as positional argum ```bash # Add a single skill -dotagents add getsentry/skills find-bugs +dotagents add https://github.com/getsentry/skills find-bugs # Add multiple skills -dotagents add getsentry/skills find-bugs code-review commit +dotagents add https://github.com/getsentry/skills find-bugs code-review commit # Equivalent using --skill flags -dotagents add getsentry/skills --skill find-bugs --skill code-review +dotagents add https://github.com/getsentry/skills --skill find-bugs --skill code-review # Pin to a ref -dotagents add getsentry/skills find-bugs --ref v1.0.0 +dotagents add https://github.com/getsentry/skills find-bugs --ref v1.0.0 # Add all skills as a wildcard entry -dotagents add getsentry/skills --all +dotagents add https://github.com/getsentry/skills --all ``` When a repo has one skill, it's added automatically. When multiple are found and no names are given, interactive mode shows a picker. When adding multiple skills, any that already exist in `agents.toml` are skipped with a warning. The rest are added normally. +Note: `dotagents add` requires explicit git URLs. Shorthand forms like `getsentry/skills` are not supported in the add flow. + ### remove ```bash @@ -160,11 +162,15 @@ dotagents mcp list [--json] ```toml [[skills]] name = "find-bugs" -source = "getsentry/skills" # GitHub repo +source = "https://github.com/getsentry/skills" # GitHub URL [[skills]] name = "review" -source = "getsentry/skills@v1.0.0" # Pinned to a ref +source = "https://github.com/getsentry/skills@v1.0.0" # Pinned to a ref + +[[skills]] +name = "gitlab" +source = "https://gitlab.com/group/repo" # GitLab URL [[skills]] name = "internal" @@ -182,11 +188,11 @@ Add all skills from a repo with a single entry. Use `exclude` to skip specific o ```toml [[skills]] name = "*" -source = "getsentry/skills" +source = "https://github.com/getsentry/skills" exclude = ["deprecated-skill"] ``` -Or from the CLI: `dotagents add getsentry/skills --all` +Or from the CLI: `dotagents add https://github.com/getsentry/skills --all` ## Agent Targets @@ -196,13 +202,13 @@ The `agents` field tells dotagents which tools to configure. agents = ["claude", "cursor"] ``` -| Agent | Config Dir | MCP Config | Hooks | -|-------|-----------|------------|-------| -| `claude` | `.claude` | `.mcp.json` | `.claude/settings.json` | -| `cursor` | `.cursor` | `.cursor/mcp.json` | `.cursor/hooks.json` | -| `codex` | `.codex` | `.codex/config.toml` | -- | -| `vscode` | `.vscode` | `.vscode/mcp.json` | `.claude/settings.json` | -| `opencode` | `.claude` | `opencode.json` | -- | +| Agent | Config Dir | MCP Config | Hooks | +| ---------- | ---------- | -------------------- | ----------------------- | +| `claude` | `.claude` | `.mcp.json` | `.claude/settings.json` | +| `cursor` | `.cursor` | `.cursor/mcp.json` | `.cursor/hooks.json` | +| `codex` | `.codex` | `.codex/config.toml` | -- | +| `vscode` | `.vscode` | `.vscode/mcp.json` | `.claude/settings.json` | +| `opencode` | `.claude` | `opencode.json` | -- | ### Pi @@ -266,7 +272,7 @@ Use `--user` to manage skills shared across all projects: ```bash dotagents --user init -dotagents --user add getsentry/skills --all +dotagents --user add https://github.com/getsentry/skills --all ``` User-scope files live in `~/.agents/` (override with `DOTAGENTS_HOME`). diff --git a/docs/src/app/cli/page.tsx b/docs/src/app/cli/page.tsx index 618417b..ac479c7 100644 --- a/docs/src/app/cli/page.tsx +++ b/docs/src/app/cli/page.tsx @@ -59,8 +59,8 @@ export default function CliPage() {

Global Options