Skip to content

feat(skills): scan .agents/skills as a third skill location - #640

Merged
edenreich merged 7 commits into
mainfrom
feat/skills-agents-standard-location
Jun 20, 2026
Merged

edenreich merged 7 commits into
mainfrom
feat/skills-agents-standard-location

Conversation

@edenreich

@edenreich edenreich commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds .agents/skills/<name>/SKILL.md as a third Agent Skills scan location, so skill folders authored to the emerging cross-tool open standard (Claude Code, Gemini CLI, Codex CLI) work without being moved into .infer/skills/.

Precedence (first match wins on a name collision):

  1. .infer/skills/ — project (highest)
  2. .agents/skills/ — open standard (new, middle)
  3. ~/.infer/skills/ — user-global (lowest)

Changes

  • domain (internal/domain/skills.go): new SkillScopeAgents = "agents" scope value.
  • config (config/config.go): new AgentsDirName = ".agents" constant; isWithinSkillsDir now carves .agents/skills out of the sandbox so a Read of SKILL.md / references/*.md succeeds even under a restrictive tools.sandbox.directories (parity with .infer/skills).
  • skills (internal/services/skills/skills.go): searchScopes() inserts .agents/skills between project and user-global. The existing seen-map dedup provides precedence — no loop changes.
  • cmd (cmd/skills.go): skills / skills list help now lists all three locations and scope (project / agents / user).
  • docs: docs/skills.md (Locations + portability), docs/directory-structure.md (.agents/ tree block + .infer/skills/ entry).

Out of scope (per #639)

  • Install/uninstall flow unchanged (still targets .infer/skills/, --user → ~/.infer/skills/).
  • infer init does not create .agents/ (it's brought by external repos).
  • ~/.agents/skills/ is not scanned.

Testing

  • task test (full suite) ✅, task lint (0 issues) ✅, task build ✅.
  • New tests: TestPrecedence_AgentsMiddleScope, TestSearchScopes_Order (skills pkg); TestValidatePathInSandbox_AgentsSkillsCarveOut (config pkg — uses a restrictive sandbox on purpose, since .agents/ isn't a protected path, so the test actually fails without the carve-out).
  • Manual infer skills list across a scratch project + fake HOME: .agents/skills shows scope agents, overrides user-global, and is overridden by project.

Closes #639

@edenreich
edenreich requested a review from a team as a code owner June 20, 2026 17:48
Comment thread config/config_test.go Resolved
Comment thread internal/services/skills/skills_test.go Resolved
Comment thread internal/services/skills/skills_test.go Resolved
Comment thread internal/services/skills/skills_test.go Resolved
edenreich and others added 4 commits June 20, 2026 19:59
Discover Agent Skills from the open-standard .agents/skills/<name>/SKILL.md
in addition to project .infer/skills/ and user-global ~/.infer/skills/.
Precedence is project > agents > user (first match wins on name collision),
so a repo that ships skills under the cross-tool .agents/skills/ convention
works without moving them into .infer/skills/.

- domain: add SkillScopeAgents scope value
- config: add AgentsDirName; carve .agents/skills out of the sandbox so
  SKILL.md and references/*.md read even under a restrictive sandbox
  (parity with .infer/skills)
- skills: insert .agents/skills into searchScopes, between project and user
- cmd/skills + docs/skills + docs/directory-structure: document the location

Closes #639
Centralized-config changes in one PR:

1. Adds/updates `.github/workflows/infer.yml` as a thin caller of the
org reusable workflow
   `inference-gateway/.github/.github/workflows/[email protected]`,
wiring the `@infer` bot (inference-gateway/infer-action) into this repo.
2. Bumps this repo's Flox `infer` pin (`.flox/env/manifest.toml`) to
   `v0.121.1` (the latest `inference-gateway/cli` release) and
   refreshes `.flox/env/manifest.lock`.
3. Regenerates the committed `.infer/` config with `infer init
--overwrite --skip-migrations`
   using that CLI.

Setup lives centrally, so future moves (action bump, model, tool scope,
CLI version) are a
**re-run of `migrate-infer.yml`** instead of a hand-edit per repo.

Ran in CI (mirrors `bump-adl.yml`):
- sed the `inference-gateway/cli` pin in `.flox/env/manifest.toml` to
the latest release
- `flox upgrade infer` + `flox activate` to refresh
`.flox/env/manifest.lock`
- `flox activate -- infer init --overwrite --skip-migrations` to
regenerate `.infer/`

> **Heads-up:** `infer init --overwrite` resets `.infer/` to CLI
defaults. `.infer/agents.yaml`
> and `.infer/mcp.yaml` (this repo's A2A agents registry + MCP servers)
are **preserved**
> byte-for-byte; every other config file (`config.yaml`, `prompts.yaml`,
`keybindings.yaml`,
> `channels.yaml`, `computer_use.yaml`, `heartbeat.yaml`, `shortcuts/*`)
is regenerated.
> `.infer/bin`, `logs`, history and the conversations DB stay out via
the nested
> `.infer/.gitignore`. Review the diff before merging.

- Triggers on `@infer` mentions in issues / issue comments. Default
model
`deepseek/deepseek-v4-flash`. The `infer-action` pin lives in the
reusable `infer.yml`.
- Also adds a manual `workflow_dispatch` form: from this repo's Actions
tab pick **Infer**,
type a free-text `prompt`, and the bot works it in that run and opens a
PR (no issue
  needed) - mirroring the `@claude` workflow.
- Tools = infer-action's default bash whitelist + the language preset (+
markdownlint where
set), configured in `repos.yaml` (the entry's `orchestrators.infer`
block).
- Requires the maintainer GitHub App
(`INFERENCE_GATEWAY_MAINTAINER_APP_ID` /
`INFERENCE_GATEWAY_MAINTAINER_APP_PRIVATE_KEY`) installed on this repo
plus the provider
API-key secrets; both reach the reusable workflow via `secrets:
inherit`.

Filed by
[migrate-infer.yml](https://github.com/inference-gateway/.github/blob/main/.github/workflows/migrate-infer.yml).

Co-authored-by: inference-gateway-maintainer[bot] <246577062+inference-gateway-maintainer[bot]@users.noreply.github.com>
…actoring (#637)

Extends `/explorer` so you can browse a file, select a line range,
optionally annotate it, and pull those lines into chat as **attached
context** — part of making the CLI usable without reaching for a
separate IDE. Selected snippets appear as a tree of file + line ranges
below the chat input and are sent (selected lines only) with your next
message.

Closes #599.

In `/explorer`, with a file previewed:

- `s` — enter line-select mode
- `↑/↓` (`j/k`) move the line cursor; `space`/`v` mark a range
- **`enter` attaches the selected range immediately** (annotation
optional)
- `a` — add an optional natural-language note to the range, then `enter`
attaches it
- `esc` backs out of select mode; `esc`/`q` closes the explorer
**carrying** the attachments to chat; `ctrl+c` discards

Back in chat, attachments render as a tree (file + line ranges only)
below the input. Multiple explorer trips accumulate. Manage them with:

- `ctrl+g` — focus the tree
- `↑/↓` move · `d` remove one · `c` clear all · `esc` leave

On send, the **selected lines** (fenced, headed `path (lines X-Y):`,
with the optional `note:`) are appended to your message and the tree
clears. Slash/bash commands are not augmented, so attachments persist
for the next real message. Empty input + attachments is a valid send.

- **`internal/ui/components/file_explorer.go`** — `SnippetSelection`
type + select-mode state. `enter` attaches the current range immediately
(no required annotation); `a` adds an optional note. `esc`/`q` closes
carrying selections, `ctrl+c` discards. `FormatAnnotations()` now emits
**only the selected lines** (fenced, with a `path (lines X-Y):` header +
optional `note:`) — not the whole file or a context window.
- **`internal/ui/components/snippet_attachments_view.go`** *(new)* —
`SnippetAttachmentsView`: renders pending attachments as a focusable
tree (file parents, line-range children) with cursor/remove/clear and
width-aware path truncation.
- **`internal/ui/components/application_view.go`** — renders the
attachments tree directly below the input, with height accounting so the
input isn't pushed off-screen.
- **`internal/app/chat.go`** — pending-attachments state; explorer close
**carries** selections into chat (instead of dumping a blob into the
input box); `ctrl+g` focus shim with nav/remove/clear; `SendMessage`
appends the selected-lines block at send time and clears it (skipped for
slash/bash commands).
- **`config/keybindings.go`** — explorer
`select`/`toggle_select`/`annotate`/`submit` actions +
`chat.focus_attachments` (`ctrl+g`).
- **Tests** — formatter (selected-lines-only), the attachments tree
(grouping, cursor→index mapping, clamp), explorer keys (enter-attaches,
close-carries), and the send-path gating/concatenation.

- **Attached context, not input injection** — snippets land as a
reviewable tree of file + line ranges below the input and are sent with
the next message, instead of overwriting whatever you'd typed.
- **Selected lines only** — exactly the chosen range is sent (no
whole-file or context-window dump), keeping token use tight and the
model's focus precise.
- **Line-based selection** — deterministic and language-agnostic (no
tree-sitter dependency). Syntax-tree-node selection remains a future
enhancement.
- **Optional annotations** — `enter` attaches immediately; `a` adds a
per-snippet note when wanted. The tree shows only file + lines.

- [x] `/explorer` supports a snippet-selection mode on an open file.
- [x] Select a line range, rendered with a distinct gutter style.
- [x] Attach an optional natural-language annotation.
- [x] Selections stored as `(file, start_line, end_line, annotation)`.
- [x] The selected lines (+ annotation) reach the LLM — sent with the
next message.
- [x] Multiple disjoint selections within one file and across files.
- [x] Tests cover selection, attachment, the tree, and the send path.

- `golangci-lint run` → 0 issues
- `go test ./...` → all pass
- `gofmt` / pre-commit hooks → pass

None. CLI-internal TUI feature; docs added in-repo under
`docs/features/`.

```bash
task test
go test ./internal/ui/components/... ./internal/app/...
```
@edenreich
edenreich force-pushed the feat/skills-agents-standard-location branch from b03fb78 to dea087d Compare June 20, 2026 18:00
@edenreich
edenreich merged commit 6e422b9 into main Jun 20, 2026
1 check passed
@edenreich
edenreich deleted the feat/skills-agents-standard-location branch June 20, 2026 18:13
inference-gateway-releaser Bot pushed a commit that referenced this pull request Jun 20, 2026
## [0.122.0](v0.121.1...v0.122.0) (2026-06-20)

### 🚀 Features

* **shortcuts:** add /release-notes shortcut to display changelog entries ([#634](#634)) ([4d0d0bf](4d0d0bf)), closes [#518](#518)
* **explorer:** add snippet selection and annotation for targeted refactoring ([#637](#637)) ([7e619f9](7e619f9)), closes [#599](#599)
* add wrap-up reminders for agent mode ([#628](#628)) ([#635](#635)) ([f5d95a5](f5d95a5))
* **skills:** scan .agents/skills as a third skill location ([#640](#640)) ([6e422b9](6e422b9)), closes [#639](#639) [#639](#639)

### ♻️ Code Refactoring

* **pricing:** add MiniMax models and update subscription terminology ([8df84e7](8df84e7))

### 🔧 Build System

* **deps:** bump alpine from 3.24.0 to 3.24.1 in the docker group ([#630](#630)) ([4d2160e](4d2160e))
* **deps:** bump inference-gateway/.github/.github/workflows/infer.yml from 0.8.0 to 0.10.3 in the github-actions group across 1 directory ([#633](#633)) ([913304d](913304d))
* **deps:** bump the gomod group with 4 updates ([#629](#629)) ([b73f4d3](b73f4d3))

### 👷 CI/CD

* **infer:** centralize infer.yml + sync .infer config ([#638](#638)) ([86d0c18](86d0c18))
* **deps:** upgrade actions/checkout from v6.0.3 to v7.0.0 across workflows ([7befc6c](7befc6c))

### 🧹 Maintenance

* **deps:** bump claude-code 2.1.161 -> 2.1.170, claude-code-action v1.0.135 -> v1.0.142 ([#626](#626)) ([9edfb85](9edfb85))
* **deps:** bump claude-code 2.1.170 -> 2.1.177, claude-code-action v1.0.142 -> v1.0.150 ([#632](#632)) ([c81923f](c81923f))
* **deps:** bump claude-code-action v1.0.150 -> v1.0.152 ([#636](#636)) ([1d58889](1d58889))
* **deps:** bump infer CLI v0.121.0 -> v0.121.1, infer-action v0.12.1 -> v0.13.1 ([#627](#627)) ([c231a03](c231a03))
* bump schema version to 1.13.0 and update docker version to 29.5.2 ([287b1bb](287b1bb))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.122.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: read skills also from .agents/skills/<skill name> (open standard)

1 participant