🎯 Trigger mapping
| User input trigger word | AI execution action |
|---|---|
| "convert this JSON into md files" / "extract JSON attributes into md files" / "json to markdown files" | Execute according to [Extraction Mode] |
Extraction Mode
Execution steps
Note: Do not read the specific contents of the file, because files are usually very large; you only need to pass the file path.
| Step | Execution action | Specific command/operation |
|---|---|---|
| 1 | Read and run the extraction script | Run RunCommand Execute node scripts/extract-data.js "<json-file-path>" ⚠️ Important: The file path must be wrapped in double quotes, because the path may contain spaces |
Output result
Example output on success:
✅ JSON 属性提取成功
📋 生成的文件:
- systemPrompt.md
- userPrompt.md
📝 文件已保存到输入 JSON 文件同级目录, 该目录的绝对路径是: <目录路径>
Example output on failure:
❌ 提取失败
错误原因:{具体错误信息}
解决建议:请检查 JSON 文件路径和格式是否正确
Error handling
| Error scenario | Error manifestation | Handling method |
|---|---|---|
| JSON file does not exist | ENOENT: no such file or directory | Use LS to check the file path and confirm the file exists |
| JSON format error | SyntaxError: Unexpected token | Use Read to read the file contents and check the JSON format |
| Improper use of path quotes | MODULE_NOT_FOUND / module not found | Make sure to wrap the complete file path in double quotes, and avoid nested quotes |
Resources
- extract-data.js - Extraction script for converting JSON to Markdown files