OpenCode Agent Introduction
This section introduces the OpenCode Agent / Skill / MCP system. These capabilities are provided by OpenCode, and Witty CLI registers and reuses them through its managed configuration.
Agent System
Witty Built-in Agent: witty-builtin-agent
witty-builtin-agent is the default primary agent provided by the witty-builtin-agent subpackage. It is defined in /usr/share/witty/opencode/config.d/witty-builtin-agent.json and merged into /etc/opencode/opencode.json by the loader.
| Field | Value |
|---|---|
mode | primary |
| Description | Knowledge Q&A, command lookup, fault diagnosis, solution planning, and visual reports |
| Color | #5F87FF |
| Prompt | \{file:/usr/share/witty/opencode/agents/witty-builtin-agent/witty-builtin-agent.md} |
OpenCode Built-in Agents
Besides witty-builtin-agent, OpenCode provides several built-in agents, as shown by opencode agent list:
| Agent | Mode | Description |
|---|---|---|
build | primary | Default main agent |
plan | primary | Planning agent |
summary / title | primary | Summary / title generation |
explore / general / baize / dayu / kuafu / nuwa | subagent | Subagents for various purposes |
fuxi | all | Main agent and subagent |
Diagnostic Capability Package: witty-diagnosis-agent
witty-diagnosis-agent is an optional diagnostic capability package. It does not register as a standalone agent; it declares plugins in config.d/witty-diagnosis-agent.json and installs a large number of diagnostic Skills under /usr/share/witty/opencode/skills/witty-diagnosis-agent/. After installation, these Skills and plugin context are injected into the current agent.
Usage:
sudo dnf install witty-diagnosis-agentOpenCode / Witty loads the new Skills automatically after installation; run witty server restart to make them available to an already running server.
Skill System
Skills are OpenCode scenario capability packages loaded through skills.paths; Witty manages them as /usr/share/witty/opencode/skills.
Witty Built-in Skills (from the witty-builtin-agent subpackage)
| Skill | Purpose |
|---|---|
manpage-skill | Looks up usage, options, and examples of Linux / openEuler commands |
log-anomaly-detector | Analyzes system logs and performance metrics for preliminary fault localization |
html-report-generator | Renders diagnostic reports and solutions as web pages |
brainstorm-beagle | Produces complete actionable solutions when goals are unclear |
plantuml-skill | Draws flowcharts, sequence diagrams, and architecture diagrams |
Experience Skill Management: experience-skill
experience-skill is the core knowledge engine of Witty. It supports creating, evaluating, searching, merging, and optimizing two types of experience, Skill (workflow skills) and Wiki (distilled documents). Its CLI provides the subcommands sync, add-experiences, list-experiences, search-experiences, delete-*, and web, where web is the experience management interface.
Diagnostic Skills (from the witty-diagnosis-agent subpackage)
Installing witty-diagnosis-agent provides dozens of diagnostic Skills, for example:
linux-oom-analyzer,memory-leak-diagnosis,process-hang-diagnosisnetwork-diagnosis,dns-resolution-diagnosis,tls-certificate-diagnosisdisk-health-diagnosis,coredump_diagnose,kernel-io-uring-diagnosisroot-cause-analysis,root-cause-localization,fault-rca-report-generationand others
MCP System
openeuler_portal
openeuler_portal is the built-in local MCP of Witty. It uses npx -y openeuler-portal-mcp to query openEuler official site data, covering compatibility, CVE, packages, documents, SIGs, issues and pull requests. Its tokens (OPENEULER_TOKEN, GITCODE_TOKEN, FORUM_TOKEN) are injected through environment variables.
"mcp": {
"openeuler_portal": {
"type": "local",
"command": ["npx", "-y", "openeuler-portal-mcp"],
"environment": {
"OPENEULER_TOKEN": "${OPENEULER_TOKEN}",
"GITCODE_TOKEN": "${GITCODE_TOKEN}",
"FORUM_TOKEN": "${FORUM_TOKEN}"
},
"enabled": true,
"timeout": 30000
}
}Permission Policy
Default permission policy of witty-builtin-agent, excerpted:
"permission": {
"*": "ask",
"read": { "*": "allow", "*.env": "ask" },
"edit": "allow",
"glob": "allow",
"grep": "allow",
"webfetch": "allow",
"websearch": "allow",
"skill": "allow",
"task": "allow",
"openeuler_portal_*": "allow",
"bash": "allow",
"external_directory": { "*": "ask", "/tmp/**": "allow", "/usr/share/witty/**": "allow" }
}- Read-only operations such as querying system information, reading files, and checking status are allowed by default;
- Dangerous operations such as changing configuration, installing software, restarting services, and deleting files default to
askand require user confirmation; - Sensitive data is processed locally and is not uploaded without authorization.
Field semantics of
permissionfollow opencode.ai/docs.
