git-impact 0.6.6 → 0.7.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/skill/SKILL.md CHANGED
@@ -10,8 +10,9 @@ description: >
10
10
  review", "performance review prep", "review my commits", "what's blocked",
11
11
  "weekly summary". Trigger on any request to turn raw git output into
12
12
  something a non-technical manager can read. The skill orchestrates MCP
13
- tools (get_git_activity, get_last_standup_date, save_impact_entry, render_dashboard, get_history, update_context) — it does
14
- not run sqlite3 or other DB commands directly.
13
+ tools (get_git_activity, get_last_standup_date, save_impact_entry,
14
+ render_dashboard, get_history, update_context) it does not run sqlite3
15
+ or other DB commands directly.
15
16
  ---
16
17
 
17
18
  # git-impact
@@ -23,217 +24,31 @@ rules, and produce the output. The MCP server owns all data access (git, DB).
23
24
  You own the language.
24
25
 
25
26
  If the `git-impact` MCP server is not available in this conversation, tell
26
- the user: *"The git-impact MCP server isn't connected. Add it to
27
- `.claude/settings.json` (`mcpServers.git-impact.command = "npx"`,
28
- `args = ["git-impact-mcp"]`) and restart Claude Code."* Don't try to
29
- emulate the workflow with raw bash the SQLite schema is non-trivial
30
- and you'll diverge from the canonical writer.
31
-
32
- **Pass `repo_path` explicitly to every tool call after the first.** The
33
- first `get_git_activity` call returns `_repo_root` in its response. Save
34
- that value and pass it as `repo_path` to every subsequent call
35
- (`save_impact_entry`, `render_dashboard`, etc.). The MCP server caches
36
- the resolved path within a session, but explicit passing is more reliable
37
- when the server's cwd shifts.
38
-
39
- ---
27
+ the user: *"The git-impact MCP server isn't connected. Add it to your
28
+ editor's MCP config (`command = "npx"`, `args = ["git-impact-mcp"]`) and
29
+ restart."* Don't try to emulate the workflow with raw bash — the SQLite
30
+ schema is non-trivial and you'll diverge from the canonical writer.
40
31
 
41
32
  ## Pick a mode from the user's message
42
33
 
43
- | User says | Mode |
44
- |---|---|
45
- | "do my standup", "today", "/git-impact", no args | **standup** (default) |
46
- | "since yesterday", "since 3d", "since 2026-05-01" | **standup** with explicit `since_iso` |
47
- | "review", "performance review", "last 90 days", "Q2 review" | **review** |
48
- | "init", "set up context", "configure for this repo" | **init** |
49
- | "make a presentation", "make a slide", "make me a shareable" | **standup** + **bespoke HTML** (extra step) |
50
-
51
- The default standup writes to the rolling HTML dashboard at
52
- `.git-impact/result.html` (regenerated in step 7 via the
53
- `render_dashboard` MCP tool — *not* by asking the user to run a CLI).
54
- The per-day bespoke HTML is only created when the user explicitly asks
55
- for a presentation — don't write one by default; it's expensive and
56
- most days don't need it.
57
-
58
- If the message is ambiguous, default to **standup**.
59
-
60
- ---
61
-
62
- ## Mode: standup
63
-
64
- ### 0. Resolve the repo path FIRST (before any MCP call)
65
-
66
- The MCP server's cwd is not your editor's cwd — it usually lives inside
67
- the npx cache. Every tool call needs an explicit `repo_path`. Get it once
68
- at the top of the standup:
69
-
70
- ```bash
71
- pwd # returns the absolute path of the open project in Claude Code
72
- ```
73
-
74
- Save that as `REPO_PATH` and pass it as `repo_path` to every MCP tool call
75
- in this standup. If the user's message names a specific project ("for
76
- ~/code/foo"), use that instead.
77
-
78
- ### 1. Resolve the lookback window
79
-
80
- - If the user said an explicit "since X", convert to an ISO timestamp and use it.
81
- - Otherwise call **`get_last_standup_date`**. If it returns a date, use the
82
- start of the day after that date as `since_iso`. If it returns null,
83
- default to start-of-today.
84
-
85
- This is the "since last standup" default — it survives weekends and days off.
86
-
87
- ### 2. Fetch git activity
88
-
89
- Call **`get_git_activity`** with `since_iso` and (optionally) `until_iso`.
90
- You'll get back commits, file stats, branch, and `_repo_root` — the
91
- absolute path the MCP server resolved.
92
-
93
- > **CRITICAL: capture `_repo_root` from this response and pass it as
94
- > `repo_path` to every subsequent tool call** (`save_impact_entry`,
95
- > `render_dashboard`, `get_history`). The MCP server caches it after
96
- > the first successful call, but threading it explicitly is the safe
97
- > belt-and-suspenders move and removes any chance the second tool call
98
- > resolves to a different directory.
99
-
100
- If there are no commits in the window: tell the user clearly and stop. Do
101
- NOT save an empty entry.
102
-
103
- ### 3. Optional: enrich with GitHub PR data
104
-
105
- If the user has a `github_token` saved in their context (the
106
- `get_git_activity` response or a prior `get_github_activity` call will tell
107
- you), call **`get_github_activity`** to pull PR titles and descriptions.
108
- PR descriptions are the single best source for accurate "why it matters"
109
- text — strongly prefer them over inference.
110
-
111
- ### 4. Translate
112
-
113
- Read **`references/translation-rules.md`** for the prompt-engineering details.
114
- Key rules at a glance:
115
-
116
- - **What + why**, not what + how
117
- - **Apply the glossary** from `context.json` (returned by the context resource
118
- or visible in `get_git_activity` output)
119
- - **Provenance is mandatory** — every saved bullet gets `pr` / `commit_body` /
120
- `commit_message` / `ticket` / `inferred`
121
- - **Group related commits** into one bullet, not many
122
- - **2-5 bullets total**, never more
123
-
124
- ### 5. Print the user-facing output
125
-
126
- ```
127
- 📅 [Day, Date or date range]
128
-
129
- ✅ [Summary]
130
- → [Why it matters]
131
-
132
- ⏳ In progress: [What]
133
- → [Expected outcome]
34
+ | User says | Mode | Read |
35
+ |---|---|---|
36
+ | "do my standup", "today", "/git-impact", no args | **standup** (default) | `references/mode-standup.md` |
37
+ | "since yesterday", "since 3d", "since 2026-05-01" | **standup** + explicit `since_iso` | `references/mode-standup.md` |
38
+ | "review", "performance review", "last 90 days", "Q2 review" | **review** | `references/mode-review.md` |
39
+ | "init", "set up context", "configure for this repo" | **init** | `references/mode-init.md` |
40
+ | "make a presentation", "make a slide", "make me a shareable" | **standup** + bespoke HTML | `references/mode-standup.md` + `references/html-template.md` |
134
41
 
135
- 🚫 Blocked: [What] (only if applicable)
136
- [What's needed]
42
+ If the message is ambiguous, default to **standup**. Load only the
43
+ reference file(s) for the chosen mode — don't read all of them.
137
44
 
138
- 📁 [N] files across [areas]
139
- [N] commit(s) on [branch]
140
- ```
141
-
142
- ### 6. Save to history
143
-
144
- Call **`save_impact_entry`** with the structured items including
145
- `provenance` for each. The MCP tool handles the SQLite write — never run
146
- `sqlite3` directly. Required fields per item: `status`, `summary`,
147
- `provenance`. Recommended: `impact`, `refs`.
148
-
149
- Example item:
150
- ```json
151
- {
152
- "status": "done",
153
- "summary": "Shipped multi-tenant data isolation",
154
- "impact": "Unblocks SOC2 sign-off, prevents cross-company data leaks",
155
- "provenance": "pr",
156
- "refs": ["PR #142", "ENG-1234"]
157
- }
158
- ```
159
-
160
- ### 7. Regenerate the rolling dashboard, then print its URL
161
-
162
- Call **`render_dashboard`** with the same `repo_path`. It rewrites
163
- `.git-impact/result.html` so today's entry is included, and returns
164
- the `file://` URL.
165
-
166
- End your reply with that URL on its own last line so the user can
167
- ⌘-click to open:
168
-
169
- ```
170
- 🎯 file:///<absolute-repo-path>/.git-impact/result.html
171
- ```
172
-
173
- Don't try to open a browser yourself — printing the URL is enough.
174
-
175
- **Only if the user explicitly asked for a "presentation", "slide",
176
- "shareable", or "screenshot-friendly" output**, ALSO read
177
- `references/html-template.md` and use your `Write` tool to create
178
- `<repo>/.git-impact/standups/YYYY-MM-DD.html` (plus update
179
- `standups/index.html`). Most days don't need this — skip by default.
180
-
181
- ---
182
-
183
- ## Mode: review
184
-
185
- 1. Parse the period from the user's message:
186
- - "last 30 days" / "30d" → `last_days: 30`
187
- - "last 90 days" / "90d" / no arg → `last_days: 90`
188
- - "Q2-2026" → `from_date: 2026-04-01`, `to_date: 2026-06-30`
189
- 2. Call **`get_history`** with the parsed window.
190
- 3. If no entries returned: tell the user
191
- *"No saved history yet for this period. Use the standup mode daily to
192
- build up history, then come back."* and stop.
193
- 4. Synthesise themes (Features, Reliability, Security, Code review,
194
- Infrastructure). Only include themes that apply.
195
- 5. Frame as **performance review prep** (evidence pack), not a finished
196
- review — bullets should include dates and refs the user can paste into
197
- their own writing.
198
-
199
- Output:
200
- ```
201
- Performance Review Prep — [Period]
202
-
203
- [One headline sentence — biggest contribution]
204
-
205
- 🚀 [High-impact theme]
206
- • Specific achievement [date, refs]
207
-
208
- ✅ [Medium-impact theme]
209
- • ...
210
-
211
- 🔧 [Lower-impact theme]
212
- • ...
213
-
214
- 📊 [N] commits across [N] working days
215
- ```
216
-
217
- ---
218
-
219
- ## Mode: init
220
-
221
- Ask one at a time:
222
-
223
- 1. *"What does your company/product do? (1–2 sentences)"*
224
- 2. *"What does your manager care most about?"*
225
- 3. *"Technical terms to translate? Format: RLS=data security, MFA=login security (blank to skip)"*
226
-
227
- Then call **`update_context`** with the answers. Tell the user:
228
- *"Saved to `.git-impact/context.json`. Commit this to share the glossary with your team."*
229
-
230
- If the install also wrote slash command files for other editors (Cursor,
231
- Copilot, Gemini), point that out so they know the same workflow works
232
- elsewhere.
233
-
234
- ---
45
+ The default standup writes to the rolling HTML dashboard at
46
+ `.git-impact/result.html` (regenerated via the `render_dashboard` MCP tool
47
+ — *not* by asking the user to run a CLI). The per-day bespoke HTML is only
48
+ created when the user explicitly asks for a presentation — don't write one
49
+ by default; it's expensive and most days don't need it.
235
50
 
236
- ## Tone
51
+ ## Tone (applies to every mode)
237
52
 
238
53
  - Write for a non-technical manager. No jargon that isn't in the glossary.
239
54
  - Short sentences. No filler. Skip "this change" / "this commit" constructions.
@@ -243,5 +58,4 @@ elsewhere.
243
58
  - 2 accurate bullets beat 5 vague ones.
244
59
 
245
60
  For prompt details, anti-patterns, and the full output format, see
246
- `references/translation-rules.md`. For the bespoke daily HTML, see
247
- `references/html-template.md`.
61
+ `references/translation-rules.md`.
@@ -0,0 +1,16 @@
1
+ # Mode: init
2
+
3
+ Configure or update the repo's `context.json` interactively. Ask one
4
+ question at a time:
5
+
6
+ 1. *"What does your company/product do? (1–2 sentences)"*
7
+ 2. *"What does your manager care most about?"*
8
+ 3. *"Technical terms to translate? Format: RLS=data security, MFA=login security (blank to skip)"*
9
+
10
+ Then call **`update_context`** with the answers. Tell the user:
11
+ *"Saved to `.git-impact/context.json`. Commit this to share the glossary with your team."*
12
+
13
+ If the install also wrote SKILL.md folders for other editors (Cursor,
14
+ Copilot, Gemini, OpenCode, and any Agent Skills adopter that reads
15
+ `.agents/skills/` — Goose, Amp, Codex, Letta, Roo), point that out so
16
+ they know the same workflow works elsewhere.
@@ -0,0 +1,40 @@
1
+ # Mode: review
2
+
3
+ Synthesise saved standup history into a performance-review evidence pack.
4
+ Not a finished review — bullets carry dates and refs the user can paste
5
+ into their own writing.
6
+
7
+ ## Steps
8
+
9
+ 1. Parse the period from the user's message:
10
+ - "last 30 days" / "30d" → `last_days: 30`
11
+ - "last 90 days" / "90d" / no arg → `last_days: 90`
12
+ - "Q2-2026" → `from_date: 2026-04-01`, `to_date: 2026-06-30`
13
+ 2. Call **`get_history`** with the parsed window.
14
+ 3. If no entries returned: tell the user
15
+ *"No saved history yet for this period. Use the standup mode daily to
16
+ build up history, then come back."* and stop.
17
+ 4. Synthesise themes (Features, Reliability, Security, Code review,
18
+ Infrastructure). Only include themes that apply.
19
+ 5. Frame as **performance review prep** (evidence pack), not a finished
20
+ review — bullets should include dates and refs the user can paste into
21
+ their own writing.
22
+
23
+ ## Output
24
+
25
+ ```
26
+ Performance Review Prep — [Period]
27
+
28
+ [One headline sentence — biggest contribution]
29
+
30
+ 🚀 [High-impact theme]
31
+ • Specific achievement [date, refs]
32
+
33
+ ✅ [Medium-impact theme]
34
+ • ...
35
+
36
+ 🔧 [Lower-impact theme]
37
+ • ...
38
+
39
+ 📊 [N] commits across [N] working days
40
+ ```
@@ -0,0 +1,122 @@
1
+ # Mode: standup
2
+
3
+ The default mode. Translates commits since the user's last standup into
4
+ 2–5 plain-English bullets, prints them, saves to history, regenerates the
5
+ rolling HTML dashboard.
6
+
7
+ ## 0. Resolve the repo path FIRST (before any MCP call)
8
+
9
+ The MCP server's cwd is not your editor's cwd — it usually lives inside
10
+ the npx cache. Every tool call needs an explicit `repo_path`. Get it once
11
+ at the top of the standup:
12
+
13
+ ```bash
14
+ pwd # returns the absolute path of the open project
15
+ ```
16
+
17
+ Save that as `REPO_PATH` and pass it as `repo_path` to every MCP tool call
18
+ in this standup. If the user's message names a specific project ("for
19
+ ~/code/foo"), use that instead.
20
+
21
+ ## 1. Resolve the lookback window
22
+
23
+ - If the user said an explicit "since X", convert to an ISO timestamp and use it.
24
+ - Otherwise call **`get_last_standup_date`**. If it returns a date, use the
25
+ start of the day after that date as `since_iso`. If it returns null,
26
+ default to start-of-today.
27
+
28
+ This is the "since last standup" default — it survives weekends and days off.
29
+
30
+ ## 2. Fetch git activity
31
+
32
+ Call **`get_git_activity`** with `since_iso` and (optionally) `until_iso`.
33
+ You'll get back commits, file stats, branch, and `_repo_root` — the
34
+ absolute path the MCP server resolved.
35
+
36
+ > **CRITICAL: capture `_repo_root` from this response and pass it as
37
+ > `repo_path` to every subsequent tool call** (`save_impact_entry`,
38
+ > `render_dashboard`, `get_history`). The MCP server caches it after
39
+ > the first successful call, but threading it explicitly is the safe
40
+ > belt-and-suspenders move and removes any chance the second tool call
41
+ > resolves to a different directory.
42
+
43
+ If there are no commits in the window: tell the user clearly and stop. Do
44
+ NOT save an empty entry.
45
+
46
+ ## 3. Optional: enrich with GitHub PR data
47
+
48
+ If the user has a `github_token` saved in their context (the
49
+ `get_git_activity` response or a prior `get_github_activity` call will tell
50
+ you), call **`get_github_activity`** to pull PR titles and descriptions.
51
+ PR descriptions are the single best source for accurate "why it matters"
52
+ text — strongly prefer them over inference.
53
+
54
+ ## 4. Translate
55
+
56
+ Read **`references/translation-rules.md`** for the prompt-engineering details.
57
+ Key rules at a glance:
58
+
59
+ - **What + why**, not what + how
60
+ - **Apply the glossary** from `context.json` (returned by the context resource
61
+ or visible in `get_git_activity` output)
62
+ - **Provenance is mandatory** — every saved bullet gets `pr` / `commit_body` /
63
+ `commit_message` / `ticket` / `inferred`
64
+ - **Group related commits** into one bullet, not many
65
+ - **2-5 bullets total**, never more
66
+
67
+ ## 5. Print the user-facing output
68
+
69
+ ```
70
+ 📅 [Day, Date or date range]
71
+
72
+ ✅ [Summary]
73
+ → [Why it matters]
74
+
75
+ ⏳ In progress: [What]
76
+ → [Expected outcome]
77
+
78
+ 🚫 Blocked: [What] (only if applicable)
79
+ → [What's needed]
80
+
81
+ 📁 [N] files across [areas]
82
+ [N] commit(s) on [branch]
83
+ ```
84
+
85
+ ## 6. Save to history
86
+
87
+ Call **`save_impact_entry`** with the structured items including
88
+ `provenance` for each. The MCP tool handles the SQLite write — never run
89
+ `sqlite3` directly. Required fields per item: `status`, `summary`,
90
+ `provenance`. Recommended: `impact`, `refs`.
91
+
92
+ Example item:
93
+ ```json
94
+ {
95
+ "status": "done",
96
+ "summary": "Shipped multi-tenant data isolation",
97
+ "impact": "Unblocks SOC2 sign-off, prevents cross-company data leaks",
98
+ "provenance": "pr",
99
+ "refs": ["PR #142", "ENG-1234"]
100
+ }
101
+ ```
102
+
103
+ ## 7. Regenerate the rolling dashboard, then print its URL
104
+
105
+ Call **`render_dashboard`** with the same `repo_path`. It rewrites
106
+ `.git-impact/result.html` so today's entry is included, and returns
107
+ the `file://` URL.
108
+
109
+ End your reply with that URL on its own last line so the user can
110
+ ⌘-click to open:
111
+
112
+ ```
113
+ 🎯 file:///<absolute-repo-path>/.git-impact/result.html
114
+ ```
115
+
116
+ Don't try to open a browser yourself — printing the URL is enough.
117
+
118
+ **Only if the user explicitly asked for a "presentation", "slide",
119
+ "shareable", or "screenshot-friendly" output**, ALSO read
120
+ `references/html-template.md` and use your `Write` tool to create
121
+ `<repo>/.git-impact/standups/YYYY-MM-DD.html` (plus update
122
+ `standups/index.html`). Most days don't need this — skip by default.