---
name: agent-emacs-720e47e43e2d
description: Unified persistent text-based environment for AI agents. Use when an agent needs to maintain state across sessions, perform structural code editing, or manage remote nodes via TRAMP. Transforms the agent from a stateless script executor into a stateful resident of a living Emacs daemon.
---

# Agent Emacs: The Living Workspace

This skill provides a persistent, high-performance Emacs environment designed specifically for AI agents. It replaces fragmented CLI tools with a unified "Living Image" workflow.

## Core Concepts

1. **The Daemon**: All work happens inside a persistent Emacs daemon (`emacs-agent.service`).
2. **The Socket**: Communication is handled via `emacsclient -s /tmp/emacs0/server`.
3. **Buffers as State**: Files, terminal outputs, and remote connections are treated as persistent buffers. State is maintained between agent turns.

## Operational Workflow

### 1. Structural Editing
Do not use regex for complex code changes. Use ELisp forms to manipulate the AST.
```bash
emacsclient -s /tmp/emacs0/server --eval "(with-current-buffer \"main.lisp\" (goto-char (point-max)) (insert \"\n(new-function)\"))"
```

### 2. Remote Infrastructure (TRAMP)
Manage remote nodes transparently. Opening a remote file automatically establishes a persistent SSH tunnel.
```elisp
(find-file "/ssh:user@remote-node:/etc/config.json")
```

### 3. Project Management (Magit)
Use Magit for all Git operations to ensure high-integrity commits and staging.

## Advanced Workflows
For detailed patterns on recursive data processing (RLM), memory management, and REPL-based accuracy, see:
- [usage.md](references/usage.md) - Low-level Lisp interaction patterns.
- [agent-workflows.md](references/agent-workflows.md) - High-level operational strategies.

## Guaranteed Accuracy
Always use the Emacs Lisp REPL for math, data manipulation, or status calculations. Accuracy is paramount; do not attempt manual calculations.

## Initialization
Run `scripts/bootstrap.sh` to ensure the daemon is active and the `agent-init.el` configuration is loaded.


---
Source attribution: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/agent-emacs/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025 skill-library-mcp contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/agent-emacs/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Backend Developer, Data Engineer, DevOps / SRE
Specialties: Backend, DevOps
Tools: Emacs
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 4c7637dece8ab73d2b3d74e4c587f9c65d1987a85da8741e59d5987fc3ca8292
