mate-new-module

A project-specific guide for creating MateCloud business modules with Domain-Driven Design (DDD), a way to organise code around business concepts.

In plain words
What is it for?
Use it when scaffolding a new mate-xxx service, adding it to the Maven build, configuring it, or checking its layers before committing.
Why use it?
It prevents new services from violating the project's package structure, naming rules, error-code conventions, or port assignments.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mateaix/matecloud/mate-new-module
Any agent
npx skills add mateaix/matecloud --skill mate-new-module
Clone the repo
git clone --depth 1 https://github.com/mateaix/matecloud

Made for: Claude Code, Codex.

Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 851 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00079 $0.00851
Opus 5 $0.00039 $0.00426
Sonnet 5 $0.00016 $0.00170
Haiku 4.5 $0.00008 $0.00085

Measured 2d ago against content hash 8583b3745893, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mate-new-module 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 2d 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.

.claude/.harness/skills/mate-new-module/SKILL.md · 51 lines

What it actually says

新建 MateCloud 业务模块

目标:产出一个符合 DDD 四层 + 项目约定的新模块,而不是随手摆几个包。 完整规则见 .claude/.harness/rules/01-architecture.md02-conventions.md

第一步:优先用 CLI 脚手架(别手搓)

java -jar mate-cli/target/mate-cli.jar new module mate-{name} --port {port}

端口按段分配(见 coding-standards §1.3):9030-9039 系统 / 9040-9049 后台 / 9050-9059 通知 / 9060+ 业务扩展。新模块端口递增,别撞已用端口。

CLI 不可用时才手动建,且必须补齐:

  1. mate-biz/mate-{name}/pom.xml 引入所需 starter(core7 必备)。
  2. application.yml(~15 行):端口 + 应用名 + spring.config.import 引 Nacos。
  3. Mate{Name}Application.java@SpringBootApplication + @EnableDubbo
  4. DDD 四层包:trigger / application / domain / infrastructure / types
  5. pom.xmlmate-biz/pom.xml 各加一行 <module>

第二步:四层落位(包根 vip.mate.{name}

  • trigger/ controller(/api/v1/... + @SaCheckLogin/@SaCheckPermission) · rpc · event · job
  • application/ command(写,@Transactional) · query(读,接口+impl) · convertor(MapStruct)
  • domain/ model{aggregate,entity,valobj} · service · adapter{repository,port}(接口) · event
  • infrastructure/ adapter 实现 · dao + dao/po(PO) · seed · config
  • types/ exception(ErrorCode 枚举) · constant · security(Perms)

约束清单(提交前逐条自查)

  • 领域纯净domain/model/** 零框架 import(框架注解只在 PO)。
  • CQRS:Command 与 Query 不混在一个类;Command 标 @Transactional(rollbackFor=Exception.class)
  • 仓储接口在 domain,实现在 infrastructure;application 不直接碰 DAO。
  • 所有对象转换用 MapStruct,不用 BeanUtils.copyProperties
  • 错误码 {MODULE}{TYPE}{SEQ}(如 ORDB001;A=参数 B=业务 C=RPC D=DB E=外部)。
  • mate_ 前缀,必备 deleted/lock_version/created_at/updated_at
  • API 统一 /api/v1/,返回 Result<T>;权限用 Perms 常量不硬编码。
  • 无内联 FQN,import 按 IntelliJ 默认分组(见 rules/02)。

第三步:建完即自检

bash .claude/.harness/checks/run-all.sh

阻断级必须全绿。代码生成可用 mate-cli gen code --table {table} --module mate-{name} --service {svc}

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. 2d ago First seen · 51 lines · 79 tokens per session scan A 8583b3745893

Subscribe to this mod's changes

mate-new-module is a skill published in the GitHub repository mateaix/matecloud (1,693 stars, last pushed 3d ago), licensed Apache-2.0. It adds 79 tokens to every session and 851 once invoked, about $0.0004 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

release-sample-sweep

Run the pre-release end-to-end sweep of every user-facing surface — the 33 samples under samples/ (booted from their packaged artifacts and driven in a real browser via chrome-devtools MCP), the Expo/React Native client, and the atmosphere CLI. Use before cutting a release, and after any change to the Console bundle…

Atmosphere/atmosphere · 143 tokens

obsidian-writer

Write well-formatted notes to the atmosphere-vault Obsidian knowledge base. Use this skill whenever creating or updating an ADR, runbook, plan, API doc, guide, session output, or any structured document that should land in the vault — even when the user doesn't say "Obsidian" explicitly. Delegates to…

Atmosphere/atmosphere · 93 tokens

llm-judge

AI quality judge that scores agent responses 0-10 across helpfulness, accuracy, completeness, and clarity. Use when evaluating multi-agent output or implementing LLM-as-judge quality gates.

Atmosphere/atmosphere · 43 tokens

rocketmq-rust-issue-generator

Use when the user asks to create, draft, prepare, or publish a GitHub issue for the rocketmq-rust project — bugs, features, enhancements, refactors, docs, unit tests, CI, runtime-model, broker, namesrv, client, store, dashboard, architecture, or performance work — especially when the issue must preserve real…

mxsm/rocketmq-rust · 102 tokens

rocketmq-rust-pr-submitter

Use when the user asks to prepare, submit, publish, or optimize a pull request for the rocketmq-rust project, especially when the PR title or commit message must follow the [ISSUE.

mxsm/rocketmq-rust · 47 tokens

rust-doc-comment-generator

Generate idiomatic, production-grade Rust comments and documentation strictly following official Rustdoc and Rust API documentation conventions. Designed for real-world Rust projects with zero AI-identifiable markers.

mxsm/rocketmq-rust · 39 tokens