core/skills: announce the skill tools in a notice, not a catalog

This commit is contained in:
2026-10-09 21:40:45 +08:00
parent e72d2359d7
commit 8729330120
12 changed files with 139 additions and 94 deletions
+2 -4
View File
@@ -31,8 +31,8 @@
# Discovery roots in priority order: explicit `paths`, our own user config
# directory (<config dir>/skills), other harnesses' skill directories
# (~/.claude/skills; plus <workspace>/.claude/skills when include_project_roots).
# The catalog (name + description) is folded into the system prompt when tools
# are on; the model reads bodies with skill_read and searches with skill_search.
# A session-start notice describes the tools; what exists is found with
# skill_list, bodies are read with skill_read, contents searched with skill_search.
# Reading needs no grant (the roots are read-only roots); creating or editing a
# skill asks once/session, or stands with allow_write = true. See doc/skills.md.
# [skills]
@@ -40,8 +40,6 @@
# paths = ["~/team-skills", "/srv/skills"]
# discover = ["plyngent", "claude"]
# include_project_roots = true
# inject_catalog = true
# max_catalog_skills = 50
# allow_write = false
# MCP (Model Context Protocol) servers exposed as agent tools.
+6 -6
View File
@@ -49,12 +49,10 @@ lists the ones with no directory.
```toml
[skills]
enabled = true # false = no skill tools and no prompt catalog
enabled = true # false = no skill tools
paths = ["~/team-skills"] # explicit roots; `~` expands to your home
discover = ["plyngent", "claude"]
include_project_roots = true
inject_catalog = true # fold the catalog into the system prompt
max_catalog_skills = 50
allow_write = false # true = standing grant for skill writes
```
@@ -70,13 +68,15 @@ a note: the skill stays listable instead of vanishing.
| Field | Meaning |
|-------|---------|
| `name` | Skill name; must be lowercase letters, digits, and single hyphens (max 64). A name that cannot be used falls back to the directory name, with a note. |
| `description` | One line shown in the catalog and in `skill_list`. Missing → the first non-heading paragraph of the body. |
| `description` | One line shown by `skill_list` (and `/skills` for the human). Missing → the first non-heading paragraph of the body. |
| `version`, `license`, `allowed-tools`, … | Kept and shown by `skill_list`; `allowed-tools` is **recorded, not enforced** today. |
## What the agent sees
- **Catalog** (system prompt, `inject_catalog`): names, sources, descriptions —
never the bodies, so a turn only pays for the skill it actually reads.
- **Notice** (a host notice, `agent/notices.py`): when skills are enabled and
tools are on, the session gets one `skills` notice describing the tools; it
lists nothing, so what *exists* is asked for and a turn only pays for the
skill it actually reads.
- `skill_list` — what exists, where it came from, shadowed copies, and the notes
from repaired frontmatter.
- `skill_read NAME [file]` — the `SKILL.md` body (ranges, line numbers, and a