@staff0rd/assist 0.93.0 → 0.93.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 +1 -0
- package/claude/commands/pr.md +7 -0
- package/dist/index.js +33 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,7 @@ After installation, the `assist` command will be available globally. You can als
|
|
|
35
35
|
- `/commit` - Commit only relevant files from the session
|
|
36
36
|
- `/devlog` - Generate devlog entry for the next unversioned day
|
|
37
37
|
- `/next-backlog-item` - Pick and implement the next backlog item
|
|
38
|
+
- `/pr` - Raise a PR with a concise description
|
|
38
39
|
- `/refactor` - Run refactoring checks for code quality
|
|
39
40
|
- `/restructure` - Analyze and restructure tightly-coupled files
|
|
40
41
|
- `/review-comments` - Process PR review comments one by one
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Raise a PR with a concise description
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Raise a pull request for the current branch. Use a concise description with no headers. Do not reference Claude or any AI assistance in the title or body.
|
|
6
|
+
|
|
7
|
+
Use `gh pr create` to create the PR. Keep the title short and the body to a brief plain-text summary of the changes.
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.93.
|
|
9
|
+
version: "0.93.2",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -217,6 +217,17 @@ function getTranscriptConfig() {
|
|
|
217
217
|
return config.transcript;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
+
// src/shared/shellQuote.ts
|
|
221
|
+
function shellQuote(arg) {
|
|
222
|
+
if (/[^a-zA-Z0-9_./:=@%^+,-]/.test(arg)) {
|
|
223
|
+
if (process.platform === "win32") {
|
|
224
|
+
return `"${arg.replace(/"/g, '\\"')}"`;
|
|
225
|
+
}
|
|
226
|
+
return `'${arg.replace(/'/g, "'\\''")}'`;
|
|
227
|
+
}
|
|
228
|
+
return arg;
|
|
229
|
+
}
|
|
230
|
+
|
|
220
231
|
// src/commands/commit/validateMessage.ts
|
|
221
232
|
var MAX_MESSAGE_LENGTH = 50;
|
|
222
233
|
var CONVENTIONAL_COMMIT_REGEX = /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(!)?(\(.+\))?!?: .+$/;
|
|
@@ -240,17 +251,14 @@ function validateMessage(message, config) {
|
|
|
240
251
|
}
|
|
241
252
|
|
|
242
253
|
// src/commands/commit.ts
|
|
243
|
-
function escapeShell(s) {
|
|
244
|
-
return `"${s.replace(/"/g, '\\"')}"`;
|
|
245
|
-
}
|
|
246
254
|
function commitStaged(message) {
|
|
247
|
-
execSync(`git commit -m ${
|
|
255
|
+
execSync(`git commit -m ${shellQuote(message)}`, { stdio: "inherit" });
|
|
248
256
|
return execSync("git rev-parse --short=7 HEAD", {
|
|
249
257
|
encoding: "utf-8"
|
|
250
258
|
}).trim();
|
|
251
259
|
}
|
|
252
260
|
function stageAndCommit(files, message) {
|
|
253
|
-
const escaped = files.map(
|
|
261
|
+
const escaped = files.map(shellQuote).join(" ");
|
|
254
262
|
execSync(`git add ${escaped}`, { stdio: "inherit" });
|
|
255
263
|
return commitStaged(message);
|
|
256
264
|
}
|
|
@@ -270,19 +278,26 @@ function execCommit(files, message, config) {
|
|
|
270
278
|
process.exit(1);
|
|
271
279
|
}
|
|
272
280
|
}
|
|
273
|
-
function commit(args) {
|
|
281
|
+
function commit(args, options2) {
|
|
274
282
|
if (args[0] === "status") {
|
|
275
283
|
execSync("git status && echo '---DIFF---' && git diff", {
|
|
276
284
|
stdio: "inherit"
|
|
277
285
|
});
|
|
278
286
|
return;
|
|
279
287
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
288
|
+
let message;
|
|
289
|
+
let files;
|
|
290
|
+
if (options2.message) {
|
|
291
|
+
message = options2.message;
|
|
292
|
+
files = args;
|
|
293
|
+
} else {
|
|
294
|
+
if (args.length < 1) {
|
|
295
|
+
console.error("Usage: assist commit [-m <message>] [files...] <message>");
|
|
296
|
+
process.exit(1);
|
|
297
|
+
}
|
|
298
|
+
message = args[args.length - 1];
|
|
299
|
+
files = args.slice(0, -1);
|
|
283
300
|
}
|
|
284
|
-
const message = args[args.length - 1];
|
|
285
|
-
const files = args.slice(0, -1);
|
|
286
301
|
const config = loadConfig();
|
|
287
302
|
validateMessage(message, config);
|
|
288
303
|
execCommit(files, message, config);
|
|
@@ -1428,14 +1443,8 @@ Total: ${lines.length} hardcoded color(s)`);
|
|
|
1428
1443
|
|
|
1429
1444
|
// src/commands/verify/run/resolveEntries.ts
|
|
1430
1445
|
import * as path13 from "path";
|
|
1431
|
-
function quoteIfNeeded(arg) {
|
|
1432
|
-
if (/[^a-zA-Z0-9_./:=@%^+,-]/.test(arg)) {
|
|
1433
|
-
return `'${arg.replace(/'/g, "'\\''")}'`;
|
|
1434
|
-
}
|
|
1435
|
-
return arg;
|
|
1436
|
-
}
|
|
1437
1446
|
function buildFullCommand(command, args) {
|
|
1438
|
-
return [
|
|
1447
|
+
return [shellQuote(command), ...(args ?? []).map(shellQuote)].join(" ");
|
|
1439
1448
|
}
|
|
1440
1449
|
function getRunEntries() {
|
|
1441
1450
|
const { run: run3 } = loadConfig();
|
|
@@ -5950,15 +5959,9 @@ function add2() {
|
|
|
5950
5959
|
}
|
|
5951
5960
|
|
|
5952
5961
|
// src/commands/run/index.ts
|
|
5953
|
-
function quoteIfNeeded2(arg) {
|
|
5954
|
-
if (/[^a-zA-Z0-9_./:=@%^+,-]/.test(arg)) {
|
|
5955
|
-
return `'${arg.replace(/'/g, "'\\''")}'`;
|
|
5956
|
-
}
|
|
5957
|
-
return arg;
|
|
5958
|
-
}
|
|
5959
5962
|
function buildCommand(command, configArgs, extraArgs) {
|
|
5960
5963
|
const allArgs = [...configArgs, ...extraArgs];
|
|
5961
|
-
return [
|
|
5964
|
+
return [shellQuote(command), ...allArgs.map(shellQuote)].join(" ");
|
|
5962
5965
|
}
|
|
5963
5966
|
function printAvailableConfigs(configs) {
|
|
5964
5967
|
console.error("Available configurations:");
|
|
@@ -6142,11 +6145,11 @@ function getInstallDir() {
|
|
|
6142
6145
|
}
|
|
6143
6146
|
function isGitRepo(dir) {
|
|
6144
6147
|
try {
|
|
6145
|
-
execSync27("git rev-parse --
|
|
6148
|
+
const result = execSync27("git rev-parse --show-toplevel", {
|
|
6146
6149
|
cwd: dir,
|
|
6147
6150
|
stdio: "pipe"
|
|
6148
|
-
});
|
|
6149
|
-
return
|
|
6151
|
+
}).toString().trim();
|
|
6152
|
+
return path30.resolve(result) === path30.resolve(dir);
|
|
6150
6153
|
} catch {
|
|
6151
6154
|
return false;
|
|
6152
6155
|
}
|
|
@@ -6187,7 +6190,7 @@ var program = new Command();
|
|
|
6187
6190
|
program.name("assist").description("CLI application").version(package_default.version);
|
|
6188
6191
|
program.command("sync").description("Copy command files to ~/.claude/commands").option("-y, --yes", "Overwrite settings.json without prompting").action((options2) => sync(options2));
|
|
6189
6192
|
program.command("init").description("Initialize VS Code and verify configurations").action(init4);
|
|
6190
|
-
program.command("commit").description("Create a git commit with validation").argument("
|
|
6193
|
+
program.command("commit").description("Create a git commit with validation").argument("[args...]", "status | [files...] [message]").option("-m, --message <message>", "Commit message").action(commit);
|
|
6191
6194
|
var configCommand = program.command("config").description("View and modify assist.yml configuration");
|
|
6192
6195
|
configCommand.command("set <key> <value>").description("Set a config value (e.g. commit.push true)").action(configSet);
|
|
6193
6196
|
configCommand.command("get <key>").description("Get a config value").action(configGet);
|