new-service

new-service is a skill for Claude Code from zuoyebang/aiweave. It costs 29 tokens per session (953 once invoked), scanned A, original, Apache-2.0.

A code-generation guide for implementing service methods from a service-design document. It selects error handling, the appropriate MySQL database client, and how MySQL and Redis writes are handled.

In plain words
What is it for?
Use it to create service-layer methods for modules whose database, cache, error, and dependency rules are documented.
Why use it?
It removes repeated decisions when turning a written service design into consistent Go code.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is cd test && go test -v ./cases/{scope}/... -run Test{Method}.

Good fit Use it to create service-layer methods for modules whose database, cache, error, and dependency rules are documented.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/zuoyebang/aiweave
agentmods
npx agentmods add skills/zuoyebang/aiweave/new-service

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for new-service

README.md
[![agentmods](https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-service/github.svg)](https://agentmods.dev/skills/zuoyebang/aiweave/new-service)
Your own site
<a href="https://agentmods.dev/skills/zuoyebang/aiweave/new-service"><img src="https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-service/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for new-service

Your own site · 80×15
<a href="https://agentmods.dev/skills/zuoyebang/aiweave/new-service"><img src="https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-service.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 953 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.00953
Opus 5 $0.00015 $0.00477
Sonnet 5 $0.00006 $0.00191
Haiku 4.5 $0.00003 $0.00095

Measured 9d ago against content hash 8bfecb2a2604, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

new-service scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/skills/new-service/SKILL.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

根据 $ARGUMENTS 生成 Service 方法实现。

公共步骤模板见 skills-spec/01_skill_authoring_guide.md §A-§E。本 Skill 特定内容如下。

第 0 步:拒绝规则与依赖前置

  • ⛔ 拒绝(§A.1):module 命中 BUILD_STATUS.md §0 中 🚫 模块时立即拒绝
  • 状态检查(§A.2):读 BUILD_STATUS.md §4 Service 层明细
  • 依赖(§A.3):
    • components/constants.go 不存在 → 先按 constants.md §10 生成
    • 如本 Skill 是核心校验类(auth 等)→ 检查 service/{module}/cache_loaders.go 是否就绪,否则先生成
    • 如本 Skill 是 Internal 业务上报类(需写 Kafka)→ 检查 helpers/kafka_consumer.go 是否就绪

第 1 步:读取设计文档(公共必读见 §B)

  • 主文档:docs/service/{module}_service.md + docs/service/service_design.md
  • 额外必读:docs/schema/database_design.mddocs/cache/cache_design.md

第 2 步:确定编码规则

错误类型选择

模块 错误类型
{特定方法集,详见 docs-spec/09 §5} *components.ServiceError(业务状态码)
其他 base.Error(内部错误码)

MySQL Client 选择

按表所属库选择 helpers.MysqlClient{Core/Trade/Log/CallLog}

双写模式

// 1. 先写 MySQL
if err := helpers.MysqlClientCore.Model(&model).Updates(updates).Error; err != nil {
    return nil, components.ErrorDbUpdate.Wrap(err)
}
// 2. 写 Redis(失败不回滚,仅 WARN)
if err := helpers.{Project}CacheClient.HSet(ctx, key, ...); err != nil {
    tlog.WarnLogger(ctx, "redis write failed after mysql success",
        tlog.String("redisKey", key),
        tlog.String("error", err.Error()))
}
// 3. 清除本地缓存
helpers.{LocalCache1}.Delete(key)

第 3 步:生成 Service 文件

文件路径:service/{module}/{module}.go(核心校验类模块可拆分为 {module}.go + checker.go

{module}_service.md 中的伪码精确实现。

第 4 步:文档同步(公共项见 §C)

  • 确认 {module}_service.md 与实现一致;伪码需调整时同步更新 md
  • 更新 BUILD_STATUS §4 状态

第 5 步:测试同步(4 类用例标准见 §D)

测试位置(按对外接口归属):

service 模块 测试位置
核心校验类 test/cases/internal/{module}_*_test.go
Internal 业务上报类(如 {module}.{Method-N}) test/cases/internal/{module}_*_test.go 或 cases/operator/
其他业务模块 test/cases/operator/ 或 cases/admin/
内部方法(无对外接口) 同目录 _test.go 单元测试
cd test && go test -v ./cases/{scope}/... -run Test{Method}

第 6 步:验证(公共格式见 §E)

Read the full file on GitHub · 93 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 93 lines · 29 tokens per session scan A 8bfecb2a2604

Subscribe to this mod's changes

new-service is a skill published in the GitHub repository zuoyebang/aiweave (20 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 29 tokens to every session and 953 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.