Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .agents/.claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
"name": "dubbo-go-agent-skills",
"description": "Agent skills bundled with Apache dubbo-go for v3 framework users",
"owner": {
"name": "Apache Dubbo"
},
"plugins": [
{
"name": "dubbo-go",
"description": "AI skills for Apache dubbo-go v3 users — scaffolding, extensions, Java interop, debugging, guidance, migration, plus contributor support.",
"category": "development",
"source": {
"source": "url",
"url": "https://github.com/apache/dubbo-go.git"
},
"homepage": "https://github.com/apache/dubbo-go/tree/main/.agents"
}
]
}
68 changes: 68 additions & 0 deletions .agents/.codex/INSTALL.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文档里面写的步骤都必要吗?我怎么感觉不太需要呀

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只保留Tell Codex: 剩下的删掉?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是面向用户的还是面向agents的文档呀

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我晕了 I have fixed it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我觉得无论是面向用户的还是面向agents这个文档都没啥用呀

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你看一下https://github.com/obra/superpowers 就没有这个文档
这个install.md 真的有必要吗

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Installing dubbo-go Agent Skills for Codex

## Install

Install these skills globally when the user asks to install dubbo-go skills for Codex.

```bash
if [ -d ~/.codex/dubbo-go/.git ]; then
git -C ~/.codex/dubbo-go pull --ff-only
else
git clone https://github.com/apache/dubbo-go.git ~/.codex/dubbo-go
fi

mkdir -p ~/.agents/skills
rm -rf ~/.agents/skills/dubbo-go
ln -s ~/.codex/dubbo-go/.agents/skills ~/.agents/skills/dubbo-go
```

Restart Codex after installation.

### Windows

```powershell
$repo = "$env:USERPROFILE\.codex\dubbo-go"
if (Test-Path "$repo\.git") {
git -C $repo pull --ff-only
} else {
git clone https://github.com/apache/dubbo-go.git $repo
}

New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.agents\skills"
Remove-Item -Recurse -Force "$env:USERPROFILE\.agents\skills\dubbo-go" -ErrorAction SilentlyContinue
cmd /c mklink /J "$env:USERPROFILE\.agents\skills\dubbo-go" "$env:USERPROFILE\.codex\dubbo-go\.agents\skills"
```

Restart Codex after installation.

## Update

```bash
cd ~/.codex/dubbo-go
git pull --ff-only
rm -rf ~/.agents/skills/dubbo-go
ln -s ~/.codex/dubbo-go/.agents/skills ~/.agents/skills/dubbo-go
```

Restart Codex after updating.

## Usage

The installed skills cover scaffolding, custom SPI extensions, Java interoperability, runtime debugging, conceptual guidance, and migration for dubbo-go v3 — plus a contributor-focused skill for modifying the `apache/dubbo-go` repository itself.
46 changes: 46 additions & 0 deletions .agents/.opencode/plugins/dubbo-go-agent-skills.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { readFileSync } from 'fs';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';

const __dirname = dirname(fileURLToPath(import.meta.url));
const pluginRoot = join(__dirname, '..', '..');

const skillNames = ['scaffolding', 'extensions', 'java-interop', 'debug', 'guide', 'migrate', 'development'];

export const skills = skillNames.map(name => {
const skillPath = join(pluginRoot, 'skills', name, 'SKILL.md');
let content;
try {
content = readFileSync(skillPath, 'utf-8');
} catch (err) {
throw new Error(`dubbo-go-agent-skills: failed to read ${skillPath}: ${err.message}`);
}
// Parse frontmatter (tolerates both LF and CRLF line endings)
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);
const frontmatter = match ? match[1] : '';
const body = match ? match[2] : content;
const nameMatch = frontmatter.match(/^name:\s*(.+)$/m);
const descMatch = frontmatter.match(/^description:\s*(.+)$/m);
return {
name: nameMatch ? nameMatch[1].trim() : `dubbo-go:${name}`,
description: descMatch ? descMatch[1].trim() : '',
content: body,
};
});
24 changes: 24 additions & 0 deletions .agents/GEMINI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

@./skills/scaffolding/SKILL.md
@./skills/extensions/SKILL.md
@./skills/java-interop/SKILL.md
@./skills/debug/SKILL.md
@./skills/guide/SKILL.md
@./skills/migrate/SKILL.md
@./skills/development/SKILL.md
142 changes: 142 additions & 0 deletions .agents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# dubbo-go Agent Skills

[English](README.md) | [中文](README_CN.md)

AI agent skills bundled with [Apache dubbo-go](https://github.com/apache/dubbo-go) — make your coding assistant fluent in dubbo-go v3.

## What This Gives You

When you're using dubbo-go, your AI assistant now actually knows what it's doing.

Ask it to scaffold a new provider or consumer and it picks the current code-API style (`dubbo.NewInstance` + `server.WithServerProtocol`), wires up the registry you actually use, and produces something that compiles on the first try. Need a custom filter or load balancer? It knows the SPI pattern — `extension.SetXxx` registration, blank imports, per-service or per-reference activation. Calling a Java Dubbo service? It picks Triple+Protobuf or Dubbo+Hessian2 based on whether you have a `.proto` or a Java interface, and gets the POJO class names right.

Ask why your service won't connect, and it triages by structured checklist — registry, protocol, serialization, filter chain — instead of guessing. Migrating from gRPC-Go or Spring Cloud? It maps the concepts side by side.

Skills activate automatically when the conversation matches; you don't invoke them by name.

> All skills target dubbo-go **v3**. v1 and v2 are deprecated.

## Install

Install paths vary by AI tool. Claude Code and Cursor read a marketplace; Codex and OpenCode are manual.

### Claude Code / Cursor

```bash
/plugin marketplace add apache/dubbo-go
/plugin install dubbo-go@dubbo-go-agent-skills
```

### Codex

Tell Codex:

```
Fetch and follow instructions from https://raw.githubusercontent.com/apache/dubbo-go/main/.agents/.codex/INSTALL.md
```

Full instructions: [.codex/INSTALL.md](.codex/INSTALL.md)

### OpenCode

Add to `opencode.json`:

```json
{
"plugin": ["dubbo-go-agent-skills@git+https://github.com/apache/dubbo-go.git#path:.agents"]
}
```

### Gemini CLI

```bash
gemini extensions install https://github.com/apache/dubbo-go --path .agents
```

Update later with:

```bash
gemini extensions update dubbo-go-agent-skills
```

### Verify

Open a new session and try one of these:

- "Scaffold a dubbo-go provider with Nacos"
- "Why does my consumer log 'no provider available'?"
- "How do I call a Java Dubbo service from Go?"

The assistant should auto-trigger the matching skill.

## Reference Docs

Use the official Dubbo Golang SDK documentation as the primary reference for user-facing behavior and tutorials:

- [Dubbo Golang SDK documentation](https://github.com/apache/dubbo-website/tree/master/content/zh-cn/overview/mannual/golang-sdk)

## Skills

### scaffolding

Generates provider or consumer skeletons in v3 code-API style (`dubbo.NewInstance` / `server.NewServer` / `client.NewClient`). Asks about protocol (Triple / Dubbo / gRPC) and registry (Nacos / ZooKeeper / etcd / direct) first, then produces a complete, compilable skeleton matching the official samples. Covers OpenAPI, HTTP handler attachment, and HTTP/3.

### extensions

Custom SPI extensions — Filter, LoadBalance, Registry, Protocol, Router, Logger. Explains the uniform pattern (`extension.SetXxx` + blank import + `WithFilter` / `WithLoadBalance`), with runnable templates and the silent-failure modes that catch newcomers.

### java-interop

Cross-language RPC between dubbo-go and dubbo-java. Picks Triple+Protobuf for new services, Dubbo+Hessian2 for existing Java-defined ones, and gets POJO class names, method-name casing, and the curl-friendly HTTP route format right.

### debug

Structured diagnosis for runtime errors. Matches your error or log against known patterns — "no provider available", connection refused, serialization mismatch, timeout, filter panic, OpenAPI 404, AttachHTTPHandler failure, slow shutdown — and gives a targeted checklist.

### guide

Architecture, extension points, and best practices. Covers Instance, Protocol, Registry, Filter, Cluster, LoadBalance, Router, Triple OpenAPI, HTTP/3, CORS, graceful shutdown, observability, and tells agents to read the current `apache/dubbo-go-samples` README and directories when choosing examples.

### migrate

Step-by-step migration guidance:

- **gRPC-Go** — concept mapping, proto reuse, direct mode parallels
- **Spring Cloud (Java)** — registry sharing, Java/Go coexistence path
- **Gin / plain HTTP** — coexistence options and Triple REST mode
- **dubbo-go v1/v2 → v3** — breaking-change table, minimum migration path
- **YAML-heavy v3** — incremental move to the code API

### development

For contributors modifying the `apache/dubbo-go` repository itself — Go toolchain, package boundaries, validation commands, generated files, repository-level do-not rules. Not for application-side scaffolding.

## Contributing

Skills live in `.agents/skills/<name>/SKILL.md`.

1. Edit or add a skill in place.
2. Keep the frontmatter `description` trigger-focused — that line is what the agent reads to decide whether to use the skill.
3. Update `.agents/` metadata only when install paths, skill names, or supported agents change.
4. Submit through the normal dubbo-go contribution workflow.

## License

Apache License 2.0
Loading
Loading