# agent_skills: Read SKILL.md in one shot via fs.load \(\#57510\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a55e3e99f521f4fdc8b4c9052591740d76553bf2)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a55e3e99f521f4fdc8b4c9052591740d76553bf2

Requested commit: a55e3e99f521f4fdc8b4c9052591740d76553bf2

Commit: a55e3e99f521f4fdc8b4c9052591740d76553bf2

Tree: 61dae6d7ff81c2b3e3483d74b639189021d72500

Author: Richard Feldman

Committer: GitHub

## Message

```
agent_skills: Read SKILL.md in one shot via fs.load (#57510)

Follow-up to #57466 simplifying `load_skill_frontmatter` rather than
fixing a separate bug.

#57466 fixed the chunked-read loop so it truncates accumulated bytes at
the frontmatter boundary, preventing `str::from_utf8` from failing on a
multi-byte grapheme split across chunks. That fix is correct, but the
chunked read it's working around isn't pulling its weight:
`MAX_SKILL_FILE_SIZE` is 100KB and there's already a metadata pre-check,
so "stop reading early once we've seen the closing `---`" saves at most
~25 pages per file while forcing the use of `open_sync`, a hand-rolled
loop, and a long comment about `smol::unblock` vs the GPUI test
scheduler.

This PR:

- replaces the chunked `open_sync` + read loop with a single
`fs.load(...)` call (the same primitive `read_skill_body` already uses);
- deletes `closing_delimiter_end`, `SKILL_READ_CHUNK_SIZE`, the
`std::io::{self, Read}` import, and the `Parking forbidden` paragraph;
- tightens the metadata pre-check so a metadata error (permissions, I/O,
etc.) bails out instead of silently falling through to a blind read;
- removes the now-obsolete
`test_load_skill_frontmatter_with_emoji_at_chunk_boundary` test — by
construction, a single full read can't split a UTF-8 sequence at any
boundary.

Closes AI-303

Release Notes:

- N/A
```

## Parents

- [a9296b9a5ac2942fc5c4a7bfe0de0f53abdbe042](https://git.cafe/gitcafe/zed/commit/a9296b9a5ac2942fc5c4a7bfe0de0f53abdbe042?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a55e3e99f521f4fdc8b4c9052591740d76553bf2?format=markdown)
