next-issue 16.9.0 → 16.10.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/dist/cli/skills.mjs +1 -1
- package/dist/cli/start.mjs +1 -1
- package/dist/shared/args.mjs +13 -13
- package/dist/shared/config.mjs +2 -2
- package/dist/shared/issue-format.mjs +1 -0
- package/dist/shared/prompts.mjs +1 -1
- package/dist/worker/serve.mjs +1 -1
- package/package.json +1 -1
- package/skills/create-issue/SKILL.md +16 -14
- package/skills/create-issue/template.md +2 -0
package/dist/cli/skills.mjs
CHANGED
|
@@ -31,7 +31,7 @@ export async function chooseScope(scope) {
|
|
|
31
31
|
return scope;
|
|
32
32
|
}
|
|
33
33
|
if (process.stdin.isTTY !== true) {
|
|
34
|
-
throw new Error('init needs
|
|
34
|
+
throw new Error('`init` needs `--scope user|project` when there is no terminal to ask where to install the skills');
|
|
35
35
|
}
|
|
36
36
|
return askScope(process.stdin, process.stdout);
|
|
37
37
|
}
|
package/dist/cli/start.mjs
CHANGED
|
@@ -9,7 +9,7 @@ const REFUSED_GOING = [
|
|
|
9
9
|
'the worker is restarting, try again soon',
|
|
10
10
|
];
|
|
11
11
|
const SILENT = 'the next-issue worker did not answer';
|
|
12
|
-
const STARTED = 'the run started in the worker; follow it with npx -y next-issue@latest logs and stop it with npx -y next-issue@latest stop
|
|
12
|
+
const STARTED = 'the run started in the worker; follow it with `npx -y next-issue@latest logs` and stop it with `npx -y next-issue@latest stop`\n';
|
|
13
13
|
export async function startInWorker(root, argv) {
|
|
14
14
|
const version = await packageVersion();
|
|
15
15
|
const given = givenStartFlags(argv);
|
package/dist/shared/args.mjs
CHANGED
|
@@ -31,31 +31,31 @@ export function parseArgs(argv) {
|
|
|
31
31
|
return args;
|
|
32
32
|
}
|
|
33
33
|
if (args.command === undefined && flag !== undefined) {
|
|
34
|
-
throw new Error('no command given: use npx -y next-issue@latest start to start a run, or see npx -y next-issue@latest --help');
|
|
34
|
+
throw new Error('no command given: use `npx -y next-issue@latest start` to start a run, or see `npx -y next-issue@latest --help`');
|
|
35
35
|
}
|
|
36
36
|
if (args.command !== undefined && args.command !== 'start' && runFlag !== undefined) {
|
|
37
|
-
throw new Error(
|
|
37
|
+
throw new Error(`\`${args.command}\` does not take \`${runFlag}\`: it belongs to \`start\``);
|
|
38
38
|
}
|
|
39
39
|
if (args.command !== undefined && args.command !== 'init' && args.scope !== undefined) {
|
|
40
|
-
throw new Error(
|
|
40
|
+
throw new Error(`\`${args.command}\` does not take \`--scope\`: it belongs to \`init\``);
|
|
41
41
|
}
|
|
42
42
|
if ((args.command === 'watch' || args.command === 'hunt') && args.on === undefined) {
|
|
43
|
-
throw new Error(
|
|
43
|
+
throw new Error(`\`${args.command}\` takes \`on\` or \`off\``);
|
|
44
44
|
}
|
|
45
45
|
if (args.command !== undefined && args.command !== 'init' && args.force) {
|
|
46
|
-
throw new Error(
|
|
46
|
+
throw new Error(`\`${args.command}\` does not take \`--force\`: it belongs to \`init\``);
|
|
47
47
|
}
|
|
48
48
|
return args;
|
|
49
49
|
}
|
|
50
50
|
function onOffValue(name, value) {
|
|
51
51
|
if (value !== 'on' && value !== 'off') {
|
|
52
|
-
throw new Error(
|
|
52
|
+
throw new Error(`\`${name}\` takes \`on\` or \`off\``);
|
|
53
53
|
}
|
|
54
54
|
return value === 'on';
|
|
55
55
|
}
|
|
56
56
|
function scopeValue(value) {
|
|
57
57
|
if (value !== 'user' && value !== 'project') {
|
|
58
|
-
throw new Error('
|
|
58
|
+
throw new Error('`--scope` takes `user` or `project`');
|
|
59
59
|
}
|
|
60
60
|
return value;
|
|
61
61
|
}
|
|
@@ -96,11 +96,11 @@ function readArgs(passed) {
|
|
|
96
96
|
given[RUN_FLAGS.get(arg)] = onOffValue(arg, argv[index]);
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
|
-
throw new Error(`Unknown argument:
|
|
99
|
+
throw new Error(`Unknown argument: \`${arg}\``);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
if (given.hunt === true && given.watch === false) {
|
|
103
|
-
throw new Error('hunting needs watching:
|
|
103
|
+
throw new Error('hunting needs watching: `--hunt on` does not go with `--watch off`');
|
|
104
104
|
}
|
|
105
105
|
args.watch = given.watch ?? true;
|
|
106
106
|
args.hunt = given.hunt ?? false;
|
|
@@ -109,7 +109,7 @@ function readArgs(passed) {
|
|
|
109
109
|
function command(arg) {
|
|
110
110
|
const found = COMMANDS.find((name) => name === arg);
|
|
111
111
|
if (found === undefined) {
|
|
112
|
-
throw new Error(`Unknown command:
|
|
112
|
+
throw new Error(`Unknown command: \`${arg}\``);
|
|
113
113
|
}
|
|
114
114
|
return found;
|
|
115
115
|
}
|
|
@@ -117,14 +117,14 @@ const OUTPUT_ONLY = ['force', 'help'];
|
|
|
117
117
|
export function parseStartArgs(argv) {
|
|
118
118
|
const { args } = readArgs(argv);
|
|
119
119
|
if (args.command !== undefined) {
|
|
120
|
-
throw new Error(
|
|
120
|
+
throw new Error(`\`start\` does not take \`${args.command}\``);
|
|
121
121
|
}
|
|
122
122
|
if (args.scope !== undefined) {
|
|
123
|
-
throw new Error('start does not take
|
|
123
|
+
throw new Error('`start` does not take `--scope`');
|
|
124
124
|
}
|
|
125
125
|
const refused = OUTPUT_ONLY.find((name) => args[name]);
|
|
126
126
|
if (refused !== undefined) {
|
|
127
|
-
throw new Error(
|
|
127
|
+
throw new Error(`\`start\` does not take \`--${refused}\``);
|
|
128
128
|
}
|
|
129
129
|
return { ...args, command: 'start' };
|
|
130
130
|
}
|
package/dist/shared/config.mjs
CHANGED
|
@@ -83,7 +83,7 @@ function configFile(root) {
|
|
|
83
83
|
return join(root, CONFIG_FILE);
|
|
84
84
|
}
|
|
85
85
|
function existsAlready() {
|
|
86
|
-
return new Error(`${CONFIG_FILE} exists already. Use
|
|
86
|
+
return new Error(`${CONFIG_FILE} exists already. Use \`--force\` to replace it.`);
|
|
87
87
|
}
|
|
88
88
|
export async function writeDefaultConfig(root, force) {
|
|
89
89
|
const path = configFile(root);
|
|
@@ -114,7 +114,7 @@ export async function moveOldConfig(root, force) {
|
|
|
114
114
|
}
|
|
115
115
|
export async function rejectOldConfig(root) {
|
|
116
116
|
if ((await readTextIfPresent(join(root, OLD_CONFIG_FILE))) !== undefined) {
|
|
117
|
-
throw new Error(`${OLD_CONFIG_FILE} moved to ${CONFIG_FILE}. Run npx -y next-issue@latest init to move it.`);
|
|
117
|
+
throw new Error(`${OLD_CONFIG_FILE} moved to ${CONFIG_FILE}. Run \`npx -y next-issue@latest init\` to move it.`);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
export async function loadConfig(root, options = {}) {
|
package/dist/shared/prompts.mjs
CHANGED
|
@@ -248,7 +248,7 @@ export function huntPrompt(instructions, ready, source, count, repository) {
|
|
|
248
248
|
`Before you file an issue, search the open and closed issues for a duplicate, for example with \`gh issue list --repo ${repository} --state all --search "<words>"\`. Do not file a finding when a duplicate exists.`,
|
|
249
249
|
`File each issue with \`gh issue create --repo ${repository}${label} --title "<conventional commit subject>" --body-file -\`.`,
|
|
250
250
|
`The body holds these sections as \`##\` headings, in this order: ${ISSUE_SECTIONS.map((section) => `\`## ${section}\``).join(', ')}.`,
|
|
251
|
-
'Give the file and line of each piece of evidence. Leave the Open questions section empty.',
|
|
251
|
+
'Give the file and line of each piece of evidence. Write the approach you chose in the Decisions section, or leave it empty when no choice is needed. Leave the Open questions section empty.',
|
|
252
252
|
'End your final message with one line in the form `issue: <url>` for each issue you filed, or one `issue: none` line when you filed nothing.',
|
|
253
253
|
].join('\n'),
|
|
254
254
|
]);
|
package/dist/worker/serve.mjs
CHANGED
|
@@ -169,7 +169,7 @@ export async function startWorker(options) {
|
|
|
169
169
|
const stop = (socket, refuse, root, after, id) => {
|
|
170
170
|
const point = stopPoint(after);
|
|
171
171
|
if (point === undefined) {
|
|
172
|
-
refuse(
|
|
172
|
+
refuse(`\`stop\` does not take \`--after ${String(after)}\``);
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
const run = runs.get(root);
|
package/package.json
CHANGED
|
@@ -14,8 +14,9 @@ Turn the problem of the user into one GitHub issue, or a split of linked issues
|
|
|
14
14
|
|
|
15
15
|
3. Judge whether the change fits one atomic commit that leaves the trunk green. When it does not, propose a split into issues that each land alone and keep the trunk green, in the order they land, and note which issues of the split each one depends on.
|
|
16
16
|
4. Ask numbered questions about anything that is unclear: the scope, the expected behaviour, the acceptance criteria. When you propose a split, ask the user to confirm the split with the other questions. Label options with letters and recommend one. Ask again until no question is open.
|
|
17
|
-
5.
|
|
18
|
-
6.
|
|
17
|
+
5. List every choice the implementer would have to make, for example the approach, where data comes from, what to delete and which files to change. Ask the user about each choice that has more than one reasonable answer, with lettered options and a recommended one. Ask these with the questions of step 4.
|
|
18
|
+
6. Write the body from `template.md` into a temporary file. Keep every heading of the template and its order. Write each answered choice in `Decisions`. Leave `Decisions` empty when no choice needed asking. Leave `Open questions` empty.
|
|
19
|
+
7. Find the ready label, `<ready>`: the value of `labels.ready` in `.next-issue/config.json` at the root of the repository. The worker claims only issues with that label. When `labels.ready` is not set, or there is no config file, `<ready>` is `status:todo`.
|
|
19
20
|
|
|
20
21
|
Create the `<ready>` label when the repository does not have it:
|
|
21
22
|
|
|
@@ -34,31 +35,31 @@ Turn the problem of the user into one GitHub issue, or a split of linked issues
|
|
|
34
35
|
|
|
35
36
|
`<blockers>` is the comma-separated list of the numbers of the issues it depends on. Leave out `--blocked-by <blockers>` when the issue has no blocker. When gh does not know `--blocked-by` (it needs GitHub CLI 2.94.0 or later), do not create the issue: ask the user to upgrade gh.
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
8. Only once the issue exists with every blocker linked, add the ready label, unless `labels.ready` is empty. Add no label other than `<ready>`:
|
|
38
39
|
|
|
39
40
|
```bash
|
|
40
41
|
gh issue edit --repo <repo> <number> --add-label "<ready>"
|
|
41
42
|
```
|
|
42
43
|
|
|
43
|
-
For a confirmed split, repeat steps
|
|
44
|
+
For a confirmed split, repeat steps 6 to 8 for each issue of the split, in order. Create each one with `--blocked-by` the issues of the split it depends on, so it is linked before you add its ready label.
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
9. Once the issue exists with its ready label, or the last issue of a split has its ready label, run `npx -y next-issue@latest status` once. When `labels.ready` is empty, run it too, since the worker claims every open issue.
|
|
46
47
|
|
|
47
48
|
When the first line of the status starts with `stopping`, run no `start`: the run is stopping, so the issue waits for the next run. Otherwise run `npx -y next-issue@latest start` once. It starts a run when none is going, and joins a going run.
|
|
48
49
|
|
|
49
50
|
Then give the user the issue url, or each url of a split, and the outcome of `start`, or that the run is stopping, in one line, and stop.
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
10. When the user asks for a change to the issue, make the change on GitHub. Write the new body into the temporary file and run:
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
```bash
|
|
55
|
+
gh issue edit --repo <repo> <number> --body-file <file>
|
|
56
|
+
```
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
To change the title, run:
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
```bash
|
|
61
|
+
gh issue edit --repo <repo> <number> --title "<title>"
|
|
62
|
+
```
|
|
62
63
|
|
|
63
64
|
Once the issue exists, do not implement it in this session. The next-issue worker does the work.
|
|
64
65
|
|
|
@@ -66,6 +67,7 @@ Once the issue exists, do not implement it in this session. The next-issue worke
|
|
|
66
67
|
|
|
67
68
|
- Problem: what is wrong or missing, and who it affects.
|
|
68
69
|
- Context and findings: what you found in the code and the docs, with paths.
|
|
69
|
-
-
|
|
70
|
+
- Decisions: each choice the user made about how to do the change, with the chosen option. Empty when no choice needed asking.
|
|
71
|
+
- Acceptance criteria: a list of checks that show the issue is done, each one observable. Name each concrete target, such as each file, test or item, instead of a count or a general phrase like "update the docs". Write each check as a plain bullet (`- `), not a task-list checkbox (`- [ ]`), since nothing ticks the boxes.
|
|
70
72
|
- Out of scope: what the issue does not cover.
|
|
71
73
|
- Open questions: empty when the issue is created.
|