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.
npx agentmods add skills/zhaoxingpeng/dbjavagenix/java-codegen-from-dbnpx skills add ZhaoXingPeng/DBJavaGenix --skill java-codegen-from-dbgit clone --depth 1 https://github.com/ZhaoXingPeng/DBJavaGenixWrote 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.
[](https://agentmods.dev/skills/zhaoxingpeng/dbjavagenix/java-codegen-from-db)<a href="https://agentmods.dev/skills/zhaoxingpeng/dbjavagenix/java-codegen-from-db"><img src="https://agentmods.dev/badge/skills/zhaoxingpeng/dbjavagenix/java-codegen-from-db.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00082 | $0.02728 |
| Opus 5 | $0.00041 | $0.01364 |
| Sonnet 5 | $0.00016 | $0.00546 |
| Haiku 4.5 | $0.00008 | $0.00273 |
Grade A, and why
java-codegen-from-db 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 6d 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.
How it starts
The opening of the file, as written. The whole thing — 257 lines — stays where its author put it; the contents beside it link to each section on GitHub.
java-codegen-from-db
工作流总览
本 skill 把"从数据库表生成 Java 代码"拆为 5 个显式阶段,每个阶段调用具体的 MCP 工具,关键决策点会暂停让用户确认。不允许跳步——前一步的输出是后一步的输入。
[1] 预检查项目 → [2] schema 分析 → [3] 语义增强(可选)
↓
[5] 写盘 ← [4] 分层渲染(等待用户确认)
阶段 1: 预检查项目(必做)
目的: 在生成代码前确认目标 Spring Boot 项目结构合法、依赖大致齐全。否则生成出来也编译不过。
1.1 验证项目结构
调用 springboot_validate_project:
- 参数:
{ "check_dependencies": true, "create_missing_dirs": true, "template_category": "<用户选定的分类>" } - 期待返回中包含
Project Structure: ✅ OK或✅ Project Root - 如果失败 → 告诉用户具体缺什么,不要继续
1.2 分析依赖健康度
调用 springboot_analyze_dependencies:
- 参数:
{ "template_category": "<同上>", "database_type": "mysql|postgresql|sqlite", "include_swagger": true, "include_lombok": true, "include_mapstruct": true } - 返回中提取
Missing Dependencies: N:- N == 0 → health = 100,继续
- N ≤ 2 → health = 80,继续但提醒用户
- N ≤ 5 → health = 60,暂停让用户决定是否继续
- N > 5 → health = 40,强烈建议先修依赖,问用户是否要看具体清单
1.3 渲染依赖健康仪表盘(MCP App)
如果客户端支持 MCP Apps(_meta 渲染),返回值中应附加:
{
"_meta": {
"mcp-apps/component": "dashboard",
"mcp-apps/data": { "score": <health>, ... }
}
}
现阶段如未支持,用文本表格代替。
阶段 2: schema 分析(必做)
目的: 拿到目标表的列、主键、外键、索引,这是模板渲染的输入。
2.1 建立或复用连接
如果用户尚未连接:
- 调用
db_connect_testwith{host, port, username, password, database, database_type} - 拿到
connection_id,记住它,后续所有调用都要带
2.2 列出表名(可选)
当用户没指明表,先列出来让用户选:
- 调用
db_query_tableswith{connection_id, database} - 把表名列给用户,等用户选
2.3 描述目标表
对每张目标表:
- 调用
db_table_describewith{connection_id, database, table, include_java_types: true} - 这一步会返回列定义 + 推断的 Java 类型
2.4 获取外键关系
- 调用
db_table_foreign_keyswith{connection_id, database, table} - 多张表时一起调,然后给用户渲染 ER 图(MCP App
mermaid组件)
2.5 渲染 ER 图(MCP App)
当用户选了 ≥ 2 张表,构造 Mermaid erDiagram 字符串,放进 _meta["mcp-apps/source"]。
阶段 3: 语义增强(推荐,Phase 4 工具可用后启用)
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.
- 6d ago First seen · 257 lines · 82 tokens per session scan A c113fccf1001
java-codegen-from-db is a skill published in the GitHub repository ZhaoXingPeng/DBJavaGenix (35 stars, last pushed 16d ago), licensed MIT. It adds 82 tokens to every session and 2,728 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.
Other skills, from other repositories
jpa-patterns
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
azure-data-tables-java
Build table storage applications with Azure Tables SDK for Java. Use when working with Azure Table Storage or Cosmos DB Table API for NoSQL key-value data, schemaless storage, or structured data at scale.
azure-cosmos-java
Azure Cosmos DB SDK for Java. NoSQL database operations with global distribution, multi-model support, and reactive patterns. Triggers: "CosmosClient java", "CosmosAsyncClient", "cosmos database java", "cosmosdb java", "document database java".
jpa-patterns
JPA/Hibernate patterns and common pitfalls (N+1, lazy loading, transactions, queries). Use when user has JPA performance issues, LazyInitializationException, or asks about entity relationships and fetching strategies.
solr-extending
To build Solr plugins: SearchComponent, QParser, URP, DocTransformer.
eclipse-debug
Debug Java applications in Eclipse — set breakpoints, launch in debug mode, step through code, inspect stack traces, evaluate expressions, and hot-swap code changes.