Skip to content
Back to skills

Code Generation

ASecurity

多语言业务代码生成的通用规范(分层、命名、异常、边界)。当需要生成 Java/Python/Go/Node/TS 等业务代码,确保代码可直接运行且符合工程规范时使用。

  • 666 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 8, 2026
ai-agentspythongojavasqlnode

Security analysis

A100/100

Scanned October 8, 2026

npx -y skills add majiayu000/claude-skill-registry --skill code-generation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Generation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Generation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-code-generation-claude-skill-registry/badge)](https://www.skillsdirectory.com/skills/majiayu000-code-generation-claude-skill-registry)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: 多语言代码生成Skill
description: 多语言业务代码生成的通用规范(分层、命名、异常、边界)。当需要生成 Java/Python/Go/Node/TS 等业务代码,确保代码可直接运行且符合工程规范时使用。
---
# 多语言代码生成Skill

## 适用场景
后端/前端 Sub-Agent 编写业务代码时使用,保证生成代码完整、可运行、规范统一。

## 执行步骤
1. 确认语言与框架及既有工程结构(优先复用现有分层与工具类)。
2. 按工程分层落代码:Controller/Service/DAO(Java)或 routes/services/models(Python/Node)。
3. 补齐:导入、依赖声明、配置项、启动方式。
4. 处理边界:参数校验、空值、异常路径、并发与事务(涉及时)。
5. 自查后交付:语法、运行、安全(无硬编码密钥)。

## 规范要点(全局 CLAUDE.md 强制项)
- 命名:变量/方法 camelCase、类 PascalCase、常量 UPPER_SNAKE_CASE、文件 kebab-case。
- 类/核心函数必须有文档注释(作用/入参/出参/异常);复杂逻辑加思路注释。
- 禁止魔法数字与魔法字符串,统一常量定义。
- 所有可能抛错的位置必须处理,禁止裸奔;禁止吞异常不处理。
- 安全:SQL 参数化、输入校验、输出编码、防越权(数据归属校验)。
- 完整可运行:不省略导入、依赖、基础结构。

## 输出模板
```
[完整代码文件]
## 使用说明(启动/调用方式)
## 关键逻辑说明
## 易错点提醒
```

## 自检清单
- [ ] 可直接编译/运行,依赖完整
- [ ] 分层与现有工程一致
- [ ] 边界/空值/异常已处理
- [ ] 无硬编码密钥
- [ ] 注释符合规范

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.