@m2015agg/git-skill 0.4.2 → 0.4.4
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
CHANGED
|
@@ -56,7 +56,7 @@ For semantic search, configure an embedding provider. Works with any OpenAI-comp
|
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
58
|
git-skill install # Configure embedding provider
|
|
59
|
-
git-skill embed # Generate embeddings for all commits
|
|
59
|
+
git-skill embed # Generate embeddings for all commits + enrichments
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
Or manually edit `~/.config/git-skill/config.json`:
|
|
@@ -170,7 +170,7 @@ git-skill why <hash> # View enrichment for a commit
|
|
|
170
170
|
| `git-skill init` | Per-project setup (hook, snapshot, permissions) |
|
|
171
171
|
| `git-skill approve` | Pre-approve read commands in Claude Code |
|
|
172
172
|
| `git-skill docs` | Output CLAUDE.md snippet |
|
|
173
|
-
| `git-skill cron` | Nightly snapshot automation |
|
|
173
|
+
| `git-skill cron` | Nightly fetch + snapshot + embed automation |
|
|
174
174
|
| `git-skill update` | Self-update |
|
|
175
175
|
| `git-skill uninstall` | Clean removal |
|
|
176
176
|
|
|
@@ -188,7 +188,7 @@ Three-layer SQLite cache at `.git-history/history.db`:
|
|
|
188
188
|
2. **Derived analytics** — file evolution, churn hotspots, coupling, decision points, author expertise, trends
|
|
189
189
|
3. **LLM enrichments** — intent, reasoning, category per commit (optional, via `enrich`)
|
|
190
190
|
|
|
191
|
-
Search uses BM25 (
|
|
191
|
+
Search uses hybrid BM25 + vector similarity (Reciprocal Rank Fusion) when embeddings exist. Falls back to BM25-only when no embeddings are configured. Use `--bm25` flag to force keyword-only search.
|
|
192
192
|
|
|
193
193
|
## Built-in Metrics
|
|
194
194
|
|
|
@@ -237,6 +237,26 @@ Example output:
|
|
|
237
237
|
|
|
238
238
|
Works without an LLM configured (local-only analysis shows edit counts and revert history). With an LLM configured, provides deep reasoning about why previous attempts failed.
|
|
239
239
|
|
|
240
|
+
## Automation
|
|
241
|
+
|
|
242
|
+
git-skill runs automatically at two levels:
|
|
243
|
+
|
|
244
|
+
**Every commit** (post-commit hook):
|
|
245
|
+
- `git-skill capture` — indexes the new commit into SQLite + FTS
|
|
246
|
+
- `git-skill context-update` — refreshes Claude's memory with latest alerts
|
|
247
|
+
|
|
248
|
+
**Nightly at 3 AM** (cron, set up with `git-skill cron`):
|
|
249
|
+
- `git fetch --all` — pulls in team members' commits
|
|
250
|
+
- `git-skill snapshot` — full re-index with 8 phases:
|
|
251
|
+
1. Backfill commits
|
|
252
|
+
2. Index branches
|
|
253
|
+
3. Index tags
|
|
254
|
+
4. Rebuild FTS search index
|
|
255
|
+
5. Compute analytics (hotspots, coupling, decisions, expertise, trends)
|
|
256
|
+
6. Compute built-in metrics (revert rate, fix-on-fix, scope creep)
|
|
257
|
+
7. Auto-embed new commits + enrichments
|
|
258
|
+
8. Update Claude memory context with health summary
|
|
259
|
+
|
|
240
260
|
## Need Help?
|
|
241
261
|
|
|
242
262
|
git-skill is designed for AI agents. If you're using Claude Code, just ask:
|
package/dist/commands/init.js
CHANGED
|
@@ -6,7 +6,7 @@ import { installHook } from "../util/hooks.js";
|
|
|
6
6
|
import { isGitRepo } from "../util/git.js";
|
|
7
7
|
import { upsertSection } from "../util/claude-md.js";
|
|
8
8
|
import { getSkillDoc } from "./docs.js";
|
|
9
|
-
import { WALKTHROUGH } from "../templates/walkthrough.js";
|
|
9
|
+
import { WALKTHROUGH, REVIEW_COMMAND } from "../templates/walkthrough.js";
|
|
10
10
|
function write(msg) { process.stdout.write(msg); }
|
|
11
11
|
export function initCommand() {
|
|
12
12
|
return new Command("init")
|
|
@@ -49,12 +49,27 @@ export function initCommand() {
|
|
|
49
49
|
write("3. Writing CLAUDE.md...\n");
|
|
50
50
|
const claudeMdResult = upsertSection(join(cwd, "CLAUDE.md"), getSkillDoc());
|
|
51
51
|
write(` CLAUDE.md: ${claudeMdResult}\n`);
|
|
52
|
-
// 5. Write walkthrough
|
|
53
|
-
write("4. Writing
|
|
52
|
+
// 5. Write walkthrough + review command
|
|
53
|
+
write("4. Writing slash commands...\n");
|
|
54
54
|
const walkthroughDir = join(cwd, ".claude", "commands");
|
|
55
55
|
mkdirSync(walkthroughDir, { recursive: true });
|
|
56
56
|
writeFileSync(join(walkthroughDir, "git-history.md"), WALKTHROUGH);
|
|
57
|
-
write("
|
|
57
|
+
write(" /git-history — explore repo history\n");
|
|
58
|
+
// Install review command if it doesn't already exist (don't overwrite user customizations)
|
|
59
|
+
const reviewPath = join(walkthroughDir, "review.md");
|
|
60
|
+
if (!existsSync(reviewPath)) {
|
|
61
|
+
writeFileSync(reviewPath, REVIEW_COMMAND);
|
|
62
|
+
write(" /review — code review with git-skill verify (NEW)\n");
|
|
63
|
+
write("\n");
|
|
64
|
+
write(" The /review command adds git history verification to your code review.\n");
|
|
65
|
+
write(" It runs git-skill verify to check if staged changes repeat past mistakes,\n");
|
|
66
|
+
write(" flags files in churn hotspots, and blocks re-introduction of reverted code.\n");
|
|
67
|
+
write(" Customize it at .claude/commands/review.md\n");
|
|
68
|
+
write("\n");
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
write(" /review — already exists (not overwritten)\n");
|
|
72
|
+
}
|
|
58
73
|
// 6. Run snapshot
|
|
59
74
|
if (!opts.skipSnapshot) {
|
|
60
75
|
write("5. Running initial snapshot...\n");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MA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CAAC,CAAC,CAAC;gBACnC,YAAY,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YAC5E,CAAC;YAAC,MAAM,CAAC;gBACP,KAAK,CAAC,mEAAmE,CAAC,CAAC;YAC7E,CAAC;QACH,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACnC,CAAC;QAED,iBAAiB;QACjB,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAClD,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnC,YAAY,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC3E,CAAC;QAAC,MAAM,CAAC;YACP,KAAK,CAAC,iEAAiE,CAAC,CAAC;QAC3E,CAAC;QAED,qBAAqB;QACrB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC/B,CAAC;QAED,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export declare const WALKTHROUGH = "# Git History Walkthrough\n\nUse git-skill to explore this repository's history.\n\n## Quick Start\n```\ngit-skill doctor # Check setup health\ngit-skill hotspots # Find churning files\ngit-skill trends # View metric trends\ngit-skill search \"auth\" # Search history\n```\n";
|
|
2
|
+
export declare const REVIEW_COMMAND = "---\ndescription: \"Code review with git history verification \u2014 checks for repeated mistakes before merge\"\n---\n\n# Code Review with History Verification\n\nReview the current branch changes before merging.\n\n**PROCESS:**\n\n1. **Run tests**:\n ```bash\n # Run the project's test suite (adjust command for your project)\n npm test # Node.js\n # pytest # Python\n # cargo test # Rust\n ```\n\n2. **Git History Verification** (prevent re-trying failed approaches):\n ```bash\n git-skill verify\n ```\n If `git-skill verify` returns WARN or BLOCK:\n - **BLOCK**: STOP. This change re-introduces something that was explicitly reverted. Ask the user before proceeding.\n - **WARN**: Note the warning. Check if the current approach addresses the previous failure. Proceed with caution.\n - **PASS**: No concerns from history.\n\n3. **Check codebase health**:\n ```bash\n git-skill doctor\n git-skill hotspots --limit 5\n ```\n Flag any files being modified that appear in the hotspots list.\n\n4. **Review against criteria**:\n - **Critical** (must fix): Security vulnerabilities, data loss risks, breaking changes, tests failing\n - **Major** (should fix): Missing error handling, pattern violations, missing tests\n - **Minor** (optional): Style, docs, optimization\n\n5. **Auto-fix critical/major issues**:\n - Fix issues following established patterns\n - Run tests after each fix\n - Commit fixes separately\n\n6. **Report findings**:\n - List issues found and fixed\n - List any WARN/BLOCK from git-skill verify\n - Provide verification commands\n - Recommend proceeding or returning to implementation\n\n**IMPORTANT:**\n- `git-skill verify` is authoritative \u2014 if it says something was reverted before, take it seriously\n- Auto-fix critical/major issues, don't just report them\n- Always run tests after fixes\n";
|
|
@@ -10,4 +10,59 @@ git-skill trends # View metric trends
|
|
|
10
10
|
git-skill search "auth" # Search history
|
|
11
11
|
\`\`\`
|
|
12
12
|
`;
|
|
13
|
+
export const REVIEW_COMMAND = `---
|
|
14
|
+
description: "Code review with git history verification — checks for repeated mistakes before merge"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Code Review with History Verification
|
|
18
|
+
|
|
19
|
+
Review the current branch changes before merging.
|
|
20
|
+
|
|
21
|
+
**PROCESS:**
|
|
22
|
+
|
|
23
|
+
1. **Run tests**:
|
|
24
|
+
\`\`\`bash
|
|
25
|
+
# Run the project's test suite (adjust command for your project)
|
|
26
|
+
npm test # Node.js
|
|
27
|
+
# pytest # Python
|
|
28
|
+
# cargo test # Rust
|
|
29
|
+
\`\`\`
|
|
30
|
+
|
|
31
|
+
2. **Git History Verification** (prevent re-trying failed approaches):
|
|
32
|
+
\`\`\`bash
|
|
33
|
+
git-skill verify
|
|
34
|
+
\`\`\`
|
|
35
|
+
If \`git-skill verify\` returns WARN or BLOCK:
|
|
36
|
+
- **BLOCK**: STOP. This change re-introduces something that was explicitly reverted. Ask the user before proceeding.
|
|
37
|
+
- **WARN**: Note the warning. Check if the current approach addresses the previous failure. Proceed with caution.
|
|
38
|
+
- **PASS**: No concerns from history.
|
|
39
|
+
|
|
40
|
+
3. **Check codebase health**:
|
|
41
|
+
\`\`\`bash
|
|
42
|
+
git-skill doctor
|
|
43
|
+
git-skill hotspots --limit 5
|
|
44
|
+
\`\`\`
|
|
45
|
+
Flag any files being modified that appear in the hotspots list.
|
|
46
|
+
|
|
47
|
+
4. **Review against criteria**:
|
|
48
|
+
- **Critical** (must fix): Security vulnerabilities, data loss risks, breaking changes, tests failing
|
|
49
|
+
- **Major** (should fix): Missing error handling, pattern violations, missing tests
|
|
50
|
+
- **Minor** (optional): Style, docs, optimization
|
|
51
|
+
|
|
52
|
+
5. **Auto-fix critical/major issues**:
|
|
53
|
+
- Fix issues following established patterns
|
|
54
|
+
- Run tests after each fix
|
|
55
|
+
- Commit fixes separately
|
|
56
|
+
|
|
57
|
+
6. **Report findings**:
|
|
58
|
+
- List issues found and fixed
|
|
59
|
+
- List any WARN/BLOCK from git-skill verify
|
|
60
|
+
- Provide verification commands
|
|
61
|
+
- Recommend proceeding or returning to implementation
|
|
62
|
+
|
|
63
|
+
**IMPORTANT:**
|
|
64
|
+
- \`git-skill verify\` is authoritative — if it says something was reverted before, take it seriously
|
|
65
|
+
- Auto-fix critical/major issues, don't just report them
|
|
66
|
+
- Always run tests after fixes
|
|
67
|
+
`;
|
|
13
68
|
//# sourceMappingURL=walkthrough.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walkthrough.js","sourceRoot":"","sources":["../../src/templates/walkthrough.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;CAW1B,CAAC"}
|
|
1
|
+
{"version":3,"file":"walkthrough.js","sourceRoot":"","sources":["../../src/templates/walkthrough.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;CAW1B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsD7B,CAAC"}
|