/install easycode-skill
EasyCode Skill
Purpose
This skill turns natural-language requests into deterministic EasyCode-style generation inputs and execution steps.
Use this skill when users ask for:
- Generating Java code from one or more DB tables
- MyBatisPlus or custom template-group generation
- Reusing previous DB/package/author/template settings
- Auto-mapping
base_packageto project output paths
Inputs and Contract
- Normalize the request to
generate_java_codeschema in references/function-schema.json. - Require explicit table names.
- Fill missing fields from local state when available.
- If critical DB fields are still missing, ask only for missing items.
- When available, pass
generation_config.table_columnsfor full field-level rendering parity. - If
table_columnsis absent, script attempts JDBC metadata fetch fromdb_connection.
Workflow
- Parse user intent.
- Load recent state from
.easycode-skill/state.jsonby running:python3 scripts/easycode_skill.py state --show
- Merge request + state + defaults:
- default
template_groupisCustom-V3. - default output root is
src/main/java.
- default
- Validate template group against references/template-groups.md.
- Preview output plan:
python3 scripts/easycode_skill.py plan --spec '\x3Cjson>'
- Execute generation:
python3 scripts/easycode_skill.py execute --spec '\x3Cjson>'- add
--overwriteonly when user confirms replacement - add
--run-project-formatto run formatter after generation
- Persist successful config:
python3 scripts/easycode_skill.py state --save --spec '\x3Cjson>'
- Helper commands:
python3 scripts/easycode_skill.py check-driver --db-type mysqlpython3 scripts/easycode_skill.py spec-template --db-type mysql --tables user,orderpython3 scripts/easycode_skill.py interactive(首次 1~9 步引导,后续仅输入表名)
Generation Rules
- Path mapping:
- Convert
base_package(for examplecom.app.admin) tosrc/main/java/com/app/admin. - Append template-level relative package (for example
entity,mapper,service,controller).
- Convert
- Template groups:
MyBatisPlus->configs/EasyCodeConfig-mybatispuls.json(fallback project root file)Custom-V2->configs/EasyCodeConfig-V2.json(fallback project root file)Custom-V3->configs/EasyCodeConfig-V3.json(fallback project root file)
- JDBC drivers:
- Preferred lookup is
drivers/drivers-paths.json. - Skill-local jars under
drivers/\x3Cdb>/are supported. - If still missing, pass
db_connection.driver_jar.
- Preferred lookup is
- Safety:
- Always show a pre-write file list.
- If file exists, mark as
overwrite_candidateand ask for confirmation before replacing.
Current Renderer Status
- The script uses a Java Velocity bridge to render template
codewith EasyCode global macros (init/define/autoImport/mybatisSupport). executewrites rendered output (not scaffold), andplancan include rendered content with--include-content.- If
table_columnsis missing, script auto-fetches metadata through JDBC. - When no JDBC driver is found locally, pass
db_connection.driver_jar(and optionaldb_connection.driver_class) or providetable_columns. - Default JDBC type preferences:
- Number ->
Long - Time/Date/Timestamp ->
Date - Override via
generation_config.type_mappingwhen needed. - Optional interactive prompt: add
--interactive-type-mappingtoplan/executewhentype_mappingis not specified.
- Number ->
- Optional project formatter:
- set
generation_config.project_format_commandto custom command(s), or - use
--run-project-formatand let script auto-detectgradlew/mvnwformat tasks.
- set
Memory Policy
Persist these keys after successful run:
db_type,url,userauthor,base_package,template_group- optional
project_root,output_root - interactive mode also persists
pass,driver_jar,driver_class,type_mapping,project_format_commandfor next-run defaults.
Do not store plaintext password in state. If password must be cached, store encrypted value from host secret manager.
Execution Guidance
- Prefer deterministic script calls for plan/state actions.
- For actual rendering, use the project’s EasyCode engine implementation when available.
- If engine invocation is unavailable, still provide a complete plan and clearly report blocked execution step.
Response Style
When reporting execution:
- Show resolved template group
- Show resolved base output directory
- Show generated/updated file count
- Show blocked items (if any) and exact next action
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install easycode-skill - 安装完成后,直接呼叫该 Skill 的名称或使用
/easycode-skill触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Easycode Skill 是什么?
Use when users ask to generate Java code from database tables with EasyCode-style templates, including parsing db config, remembering last-used generation se... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 335 次。
如何安装 Easycode Skill?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install easycode-skill」即可一键安装,无需额外配置。
Easycode Skill 是免费的吗?
是的,Easycode Skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Easycode Skill 支持哪些平台?
Easycode Skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Easycode Skill?
由 huhua1990(@huhua1990)开发并维护,当前版本 v1.0.3。