buffer
Read an Emacs buffer
Read the contents of a named Emacs buffer (e.g. *Messages*, *scratch*, a compilation, *Org Agenda*, or ibuffer output) using emacsclient --eval, and bring the text back into the conversation. The user may invoke this directly with /buffer, but they are more likely to refer to a buffer mid-conversation — e.g. "Explain the error from *Messages* buffer lines 23-25". Treat any buffer-name reference in the prompt as a request to read it.
How to read
First, locate agent-skill-buffer.el which lives alongside this skill file at skills/buffer/agent-skill-buffer.el in the emacs-skills plugin directory.
A plain read of the whole buffer:
emacsclient --eval '
(progn
(load "/path/to/skills/buffer/agent-skill-buffer.el" nil t)
(agent-skill-buffer
:buffer "*scratch*"))'
The helper returns a plist with the buffer name, whether it exists, its total line count, the character count of the returned text, and the text itself: