feat(core): always-on INSTRUCTIONS.md in skill directories

A skill directory may hold INSTRUCTIONS.md, with or without SKILL.md. Its body
(frontmatter cut) goes into every system prompt in <skill_instructions>, re-read
on every run: 16 KB per file, 64 KB in total, truncation marked with the file's
path. /skills marks skills with instructions and lists instruction-only dirs.
This commit is contained in:
EugeneTes
2026-10-12 10:15:05 +00:00
parent dccdf3a8ed
commit bb1c534a7a
9 changed files with 253 additions and 25 deletions

View File

@@ -188,6 +188,16 @@ description and path, re-read on every run, so a skill the agent (or you) just w
on, no `/new` needed. The model reads the full SKILL.md with `read` when a task matches. Skills without a
`description` are skipped. A chat only sees the skills in its own workspace. `/skills` lists them.
A skill directory may also hold an `INSTRUCTIONS.md` (name matched case-insensitively): standing rules that apply all
the time, not only when the skill is used. Its whole body (a leading YAML frontmatter is cut) goes into every system
prompt in a `<skill_instructions>` section after `<skills>`, as `<instructions skill="<name>" location="<path>">`
blocks in directory order. It is re-read on every run, so an edit counts from the next message. The name is the
SKILL.md `name`, else the directory name. A directory may hold only an `INSTRUCTIONS.md`; it is then not listed among
the skills, but its rules still apply. Limits: 16 KB (16,384 characters) per file and 64 KB (65,536) for all
files together; a file over its share is cut and the prompt says `[…truncated, read the full file at <path>]`, and
once the total is used up, later files appear with only that note. Empty and unreadable files are skipped. `/skills`
marks skills with `(+ INSTRUCTIONS.md)` and lists instruction-only directories as `INSTRUCTIONS.md only`.
```markdown
---
name: trip-planner