[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ACNFN7BGMG7QMCN97V40BH":3,"skill-same:01M6ACNFN7BGMG7QMCN97V40BH":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":40,"ownerHtmlUrl":41,"ownerBlogUrl":42,"ownerDescription":7,"updatedAt":43,"install":44,"resources":57},"01M6ACNFN7BGMG7QMCN97V40BH","manage-data","数据管理",null,"","apache\u002Fofbiz-plugins","apache","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47359?v=4","01M6AC83E6K4FDKK7HZ8WNMQKE","The Apache Software Foundation","01M6ACMJJ1Q4WYATY4GXZ2FAVD",178,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-data\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BTGTEHKD89NSZ5CT4Y5AGV","数据工程师","PROFESSION","适用职业",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BWWFZDF3GR3XDG2G0W3XCJ","数据治理与目录管理","SCENARIO","使用场景",[30],"manage data","2026-11-10 10:12:30",false,"\u003C!--\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements.  See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership.  The ASF licenses this file\nto you under the Apache License, Version 2.0 (the\n\"License\"); you may not use this file except in compliance\nwith the License.  You may obtain a copy of the License at\n\nhttp:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the License is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied.  See the License for the\nspecific language governing permissions and limitations\nunder the License.\n-->\n\n---\nname: manage-data\ndescription: Create and manage OFBiz data files (Entity Engine XML).\n---\n\n# Skill: manage-data\n## Goal\nCreate and manage OFBiz data files (Entity Engine XML) to populate the database with valid seed, demo, or configuration data. This includes adding mandatory setup records, common type definitions (Seed\u002FSeed-Initial), and optional transactional records for development environments (Demo). \n\n> [!TIP]\n> Use this skill in conjunction with [manage-entities](..\u002Fmanage-entities\u002FSKILL.md) and [manage-component](..\u002Fmanage-component\u002FSKILL.md).\n\n## Triggers\n**ALWAYS** read this skill when:\n- Creating or updating XML files intended for data loading.\n- Troubleshooting data-related startup errors or foreign key violations.\n- Configuring entity data resources in `ofbiz-component.xml`.\n\n## Rules & Procedures\n\n### 1. File Structure & Validation\n- **Encoding**: ALWAYS use `UTF-8` encoding.\n- **Granularity**: Prefer small, logically focused data files (e.g., `ProductPriceData.xml`) over monolithic files for better maintainability.\n- **Header**: ALWAYS include the correct XSI schema for IDE validation and framework parsing.\n```xml\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003Centity-engine-xml xmlns:xsi=\"http:\u002F\u002Fwww.w3.org\u002F2001\u002FXMLSchema-instance\"\n    xsi:noNamespaceSchemaLocation=\"http:\u002F\u002Fofbiz.apache.org\u002Fdtds\u002Fentity-engine-xml.xsd\">\n    \u003C!-- Entries -->\n\u003C\u002Fentity-engine-xml>\n```\n\n### 2. Data Readers & Loading Order\nData files **must** be registered in `ofbiz-component.xml` using `\u003Centity-resource type=\"data\" ...\u002F>`.\n| Reader | Technical Purpose | Content Type |\n| :--- | :--- | :--- |\n| `seed` | Mandatory configuration | Enums, StatusItems, UOMs, System Settings. |\n| `seed-initial` | Loading during first install | Baseline setup, administrative users. |\n| `ext` | External\u002FCustom seed | Plugin-specific configuration data. |\n| `demo` | Development\u002FTesting | Orders, Invoices, Shipments, Sample Products. |\n\n**Loading Order**: Ensure foreign keys are satisfied. If `Product` refers to `ProductType`, the `ProductType` data must be loaded first (or be in the same file earlier). Standard reader sequence: `seed` -> `seed-initial` -> `ext` -> `demo`.\n\n### 3. Record Definition Patterns\n- **Upsert Behavior**: Data loading is an \"upsert\" (create-or-store). Re-loading a file updates existing records based on Primary Keys.\n- **Null Handling**: Omitted attributes are treated as `null`. Attributes with empty quotes (e.g., `attr=\"\"`) are treated as **Empty Strings**.\n- **Entity Grouping**: Group related entities using XML comments as headers (e.g., `\u003C!-- Products -->`) for readability in large files.\n\n## Guardrails\n- **Security**: **NEVER** include sensitive data (PII, actual passwords, PCI data) in seed or demo files. Use standard \"ofbiz\" hashes for demo users.\n- **Entity Verification**: **NEVER** invent entity names. Always verify the entity exists in `entitymodel.xml` before creating data.\n- **Unique Primary Keys**: Ensure all records have unique primary keys. For Seed\u002FExt data, use descriptive string IDs if possible.\n- **Ordering**: Define parent entities BEFORE child entities to avoid foreign key violations. Referenced records (e.g., `statusId`) must exist in the same file or earlier seed files.\n- **Composite Primary Keys**: Always populate **ALL** primary key fields defined in the model (e.g., `ProductPrice` requires `productId`, `productPriceTypeId`, etc.).\n- **Temporal Patterns**: For entities using `fromDate`\u002F`thruDate`, ensure `fromDate` is populated (often part of PK) and date ranges do not overlap for the same logical record.\n- **Dates**: Use ISO timestamp: `YYYY-MM-DD HH:MM:SS` (milliseconds are optional and typically not required).\n- **ID Generation**: Prefer descriptive\u002Freadable IDs for seed\u002Fdemo data (e.g., `DEMO_STORE`, `PROD_100`) instead of arbitrary numeric sequences.\n- **CDATA**: Wrap text containing XML special characters (e.g., descriptions with HTML) in `\u003C![CDATA[ ... ]]>`.\n- **Determinism**: Seed data must be **deterministic and environment independent**. Do not rely on environment-specific system variables.\n\n## Bad Practices & Anti-patterns\n\n### Anti-pattern: FK Ordering Trap\n**Pitfall**: Defining a child record (like `OrderItem`) before its parent (`OrderHeader`). This triggers immediate loading failures.\n- **❌ Bad**: `OrderItem` followed by `OrderHeader`.\n- **✅ Good**: Parent first, then children. Use `dependent-on` in the entity model and ensure referenced records (e.g., `statusId`) exist in the same XML file or in earlier reader files (e.g., `seed` before `demo`).\n\n### Anti-pattern: Reader Misuse\n**Pitfall**: Putting transactional demo data (like Orders) into a `seed` file. This forces bloat into production environments.\n- **❌ Bad**: Placing `\u003COrderHeader ...\u002F>` in a file registered as `reader-name=\"seed\"`.\n- **✅ Good**: Use `reader-name=\"demo\"` for transactional samples.\n\n### Anti-pattern: Timestamp Fragility\n**Pitfall**: Using non-standard or localized date formats that fail on different server locales.\n- **❌ Bad**: `Jan 1 2023 10:00 AM`\n- **✅ Good**: `2023-01-01 10:00:00`\n\n---\n\n## Common Code Patterns (Examples)\n\n**Example: Comprehensive Seed Data (Types, Products, Relationships)**\n```xml\n\u003Centity-engine-xml xmlns:xsi=\"http:\u002F\u002Fwww.w3.org\u002F2001\u002FXMLSchema-instance\"\n    xsi:noNamespaceSchemaLocation=\"http:\u002F\u002Fofbiz.apache.org\u002Fdtds\u002Fentity-engine-xml.xsd\">\n\n    \u003C!-- Product Metadata -->\n    \u003CProductType productTypeId=\"FINISHED_GOOD\" isPhysical=\"Y\" isDigital=\"N\" description=\"Finished Good\"\u002F>\n\n    \u003C!-- Core Product Data -->\n    \u003CProduct productId=\"PROD_MASTER\" productTypeId=\"FINISHED_GOOD\" internalName=\"Master Product\"\n        description=\"A standard physical product sample.\" createdDate=\"2023-01-01 00:00:00\"\u002F>\n\n    \u003C!-- Temporal Relationship (Price) -->\n    \u003CProductPrice productId=\"PROD_MASTER\" productPriceTypeId=\"DEFAULT_PRICE\"\n        productPricePurposeId=\"PURCHASE\" currencyUomId=\"USD\" productStoreGroupId=\"_NA_\"\n        price=\"19.99\" fromDate=\"2023-01-01 00:00:00\"\u002F>\n\n    \u003C!-- Batch Job Scheduling -->\n    \u003CRecurrenceInfo recurrenceInfoId=\"BATCH_DAILY\" startDateTime=\"2023-01-01 00:00:00\" recurrenceInfoTypeId=\"DAILY\"\u002F>\n    \u003C!-- Note: runtimeDataId omitted (null) as per best practice -->\n    \u003CJobSandbox jobId=\"BATCH_DAILY_JOB\" jobName=\"Daily Sync\" serviceName=\"syncExternalData\"\n        poolId=\"pool\" runTime=\"2023-01-01 00:00:00\" recurrenceInfoId=\"BATCH_DAILY\" statusId=\"SERVICE_PENDING\"\u002F>\n\u003C\u002Fentity-engine-xml>\n```\n",{},"trunk","6c6c27710443de03e9247605d33a2e2f5bc3d1e2","ai-agent-skills\u002Fmanage-data",222,"https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins","https:\u002F\u002Fofbiz.apache.org\u002F","https:\u002F\u002Fgithub.com\u002Fapache","https:\u002F\u002Fwww.apache.org\u002F","2026-11-12 22:04:06",{"source":9,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add apache\u002Fofbiz-plugins --skill manage-data",{"tool":50,"command":51},"bunx","bunx skills add apache\u002Fofbiz-plugins --skill manage-data",{"tool":53,"command":54},"pnpm","pnpm dlx skills add apache\u002Fofbiz-plugins --skill manage-data","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-data\u002FSKILL.md",true,[],[59,73,85,99,113,127],{"skillNo":60,"name":61,"nameZh":62,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":63,"categories":64,"keywords":71,"publishedAt":31},"01M6ACQSN90YKJZ92MQ52D9R8H","prepush-readiness","推送前就绪检查","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fprepush-readiness\u002FSKILL.md",[65,68],{"categoryNo":66,"categoryName":67,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":69,"categoryName":70,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理",[72],"prepush readiness",{"skillNo":74,"name":75,"nameZh":76,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":77,"categories":78,"keywords":83,"publishedAt":31},"01M6ACQPR1WRA751V4DXVC3AHF","manage-webapps","Web 应用管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-webapps\u002FSKILL.md",[79,80],{"categoryNo":66,"categoryName":67,"taxonomyType":22,"taxonomyTypeDesc":23},{"categoryNo":81,"categoryName":82,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BWKS60NTYJHFE9FQSXGDKS","低代码应用开发",[84],"manage webapps",{"skillNo":86,"name":87,"nameZh":88,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":89,"categories":90,"keywords":97,"publishedAt":31},"01M6ACQMCX8Z7NY2CE08NCV6ND","manage-themes","主题管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-themes\u002FSKILL.md",[91,94],{"categoryNo":92,"categoryName":93,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TQMKHSMFVQHR2KYAEVN","界面设计师",{"categoryNo":95,"categoryName":96,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现",[98],"manage themes",{"skillNo":100,"name":101,"nameZh":102,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":103,"categories":104,"keywords":111,"publishedAt":31},"01M6ACQHYN20AFWF6TKK4RGQ8A","manage-tests","测试管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-tests\u002FSKILL.md",[105,108],{"categoryNo":106,"categoryName":107,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":109,"categoryName":110,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[112],"manage tests",{"skillNo":114,"name":115,"nameZh":116,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":117,"categories":118,"keywords":125,"publishedAt":31},"01M6ACQFRMW7R45YD3HRAXPGWF","manage-templates","模板管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-templates\u002FSKILL.md",[119,122],{"categoryNo":120,"categoryName":121,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQ6TK1MPB82068236GSXDE","文档处理",{"categoryNo":123,"categoryName":124,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TPH3VQWKQZXV7EPF8VZ","办公行政人员",[126],"manage templates",{"skillNo":128,"name":129,"nameZh":130,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":131,"categories":132,"keywords":139,"publishedAt":31},"01M6ACQCSSDZQMD8VX2K3WRR93","manage-strategies","策略管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-strategies\u002FSKILL.md",[133,136],{"categoryNo":134,"categoryName":135,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BTXF8K9DFQC4T4TXVH0NMZ","策略与托管设置管理",{"categoryNo":137,"categoryName":138,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8C6RQ852C9AEJFCBGG1YA7S","IT 管理员",[140],"manage strategies"]