git-impact 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/LICENSE +21 -0
- package/README.md +305 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +267 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/init/installer.d.ts +31 -0
- package/dist/init/installer.d.ts.map +1 -0
- package/dist/init/installer.js +225 -0
- package/dist/init/installer.js.map +1 -0
- package/dist/init/templates.d.ts +12 -0
- package/dist/init/templates.d.ts.map +1 -0
- package/dist/init/templates.js +258 -0
- package/dist/init/templates.js.map +1 -0
- package/dist/mcp/prompts.d.ts +4 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +242 -0
- package/dist/mcp/prompts.js.map +1 -0
- package/dist/mcp/repo.d.ts +14 -0
- package/dist/mcp/repo.d.ts.map +1 -0
- package/dist/mcp/repo.js +106 -0
- package/dist/mcp/repo.js.map +1 -0
- package/dist/mcp/resources.d.ts +4 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +98 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +14 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +61 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +12 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +285 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/readers/git.d.ts +23 -0
- package/dist/readers/git.d.ts.map +1 -0
- package/dist/readers/git.js +120 -0
- package/dist/readers/git.js.map +1 -0
- package/dist/readers/github.d.ts +22 -0
- package/dist/readers/github.d.ts.map +1 -0
- package/dist/readers/github.js +94 -0
- package/dist/readers/github.js.map +1 -0
- package/dist/storage/db.d.ts +31 -0
- package/dist/storage/db.d.ts.map +1 -0
- package/dist/storage/db.js +170 -0
- package/dist/storage/db.js.map +1 -0
- package/dist/translator/prompt.d.ts +21 -0
- package/dist/translator/prompt.d.ts.map +1 -0
- package/dist/translator/prompt.js +117 -0
- package/dist/translator/prompt.js.map +1 -0
- package/dist/translator/translate.d.ts +36 -0
- package/dist/translator/translate.d.ts.map +1 -0
- package/dist/translator/translate.js +73 -0
- package/dist/translator/translate.js.map +1 -0
- package/package.json +55 -0
- package/skill/SKILL.md +238 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Efraim Nafady
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# git-impact
|
|
2
|
+
|
|
3
|
+
Translate your git commits into plain-English business impact — for standups, manager updates, and performance reviews.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
📅 Thursday, May 8, 2026
|
|
7
|
+
|
|
8
|
+
✅ Shipped secure multi-tenant data access layer
|
|
9
|
+
→ Prevents cross-company data leaks. Required for SOC2 compliance sign-off.
|
|
10
|
+
|
|
11
|
+
✅ Fixed login failures for admin users
|
|
12
|
+
→ Unblocks Q2 portal launch, was blocking 3 engineers.
|
|
13
|
+
|
|
14
|
+
⏳ In progress: Refactoring authentication flow
|
|
15
|
+
→ Will reduce login latency by ~40%, targeting end of week.
|
|
16
|
+
|
|
17
|
+
📁 6 files changed across auth + database layers
|
|
18
|
+
4 commits on main
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
No API key needed when used through Claude Code.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
Run this once inside any repo:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx git-impact init
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The wizard asks four questions, then self-installs into the repo:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
git-impact init
|
|
37
|
+
────────────────────────────────────
|
|
38
|
+
|
|
39
|
+
Repo: /your/project
|
|
40
|
+
Files will be committed with your team.
|
|
41
|
+
|
|
42
|
+
What does your company/product do? (1–2 sentences)
|
|
43
|
+
> B2B SaaS for workforce analytics
|
|
44
|
+
|
|
45
|
+
What does your manager care most about?
|
|
46
|
+
> Shipping on time, not breaking prod
|
|
47
|
+
|
|
48
|
+
Technical terms to translate? (optional)
|
|
49
|
+
Format: "RLS=data security, MFA=login security"
|
|
50
|
+
>
|
|
51
|
+
|
|
52
|
+
Which AI tools do you use? (comma-separated, or "all")
|
|
53
|
+
Options: claude, copilot, cursor, gemini
|
|
54
|
+
[default: claude]
|
|
55
|
+
> all
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Then it creates everything and tells you what it did:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
────────────────────────────────────
|
|
62
|
+
git-impact installed
|
|
63
|
+
|
|
64
|
+
✅ .git-impact/context.json
|
|
65
|
+
✅ .gitignore
|
|
66
|
+
✅ .claude/skills/git-impact/SKILL.md
|
|
67
|
+
✅ .github/instructions/git-impact.instructions.md
|
|
68
|
+
✅ .cursor/rules/git-impact.mdc
|
|
69
|
+
✅ .gemini/commands/git-impact.md
|
|
70
|
+
✅ CLAUDE.md
|
|
71
|
+
✅ .git-impact/manifest.json
|
|
72
|
+
|
|
73
|
+
Next steps:
|
|
74
|
+
1. git add .git-impact/context.json .claude/ && git commit -m "chore: add git-impact"
|
|
75
|
+
2. In Claude Code, say: "do my standup"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
After that, open the project in Claude Code and you're ready to go.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Using it
|
|
83
|
+
|
|
84
|
+
Once installed, just talk to your AI editor naturally:
|
|
85
|
+
|
|
86
|
+
| What you say | What happens |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `do my standup` | Translates today's commits |
|
|
89
|
+
| `git-impact since 3d` | Looks back 3 days |
|
|
90
|
+
| `what did I ship this week?` | Looks back 7 days |
|
|
91
|
+
| `generate a performance review` | Synthesises the last 90 days |
|
|
92
|
+
| `set up context for this repo` | Re-runs the init questions inline |
|
|
93
|
+
|
|
94
|
+
Works in **Claude Code**, **GitHub Copilot**, **Cursor**, and **Gemini CLI** — each editor gets its own instruction file.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## How it works
|
|
99
|
+
|
|
100
|
+
git-impact reads your commits with `git log`, loads the team glossary from `.git-impact/context.json`, and translates them into business language. The AI editor does the translation inline — no separate process, no API key needed.
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
your commits → git log → context.json glossary → AI translation → standup
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
History is saved locally to `.git-impact/history.db` (SQLite, gitignored) so performance reviews can synthesise weeks or months of daily standups.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## What gets installed
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
your-project/
|
|
114
|
+
├── .claude/
|
|
115
|
+
│ └── skills/git-impact/
|
|
116
|
+
│ └── SKILL.md # Claude Code skill
|
|
117
|
+
├── .github/
|
|
118
|
+
│ └── instructions/
|
|
119
|
+
│ └── git-impact.instructions.md # GitHub Copilot
|
|
120
|
+
├── .cursor/
|
|
121
|
+
│ └── rules/
|
|
122
|
+
│ └── git-impact.mdc # Cursor
|
|
123
|
+
├── .gemini/
|
|
124
|
+
│ └── commands/
|
|
125
|
+
│ └── git-impact.md # Gemini CLI
|
|
126
|
+
├── .git-impact/
|
|
127
|
+
│ ├── context.json # Team glossary ← commit this
|
|
128
|
+
│ ├── manifest.json # Install record ← commit this
|
|
129
|
+
│ └── history.db # Local history ← gitignored
|
|
130
|
+
└── CLAUDE.md # Usage reminder block (managed)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Commit everything except `history.db`.** Your teammates get the glossary and AI instructions automatically when they clone or pull.
|
|
134
|
+
|
|
135
|
+
Re-running `npx git-impact init` is safe — it updates existing files without creating duplicates.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## context.json
|
|
140
|
+
|
|
141
|
+
The glossary file lives at `.git-impact/context.json`. Commit it so everyone on the team gets the same translation:
|
|
142
|
+
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"companyDescription": "B2B SaaS for workforce analytics",
|
|
146
|
+
"managerPriorities": "Shipping on time, not breaking prod",
|
|
147
|
+
"glossary": {
|
|
148
|
+
"RLS": "data security layer",
|
|
149
|
+
"MFA": "login security",
|
|
150
|
+
"TabPFN": "AI predictions"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
You can edit it by hand or re-run `git-impact init` to update it through the wizard.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Translation rules
|
|
160
|
+
|
|
161
|
+
The skill follows these rules to keep output useful rather than vague:
|
|
162
|
+
|
|
163
|
+
1. **What + why, not what + how** — "Fixed login failures for admin users → unblocks Q2 launch" not "updated auth middleware"
|
|
164
|
+
2. **Apply the glossary** — every term in `context.json` is replaced with its plain-English equivalent
|
|
165
|
+
3. **Never hallucinate** — if impact can't be inferred, says "technical foundation work for [area]"
|
|
166
|
+
4. **Group related commits** — four auth commits become one bullet, not four
|
|
167
|
+
5. **Flag WIP** — draft/WIP commits get `⏳ In progress:` with the expected outcome
|
|
168
|
+
6. **Use numbers** — "reduced latency by ~40%" beats "improved performance"
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Performance reviews
|
|
173
|
+
|
|
174
|
+
Use the standup daily for a few weeks. History builds up in `history.db`. Then:
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
generate a performance review for last 90 days ← Claude Code
|
|
178
|
+
git-impact review --last 90 ← CLI
|
|
179
|
+
git-impact review --quarter Q2-2026 ← CLI, specific quarter
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Output:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
Performance Review — Q2 2026
|
|
186
|
+
|
|
187
|
+
Led the security layer redesign that enabled SOC2 compliance sign-off.
|
|
188
|
+
|
|
189
|
+
🚀 Security
|
|
190
|
+
• Shipped multi-tenant data isolation, unblocking a $2M enterprise deal
|
|
191
|
+
• Resolved 2 auth vulnerabilities before the audit window
|
|
192
|
+
|
|
193
|
+
✅ Features
|
|
194
|
+
• Delivered admin portal ahead of schedule (was blocking 3 engineers)
|
|
195
|
+
|
|
196
|
+
🔧 Reliability
|
|
197
|
+
• Reduced login latency by ~40% through auth flow refactor
|
|
198
|
+
|
|
199
|
+
📊 47 commits across 58 working days
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## CLI reference
|
|
205
|
+
|
|
206
|
+
The CLI requires an Anthropic API key (set during `init` or via `ANTHROPIC_API_KEY`). Not needed when using the Claude Code skill.
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
git-impact init # set up / update this repo
|
|
210
|
+
git-impact today # translate today's commits
|
|
211
|
+
git-impact since yesterday # since yesterday
|
|
212
|
+
git-impact since 3d # last 3 days
|
|
213
|
+
git-impact since 2026-05-01 # since a specific date
|
|
214
|
+
git-impact review --last 90 # performance review, last 90 days
|
|
215
|
+
git-impact review --quarter Q2-2026
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
All commands accept `-p <path>` to point at a different repo. By default the repo is auto-detected from the current directory.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## MCP server
|
|
223
|
+
|
|
224
|
+
The MCP server exposes git data as tools so Claude Code can call them directly. It requires no API key — Claude does the translation in its own session.
|
|
225
|
+
|
|
226
|
+
Add to `.claude/settings.json` in your project:
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"mcpServers": {
|
|
231
|
+
"git-impact": {
|
|
232
|
+
"command": "npx",
|
|
233
|
+
"args": ["git-impact-mcp"]
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
> Until published to npm, use the local path:
|
|
240
|
+
> `"args": ["/path/to/git-impact/dist/mcp/server.js"]`
|
|
241
|
+
|
|
242
|
+
Available tools: `get_git_activity`, `get_github_activity`, `save_impact_entry`, `get_history`, `update_context`.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Local development
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
git clone https://github.com/you/git-impact
|
|
250
|
+
cd git-impact
|
|
251
|
+
npm install
|
|
252
|
+
npm run build
|
|
253
|
+
|
|
254
|
+
# Test the installer
|
|
255
|
+
node dist/cli/index.js init
|
|
256
|
+
|
|
257
|
+
# Test standup translation
|
|
258
|
+
node dist/cli/index.js today
|
|
259
|
+
|
|
260
|
+
# Run the MCP server
|
|
261
|
+
node dist/mcp/server.js
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Project structure
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
src/
|
|
270
|
+
├── init/
|
|
271
|
+
│ ├── installer.ts # install() + runInitWizard() — the spec-kit style init
|
|
272
|
+
│ └── templates.ts # all integration file content as embedded TS strings
|
|
273
|
+
├── readers/
|
|
274
|
+
│ ├── git.ts # reads git log, diffs, file changes
|
|
275
|
+
│ └── github.ts # reads PRs via GitHub API (optional)
|
|
276
|
+
├── translator/
|
|
277
|
+
│ ├── prompt.ts # Claude prompt templates
|
|
278
|
+
│ └── translate.ts # calls Claude API (CLI mode only)
|
|
279
|
+
├── storage/
|
|
280
|
+
│ └── db.ts # per-repo SQLite history + context.json
|
|
281
|
+
├── mcp/
|
|
282
|
+
│ ├── server.ts # MCP server entry point
|
|
283
|
+
│ ├── tools.ts # data tools (get_git_activity, etc.)
|
|
284
|
+
│ ├── resources.ts # MCP resources (context, history overview)
|
|
285
|
+
│ ├── prompts.ts # computed prompt templates (standup, review)
|
|
286
|
+
│ └── repo.ts # auto-detects repo root from cwd
|
|
287
|
+
└── cli/
|
|
288
|
+
└── index.ts # commander CLI
|
|
289
|
+
skill/
|
|
290
|
+
└── SKILL.md # standalone Claude Code skill (copy to any repo)
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Roadmap
|
|
296
|
+
|
|
297
|
+
- [ ] `npm publish` — so `npx git-impact init` works without cloning
|
|
298
|
+
- [ ] Color output (`chalk`) in CLI mode
|
|
299
|
+
- [ ] `--copy` flag to put output on clipboard
|
|
300
|
+
- [ ] GitHub PR enrichment fully wired into standup output
|
|
301
|
+
- [ ] Web dashboard for shared performance review links
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
MIT License
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const commander_1 = require("commander");
|
|
38
|
+
const readline = __importStar(require("readline"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const process = __importStar(require("process"));
|
|
41
|
+
const git_1 = require("../readers/git");
|
|
42
|
+
const github_1 = require("../readers/github");
|
|
43
|
+
const translate_1 = require("../translator/translate");
|
|
44
|
+
const db_1 = require("../storage/db");
|
|
45
|
+
const repo_1 = require("../mcp/repo");
|
|
46
|
+
const installer_1 = require("../init/installer");
|
|
47
|
+
const program = new commander_1.Command();
|
|
48
|
+
program
|
|
49
|
+
.name("git-impact")
|
|
50
|
+
.description("Translate git commits into plain-English business impact")
|
|
51
|
+
.version("0.1.0");
|
|
52
|
+
// ─── today ────────────────────────────────────────────────────────────────────
|
|
53
|
+
program
|
|
54
|
+
.command("today")
|
|
55
|
+
.description("Translate today's commits into business impact")
|
|
56
|
+
.option("-p, --path <path>", "Path to git repository (auto-detected if omitted)")
|
|
57
|
+
.option("--no-github", "Skip GitHub PR data")
|
|
58
|
+
.option("--no-save", "Don't save result to local history")
|
|
59
|
+
.action(async (opts) => {
|
|
60
|
+
const repoRoot = getRepoOrDie(opts.path);
|
|
61
|
+
const context = (0, db_1.loadContext)(repoRoot);
|
|
62
|
+
const since = (0, git_1.startOfDay)();
|
|
63
|
+
const until = new Date();
|
|
64
|
+
const dateLabel = formatDate(until);
|
|
65
|
+
process.stdout.write(`\nRepo: ${repoRoot}\nReading git activity...\n`);
|
|
66
|
+
const git = await (0, git_1.readGitActivity)(repoRoot, since, until).catch((err) => die(`Could not read git history: ${err.message}`));
|
|
67
|
+
if (git.commits.length === 0) {
|
|
68
|
+
console.log(`\n${dateLabel}\n\nNo commits today.\n`);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
let github = null;
|
|
72
|
+
if (opts.github && context?.githubToken) {
|
|
73
|
+
process.stdout.write("Fetching GitHub PR data...\n");
|
|
74
|
+
const remoteUrl = await getRemoteUrl(repoRoot);
|
|
75
|
+
if (remoteUrl) {
|
|
76
|
+
github = await (0, github_1.readGitHubActivity)(context.githubToken, remoteUrl, since, until).catch(() => null);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
process.stdout.write("Translating with Claude...\n\n");
|
|
80
|
+
const result = await (0, translate_1.translateActivity)(git, github, context, dateLabel);
|
|
81
|
+
printResult(dateLabel, result, git);
|
|
82
|
+
if (opts.save !== false) {
|
|
83
|
+
(0, db_1.saveEntry)({
|
|
84
|
+
date: until.toISOString().slice(0, 10),
|
|
85
|
+
repoPath: repoRoot,
|
|
86
|
+
repoName: git.repoName,
|
|
87
|
+
totalCommits: result.totalCommits,
|
|
88
|
+
totalFiles: result.totalFiles,
|
|
89
|
+
filesSummary: result.filesSummary,
|
|
90
|
+
items: result.items,
|
|
91
|
+
rawJson: result.rawJson,
|
|
92
|
+
createdAt: new Date().toISOString(),
|
|
93
|
+
}, repoRoot);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
// ─── since ────────────────────────────────────────────────────────────────────
|
|
97
|
+
program
|
|
98
|
+
.command("since <when>")
|
|
99
|
+
.description('Translate commits since a period — "yesterday", "3d", "2026-05-01"')
|
|
100
|
+
.option("-p, --path <path>", "Path to git repository (auto-detected if omitted)")
|
|
101
|
+
.action(async (when, opts) => {
|
|
102
|
+
const repoRoot = getRepoOrDie(opts.path);
|
|
103
|
+
const context = (0, db_1.loadContext)(repoRoot);
|
|
104
|
+
const since = parseWhen(when);
|
|
105
|
+
const until = new Date();
|
|
106
|
+
const dateLabel = `${formatDate(since)} → ${formatDate(until)}`;
|
|
107
|
+
process.stdout.write(`\nRepo: ${repoRoot}\nReading commits since ${formatDate(since)}...\n`);
|
|
108
|
+
const git = await (0, git_1.readGitActivity)(repoRoot, since, until).catch((err) => die(`Could not read git history: ${err.message}`));
|
|
109
|
+
if (git.commits.length === 0) {
|
|
110
|
+
console.log(`\nNo commits found since ${formatDate(since)}.\n`);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
process.stdout.write("Translating with Claude...\n\n");
|
|
114
|
+
const result = await (0, translate_1.translateActivity)(git, null, context, dateLabel);
|
|
115
|
+
printResult(dateLabel, result, git);
|
|
116
|
+
});
|
|
117
|
+
// ─── review ───────────────────────────────────────────────────────────────────
|
|
118
|
+
program
|
|
119
|
+
.command("review")
|
|
120
|
+
.description("Generate a performance review from saved history")
|
|
121
|
+
.option("-p, --path <path>", "Path to git repository (auto-detected if omitted)")
|
|
122
|
+
.option("--last <days>", "Days to look back", "90")
|
|
123
|
+
.option("--quarter <q>", "Quarter e.g. Q2-2026")
|
|
124
|
+
.action(async (opts) => {
|
|
125
|
+
const repoRoot = getRepoOrDie(opts.path);
|
|
126
|
+
const context = (0, db_1.loadContext)(repoRoot);
|
|
127
|
+
let entries;
|
|
128
|
+
let periodLabel;
|
|
129
|
+
if (opts.quarter) {
|
|
130
|
+
const { from, to } = parseQuarter(opts.quarter);
|
|
131
|
+
entries = (0, db_1.getEntriesForRange)(from, to, repoRoot);
|
|
132
|
+
periodLabel = opts.quarter;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
const days = parseInt(opts.last, 10);
|
|
136
|
+
entries = (0, db_1.getEntriesForDaysAgo)(days, repoRoot);
|
|
137
|
+
periodLabel = `Last ${days} days`;
|
|
138
|
+
}
|
|
139
|
+
if (entries.length === 0) {
|
|
140
|
+
console.log(`\nNo saved history for ${periodLabel} in ${repoRoot}.\nRun \`git-impact today\` daily to build history.\n`);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
process.stdout.write(`\nGenerating review for ${periodLabel} (${entries.length} days)...\n\n`);
|
|
144
|
+
const review = await (0, translate_1.generateReview)(entries, context, periodLabel);
|
|
145
|
+
console.log(`\nPerformance Review — ${review.period}`);
|
|
146
|
+
console.log("=".repeat(50));
|
|
147
|
+
console.log(`\n${review.headline}\n`);
|
|
148
|
+
for (const theme of review.themes) {
|
|
149
|
+
const icon = theme.impact_level === "high" ? "🚀" : theme.impact_level === "medium" ? "✅" : "🔧";
|
|
150
|
+
console.log(`\n${icon} ${theme.name}`);
|
|
151
|
+
for (const bullet of theme.bullets)
|
|
152
|
+
console.log(` • ${bullet}`);
|
|
153
|
+
}
|
|
154
|
+
console.log("\n" + "─".repeat(50));
|
|
155
|
+
console.log(`📊 ${review.stats.total_commits} commits across ${review.stats.working_days} working days\n`);
|
|
156
|
+
});
|
|
157
|
+
// ─── init ─────────────────────────────────────────────────────────────────────
|
|
158
|
+
program
|
|
159
|
+
.command("init")
|
|
160
|
+
.description("Install git-impact into this repo and set up personalization context")
|
|
161
|
+
.option("-p, --path <path>", "Path to git repository (auto-detected if omitted)")
|
|
162
|
+
.action(async (opts) => {
|
|
163
|
+
const repoRoot = getRepoOrDie(opts.path);
|
|
164
|
+
const existing = (0, db_1.loadContext)(repoRoot);
|
|
165
|
+
// Run the interactive wizard (company desc, manager priorities, glossary, integrations)
|
|
166
|
+
const { context, integrations } = await (0, installer_1.runInitWizard)(repoRoot);
|
|
167
|
+
// Ask for CLI-specific secrets (not committed, stored in context.json locally)
|
|
168
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
169
|
+
const ask = (q) => new Promise((res) => rl.question(q, res));
|
|
170
|
+
const anthropicApiKey = await ask(`\n Anthropic API key (for CLI translate mode — not needed for Claude Code)\n` +
|
|
171
|
+
(existing?.anthropicApiKey ? ` [already set, press Enter to keep]\n` : ` [leave blank to skip for now]\n`) +
|
|
172
|
+
` > `);
|
|
173
|
+
const githubToken = await ask(`\n GitHub token (optional — enriches output with PR titles)\n` +
|
|
174
|
+
(existing?.githubToken ? ` [already set, press Enter to keep]\n` : ` [leave blank to skip]\n`) +
|
|
175
|
+
` > `);
|
|
176
|
+
rl.close();
|
|
177
|
+
// Merge CLI-only secrets into context and persist
|
|
178
|
+
const fullContext = {
|
|
179
|
+
...context,
|
|
180
|
+
anthropicApiKey: anthropicApiKey.trim() || existing?.anthropicApiKey,
|
|
181
|
+
githubToken: githubToken.trim() || existing?.githubToken,
|
|
182
|
+
};
|
|
183
|
+
(0, db_1.saveContext)(fullContext, repoRoot);
|
|
184
|
+
// Install all integration files (SKILL.md, Copilot instructions, Cursor rules, etc.)
|
|
185
|
+
const installed = (0, installer_1.install)({ repoRoot, integrations, context, silent: false });
|
|
186
|
+
// Print summary
|
|
187
|
+
console.log(`\n ${"─".repeat(36)}`);
|
|
188
|
+
console.log(` git-impact installed\n`);
|
|
189
|
+
for (const f of installed) {
|
|
190
|
+
const rel = path.relative(repoRoot, f.path);
|
|
191
|
+
const icon = f.action === "created" ? "✅" : f.action === "updated" ? "🔄" : "⏭️ ";
|
|
192
|
+
console.log(` ${icon} ${rel}`);
|
|
193
|
+
}
|
|
194
|
+
console.log(`\n Next steps:`);
|
|
195
|
+
console.log(` 1. git add .git-impact/context.json .claude/ && git commit -m "chore: add git-impact"`);
|
|
196
|
+
console.log(` 2. In Claude Code, say: "do my standup"\n`);
|
|
197
|
+
});
|
|
198
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
199
|
+
function getRepoOrDie(explicitPath) {
|
|
200
|
+
try {
|
|
201
|
+
return (0, repo_1.resolveRepoPath)(explicitPath).path;
|
|
202
|
+
}
|
|
203
|
+
catch (err) {
|
|
204
|
+
die(err.message);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function printResult(dateLabel, result, git) {
|
|
208
|
+
console.log(`📅 ${dateLabel}\n`);
|
|
209
|
+
if (result.items.length === 0) {
|
|
210
|
+
console.log("No significant changes to report.");
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
for (const item of result.items) {
|
|
214
|
+
const icon = item.status === "done" ? "✅" : "⏳";
|
|
215
|
+
console.log(`${icon} ${item.summary}`);
|
|
216
|
+
if (item.impact)
|
|
217
|
+
console.log(` → ${item.impact}`);
|
|
218
|
+
if (item.technical_note)
|
|
219
|
+
console.log(` (${item.technical_note})`);
|
|
220
|
+
console.log("");
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (result.filesSummary) {
|
|
224
|
+
console.log(`📁 ${git.totalFilesChanged} files — ${result.filesSummary}`);
|
|
225
|
+
}
|
|
226
|
+
console.log(` ${git.commits.length} commit(s) on ${git.branch}\n`);
|
|
227
|
+
}
|
|
228
|
+
function formatDate(d) {
|
|
229
|
+
return d.toLocaleDateString("en-US", {
|
|
230
|
+
weekday: "long", year: "numeric", month: "long", day: "numeric",
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
function parseWhen(when) {
|
|
234
|
+
if (when === "yesterday")
|
|
235
|
+
return (0, git_1.startOfDaysAgo)(1);
|
|
236
|
+
const daysMatch = when.match(/^(\d+)d$/);
|
|
237
|
+
if (daysMatch)
|
|
238
|
+
return (0, git_1.startOfDaysAgo)(parseInt(daysMatch[1], 10));
|
|
239
|
+
const parsed = new Date(when);
|
|
240
|
+
if (!isNaN(parsed.getTime()))
|
|
241
|
+
return parsed;
|
|
242
|
+
die(`Could not parse date: "${when}". Try "yesterday", "3d", or "2026-05-01".`);
|
|
243
|
+
}
|
|
244
|
+
function parseQuarter(q) {
|
|
245
|
+
const match = q.match(/^Q([1-4])-(\d{4})$/i);
|
|
246
|
+
if (!match)
|
|
247
|
+
die(`Invalid quarter format. Use Q1-2026, Q2-2026, etc.`);
|
|
248
|
+
const quarter = parseInt(match[1], 10);
|
|
249
|
+
const year = parseInt(match[2], 10);
|
|
250
|
+
const startMonth = (quarter - 1) * 3 + 1;
|
|
251
|
+
const endMonth = startMonth + 2;
|
|
252
|
+
const from = `${year}-${String(startMonth).padStart(2, "0")}-01`;
|
|
253
|
+
const lastDay = new Date(year, endMonth, 0).getDate();
|
|
254
|
+
const to = `${year}-${String(endMonth).padStart(2, "0")}-${lastDay}`;
|
|
255
|
+
return { from, to };
|
|
256
|
+
}
|
|
257
|
+
async function getRemoteUrl(repoPath) {
|
|
258
|
+
const simpleGit = await Promise.resolve().then(() => __importStar(require("simple-git"))).then((m) => m.default);
|
|
259
|
+
const remotes = await simpleGit(repoPath).getRemotes(true).catch(() => []);
|
|
260
|
+
return remotes.find((r) => r.name === "origin")?.refs?.fetch ?? null;
|
|
261
|
+
}
|
|
262
|
+
function die(msg) {
|
|
263
|
+
console.error(`\nError: ${msg}\n`);
|
|
264
|
+
process.exit(1);
|
|
265
|
+
}
|
|
266
|
+
program.parse(process.argv);
|
|
267
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAoC;AACpC,mDAAqC;AACrC,2CAA6B;AAC7B,iDAAmC;AACnC,wCAA6E;AAC7E,8CAAuD;AACvD,uDAA4E;AAC5E,sCAOuB;AACvB,sCAA8C;AAC9C,iDAA2D;AAE3D,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,YAAY,CAAC;KAClB,WAAW,CAAC,0DAA0D,CAAC;KACvE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,iFAAiF;AAEjF,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,gDAAgD,CAAC;KAC7D,MAAM,CAAC,mBAAmB,EAAE,mDAAmD,CAAC;KAChF,MAAM,CAAC,aAAa,EAAE,qBAAqB,CAAC;KAC5C,MAAM,CAAC,WAAW,EAAE,oCAAoC,CAAC;KACzD,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;IACrB,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,OAAO,GAAI,IAAA,gBAAW,EAAC,QAAQ,C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0,0 +1,31 @@
|
|
|
1
|
+
export interface InstallOptions {
|
|
2
|
+
repoRoot: string;
|
|
3
|
+
integrations: Integration[];
|
|
4
|
+
context: RepoContext;
|
|
5
|
+
silent?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type Integration = "claude" | "copilot" | "cursor" | "gemini";
|
|
8
|
+
export interface RepoContext {
|
|
9
|
+
companyDescription: string;
|
|
10
|
+
managerPriorities: string;
|
|
11
|
+
glossary: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export interface InstalledFile {
|
|
14
|
+
path: string;
|
|
15
|
+
action: "created" | "updated" | "skipped";
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Core install function — idempotent, safe to run multiple times.
|
|
19
|
+
* Creates all integration files, context.json, updates CLAUDE.md and .gitignore.
|
|
20
|
+
* Returns a manifest of every file it touched.
|
|
21
|
+
*/
|
|
22
|
+
export declare function install(opts: InstallOptions): InstalledFile[];
|
|
23
|
+
/**
|
|
24
|
+
* Run the interactive init wizard. Resolves with the answers.
|
|
25
|
+
* Designed to be called from the CLI `init` command.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runInitWizard(repoRoot: string): Promise<{
|
|
28
|
+
context: RepoContext;
|
|
29
|
+
integrations: Integration[];
|
|
30
|
+
}>;
|
|
31
|
+
//# sourceMappingURL=installer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../src/init/installer.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;CAC3C;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,aAAa,EAAE,CAyC7D;AA8FD;;;GAGG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7D,OAAO,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B,CAAC,CAyED"}
|