导出与导入

SkillDev tools

Use when you need to export or import Ordine Best Practice data (including checklistItems and codeSnippets) for backup, migration, or sharing. Trigger words: 导出最佳实践, 导入规范, 迁移数据, 备份bestpractice, export import.

Use 导出与导入 in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add 导出与导入 and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the 导出与导入 skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

导出与导入Start free

What this skill tells your AI

The instructions your AI receives, as published by forge-town/ordine in skills/ordine-export-import/SKILL.md and read by Ahel’s review.

概述

Ordine 支持将 Best Practice(连同关联的 Checklist Items 和 Code Snippets)批量导出为 JSON 文件,以及从 JSON 文件导入。适用于数据备份、环境迁移和团队共享。

通过 CLI

CLI 当前不直接支持导出导入。使用 REST API 操作。

通过 REST API

导出所有 Best Practice

# 导出到文件
curl -s http://localhost:9433/api/best-practices/export > best-practices-export.json

# 预览导出内容
curl -s http://localhost:9433/api/best-practices/export | python3 -m json.tool

导出格式:

[
  {
    "id": "bp_classname_convention",
    "title": "className 使用 cn() 函数",
    "condition": "当组件中使用 className 动态拼接时",
    "content": "所有动态 className 必须使用 cn() 工具函数",
    "codeSnippet": "...",
    "category": "style",
    "language": "react",
    "tags": ["className", "tailwind"],
    "checklistItems": [
      { "id": "cli_cn_1", "content": "所有动态 className 使用 cn()", "sortOrder": 0 }
    ],
    "codeSnippets": [
      { "id": "cs_cn_good", "title": "✅ 正确用法", "code": "...", "language": "tsx", "sortOrder": 0 }
    ]
  }
]

导入 Best Practice

# 从文件导入
curl -X POST http://localhost:9433/api/best-practices/import \
  -H "Content-Type: application/json" \
  -d @best-practices-export.json

返回导入统计:

{
  "imported": {
    "bestPractices": 5,
    "checklistItems": 12,
    "codeSnippets": 8
  }
}

典型工作流

备份
# 定期备份
DATE=$(date +%Y%m%d)
curl -s http://localhost:9433/api/best-practices/export > "backups/bp-${DATE}.json"
环境迁移
# 从开发环境导出
ORDINE_API_URL=http://localhost:9433 \
  curl -s http://localhost:9433/api/best-practices/export > bp-export.json

# 导入到生产环境
curl -X POST http://production-server:9433/api/best-practices/import \
  -H "Content-Type: application/json" \
  -d @bp-export.json
团队共享

将导出的 JSON 文件提交到仓库,团队成员各自导入:

# 从仓库中的共享文件导入
curl -X POST http://localhost:9433/api/best-practices/import \
  -H "Content-Type: application/json" \
  -d @shared/best-practices.json

Signals

GitHub stars
28
Forks
2
Last commit
Oct 2026
Advanced
Item type
skill
Key
ordine-export-import
Source
github.com/forge-town/ordine