Core rules, mapping table, pitfalls, recipes index, execution workflow, and error handling standards are all in
SKILL.md. This file covers only conventions and tooling guidance not present inSKILL.md. Do not duplicate content.
Language: TypeScript · Runtime: EasyEDA Pro browser sandbox (not Node.js)
| Search Target | Correct Pattern | Incorrect Pattern |
|---|---|---|
| Class/Interface name | SCH_PrimitiveComponent |
class SCH_PrimitiveComponent |
| Method name | getCurrentDocumentInfo |
function getCurrentDocumentInfo |
| Enum name | EDMT_EditorDocumentType |
enum EDMT_EditorDocumentType |
| eda property | dmt_SelectControl |
eda.dmt_SelectControl |
When you already know the class name, prefer reading the doc file directly (e.g., resources/references/classes/DMT_SelectControl.md) over broad grepSearch.
When an API query result contains any of the following, continue querying recursively:
- Returns
Promise<IPCB_*>orPromise<ISCH_*>→ Read the corresponding interface doc inreferences/interfaces/ - Parameter contains a complex interface → Read its interface doc for property structure
- Interface has inheritance → Read both parent and child docs
- Return value is a union type → Read each member's doc
- Enum type parameter → Read the enum doc in
references/enums/for all possible values
Core rules (try/catch, browser API restrictions, logging standards, defensive checks) are in
SKILL.md. Below are additional conventions only:
- npm dependencies can be imported as needed; update
package.jsonaccordingly - Define a
PLUGIN_TAGconstant at the top of each file for consistent log prefixes - Prefer
async/awaitover.then()chains - All generated code must be valid TypeScript; avoid
anyunless unavoidable
├── src/ Main plugin code (src/index.ts entry point)
├── iframe/ Frontend code for custom UI panels
├── locales/ i18n files (en.json + zh-Hans.json)
│ └── extensionJson/ Menu title translations (en.json + zh-Hans.json)
├── images/ Extension preview images
├── build/ Build output directory
├── extension.json Plugin metadata and menu configuration
├── package.json NPM configuration
├── eslint.config.mjs ESLint configuration
└── tsconfig.json TypeScript compilation configuration
Menu titles in extension.json are not translated via locales/en.json. They use a separate directory: locales/extensionJson/.
locales/en.json+locales/zh-Hans.json— for code-leveleda.sys_I18n.text()translationslocales/extensionJson/en.json+locales/extensionJson/zh-Hans.json— forextension.jsonheaderMenus[].titletranslations
The title value in extension.json is used as the lookup key in locales/extensionJson/:
// extension.json
{ "id": "About", "title": "About...", "registerFn": "about" }// locales/extensionJson/en.json
{ "About...": "About..." }
// locales/extensionJson/zh-Hans.json
{ "About...": "关于..." }
⚠️ Do not use%key%syntax inextension.jsonmenu titles. The title text itself is the key, matched directly againstlocales/extensionJson/files.
npm dependencies can be used inside iframe/ code. The iframe runs in a standard browser context, so bundled npm packages (e.g., chart libraries, UI frameworks, utility libraries) work normally.
- Install via
npm install <package>and import in iframe source files - The build process bundles iframe dependencies into the output
- Update
package.jsonaccordingly when adding new dependencies - This does not apply to
src/main process code, which runs in the EDA sandbox
Use npm run build as the required validation step for generated plugin projects.
Requires the eext-dev-mcp MCP service:
- Build:
npm run build(output inbuild/dist/*.eext) listDirectoryto find the.eextabsolute path- MCP
dev_pluginto import - MCP
get_console_logsto retrieve logs - Fix and repeat
Without MCP: manually upload the .eext file via the EDA Extension Manager.
resources/guide/andresources/references/— API documentation sourceSKILL.mdfront matter — Skill metadata