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.
- package/README.en.md +341 -0
- package/README.md +120 -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)
|
|
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
|
-
์์ ๊ธฐ๋ฅ ํ๋๋ฅผ ์๋ก, ์ ์ฒด ํ๋ฆ์ ๊ทธ๋๋ก ๋ฐ์
|
|
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.
|
|
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"
|