commitgate 0.1.0 โ†’ 0.1.1

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.
Files changed (3) hide show
  1. package/README.en.md +341 -0
  2. package/README.md +120 -3
  3. package/package.json +3 -2
package/README.en.md ADDED
@@ -0,0 +1,341 @@
1
+ # CommitGate ๐Ÿšฆ
2
+
3
+ ๐ŸŒ [ํ•œ๊ตญ์–ด](./README.md) ยท **English**
4
+
5
+ **A "commit gate" that lets AI-written code be committed only after a *different* AI reviews and approves it.**
6
+
7
+ > In one line: pair a **Builder AI** with a **Reviewer AI** so that **nothing gets committed without review, approval, and evidence.**
8
+
9
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
10
+
11
+ ---
12
+
13
+ ## ๐Ÿค” What is this? (an analogy)
14
+
15
+ Think of an airport security checkpoint. No matter how much of a hurry you're in, you **can't reach the gate without passing through security.**
16
+
17
+ CommitGate works the same way. No matter how much code you produce, **`git commit` is blocked until it passes the "review โ†’ approval" gate.**
18
+
19
+ - ๐Ÿ› ๏ธ **Builder (the maker)** โ€” you, or your AI coding tool (e.g. Claude Code). Designs the requirement and writes the code.
20
+ - ๐Ÿ”Ž **Reviewer (the checker)** โ€” the **Codex CLI**. **Independently re-reviews** what the Builder made and rules pass / needs-fix.
21
+ - ๐Ÿšฆ **CommitGate** โ€” stands between them and lets **only Reviewer-approved code** be committed.
22
+
23
+ In short, instead of "build alone, commit alone," it enforces **cross-verification between the AI that built it and the AI that checked it.**
24
+
25
+ ## ๐ŸŽฏ What problem does it solve?
26
+
27
+ AI produces code **fast**, but committing it without verification is risky. CommitGate:
28
+
29
+ - โœ… Forces **every change through review.**
30
+ - โœ… Binds approval to **"the exact code that was reviewed."** (You can't swap in changes after approval โ€” it's compared like a fingerprint.)
31
+ - โœ… **Blocks by default (fail-closed)** whenever something is ambiguous or missing. "Pass only when certain" is the default, so it's safe.
32
+ - โœ… Leaves **evidence on disk** of who approved what and when.
33
+
34
+ ## ๐Ÿ”„ The flow at a glance
35
+
36
+ ```
37
+ โ‘  create ticket โ†’ โ‘ก write design โ†’ โ‘ข design review(Codex) โ†’ โ‘ฃ implement code
38
+ req:new req:review-codex
39
+
40
+ โ†’ โ‘ค gate check โ†’ โ‘ฅ code review(Codex) โ†’ โ‘ฆ commit once approved
41
+ req:doctor req:review-codex req:commit
42
+ ```
43
+
44
+ At each step, **if it doesn't pass, you can't move to the next.**
45
+
46
+ ---
47
+
48
+ ## ๐Ÿ“ฆ Prerequisites
49
+
50
+ You need these 4 things before starting. Check each in your terminal.
51
+
52
+ | What | Check command | If missing |
53
+ |---|---|---|
54
+ | **Git** (required) | `git --version` | install from [git-scm.com](https://git-scm.com) |
55
+ | **Node.js 18.17+** (required) | `node --version` | install from [nodejs.org](https://nodejs.org) |
56
+ | **Codex CLI** (for review) | `codex --version` | install OpenAI Codex CLI (without it only review is unavailable; the rest works) |
57
+ | **Package manager** | `npm --version` | `npm` ships with Node (or use `pnpm`/`yarn`) |
58
+
59
+ > ๐Ÿ’ก **Reviewer = Codex CLI.** To actually run reviews, the Codex CLI must be installed. Without it, review commands **fail safely (fail-closed)** โ€” they never silently pass.
60
+
61
+ ### ๐Ÿ”ง Install & log in to the Codex CLI (Reviewer setup)
62
+
63
+ Reviews in CommitGate are handled by the **OpenAI Codex CLI**. Three steps:
64
+
65
+ **โ‘  Install**
66
+
67
+ ```sh
68
+ # npm (all OSes)
69
+ npm install -g @openai/codex
70
+
71
+ # or macOS Homebrew
72
+ brew install codex
73
+ ```
74
+
75
+ Verify:
76
+
77
+ ```sh
78
+ codex --version # e.g. codex-cli 0.4x.x
79
+ ```
80
+
81
+ **โ‘ก Log in** โ€” pick whichever is easier
82
+
83
+ - **Option A. With a ChatGPT account (recommended, browser)**
84
+ ```sh
85
+ codex login
86
+ ```
87
+ A browser opens โ†’ sign in with your ChatGPT account โ†’ return to the terminal when done.
88
+
89
+ - **Option B. With an OpenAI API key**
90
+ ```sh
91
+ # via environment variable (simplest)
92
+ export OPENAI_API_KEY=sk-... # Windows PowerShell: $env:OPENAI_API_KEY="sk-..."
93
+
94
+ # or store the key in Codex
95
+ printenv OPENAI_API_KEY | codex login --with-api-key
96
+ ```
97
+ Create an API key at [platform.openai.com](https://platform.openai.com/api-keys).
98
+
99
+ **โ‘ข Verify login**
100
+
101
+ ```sh
102
+ codex login status # shows login status
103
+ codex doctor # full diagnosis of install, auth, and environment (explains any issue)
104
+ ```
105
+
106
+ > โœ… If `codex --version` and `codex login status` look good, the Reviewer is ready. Move on to `npx commitgate`.
107
+ > โš ๏ธ If Windows can't find the `codex` command, open a **new terminal** so PATH is reloaded (a common issue right after a global install).
108
+
109
+ ---
110
+
111
+ ## ๐Ÿš€ Install (one line)
112
+
113
+ **In your project folder** (= a git repo that has a `package.json`):
114
+
115
+ ```sh
116
+ npx commitgate
117
+ ```
118
+
119
+ What this does automatically (it **never overwrites** existing files):
120
+
121
+ 1. Copies the workflow scripts (`scripts/req/`) and schemas.
122
+ 2. Creates a `req.config.json` (settings file).
123
+ 3. Adds the `req:*` commands and required devDependencies (`tsx`, `ajv`, `cross-spawn`) to your `package.json`.
124
+ 4. Creates an `AGENTS.md` template (the rules file the Reviewer reads) if you don't have one.
125
+
126
+ After installing, fetch the newly added dependencies:
127
+
128
+ ```sh
129
+ npm install
130
+ ```
131
+
132
+ > Add `--dry-run` to preview what it would do **without changing anything**: `npx commitgate --dry-run`
133
+
134
+ ---
135
+
136
+ ## ๐Ÿค– How to use it โ€” hand it to an AI agent via a prompt (recommended)
137
+
138
+ Honestly, **nobody types `req:new โ†’ review โ†’ implement โ†’ review โ†’ commit` by hand, one at a time.** It's tedious.
139
+
140
+ The real way to use CommitGate is this: **give your AI coding agent a prompt with your "requirements" plus "use this workflow," and the agent drives the whole thing.** You only approve at **control points (commit, merge, push, etc.).**
141
+
142
+ ### What this mode assumes
143
+ - **An AI coding agent that can run shell commands** โ€” Claude Code, Cursor (agent), Codex CLI, etc. (it must be able to run terminal commands in your repo)
144
+ - **Codex CLI installed** โ€” the Reviewer role. Without it, the review step stops (fail-closed).
145
+ - **A filled-in `AGENTS.md`** โ€” write your project's rules (coding conventions, test commands, etc.) into the template that `npx commitgate` created; it improves review quality.
146
+
147
+ ### Three steps and you're done
148
+ 1. Copy the **prompt template** below and fill the `[Requirements]` block at the bottom with your request.
149
+ 2. Paste the whole thing **into your AI agent's chat.**
150
+ 3. The agent's **first reply reports only the REQ number, branch, phase plan, and control points.** After that it asks you **only at control points** โ€” everything else (implementation, tests, Codex review, applying NEEDS_FIX, re-review) is automatic.
151
+
152
+ ### ๐Ÿ“‹ Copy-paste prompt template
153
+
154
+ ````text
155
+ Do NOT handle this as a normal implementation task. You MUST use the CommitGate (AI REQ workflow) installed in this project.
156
+
157
+ Issue a new REQ ticket for the [Requirements] below and drive it all the way through:
158
+ req:new โ†’ write design docs (00/01/02) โ†’ req:review-codex (design review)
159
+ โ†’ implement phase + tests โ†’ req:doctor (gate) โ†’ req:review-codex (phase review) โ†’ req:commit
160
+
161
+ [Do automatically]
162
+ - Within the approved phase scope, do implementation, tests, keeping codex-request consistent, applying NEEDS_FIX, and re-review (resume) automatically. Do not ask me every time.
163
+ - If Codex returns NEEDS_FIX, apply the feedback and re-run the review until approved (max 3 rounds per phase).
164
+ - Only what is `git add`ed is reviewed. NEVER `git add` state.json or responses/ (the tool manages those).
165
+
166
+ [Control points โ€” stop and ask me ONLY here]
167
+ - Right before `req:commit --run` (the actual commit / HIGH impact)
168
+ - Right before merging to main or `git push`
169
+ - Destructive operations such as reset, clean, force push
170
+ - When a design-scope change or a feature not in [Requirements] is needed
171
+ - When Codex review exceeds 3 rounds without approval, or the judgment is unclear
172
+ - When a prerequisite is missing (not a git repo, no Codex CLI / Node / package manager) and you must fail-closed
173
+
174
+ [First reply] Report only the REQ number, branch, phase plan, and control points. After that, stop only at control points.
175
+
176
+ [Requirements]
177
+ - What: (e.g.) Add a user-profile edit API
178
+ - Why: (e.g.) Only the name is editable today โ€” email and bio should be editable too
179
+ - Constraints: (e.g.) Reuse the existing auth middleware, validate email format, no new external libraries
180
+ - Done when: (e.g.) PATCH /profile works + unit tests pass + existing tests unbroken
181
+ ````
182
+
183
+ > The `[Requirements]` example above is **just a sample.** Just replace the 4 lines (What / Why / Constraints / Done when) with your own. If the request is large, it's split into multiple phases, each going through its own review and gate.
184
+
185
+ ### Example of the agent's first reply
186
+
187
+ ```
188
+ Issued REQ-2026-002 ยท branch feat/req-2026-002-profile-edit-api
189
+ Phase plan:
190
+ - phase-1: PATCH /profile handler + validation
191
+ - phase-2: unit tests + regression
192
+ Control points: proceed per phase after design approval / confirm before req:commit --run / push needs separate approval
193
+ โ†’ Starting with the design docs. Once the design review passes, I'll move to implementation.
194
+ ```
195
+
196
+ Now you just **wait** until a control-point notification arrives. When it asks "commit as-is?" right before committing, you confirm.
197
+
198
+ ---
199
+
200
+ ## ๐Ÿ”ง Appendix: what the workflow actually runs under the hood (manual steps)
201
+
202
+ > With the prompt approach above, you **don't need to type the commands below** โ€” the agent runs them for you.
203
+ > These are the actual commands the workflow runs internally. Refer to them only when you need to **understand the behavior, debug, or run steps manually.**
204
+
205
+ Let's walk the whole flow with one small feature as an example. (Commands use `npm`; arguments after `npm run` go after `--`. With `pnpm` you can drop the `--`, e.g. `pnpm req:new my-feature --run`.)
206
+
207
+ ### Step 1 โ€” create a work ticket
208
+
209
+ ```sh
210
+ npm run req:new -- my-feature --run
211
+ ```
212
+
213
+ - A new branch (`feat/req-...`) is created, and three design docs appear under `workflow/REQ-2026-001/`.
214
+ - The output shows a **ticket number** (e.g. `REQ-2026-001`). Later commands use just the number โ†’ `2026-001`
215
+
216
+ ### Step 2 โ€” write the design docs
217
+
218
+ Fill in the three files under `workflow/REQ-2026-001/`:
219
+
220
+ - `00-requirement.md` โ€” **what** to build and why
221
+ - `01-design.md` โ€” **how** to build it
222
+ - `02-plan.md` โ€” in what **order/phases** to proceed
223
+
224
+ ### Step 3 โ€” get a design review (Codex)
225
+
226
+ Stage your design (i.e. `git add`):
227
+
228
+ ```sh
229
+ git add workflow/REQ-2026-001/00-requirement.md workflow/REQ-2026-001/01-design.md workflow/REQ-2026-001/02-plan.md
230
+ npm run req:review-codex -- 2026-001 --kind design --run
231
+ ```
232
+
233
+ - Codex reads the design and returns **approval** or **NEEDS_FIX**.
234
+ - If NEEDS_FIX, apply the feedback, then **`git add` again โ†’ re-run the command.** Repeat until approved.
235
+
236
+ ### Step 4 โ€” implement code + tests
237
+
238
+ Once the design is approved, write the actual code and tests.
239
+
240
+ ### Step 5 โ€” gate check
241
+
242
+ Stage your changes and preview the gate status:
243
+
244
+ ```sh
245
+ git add <files-you-changed>
246
+ npm run req:doctor -- 2026-001
247
+ ```
248
+
249
+ - It checks several things (is the design approval valid, does the staged code match the approved code, is the working tree clean, etc.) and shows **PASS/FAIL.**
250
+
251
+ > โš ๏ธ **Important:** `git add` **only your own code/docs.** Do **not** stage workflow-internal files like `state.json` or `responses/` (the tool manages them; staging them by mistake gets blocked at the commit step).
252
+
253
+ ### Step 6 โ€” get a code review (Codex)
254
+
255
+ ```sh
256
+ npm run req:review-codex -- 2026-001 --kind phase --run
257
+ ```
258
+
259
+ - Codex reviews the **implementation code.** Again, apply feedback โ†’ re-run until approved.
260
+ - Once approved, `commit_allowed=true` and the commit opens.
261
+
262
+ ### Step 7 โ€” commit
263
+
264
+ ```sh
265
+ npm run req:commit -- 2026-001 --run -m "feat: implement my-feature"
266
+ ```
267
+
268
+ - After passing the gate (doctor) one final time, it makes a **code commit + an evidence commit.**
269
+ - If it isn't approved, or the code changed after approval, it **stops here.** (That's the heart of CommitGate.)
270
+
271
+ ๐ŸŽ‰ Done! Your code is now committed safely with review, approval, and evidence all recorded.
272
+
273
+ ---
274
+
275
+ ## ๐Ÿ“‹ Command cheat sheet
276
+
277
+ | Command | What it does |
278
+ |---|---|
279
+ | `npx commitgate` | Install (scaffold) CommitGate into your project |
280
+ | `req:new <name> --run` | Create a new ticket + branch + design docs |
281
+ | `req:review-codex <num> --kind design --run` | **Design** review (Codex) |
282
+ | `req:review-codex <num> --kind phase --run` | **Implementation** review (Codex) |
283
+ | `req:doctor <num>` | Gate check (shows pass/fail) |
284
+ | `req:commit <num> --run -m "message"` | Commit approved code (+ evidence) |
285
+
286
+ > Instead of `-m "message"`, multi-line messages can be read from a file with `--message-file message.txt`.
287
+
288
+ ---
289
+
290
+ ## โš™๏ธ Configuration (`req.config.json`, optional)
291
+
292
+ You can tweak behavior via `req.config.json` at the project root. **Without the file it works on sensible defaults**, so you can ignore it at first.
293
+
294
+ | Key | Default | Meaning |
295
+ |---|---|---|
296
+ | `branchPrefix` | `"feat/req-"` | Prefix for newly created branch names |
297
+ | `ticketRoot` | `"workflow"` | Where ticket folders live |
298
+ | `packageManager` | auto-detected | `npm` / `pnpm` / `yarn` |
299
+ | `designDocs` | `00-/01-/02-*.md` | Filenames of the three design docs |
300
+
301
+ Invalid values (e.g. an empty `branchPrefix`, a path that escapes the folder) are **rejected safely.**
302
+
303
+ ---
304
+
305
+ ## โ“ FAQ / troubleshooting
306
+
307
+ **Q. It says the `codex` command is not found.**
308
+ A. The Reviewer (Codex CLI) must be installed for reviews to run. Before it's installed, review commands don't "silently pass" โ€” they **fail clearly** (that's the intended fail-closed behavior).
309
+
310
+ **Q. I get an error like "staged tree != approved" at the commit step.**
311
+ A. It means **the approved code and the code you currently staged (`git add`) differ.** If you changed code after approval, redo Step 6 (implementation review) to re-approve. (This safeguard prevents approval swapping.)
312
+
313
+ **Q. I get a "non-code staged not allowed (state/responses)" error.**
314
+ A. You `git add`ed `state.json` or `responses/`. **Don't stage those** (the tool manages them); stage only your own code/docs.
315
+
316
+ **Q. Does running `npx commitgate` twice overwrite things?**
317
+ A. No. **Existing files are skipped** (idempotent). To force overwrite, add `--force`.
318
+
319
+ **Q. On Windows my commit message newlines look wrong.**
320
+ A. For multi-line messages, use `--message-file file.txt` instead of `-m`.
321
+
322
+ ---
323
+
324
+ ## ๐Ÿ”’ How is "safety" guaranteed? (fail-closed)
325
+
326
+ CommitGate's principle is **"pass only when definitely approved; block on the slightest doubt."**
327
+
328
+ - Design docs missing or malformed โ†’ treated as not approved
329
+ - Codex not installed / review failed โ†’ not a pass, fails clearly
330
+ - The approved code fingerprint differs from the current code โ†’ commit rejected
331
+ - The working tree is dirty (unreviewed changes mixed in) โ†’ review/commit rejected
332
+
333
+ In other words, **blocking is the default and passing is the exception**, minimizing the chance of unverified code slipping through.
334
+
335
+ ---
336
+
337
+ ## ๐Ÿ“„ License
338
+
339
+ [MIT](./LICENSE) ยฉ 2026 sol5288
340
+
341
+ > This workflow was extracted as a standalone package from the REQ-2026-017 portability kit of `palm-kiosk-app`, and was validated by **reviewing and approving itself through this very workflow (dogfood).**
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # CommitGate ๐Ÿšฆ
2
2
 
3
+ ๐ŸŒ **ํ•œ๊ตญ์–ด** ยท [English](./README.en.md)
4
+
3
5
  **AI๊ฐ€ ์ง  ์ฝ”๋“œ๋ฅผ, ๋‹ค๋ฅธ AI๊ฐ€ ๋ฆฌ๋ทฐํ•˜๊ณ  ์Šน์ธํ•ด์•ผ๋งŒ ์ปค๋ฐ‹๋˜๊ฒŒ ํ•˜๋Š” "์ปค๋ฐ‹ ๊ด€๋ฌธ(gate)".**
4
6
 
5
7
  > ํ•œ ์ค„ ์š”์•ฝ: **๋งŒ๋“œ๋Š” AI(Builder)** ์™€ **๊ฒ€์‚ฌํ•˜๋Š” AI(Reviewer)** ๋ฅผ ์ง์ง€์–ด, **๋ฆฌ๋ทฐยท์Šน์ธยท์ฆ๊ฑฐ ์—†์ด๋Š” ์ปค๋ฐ‹์ด ํ†ต๊ณผํ•˜์ง€ ๋ชปํ•˜๊ฒŒ** ๋ง‰์•„์ค๋‹ˆ๋‹ค.
@@ -56,6 +58,54 @@ AI๋Š” ์ฝ”๋“œ๋ฅผ **๋น ๋ฅด๊ฒŒ** ๋งŒ๋“ค์ง€๋งŒ, ๊ฒ€์ฆ ์—†์ด ๊ทธ๋Œ€๋กœ ์ปค๋ฐ‹๋˜๋ฉด
56
58
 
57
59
  > ๐Ÿ’ก **Reviewer = Codex CLI** ์ž…๋‹ˆ๋‹ค. ๋ฆฌ๋ทฐ๋ฅผ ์‹ค์ œ๋กœ ๋Œ๋ฆฌ๋ ค๋ฉด Codex CLI๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์–ด์•ผ ํ•ด์š”. ์—†์œผ๋ฉด ๋ฆฌ๋ทฐ ๋ช…๋ น์ด "์•ˆ์ „ํ•˜๊ฒŒ ์‹คํŒจ(fail-closed)"ํ•ฉ๋‹ˆ๋‹ค โ€” ์กฐ์šฉํžˆ ํ†ต๊ณผ๋˜๋Š” ์ผ์€ ์—†์Šต๋‹ˆ๋‹ค.
58
60
 
61
+ ### ๐Ÿ”ง Codex CLI ์„ค์น˜ & ๋กœ๊ทธ์ธ (Reviewer ์ค€๋น„)
62
+
63
+ CommitGate์˜ ๋ฆฌ๋ทฐ๋Š” **OpenAI Codex CLI**๊ฐ€ ๋‹ด๋‹นํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜ 3๋‹จ๊ณ„๋ฉด ๋๋‚ฉ๋‹ˆ๋‹ค.
64
+
65
+ **โ‘  ์„ค์น˜**
66
+
67
+ ```sh
68
+ # npm (๋ชจ๋“  OS)
69
+ npm install -g @openai/codex
70
+
71
+ # ๋˜๋Š” macOS Homebrew
72
+ brew install codex
73
+ ```
74
+
75
+ ์„ค์น˜ ํ™•์ธ:
76
+
77
+ ```sh
78
+ codex --version # ์˜ˆ: codex-cli 0.4x.x
79
+ ```
80
+
81
+ **โ‘ก ๋กœ๊ทธ์ธ** โ€” ๋‘˜ ์ค‘ ํŽธํ•œ ๋ฐฉ๋ฒ• ํ•˜๋‚˜
82
+
83
+ - **๋ฐฉ๋ฒ• A. ChatGPT ๊ณ„์ •์œผ๋กœ (๊ถŒ์žฅ, ๋ธŒ๋ผ์šฐ์ €)**
84
+ ```sh
85
+ codex login
86
+ ```
87
+ ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์—ด๋ฆฌ๋ฉด ChatGPT ๊ณ„์ •์œผ๋กœ ๋กœ๊ทธ์ธ โ†’ ํ„ฐ๋ฏธ๋„๋กœ ๋Œ์•„์˜ค๋ฉด ์™„๋ฃŒ.
88
+
89
+ - **๋ฐฉ๋ฒ• B. OpenAI API ํ‚ค๋กœ**
90
+ ```sh
91
+ # ํ™˜๊ฒฝ๋ณ€์ˆ˜๋กœ (๊ฐ€์žฅ ๊ฐ„๋‹จ)
92
+ export OPENAI_API_KEY=sk-... # Windows PowerShell: $env:OPENAI_API_KEY="sk-..."
93
+
94
+ # ๋˜๋Š” ํ‚ค๋ฅผ Codex์— ์ €์žฅ
95
+ printenv OPENAI_API_KEY | codex login --with-api-key
96
+ ```
97
+ API ํ‚ค๋Š” [platform.openai.com](https://platform.openai.com/api-keys) ์—์„œ ๋ฐœ๊ธ‰ํ•ฉ๋‹ˆ๋‹ค.
98
+
99
+ **โ‘ข ๋กœ๊ทธ์ธ ํ™•์ธ**
100
+
101
+ ```sh
102
+ codex login status # ๋กœ๊ทธ์ธ ์ƒํƒœ ํ‘œ์‹œ
103
+ codex doctor # ์„ค์น˜ยท์ธ์ฆยทํ™˜๊ฒฝ ์ข…ํ•ฉ ์ง„๋‹จ(๋ฌธ์ œ ์žˆ์œผ๋ฉด ์›์ธ ์•ˆ๋‚ด)
104
+ ```
105
+
106
+ > โœ… `codex --version` ๊ณผ `codex login status` ๊ฐ€ ์ •์ƒ์ด๋ฉด ๋ฆฌ๋ทฐ ์ค€๋น„ ๋. ์ด์ œ `npx commitgate` ๋กœ ๋„˜์–ด๊ฐ€์„ธ์š”.
107
+ > โš ๏ธ Windows์—์„œ `codex` ๋ช…๋ น์„ ๋ชป ์ฐพ์œผ๋ฉด **์ƒˆ ํ„ฐ๋ฏธ๋„**์„ ์—ด์–ด PATH๋ฅผ ์ƒˆ๋กœ ์ฝ๊ฒŒ ํ•˜์„ธ์š”(์ „์—ญ ์„ค์น˜ ์งํ›„ ํ”ํ•œ ๋ฌธ์ œ).
108
+
59
109
  ---
60
110
 
61
111
  ## ๐Ÿš€ ์„ค์น˜ (๋”ฑ ํ•œ ์ค„)
@@ -70,7 +120,7 @@ npx commitgate
70
120
 
71
121
  1. ์›Œํฌํ”Œ๋กœ ์Šคํฌ๋ฆฝํŠธ(`scripts/req/`)์™€ ์Šคํ‚ค๋งˆ๋ฅผ ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.
72
122
  2. `req.config.json`(์„ค์ • ํŒŒ์ผ)์„ ๋งŒ๋“ค์–ด ๋‘ก๋‹ˆ๋‹ค.
73
- 3. `package.json`์— `req:*` ๋ช…๋ น๋“ค๊ณผ ํ•„์š”ํ•œ devDependencies(`tsx`, `ajv`)๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
123
+ 3. `package.json`์— `req:*` ๋ช…๋ น๋“ค๊ณผ ํ•„์š”ํ•œ devDependencies(`tsx`, `ajv`, `cross-spawn`)๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
74
124
  4. `AGENTS.md`(Reviewer๊ฐ€ ์ฝ๋Š” ๊ทœ์น™ ํŒŒ์ผ)๊ฐ€ ์—†์œผ๋ฉด ํ…œํ”Œ๋ฆฟ์„ ๋งŒ๋“ค์–ด ์ค๋‹ˆ๋‹ค.
75
125
 
76
126
  ์„ค์น˜ ํ›„, ๋ฐฉ๊ธˆ ์ถ”๊ฐ€๋œ ์˜์กด์„ฑ์„ ๋ฐ›์Šต๋‹ˆ๋‹ค:
@@ -83,9 +133,76 @@ npm install
83
133
 
84
134
  ---
85
135
 
86
- ## ๐Ÿ‘ฃ ์ฒ˜์Œ๋ถ€ํ„ฐ ๋๊นŒ์ง€ ๋”ฐ๋ผํ•˜๊ธฐ
136
+ ## ๐Ÿค– ์‚ฌ์šฉ๋ฒ• โ€” AI ์—์ด์ „ํŠธ์—๊ฒŒ ํ”„๋กฌํ”„ํŠธ๋กœ ๋งก๊ธฐ๊ธฐ (๊ถŒ์žฅ)
137
+
138
+ ์†”์งํžˆ, `req:new โ†’ ๋ฆฌ๋ทฐ โ†’ ๊ตฌํ˜„ โ†’ ๋ฆฌ๋ทฐ โ†’ ์ปค๋ฐ‹`์„ **์†์œผ๋กœ ํ•˜๋‚˜์”ฉ ์น˜๋Š” ์‚ฌ๋žŒ์€ ์—†์Šต๋‹ˆ๋‹ค.** ํ”ผ๊ณคํ•˜๋‹ˆ๊นŒ์š”.
139
+
140
+ CommitGate์˜ ์ง„์งœ ์‚ฌ์šฉ๋ฒ•์€ ์ด๊ฒ๋‹ˆ๋‹ค: **๋‹น์‹ ์˜ AI ์ฝ”๋”ฉ ์—์ด์ „ํŠธ์—๊ฒŒ "์š”๊ตฌ์‚ฌํ•ญ"๊ณผ "์ด ์›Œํฌํ”Œ๋กœ๋ฅผ ์“ฐ๋ผ"๋Š” ํ”„๋กฌํ”„ํŠธ๋ฅผ ๋˜์ง€๋ฉด, ์—์ด์ „ํŠธ๊ฐ€ ์•Œ์•„์„œ ์ „ ๊ณผ์ •์„ ๊ตด๋ฆฝ๋‹ˆ๋‹ค.** ๋‹น์‹ ์€ **ํ†ต์ œ์ (์ปค๋ฐ‹ยท๋จธ์ง€ยทํ‘ธ์‹œ ๋“ฑ)์—์„œ๋งŒ** ์Šน์ธํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.
141
+
142
+ ### ์ด ๋ฐฉ์‹์˜ ์ „์ œ
143
+ - **์…ธ ๋ช…๋ น์„ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” AI ์ฝ”๋”ฉ ์—์ด์ „ํŠธ** โ€” Claude Code, Cursor(agent), Codex CLI ๋“ฑ. (๋‹น์‹ ์˜ ์ €์žฅ์†Œ์—์„œ ํ„ฐ๋ฏธ๋„ ๋ช…๋ น์„ ์ง์ ‘ ๋Œ๋ฆด ์ˆ˜ ์žˆ์–ด์•ผ ํ•จ)
144
+ - **Codex CLI ์„ค์น˜** โ€” ๋ฆฌ๋ทฐ์–ด(Reviewer) ์—ญํ• . ์—†์œผ๋ฉด ๋ฆฌ๋ทฐ ๋‹จ๊ณ„๊ฐ€ fail-closed๋กœ ๋ฉˆ์ถฅ๋‹ˆ๋‹ค.
145
+ - **`AGENTS.md` ์ฑ„์šฐ๊ธฐ** โ€” `npx commitgate`๊ฐ€ ๋งŒ๋“  ํ…œํ”Œ๋ฆฟ์— ๋‹น์‹  ํ”„๋กœ์ ํŠธ์˜ ๊ทœ์น™(์ฝ”๋”ฉ ์ปจ๋ฒค์…˜ยทํ…Œ์ŠคํŠธ ๋ช…๋ น ๋“ฑ)์„ ์ ์–ด๋‘๋ฉด ๋ฆฌ๋ทฐ ํ’ˆ์งˆ์ด ์˜ฌ๋ผ๊ฐ‘๋‹ˆ๋‹ค.
146
+
147
+ ### 3๋‹จ๊ณ„๋ฉด ๋
148
+ 1. ์•„๋ž˜ **ํ”„๋กฌํ”„ํŠธ ํ…œํ”Œ๋ฆฟ**์„ ๋ณต์‚ฌํ•˜๊ณ , ๋งจ ์•„๋ž˜ `[์š”๊ตฌ์‚ฌํ•ญ]` ์นธ์„ ๋‹น์‹  ์š”๊ตฌ๋กœ ์ฑ„์›๋‹ˆ๋‹ค.
149
+ 2. ์ „์ฒด๋ฅผ **AI ์—์ด์ „ํŠธ ๋Œ€ํ™”์ฐฝ์— ๊ทธ๋Œ€๋กœ ๋ถ™์—ฌ๋„ฃ์Šต๋‹ˆ๋‹ค.**
150
+ 3. ์—์ด์ „ํŠธ๊ฐ€ **์ฒซ ์‘๋‹ต์œผ๋กœ REQ ๋ฒˆํ˜ธยท๋ธŒ๋žœ์น˜ยทphase ๊ณ„ํšยทํ†ต์ œ์ **๋งŒ ๋ณด๊ณ ํ•ฉ๋‹ˆ๋‹ค. ์ดํ›„์—” **ํ†ต์ œ์ ์—์„œ๋งŒ** ๋‹น์‹ ์—๊ฒŒ ํ™•์ธ์„ ๋ฐ›์Šต๋‹ˆ๋‹ค โ€” ๋‚˜๋จธ์ง€(๊ตฌํ˜„ยทํ…Œ์ŠคํŠธยทCodex ๋ฆฌ๋ทฐยทNEEDS_FIX ๋ฐ˜์˜ยท์žฌ๋ฆฌ๋ทฐ)๋Š” ์ž๋™์ž…๋‹ˆ๋‹ค.
151
+
152
+ ### ๐Ÿ“‹ ๋ณต์‚ฌํ•ด์„œ ์“ฐ๋Š” ํ”„๋กฌํ”„ํŠธ ํ…œํ”Œ๋ฆฟ
153
+
154
+ ````text
155
+ ์ด ์š”์ฒญ์€ ์ผ๋ฐ˜ ๊ตฌํ˜„์œผ๋กœ ์ฒ˜๋ฆฌํ•˜์ง€ ๋ง๊ณ , ๋ฐ˜๋“œ์‹œ ์ด ํ”„๋กœ์ ํŠธ์— ์„ค์น˜๋œ CommitGate(AI REQ workflow)๋ฅผ ์‚ฌ์šฉํ•ด๋ผ.
156
+
157
+ ์•„๋ž˜ [์š”๊ตฌ์‚ฌํ•ญ]์œผ๋กœ ์ƒˆ REQ ํ‹ฐ์ผ“์„ ๋ฐœํ–‰ํ•˜๊ณ  ๋‹ค์Œ ํ๋ฆ„์„ ๋๊นŒ์ง€ ํƒœ์›Œ๋ผ:
158
+ req:new โ†’ ์„ค๊ณ„๋ฌธ์„œ(00/01/02) ์ž‘์„ฑ โ†’ req:review-codex(design ๋ฆฌ๋ทฐ)
159
+ โ†’ phase ๊ตฌํ˜„ยทํ…Œ์ŠคํŠธ โ†’ req:doctor(๊ฒŒ์ดํŠธ) โ†’ req:review-codex(phase ๋ฆฌ๋ทฐ) โ†’ req:commit
160
+
161
+ [์ž๋™์œผ๋กœ ์ง„ํ–‰ํ•  ๊ฒƒ]
162
+ - ์Šน์ธ๋œ phase ๋ฒ”์œ„ ์•ˆ์—์„œ ๊ตฌํ˜„ยทํ…Œ์ŠคํŠธยทcodex-request ์ •ํ•ฉยทNEEDS_FIX ๋ฐ˜์˜ยท์žฌ๋ฆฌ๋ทฐ(resume)๋Š” ์ž๋™์œผ๋กœ ์ง„ํ–‰ํ•ด๋ผ. ๋งค๋ฒˆ ํ™•์ธ๋ฐ›์ง€ ๋งˆ๋ผ.
163
+ - Codex๊ฐ€ NEEDS_FIX๋ฅผ ์ฃผ๋ฉด ์ง€์ ์„ ๋ฐ˜์˜ํ•˜๊ณ  ์žฌ๋ฆฌ๋ทฐ๋ฅผ ๋Œ๋ ค ์Šน์ธ๊นŒ์ง€ ๋ฐ˜๋ณตํ•ด๋ผ(phase๋‹น ์ตœ๋Œ€ 3๋ผ์šด๋“œ).
164
+ - ๋ฆฌ๋ทฐ ๋Œ€์ƒ์€ git add ํ•œ ๊ฒƒ๋งŒ์ด๋‹ค. state.jsonยทresponses/ ๋Š” ์ ˆ๋Œ€ git add ํ•˜์ง€ ๋งˆ๋ผ(๋„๊ตฌ๊ฐ€ ๊ด€๋ฆฌํ•œ๋‹ค).
165
+
166
+ [๋ฉˆ์ถฐ์„œ ์‚ฌ๋žŒ ํ™•์ธ์„ ๋ฐ›์„ ํ†ต์ œ์  โ€” ์—ฌ๊ธฐ์„œ๋งŒ ๋ฉˆ์ถฐ๋ผ]
167
+ - req:commit --run ์ง์ „ (์‹ค์ œ ์ปค๋ฐ‹ / HIGH ์˜ํ–ฅ)
168
+ - main ๋ณ‘ํ•ฉ ๋˜๋Š” git push ์ง์ „
169
+ - resetยทcleanยทforce push ๋“ฑ destructive ์ž‘์—…
170
+ - ์„ค๊ณ„ ๋ฒ”์œ„ ๋ณ€๊ฒฝ ๋˜๋Š” [์š”๊ตฌ์‚ฌํ•ญ]์— ์—†๋Š” ๊ธฐ๋Šฅ ์ถ”๊ฐ€๊ฐ€ ํ•„์š”ํ•  ๋•Œ
171
+ - Codex ๋ฆฌ๋ทฐ๊ฐ€ 3๋ผ์šด๋“œ๋ฅผ ๋„˜๊ฒจ๋„ ์Šน์ธ ์•ˆ ๋˜๊ฑฐ๋‚˜ ํŒ๋‹จ์ด ๋ถˆ๋ช…ํ™•ํ•  ๋•Œ
172
+ - git ์ €์žฅ์†Œ๊ฐ€ ์•„๋‹ˆ๊ฑฐ๋‚˜ Codex CLIยทNodeยทํŒจํ‚ค์ง€๋งค๋‹ˆ์ € ์ „์ œ๊ฐ€ ์—†์–ด fail-closed ํ•ด์•ผ ํ•  ๋•Œ
173
+
174
+ [์ฒซ ์‘๋‹ต] REQ ๋ฒˆํ˜ธ, ๋ธŒ๋žœ์น˜, phase ๊ณ„ํš, ํ†ต์ œ์ ๋งŒ ๊ฐ„๋‹จํžˆ ๋ณด๊ณ ํ•ด๋ผ. ๊ทธ ๋’ค๋ถ€ํ„ฐ๋Š” ํ†ต์ œ์ ์—์„œ๋งŒ ๋ฉˆ์ถฐ๋ผ.
175
+
176
+ [์š”๊ตฌ์‚ฌํ•ญ]
177
+ - ๋ฌด์—‡์„: (์˜ˆ) ์‚ฌ์šฉ์ž ํ”„๋กœํ•„ ํŽธ์ง‘ API ์ถ”๊ฐ€
178
+ - ์™œ: (์˜ˆ) ์ง€๊ธˆ์€ ์ด๋ฆ„๋งŒ ์ˆ˜์ • ๊ฐ€๋Šฅ โ€” ์ด๋ฉ”์ผยท์†Œ๊ฐœ๋„ ํŽธ์ง‘ ํ•„์š”
179
+ - ์ œ์•ฝ: (์˜ˆ) ๊ธฐ์กด ์ธ์ฆ ๋ฏธ๋“ค์›จ์–ด ์žฌ์‚ฌ์šฉ, ์ด๋ฉ”์ผ ํ˜•์‹ ๊ฒ€์ฆ, ์™ธ๋ถ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ถ”๊ฐ€ ๊ธˆ์ง€
180
+ - ์™„๋ฃŒ ๊ธฐ์ค€: (์˜ˆ) PATCH /profile ๋™์ž‘ + ๋‹จ์œ„ ํ…Œ์ŠคํŠธ ํ†ต๊ณผ + ๊ธฐ์กด ํ…Œ์ŠคํŠธ ๋ฌด์†์ƒ
181
+ ````
182
+
183
+ > ์œ„ `[์š”๊ตฌ์‚ฌํ•ญ]` ์˜ˆ์‹œ๋Š” **์ƒ˜ํ”Œ์ผ ๋ฟ**์ž…๋‹ˆ๋‹ค. 4์ค„(๋ฌด์—‡์„/์™œ/์ œ์•ฝ/์™„๋ฃŒ ๊ธฐ์ค€)์„ ๋‹น์‹  ์š”๊ตฌ๋กœ ๋ฐ”๊พธ๊ธฐ๋งŒ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์š”๊ตฌ๊ฐ€ ํฌ๋ฉด phase๊ฐ€ ์—ฌ๋Ÿฌ ๊ฐœ๋กœ ์ชผ๊ฐœ์ง€๊ณ , ๊ฐ phase๋งˆ๋‹ค ๋ฆฌ๋ทฐยท๊ฒŒ์ดํŠธ๋ฅผ ๊ฑฐ์นฉ๋‹ˆ๋‹ค.
184
+
185
+ ### ์—์ด์ „ํŠธ๊ฐ€ ๋ณด๊ณ ํ•˜๋Š” ์ฒซ ์‘๋‹ต ์˜ˆ์‹œ
186
+
187
+ ```
188
+ REQ-2026-002 ๋ฐœํ–‰ ยท ๋ธŒ๋žœ์น˜ feat/req-2026-002-profile-edit-api
189
+ phase ๊ณ„ํš:
190
+ - phase-1: PATCH /profile ํ•ธ๋“ค๋Ÿฌ + ์œ ํšจ์„ฑ ๊ฒ€์ฆ
191
+ - phase-2: ๋‹จ์œ„ ํ…Œ์ŠคํŠธ + ํšŒ๊ท€
192
+ ํ†ต์ œ์ : design ์Šน์ธ ํ›„ phase๋ณ„ ์ง„ํ–‰ / req:commit --run ์ง์ „ ํ™•์ธ / push๋Š” ๋ณ„๋„ ์Šน์ธ
193
+ โ†’ ์„ค๊ณ„๋ฌธ์„œ ์ž‘์„ฑ๋ถ€ํ„ฐ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค. design ๋ฆฌ๋ทฐ ํ†ต๊ณผํ•˜๋ฉด ๊ตฌํ˜„์œผ๋กœ ๋„˜์–ด๊ฐ‘๋‹ˆ๋‹ค.
194
+ ```
195
+
196
+ ์ด์ œ ๋‹น์‹ ์€ ํ†ต์ œ์  ์•Œ๋ฆผ์ด ์˜ฌ ๋•Œ๊นŒ์ง€ **๊ธฐ๋‹ค๋ฆฌ๊ธฐ๋งŒ** ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์ปค๋ฐ‹ ์ง์ „์— "์ด๋Œ€๋กœ ์ปค๋ฐ‹ํ• ๊นŒ์š”?" ๋ฌผ์œผ๋ฉด ํ™•์ธํ•ด ์ฃผ๋ฉด ๋˜๊ณ ์š”.
197
+
198
+ ---
199
+
200
+ ## ๐Ÿ”ง ๋ถ€๋ก: ์›Œํฌํ”Œ๋กœ๊ฐ€ ๋‚ด๋ถ€์—์„œ ์‹ค์ œ๋กœ ํ•˜๋Š” ์ผ (์ˆ˜๋™ ๋‹จ๊ณ„)
201
+
202
+ > ์œ„ ํ”„๋กฌํ”„ํŠธ ๋ฐฉ์‹์ด๋ฉด ์•„๋ž˜ ๋ช…๋ น์„ **์ง์ ‘ ์น  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค** โ€” ์—์ด์ „ํŠธ๊ฐ€ ์•Œ์•„์„œ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.
203
+ > ์•„๋ž˜๋Š” ์›Œํฌํ”Œ๋กœ๊ฐ€ ๋‚ด๋ถ€์—์„œ ๋Œ๋ฆฌ๋Š” ์‹ค์ œ ๋ช…๋ น๋“ค์ž…๋‹ˆ๋‹ค. **๋™์ž‘ ์ดํ•ดยท๋””๋ฒ„๊น…ยท์ˆ˜๋™ ์‹คํ–‰**์ด ํ•„์š”ํ•  ๋•Œ๋งŒ ์ฐธ๊ณ ํ•˜์„ธ์š”.
87
204
 
88
- ์ž‘์€ ๊ธฐ๋Šฅ ํ•˜๋‚˜๋ฅผ ์˜ˆ๋กœ, ์ „์ฒด ํ๋ฆ„์„ ๊ทธ๋Œ€๋กœ ๋ฐŸ์•„ ๋ด…์‹œ๋‹ค. (๋ช…๋ น์€ `npm` ๊ธฐ์ค€์ด๋ฉฐ, `npm run` ๋’ค ์ธ์ž๋Š” `--` ๋‹ค์Œ์— ์”๋‹ˆ๋‹ค. `pnpm`์„ ์“ฐ๋ฉด `pnpm req:new my-feature --run` ์ฒ˜๋Ÿผ `--` ์—†์ด ๋ฉ๋‹ˆ๋‹ค.)
205
+ ์ž‘์€ ๊ธฐ๋Šฅ ํ•˜๋‚˜๋ฅผ ์˜ˆ๋กœ, ์ „์ฒด ํ๋ฆ„์„ ๊ทธ๋Œ€๋กœ ๋ฐŸ์•„ ๋ด…๋‹ˆ๋‹ค. (๋ช…๋ น์€ `npm` ๊ธฐ์ค€์ด๋ฉฐ, `npm run` ๋’ค ์ธ์ž๋Š” `--` ๋‹ค์Œ์— ์”๋‹ˆ๋‹ค. `pnpm`์„ ์“ฐ๋ฉด `pnpm req:new my-feature --run` ์ฒ˜๋Ÿผ `--` ์—†์ด ๋ฉ๋‹ˆ๋‹ค.)
89
206
 
90
207
  ### 1๋‹จ๊ณ„ โ€” ์ž‘์—… ํ‹ฐ์ผ“ ๋งŒ๋“ค๊ธฐ
91
208
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commitgate",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
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",
@@ -43,7 +43,8 @@
43
43
  "bin",
44
44
  "AGENTS.template.md",
45
45
  "req.config.json.sample",
46
- "README.md"
46
+ "README.md",
47
+ "README.en.md"
47
48
  ],
48
49
  "engines": {
49
50
  "node": ">=18.17"