Agent skill

Go Service Guide

by 1204244136 in 1204244136/MDA

MaaFramework Go Agent / go-service 编写指南。用于编写、修改或审查 agent/go-service/ 下的 Go 自定义识别器、动作、EventSink,或了解 MaaFramework Go Agent 的注册、日志、目录组织和参数解析模式。

AGPL-3.0Auto-check passed

Install Go Service Guide

skills CLI
$ npx skills add 1204244136/MDA --skill go-service-guide -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install 1204244136/MDA go-service-guide --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/1204244136/MDA.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/go-service-guide .claude/skills/go-service-guide && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
go-service-guide
GitHub stars
120
Token cost
~1.3k tokens
SKILL.md length
139 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
AGPL-3.0

At a glance

MaaFramework Go Agent / go-service 编写指南。用于编写、修改或审查 agent/go-service/ 下的 Go 自定义识别器、动作、EventSink,或了解 MaaFramework Go Agent 的注册、日志、目录组织和参数解析模式。

  • SKILL.md covers 架构定位, 常见目录结构, 注册机制 and 编译期接口校验, plus 10 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Go Service Guide is an agent skill from 1204244136/MDA. MaaFramework Go Agent / go-service 编写指南。用于编写、修改或审查 agent/go-service/ 下的 Go 自定义识别器、动作、EventSink,或了解 MaaFramework Go Agent 的注册、日志、目录组织和参数解析模式。

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Nikke小助手 | Assistant For Goddess of Victory: Nikke. The licence is AGPL-3.0.

Example prompts

  • “/go-service-guide”

What it can do on your machine

Read from SKILL.md and the folder at commit 90bb2b2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Go Service Guide loads about 1.3k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 139 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~39
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from 1204244136/MDA at commit 90bb2b2, republished under its AGPL-3.0 licence (© 1204244136). 139 words, ~1,267 tokens.

Download SKILL.mdSave it as .claude/skills/go-service-guide/SKILL.md (or your agent's skills folder).
name
go-service-guide
description
MaaFramework Go Agent / go-service 编写指南。用于编写、修改或审查 agent/go-service/ 下的 Go 自定义识别器、动作、EventSink,或了解 MaaFramework Go Agent 的注册、日志、目录组织和参数解析模式。

MaaFramework Go Service 编写指南

架构定位

Go Service / Go Agent 只处理 Pipeline 难以表达的复杂逻辑,例如图像算法、状态机、外部数据、系统环境检查、运行时上下文处理等。

不要在 Go 中编写大规模业务流程;业务流程控制应优先由 Pipeline JSON 负责。

除非项目另有说明,所有坐标与图像处理以 720p(1280×720)为基准。

常见目录结构

text
agent/go-service/
├── main.go                 # 入口:初始化、registerAll、启动 AgentServer
├── register.go             # registerAll() 聚合各子包 Register()
├── logger.go               # 日志初始化
├── pkg/                    # 公共工具包
├── common/                 # 通用 Custom 组件
├── taskersink/             # TaskerEventSink / ContextEventSink 实现
└── <business>/             # 业务子包
    ├── register.go         # Register() 注册本包组件
    └── *.go                # 实现文件

实际项目可能只使用其中一部分;遵循当前仓库已有结构。

注册机制

子包 Register()

每个包含 MaaFramework 自定义组件的子包应暴露一个 Register() 函数,在其中注册本包所有组件:

go
package mypkg

import maa "github.com/MaaXYZ/maa-framework-go/v4"

func Register() {
    maa.AgentServerRegisterCustomAction("MyAction", &MyAction{})
    maa.AgentServerRegisterCustomRecognition("MyRecognition", &MyRecognition{})
}

注册名称必须与 Pipeline JSON 中 custom_action / custom_recognition 的名称一致。

main 聚合

子包 Register() 必须在总注册函数中调用:

go
func registerAll() {
    mypkg.Register()
}

遗漏调用会导致 Pipeline 中的 Custom 节点运行时找不到组件。

编译期接口校验

所有注册类型应在定义该类型的文件中包含编译期校验:

go
var _ maa.CustomActionRunner = &MyAction{}
var _ maa.CustomRecognitionRunner = &MyRecognition{}
var _ maa.TaskerEventSink = &MySink{}
var _ maa.ContextEventSink = &MySink{}

不要把这些校验集中放在 register.go,应靠近类型定义。

文件管理

  • 一个 Custom 组件的主要实现尽量集中在单个文件。
  • 同包内可按职责拆分多个 .go 文件,但避免无意义碎片化。
  • 参数结构体放在实现文件中,紧跟类型定义。
  • 公共工具放到 pkg/ 或当前项目已有公共包中。

命名

  • 包名简短、小写,使用单词,不重复上层目录语义。
  • 导出类型和方法使用清晰驼峰命名。
  • 未导出变量保持简短但可读。
  • Pipeline 注册名使用稳定的 PascalCase 字符串。

日志

优先使用当前项目已配置的结构化日志库;常见 MaaFramework Go 项目使用 zerolog。

go
log.Info().
    Str("component", "MyComponent").
    Str("step", "Prepare").
    Msg("prepared input")

log.Error().
    Err(err).
    Str("component", "MyComponent").
    Msg("failed to parse params")

规则:

  • 上下文用链式字段,避免拼进 Msg。
  • 错误用 .Err(err)。
  • 坐标、识别结果、参数等结构化输出为字段。
  • 不使用 log.Printf / log.Println,除非项目明确采用标准库日志。

注释

  • 导出符号添加 Go 风格注释,以符号名开头。
  • 未导出但复杂的逻辑可写简短注释解释为什么这样做。
  • 不要为显而易见的代码写解释性注释。

CustomAction 模板

go
package mypkg

import (
    "encoding/json"

    maa "github.com/MaaXYZ/maa-framework-go/v4"
    "github.com/rs/zerolog/log"
)

var _ maa.CustomActionRunner = &MyAction{}

type myActionParam struct {
    Target string `json:"target"`
}

// MyAction performs a custom Pipeline action.
type MyAction struct{}

func (a *MyAction) Run(ctx *maa.Context, arg *maa.CustomActionArg) bool {
    var params myActionParam
    if err := json.Unmarshal([]byte(arg.CustomActionParam), &params); err != nil {
        log.Error().
            Err(err).
            Str("component", "MyAction").
            Msg("failed to parse params")
        return false
    }

    return true
}

CustomRecognition 模板

go
package mypkg

import (
    "encoding/json"

    maa "github.com/MaaXYZ/maa-framework-go/v4"
    "github.com/rs/zerolog/log"
)

var _ maa.CustomRecognitionRunner = &MyRecognition{}

type myRecognitionParam struct {
    Threshold float64 `json:"threshold"`
}

// MyRecognition performs a custom Pipeline recognition.
type MyRecognition struct{}

func (r *MyRecognition) Run(ctx *maa.Context, arg *maa.CustomRecognitionArg) (*maa.CustomRecognitionResult, bool) {
    var params myRecognitionParam
    if err := json.Unmarshal([]byte(arg.CustomRecognitionParam), &params); err != nil {
        log.Error().
            Err(err).
            Str("component", "MyRecognition").
            Msg("failed to parse params")
        return nil, false
    }

    matched := true
    if !matched {
        return nil, false
    }

    return &maa.CustomRecognitionResult{
        Box:    arg.Roi,
        Detail: "{}",
    }, true
}

EventSink 模板

go
package mypkg

import maa "github.com/MaaXYZ/maa-framework-go/v4"

var _ maa.TaskerEventSink = &MySink{}

// MySink handles task lifecycle events.
type MySink struct{}

func (s *MySink) OnTaskerTask(tasker *maa.Tasker, event maa.EventStatus, detail maa.TaskerTaskDetail) {
    if event != maa.EventStatusStarting {
        return
    }
}

如需监听 Context 事件,实现 maa.ContextEventSink 并按项目现有方式注册。未使用的回调方法写空实现。

错误处理

  • 参数解析失败要记录错误并返回 false。
  • 外部 I/O、系统调用、图像处理错误要显式处理。
  • 不要静默吞掉错误。
  • 不要随意 panic;除非这是启动期不可恢复配置错误且项目已有相同模式。

审查清单

  • 注册名与 Pipeline custom_action / custom_recognition 完全一致。
  • 子包 Register() 已在总注册函数中调用。
  • 编译期接口校验靠近类型定义。
  • 参数解析有错误日志和失败返回。
  • 日志为结构化字段,不拼接上下文。
  • 导出符号有 Go 风格注释。
  • 业务流程没有从 Pipeline 大量搬到 Go。
  • 坐标/图像处理基于项目约定分辨率。
  • 没有无解释的 time.Sleep。

参考

© 1204244136, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/go-service-guide of 1204244136/MDA.

Open the folder on GitHubat commit 90bb2b2

Compare with similar skills

Go Service Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Go Service Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Go Service Guide this skill1204244136/MDA120—~1.3kAutomated safety check: PassAGPL-3.0
Pipeline GuideMaaEnd/MaaEnd4k—~1.9kAutomated safety check: PassAGPL-3.0
Go Service GuideMaaEnd/MaaEnd4k—~2.1kAutomated safety check: PassAGPL-3.0
Maa Pipeline Guideduorua/narutomobile340—~3.4kAutomated safety check: PassAGPL-3.0
Cpp Algo StyleMaaEnd/MaaEnd4k—~2.3kAutomated safety check: PassAGPL-3.0
Maafwkqcoxn/MaaPipelineEditor408—~1.1kAutomated safety check: PassMIT

Similar skills

  • Pipeline Guide

    MaaEnd/MaaEnd

    MaaEnd Pipeline JSON 编写指南。基于 MaaFramework Pipeline 协议,提供节点命名、识别算法、动作类型、流程控制、可复用节点等编码规范与模式参考。在编写、修改或审查 Pipeline JSON、设计节点流程、使用 TemplateMatch/OCR/Custom 识别或 Click/Swipe 动作时使用。

    4k GitHub stars~1.9k tokensUpdated today
    MobileAuto-check passed
  • Go Service Guide

    MaaEnd/MaaEnd

    MaaEnd go-service 编写指南。为 agent/go-service/ 下的 Go 代码提供架构、注册、命名、日志、注释等编码规范和模式参考。在编写、修改或审查 Go 自定义识别器、动作、EventSink,或需要了解 go-service 项目结构与 MaaFramework Go 集成方式时使用。

    4k GitHub stars~2.1k tokensUpdated today
    MobileAuto-check passed
  • Maa Pipeline Guide

    duorua/narutomobile

    Universal Pipeline JSON 编写指南。基于 MaaFramework Pipeline 协议,提供节点命名、识别算法、动作类型、流程控制、可复用节点等编码规范与模式参考。在编写、修改或审查 Pipeline JSON、设计节点流程、使用 TemplateMatch/OCR/Custom 识别或 Click/Swipe 动作时使用。

    340 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Cpp Algo Style

    MaaEnd/MaaEnd

    MaaEnd cpp-algo C++ 编码风格与工程规范指南。参考 MaaFramework 的优秀实践,规范命名、头文件、公共工具、错误处理、日志、CMake 等方面。在编写、修改或审查 agent/cpp-algo/ 下的 C++ 代码时使用。

    4k GitHub stars~2.3k tokensUpdated today
    MobileAuto-check passed
  • Maafw

    kqcoxn/MaaPipelineEditor

    MaaFramework 开发与集成指南。当任务涉及 MaaFramework 项目结构、Pipeline 协议、ProjectInterface V2 协议、自定义识别/动作(Custom/Agent)、Python/NodeJS/CSharp 等语言 Binding 集成、控制器配置、回调协议或运行时行为时使用。

    408 GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Maa Logging

    MaaEnd/MaaEnd

    MaaFramework 日志宏用法指南,适用于 MaaEnd cpp-algo。Use when writing logging code, using LogInfo/LogError/LogWarn/LogDebug/LogTrace, outputting containers or custom types to logs, or when the user asks about…

    4k GitHub stars~807 tokensUpdated today
    MobileAuto-check passed

More from 1204244136/MDA

All 9 skills in this repo
  • Generate Pi Task

    1204244136/MDA

    根据 MaaFramework Pipeline 定义生成或更新 Project Interface 任务 JSON。用于创建、编辑或扩展 assets/tasks/ 下的任务文件,将 Pipeline 节点映射为用户可配置选项(switch/select/checkbox/input)并绑定 pipelineoverride。

    120 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Dmp Analysis

    1204244136/MDA

    分析 Windows 崩溃转储文件(.dmp),诊断 MaaFramework / MXU 项目及其依赖项的崩溃。用于 issue 日志包或附件中发现 .dmp 文件,或用户要求分析 DMP / 崩溃转储时。

    120 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Maa Logging

    1204244136/MDA

    MaaFramework C++ 日志宏用法指南。用于写 C++ MaaFramework 扩展、Custom 组件或工具代码时使用 LogInfo/LogError/LogWarn/LogDebug/LogTrace、VAR、容器输出和自定义类型日志。

    120 GitHub stars~790 tokensUpdated yesterday
    Auto-check passed
  • 分析 MDA 公开 Issue、日志包或本地日志。用于 https://github.com/1204244136/MDA/issues/...、1234、MDA 日志压缩包、识别失败、任务卡死、控制器差异、Pipeline/Agent/MXU 问题。会从…

    120 GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Mda Project Guide

    1204244136/MDA

    MDA 项目专属开发指南。用于在 MDA 中编写或审查 MaaFramework Pipeline、Project Interface 任务、locale、go-service 组件时补充项目结构、业务域、命名习惯和现有任务选项示例。与通用 pipeline-guide、pipeline-debug、generate-pi-task、go-service-guide 配合使用。

    120 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Meojson

    1204244136/MDA

    meojson C++ JSON 库使用指南。用于 MaaFramework C++ 项目中的 JSON 解析、序列化、MEOJSONIZATION、json::value 操作、ext::jsonization 自定义类型支持,以及 Custom 参数解析。

    120 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed

Questions about Go Service Guide

What does Go Service Guide do?

MaaFramework Go Agent / go-service 编写指南。用于编写、修改或审查 agent/go-service/ 下的 Go 自定义识别器、动作、EventSink,或了解 MaaFramework Go Agent 的注册、日志、目录组织和参数解析模式。. Go Service Guide is an agent skill from 1204244136/MDA.

How do I install Go Service Guide in Claude Code?

Run `npx skills add 1204244136/MDA --skill go-service-guide -a claude-code`. Or copy the skill folder (.claude/skills/go-service-guide in 1204244136/MDA) into .claude/skills/go-service-guide in your project. Claude Code loads it when a task matches its description.

How do I install Go Service Guide in Codex?

Run `npx skills add 1204244136/MDA --skill go-service-guide -a codex`. Or copy the skill folder (.claude/skills/go-service-guide in 1204244136/MDA) into .agents/skills/go-service-guide in your project. Codex loads it when a task matches its description.

Can I use Go Service Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add 1204244136/MDA --skill go-service-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/go-service-guide, .gemini/skills/go-service-guide, .github/skills/go-service-guide and .opencode/skills/go-service-guide in your project.

What does Go Service Guide need to run?

SKILL.md names no scripts, command-line tools or credentials: Go Service Guide is instructions for the agent only.

Does Go Service Guide access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Go Service Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Go Service Guide use?

Go Service Guide is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Go Service Guide use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Go Service Guide?

Skills that share tags, products or a category with Go Service Guide: Pipeline Guide (MaaEnd/MaaEnd, 4k stars), Go Service Guide (MaaEnd/MaaEnd, 4k stars), Maa Pipeline Guide (duorua/narutomobile, 340 stars) and Cpp Algo Style (MaaEnd/MaaEnd, 4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Go Service Guide?

1204244136 (a GitHub user) maintains it in 1204244136/MDA, which has 120 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 10, 2026.

Source: 1204244136/MDA on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.