JSON 규격 가이드

PIPEJS에서 사용하는 워크플로우 JSON 구조와 규칙을 설명합니다.

기본 구조

{
  "projectName": "프로젝트명",
  "version": "1.0.0",
  "description": "프로젝트 설명",
  "lastUpdated": "2025-07-24T00:00:00Z",
  "nodes": [
    // 노드 배열
  ],
  "statistics": {
    "totalNodes": 5,
    "byType": { "project": 1, "workflow": 1, "step": 3 },
    "byStatus": { "pending": 2, "in-progress": 2, "completed": 1, "error": 0 }
  }
}

노드 구조

{
  "id": "unique_id",           // 각 노드의 고유 식별자
  "parentId": "parent_id",     // 부모 노드 ID (루트 노드는 null)
  "type": "project",           // 노드 유형 (project, workflow, step 등)
  "name": "노드 이름",          // 노드에 표시될 이름
  "order": 1,                  // 형제 노드 간 순서 (숫자)
  "status": "pending",         // 진행 상태 (pending, in-progress, completed, error 중 하나)
  "description": "설명",       // 노드에 대한 상세 설명
  "path": ["/src/file.ts"],    // 관련 파일 경로 배열
  "priority": "높음",          // 우선순위 (높음, 보통, 낮음)
  "prompt": "AI prompt for this task",  // 해당 작업에 특화된 AI 프롬프트
  "code": "function hello() { return 'Hello World'; }", // 작업과 관련된 코드 스니펫 (선택적) (선택적)
  "metadata": {                // 추가 메타데이터 객체
    "category": "implementation"
  }
}

필수 필드

id

각 노드의 고유 식별자

parentId

부모 노드 ID (루트 노드는 null)

type

노드 유형 (project, workflow, step 등)

name

노드에 표시될 이름

order

형제 노드 간 순서 (숫자)

status

진행 상태 (pending, in-progress, completed, error 중 하나)

path

관련 파일 경로 배열

선택적 필드

description

노드에 대한 상세 설명

priority

우선순위 (높음, 보통, 낮음)

prompt

해당 작업에 특화된 AI 프롬프트

code

작업과 관련된 코드 스니펫 (선택적)

metadata

추가 메타데이터 객체

상태 값 (status)

status 필드는 정확히 4개의 값 중 하나만 허용됩니다. 다른 값을 입력하면 유효성 검사 오류가 발생합니다.

pending

대기 중인 작업

in-progress

진행 중인 작업

completed

완료된 작업

error

오류가 발생한 작업

error

오류가 발생한 작업

유효성 검사 규칙

6가지 주요 규칙

1
ID 유일성: 모든 노드의 id는 고유해야 합니다.
2
단일 루트: parentId가 null인 노드는 정확히 하나여야 합니다.
3
parentId 존재성: parentId가 null이 아닌 경우, 해당 ID를 가진 노드가 존재해야 합니다.
4
순환 참조 금지: 트리 구조에 순환 참조가 있으면 안 됩니다.
5
필수 필드: id, parentId, type, name, order, status, path 필드는 필수입니다.
6
order 중복 금지: 같은 부모를 가진 형제 노드들의 order 값은 중복되면 안 됩니다.

완전한 예시

{
  "projectName": "pipejs",
  "version": "1.0.0",
  "description": "parentId 기본 워크플로우 web service",
  "lastUpdated": "2025-07-24T00:00:00Z",
  "nodes": [
    {
      "id": "project_root",
      "parentId": null,
      "type": "project",
      "name": "pipejs",
      "order": 0,
      "status": "in-progress",
      "description": "프로젝트 루트",
      "path": ["/"],
      "priority": "높음",
      "prompt": "Analyze the overall project structure and design the architecture",
      "metadata": { "category": "root" }
    },
    {
      "id": "workflow_1",
      "parentId": "project_root",
      "type": "workflow",
      "name": "기본 워크플로우",
      "order": 1,
      "status": "pending",
      "description": "샘플 워크플로우",
      "path": ["/src/DiagramEditor.tsx"],
      "priority": "보통",
      "prompt": "Implement JSON workflow editor and diagram viewer with real-time validation",
      "metadata": { "category": "implementation" }
    }
  ],
  "statistics": {
    "totalNodes": 2,
    "byType": { "project": 1, "workflow": 1 },
    "byStatus": { "pending": 1, "in-progress": 1 }
  }
}