zot/internal/agent/modes
patriceckhart 222a62c70f feat: skills — reusable instructions discovered from SKILL.md files
A skill is a single SKILL.md file with a YAML frontmatter header,
discovered from well-known directories at startup. Two integration
points:

  1. The system prompt gains a short manifest listing each skill's
     name + one-line description. Cheap (a few dozen tokens).
  2. A built-in `skill` tool lets the model load any one skill's
     full body on demand and follow the instructions there.

The on-demand-load model keeps token usage cheap: only the
manifest goes into every request; the body is fetched as a tool
result the one or two turns the model actually needs it.

Discovery (priority order — first match wins per name):
  ./.zot/skills/<name>/SKILL.md            project (native)
  $ZOT_HOME/skills/<name>/SKILL.md         global (native)
  ./.claude/skills/<name>/SKILL.md         project (claude-compat)
  ~/.claude/skills/<name>/SKILL.md         global (claude-compat)
  ./.agents/skills/<name>/SKILL.md         project (agent-compat)
  ~/.agents/skills/<name>/SKILL.md         global (agent-compat)

Compat paths are deliberate: any SKILL.md written for a related
ecosystem works in zot unchanged.

Frontmatter fields:
  name           optional; defaults to directory name
  description    required; shown in the system prompt
  allowed-tools  optional list; informational (no enforcement)
  permissions    optional per-tool patterns; informational

allowed-tools and permissions are parsed but not enforced this
version. They render in the body so the model can self-regulate.

What landed:

- internal/skills: discovery + frontmatter parsing (no yaml dep —
  hand-rolled subset for the limited shape skills use), the on-
  demand `skill` tool implementing core.Tool, system-prompt
  addendum, FindByName lookup helper. Real unit tests cover all
  five locations + dedup priority + parser corner cases.

- internal/agent/build.go: Resolve discovers skills, registers the
  skill tool when at least one was found, appends the manifest to
  the system prompt's append list. Resolved gains a SkillTool
  field so the tui can read the live set.

- internal/agent/modes/skills_dialog.go: /skills picker with two
  modes — list view (cursor + paging) and body view (markdown-
  rendered with scroll). Refreshes its snapshot each open via
  cfg.SkillSnapshot so edits to a SKILL.md during a session are
  reflected immediately.

- /skills slash command + entry in slashCatalog.

- examples/skills/code-review and examples/skills/test-fix as
  starter skills demonstrating procedural style + frontmatter.

- docs/skills.md: full reference covering discovery, frontmatter,
  inspection, authoring tips, and ecosystem compat.

End-to-end verified against the live anthropic backend:

  prompt: "What skills do you have available?"
  -> "- code-review\n- test-fix"

  prompt: "Use the skill tool to load the code-review skill,
           then summarize step 1."
  -> [tool_call] skill({"name":"code-review"})
  -> [tool_result] body returned
  -> "Step 1 is to establish what changed by running git status..."
2026-04-19 14:32:30 +02:00
..
telegram add telegram bot bridge 2026-04-18 09:15:46 +02:00
btw_dialog.go fix(tui): cell-aware width math for dialog header rules + add /btw 2026-04-19 13:47:39 +02:00
dialog_frame.go fix(tui): cell-aware width math for dialog header rules + add /btw 2026-04-19 13:47:39 +02:00
help.go tui: align /help descriptions across slash commands and keys 2026-04-19 13:14:28 +02:00
interactive.go feat: skills — reusable instructions discovered from SKILL.md files 2026-04-19 14:32:30 +02:00
json.go feat: zotcore SDK + zot rpc subprocess protocol 2026-04-19 12:26:48 +02:00
jump_dialog.go tui: /jump to scroll to past turns, render cache for long transcripts 2026-04-18 12:22:16 +02:00
login_dialog.go initial commit 2026-04-17 20:36:38 +02:00
model_dialog.go add telegram bot bridge 2026-04-18 09:15:46 +02:00
print.go initial commit 2026-04-17 20:36:38 +02:00
session_dialog.go fix ci: portable syscall.Select via x/sys/unix; gofmt pass 2026-04-18 10:55:42 +02:00
skills_dialog.go feat: skills — reusable instructions discovered from SKILL.md files 2026-04-19 14:32:30 +02:00
slash_suggest.go feat: skills — reusable instructions discovered from SKILL.md files 2026-04-19 14:32:30 +02:00
spinner.go fix(tui): cell-aware width math for dialog header rules + add /btw 2026-04-19 13:47:39 +02:00
update_banner.go tui: show 'update available' banner at top of chat 2026-04-18 11:49:22 +02:00
welcome.go tui: show binary version in the welcome banner for 1 second 2026-04-19 13:22:10 +02:00