smart-commit-copilot-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/LICENSE +21 -0
- package/README.md +392 -0
- package/docs/configuration.md +262 -0
- package/docs/contracts.md +134 -0
- package/docs/getting-started.md +177 -0
- package/docs/integrations.md +85 -0
- package/docs/publish.md +135 -0
- package/docs/release-checklist.md +39 -0
- package/docs/releases/0.1.0-draft.md +52 -0
- package/docs/roadmap.md +94 -0
- package/examples/agent/bridge-agent.mjs +51 -0
- package/examples/agent/report-agent.mjs +48 -0
- package/examples/config/smart-commit.json +60 -0
- package/examples/hooks/cursor-bridge-wrapper.sh +12 -0
- package/examples/hooks/husky-pre-commit.sh +6 -0
- package/examples/hooks/smart-commit-bridge.sh +11 -0
- package/out/cli.js +19 -0
- package/out/cli.js.map +1 -0
- package/out/cliApp.js +239 -0
- package/out/cliApp.js.map +1 -0
- package/out/commands/bridge.js +607 -0
- package/out/commands/bridge.js.map +1 -0
- package/out/commands/report.js +266 -0
- package/out/commands/report.js.map +1 -0
- package/out/commands/types.js +3 -0
- package/out/commands/types.js.map +1 -0
- package/out/commitMessage/index.js +110 -0
- package/out/commitMessage/index.js.map +1 -0
- package/out/commitMessage/mockProvider.js +27 -0
- package/out/commitMessage/mockProvider.js.map +1 -0
- package/out/commitMessage/openaiProvider.js +44 -0
- package/out/commitMessage/openaiProvider.js.map +1 -0
- package/out/commitMessage/prompt.js +65 -0
- package/out/commitMessage/prompt.js.map +1 -0
- package/out/commitMessage/protocol.js +126 -0
- package/out/commitMessage/protocol.js.map +1 -0
- package/out/commitMessage/provider.js +3 -0
- package/out/commitMessage/provider.js.map +1 -0
- package/out/config/cliArgs.js +249 -0
- package/out/config/cliArgs.js.map +1 -0
- package/out/config/constants.js +47 -0
- package/out/config/constants.js.map +1 -0
- package/out/config/env.js +183 -0
- package/out/config/env.js.map +1 -0
- package/out/config/file.js +245 -0
- package/out/config/file.js.map +1 -0
- package/out/config/index.js +46 -0
- package/out/config/index.js.map +1 -0
- package/out/config/legacySmartCommit.js +200 -0
- package/out/config/legacySmartCommit.js.map +1 -0
- package/out/config/merge.js +70 -0
- package/out/config/merge.js.map +1 -0
- package/out/config/runtime.js +36 -0
- package/out/config/runtime.js.map +1 -0
- package/out/config/schema.js +204 -0
- package/out/config/schema.js.map +1 -0
- package/out/contracts.js +311 -0
- package/out/contracts.js.map +1 -0
- package/out/git.js +119 -0
- package/out/git.js.map +1 -0
- package/out/logger.js +17 -0
- package/out/logger.js.map +1 -0
- package/out/openaiCompatible.js +67 -0
- package/out/openaiCompatible.js.map +1 -0
- package/out/output.js +23 -0
- package/out/output.js.map +1 -0
- package/out/passHistory/index.js +119 -0
- package/out/passHistory/index.js.map +1 -0
- package/out/passHistory/store.js +252 -0
- package/out/passHistory/store.js.map +1 -0
- package/out/passHistory/types.js +6 -0
- package/out/passHistory/types.js.map +1 -0
- package/out/promptContext.js +72 -0
- package/out/promptContext.js.map +1 -0
- package/out/renderOutput.js +89 -0
- package/out/renderOutput.js.map +1 -0
- package/out/reporting/aggregate.js +113 -0
- package/out/reporting/aggregate.js.map +1 -0
- package/out/reporting/index.js +72 -0
- package/out/reporting/index.js.map +1 -0
- package/out/reporting/mockProvider.js +25 -0
- package/out/reporting/mockProvider.js.map +1 -0
- package/out/reporting/openaiProvider.js +19 -0
- package/out/reporting/openaiProvider.js.map +1 -0
- package/out/reporting/prompt.js +28 -0
- package/out/reporting/prompt.js.map +1 -0
- package/out/reporting/provider.js +3 -0
- package/out/reporting/provider.js.map +1 -0
- package/out/reporting/render.js +151 -0
- package/out/reporting/render.js.map +1 -0
- package/out/reporting/timeWindow.js +79 -0
- package/out/reporting/timeWindow.js.map +1 -0
- package/out/reporting/types.js +11 -0
- package/out/reporting/types.js.map +1 -0
- package/out/review/index.js +64 -0
- package/out/review/index.js.map +1 -0
- package/out/review/mockProvider.js +57 -0
- package/out/review/mockProvider.js.map +1 -0
- package/out/review/openaiProvider.js +40 -0
- package/out/review/openaiProvider.js.map +1 -0
- package/out/review/parser.js +92 -0
- package/out/review/parser.js.map +1 -0
- package/out/review/prompt.js +61 -0
- package/out/review/prompt.js.map +1 -0
- package/out/review/provider.js +3 -0
- package/out/review/provider.js.map +1 -0
- package/out/review/types.js +3 -0
- package/out/review/types.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Contracts
|
|
2
|
+
|
|
3
|
+
This document summarizes the stable machine-facing contracts exposed by `smart-commit CLI`.
|
|
4
|
+
|
|
5
|
+
If you are trying the CLI for the first time, start with [`getting-started.md`](./getting-started.md). This document is mainly for machine integrations and contract consumers.
|
|
6
|
+
|
|
7
|
+
For formal JSON Schema output, use:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
smart-commit schema print --target bridge
|
|
11
|
+
smart-commit schema print --target report-generate
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Shared Rules
|
|
15
|
+
|
|
16
|
+
- All machine-facing JSON payloads include `schemaVersion`
|
|
17
|
+
- Parse stdout as JSON
|
|
18
|
+
- Treat stderr as supplemental human-readable context
|
|
19
|
+
- Prefer `status` and `error.code` over string matching in `summary`
|
|
20
|
+
|
|
21
|
+
## `config resolve`
|
|
22
|
+
|
|
23
|
+
Command:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
smart-commit config resolve --config ./smart-commit.json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Stable top-level fields:
|
|
30
|
+
|
|
31
|
+
- `schemaVersion`
|
|
32
|
+
- `status`
|
|
33
|
+
- `command`
|
|
34
|
+
- `runtime`
|
|
35
|
+
- `config`
|
|
36
|
+
|
|
37
|
+
Use it to validate merged config before wiring `bridge` or `report generate` into automation.
|
|
38
|
+
|
|
39
|
+
## `bridge`
|
|
40
|
+
|
|
41
|
+
Command:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
smart-commit bridge --repo /path/to/repo --config ./smart-commit.json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Stable top-level fields:
|
|
48
|
+
|
|
49
|
+
- `schemaVersion`
|
|
50
|
+
- `status`
|
|
51
|
+
- `command`
|
|
52
|
+
- `repositoryPath`
|
|
53
|
+
- `phase`
|
|
54
|
+
- `didCommit`
|
|
55
|
+
- `didPush`
|
|
56
|
+
- `commitSha`
|
|
57
|
+
- `passHistory`
|
|
58
|
+
- `reviewDecision`
|
|
59
|
+
- `score`
|
|
60
|
+
- `summary`
|
|
61
|
+
- `error`
|
|
62
|
+
|
|
63
|
+
Status semantics:
|
|
64
|
+
|
|
65
|
+
- `ready`
|
|
66
|
+
Returned for dry-run preflight success.
|
|
67
|
+
- `passed`
|
|
68
|
+
Returned when execution succeeds through review, or through commit/push depending on config.
|
|
69
|
+
- `blocked`
|
|
70
|
+
Returned for expected business outcomes such as review blocking or staged-diff gating.
|
|
71
|
+
- `error`
|
|
72
|
+
Returned for configuration or runtime failures.
|
|
73
|
+
|
|
74
|
+
Important `error.code` values:
|
|
75
|
+
|
|
76
|
+
- `CONFIG_ERROR`
|
|
77
|
+
- `RUNTIME_ERROR`
|
|
78
|
+
- `NO_CHANGES`
|
|
79
|
+
- `NO_STAGED_DIFF`
|
|
80
|
+
- `WOULD_AUTO_STAGE`
|
|
81
|
+
- `COMMIT_MESSAGE_REQUIRED`
|
|
82
|
+
- `COMMIT_MESSAGE_INVALID`
|
|
83
|
+
- `REVIEW_BLOCKED`
|
|
84
|
+
|
|
85
|
+
Recommended automation behavior:
|
|
86
|
+
|
|
87
|
+
- continue on `ready` or `passed`
|
|
88
|
+
- stop on `blocked` and surface `error.code` plus `summary`
|
|
89
|
+
- fail on `error`
|
|
90
|
+
|
|
91
|
+
## `report generate`
|
|
92
|
+
|
|
93
|
+
Command:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
smart-commit report generate --repo /path/to/repo --period weekly
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Stable top-level fields:
|
|
100
|
+
|
|
101
|
+
- `schemaVersion`
|
|
102
|
+
- `status`
|
|
103
|
+
- `command`
|
|
104
|
+
- `repositoryPath`
|
|
105
|
+
- `periodType`
|
|
106
|
+
- `passHistoryFilePath`
|
|
107
|
+
- `outputFilePath`
|
|
108
|
+
- `renderMode`
|
|
109
|
+
- `reportProvider`
|
|
110
|
+
- `warnings`
|
|
111
|
+
- `facts`
|
|
112
|
+
- `summary`
|
|
113
|
+
- `error`
|
|
114
|
+
|
|
115
|
+
`renderMode` semantics:
|
|
116
|
+
|
|
117
|
+
- `local`
|
|
118
|
+
Local deterministic Markdown generation was used.
|
|
119
|
+
- `ai`
|
|
120
|
+
AI-enhanced report generation succeeded.
|
|
121
|
+
- `ai-fallback-local`
|
|
122
|
+
AI generation failed and the CLI fell back to local Markdown.
|
|
123
|
+
|
|
124
|
+
Recommended automation behavior:
|
|
125
|
+
|
|
126
|
+
- archive or upload `outputFilePath` on success
|
|
127
|
+
- inspect `warnings` when `renderMode` is `ai-fallback-local`
|
|
128
|
+
- fail on `status: "error"`
|
|
129
|
+
|
|
130
|
+
## Versioning Guidance
|
|
131
|
+
|
|
132
|
+
- treat `schemaVersion` as the primary compatibility gate
|
|
133
|
+
- use JSON Schema for strict validation when integrating with agents or services
|
|
134
|
+
- expect additive fields to be the preferred evolution path
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
This guide is the fastest path from a fresh checkout to a successful `bridge` run.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
By the end of this guide, you will:
|
|
8
|
+
|
|
9
|
+
1. build the CLI
|
|
10
|
+
2. prepare a config file
|
|
11
|
+
3. validate the merged config
|
|
12
|
+
4. run a safe bridge preflight
|
|
13
|
+
5. run review-only mode
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
- Node.js 20+
|
|
18
|
+
- Git repository with staged changes
|
|
19
|
+
- an OpenAI-compatible API endpoint and API key
|
|
20
|
+
|
|
21
|
+
## Step 1: Install And Build
|
|
22
|
+
|
|
23
|
+
From the repository root:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install
|
|
27
|
+
npm run build
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Optional, if you want the `smart-commit` binary available globally in your shell:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm link
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If you do not run `npm link`, replace `smart-commit` in the examples below with:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
node out/cli.js
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Step 2: Export Your API Key
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
export SMART_COMMIT_API_KEY="your-api-key"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The example config uses `env:SMART_COMMIT_API_KEY`, so this environment variable must exist before validation.
|
|
49
|
+
|
|
50
|
+
## Step 3: Create A Config File
|
|
51
|
+
|
|
52
|
+
Start from the example:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
cp examples/config/smart-commit.json ./smart-commit.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
You can keep the example mostly as-is for first use. The important part is:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"smartCommitCli": {
|
|
63
|
+
"connection": {
|
|
64
|
+
"baseUrl": "https://api.openai.com/v1",
|
|
65
|
+
"apiKey": "env:SMART_COMMIT_API_KEY",
|
|
66
|
+
"model": "gpt-5"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Step 4: Validate The Final Config
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
smart-commit config resolve --config ./smart-commit.json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This command is important because it shows:
|
|
79
|
+
|
|
80
|
+
- merged values after precedence rules
|
|
81
|
+
- secret redaction
|
|
82
|
+
- validation errors before execution
|
|
83
|
+
|
|
84
|
+
For a more readable terminal view:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
smart-commit config resolve --config ./smart-commit.json --output text
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Step 5: Prepare Some Staged Changes
|
|
91
|
+
|
|
92
|
+
Inside your target repo:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git add -A
|
|
96
|
+
git status --short
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`bridge` works on staged changes, so this step matters.
|
|
100
|
+
|
|
101
|
+
## Step 6: Run A Safe Preflight
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
smart-commit bridge --repo . --config ./smart-commit.json --dry-run
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Expected result:
|
|
108
|
+
|
|
109
|
+
- `status: "ready"` if everything is prepared
|
|
110
|
+
- `status: "blocked"` if changes are missing or staging rules prevent execution
|
|
111
|
+
- `status: "error"` if config or runtime setup is invalid
|
|
112
|
+
|
|
113
|
+
Human-readable version:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
smart-commit bridge --repo . --config ./smart-commit.json --dry-run --output text
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Step 7: Run Review-Only Mode
|
|
120
|
+
|
|
121
|
+
This is the safest way to onboard the CLI into a real workflow:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
smart-commit bridge --repo . --config ./smart-commit.json --no-commit --no-push
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
This lets you verify:
|
|
128
|
+
|
|
129
|
+
- review path
|
|
130
|
+
- commit-message generation path
|
|
131
|
+
- threshold behavior
|
|
132
|
+
- structured JSON output
|
|
133
|
+
|
|
134
|
+
without creating a commit or pushing to remote.
|
|
135
|
+
|
|
136
|
+
## Step 8: Enable Pass History
|
|
137
|
+
|
|
138
|
+
If you want reporting later, enable pass history:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
smart-commit bridge \
|
|
142
|
+
--repo . \
|
|
143
|
+
--config ./smart-commit.json \
|
|
144
|
+
--enable-pass-history=true \
|
|
145
|
+
--no-commit \
|
|
146
|
+
--no-push
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
This writes local JSONL history for successful bridge runs.
|
|
150
|
+
|
|
151
|
+
## Step 9: Generate A Report
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
smart-commit report generate --repo . --config ./smart-commit.json --period weekly
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Useful follow-up checks:
|
|
158
|
+
|
|
159
|
+
- confirm `outputFilePath`
|
|
160
|
+
- confirm `renderMode`
|
|
161
|
+
- inspect generated Markdown
|
|
162
|
+
|
|
163
|
+
## Recommended First Production Rollout
|
|
164
|
+
|
|
165
|
+
1. validate config with `config resolve`
|
|
166
|
+
2. run `bridge --dry-run`
|
|
167
|
+
3. run `bridge --no-commit --no-push`
|
|
168
|
+
4. wire the same review-only command into Husky or Cursor hook
|
|
169
|
+
5. enable pass history
|
|
170
|
+
6. add reporting
|
|
171
|
+
7. only then enable automatic commit or push if you really want the CLI to own those side effects
|
|
172
|
+
|
|
173
|
+
## Where To Go Next
|
|
174
|
+
|
|
175
|
+
- configuration details: [`configuration.md`](./configuration.md)
|
|
176
|
+
- integration patterns: [`integrations.md`](./integrations.md)
|
|
177
|
+
- machine-facing contracts: [`contracts.md`](./contracts.md)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Integrations
|
|
2
|
+
|
|
3
|
+
This document shows recommended integration patterns for `smart-commit CLI` in shell-first automation.
|
|
4
|
+
|
|
5
|
+
If you have not run the CLI manually yet, start with [`getting-started.md`](./getting-started.md) first. Integration is much easier after you have already verified `config resolve` and `bridge --dry-run`.
|
|
6
|
+
|
|
7
|
+
## Principles
|
|
8
|
+
|
|
9
|
+
- Prefer `bridge` as the enforcement entrypoint for hooks and agents
|
|
10
|
+
- Prefer `report generate` as the reporting entrypoint for scheduled or post-task automation
|
|
11
|
+
- Parse JSON output instead of scraping stderr
|
|
12
|
+
- Gate logic on `schemaVersion`, `status`, and `error.code`
|
|
13
|
+
- Keep hook integrations in `--no-commit --no-push` mode unless you explicitly want the CLI to own Git side effects
|
|
14
|
+
|
|
15
|
+
## Husky
|
|
16
|
+
|
|
17
|
+
Recommended use:
|
|
18
|
+
|
|
19
|
+
- Use `pre-commit` to review staged changes before Git creates a commit
|
|
20
|
+
- Keep Husky in review-only mode with `--no-commit --no-push`
|
|
21
|
+
- Let Git itself continue to own the actual commit lifecycle
|
|
22
|
+
|
|
23
|
+
Suggested layout:
|
|
24
|
+
|
|
25
|
+
- Wrapper script: [`examples/hooks/smart-commit-bridge.sh`](../examples/hooks/smart-commit-bridge.sh)
|
|
26
|
+
- Husky example: [`examples/hooks/husky-pre-commit.sh`](../examples/hooks/husky-pre-commit.sh)
|
|
27
|
+
|
|
28
|
+
Example:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
cp examples/hooks/husky-pre-commit.sh .husky/pre-commit
|
|
32
|
+
chmod +x .husky/pre-commit
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Cursor Hook
|
|
36
|
+
|
|
37
|
+
Cursor hook registration details can vary by version, so the most stable approach is:
|
|
38
|
+
|
|
39
|
+
- register a shell script as the hook target
|
|
40
|
+
- let the shell script invoke `smart-commit bridge`
|
|
41
|
+
- consume JSON output if your hook host supports it
|
|
42
|
+
|
|
43
|
+
Suggested wrapper:
|
|
44
|
+
|
|
45
|
+
- [`examples/hooks/cursor-bridge-wrapper.sh`](../examples/hooks/cursor-bridge-wrapper.sh)
|
|
46
|
+
|
|
47
|
+
Recommended behavior:
|
|
48
|
+
|
|
49
|
+
- run before commit or before custom repo actions
|
|
50
|
+
- use `--no-commit --no-push`
|
|
51
|
+
- inspect `status`
|
|
52
|
+
`ready` and `passed` mean continue
|
|
53
|
+
`blocked` means stop and surface the review reason
|
|
54
|
+
`error` means stop and surface the runtime or config problem
|
|
55
|
+
|
|
56
|
+
## External Agent
|
|
57
|
+
|
|
58
|
+
For custom agents, CI bots, or local automation runners:
|
|
59
|
+
|
|
60
|
+
- spawn `smart-commit bridge` or `smart-commit report generate`
|
|
61
|
+
- parse stdout as JSON
|
|
62
|
+
- check `schemaVersion`
|
|
63
|
+
- branch behavior on `status`
|
|
64
|
+
|
|
65
|
+
Example consumers:
|
|
66
|
+
|
|
67
|
+
- [`examples/agent/bridge-agent.mjs`](../examples/agent/bridge-agent.mjs)
|
|
68
|
+
- [`examples/agent/report-agent.mjs`](../examples/agent/report-agent.mjs)
|
|
69
|
+
|
|
70
|
+
## Exit Codes
|
|
71
|
+
|
|
72
|
+
- `0`: success
|
|
73
|
+
- `2`: blocked business decision, such as review blocked or auto-stage dry-run warning
|
|
74
|
+
- `3`: config error
|
|
75
|
+
- `4`: runtime error
|
|
76
|
+
|
|
77
|
+
JSON payloads should remain the primary contract. Exit codes are best used as a coarse first filter.
|
|
78
|
+
|
|
79
|
+
## Recommended Rollout
|
|
80
|
+
|
|
81
|
+
1. Start with `smart-commit config resolve` in CI or local scripts to verify merged config.
|
|
82
|
+
2. Wire `bridge` into Husky or Cursor hook in `--no-commit --no-push` mode.
|
|
83
|
+
3. Enable `passHistory`.
|
|
84
|
+
4. Add `report generate` in scheduled automation or agent workflows.
|
|
85
|
+
5. Optionally enable AI reporting with local fallback after the local flow is already stable.
|
package/docs/publish.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Publish Guide
|
|
2
|
+
|
|
3
|
+
This guide covers the practical steps for turning the current repository state into a first public release.
|
|
4
|
+
|
|
5
|
+
## Current Assumption
|
|
6
|
+
|
|
7
|
+
The project is now configured to allow npm publication. Before you publish, you still need to confirm:
|
|
8
|
+
|
|
9
|
+
- the final package name
|
|
10
|
+
- the canonical Git remote
|
|
11
|
+
- whether the package should be published to npm, GitHub Packages, or stay private
|
|
12
|
+
|
|
13
|
+
Current package name:
|
|
14
|
+
|
|
15
|
+
- `smart-commit-copilot-cli`
|
|
16
|
+
|
|
17
|
+
## Pre-Publish Checklist
|
|
18
|
+
|
|
19
|
+
1. Run `npm test`
|
|
20
|
+
2. Run `npm run pack:dry-run`
|
|
21
|
+
3. Review [`CHANGELOG.md`](../CHANGELOG.md)
|
|
22
|
+
4. Review [`docs/release-checklist.md`](./release-checklist.md)
|
|
23
|
+
5. Review the release draft in [`docs/releases/0.1.0-draft.md`](./releases/0.1.0-draft.md)
|
|
24
|
+
|
|
25
|
+
## Recommended Release Order
|
|
26
|
+
|
|
27
|
+
For the current repository state, the safest order is:
|
|
28
|
+
|
|
29
|
+
1. create and push a Git tag for `v0.1.0`
|
|
30
|
+
2. create a GitHub Release using the release draft text
|
|
31
|
+
3. log in to npm
|
|
32
|
+
4. publish `smart-commit-copilot-cli@0.1.0`
|
|
33
|
+
|
|
34
|
+
This gives you:
|
|
35
|
+
|
|
36
|
+
- a fixed release checkpoint on GitHub
|
|
37
|
+
- a stable version label for discussion and changelog references
|
|
38
|
+
- a clean follow-up path for npm publication
|
|
39
|
+
|
|
40
|
+
## Metadata To Finalize Before Public Publish
|
|
41
|
+
|
|
42
|
+
Update [`package.json`](../package.json) with:
|
|
43
|
+
|
|
44
|
+
- `repository`
|
|
45
|
+
- `homepage`
|
|
46
|
+
- `bugs`
|
|
47
|
+
|
|
48
|
+
If the package will be public on npm:
|
|
49
|
+
|
|
50
|
+
1. confirm the package name is available
|
|
51
|
+
2. run `npm publish --access public`
|
|
52
|
+
|
|
53
|
+
If the package will remain private for now:
|
|
54
|
+
|
|
55
|
+
- set `"private": true` again before any publish attempt
|
|
56
|
+
- continue distributing via source checkout, internal package registry, or tarball
|
|
57
|
+
|
|
58
|
+
## Dry-Run Packaging
|
|
59
|
+
|
|
60
|
+
Use:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm run pack:dry-run
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This shows the exact files that would be included in the published tarball, based on the `files` field in [`package.json`](../package.json).
|
|
67
|
+
|
|
68
|
+
## Exact GitHub Release Steps
|
|
69
|
+
|
|
70
|
+
Create and push the release tag:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git tag v0.1.0
|
|
74
|
+
git push smart-commit-cli v0.1.0
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Then create a GitHub Release:
|
|
78
|
+
|
|
79
|
+
- tag: `v0.1.0`
|
|
80
|
+
- title: `v0.1.0`
|
|
81
|
+
- description: use the content from [`docs/releases/0.1.0-draft.md`](./releases/0.1.0-draft.md)
|
|
82
|
+
|
|
83
|
+
## Exact npm Publish Steps
|
|
84
|
+
|
|
85
|
+
Log in first:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm login
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Optional verification:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm whoami
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Publish:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npm publish --access public
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Package that will be published:
|
|
104
|
+
|
|
105
|
+
- `smart-commit-copilot-cli@0.1.0`
|
|
106
|
+
|
|
107
|
+
## Suggested Final Verification After Publish
|
|
108
|
+
|
|
109
|
+
After npm publish succeeds, verify:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npm view smart-commit-copilot-cli version
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Then test a fresh install path:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npx smart-commit-copilot-cli --help
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Suggested First Release Shape
|
|
122
|
+
|
|
123
|
+
Recommended first public scope:
|
|
124
|
+
|
|
125
|
+
- `config resolve`
|
|
126
|
+
- `bridge`
|
|
127
|
+
- `report generate`
|
|
128
|
+
- `schema print`
|
|
129
|
+
- example configs and integration templates
|
|
130
|
+
|
|
131
|
+
Recommended non-goals for the first release:
|
|
132
|
+
|
|
133
|
+
- broad plugin ecosystem promises
|
|
134
|
+
- advanced multi-repository orchestration
|
|
135
|
+
- unstable breaking changes to machine-facing JSON contracts
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Release Checklist
|
|
2
|
+
|
|
3
|
+
Use this checklist before the first public release and for later release candidates.
|
|
4
|
+
|
|
5
|
+
## Product
|
|
6
|
+
|
|
7
|
+
- Confirm README reflects the current command surface and examples
|
|
8
|
+
- Confirm `docs/integrations.md` still matches the recommended Husky, Cursor hook, and agent patterns
|
|
9
|
+
- Confirm `docs/contracts.md` matches the actual JSON payloads and schema output
|
|
10
|
+
- Confirm `CHANGELOG.md` is updated for the release
|
|
11
|
+
- Confirm the release draft in `docs/releases/0.1.0-draft.md` matches the intended release scope
|
|
12
|
+
|
|
13
|
+
## Build
|
|
14
|
+
|
|
15
|
+
- Run `npm test`
|
|
16
|
+
- Run `smart-commit schema print --target bridge` and spot-check the output
|
|
17
|
+
- Run `smart-commit config resolve` against the example config
|
|
18
|
+
- Confirm GitHub Actions CI passes on the target branch
|
|
19
|
+
|
|
20
|
+
## Runtime
|
|
21
|
+
|
|
22
|
+
- Dry-run `bridge` in a temporary Git repository
|
|
23
|
+
- Run `bridge` with mock review and commit-message providers
|
|
24
|
+
- Run `report generate` from a repository with pass-history records
|
|
25
|
+
- Run `report generate --report-ai` with a mock provider and confirm fallback behavior still works
|
|
26
|
+
|
|
27
|
+
## Package
|
|
28
|
+
|
|
29
|
+
- Confirm `package.json` version is correct
|
|
30
|
+
- Confirm `package.json` `files` list still includes all runtime assets that should ship
|
|
31
|
+
- Confirm `node` engine requirement still matches the codebase
|
|
32
|
+
- Run `npm run pack:dry-run` and inspect the tarball file list
|
|
33
|
+
|
|
34
|
+
## Optional Publish Readiness
|
|
35
|
+
|
|
36
|
+
- Add repository metadata once the canonical remote URL is finalized
|
|
37
|
+
- Add homepage and bugs metadata if the project will be published externally
|
|
38
|
+
- Add CI workflow badges and installation instructions if distribution is planned
|
|
39
|
+
- Revisit whether the package should continue publishing from this repository state or move to a scoped package later
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# `smart-commit-copilot-cli` 0.1.0 Draft Release Notes
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
`smart-commit-copilot-cli` 0.1.0 is the first standalone CLI-first release of the Smart Commit automation runtime.
|
|
6
|
+
|
|
7
|
+
This release establishes the product as an independent repository and focuses on shell, Husky, Cursor hook, and agent integration rather than VS Code extension settings as the primary runtime model.
|
|
8
|
+
|
|
9
|
+
## Highlights
|
|
10
|
+
|
|
11
|
+
- standalone CLI-first repository and runtime
|
|
12
|
+
- npm package name: `smart-commit-copilot-cli`
|
|
13
|
+
- canonical `smartCommitCli` configuration format
|
|
14
|
+
- compatibility input layer for legacy `smartCommit.*`
|
|
15
|
+
- `bridge` command for review, commit-message generation, optional commit, and optional push
|
|
16
|
+
- `passHistory` persistence for successful runs
|
|
17
|
+
- `report generate` for local Markdown work reports
|
|
18
|
+
- optional AI-enhanced reporting with deterministic fallback
|
|
19
|
+
- machine-facing JSON contracts with `schemaVersion`
|
|
20
|
+
- `schema print` for formal JSON Schema output
|
|
21
|
+
- ready-to-copy examples for Husky, Cursor hook, and external agents
|
|
22
|
+
|
|
23
|
+
## Why This Release Matters
|
|
24
|
+
|
|
25
|
+
This version is the foundation for embedding Smart Commit behavior into normal engineering workflows:
|
|
26
|
+
|
|
27
|
+
- shell scripts
|
|
28
|
+
- Git hooks
|
|
29
|
+
- Cursor hooks
|
|
30
|
+
- external agents
|
|
31
|
+
- future scheduled automation
|
|
32
|
+
|
|
33
|
+
## Stability Notes
|
|
34
|
+
|
|
35
|
+
- `smartCommitCli` is the canonical config format going forward
|
|
36
|
+
- `smartCommit.*` remains supported as a compatibility input layer
|
|
37
|
+
- machine-facing JSON outputs are versioned with `schemaVersion`
|
|
38
|
+
- additive changes are preferred over breaking contract changes during the `0.1.x` phase
|
|
39
|
+
|
|
40
|
+
## Suggested Upgrade Path
|
|
41
|
+
|
|
42
|
+
1. start with `smart-commit config resolve`
|
|
43
|
+
2. wire `smart-commit bridge` into hook or agent workflows in `--no-commit --no-push` mode
|
|
44
|
+
3. enable `passHistory`
|
|
45
|
+
4. add `report generate`
|
|
46
|
+
5. optionally enable AI reporting after the local workflow is stable
|
|
47
|
+
|
|
48
|
+
## Known Follow-Up Areas
|
|
49
|
+
|
|
50
|
+
- release metadata finalization in `package.json`
|
|
51
|
+
- repository metadata once a public homepage or repository URL is ready
|
|
52
|
+
- continued improvements to integration ergonomics and reporting depth
|
package/docs/roadmap.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Roadmap
|
|
2
|
+
|
|
3
|
+
This document defines the intended stability boundary for the `0.x` phase of `smart-commit CLI`.
|
|
4
|
+
|
|
5
|
+
## Current Position
|
|
6
|
+
|
|
7
|
+
The project already has a usable standalone automation loop:
|
|
8
|
+
|
|
9
|
+
- config resolution
|
|
10
|
+
- bridge execution
|
|
11
|
+
- pass-history persistence
|
|
12
|
+
- report generation
|
|
13
|
+
- AI-enhanced reporting with local fallback
|
|
14
|
+
- machine-facing JSON schemas
|
|
15
|
+
|
|
16
|
+
The next goal is to move from "feature-complete prototype" to "stable automation product".
|
|
17
|
+
|
|
18
|
+
## Version Strategy
|
|
19
|
+
|
|
20
|
+
## `0.1.x`
|
|
21
|
+
|
|
22
|
+
Focus:
|
|
23
|
+
|
|
24
|
+
- keep command surface stable enough for real integrations
|
|
25
|
+
- continue tightening docs, examples, and CI
|
|
26
|
+
- prefer additive changes over behavior churn
|
|
27
|
+
|
|
28
|
+
Expected stability:
|
|
29
|
+
|
|
30
|
+
- `schemaVersion: "1.0.0"` machine contracts should remain stable unless there is a strong reason to break them
|
|
31
|
+
- `smartCommitCli` remains the canonical config namespace
|
|
32
|
+
- legacy `smartCommit.*` remains compatibility-only
|
|
33
|
+
|
|
34
|
+
Allowed changes:
|
|
35
|
+
|
|
36
|
+
- additive output fields
|
|
37
|
+
- new optional flags
|
|
38
|
+
- more examples and docs
|
|
39
|
+
- richer reporting content
|
|
40
|
+
- more integration helpers
|
|
41
|
+
|
|
42
|
+
Avoid during `0.1.x`:
|
|
43
|
+
|
|
44
|
+
- renaming canonical config groups
|
|
45
|
+
- changing precedence rules
|
|
46
|
+
- changing `bridge` and `report generate` exit-code semantics
|
|
47
|
+
|
|
48
|
+
## `0.2.x`
|
|
49
|
+
|
|
50
|
+
Focus:
|
|
51
|
+
|
|
52
|
+
- broader workflow automation
|
|
53
|
+
- stronger hook ergonomics
|
|
54
|
+
- richer agent-facing integrations
|
|
55
|
+
|
|
56
|
+
Candidate scope:
|
|
57
|
+
|
|
58
|
+
- more explicit machine-facing schemas for sub-objects
|
|
59
|
+
- reusable shell installers or bootstrap commands
|
|
60
|
+
- additional reporting modes
|
|
61
|
+
- optional chunked review or larger-diff orchestration
|
|
62
|
+
|
|
63
|
+
## `0.3.x`
|
|
64
|
+
|
|
65
|
+
Focus:
|
|
66
|
+
|
|
67
|
+
- release hardening and external distribution readiness
|
|
68
|
+
|
|
69
|
+
Candidate scope:
|
|
70
|
+
|
|
71
|
+
- package publish readiness
|
|
72
|
+
- repository metadata finalization
|
|
73
|
+
- CI release workflows
|
|
74
|
+
- migration guides
|
|
75
|
+
- long-term deprecation policy for legacy config input
|
|
76
|
+
|
|
77
|
+
## Toward `1.0`
|
|
78
|
+
|
|
79
|
+
The project is ready to target `1.0` when all of the following are true:
|
|
80
|
+
|
|
81
|
+
- machine-facing contracts are treated as stable product APIs
|
|
82
|
+
- `bridge` and `report generate` are used in real automation without frequent breaking adjustments
|
|
83
|
+
- documentation covers the common adoption paths clearly
|
|
84
|
+
- legacy compatibility behavior has an explicit support window
|
|
85
|
+
- release and test automation are routine rather than manual
|
|
86
|
+
|
|
87
|
+
## Product Rules
|
|
88
|
+
|
|
89
|
+
When making future changes, prefer these rules:
|
|
90
|
+
|
|
91
|
+
1. Preserve JSON contract compatibility when possible.
|
|
92
|
+
2. Prefer additive evolution over renaming or removing fields.
|
|
93
|
+
3. Keep local-first behavior available even when AI features are enabled.
|
|
94
|
+
4. Treat Husky, Cursor hook, and agent integrations as first-class use cases rather than examples only.
|