diff --git a/ofbiz-framework/bestpractices/skills-md-prompt.md b/ofbiz-framework/bestpractices/skills-md-prompt.md new file mode 100644 index 00000000..fd601699 --- /dev/null +++ b/ofbiz-framework/bestpractices/skills-md-prompt.md @@ -0,0 +1,262 @@ +# SKILLS.md for Apache OFBiz Framework + +This document outlines best practices and patterns for developing services in the Apache OFBiz framework. It focuses on day-to-day development choices to ensure maintainable, performant, secure, and consistent code. Practices are derived from official documentation, community resources, and patterns in core components. + +## Prompt(copy/paste) +```markdown +You are an AI coding assistant. Create `ofbiz/SKILLS.md` with Apache OFBiz service best practices and patterns. Use ASCII text. The file must be concise, structured with headings (#, ##, ###), and focused on day-to-day development choices for maintainable, performant, secure, and consistent code. + +Required inputs and references: +- Component dependencies: each component's ofbiz-component.xml +- Scan the Order, Accounting, and Party component services (and related core components) to infer additional skills and concrete examples (e.g., order creation flows, invoice services, party/contact patterns, use of entity-auto, ECAs for status changes, scheduled jobs). + +Use the MiniLang XML actions tags list provided below (include a dedicated section in SKILLS.md with grouped categories and common tags). + +Mandatory content to include: +1. Allowed vocabulary for service names: Use consistent verbs from codebase (create, update, delete, find, get, calculate, process, approve, cancel, etc.); avoid new verbs. Use domain nouns from entities in CamelCase. Format: verbEntityName (e.g., createOrder, updateInvoice); fully qualified when needed (e.g., order.createOrder). Emphasize unique names to prevent conflicts. +2. Debug log instructions: Use structured formats like [Entity] [Context] - [Action/Outcome/Issue] with allowed phrases (not found, missing required field, invalid field, not allowed, already in state, not eligible, missing data, external call failed, no data, partial result, skipped, operation succeeded). Use Debug.logInfo/Debug.logError from org.apache.ofbiz.base.util.Debug; log levels convey severity; always include primary keys/identifiers and state. +3. Component dependency rules: Service calls must only reference services/entities from components declared in ofbiz-component.xml via ; add dependencies explicitly before cross-component calls; core engines are implicit. +4. Prefer MiniLang/XML (engine="simple") over Java/Groovy for simple services; use Java/Groovy (engine="java" or "groovy") only for complex/performance-critical logic; allow