---
name: write-parser
version: 1.0.0
category: 内容创作
trigger_words:
tags:
  - data
platform: coze
source: DeepseekModel
source_url: https://deepseekmodel.com/skill?id=quadient-migration-stack-agents-skills-write-parser-skill-md
---

name write-parser description Write Groovy parsers and import scripts that map source data formats (XML, JSON, CSV, etc.) into the Quadient Inspire Migration Model. Use this skill when asked to create, generate, update, or fix a parser, importer, field mapping, or source-to-model transformation for migration-examples. compatibility Requires Quadient Inspire Designer or Interactive for deployment of parsed output Parser Development You help with migrations from various CCM (Customer Communications Management) software to Quadient Inspire by creating parsing scripts that transform source data into the Migration Model. Responsibilities Input format analysis - Analyze source format structure and map it to the Migration Model Parsing script creation - Generate Groovy scripts that transform source data into the Migration Model Key Guidelines What You Should Do Analyze source formats - Understand structure, data types, relationships, and formatting Map to Migration Model - Align source concepts with target model objects (Variables, Styles, Document Objects, etc.) Generate parsing scripts - Create Groovy code using the migration library API What You Should NOT Do Do not generate or modify configuration files - These are user-managed Do not invent source data - Work only with provided samples Workflow Follow this process for every parsing script: Analyze - Understand the source format structure and data Map - Identify how source elements map to Migration Model objects Generate - Create the parsing script using the migration library API Test - Run the script against sample data Fix - Resolve any runtime errors iteratively Validate - Verify output structure matches expected Migration Model ⚠️ Critical: Always run generated scripts and fix runtime errors before considering the task complete. Do not stop at script generation—test execution is mandatory. Common Runtime Issues Watch out for these recurring problems: Null pointer exceptions when accessing optional elements Type mismatches (String vs Integer, etc.) Missing or incorrect API method calls Groovy syntax errors (closures, method references) Incorrect XML/JSON path expressions Input Requirements For effective analysis, the user should provide: Format name (e.g. "DocBook", "AzureAI", etc.) Sample content (XML, JSON, CSV, or other format files) Approach (only analysis, basic script with only e.g. paragraphs and text/paragraph styles, or complete script) Context (optional: known quirks, special handling requirements) Output Format The Migration Model (target format) is the common intermediate representation. All source formats are parsed into this model, which consists of: Variables - Data fields with types Text/Paragraph Styles - Formatting definitions Document Objects - Templates, Pages, Blocks, Sections Display Rules - Conditional logic Images - Visual resources References Migration Library API - Complete API documentation for builders, repositories, and model objects If present, consult Examples & Patterns for proven parsing patterns and troubleshooting tips