Skip to main content

Custom Agent

Custom agents extend base capabilities by handling specific tasks with isolated context windows, tool permissions, and system prompts. They are managed as subagents.

Create a Custom Agent

Use the built-in create-agent skill to interactively create a custom agent:
/create-agent <your goal, for example, code review expert>
The create-agent skill guides you through these steps:
  • Define the agent name and description
  • Select required tool permissions
  • Auto-generate a system prompt template
  • Save the agent file to the correct location
For your first custom agent, use /create-agent to generate a correctly formatted configuration file.

Method 2: Create manually

Alternatively, create a .md file manually in one of these locations:
LocationPathScope
User-level~/.lingma/agents/<agentName>.mdAll projects
Project-level${project}/.lingma/agents/<agentName>.mdCurrent project only
Each agent file requires a frontmatter block for metadata and a system prompt:
---
name: code-review
description: A code review expert that checks code quality and security
tools: Read, Grep, Glob, Bash
---
You are a senior code reviewer. Ensure high code quality. Review checklist:
1. Code readability
2. Naming conventions
3. Error handling
4. Security checks
5. Test coverage
FieldRequiredDescription
nameYesUnique agent identifier
descriptionYesBrief description of function and expertise. Used for automatic agent selection
toolsNoList of allowed tools, comma-separated

Supported Tools

Tool NameDescription
ShellRun shell commands
EditEdit files
WriteCreate or overwrite files
GlobFind files by pattern
GrepSearch file contents
ReadRead files
WebFetchFetch URL content
WebSearchSearch the web with domain filtering

Use in Your IDE

Method 1: Automatic Trigger

Describe your task in natural language. The model matches your intent to the appropriate agent:
Review the implementation of this API
The model detects your intent and invokes the code-review agent.

Method 2: Manual Trigger

Type /agent-name to trigger a specific agent:
/code-review