commitgate 0.2.1 โ 0.3.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/AGENTS.template.md +85 -48
- package/README.en.md +332 -238
- package/README.md +332 -238
- package/bin/commitgate.mjs +12 -4
- package/bin/init.ts +61 -12
- package/bin/uninstall.ts +551 -0
- 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.en.md
CHANGED
|
@@ -1,238 +1,332 @@
|
|
|
1
|
-
# CommitGate
|
|
2
|
-
|
|
3
|
-
๐ [ํ๊ตญ์ด](./README.md) ยท **English**
|
|
4
|
-
|
|
5
|
-
**A commit gate that blocks AI-generated code from being committed until Codex has reviewed and approved it.**
|
|
6
|
-
|
|
7
|
-
AI coding agents can move quickly, but unreviewed changes should not go straight into your history. CommitGate wraps each change in a REQ ticket and only allows the staged tree approved by Codex to be committed. If the code changes after approval, or if evidence is missing, it fails closed.
|
|
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
|
-
Run this from your project root. The project must be a **git repository with a `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
|
-
-
|
|
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
|
-
|
|
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
|
+
๐ [ํ๊ตญ์ด](./README.md) ยท **English**
|
|
4
|
+
|
|
5
|
+
**A commit gate that blocks AI-generated code from being committed until Codex has reviewed and approved it.**
|
|
6
|
+
|
|
7
|
+
AI coding agents can move quickly, but unreviewed changes should not go straight into your history. CommitGate wraps each change in a REQ ticket and only allows the staged tree approved by Codex to be committed. If the code changes after approval, or if evidence is missing, it fails closed.
|
|
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
|
+
Run this from your project root. The project must be a **git repository with a `package.json`**.
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
# If this is a fresh folder that is not yet a git repo or has no package.json, first:
|
|
21
|
+
git init
|
|
22
|
+
npm init -y
|
|
23
|
+
|
|
24
|
+
# Then install:
|
|
25
|
+
npx commitgate
|
|
26
|
+
npm install
|
|
27
|
+
codex --version
|
|
28
|
+
codex login status
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then paste this prompt into your AI coding agent.
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
Do not handle this as a normal implementation. Use the CommitGate workflow installed in this project.
|
|
35
|
+
|
|
36
|
+
Create a new REQ ticket and run this flow end to end:
|
|
37
|
+
req:new โ write design docs โ Codex design review โ implement and test โ req:doctor โ Codex phase review โ req:commit
|
|
38
|
+
|
|
39
|
+
Proceed automatically:
|
|
40
|
+
- If `req:review-codex` returns NEEDS_FIX/exit 3, fix the findings and rerun review.
|
|
41
|
+
- If it returns BLOCKED/exit 2, do not retry the same review; escalate or change the review target. If a stuck thread is suspected, you may retry once with `--fresh-thread`.
|
|
42
|
+
- The review target is only what has been staged with git add.
|
|
43
|
+
- Do not manually git add state.json or responses/.
|
|
44
|
+
|
|
45
|
+
Stop for human confirmation only (each item must be approved by that exact sentence; one approval never carries over to the next step):
|
|
46
|
+
- Right before req:commit --run
|
|
47
|
+
- [Path A ยท optional] [I1] Before pushing the feature branch and opening a PR / [I2] Before merging the PR, after confirming the required status checks are green
|
|
48
|
+
- [Path B] [B1] Before a direct push to a protected branch โ get a separate "branch protection bypass๋ฅผ ์ฌ์ฉํ direct push ์น์ธ". This push bypasses the required status checks, and CI runs after it
|
|
49
|
+
- [R1/R2/R3] tag creation and push / npm publish / GitHub release โ each approved separately, after CI is green
|
|
50
|
+
- Before destructive actions such as reset, clean, or force push
|
|
51
|
+
- When the requested scope must change
|
|
52
|
+
- When Codex review returns BLOCKED or remains unclear after bounded retries
|
|
53
|
+
|
|
54
|
+
Requirement:
|
|
55
|
+
- What:
|
|
56
|
+
- Why:
|
|
57
|
+
- Constraints:
|
|
58
|
+
- Done when:
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The agent's first reply should look roughly like this.
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
REQ-2026-002 created
|
|
65
|
+
Branch: feat/req-2026-002-profile-edit-api
|
|
66
|
+
Phases:
|
|
67
|
+
- phase-1: implement PATCH /profile
|
|
68
|
+
- phase-2: tests and regression checks
|
|
69
|
+
Control points: before req:commit --run / [B1] before a direct push to main (or [I1] open PR โ [I2] merge)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
After that, the agent runs design, implementation, tests, and Codex review. You only confirm at control points.
|
|
73
|
+
|
|
74
|
+
Both integration paths are valid: **through a PR (optional)** and **direct push**. A PR is not mandatory. But a direct push to a protected branch **bypasses the required status checks**, so it needs a separate "branch protection bypass๋ฅผ ์ฌ์ฉํ direct push ์น์ธ" โ holding bypass permission is not approval. In that case CI runs **after** the push, so its green is post-hoc verification, and the agent must not omit that from its report. tag, npm publish, and GitHub release are control points of their own, requested after CI is green and never bundled with the integration approval. See [AGENTS.template.md](AGENTS.template.md) and [docs/RELEASING.md](docs/RELEASING.md) for the full contract.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## What Does It Enforce?
|
|
79
|
+
|
|
80
|
+
CommitGate is designed to block **unreviewed changes from being committed**, not just to wrap commands.
|
|
81
|
+
|
|
82
|
+
- No Codex approval means no commit.
|
|
83
|
+
- If the approved staged tree differs from the current staged tree, the commit is blocked.
|
|
84
|
+
- Workflow files such as `state.json` and `responses/` cannot be mixed into the source commit.
|
|
85
|
+
- If Codex CLI is missing or fails, the workflow fails instead of silently passing.
|
|
86
|
+
- Review exit codes are outcome-based: `0` approved, `1` invalid/fail-closed, `2` blocked/no actionable findings, `3` needs fix.
|
|
87
|
+
- A no-findings/no-approval response is BLOCKED, not NEEDS_FIX, so agents must not loop on it.
|
|
88
|
+
- During install, existing `cross-spawn` versions below the verified floor warn by default and fail with `--strict`.
|
|
89
|
+
- Approval responses and evidence are kept under `workflow/REQ-.../responses/`.
|
|
90
|
+
|
|
91
|
+
In short: **approved changes pass, ambiguous changes stop.**
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## What Installation Adds
|
|
96
|
+
|
|
97
|
+
`npx commitgate` adds the following to the target project. Existing files are not overwritten by default.
|
|
98
|
+
|
|
99
|
+
| Added item | Purpose |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `scripts/req/` | `req:new`, `req:review-codex`, `req:doctor`, `req:commit` scripts |
|
|
102
|
+
| `workflow/*.schema.json` | Schemas for Codex responses and config |
|
|
103
|
+
| `req.config.json` | Project-level configuration |
|
|
104
|
+
| `AGENTS.md` | Template rules for the agent and reviewer |
|
|
105
|
+
| `package.json` scripts | `req:*` commands and required devDependencies |
|
|
106
|
+
|
|
107
|
+
Preview without writing files:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
npx commitgate --dry-run
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Treat the security floor warning as an install failure:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
npx commitgate --strict
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
If an existing `cross-spawn` is below the verified floor, CommitGate stops before copying files.
|
|
120
|
+
|
|
121
|
+
> `workflow/machine.schema.json` and `workflow/req.config.schema.json` are always copied under `workflow/`, regardless of the `ticketRoot` setting in `req.config.json`.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Removing CommitGate
|
|
126
|
+
|
|
127
|
+
First, the important part: **`npx commitgate` is not a global install.** npx downloads the package into the npm cache (`_npx/<hash>/`) and runs it once; it leaves nothing in your global `node_modules` and nothing on your PATH. The real "installation" is the set of files added to your repo, plus the `package.json` changes listed above.
|
|
128
|
+
|
|
129
|
+
Start by previewing the removal plan. This command **deletes nothing**:
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
npx commitgate uninstall
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
It reads your repo and classifies what it finds: (1) CommitGate-owned files that are byte-identical to the package originals, (2) files that differ and need your review, (3) files that must not be removed automatically, and (4) audit evidence. Then it prints the revert commands that match your commit state. You review them and run the deletions yourself.
|
|
136
|
+
|
|
137
|
+
### Why isn't removal automatic?
|
|
138
|
+
|
|
139
|
+
`init` **does not record on disk what it created.** At removal time it is therefore impossible to tell apart:
|
|
140
|
+
|
|
141
|
+
- `AGENTS.md` is created **only when absent**. If you already had one, init leaves it alone โ so a file init wrote and a file you wrote look identical on disk.
|
|
142
|
+
- `req.config.json` is **merged** (missing keys only) when it already exists. The original is not kept, so the merge cannot be undone.
|
|
143
|
+
- `package.json` only gets keys that are **absent**. A pre-existing `req:doctor` or `cross-spawn` is not CommitGate's. And `ajv`, `cross-spawn`, and `tsx` are devDependencies other packages commonly use too.
|
|
144
|
+
- Your `ticketRoot` (default `workflow/`) accumulates REQ ticket `state.json` and `approvals.jsonl` โ this tool's **audit evidence**.
|
|
145
|
+
|
|
146
|
+
Deleting all of that without a ledger would destroy user data. CommitGate installs no git hooks and touches no git config โ it is a pure in-tree scaffolder, so git is the source of truth for undoing it.
|
|
147
|
+
|
|
148
|
+
### If you have not committed the scaffold
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
git status --porcelain -uall # see what was added
|
|
152
|
+
git diff -- package.json # see the injected req:* scripts and devDependencies
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Then revert it yourself. Always restore `package.json` from `HEAD`:
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
git checkout HEAD -- package.json
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
> โ ๏ธ Without `HEAD`, git restores from the **index**, so after a `git add` the injected `req:*` scripts survive.
|
|
162
|
+
> โ ๏ธ This command also discards **any other uncommitted edits** to `package.json`. Check the diff first.
|
|
163
|
+
|
|
164
|
+
Delete only the paths `npx commitgate uninstall` listed. Removing `scripts/req/` or `workflow/` as whole directories would also take your own files and your ticket evidence with them.
|
|
165
|
+
|
|
166
|
+
> git does not track empty directories. After deleting the files, `git status` can report a clean tree while empty `scripts/` and `workflow/` directories remain on disk.
|
|
167
|
+
|
|
168
|
+
### If you already committed the scaffold
|
|
169
|
+
|
|
170
|
+
Revert the commit that introduced it.
|
|
171
|
+
|
|
172
|
+
```sh
|
|
173
|
+
git log --diff-filter=A --format='%H %s' -- scripts/req/req-new.ts
|
|
174
|
+
git revert <sha>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`npx commitgate uninstall` finds the introducing commit for you. If that commit also contains unrelated work, reverting it undoes that work too โ inspect it with `git show <sha>` first. If the scaffold was introduced across several commits, no single revert will undo it.
|
|
178
|
+
|
|
179
|
+
### Clearing the npx cache (unrelated to your repo)
|
|
180
|
+
|
|
181
|
+
Check for a global install first:
|
|
182
|
+
|
|
183
|
+
```sh
|
|
184
|
+
npm ls -g commitgate # empty output means it is not installed globally
|
|
185
|
+
npm uninstall -g commitgate # only if you did install it globally
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
The package npx downloaded stays under `_npx/` in the npm cache.
|
|
189
|
+
|
|
190
|
+
```powershell
|
|
191
|
+
# Windows (PowerShell)
|
|
192
|
+
Remove-Item -Recurse -Force "$(npm config get cache)\_npx"
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
```sh
|
|
196
|
+
# macOS / Linux
|
|
197
|
+
rm -rf "$(npm config get cache)/_npx"
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
> โ ๏ธ **`npm cache clean --force` is not a CommitGate removal command.** It empties `_cacache` only and leaves `_npx` intact. It has nothing to do with the scaffolding in your repo.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Prerequisites
|
|
205
|
+
|
|
206
|
+
| Requirement | Check | Notes |
|
|
207
|
+
|---|---|---|
|
|
208
|
+
| Git | `git --version` | Required |
|
|
209
|
+
| Node.js 18.17+ | `node --version` | Required |
|
|
210
|
+
| npm, pnpm, or yarn | `npm --version` | Examples use npm |
|
|
211
|
+
| Codex CLI | `codex --version` | Required for review runs |
|
|
212
|
+
|
|
213
|
+
If Codex CLI is not installed:
|
|
214
|
+
|
|
215
|
+
```sh
|
|
216
|
+
npm install -g @openai/codex
|
|
217
|
+
codex login
|
|
218
|
+
codex login status
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
On Windows, if `codex` is not found right after installation, open a new terminal so PATH is reloaded.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Manual Commands
|
|
226
|
+
|
|
227
|
+
Most users should use the prompt flow above. This section is for understanding what the workflow runs internally or for debugging.
|
|
228
|
+
|
|
229
|
+
```sh
|
|
230
|
+
# 1. Create a ticket and branch
|
|
231
|
+
npm run req:new -- my-feature --run
|
|
232
|
+
|
|
233
|
+
# 2. Write design docs, then stage them
|
|
234
|
+
git add workflow/REQ-2026-001/00-requirement.md workflow/REQ-2026-001/01-design.md workflow/REQ-2026-001/02-plan.md
|
|
235
|
+
|
|
236
|
+
# 3. Design review
|
|
237
|
+
npm run req:review-codex -- 2026-001 --kind design --run
|
|
238
|
+
|
|
239
|
+
# 4. Implement code, then stage source files
|
|
240
|
+
git add <changed-source-files>
|
|
241
|
+
|
|
242
|
+
# 5. Gate check
|
|
243
|
+
npm run req:doctor -- 2026-001
|
|
244
|
+
|
|
245
|
+
# 6. Implementation review
|
|
246
|
+
npm run req:review-codex -- 2026-001 --kind phase --run
|
|
247
|
+
|
|
248
|
+
# 7. Commit approved code
|
|
249
|
+
npm run req:commit -- 2026-001 --run -m "feat: my feature"
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Important: only stage code and documents you authored for the source commit. `state.json` and `responses/` are managed by the tool.
|
|
253
|
+
|
|
254
|
+
For multi-line commit messages, use a file instead of `-m`.
|
|
255
|
+
|
|
256
|
+
```sh
|
|
257
|
+
npm run req:commit -- 2026-001 --run --message-file commit-message.txt
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Command Cheat Sheet
|
|
263
|
+
|
|
264
|
+
| Command | Purpose |
|
|
265
|
+
|---|---|
|
|
266
|
+
| `npx commitgate` | Install CommitGate into a project |
|
|
267
|
+
| `npx commitgate --dry-run` | Preview the install plan without writing files |
|
|
268
|
+
| `npx commitgate --strict` | Treat low `cross-spawn` version warnings as install failures |
|
|
269
|
+
| `npx commitgate uninstall` | Preview the removal plan (read-only โ deletes nothing) |
|
|
270
|
+
| `req:new <slug> --run` | Create a REQ ticket, branch, and design docs |
|
|
271
|
+
| `req:review-codex <id> --kind design --run` | Review the design |
|
|
272
|
+
| `req:review-codex <id> --kind phase --run` | Review the implementation |
|
|
273
|
+
| `req:doctor <id>` | Check gate status |
|
|
274
|
+
| `req:commit <id> --run -m "message"` | Commit approved changes |
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Configuration
|
|
279
|
+
|
|
280
|
+
Defaults are enough for most projects. If needed, edit `req.config.json` in the project root.
|
|
281
|
+
|
|
282
|
+
| Key | Default | Meaning |
|
|
283
|
+
|---|---|---|
|
|
284
|
+
| `branchPrefix` | `"feat/req-"` | Prefix for new branches |
|
|
285
|
+
| `ticketRoot` | `"workflow"` | REQ ticket directory |
|
|
286
|
+
| `packageManager` | auto-detected | `npm`, `pnpm`, or `yarn` |
|
|
287
|
+
| `designDocs` | `00/01/02` docs | Design document filenames |
|
|
288
|
+
|
|
289
|
+
Empty `branchPrefix` values and paths that escape the project root are rejected.
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## FAQ
|
|
294
|
+
|
|
295
|
+
**What happens if Codex CLI is missing?**
|
|
296
|
+
The review command fails. It is not treated as approval.
|
|
297
|
+
|
|
298
|
+
**Can I edit code after approval and still commit?**
|
|
299
|
+
No. If the staged tree changes after approval, CommitGate treats the approval as stale and requires review again.
|
|
300
|
+
|
|
301
|
+
**Why should I not stage `state.json` or `responses/`?**
|
|
302
|
+
They are workflow state and evidence files. Mixing them into the source commit weakens the approval binding, so `req:commit` blocks it.
|
|
303
|
+
|
|
304
|
+
**What should I do if I see a cross-spawn version warning?**
|
|
305
|
+
It means the target project may already have a `cross-spawn` version below CommitGate's verified floor. Upgrade it with `npm i -D cross-spawn@^7.0.6`. In CI or security-sensitive installs, use `npx commitgate --strict` to treat the warning as a failure.
|
|
306
|
+
|
|
307
|
+
**Does running install twice overwrite files?**
|
|
308
|
+
No. Existing files are skipped. Use `--force` if you intentionally want to refresh them.
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Current Scope
|
|
313
|
+
|
|
314
|
+
The current release is **Stage A: vendored scaffold model**. `npx commitgate` copies workflow files into the target project.
|
|
315
|
+
|
|
316
|
+
Current verification:
|
|
317
|
+
|
|
318
|
+
- GitHub Actions runs a `ubuntu-latest`, `macos-latest`, `windows-latest` ร Node 18/20/22 matrix.
|
|
319
|
+
- `npm run smoke` installs the packed tarball and runs the installed `commitgate` bin.
|
|
320
|
+
- A Windows `.cmd` wrapper injection regression test protects package-manager and Codex wrapper paths.
|
|
321
|
+
|
|
322
|
+
Future scope:
|
|
323
|
+
|
|
324
|
+
- Running directly from `node_modules` as a library-style model
|
|
325
|
+
- Non-git VCS support
|
|
326
|
+
- More design document templates
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## License
|
|
331
|
+
|
|
332
|
+
[MIT](./LICENSE) ยฉ 2026 sol5288
|