Skip to content

[5/5] Aitools: project scope (--project/--global)#4814

Merged
simonfaltum merged 5 commits intomainfrom
simonfaltum/aitools-pr5-impl
Mar 26, 2026
Merged

[5/5] Aitools: project scope (--project/--global)#4814
simonfaltum merged 5 commits intomainfrom
simonfaltum/aitools-pr5-impl

Conversation

@simonfaltum
Copy link
Copy Markdown
Member

PR Stack

  1. [1/5] State + release discovery + directory rename ([1/5] Aitools: state tracking, manifest source, directory rename #4810)
  2. [2/5] Install writes state + interactive agent selection ([2/5] Aitools: install writes state, interactive agent selection, idempotent install #4811)
  3. [3/5] Update + uninstall + version commands ([3/5] Aitools: update, uninstall, and version commands #4812)
  4. [4/5] List improvements + command restructuring + flags ([4/5] Aitools: list command, flat structure, --skills/--agents/--include-experimental flags #4813)
  5. [5/5] Project scope (--project/--global) (this PR)

Manifest v2 PR: databricks/databricks-agent-skills#35

Base: simonfaltum/aitools-pr4-restructure (PR 4)

Why

Skills are currently global-only. Teams working on the same project can't share a curated set of skills via their repo. Project-scoped installation puts skills alongside the code, so they can be committed to git and shared.

Changes

Before: All skills install to ~/.databricks/aitools/skills/ (global only).

Now:

  • --project flag on install, update, uninstall: operates on <cwd>/.databricks/aitools/skills/
  • --global flag: explicit global scope (default behavior)
  • --global + --project -> error
  • Interactive scope prompt on install (default: global). Uses huh.NewSelect in cmd layer.
  • Non-interactive defaults to global.
  • SupportsProjectScope field on Agent struct. Only Claude Code and Cursor support project scope.
  • Incompatible agents get a warning, not an error: "Skipped : does not support project-scoped skills."
  • Version shows both scopes when both exist.
  • State includes scope: "project" field for project installs.

Test plan

  • --project installs to cwd-relative directory
  • --global + --project -> error
  • No flag, interactive -> scope prompt shown, default is global
  • No flag, non-interactive -> global (no prompt)
  • Incompatible agents warned, not errored
  • Symlinks only created for capable agents in project scope
  • Version shows both scopes when both exist
  • SupportsProjectScope set correctly for all 6 agents
  • All lint checks pass

@simonfaltum simonfaltum force-pushed the simonfaltum/aitools-pr4-restructure branch from f2fba9a to 1243dc4 Compare March 22, 2026 10:44
@simonfaltum simonfaltum force-pushed the simonfaltum/aitools-pr5-impl branch from b2584d2 to 47f3578 Compare March 22, 2026 10:44
@simonfaltum simonfaltum force-pushed the simonfaltum/aitools-pr4-restructure branch from 1243dc4 to ccf24e9 Compare March 22, 2026 22:00
@simonfaltum simonfaltum force-pushed the simonfaltum/aitools-pr5-impl branch from 47f3578 to 8de78bd Compare March 22, 2026 22:00
@simonfaltum simonfaltum marked this pull request as ready for review March 22, 2026 22:01
@simonfaltum simonfaltum requested review from a team and lennartkats-db as code owners March 22, 2026 22:01
@github-actions
Copy link
Copy Markdown

Suggested reviewers

Based on git history of the changed files, these people are best suited to review:

  • @arsenyinfo -- recent work in experimental/aitools/cmd/, experimental/aitools/lib/installer/, experimental/aitools/lib/agents/

Confidence: high

Eligible reviewers

Based on CODEOWNERS, these people or teams could also review:

@databricks/eng-apps-devex, @lennartkats-db

Suggestions based on git history of 17 changed files (6 scored). See CODEOWNERS for path-specific ownership rules.

@simonfaltum simonfaltum force-pushed the simonfaltum/aitools-pr4-restructure branch from ccf24e9 to 3a9003f Compare March 23, 2026 14:03
@simonfaltum simonfaltum force-pushed the simonfaltum/aitools-pr5-impl branch from 8de78bd to 112b87b Compare March 23, 2026 14:03
@simonfaltum simonfaltum force-pushed the simonfaltum/aitools-pr4-restructure branch from 3a9003f to 50babdc Compare March 24, 2026 11:54
@simonfaltum simonfaltum force-pushed the simonfaltum/aitools-pr5-impl branch from 112b87b to a17092c Compare March 24, 2026 11:55
Copy link
Copy Markdown
Contributor

@arsenyinfo arsenyinfo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More nitpicker comments that look legit to me:

Critical & Medium Priority Fixes

- Idempotency Failure (Scope-Unaware Check): The allAgentsHaveSkill function in installer.go hardcodes the global skills directory. During a --project install, the check looks in the wrong place, finds nothing, and triggers unnecessary re-downloads every time.
- *Action:* Update to use `agentSkillsDirForScope` and pass the relevant scope/CWD.
- Incorrect UI Labeling in list: Running list --project when no skills are installed incorrectly displays (global) in the summary.
- *Action:* Update `list.go` to respect the requested scope in the default switch case.
- Silent Update Failures: In UpdateSkills, if a user attempts to update project-scoped skills for agents that don't support them, the process proceeds silently without symlinking or warning.
- *Action:* Add a `len(targetAgents) == 0` check (similar to the install flow) to return an error/warning.
- Incompatible Agent Prompting (UX): The interactive install prompt displays all detected agents even if a user has already selected --project scope. While not a "crash" (as it is handled gracefully later), it leads to a poor user experience.
- *Action:* Pre-filter the agent list passed to the prompt based on the resolved scope.

Copy link
Copy Markdown
Member Author

@simonfaltum simonfaltum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catches, all four are legit. Fixed in 0dab0e7:

  1. Idempotency check: allAgentsHaveSkill now takes scope and cwd params and uses agentSkillsDirForScope instead of the hardcoded global dir.
  2. List label: added a scope == ScopeProject case before the default so list --project with no state shows "(project)" not "(global)".
  3. Update zero-agent guard: UpdateSkills now returns an error when all agents are incompatible with project scope, matching the install flow.
  4. Agent prompt pre-filter: the install command pre-filters detected agents by SupportsProjectScope before showing the interactive prompt, so users don't see agents that'll get skipped anyway.

@simonfaltum simonfaltum force-pushed the simonfaltum/aitools-pr4-restructure branch from 48d9fca to e0166f7 Compare March 26, 2026 07:38
github-merge-queue bot pushed a commit that referenced this pull request Mar 26, 2026
…ude-experimental flags (#4813)

## PR Stack

1. [1/5] State + release discovery + directory rename (#4810)
2. [2/5] Install writes state + interactive agent selection (#4811)
3. [3/5] Update + uninstall + version commands (#4812)
4. **[4/5] List improvements + command restructuring + flags** (this PR)
5. [5/5] Project scope (--project/--global) (#4814)

Manifest v2 PR: databricks/databricks-agent-skills#35

**Base**: `simonfaltum/aitools-pr3-lifecycle` (PR 3)

## Why

Commands are nested under `skills` which burns namespace for future
component types (hooks, etc.). There's no way to install specific
skills, target specific agents from the CLI, or see installed status in
the list output.

## Changes

**New `list` command**: Table output with skill names, versions,
installed status, `[experimental]` tags. Sorted alphabetically. Uses
`tabwriter` for alignment.

**Flat command structure**: `aitools
install/update/uninstall/list/version` at the top level. Hidden `skills
install` and `skills list` aliases for backward compat.

**Flags**:
- `--skills` (string, comma-separated) on install, update, uninstall:
operate on specific skills
- `--skills` (bool) on list, version: show detailed skills view
- `--agents` (string, comma-separated) on install: target specific
agents, validates against registry, skips interactive prompt
- `--include-experimental` on install: include experimental skills

**Selective uninstall**: `--skills` on uninstall removes only named
skills, preserves state file with remaining.

## Test plan

- [x] `install --skills`, `--agents`, `--include-experimental` flags
work
- [x] `--agents` validates against registry, errors on unknown
- [x] `uninstall --skills` selective removal, state preserved
- [x] `update --skills` selective update
- [x] `list` shows detailed table
- [x] `skills install` and `skills list` hidden aliases work (Execute
path tested)
- [x] `cmd/apps/init.go` integration preserved
- [x] All lint checks pass
Base automatically changed from simonfaltum/aitools-pr4-restructure to main March 26, 2026 08:19
Implements scope selection for aitools install, update, uninstall, and version
commands. Skills can now be installed to a project directory (cwd) instead of
only globally. Agents that support project scope (Claude Code, Cursor) get
symlinks from their project config dirs to the canonical project skills dir.

Co-authored-by: Isaac
…agent guard, param cleanup

Co-authored-by: Isaac
…, agent prompt

1. allAgentsHaveSkill now uses agentSkillsDirForScope so the idempotency
   check looks in the correct directory during --project installs.
2. list --project with no installed state now shows "(project)" instead
   of "(global)" in the summary line.
3. UpdateSkills now returns an error when all detected agents are
   incompatible with project scope, matching the install flow guard.
4. Install prompt pre-filters agents by project-scope compatibility,
   so users only see agents that can actually receive the skills.

Co-authored-by: Isaac
…on refs

The mockManifestSource no longer has release/authoritative fields after
FetchLatestRelease was removed. Update test struct literals and replace
hardcoded "v0.1.0" assertions with defaultSkillsRepoRef.
@simonfaltum simonfaltum force-pushed the simonfaltum/aitools-pr5-impl branch from 0dab0e7 to ea74946 Compare March 26, 2026 08:35
@simonfaltum simonfaltum added this pull request to the merge queue Mar 26, 2026
Merged via the queue into main with commit a9c8a28 Mar 26, 2026
15 checks passed
@simonfaltum simonfaltum deleted the simonfaltum/aitools-pr5-impl branch March 26, 2026 08:51
@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

Commit: a9c8a28

Run: 23585568387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants