@crewx/workflow 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SKILL.md ADDED
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: crewx/workflow
3
+ description: 워크플로 관리 빌트인 도구. 목록 조회, 상세 보기(머메이드 포함), 문법 검증, 실행 State 관리.
4
+ argument-hint: "<list|show|validate|run> [args]"
5
+ metadata:
6
+ built-in: true
7
+ entrypoint: cli.ts
8
+ schema: workflow-schema.json
9
+ ---
10
+
11
+ # CrewX Workflow
12
+
13
+ 에이전트 간 협업 흐름을 **시멘틱 워크플로 YAML**로 관리하는 빌트인 도구입니다.
14
+
15
+ ## 사용법
16
+
17
+ ```bash
18
+ # 워크플로 목록
19
+ crewx workflow list
20
+ crewx workflow list --json
21
+
22
+ # 워크플로 상세 보기
23
+ crewx workflow show standard-dev-core
24
+ crewx workflow show standard-dev-core --mermaid
25
+
26
+ # 문법 검증
27
+ crewx workflow validate
28
+ crewx workflow validate workflows/standard-dev.yaml
29
+ ```
30
+
31
+ ## 서브커맨드
32
+
33
+ | 커맨드 | 동작 |
34
+ |--------|------|
35
+ | `list` | workflows/*.yaml 파싱 → 목록 출력 (이름, 노드 수, 에이전트) |
36
+ | `list --json` | JSON 형태 출력 |
37
+ | `show <name>` | 워크플로 상세 텍스트 출력 |
38
+ | `show <name> --mermaid` | 머메이드 코드 stdout 출력 |
39
+ | `validate` | workflows/ 전체 검증 |
40
+ | `validate <file>` | 특정 파일 검증 |
41
+ | `run start <file> [id]` | 워크플로 실행 생성 (`--set key=value` 지원) |
42
+ | `run state <exec-id>` | 실행 state 조회 (`--set key=value`로 쓰기, `--set key=-`로 stdin 파이프) |
43
+ | `run node <exec-id> <node-id>` | 현재 노드 이동 + completed_nodes 추적 |
44
+ | `run reset <exec-id>` | 실행 state를 initial_state로 복원 |
45
+ | `run list` | 모든 실행 목록 조회 |
46
+
47
+ ## 실행 State 관리
48
+
49
+ 워크플로 실행 상태를 JSON 파일(`.crewx/workflow-runs/`)로 관리합니다.
50
+
51
+ ```bash
52
+ # 실행 생성
53
+ crewx workflow run start workflows/idea-validation.yaml
54
+ crewx workflow run start workflows/standard-dev.yaml standard-dev-core --set goal="구현"
55
+
56
+ # state 조회/수정
57
+ crewx workflow run state idea-validation-1711100000000
58
+ crewx workflow run state idea-validation-1711100000000 --set result="완료"
59
+
60
+ # stdin 파이프로 긴 값 저장
61
+ echo "긴 분석 결과..." | crewx workflow run state <exec-id> --set analysis=-
62
+
63
+ # 노드 이동
64
+ crewx workflow run node <exec-id> research
65
+ crewx workflow run node <exec-id> end
66
+
67
+ # 리셋
68
+ crewx workflow run reset <exec-id>
69
+
70
+ # 실행 목록
71
+ crewx workflow run list
72
+ crewx workflow run list --json
73
+ ```
74
+
75
+ 모든 `run` 서브커맨드에 `--json` 플래그를 사용할 수 있습니다.
76
+
77
+ ## ⚠️ 설계 전 필수: 에이전트 목록 확인
78
+
79
+ **워크플로에 존재하지 않는 에이전트를 지정하면 실행 불가!**
80
+ 설계 전에 반드시 사용 가능한 에이전트를 확인하세요.
81
+
82
+ ```bash
83
+ crewx agent ls
84
+ ```
85
+
86
+ ## 워크플로 기본 구조
87
+
88
+ ```yaml
89
+ workflows:
90
+ process-name:
91
+ metadata:
92
+ name: "프로세스 이름"
93
+ description: "설명"
94
+ timeout: 300
95
+ max_iterations: 50
96
+ state:
97
+ variable_name: ""
98
+ nodes:
99
+ step_id:
100
+ type: agent_task
101
+ ...
102
+ ```
103
+
104
+ ## 노드 타입
105
+
106
+ ### `agent_task` — 에이전트에게 작업 지시
107
+
108
+ ```yaml
109
+ analyze:
110
+ type: agent_task
111
+ agent: tax_lawyer
112
+ mode: query
113
+ input: |
114
+ 세법을 분석해줘: {{user_input}}
115
+ output: law_analysis
116
+ next: calculate
117
+ ```
118
+
119
+ ### `parallel` — 병렬 실행
120
+
121
+ ```yaml
122
+ parallel_review:
123
+ type: parallel
124
+ branches: [cpo_review, persona_survey]
125
+ join: merge_feedback
126
+ ```
127
+
128
+ ### `join` — 병렬 합류
129
+
130
+ ```yaml
131
+ merge_feedback:
132
+ type: join
133
+ on_failure: continue
134
+ next: check_quality
135
+ ```
136
+
137
+ ### `branch` — 조건 분기
138
+
139
+ ```yaml
140
+ check_approval:
141
+ type: branch
142
+ condition: "state.cpo_feedback.includes('승인')"
143
+ branches:
144
+ "true": end
145
+ "false": persona_survey
146
+ default: persona_survey
147
+ ```
148
+
149
+ ### `approval` — 사람 승인 대기
150
+
151
+ ```yaml
152
+ human_check:
153
+ type: approval
154
+ description: "결과를 확인하고 승인하시겠습니까?"
155
+ assignee: "@manager"
156
+ on_approve: publish
157
+ on_reject: revise
158
+ ```
159
+
160
+ ### `end` — 종료
161
+
162
+ ```yaml
163
+ end:
164
+ type: end
165
+ ```
166
+
167
+ ## 템플릿 문법
168
+
169
+ `input`에서 `{{변수명}}`으로 `state` 값을 참조합니다.
170
+
171
+ ## 노드 공통 선택 필드
172
+
173
+ | 필드 | 타입 | 설명 |
174
+ |------|------|------|
175
+ | `timeout` | number | 초 단위 타임아웃 |
176
+ | `retry` | object | `{ max, delay: "exponential"\|"fixed" }` |
177
+ | `hooks` | string[] | 이 노드에 적용할 Hook 패키지 |
178
+ | `on_failure` | string | `fail_fast` \| `continue` \| `ignore` |
179
+ | `on_error` | object | `{ handler?, fallback_node? }` |
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export declare function main(inputArgs?: string[]): Promise<void>;
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";AAikBA,wBAAsB,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAkD9D"}