git-jev-stage 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/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "git-jev-stage",
3
+ "version": "0.1.0",
4
+ "description": "Stage the diff hunks that match a sentence.",
5
+ "keywords": [
6
+ "git",
7
+ "staging",
8
+ "hunks",
9
+ "git-add",
10
+ "typesafe",
11
+ "jev",
12
+ "claude-code"
13
+ ],
14
+ "author": "Ibrahem",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/ibrahemid/git-jev-stage.git"
18
+ },
19
+ "homepage": "https://github.com/ibrahemid/git-jev-stage#readme",
20
+ "bugs": {
21
+ "url": "https://github.com/ibrahemid/git-jev-stage/issues"
22
+ },
23
+ "private": false,
24
+ "license": "MIT",
25
+ "type": "module",
26
+ "engines": {
27
+ "node": ">=22"
28
+ },
29
+ "bin": {
30
+ "git-jev-stage": "dist/git-jev-stage.js"
31
+ },
32
+ "main": "dist/index.js",
33
+ "types": "dist/index.d.ts",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./dist/index.d.ts",
37
+ "import": "./dist/index.js"
38
+ }
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "skills",
43
+ ".claude-plugin",
44
+ "README.md",
45
+ "LICENSE"
46
+ ],
47
+ "scripts": {
48
+ "build": "tsup",
49
+ "typecheck": "tsc --noEmit",
50
+ "lint": "biome check .",
51
+ "format": "biome check --write .",
52
+ "test": "vitest run",
53
+ "gate": "scripts/gate.sh",
54
+ "prepack": "npm run build"
55
+ },
56
+ "dependencies": {
57
+ "@typesafe-ai/sdk": "^0.6.0"
58
+ },
59
+ "devDependencies": {
60
+ "@biomejs/biome": "^2.5.14",
61
+ "@types/node": "^22",
62
+ "tsup": "^8.5.1",
63
+ "typescript": "^5",
64
+ "vitest": "^5.0.1"
65
+ },
66
+ "allowScripts": {
67
+ "esbuild@0.27.7": true
68
+ }
69
+ }
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: git-jev-stage
3
+ description: Stage only the diff hunks that match a sentence, with git jev-stage. Use when asked to commit or stage part of the working tree ("commit just the auth fix", "stage only the tests", "leave the debug logging out").
4
+ allowed-tools: Bash(git jev-stage *) Bash(git-jev-stage *) Bash(git status *) Bash(git diff *) Bash(git commit *) Bash(git add *)
5
+ ---
6
+
7
+ `git jev-stage "<sentence>"` classifies every unstaged hunk against the sentence and stages the ones that belong. It never commits, never edits files, and never stages a hunk it is unsure about.
8
+
9
+ ## Steps
10
+
11
+ 1. Run the plan in machine mode:
12
+
13
+ ```
14
+ git jev-stage "<what to stage>" --json --yes
15
+ ```
16
+
17
+ Add `--exclude "<what to leave out>"` when the request names something to keep out.
18
+
19
+ 2. Read the JSON. `applied: true` means the `include` hunks are now in the index. `mixedHunkIds` lists hunks the tool did not stage because they hold both wanted and unwanted lines, or because it was not confident.
20
+
21
+ 3. If `mixedHunkIds` is non-empty, decide each one yourself: read the hunk under `files[].hunks[]` (its `header` and `text`), then stage the whole hunk with `git add -p` if it belongs, or leave it. Never edit the working tree to split a hunk.
22
+
23
+ 4. Confirm with `git diff --cached --stat`, then commit.
24
+
25
+ ## Failure modes
26
+
27
+ - Exit 1 with `missing-api-key`: `TYPESAFE_API_KEY` is not set. Fall back to `git add -p`.
28
+ - Exit 3 with `stale-snapshot` or `index-locked`: the working tree, index, or HEAD changed while planning, or another git process holds the index. Nothing was staged. Run the command again.
29
+ - Exit 1 with `unsupported-entry`: binary, symlink, or submodule changes are present. Stage those by path with `git add` first, or stash them, then rerun.
30
+
31
+ ## Do not
32
+
33
+ - Do not pass `--yes` without `--json` in an agent session; the interactive prompt cannot be answered.
34
+ - Do not describe the whole diff. One sentence naming the change to keep is enough; everything else stays unstaged.