@m2015agg/git-skill 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -1
- package/dist/util/hooks.js +11 -3
- package/dist/util/hooks.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
# @m2015agg/git-skill
|
|
2
2
|
|
|
3
|
-
Git history intelligence for LLMs
|
|
3
|
+
**Git history intelligence for LLMs.** Gives AI agents institutional memory over a codebase's evolution, decisions, and health trends.
|
|
4
|
+
|
|
5
|
+
## Why This Exists
|
|
6
|
+
|
|
7
|
+
AI coding agents start every session blind. They don't know that `chat.py` has been edited 209 times and is the most volatile file in your project. They don't know you reverted that RAG optimization last week because it broke prod. They don't know the codebase just went through a major refactor and things are stabilizing.
|
|
8
|
+
|
|
9
|
+
**git-skill fixes this.** It indexes your entire git history into a local SQLite cache, computes analytics (churn hotspots, coupling, decision points, quality metrics), and writes a health summary directly into Claude Code's memory system — so every new session starts with full awareness.
|
|
10
|
+
|
|
11
|
+
### What It Solves
|
|
12
|
+
|
|
13
|
+
- **"We tried that already"** — Enrichment data tracks what was tried, reverted, and why. Agents stop re-suggesting failed approaches.
|
|
14
|
+
- **"Why does this keep breaking?"** — Churn hotspots and fix-on-fix metrics surface files that are thrashing. Agents flag risk before touching them.
|
|
15
|
+
- **"Who knows this code?"** — Author expertise mapping shows who has the most context on any file or directory.
|
|
16
|
+
- **"What happened while I was gone?"** — Decision points, trends, and release notes give a complete picture of codebase evolution.
|
|
17
|
+
- **"The agent has no memory"** — The `context-update` command writes codebase health directly into Claude's memory system. Every session starts informed.
|
|
18
|
+
|
|
19
|
+
### How It Fits Together
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
git history ──→ SQLite cache ──→ Analytics ──→ Claude Memory
|
|
23
|
+
(commits, (indexed, (hotspots, (auto-loaded
|
|
24
|
+
diffs, searchable) trends, every session)
|
|
25
|
+
branches) decisions)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Three layers of intelligence, each useful independently:
|
|
29
|
+
1. **Raw data** — every commit, file change, branch, and tag indexed and searchable
|
|
30
|
+
2. **Derived analytics** — churn hotspots, file coupling, decision points, author expertise, quality metrics
|
|
31
|
+
3. **LLM enrichments** — AI-analyzed intent, reasoning, and impact per commit (optional)
|
|
32
|
+
|
|
33
|
+
The `context-update` command bridges git-skill to Claude's memory system, writing a concise health summary that `findRelevantMemories` loads at session start.
|
|
34
|
+
|
|
35
|
+
---
|
|
4
36
|
|
|
5
37
|
## Install
|
|
6
38
|
|
|
@@ -182,6 +214,16 @@ Claude can read the config, run the commands, and interpret the results. When in
|
|
|
182
214
|
- [`@m2015agg/context7-skill`](https://github.com/m2015agg/context7-skill) — Library docs cache
|
|
183
215
|
- `@m2015agg/git-skill` — Git history intelligence
|
|
184
216
|
|
|
217
|
+
## Known Gaps
|
|
218
|
+
|
|
219
|
+
- **Team sharing** — Enrichments and embeddings are per-user. On a team of 3, each person pays independently for identical LLM analysis. A JSONL export/import mechanism is planned to share enrichments via git. See [team-collaboration.md](docs/specs/team-collaboration.md) for the full brainstorm.
|
|
220
|
+
|
|
221
|
+
## Detailed Documentation
|
|
222
|
+
|
|
223
|
+
- [Design Spec](docs/specs/2026-03-31-git-skill-design.md) — Full architecture, schema, algorithms, and test strategy
|
|
224
|
+
- [GeorgeWorks: Memory Integration](docs/specs/context-injection.md) — How context-update writes to Claude's memory system, internal architecture of `findRelevantMemories`, consolidation phases, and thresholds
|
|
225
|
+
- [Opus Verification Layer](docs/specs/opus-verification-layer.md) — Concept for pre-commit AI verification that catches reverted re-introductions and thrashing patterns
|
|
226
|
+
|
|
185
227
|
## License
|
|
186
228
|
|
|
187
229
|
MIT
|
package/dist/util/hooks.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync, existsSync, chmodSync, unlinkSync } from "fs";
|
|
2
2
|
import { join } from "path";
|
|
3
3
|
const HOOK_MARKER = "# git-skill hook";
|
|
4
|
-
const HOOK_CONTENT = `\n${HOOK_MARKER}\ngit-skill capture --hook 2>/dev/null &\n`;
|
|
4
|
+
const HOOK_CONTENT = `\n${HOOK_MARKER}\ngit-skill capture --hook 2>/dev/null &\ngit-skill context-update 2>/dev/null &\n`;
|
|
5
5
|
export function installHook(gitDir) {
|
|
6
6
|
const hookPath = join(gitDir, "hooks", "post-commit");
|
|
7
7
|
if (existsSync(hookPath)) {
|
|
8
8
|
const content = readFileSync(hookPath, "utf-8");
|
|
9
|
-
if (content.includes(HOOK_MARKER))
|
|
9
|
+
if (content.includes(HOOK_MARKER)) {
|
|
10
|
+
// Upgrade old hook that doesn't have context-update
|
|
11
|
+
if (!content.includes("context-update")) {
|
|
12
|
+
const upgraded = content.replace(/git-skill capture --hook 2>\/dev\/null &\n/, "git-skill capture --hook 2>/dev/null &\ngit-skill context-update 2>/dev/null &\n");
|
|
13
|
+
writeFileSync(hookPath, upgraded);
|
|
14
|
+
chmodSync(hookPath, 0o755);
|
|
15
|
+
return "updated";
|
|
16
|
+
}
|
|
10
17
|
return "already_installed";
|
|
18
|
+
}
|
|
11
19
|
writeFileSync(hookPath, content + HOOK_CONTENT);
|
|
12
20
|
chmodSync(hookPath, 0o755);
|
|
13
21
|
return "updated";
|
|
@@ -24,7 +32,7 @@ export function removeHook(gitDir) {
|
|
|
24
32
|
if (!content.includes(HOOK_MARKER))
|
|
25
33
|
return "not_found";
|
|
26
34
|
const lines = content.split("\n");
|
|
27
|
-
const filtered = lines.filter(line => !line.includes(HOOK_MARKER) && !line.includes("git-skill capture"));
|
|
35
|
+
const filtered = lines.filter(line => !line.includes(HOOK_MARKER) && !line.includes("git-skill capture") && !line.includes("git-skill context-update"));
|
|
28
36
|
const result = filtered.join("\n").trim();
|
|
29
37
|
if (result === "#!/bin/sh" || result === "") {
|
|
30
38
|
unlinkSync(hookPath);
|
package/dist/util/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/util/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,WAAW,GAAG,kBAAkB,CAAC;AACvC,MAAM,YAAY,GAAG,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/util/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,WAAW,GAAG,kBAAkB,CAAC;AACvC,MAAM,YAAY,GAAG,KAAK,WAAW,oFAAoF,CAAC;AAE1H,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;IAEtD,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAChD,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YAClC,oDAAoD;YACpD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAC9B,4CAA4C,EAC5C,kFAAkF,CACnF,CAAC;gBACF,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBAClC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBAC3B,OAAO,SAAS,CAAC;YACnB,CAAC;YAC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