← 返回 Skills 市场
huhua1990

Easycode Skill

作者 huhua1990 · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ⚠ suspicious
335
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (SKILL.md)

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_package to project output paths

Inputs and Contract

  1. Normalize the request to generate_java_code schema in references/function-schema.json.
  2. Require explicit table names.
  3. Fill missing fields from local state when available.
  4. If critical DB fields are still missing, ask only for missing items.
  5. When available, pass generation_config.table_columns for full field-level rendering parity.
  6. If table_columns is absent, script attempts JDBC metadata fetch from db_connection.

Workflow

  1. Parse user intent.
  2. Load recent state from .easycode-skill/state.json by running:
    • python3 scripts/easycode_skill.py state --show
  3. Merge request + state + defaults:
    • default template_group is Custom-V3.
    • default output root is src/main/java.
  4. Validate template group against references/template-groups.md.
  5. Preview output plan:
    • python3 scripts/easycode_skill.py plan --spec '\x3Cjson>'
  6. Execute generation:
    • python3 scripts/easycode_skill.py execute --spec '\x3Cjson>'
    • add --overwrite only when user confirms replacement
    • add --run-project-format to run formatter after generation
  7. Persist successful config:
    • python3 scripts/easycode_skill.py state --save --spec '\x3Cjson>'
  8. Helper commands:
    • python3 scripts/easycode_skill.py check-driver --db-type mysql
    • python3 scripts/easycode_skill.py spec-template --db-type mysql --tables user,order
    • python3 scripts/easycode_skill.py interactive (首次 1~9 步引导,后续仅输入表名)

Generation Rules

  • Path mapping:
    • Convert base_package (for example com.app.admin) to src/main/java/com/app/admin.
    • Append template-level relative package (for example entity, mapper, service, controller).
  • 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.
  • Safety:
    • Always show a pre-write file list.
    • If file exists, mark as overwrite_candidate and ask for confirmation before replacing.

Current Renderer Status

  • The script uses a Java Velocity bridge to render template code with EasyCode global macros (init/define/autoImport/mybatisSupport).
  • execute writes rendered output (not scaffold), and plan can include rendered content with --include-content.
  • If table_columns is missing, script auto-fetches metadata through JDBC.
  • When no JDBC driver is found locally, pass db_connection.driver_jar (and optional db_connection.driver_class) or provide table_columns.
  • Default JDBC type preferences:
    • Number -> Long
    • Time/Date/Timestamp -> Date
    • Override via generation_config.type_mapping when needed.
    • Optional interactive prompt: add --interactive-type-mapping to plan/execute when type_mapping is not specified.
  • Optional project formatter:
    • set generation_config.project_format_command to custom command(s), or
    • use --run-project-format and let script auto-detect gradlew/mvnw format tasks.

Memory Policy

Persist these keys after successful run:

  • db_type, url, user
  • author, base_package, template_group
  • optional project_root, output_root
  • interactive mode also persists pass, driver_jar, driver_class, type_mapping, project_format_command for 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
安全使用建议
This skill generally does what it says (generate Java from DB tables) and includes the necessary template/config files and Java/Python bridges. Before installing: 1) Be prepared that the skill requires Java toolchain (javac/java) and local Java/Velocity dependencies in your ~/.m2 or Gradle cache even though the registry metadata lists no required binaries. 2) Do NOT supply production DB credentials unless you trust the code — the tool accepts db_connection.pass and the packaged Python saves state into .easycode-skill/state.json with no obvious encryption; the SKILL.md's guidance not to store plaintext passwords contradicts the implementation. 3) Consider using a read-only or throwaway DB account, or provide pre-fetched table_columns instead of live DB passwords. 4) Inspect .easycode-skill/state.json after a run and delete any stored secrets; run the tool in a sandboxed environment or container if possible. 5) Review where generated files will be written (project_root/output_root) to avoid accidental overwrites; the tool asks for confirmation on overwrite but always double-check. If you need assurance the skill won't persist secrets, request changes or a code update that redacts or encrypts sensitive fields before saving state.
功能分析
Type: OpenClaw Skill Name: easycode-skill Version: 1.0.3 The skill bundle provides Java code generation from databases but exhibits high-risk behaviors. Specifically, 'scripts/easycode_skill.py' stores database credentials (including passwords) in plaintext within a local '.easycode-skill/state.json' file and allows for arbitrary command execution through the 'project_format_command' field in the '_run_project_formatter' function. While these features support the stated purpose of code generation and formatting, the lack of credential encryption and the direct execution of user-supplied strings represent significant security vulnerabilities. No evidence of intentional data exfiltration or malicious backdoors was found.
能力评估
Purpose & Capability
Name/description (EasyCode-style Java generation) align with included artifacts: template configs, Velocity/Java bridge, JDBC metadata bridge, and a Python orchestration script. The ability to fetch JDBC metadata, map packages to src paths, and render templates is coherent with the stated purpose.
Instruction Scope
Runtime instructions instruct the agent to read/write a local state file (.easycode-skill/state.json), compile/run Java bridge code, search local Maven/Gradle caches and drivers, and write generated files into the user's project. These actions are expected for the use case but the SKILL.md claims not to store plaintext passwords while the workflow includes persisting db_connection state (potentially including pass). The instructions also reference running commands that require system Java/tooling but the skill metadata declared no required binaries.
Install Mechanism
No remote install or downloads; all code is packaged with the skill. The Python script compiles local Java sources using the host's javac/java and reads local caches (~/.m2, ~/.gradle). No network fetches or archive extractions were found. This is lower risk than remote installers, though it does require host toolchain presence.
Credentials
No environment variables or external credentials were declared, but the JSON schema and runtime require database credentials (db_connection.*, including pass). The skill will read user home paths (Maven/Gradle cache) and can accept driver_jar or driver_class. The main concern: SKILL.md asserts 'Do not store plaintext password' but also documents persisting 'pass' in interactive mode; the implementation writes state.json without any obvious encryption/redaction. Requesting DB credentials is reasonable for the task, but persisting them plaintext would be disproportionate risk.
Persistence & Privilege
always:false and no cross-skill/system-wide config changes were found. The skill persists its own state in .easycode-skill/state.json and writes generated files into the project (project_root/output_root). Persisting the state and writing project files is normal for this functionality, but users should be aware of files written and the state file contents (may contain credentials).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install easycode-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /easycode-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
easycode-skill 1.0.3 - No user-facing changes in workflow or functionality. - Internal update: documentation (SKILL.md) modified—no changes to execution, inputs, or script behavior.
v1.0.2
easycode-skill v1.0.2 - Added support for `python3 scripts/easycode_skill.py interactive`, enabling step-by-step guided setup on first use. - Updated SKILL.md: expanded workflow and memory policy to reflect interactive mode, which now persists additional values (password, driver, type mapping, format command) for easier repeated use. - Minor clarifications and additional helper commands in SKILL.md documentation.
v1.0.1
- Added versioned EasyCode config files and a drivers-paths.json for improved template and driver management. - Updated JDBC driver discovery to prefer lookup via drivers/drivers-paths.json and support local drivers/<db>/ directories. - Clarified template group file locations in the documentation to point to configs/* instead of project root. - Added guidance for type mapping, specifying default Java type choices and supporting interactive type overrides. - Improved SKILL.md instructions to clarify JDBC driver handling and fallback, config references, and type-mapping options.
v1.0.0
EasyCode Skill 1.0.0 – Initial Release - Provides deterministic Java code generation from database tables via EasyCode-style templates. - Supports parsing and reusing DB config, generation settings, and handles output path mapping from base package. - Offers preview/plan, execution, and state persistence with safe overwrite confirmation. - Integrates JDBC metadata fetch when table columns are absent. - Responds with detailed status on template group, output paths, file changes, and next steps.
元数据
Slug easycode-skill
版本 1.0.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

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。

💬 留言讨论