commitgate 0.2.1 โ 0.2.2
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/AGENTS.template.md +51 -48
- package/README.en.md +246 -238
- package/README.md +246 -238
- package/bin/commitgate.mjs +2 -1
- package/bin/init.ts +40 -6
- package/package.json +1 -1
- package/scripts/req/lib/adapters.ts +35 -8
- package/scripts/req/review-codex.ts +243 -20
- package/workflow/machine.schema.json +19 -2
package/README.md
CHANGED
|
@@ -1,238 +1,246 @@
|
|
|
1
|
-
# CommitGate
|
|
2
|
-
|
|
3
|
-
๐ **ํ๊ตญ์ด** ยท [English](./README.en.md)
|
|
4
|
-
|
|
5
|
-
**AI ์ฝ๋ฉ ๋ณ๊ฒฝ์ Codex ๋ฆฌ๋ทฐ ์น์ธ ์์ด๋ ์ปค๋ฐํ์ง ๋ชปํ๊ฒ ๋ง๋ ์ปค๋ฐ ๊ฒ์ดํธ์
๋๋ค.**
|
|
6
|
-
|
|
7
|
-
AI ์์ด์ ํธ๊ฐ ์ฝ๋๋ฅผ ๋น ๋ฅด๊ฒ ๋ง๋ค๋๋ผ๋, ๋ฆฌ๋ทฐ ์์ด ๋ฐ๋ก ์ปค๋ฐ๋๋ฉด ์ํํฉ๋๋ค. CommitGate๋ ๋ณ๊ฒฝ์ ํฐ์ผ ๋จ์๋ก ๋ฌถ๊ณ , Codex๊ฐ ์น์ธํ staged tree๋ง ์ปค๋ฐ๋๊ฒ ํฉ๋๋ค. ์น์ธ ํ ์ฝ๋๊ฐ ๋ฐ๋๊ฑฐ๋ ์ฆ๊ฑฐ๊ฐ ๋ถ์กฑํ๋ฉด ๊ธฐ๋ณธ์ ์ผ๋ก ๋ง์ต๋๋ค.
|
|
8
|
-
|
|
9
|
-
[](https://github.com/sol5288/commitgate/actions/workflows/ci.yml)
|
|
10
|
-
[](https://www.npmjs.com/package/commitgate)
|
|
11
|
-
[](./LICENSE)
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Quick Start
|
|
16
|
-
|
|
17
|
-
์๋๋ ๊ฐ์ฅ ์งง์ ์ฌ์ฉ ๊ฒฝ๋ก์
๋๋ค. ํ๋ก์ ํธ ๋ฃจํธ๋ **git ์ ์ฅ์์ด๊ณ `package.json`์ด ์๋ ํด๋**์ฌ์ผ ํฉ๋๋ค.
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- req:
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
npm run req:commit -- 2026-001 --run
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
1
|
+
# CommitGate
|
|
2
|
+
|
|
3
|
+
๐ **ํ๊ตญ์ด** ยท [English](./README.en.md)
|
|
4
|
+
|
|
5
|
+
**AI ์ฝ๋ฉ ๋ณ๊ฒฝ์ Codex ๋ฆฌ๋ทฐ ์น์ธ ์์ด๋ ์ปค๋ฐํ์ง ๋ชปํ๊ฒ ๋ง๋ ์ปค๋ฐ ๊ฒ์ดํธ์
๋๋ค.**
|
|
6
|
+
|
|
7
|
+
AI ์์ด์ ํธ๊ฐ ์ฝ๋๋ฅผ ๋น ๋ฅด๊ฒ ๋ง๋ค๋๋ผ๋, ๋ฆฌ๋ทฐ ์์ด ๋ฐ๋ก ์ปค๋ฐ๋๋ฉด ์ํํฉ๋๋ค. CommitGate๋ ๋ณ๊ฒฝ์ ํฐ์ผ ๋จ์๋ก ๋ฌถ๊ณ , Codex๊ฐ ์น์ธํ staged tree๋ง ์ปค๋ฐ๋๊ฒ ํฉ๋๋ค. ์น์ธ ํ ์ฝ๋๊ฐ ๋ฐ๋๊ฑฐ๋ ์ฆ๊ฑฐ๊ฐ ๋ถ์กฑํ๋ฉด ๊ธฐ๋ณธ์ ์ผ๋ก ๋ง์ต๋๋ค.
|
|
8
|
+
|
|
9
|
+
[](https://github.com/sol5288/commitgate/actions/workflows/ci.yml)
|
|
10
|
+
[](https://www.npmjs.com/package/commitgate)
|
|
11
|
+
[](./LICENSE)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
์๋๋ ๊ฐ์ฅ ์งง์ ์ฌ์ฉ ๊ฒฝ๋ก์
๋๋ค. ํ๋ก์ ํธ ๋ฃจํธ๋ **git ์ ์ฅ์์ด๊ณ `package.json`์ด ์๋ ํด๋**์ฌ์ผ ํฉ๋๋ค.
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
# ์์ง git ์ ์ฅ์๊ฐ ์๋๊ฑฐ๋ package.json์ด ์๋ ์ ํด๋๋ผ๋ฉด ๋จผ์ :
|
|
21
|
+
git init
|
|
22
|
+
npm init -y
|
|
23
|
+
|
|
24
|
+
# ๊ทธ๋ค์ ์ค์น:
|
|
25
|
+
npx commitgate
|
|
26
|
+
npm install
|
|
27
|
+
codex --version
|
|
28
|
+
codex login status
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
๊ทธ๋ค์ AI ์ฝ๋ฉ ์์ด์ ํธ์๊ฒ ์๋ ํ๋กฌํํธ๋ฅผ ๋ถ์ฌ๋ฃ์ต๋๋ค.
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
์ด ์์ฒญ์ ์ผ๋ฐ ๊ตฌํ์ผ๋ก ์ฒ๋ฆฌํ์ง ๋ง๊ณ , ์ด ํ๋ก์ ํธ์ ์ค์น๋ CommitGate๋ฅผ ์ฌ์ฉํด๋ผ.
|
|
35
|
+
|
|
36
|
+
์ REQ ํฐ์ผ์ ๋ง๋ค๊ณ ๋ค์ ํ๋ฆ์ ๋๊น์ง ์งํํด๋ผ:
|
|
37
|
+
req:new โ ์ค๊ณ๋ฌธ์ ์์ฑ โ Codex design ๋ฆฌ๋ทฐ โ ๊ตฌํยทํ
์คํธ โ req:doctor โ Codex phase ๋ฆฌ๋ทฐ โ req:commit
|
|
38
|
+
|
|
39
|
+
์๋์ผ๋ก ์งํํ ๊ฒ:
|
|
40
|
+
- `req:review-codex`๊ฐ NEEDS_FIX/exit 3์ ๋ฐํํ๋ฉด findings๋ฅผ ์์ ํ๊ณ ์ฌ๋ฆฌ๋ทฐํ๋ค.
|
|
41
|
+
- BLOCKED/exit 2๋ฅผ ๋ฐํํ๋ฉด ๊ฐ์ ๋ฆฌ๋ทฐ๋ฅผ ์ฌ์๋ํ์ง ๋ง๊ณ ์ฌ๋์๊ฒ ๋ณด๊ณ ํ๊ฑฐ๋ ๋ฆฌ๋ทฐ ๋์์ ๋ฐ๊พผ๋ค. ์ค๋ ๋ ๊ณ ์ฐฉ์ด ์์ฌ๋๋ฉด `--fresh-thread`๋ก ํ ๋ฒ๋ง ํ๋ณต์ ์๋ํ ์ ์๋ค.
|
|
42
|
+
- ๋ฆฌ๋ทฐ ๋์์ git add ํ ํ์ผ๋ง์ด๋ค.
|
|
43
|
+
- `state.json`๊ณผ `responses/`๋ ์ง์ `git add`ํ์ง ์๋๋ค.
|
|
44
|
+
|
|
45
|
+
๋ฉ์ถฐ์ ํ์ธ๋ฐ์ ๋:
|
|
46
|
+
- req:commit --run ์ง์
|
|
47
|
+
- main ๋ณํฉ ๋๋ push ์ง์
|
|
48
|
+
- reset, clean, force push ๊ฐ์ destructive ์์
์
|
|
49
|
+
- ์๊ตฌ์ฌํญ ๋ฒ์๋ฅผ ๋ฐ๊ฟ์ผ ํ ๋
|
|
50
|
+
- Codex ๋ฆฌ๋ทฐ๊ฐ BLOCKED๋ฅผ ๋ฐํํ๊ฑฐ๋ ์ ํ๋ ์ฌ์๋ ํ์๋ ํ๋จ์ด ๋ถ๋ช
ํํ ๋
|
|
51
|
+
|
|
52
|
+
์๊ตฌ์ฌํญ:
|
|
53
|
+
- ๋ฌด์์:
|
|
54
|
+
- ์:
|
|
55
|
+
- ์ ์ฝ:
|
|
56
|
+
- ์๋ฃ ๊ธฐ์ค:
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
์ฒซ ์๋ต์ ๋ณดํต ์ด๋ ๊ฒ ๋์์ผ ํฉ๋๋ค.
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
REQ-2026-002 ๋ฐํ
|
|
63
|
+
๋ธ๋์น: feat/req-2026-002-profile-edit-api
|
|
64
|
+
phase:
|
|
65
|
+
- phase-1: PATCH /profile ๊ตฌํ
|
|
66
|
+
- phase-2: ํ
์คํธ์ ํ๊ท ํ์ธ
|
|
67
|
+
ํต์ ์ : req:commit --run ์ง์ , push ์ง์
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
์ดํ์๋ ์์ด์ ํธ๊ฐ ์ค๊ณ, ๊ตฌํ, ํ
์คํธ, Codex ๋ฆฌ๋ทฐ๋ฅผ ์งํํฉ๋๋ค. ์ฌ์ฉ์๋ ์ปค๋ฐ์ด๋ push ๊ฐ์ ํต์ ์ ์์๋ง ํ์ธํ๋ฉด ๋ฉ๋๋ค.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## ๋ฌด์์ ๋ณด์ฅํ๋์?
|
|
75
|
+
|
|
76
|
+
CommitGate๊ฐ ๋ง๋ ๊ฒ์ ๋จ์ํ ๋ช
๋ น ์ค์๊ฐ ์๋๋ผ **๋ฆฌ๋ทฐ๋ฐ์ง ์์ ๋ณ๊ฒฝ์ด ์ปค๋ฐ๋๋ ์ํฉ**์
๋๋ค.
|
|
77
|
+
|
|
78
|
+
- Codex ๋ฆฌ๋ทฐ๊ฐ ์คํจํ๊ฑฐ๋ ์์ผ๋ฉด ์ปค๋ฐํ ์ ์์ต๋๋ค.
|
|
79
|
+
- ์น์ธ๋ staged tree์ ์ง๊ธ ์ปค๋ฐํ๋ ค๋ staged tree๊ฐ ๋ค๋ฅด๋ฉด ๋ง์ต๋๋ค.
|
|
80
|
+
- `state.json`, `responses/` ๊ฐ์ ์ํฌํ๋ก ๋ด๋ถ ํ์ผ์ source ์ปค๋ฐ์ ์์ผ๋ฉด ๋ง์ต๋๋ค.
|
|
81
|
+
- Codex CLI๊ฐ ์๊ฑฐ๋ ์คํ์ ์คํจํ๋ฉด ์กฐ์ฉํ ํต๊ณผํ์ง ์๊ณ ์คํจํฉ๋๋ค.
|
|
82
|
+
- ๋ฆฌ๋ทฐ ์ข
๋ฃ์ฝ๋๋ outcome ๊ธฐ์ค์
๋๋ค: `0` ์น์ธ, `1` ๋ฌดํจ/fail-closed, `2` blocked(์ง์ ์์+๋ฏธ์น์ธ), `3` needs-fix.
|
|
83
|
+
- ์ง์ ์ ์์ง๋ง ์น์ธ๋ ์๋ ์๋ต์ NEEDS_FIX๊ฐ ์๋๋ผ BLOCKED์ด๋ฉฐ, ์์ด์ ํธ๋ ๊ฐ์ ๋ฆฌ๋ทฐ๋ฅผ ๋ฐ๋ณตํ์ง ์์ต๋๋ค.
|
|
84
|
+
- ์ค์น ์ ๊ธฐ์กด `cross-spawn`์ด ๊ฒ์ฆ ํํ๋ณด๋ค ๋ฎ์ผ๋ฉด ๊ฒฝ๊ณ ํ๊ณ , `--strict`์์๋ ์ค๋จํฉ๋๋ค.
|
|
85
|
+
- ์น์ธ ์๋ต๊ณผ ์ฆ๊ฑฐ ํ์ผ์ `workflow/REQ-.../responses/`์ ๋จ์ต๋๋ค.
|
|
86
|
+
|
|
87
|
+
ํ ์ค๋ก ๋งํ๋ฉด, **ํ์คํ ์น์ธ๋ ๋ณ๊ฒฝ๋ง ํต๊ณผํ๊ณ ์ ๋งคํ๋ฉด ๋ฉ์ถ๋ ๋ฐฉ์**์
๋๋ค.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## ์ค์น๊ฐ ํ๋ ์ผ
|
|
92
|
+
|
|
93
|
+
`npx commitgate`๋ ๋์ ํ๋ก์ ํธ์ ์๋ ํ์ผ๊ณผ ์ค์ ์ ์ถ๊ฐํฉ๋๋ค. ๊ธฐ์กด ํ์ผ์ ๊ธฐ๋ณธ์ ์ผ๋ก ๋ฎ์ด์ฐ์ง ์์ต๋๋ค.
|
|
94
|
+
|
|
95
|
+
| ์ถ๊ฐ ํญ๋ชฉ | ์ค๋ช
|
|
|
96
|
+
|---|---|
|
|
97
|
+
| `scripts/req/` | `req:new`, `req:review-codex`, `req:doctor`, `req:commit` ์คํฌ๋ฆฝํธ |
|
|
98
|
+
| `workflow/*.schema.json` | Codex ์๋ต๊ณผ ์ค์ ๊ฒ์ฆ ์คํค๋ง |
|
|
99
|
+
| `req.config.json` | ํ๋ก์ ํธ๋ณ ์ค์ |
|
|
100
|
+
| `AGENTS.md` | ์์ด์ ํธ์ Reviewer๊ฐ ์ฝ๋ ๊ท์น ํ
ํ๋ฆฟ |
|
|
101
|
+
| `package.json` ์คํฌ๋ฆฝํธ | `req:*` ๋ช
๋ น๊ณผ ํ์ํ devDependencies |
|
|
102
|
+
|
|
103
|
+
๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ง ํ๋ ค๋ฉด:
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
npx commitgate --dry-run
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
๋ณด์ ํํ ๊ฒฝ๊ณ ๋ฅผ ์ค์น ์คํจ๋ก ์ทจ๊ธํ๋ ค๋ฉด:
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
npx commitgate --strict
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
๊ธฐ์กด `cross-spawn`์ด ๊ฒ์ฆ ํํ๋ณด๋ค ๋ฎ์ผ๋ฉด ํ์ผ์ ๋ณต์ฌํ๊ธฐ ์ ์ ์ค๋จํฉ๋๋ค.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## ์ค๋น๋ฌผ
|
|
120
|
+
|
|
121
|
+
| ํ์ | ํ์ธ ๋ช
๋ น | ๋น๊ณ |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| Git | `git --version` | ํ์ |
|
|
124
|
+
| Node.js 18.17+ | `node --version` | ํ์ |
|
|
125
|
+
| npm, pnpm, yarn ์ค ํ๋ | `npm --version` | npm ๊ธฐ์ค์ผ๋ก ์๋ด |
|
|
126
|
+
| Codex CLI | `codex --version` | ๋ฆฌ๋ทฐ ์คํ์ ํ์ |
|
|
127
|
+
|
|
128
|
+
Codex CLI๊ฐ ์๋ค๋ฉด:
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
npm install -g @openai/codex
|
|
132
|
+
codex login
|
|
133
|
+
codex login status
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Windows์์ ์ค์น ์งํ `codex` ๋ช
๋ น์ ๋ชป ์ฐพ์ผ๋ฉด ์ ํฐ๋ฏธ๋์ ์ด์ด PATH๋ฅผ ๋ค์ ์ฝ๊ฒ ํ์ธ์.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## ์๋ ๋ช
๋ น
|
|
141
|
+
|
|
142
|
+
๋๋ถ๋ถ์ ์ฌ์ฉ์๋ ์ ํ๋กฌํํธ ๋ฐฉ์์ผ๋ก ์ถฉ๋ถํฉ๋๋ค. ์๋๋ ๋ด๋ถ์์ ์ด๋ค ๋ช
๋ น์ด ์คํ๋๋์ง ์ดํดํ๊ฑฐ๋ ์ง์ ๋๋ฒ๊น
ํ ๋๋ง ๋ณด๋ฉด ๋ฉ๋๋ค.
|
|
143
|
+
|
|
144
|
+
```sh
|
|
145
|
+
# 1. ํฐ์ผ๊ณผ ๋ธ๋์น ์์ฑ
|
|
146
|
+
npm run req:new -- my-feature --run
|
|
147
|
+
|
|
148
|
+
# 2. ์ค๊ณ ๋ฌธ์ ์์ฑ ํ stage
|
|
149
|
+
git add workflow/REQ-2026-001/00-requirement.md workflow/REQ-2026-001/01-design.md workflow/REQ-2026-001/02-plan.md
|
|
150
|
+
|
|
151
|
+
# 3. ์ค๊ณ ๋ฆฌ๋ทฐ
|
|
152
|
+
npm run req:review-codex -- 2026-001 --kind design --run
|
|
153
|
+
|
|
154
|
+
# 4. ์ฝ๋ ๊ตฌํ ํ stage
|
|
155
|
+
git add <changed-source-files>
|
|
156
|
+
|
|
157
|
+
# 5. ๊ฒ์ดํธ ์ ๊ฒ
|
|
158
|
+
npm run req:doctor -- 2026-001
|
|
159
|
+
|
|
160
|
+
# 6. ๊ตฌํ ๋ฆฌ๋ทฐ
|
|
161
|
+
npm run req:review-codex -- 2026-001 --kind phase --run
|
|
162
|
+
|
|
163
|
+
# 7. ์น์ธ๋ ์ฝ๋ ์ปค๋ฐ
|
|
164
|
+
npm run req:commit -- 2026-001 --run -m "feat: my feature"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
์ค์: source ์ปค๋ฐ์๋ ๋ด๊ฐ ๋ง๋ ์ฝ๋์ ๋ฌธ์๋ง stageํ์ธ์. `state.json`๊ณผ `responses/`๋ ๋๊ตฌ๊ฐ ๊ด๋ฆฌํฉ๋๋ค.
|
|
168
|
+
|
|
169
|
+
์ฌ๋ฌ ์ค ์ปค๋ฐ ๋ฉ์์ง๋ `-m` ๋์ ํ์ผ์ ์ฌ์ฉํ์ธ์.
|
|
170
|
+
|
|
171
|
+
```sh
|
|
172
|
+
npm run req:commit -- 2026-001 --run --message-file commit-message.txt
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## ๋ช
๋ น์ด ์์ฝ
|
|
178
|
+
|
|
179
|
+
| ๋ช
๋ น | ์ฉ๋ |
|
|
180
|
+
|---|---|
|
|
181
|
+
| `npx commitgate` | ํ๋ก์ ํธ์ CommitGate ์ค์น |
|
|
182
|
+
| `npx commitgate --dry-run` | ํ์ผ์ ์ฐ์ง ์๊ณ ์ค์น ๊ณํ ํ์ธ |
|
|
183
|
+
| `npx commitgate --strict` | ๋ฎ์ `cross-spawn` ๋ฒ์ ๊ฒฝ๊ณ ๋ฅผ ์ค์น ์คํจ๋ก ์ฒ๋ฆฌ |
|
|
184
|
+
| `req:new <slug> --run` | REQ ํฐ์ผ, ๋ธ๋์น, ์ค๊ณ๋ฌธ์ ์์ฑ |
|
|
185
|
+
| `req:review-codex <id> --kind design --run` | ์ค๊ณ ๋ฆฌ๋ทฐ |
|
|
186
|
+
| `req:review-codex <id> --kind phase --run` | ๊ตฌํ ๋ฆฌ๋ทฐ |
|
|
187
|
+
| `req:doctor <id>` | ๊ฒ์ดํธ ์ํ ํ์ธ |
|
|
188
|
+
| `req:commit <id> --run -m "message"` | ์น์ธ๋ ๋ณ๊ฒฝ ์ปค๋ฐ |
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## ์ค์
|
|
193
|
+
|
|
194
|
+
๋๋ถ๋ถ์ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ถฉ๋ถํฉ๋๋ค. ํ์ํ๋ฉด ํ๋ก์ ํธ ๋ฃจํธ์ `req.config.json`์ ์์ ํ์ธ์.
|
|
195
|
+
|
|
196
|
+
| ํญ๋ชฉ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช
|
|
|
197
|
+
|---|---|---|
|
|
198
|
+
| `branchPrefix` | `"feat/req-"` | ์ ๋ธ๋์น prefix |
|
|
199
|
+
| `ticketRoot` | `"workflow"` | REQ ํฐ์ผ ํด๋ |
|
|
200
|
+
| `packageManager` | ์๋ ๊ฐ์ง | `npm`, `pnpm`, `yarn` |
|
|
201
|
+
| `designDocs` | `00/01/02` ๋ฌธ์ | ์ค๊ณ ๋ฌธ์ ํ์ผ๋ช
|
|
|
202
|
+
|
|
203
|
+
๋น `branchPrefix`๋ ํ๋ก์ ํธ ๋ฐ์ผ๋ก ๋๊ฐ๋ ๊ฒฝ๋ก๋ ๊ฑฐ๋ถ๋ฉ๋๋ค.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## FAQ
|
|
208
|
+
|
|
209
|
+
**Codex CLI๊ฐ ์์ผ๋ฉด ์ด๋ป๊ฒ ๋๋์?**
|
|
210
|
+
๋ฆฌ๋ทฐ ๋ช
๋ น์ด ์คํจํฉ๋๋ค. ์กฐ์ฉํ ์น์ธ ์ฒ๋ฆฌํ์ง ์์ต๋๋ค.
|
|
211
|
+
|
|
212
|
+
**์น์ธ ํ ์ฝ๋๋ฅผ ์กฐ๊ธ ๊ณ ์น๋ฉด ์ปค๋ฐ๋๋์?**
|
|
213
|
+
์ ๋ฉ๋๋ค. ์น์ธ๋ staged tree์ ๋ฌ๋ผ์ง๋ฉด stale ์น์ธ์ผ๋ก ๋ณด๊ณ ๋ค์ ๋ฆฌ๋ทฐ๋ฅผ ์๊ตฌํฉ๋๋ค.
|
|
214
|
+
|
|
215
|
+
**`state.json`์ด๋ `responses/`๋ ์ stageํ๋ฉด ์ ๋๋์?**
|
|
216
|
+
์ํฌํ๋ก ์ฆ๊ฑฐ์ ์ํ ํ์ผ์
๋๋ค. source ์ปค๋ฐ์ ์์ด๋ฉด ์น์ธ ๋ฐ์ธ๋ฉ์ด ํ๋ ค์ง๋ฏ๋ก `req:commit`์ด ๋ง์ต๋๋ค.
|
|
217
|
+
|
|
218
|
+
**cross-spawn ๋ฒ์ ๊ฒฝ๊ณ ๊ฐ ๋์ค๋ฉด ์ด๋ป๊ฒ ํ๋์?**
|
|
219
|
+
๋์ ํ๋ก์ ํธ์ ๊ธฐ์กด `cross-spawn`์ด CommitGate๊ฐ ๊ฒ์ฆํ ํํ๋ณด๋ค ๋ฎ์ ์ ์๋ค๋ ๋ป์
๋๋ค. `npm i -D cross-spawn@^7.0.6`์ผ๋ก ์ฌ๋ฆฌ์ธ์. CI๋ ๋ณด์ ๋ฏผ๊ฐ ํ๊ฒฝ์์๋ `npx commitgate --strict`๋ฅผ ์ฌ์ฉํด ๊ฒฝ๊ณ ๋ฅผ ์คํจ๋ก ๋ค๋ฃจ์ธ์.
|
|
220
|
+
|
|
221
|
+
**๋ ๋ฒ ์ค์นํ๋ฉด ๋ฎ์ด์ฐ๋์?**
|
|
222
|
+
์๋์. ๊ธฐ์กด ํ์ผ์ ๊ฑด๋๋๋๋ค. ๊ฐ์ ๋ก ๊ฐฑ์ ํ๋ ค๋ฉด `--force`๋ฅผ ์ฌ์ฉํ์ธ์.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## ํ์ฌ ๋ฒ์
|
|
227
|
+
|
|
228
|
+
ํ์ฌ ๋ฒ์ ์ **Stage A: vendored scaffold ๋ชจ๋ธ**์
๋๋ค. ์ฆ `npx commitgate`๊ฐ ๋์ ํ๋ก์ ํธ์ ์ํฌํ๋ก ํ์ผ์ ๋ณต์ฌํฉ๋๋ค.
|
|
229
|
+
|
|
230
|
+
ํ์ฌ ์ด์ ์ค์ธ ๊ฒ์ฆ์
๋๋ค.
|
|
231
|
+
|
|
232
|
+
- GitHub Actions์์ `ubuntu-latest`, `macos-latest`, `windows-latest` ร Node 18/20/22 ๋งคํธ๋ฆญ์ค๋ฅผ ์คํํฉ๋๋ค.
|
|
233
|
+
- `npm run smoke`๋ pack tarball ์ค์น๋ณธ์ `commitgate` bin์ ์คํํฉ๋๋ค.
|
|
234
|
+
- Windows `.cmd` ๋ํผ ์ฃผ์
ํ๊ท ํ
์คํธ๊ฐ ํจํค์ง ๋งค๋์ ์ Codex wrapper ๊ฒฝ๋ก๋ฅผ ๋ณดํธํฉ๋๋ค.
|
|
235
|
+
|
|
236
|
+
์๋๋ ํ์ ๋ฒ์์
๋๋ค.
|
|
237
|
+
|
|
238
|
+
- `node_modules`์์ ์ง์ ์คํํ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ชจ๋ธ
|
|
239
|
+
- ๋น-git VCS ์ง์
|
|
240
|
+
- ๋ ๋ค์ํ ์ค๊ณ๋ฌธ์ ํ
ํ๋ฆฟ
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## License
|
|
245
|
+
|
|
246
|
+
[MIT](./LICENSE) ยฉ 2026 sol5288
|
package/bin/commitgate.mjs
CHANGED
|
@@ -18,4 +18,5 @@ register()
|
|
|
18
18
|
|
|
19
19
|
const initTs = pathToFileURL(join(dirname(fileURLToPath(import.meta.url)), 'init.ts')).href
|
|
20
20
|
const mod = await import(initTs)
|
|
21
|
-
|
|
21
|
+
// runCli = ์์ธ๋ฅผ ์น์ ํ ํ ์ค ๋ฉ์์ง + exit 1๋ก ๋ณํํ๋ CLI ๊ฒฝ๊ณ(์คํํธ๋ ์ด์ค ๋
ธ์ถ ๋ฐฉ์ง).
|
|
22
|
+
mod.runCli(process.argv.slice(2))
|
package/bin/init.ts
CHANGED
|
@@ -21,10 +21,11 @@ import {
|
|
|
21
21
|
copyFileSync,
|
|
22
22
|
realpathSync,
|
|
23
23
|
} from 'node:fs'
|
|
24
|
+
import { execFileSync } from 'node:child_process'
|
|
24
25
|
import { resolve, join, dirname, relative } from 'node:path'
|
|
25
26
|
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
26
27
|
import { loadConfig, stripBom, type PackageManager } from '../scripts/req/lib/config'
|
|
27
|
-
import { createGitAdapter } from '../scripts/req/lib/adapters'
|
|
28
|
+
import { createGitAdapter, type GitRunner } from '../scripts/req/lib/adapters'
|
|
28
29
|
import * as semver from 'semver'
|
|
29
30
|
|
|
30
31
|
/** ์ด ํจํค์ง ๋ฃจํธ(bin/ ๊ธฐ์ค 1๋จ๊ณ ์). ๋ณต์ฌ ์๋ณธ. */
|
|
@@ -73,7 +74,12 @@ export interface InitResult {
|
|
|
73
74
|
* targetRoot๊ฐ repo top-level๊ณผ ์ผ์นํด์ผ ํจ(ํ์ ๋๋ ํฐ๋ฆฌ์ ์ค์บํด๋ ๋ฐฉ์ง). git ๋ฏธ์ค์น/๋น-repo โ throw(fail-closed).
|
|
74
75
|
*/
|
|
75
76
|
function assertGitWorkTree(targetRoot: string): void {
|
|
76
|
-
|
|
77
|
+
// probe ์ ์ฉ runner: ๋น-repo์ผ ๋ git์ด ๋ฑ๋ `fatal: not a git repository` stderr๋ฅผ ์ผํจ๋ค.
|
|
78
|
+
// ์ฐ๋ฆฌ๊ฐ ๋ ๋ช
ํํ ์กฐ์น ๋ฉ์์ง๋ก ๋์ฒดํ๋ฏ๋ก raw git stderr๋ ๋
ธ์ด์ฆ์ผ ๋ฟ(design ํ์ UX).
|
|
79
|
+
// โ ๏ธ ์ ์ญ GitAdapter ๊ธฐ๋ณธ(stderr ์์)์ ๊ทธ๋๋ก โ ๋ค๋ฅธ git ํธ์ถ(req:commit ๋ฑ)์ ์ง๋จ ์์ค ๋ฐฉ์ง.
|
|
80
|
+
const quietRunner: GitRunner = (file, args, opts) =>
|
|
81
|
+
execFileSync(file, args, { ...opts, stdio: ['ignore', 'pipe', 'ignore'] })
|
|
82
|
+
const git = createGitAdapter(targetRoot, quietRunner)
|
|
77
83
|
let inside: string
|
|
78
84
|
let topLevel: string
|
|
79
85
|
try {
|
|
@@ -98,6 +104,16 @@ export function detectPackageManager(root: string): PackageManager {
|
|
|
98
104
|
return 'npm'
|
|
99
105
|
}
|
|
100
106
|
|
|
107
|
+
/**
|
|
108
|
+
* ๋์ pm์ ๋ง๋ package.json script ์คํ ์ปค๋งจ๋ ๋ฌธ์์ด.
|
|
109
|
+
* npm์ ์์ ์คํฌ๋ฆฝํธ๋ฅผ `npm run <script>`๋ก๋ง ์คํํ๊ณ ์ธ์ ์ ๋ฌ์ `--` ๊ตฌ๋ถ์๊ฐ ํ์ํ๋ค
|
|
110
|
+
* (`npm req:new โฆ`์ "Unknown command"๋ก ์คํจ). pnpm/yarn์ bare script + ์ธ์ ์ง์ ์ ๋ฌ์ ์ง์.
|
|
111
|
+
* โ ์๋ด ๋ฌธ๊ตฌ๊ฐ ์ค์ ๋ก ๋ณต๋ถ ๊ฐ๋ฅํ ์ ํจ ์ปค๋งจ๋๊ฐ ๋๋๋ก pm๋ณ๋ก ๋ถ๊ธฐ(README ์๋ ๋ช
๋ น๊ณผ ๋์ผ ํํ).
|
|
112
|
+
*/
|
|
113
|
+
export function runScriptCmd(pm: PackageManager, script: string, args: string): string {
|
|
114
|
+
return pm === 'npm' ? `npm run ${script} -- ${args}` : `${pm} ${script} ${args}`
|
|
115
|
+
}
|
|
116
|
+
|
|
101
117
|
/** dir ํ์ ๋ชจ๋ ํ์ผ์ ์ ๋๊ฒฝ๋ก(์ฌ๊ท). */
|
|
102
118
|
function walkFiles(dir: string): string[] {
|
|
103
119
|
const out: string[] = []
|
|
@@ -388,7 +404,7 @@ function printHelp(): void {
|
|
|
388
404
|
console.log(`commitgate โ AI REQ workflow(์ปค๋ฐ ๊ฒ์ดํธ) kit ์ค์น
|
|
389
405
|
|
|
390
406
|
์ฌ์ฉ๋ฒ:
|
|
391
|
-
npx commitgate [--dir <๋์repo>] [--force] [--dry-run]
|
|
407
|
+
npx commitgate [--dir <๋์repo>] [--force] [--dry-run] [--strict]
|
|
392
408
|
|
|
393
409
|
์ต์
:
|
|
394
410
|
--dir <path> ๋์ repo ๋ฃจํธ(๊ธฐ๋ณธ: ํ์ฌ ๋๋ ํฐ๋ฆฌ)
|
|
@@ -401,7 +417,10 @@ function printHelp(): void {
|
|
|
401
417
|
1. <๋์repo>์์ ์์กด์ฑ ์ค์น(๊ฐ์ง๋ ํจํค์ง๋งค๋์ )
|
|
402
418
|
2. codex CLI ์ค์น ํ์ธ(๋ฆฌ๋ทฐ ์คํธ์ถ์ฉ)
|
|
403
419
|
3. req.config.json ์กฐ์ (branchPrefix/ticketRoot ๋ฑ)
|
|
404
|
-
4.
|
|
420
|
+
4. ์ฒซ ํฐ์ผ ์์ฑ:
|
|
421
|
+
npm โ npm run req:new -- <slug> --run
|
|
422
|
+
pnpm โ pnpm req:new <slug> --run
|
|
423
|
+
yarn โ yarn req:new <slug> --run`)
|
|
405
424
|
}
|
|
406
425
|
|
|
407
426
|
export function main(argv: string[]): void {
|
|
@@ -430,9 +449,24 @@ export function main(argv: string[]): void {
|
|
|
430
449
|
console.log(` 1. cd ${r.targetRoot} && ${r.packageManager} install`)
|
|
431
450
|
console.log(` 2. codex --version # ๋ฆฌ๋ทฐ ์คํธ์ถ ์ ์ (๋ฏธ์ค์น๋ฉด review-codex --run์ด fail-closed)`)
|
|
432
451
|
console.log(` 3. req.config.json ํ์ธ(branchPrefix ๋ฑ)`)
|
|
433
|
-
console.log(` 4. ${r.packageManager
|
|
452
|
+
console.log(` 4. ${runScriptCmd(r.packageManager, 'req:new', '<slug> --run')}`)
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* CLI ๊ฒฝ๊ณ: main์ ์คํํ๋ ์ฌ์ ์กฐ๊ฑด ๋ฏธ์ถฉ์กฑ ๋ฑ ์์๋ ์คํจ(throw)๋
|
|
458
|
+
* raw ์คํํธ๋ ์ด์ค๊ฐ ์๋๋ผ ์น์ ํ ํ ์ค ๋ฉ์์ง + ์ข
๋ฃ์ฝ๋ 1๋ก ํ๋ฉดํํ๋ค.
|
|
459
|
+
* (์๋ฌ ๋ฌธ๊ตฌ ์์ฒด๊ฐ ์ด๋ฏธ ์กฐ์น ์๋ด๋ฅผ ๋ด๊ณ ์์ด ์คํํธ๋ ์ด์ค๋ ๋
ธ์ด์ฆ์ผ ๋ฟ โ REQ ํ์ UX ๊ฐ์ .)
|
|
460
|
+
* bin/commitgate.mjs ๋ฐ์ฒ์ ์ง์ ์คํ(`tsx bin/init.ts`)์ด ๊ณต์ ํ๋ ๋จ์ผ ๊ฒฝ๊ณ.
|
|
461
|
+
*/
|
|
462
|
+
export function runCli(argv: string[]): void {
|
|
463
|
+
try {
|
|
464
|
+
main(argv)
|
|
465
|
+
} catch (err) {
|
|
466
|
+
console.error(`commitgate: ${err instanceof Error ? err.message : String(err)}`)
|
|
467
|
+
process.exitCode = 1
|
|
434
468
|
}
|
|
435
469
|
}
|
|
436
470
|
|
|
437
471
|
const isMain = import.meta.url === pathToFileURL(process.argv[1] ?? '').href
|
|
438
|
-
if (isMain)
|
|
472
|
+
if (isMain) runCli(process.argv.slice(2))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commitgate",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "CommitGate โ BuilderโReviewer(ClaudeโCodex) fail-closed ์ปค๋ฐ ๊ฒ์ดํธ: ๋ฆฌ๋ทฐยท์น์ธยท์ฆ๊ฑฐ ์์ธ ์ปค๋ฐ์ ํต๊ณผ์ํค์ง ์๋ AI REQ ์ํฌํ๋ก kit (req:new/review-codex/doctor/commit)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|