1---2name: agents-system3description: Manage the OpenClaw agent system end-to-end (agents/, skills/, MCP servers) so the workspace stays healthy.4---56# Agent System Maintenance Playbook78Use this skill whenever you need to add or modify OpenClaw agents, update skill packages, or verify MCP integrations inside this repo (`/Users/raphael/Documents/Devs/juliaz_agents/openclaw`).910## Repository Layout Cheat Sheet11| Path | Purpose |12| --- | --- |13| `agents/` | YAML manifests (e.g., `agents/juliamcp.yml`) describing transports, skills, behaviors |14| `skills/<name>/` | Each skill folder contains `SKILL.md`, optional references, and any tool definitions (`*.yml`) |15| `skills/julia-bridge/*.yml` | MCP tool wrappers for the Julia bridge (`send`, `receive`, `health`) |16| `bridge/` | Local MCP server source (Node) for Julia↔︎OpenClaw relay |17| `memory/` | Session notes/logs required by AGENTS.md workflow |1819## Workflow: Adding or Updating an Agent201. **Create/Update manifest:** Add `agents/<agent>.yml` with `name`, `transport`, `skills`, and behaviors. Use `agents/juliamcp.yml` as a template.212. **Validate structure:** Ensure YAML lists `skills.required` entries that exist under `skills/`. Keep correlation/behavior settings explicit (`requireCorrelationId`, retries, etc.).223. **Link MCP transport:** For MCP-based agents, set:23 ```yaml24 transport:25 type: mcp26 endpoint: http://127.0.0.1:300127 ```28 Adjust host/port if deploying elsewhere.294. **Smoke-test:** (a) restart any affected MCP servers, (b) run `mcporter call <server>.list_tools` (if exposed) or the relevant tool to confirm connectivity.305. **Document changes:** Update or create `skills/<related-skill>/SKILL.md` so future runs know how/when to use the agent.3132## Workflow: Creating or Updating a Skill Package331. **Directory scaffolding:** `mkdir -p skills/<skill>/` then add:34 - `SKILL.md` (instructions)35 - Optional helper docs (`README.md`, references)36 - Tool definitions (`*.yml`) when the skill wraps a CLI/API (see `skills/julia-bridge/send.yml`).372. **Frontmatter discipline:** Keep `name` + `description` short but descriptive so OpenClaw’s skill loader can match user intents.383. **Procedural clarity:** In `SKILL.md`, include:39 - When to trigger the skill40 - Required tools/dependencies41 - Step-by-step procedures with exact commands42 - Troubleshooting tips434. **Testing:** Execute each defined tool at least once (e.g., `mcporter call ...`) and confirm expected JSON. Capture quirks in the Troubleshooting section.4445## Workflow: MCP Server Maintenance (Bridge or Others)461. Follow `skills/julia-bridge/SKILL.md` for the existing bridge.472. New server? Add a folder under `bridge/` (or another path) with `package.json`, `server.js`, etc.483. Register it with `mcporter`:49 ```bash50 mcporter config add <name> http://127.0.0.1:<port> --transport http51 ```524. Reference the new tools in an agent manifest, then add matching `skills/<name>/*.yml` definitions.5354## Workflow: Verifying End-to-End Wiring551. **Health checks:**56 - `openclaw health`57 - `openclaw channels status`58 - `mcporter call <server>.bridge_health`592. **Skill invocation:** Use `skills/<skill>/<tool>.yml` definitions via OpenClaw to ensure they trigger the MCP server correctly.603. **Logs:**61 - Bridge server logs to stdout with `[bridge]` prefix.62 - For OpenClaw issues, check `~/.openclaw/logs/` and follow `skills/openclaw-self-manage`.634. **Queues:** Inspect `bridge` queues (`/queues/openclaw`, `/queues/julia`) if messages stall.6465## Workflow: Memory + Documentation Hygiene661. Update `memory/YYYY-MM-DD.md` after significant maintenance work.672. When a new repeatable lesson emerges, add it to `HEURISTICS.md` per AGENTS.md instructions.683. Ensure `SOUL.md`/`USER.md` reflect any long-term preference changes uncovered during maintenance.6970## Troubleshooting Tips71| Issue | Checklist |72| --- | --- |73| Agent fails to load skills | Confirm `skills/<skill>/SKILL.md` exists and `skills/<skill>/*.yml` names match the references in `agents/<agent>.yml`. |74| `mcporter` cannot reach server | Is the server running on the expected port? Run `lsof -i :3001`. Update `config/mcporter.json` if the base URL changed. |75| Output validation errors | Ensure MCP tools return both human-readable `content` and structured JSON (`structuredContent`) when an `outputSchema` is declared. |76| Persistent pairing issues | Run `skills/openclaw-self-manage` workflow (`openclaw health`, repair script, etc.) before editing configs. |7778## Related Skills + Files79- `skills/julia-bridge/SKILL.md` – bridge-specific ops80- `skills/openclaw-self-manage/SKILL.md` – gateway/CLI troubleshooting81- `AGENTS.md` – daily operating doctrine82- `HEURISTICS.md` – accumulated rules from incidents