@dobot-plus/skill
v1.6.4
Published
Agent skill for Dobot+ plugin development
Readme
Dobot+ Agent Skill
@dobot-plus/skill is an Agent Skill that converts a device specification into runnable Dobot+ plugin code — Lua logic, UI pages, block/script configurations, and more. The specification comes from either a project-root Requirements.md or PDF manuals under user_manual/.
Use it together with @dobot-plus/cli to speed up Dobot+ plugin development.
Requirements
- Node.js v20+
- IDE (with Agent Skills support)
- @dobot-plus/cli (install globally for the
dptbuild command)
Installation
npm install -g @dobot-plus/skill@latestAfter installation, the skill is deployed automatically to:
~/agents/skills/dobot-plus/
├── SKILL.md # Main skill instructions
├── scripts/ # Code generation scripts
├── references/ # Schemas and authoring guidelines
├── package.json # Runtime dependency manifest
└── node_modules/ # Runtime dependencies (e.g. ajv)The default install location is ~/agents/skills/dobot-plus. You can customize it with environment variables:
| Variable | Description |
| --- | --- |
| DOBOT_SKILL_INSTALL_DIR | Root directory for skill installation; defaults to ~/agents/skills |
| SKIP_DOBOT_SKILL_INSTALL | Set to 1 to skip the postinstall deployment step |
Usage
1. Prepare a Dobot+ plugin project
Create or open an existing Dobot+ plugin project with @dobot-plus/cli:
npm install -g @dobot-plus/cli
dpt create2. Provide the device specification
Use exactly one of the following. The agent only looks under the plugin project root.
Option A — device manuals. Put PDF files in user_manual/ at the project root. /dobot-plus will generate Requirements.md from those PDFs using references/rules.md. If Requirements.md already exists, it will be overwritten.
Option B — write the spec yourself. Create Requirements.md in the project root and do not place any .pdf files in user_manual/. A leftover user_manual.md placeholder is fine. Required sections depend on the protocol; see references/rules.md:
- I/O: cabinet vs tool I/O, port table, level meanings
- TCP: IP, port, request/response format
- Modbus: baud/parity/stop bits,
slaveID, register map, bit fields
Do not copy references/Requirements.md into a new project. That file is a human sample for a different device.
3. Invoke the skill in IDE
In IDE Chat, run:
/dobot-plusThe agent follows SKILL.md automatically:
- Prepare
Requirements.mdfromuser_manual/PDFs, or read the existing file - Check the spec against
references/rules.mdfor the detected protocol - Parse atomic functions into
function.jsonand validate it - Run
scripts/generate.jsto produce Lua, HTTP, block/script, and UI scaffold - Implement Lua function bodies and update
ui/Main.tsx - Check that
dptis installed (dpt -v, Node.js 20+), then rundpt build
The packaged plugin is written to the project's output/ folder.
Directory structure
apps/skill/
├── SKILL.md # IDE skill instructions (deployed on install)
├── install.js # postinstall script for global npm installs
├── scripts/ # Code generation CLI scripts
│ ├── projectName.js # Read the project name
│ ├── findUserManual.js # Detect PDF manuals under user_manual/
│ ├── reset.js # Reset project generation state
│ ├── validate.js # Validate function.json
│ ├── generate.js # Run scaffold generators (http/script/blocks/lua/page/...)
│ ├── http.js # Generate HTTP-related files
│ ├── script.js # Generate script programming config
│ ├── blocks.js # Generate block programming config
│ ├── httpApi.js # Generate httpAPI.lua
│ ├── userApi.js # Generate userAPI.lua
│ ├── modbus.js # Generate Modbus communication module
│ ├── lua.js # Generate core Lua logic skeleton
│ ├── page.js # Generate UI page skeleton
│ ├── daemon.js # Generate daemon.lua
│ └── toolbar.js # Copy Main.tsx to Toolbar.tsx
└── references/ # Schemas and guidelines
├── rules.md # Requirements.md rules by protocol (I/O, TCP, Modbus)
├── function.schema.json # function.json data structure
├── blocks.schema.json # Block config schema
├── scripts.schema.json # Script config schema
├── lua.md # Lua authoring guidelines
├── page.md # UI page authoring guidelines
└── Requirements.md # Human sample only; not used as a generation specDevelopment
When developing locally inside the monorepo, install.js detects that it is not running from a node_modules path and skips the consumer install step.
To publish a new version:
npm run releaseTroubleshooting
Global install fails on Windows (EBUSY)
If npm install -g @dobot-plus/skill fails with EBUSY: resource busy or locked, an older postinstall script is likely conflicting with npm's global install lock. Upgrade to v1.2.1 or later and retry:
npm uninstall -g @dobot-plus/skill
Remove-Item -Recurse -Force "$env:USERPROFILE\agents\skills\dobot-plus" -ErrorAction SilentlyContinue
npm install -g @dobot-plus/skill@latestSkill not recognized by IDE
Verify that the skill is installed at ~/agents/skills/dobot-plus/SKILL.md and that Agent Skills are enabled in IDE settings.
Missing or incomplete Requirements.md
If user_manual/ contains PDFs, the skill generates Requirements.md from those files. Otherwise you must provide Requirements.md yourself.
If required protocol fields are missing, /dobot-plus aborts and lists what is missing. It will not invent registers, ports, or encodings, and it will not copy references/Requirements.md.
Related links
- @dobot-plus/cli — Dobot+ plugin development CLI
- @dobot-plus/template — Plugin project template
- Dobot+ documentation
