# create-component > Scaffold a new OFBiz component (plugin) using Gradle. Use when starting a new feature set or isolating custom code. - Author: toaditi - Repository: toaditi/ofbiz-dev-agent-skills - Version: 20260124175846 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/toaditi/ofbiz-dev-agent-skills - Web: https://mule.run/skillshub/@@toaditi/ofbiz-dev-agent-skills~create-component:20260124175846 --- --- name: create-component description: Scaffold a new OFBiz component (plugin) using Gradle. Use when starting a new feature set or isolating custom code. --- # Skill: create-component ## Goal Scaffold a new OFBiz component (plugin) using Gradle. ## Triggers **ALWAYS** read this skill when: - User asks to create a new plugin or component. - Creating a new isolate feature set. ## Use when - Starting a brand new feature set requiring its own directory. - Isolating custom code from framework. ## Don't use when - Adding a feature to an existing component (use `manage-services`/`manage-entities`). - Modifying core framework components. ## Inputs required: - pluginId: string (kebab-case) optional: - webappName: string - basePermission: string ## Outputs - Directory `plugins/[pluginId]` with standard OFBiz structure. - `ofbiz-component.xml`, `build.gradle`, base folders (`entitydef`, `servicedef`, `data`, `webapp`, `widget`). ## Procedure 1. Navigate to OFBiz root directory. 2. Run: `./gradlew createPlugin -PpluginId=` 3. Add optional flags if needed: `-PwebappName=...`, `-PbasePermission=...` 4. Verify `plugins/` directory exists with expected structure. 5. Register component: `./gradlew loadAll` 6. Verify component loaded in Webtools → Components. ## Guardrails - **Naming**: Use lowercase, numbers, hyphens only. No leading/trailing hyphens. Max 64 chars. - **Location**: Never create components outside `plugins/` manually. - **Registration**: Always run `loadAll` after creation to register the component. - If component already exists, Gradle will fail. Delete or rename first. ## Failure handling - **Build fails**: Check pluginId naming (no spaces, uppercase, or special chars). - **Component not found**: Ensure running from OFBiz root, not a subdirectory. - **Component not loading**: Verify `ofbiz-component.xml` is present and valid. ## Minimal example Input: 'inventory-cycle-count' Output: ```bash ./gradlew createPlugin -PpluginId=inventory-cycle-count ./gradlew loadAll ``` Result: `plugins/inventory-cycle-count/` with base structure ready for entities, services, data.