next-issue 16.9.1 → 16.11.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/shared/prompts.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ISSUE_SECTIONS, numbered } from './issue-format.mjs';
|
|
2
2
|
import { fenceFor, paragraphs } from './text.mjs';
|
|
3
|
+
const README_RULE = 'Keep each README to what a user needs to start and use the tool. Put edge cases and internal behaviour in other docs.';
|
|
3
4
|
const ENGINEERING_RULES = [
|
|
4
5
|
'Update the documentation when you change behaviour or add or remove a feature.',
|
|
5
6
|
'Remove the tests of a feature or behaviour that you remove.',
|
|
6
7
|
'Test behaviour that a user can observe, not internals. Give each test a description that names the actor, the action and the observable outcome.',
|
|
7
8
|
'Reuse existing code and patterns, stay consistent with the repository and pick the simpler option.',
|
|
8
9
|
'Check an API, a command or a url in the repository or its dependencies before you use it. Do not invent one.',
|
|
10
|
+
README_RULE,
|
|
9
11
|
].join('\n');
|
|
10
12
|
const OTHER_RULES = 'The other rules of `CLAUDE.md`, such as code conventions and test style, still apply.';
|
|
11
13
|
const HARNESS_RULES = [
|
|
@@ -109,6 +111,7 @@ function reviewScope(earlier) {
|
|
|
109
111
|
'Check that the change updates the documentation when it changes behaviour or adds or removes a feature, and that it removes the tests of a removed feature or behaviour.',
|
|
110
112
|
'Check that each test checks behaviour that a user can observe, and that its description names the actor, the action and the observable outcome.',
|
|
111
113
|
'Check that the change reuses existing code and patterns, stays consistent with the repository and picks the simpler option, and that it uses no invented API, command or url.',
|
|
114
|
+
`Check that the change follows this rule: ${README_RULE}`,
|
|
112
115
|
'A missing documentation update or a test that is not observable is a finding.',
|
|
113
116
|
].join('\n')
|
|
114
117
|
: [
|
|
@@ -248,7 +251,7 @@ export function huntPrompt(instructions, ready, source, count, repository) {
|
|
|
248
251
|
`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
252
|
`File each issue with \`gh issue create --repo ${repository}${label} --title "<conventional commit subject>" --body-file -\`.`,
|
|
250
253
|
`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.',
|
|
254
|
+
'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
255
|
'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
256
|
].join('\n'),
|
|
254
257
|
]);
|
package/package.json
CHANGED
|
@@ -7,6 +7,8 @@ description: Investigate an issue that the next-issue worker handed over to a pe
|
|
|
7
7
|
|
|
8
8
|
Help the user understand why the worker handed an issue over, then answer the hand-over on GitHub. Do not fix the code of the issue yourself. The worker does the work.
|
|
9
9
|
|
|
10
|
+
Run any next-issue command as `npx -y next-issue@latest <command>`. Never run it from the `PATH`, a global install or a local build.
|
|
11
|
+
|
|
10
12
|
1. Find the repository, `<repo>`, that the worker reads. `<remote>` is the value of `remote` in `.next-issue/config.json` at the root of the repository. When there is no config file or no `remote` field, `<remote>` is `origin`. Run `git remote get-url <remote>` and take `<owner>/<name>` from the url, without `.git`. That is `<repo>`. When the host of the url is not `github.com`, `<repo>` is `<host>/<owner>/<name>`, so gh acts on that host. For an ssh url, such as `git@<host>:<owner>/<name>.git`, run `ssh -G <host>` and take the host from its `hostname` line, since `<host>` may be an alias from the ssh config. The host `ssh.github.com` means `github.com` (GitHub's ssh over port 443), so `<repo>` is then `<owner>/<name>`. Pass `--repo <repo>` to every `gh` command but `gh api`, since gh otherwise may pick another remote, such as `upstream`.
|
|
11
13
|
2. Find the labels. `<needs-human>` is the value of `labels.needsHuman` in `.next-issue/config.json`, or `status:needs-human` when it is not set or there is no config file. `<skip>` is the value of `labels.skip` in `.next-issue/config.json`, or `status:blocked` when it is not set or there is no config file. `<ready>` is the value of `labels.ready` in `.next-issue/config.json`, or `status:todo` when it is not set or there is no config file. When `labels.ready` is `""`, leave out `--add-label "<ready>"` below, since the worker then claims every open issue.
|
|
12
14
|
3. List the waiting issues:
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-issue
|
|
3
|
-
description: Turn a problem into a clear GitHub issue that the next-issue worker can claim. Use when the user wants to write, file or create an issue, or asks for a change to the code of a repository that has `.next-issue/config.json`.
|
|
3
|
+
description: Turn a problem into a clear GitHub issue that the next-issue worker can claim. Use when the user wants to write, file or create an issue, or asks for a change to the code of a repository that has `.next-issue/config.json`. In that case, file an issue with this skill instead of editing files.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Create an issue
|
|
7
7
|
|
|
8
8
|
Turn the problem of the user into one GitHub issue, or a split of linked issues when the change is too big for one commit, in the format of `template.md`, next to this file.
|
|
9
9
|
|
|
10
|
+
Run any next-issue command as `npx -y next-issue@latest <command>`. Never run it from the `PATH`, a global install or a local build.
|
|
11
|
+
|
|
10
12
|
1. Understand the problem. Restate it in your own words.
|
|
11
13
|
2. Find the repository, `<repo>`, that the worker reads. `<remote>` is the value of `remote` in `.next-issue/config.json` at the root of the repository. When there is no config file or no `remote` field, `<remote>` is `origin`. Run `git remote get-url <remote>` and take `<owner>/<name>` from the url, without `.git`. That is `<repo>`. When the host of the url is not `github.com`, `<repo>` is `<host>/<owner>/<name>`, so gh acts on that host. For an ssh url, such as `git@<host>:<owner>/<name>.git`, run `ssh -G <host>` and take the host from its `hostname` line, since `<host>` may be an alias from the ssh config. The host `ssh.github.com` means `github.com` (GitHub's ssh over port 443), so `<repo>` is then `<owner>/<name>`. Pass `--repo <repo>` to every `gh` command, since gh otherwise may pick another remote, such as `upstream`.
|
|
12
14
|
|
|
@@ -14,8 +16,9 @@ Turn the problem of the user into one GitHub issue, or a split of linked issues
|
|
|
14
16
|
|
|
15
17
|
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
18
|
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.
|
|
19
|
+
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.
|
|
20
|
+
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.
|
|
21
|
+
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
22
|
|
|
20
23
|
Create the `<ready>` label when the repository does not have it:
|
|
21
24
|
|
|
@@ -34,31 +37,31 @@ Turn the problem of the user into one GitHub issue, or a split of linked issues
|
|
|
34
37
|
|
|
35
38
|
`<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
39
|
|
|
37
|
-
|
|
40
|
+
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
41
|
|
|
39
42
|
```bash
|
|
40
43
|
gh issue edit --repo <repo> <number> --add-label "<ready>"
|
|
41
44
|
```
|
|
42
45
|
|
|
43
|
-
For a confirmed split, repeat steps
|
|
46
|
+
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
47
|
|
|
45
|
-
|
|
48
|
+
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
49
|
|
|
47
50
|
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
51
|
|
|
49
52
|
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
53
|
|
|
51
|
-
|
|
54
|
+
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
55
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
```bash
|
|
57
|
+
gh issue edit --repo <repo> <number> --body-file <file>
|
|
58
|
+
```
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
To change the title, run:
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
```bash
|
|
63
|
+
gh issue edit --repo <repo> <number> --title "<title>"
|
|
64
|
+
```
|
|
62
65
|
|
|
63
66
|
Once the issue exists, do not implement it in this session. The next-issue worker does the work.
|
|
64
67
|
|
|
@@ -66,6 +69,7 @@ Once the issue exists, do not implement it in this session. The next-issue worke
|
|
|
66
69
|
|
|
67
70
|
- Problem: what is wrong or missing, and who it affects.
|
|
68
71
|
- Context and findings: what you found in the code and the docs, with paths.
|
|
69
|
-
-
|
|
72
|
+
- Decisions: each choice the user made about how to do the change, with the chosen option. Empty when no choice needed asking.
|
|
73
|
+
- 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
74
|
- Out of scope: what the issue does not cover.
|
|
71
75
|
- Open questions: empty when the issue is created.
|