Install
$ agentstack add skill-zuoyebang-aiweave-new-test ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
为 $ARGUMENTS 生成 test/cases/ 下的接口级测试文件。
> 公共步骤模板见 [skills-spec/01skillauthoring_guide.md](path) §A-§E。本 Skill 特定内容如下。 > > 职责:补齐遗漏的测试。正常流程下,/new-service / /new-controller 在生成业务代码时就应同步测试。本 Skill 仅在发现某接口代码已有但测试缺失时使用。
第 0 步:拒绝规则与依赖前置
- ⛔ 拒绝(§A.1):接口路径命中
BUILD_STATUS.md§0 中 🚫 模块时立即拒绝 - 状态检查(§A.2):读
BUILD_STATUS.md§5 → handler 必须已实现(🟢);未实现 → 停止,提示先/new-controller - 依赖(§A.3):
- 读
docs/testing/testing_design.md§4 确认框架 API 签名 - 读
test/fixtures/seed/README.md熟悉 seed 数据
第 1 步:读取设计文档(公共必读见 §B)
- 主文档:
docs/api/{audience}_interfaces.md - 提取:请求参数 / 响应结构 / 校验规则 / 错误码映射
第 2 步:生成测试文件
文件路径:test/cases/{audience}/{module}_{action}_test.go
按 §D 的 4 类用例模板生成(每类至少 1 个 sub test):
package {audience}_test
import (
"testing"
"{project}/test/framework"
)
func Test{Action}_Succ(t *testing.T) {
body := map[string]interface{}{ /* 合法参数 */ }
resp := framework.{Audience}Post(t, "{path}", {auth}, body)
framework.AssertSucc(t, resp)
framework.AssertJSONField(t, resp.{Audience}.Data, "xxx", "expected")
}
func Test{Action}_MissingXxx_Expected{Code}(t *testing.T) {
body := map[string]interface{}{ /* 缺字段 */ }
resp := framework.{Audience}Post(t, "{path}", {auth}, body)
framework.AssertFail(t, resp, {errCode})
}
func Test{Action}_{Module}Disabled_Expected{Code}(t *testing.T) {
// seed 中状态为禁用的 {核心实体}
resp := framework.{Audience}Post(t, "{path}", {edge case auth}, body)
framework.AssertFail(t, resp, {errCode})
}
func Test{Action}_WritesMysqlAndRedis(t *testing.T) {
resp := framework.{Audience}Post(t, "{path}", {auth}, body)
framework.AssertSucc(t, resp)
framework.AssertMysqlExists(t, "{example_db}", "{example_table}", "field = ?", value)
framework.AssertRedisHashField(t, "{ns}:info:"+entityId, "status", "1")
}
第 3 步:接入 TestMain
每个 cases/{audience}/ 子包应有 common_test.go 提供 TestMain。新增测试文件不重复写。如是新路由组的第一个文件,先创建:
package {audience}_test
import (
"os"
"testing"
"{project}/test/framework"
)
func TestMain(m *testing.M) {
code := framework.RunTests(m)
os.Exit(code)
}
第 4 步:文档同步(公共项见 §C)
- 确认 BUILD_STATUS §9.5 对应行标 🟢
- seed 不足以支持某用例 → 在
test/fixtures/seed/*.sql补 + 同步test/fixtures/seed/README.md
第 5 步:验证(公共格式见 §E)
cd test
go build ./cases/{audience}/...
go vet ./cases/{audience}/...
go test -v ./cases/{audience}/... -run Test{Action}
测试红了:
- 检查 seed 数据是否匹配
- 检查业务代码是否有 bug(报告给用户而非改测试迎合 bug)
- 检查断言是否正确
> 🧩 AIWeave 骨架 · 作者 XuRuibo · Apache-2.0 · 模板文件,复制到工程后按业务语义填充
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: zuoyebang
- Source: zuoyebang/aiweave
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.