@dansyuqri/spark-joy 0.1.5 → 0.2.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/README.md +26 -2
- package/dist/app/assets/index-CX9CpO88.js +8 -0
- package/dist/app/assets/index-ChCdW9F8.css +1 -0
- package/dist/app/index.html +2 -2
- package/dist/cli.js +326 -28
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/plugin/skills/spark-joy/SKILL.md +41 -2
- package/dist/app/assets/index-BRFjS_MK.css +0 -1
- package/dist/app/assets/index-XTDapI2X.js +0 -8
package/README.md
CHANGED
|
@@ -20,6 +20,8 @@ AI-written PRs are often thousands of lines long: too big to review properly. sp
|
|
|
20
20
|
|
|
21
21
|
<p align="center"><img src="assets/demo.gif" width="800" alt="Choosing a review order, reviewing a chunk with a line note, then zooming into a chunk on the map"></p>
|
|
22
22
|
|
|
23
|
+
Writing the big PR yourself? spark-joy can also split your staged, uncommitted or branch changes into small stacked PRs. See [Split your own changes](#split-your-own-changes).
|
|
24
|
+
|
|
23
25
|
Works from plain git, so GitHub, GitLab or anything else. Nothing is posted anywhere; notes export as markdown for the PR.
|
|
24
26
|
|
|
25
27
|
Inspired by [mr-cast](https://github.com/phanshiyu/mr-cast).
|
|
@@ -77,18 +79,40 @@ In the app:
|
|
|
77
79
|
| Command | What it does |
|
|
78
80
|
| --- | --- |
|
|
79
81
|
| `spark-joy extract [base] [--working]` | Diff `merge-base(base, HEAD)..HEAD` (or the working tree) into a run in `.spark-joy/<branch>/` |
|
|
82
|
+
| `spark-joy extract --staged \| --uncommitted` | Diff `HEAD` against the index or the working tree, for splitting |
|
|
80
83
|
| `spark-joy outline` | Compact list of every file and hunk with sizes and flags |
|
|
81
84
|
| `spark-joy show <ids…> \| --file <path>` | Print hunks in full; accepts ranges like `h003..h010` |
|
|
82
85
|
| `spark-joy links` | Cross-file links: which hunk uses a name another defines |
|
|
83
86
|
| `spark-joy validate [--json]` | Check `plan.json` against the hunks |
|
|
84
87
|
| `spark-joy serve [--port n]` | Start the review app |
|
|
85
88
|
| `spark-joy export [--stdout]` | Write `review.md` |
|
|
89
|
+
| `spark-joy split [--check cmd] [--apply]` | Turn a split plan into stacked local branches |
|
|
86
90
|
| `spark-joy install-skill [--project]` | Install the Claude Code skill |
|
|
87
91
|
|
|
88
92
|
`base` defaults to `origin/HEAD`, then `origin/main`, `origin/master` or `main`. Runs are stored in `.spark-joy/`, which ignores itself in git.
|
|
89
93
|
|
|
90
94
|
The plan format is documented in [SKILL.md](plugin/skills/spark-joy/SKILL.md), and the schema is in [shared/schema.ts](shared/schema.ts).
|
|
91
95
|
|
|
96
|
+
## Split your own changes
|
|
97
|
+
|
|
98
|
+
Writing the big PR yourself? Ask Claude to "split my changes into smaller PRs". It turns your staged changes, uncommitted changes or whole branch into small PRs, each built on the one before.
|
|
99
|
+
|
|
100
|
+
<p align="center"><img src="assets/split.gif" width="800" alt="Extracting uncommitted changes, previewing five stacked PRs in the app, checking each PR's tests, then creating the branches"></p>
|
|
101
|
+
|
|
102
|
+
1. **Extract** what you want to split: `--staged`, `--uncommitted`, or a base branch for the whole branch.
|
|
103
|
+
2. **Plan.** Claude groups every change into ordered PRs: each must build on the ones before, and lockfiles go with the change that needs them. Preview the stack in the app; the Map shows how the PRs depend on each other.
|
|
104
|
+
3. **Check.** `split` builds the PRs and confirms the last one matches your changes exactly. `--check` runs your tests on each PR in a temporary worktree.
|
|
105
|
+
4. **Apply.** `split --apply` creates the local branches and writes each PR's title and description to `prs.md`. Nothing is pushed.
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
spark-joy extract --uncommitted # or --staged, or a base for the whole branch
|
|
109
|
+
spark-joy split # dry run
|
|
110
|
+
spark-joy split --check "npm ci && npm test" # optional
|
|
111
|
+
spark-joy split --apply # creates <branch>-split/1-…, 2-…
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Your working tree, staged files and current branch are never touched: the PRs are built from a temporary git index. If anything doesn't add up, no branches are created.
|
|
115
|
+
|
|
92
116
|
## Develop
|
|
93
117
|
|
|
94
118
|
```sh
|
|
@@ -102,8 +126,8 @@ npm run dev:app # Vite dev server; proxies /api to a running `spark-joy ser
|
|
|
102
126
|
|
|
103
127
|
Layout:
|
|
104
128
|
|
|
105
|
-
- `cli/`: commands, diff parsing, splitting, classification, server.
|
|
129
|
+
- `cli/`: commands, diff parsing, splitting, classification, server, stacked-branch builder.
|
|
106
130
|
- `shared/`: schemas, validation and derived state, used by both the CLI and the app.
|
|
107
131
|
- `src/`: the React review app.
|
|
108
|
-
- `
|
|
132
|
+
- `plugin/`: the Claude Code plugin and skill.
|
|
109
133
|
- `test/`: Vitest, with a fixture git repo.
|