new-mq-consumer

new-mq-consumer is a skill for Claude Code from zuoyebang/aiweave. It costs 38 tokens per session (1,072 once invoked), scanned A, original, Apache-2.0.

A skill that generates a message-queue consumer for a Go service from its scheduled-task design. A message queue delivers events between services, and a consumer reads those events; this one is designed to batch them, store them, update Redis, and send failures to a dead-letter queue.

In plain words
What is it for?
Use it to create a consumer under the project's MQ controllers for a specified topic. It supports batched processing, database writes, Redis updates, dead-letter handling, and command or configuration registration.
Why use it?
It checks that the consumer's supporting clients, configuration, commands, database schema, and cache mappings exist before generating code. This reduces incomplete integration between incoming messages, storage, and Redis.

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 go build ./controllers/mq/... ./router/....

Good fit Use it to create a consumer under the project's MQ controllers for a specified topic. It supports batched processing, database writes, Redis updates, dead-letter handling, and command or configuration registration.

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-mq-consumer

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-mq-consumer

README.md
[![agentmods](https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-mq-consumer/github.svg)](https://agentmods.dev/skills/zuoyebang/aiweave/new-mq-consumer)
Your own site
<a href="https://agentmods.dev/skills/zuoyebang/aiweave/new-mq-consumer"><img src="https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-mq-consumer/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-mq-consumer

Your own site · 80×15
<a href="https://agentmods.dev/skills/zuoyebang/aiweave/new-mq-consumer"><img src="https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-mq-consumer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,072 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.00038 $0.01072
Opus 5 $0.00019 $0.00536
Sonnet 5 $0.00008 $0.00214
Haiku 4.5 $0.00004 $0.00107

Measured 12d ago against content hash 4930807dd53f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

new-mq-consumer 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 12d 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-mq-consumer/SKILL.md · 113 lines

How it starts

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

生成 MQ 消费者。

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

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

  • ⛔ 拒绝(§A.1):topic 命中 BUILD_STATUS.md §0 中 🚫 模块时立即拒绝
  • 状态检查(§A.2):读 BUILD_STATUS.md §3 与 §6.2
  • 依赖(§A.3):Consumer Client 基础设施可能不存在,首次运行必须先:
    1. 检查 helpers/kafka_consumer.go 是否存在;不存在 → 先生成(按 docs/architecture/helpers_api.md §3.2):
      var {Topic}SubClient *kafka.SubClient
      func InitKafkaConsumer(engine *gin.Engine) {
          {Topic}SubClient = kafka.InitKafkaSub(engine, conf.RConf.KafkaSub["{topic}"])
          if {Topic}SubClient == nil { panic("init kafka consumer failed!") }
      }
      
    2. 检查 conf/mount/resource.yaml 有对应 kafkaSub 节
    3. 检查 cobra 子命令 {topic}-consumerrouter/command.go::Commands 注册并调 helpers.InitKafkaConsumer(engine)

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

  • 主文档:docs/service/scheduled_tasks_design.md §3
  • 额外必读:
    • docs/schema/database_design.md(落库表 / 按月分片)
    • docs/architecture/pkg_api.md §kafka.SubClient
    • docs/cache/cache_design.md §2.x(Redis 联动 Hash 字段映射)

第 2 步:生成消费者代码

文件:controllers/mq/{topic}_consumer.go

package mq

import (
    "{project}/helpers"
    "{project}/models/db_xxx_call_log"
    "{project}/pkg/gin"
    "{project}/pkg/golib/v2/tlog"
)

type {Topic}Msg struct {
    // 字段定义(与 Producer 侧 struct 一致)
}

func Start{Topic}Consumer(engine *gin.Engine) {
    helpers.{Topic}SubClient.Subscribe(handle{Topic}Message)
    select {} // block
}

func handle{Topic}Message(ctx *gin.Context, msg interface{}) error {
    // 1. 反序列化
    // 2. 攒批(200 条 / 5s)
    // 3. 按时间月份分组 → 分表名
    // 4. 批量 INSERT
    // 5. HINCRBY 更新 Redis 日统计
    // 6. 提交 offset
    // 7. 失败 → 重试 3 次 → DLQ
}

第 3 步:注册消费者

router/mq.go

package router

import (
    mq_ctrl "{project}/controllers/mq"
    "{project}/pkg/gin"
)

func Mq(engine *gin.Engine) {
    go mq_ctrl.Start{Topic}Consumer(engine)
}

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

  • 确认 scheduled_tasks_design.md §3 与实现一致
  • 确认 database_design.md §4.5 MQ 链路一致
  • 确认 routing.md §7 MQ 路由已登记
  • 更新 BUILD_STATUS §6.2 状态

Read the full file on GitHub · 113 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. 12d ago First seen · 113 lines · 38 tokens per session scan A 4930807dd53f

Subscribe to this mod's changes

new-mq-consumer is a skill published in the GitHub repository zuoyebang/aiweave (20 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 38 tokens to every session and 1,072 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

goframe-v2

GoFrame development skill. TRIGGER when writing/modifying Go files, implementing services, creating APIs, or database operations. DO NOT TRIGGER for frontend/shell scripts.

hashgraph-online/awesome-codex-plugins · 40 tokens

go

Use when writing, reviewing, testing, or shipping Go code and HTTP services: idioms, %w error wrapping, goroutine/context/errgroup concurrency, net/http 1.22 routing, log/slog, project layout, table-driven tests, Go hardening. NOT language-agnostic threat modeling (that is secure-coding), NOT Dockerfile/CI shipping…

ericrisco/rsc-harness · 86 tokens

go-services

Build Go HTTP services with contextual cancellation, middleware, tests, and compact deployable binaries.

alivirgo/Major-AI-Skills · 21 tokens

new-feature-go

Pre-flight checklist for adding a new feature to a Go 1.22+ service. Load when creating a new endpoint, internal package, external integration, or background worker. Forces "accept interfaces, return structs", context.Context propagation, error wrapping, and bulkhead-per-provider from line one — prevents the most…

yerdaulet-damir/vibe-coding-rules · 91 tokens

skill-go-gin-api

Padrões DARE para APIs REST em Go + Gin (ou stdlib net/http) + sqlc + PostgreSQL. Handlers, services, repositories, middleware, validação com go-playground/validator, JWT, rate limit, swag (OpenAPI), testes com testify e httptest.

dewtech-technologies/dare-method · 67 tokens

golang-pro

Implements concurrent Go patterns using goroutines and channels, designs and builds microservices with gRPC or REST, optimizes Go application performance with pprof, and enforces idiomatic Go with generics, interfaces, and robust error handling. Use when building Go applications requiring concurrent programming…

PIXARTSeu/Synapse · 95 tokens