← Back to Skills Marketplace
huhua1990

Easycode Skill

by huhua1990 · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ⚠ suspicious
335
Downloads
0
Stars
0
Active Installs
4
Versions
Install in OpenClaw
/install easycode-skill
Description
Use when users ask to generate Java code from database tables with EasyCode-style templates, including parsing db config, remembering last-used generation se...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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).
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install easycode-skill
  3. After installation, invoke the skill by name or use /easycode-skill
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug easycode-skill
Version 1.0.3
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 4
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 335 downloads so far.

How do I install Easycode Skill?

Run "/install easycode-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Easycode Skill free?

Yes, Easycode Skill is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Easycode Skill support?

Easycode Skill is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Easycode Skill?

It is built and maintained by huhua1990 (@huhua1990); the current version is v1.0.3.

💬 Comments