Skip to main content

YAML Configuration Formats

English | 简体中文

This document provides detailed explanations of the YAML configuration formats for each core concept in the Wegent platform. Each definition follows Kubernetes-style declarative API design patterns.

Table of Contents


👻 Ghost

Ghost defines the "soul" of an agent, including personality, capabilities, and behavior patterns.

Complete Configuration Example

apiVersion: agent.wecode.io/v1
kind: Ghost
metadata:
name: developer-ghost
namespace: default
spec:
systemPrompt: |
You are a senior software engineer, proficient in Git, GitHub MCP, branch management, and code submission workflows. You will use the specified programming language to generate executable code and complete the branch submission and MR (Merge Request) process.
mcpServers:
github:
env:
GITHUB_PERSONAL_ACCESS_TOKEN: ghp_xxxxx
args:
- run
- -i
- --rm
- -e
- GITHUB_PERSONAL_ACCESS_TOKEN
- -e
- GITHUB_TOOLSETS
- -e
- GITHUB_READ_ONLY
- ghcr.io/github/github-mcp-server
command: docker

Field Description

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Ghost
metadata.namespacestringYesNamespace, typically default
spec.systemPromptstringYesSystem prompt defining agent personality and capabilities
spec.mcpServersobjectNoMCP server configuration defining agent's tool capabilities
spec.skillsarrayNoList of Skill names to associate with this Ghost, e.g., ["skill-1", "skill-2"]

✨ Skill

Skill is a Claude Code capability extension package containing executable code and configuration. Skills are uploaded as ZIP packages and deployed to ~/.claude/skills/ when tasks start.

Complete Configuration Example

apiVersion: agent.wecode.io/v1
kind: Skill
metadata:
name: python-debugger
namespace: default
spec:
description: "Python debugging tool with breakpoint and variable inspection support"
version: "1.0.0"
author: "WeCode Team"
tags: ["python", "debugging", "development"]
status:
state: "Available"
fileSize: 2048576
fileHash: "abc123def456..."

Field Description

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Skill (used in Ghost spec.skills field)
metadata.namespacestringYesNamespace, typically default
spec.descriptionstringYesSkill功能描述 (extracted from SKILL.md frontmatter)
spec.versionstringNoVersion number (semantic versioning recommended)
spec.authorstringNoAuthor name or organization
spec.tagsarrayNoTags for categorization, e.g., ["python", "debugging"]
status.statestringYesSkill status: Available or Unavailable
status.fileSizeintegerNoZIP package size in bytes
status.fileHashstringNoSHA256 hash of the ZIP package

ZIP Package Requirements

Skills must be uploaded as ZIP packages containing:

  1. SKILL.md (required): Skill documentation with YAML frontmatter
  2. Other files: Scripts, configurations, assets, etc.

SKILL.md Format:

---
description: "Your skill description here"
version: "1.0.0"
author: "Your Name"
tags: ["tag1", "tag2"]
---

# Skill Documentation

Detailed description of what this skill does...

Using Skills in Ghosts

Associate skills with a Ghost by adding them to the spec.skills array:

apiVersion: agent.wecode.io/v1
kind: Ghost
metadata:
name: developer-ghost
namespace: default
spec:
systemPrompt: "You are a senior developer..."
mcpServers: {...}
skills:
- python-debugger
- code-formatter

When a task starts with this Ghost, the Executor automatically downloads and deploys these skills to ~/.claude/skills/.

🧠 Model

Model defines the AI model configuration, including environment variables and model parameters.

Complete Configuration ClaudeCode Example

apiVersion: agent.wecode.io/v1
kind: Model
metadata:
name: ClaudeSonnet4
namespace: default
spec:
modelConfig:
env:
ANTHROPIC_MODEL: "openrouter,anthropic/claude-sonnet-4"
ANTHROPIC_BASE_URL: "http://xxxxx"
ANTHROPIC_AUTH_TOKEN: "sk-xxxxxx"
ANTHROPIC_DEFAULT_HAIKU_MODEL: "openrouter,anthropic/claude-haiku-4.5"

Field Description

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Model
metadata.namespacestringYesNamespace, typically default
spec.modelConfigobjectYesModel configuration object
spec.modelConfig.envobjectYesEnvironment variables configuration

Common Environment Variables for ClaudeCode

Variable NameDescriptionExample Value
ANTHROPIC_MODELMain model configurationopenrouter,anthropic/claude-sonnet-4
ANTHROPIC_BASE_URLAPI base URLhttp://xxxxx
ANTHROPIC_AUTH_TOKENAuthentication tokensk-xxxxxx
ANTHROPIC_DEFAULT_HAIKU_MODELFast model configurationopenrouter,anthropic/claude-haiku-4.5

🐚 Shell

Shell defines the agent's runtime environment, specifying the runtime type, base image, and supported models.

Complete Configuration Example

apiVersion: agent.wecode.io/v1
kind: Shell
metadata:
name: ClaudeCode
namespace: default
labels:
type: local_engine
spec:
shellType: ClaudeCode
supportModel: []
baseImage: ghcr.io/wecode-ai/wegent-base-python3.12:1.0.1
status:
state: Available

Field Description

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Shell
metadata.namespacestringYesNamespace, typically default
metadata.labelsobjectNoLabels for categorization, e.g., type: local_engine or type: external_api
spec.shellTypestringYesShell type, such as ClaudeCode, Agno, Dify
spec.supportModelarrayNoList of supported model types
spec.baseImagestringNoDocker base image for local engine shells (required for local_engine type)
status.statestringNoShell status: Available or Unavailable

Shell Types

TypeLabelDescription
ClaudeCodelocal_engineClaude Code runtime, requires baseImage
Agnolocal_engineAgno runtime, requires baseImage
Difyexternal_apiDify external API runtime, no baseImage needed

Labels

LabelValuesDescription
typelocal_engine, external_apiIndicates whether the shell runs locally or connects to external API

🤖 Bot

Bot is a complete agent instance that combines Ghost, Shell, and Model.

Complete Configuration Example

apiVersion: agent.wecode.io/v1
kind: Bot
metadata:
name: developer-bot
namespace: default
spec:
ghostRef:
name: developer-ghost
namespace: default
shellRef:
name: ClaudeCode
namespace: default
modelRef:
name: ClaudeSonnet4
namespace: default

Field Description

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Bot
metadata.namespacestringYesNamespace, typically default
spec.ghostRefobjectYesGhost reference
spec.shellRefobjectYesShell reference
spec.modelRefobjectYesModel reference

Reference Format

All references follow the same format:

name: "resource-name"
namespace: "default"

👥 Team

Team defines a collaborative team of multiple Bots, specifying member roles and collaboration patterns.

Complete Configuration Example for ClaudeCode Model

apiVersion: agent.wecode.io/v1
kind: Team
metadata:
name: dev-team
namespace: default
spec:
members:
- role: "leader"
botRef:
name: developer-bot
namespace: default
prompt: ""
collaborationModel: "pipeline"

Field Description

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Team
metadata.namespacestringYesNamespace, typically default
spec.membersarrayYesList of team members
spec.collaborationModelstringYesCollaboration model

Member Configuration

FieldTypeRequiredDescription
rolestringNoMember role, such as leader
botRefobjectYesBot reference
promptstringNoMember-specific prompt

Collaboration Models

ModelDescription
pipelinePipeline mode, execute in sequence
routeRoute mode, route based on conditions
coordinateCoordinate mode, members coordinate
collaborateConcurrent mode, members execute simultaneously

🤝 Collaboration

Collaboration defines the interaction patterns and workflows between Bots in a Team.

Complete Configuration Example for ClaudeCode

apiVersion: agent.wecode.io/v1
kind: Collaboration
metadata:
name: workflow-collaboration
namespace: default
spec:
type: "workflow"
config:
steps:
- name: "planning"
participants:
- "planner-bot"
- name: "development"
participants:
- "developer-bot"
- name: "review"
participants:
- "reviewer-bot"

Field Description

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Collaboration
metadata.namespacestringYesNamespace, typically default
spec.typestringYesCollaboration type
spec.configobjectYesCollaboration configuration

Workflow Configuration

FieldTypeDescription
stepsarrayList of workflow steps
steps.namestringStep name
steps.participantsarrayList of participants

💼 Workspace

Workspace defines the team's working environment, including code repository and branch information.

Complete Configuration Example

apiVersion: agent.wecode.io/v1
kind: Workspace
metadata:
name: project-workspace
namespace: default
spec:
repository:
gitUrl: "https://github.com/user/repo.git"
gitRepo: "{user}/{repo}"
branchName: "main"
gitDomain: "github.com"

Field Description

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Workspace
metadata.namespacestringYesNamespace, typically default
spec.repositoryobjectYesRepository configuration

Repository Configuration

FieldTypeRequiredDescription
gitUrlstringYesGit repository URL
gitRepostringYesRepository path format
branchNamestringYesDefault branch name
gitDomainstringYesGit domain

🎯 Task

Task defines the task to be executed, associating Team and Workspace.

Complete Configuration Example

apiVersion: agent.wecode.io/v1
kind: Task
metadata:
name: implement-feature
namespace: default
spec:
title: "Implement new feature"
prompt: "Task description"
teamRef:
name: dev-team
namespace: default
workspaceRef:
name: project-workspace
namespace: default

Field Description

FieldTypeRequiredDescription
metadata.namestringYesUnique identifier for the Task
metadata.namespacestringYesNamespace, typically default
spec.titlestringYesTask title
spec.promptstringYesTask description
spec.teamRefobjectYesTeam reference
spec.workspaceRefobjectYesWorkspace reference

Task Status

StatusDescription
PENDINGWaiting for execution
RUNNINGCurrently executing
COMPLETEDExecution completed
FAILEDExecution failed
CANCELLEDExecution cancelled
DELETETask deleted

Best Practices

1. Naming Conventions

  • Use lowercase letters, numbers, and hyphens
  • Avoid special characters and spaces
  • Names should be descriptive

2. Namespaces

  • Use default namespace by default
  • Use different namespaces in multi-tenant environments

3. Reference Management

  • Ensure referenced resources exist
  • Use the same namespace
  • Avoid circular references

4. Status Management

  • Regularly check resource status
  • Handle unavailable resources promptly
  • Monitor task execution progress

5. Configuration Validation

  • Use YAML syntax validation tools
  • Check required fields
  • Validate reference relationships