@nolto/cli 0.12.0 → 0.13.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 +43 -3
- package/dist/index.js +648 -242
- package/dist/skill/roadmap-progress/SKILL.md +18 -2
- package/dist/skill/roadmap-progress/references/issue-cli.md +46 -0
- package/dist/skill/roadmap-progress/references/schema.md +4 -1
- package/dist/skill/roadmap-progress/scripts/roadmap.mjs +14 -1
- package/package.json +1 -1
|
@@ -7,6 +7,8 @@ description: Maintain a local project's `.nolto/roadmaps/<slug>.json` as work st
|
|
|
7
7
|
|
|
8
8
|
Keep `.nolto/roadmaps/<slug>.json` synchronized with verified repository work. Treat the file as the source of truth for progress reporting.
|
|
9
9
|
|
|
10
|
+
コミット件名に課題キー(例: NOLTO-50)を含めると、`nolto sync` がコミット / PR を課題に紐づけます(Git 連携スコープが必要)。
|
|
11
|
+
|
|
10
12
|
## Resolve the roadmap
|
|
11
13
|
|
|
12
14
|
1. Use the roadmap named by the user when provided.
|
|
@@ -44,6 +46,17 @@ Paths are repository-relative (the repository root is the parent of `.nolto/`).
|
|
|
44
46
|
The command warns if the file does not exist yet; create the plan file first
|
|
45
47
|
when possible.
|
|
46
48
|
|
|
49
|
+
### Work with issues
|
|
50
|
+
|
|
51
|
+
When issue work is authorized, first search for duplicates with `nolto issue list --q "<keyword>" --closed include`.
|
|
52
|
+
Create with `nolto issue create --subject "…" --phase <task-id>` (add `--roadmap <slug>` if several roadmaps exist), then run `nolto sync` to publish the link.
|
|
53
|
+
After implementing and verifying a fix, record the transition and explanation with `nolto issue update <key> --status <name> -m "…"`; use `nolto issue comment <key> -m "…"` for a separate progress note.
|
|
54
|
+
Close verified work with `nolto issue close <key> -m "…"`.
|
|
55
|
+
If `create --phase` reports that the issue was created but the local update failed, repair the existing key in the roadmap; do not create another issue.
|
|
56
|
+
On HTTP 429, wait the `Retry-After` seconds and retry once only.
|
|
57
|
+
A 403 `token_scope` / `token_project` requires a suitably scoped token from the user; inspect `nolto whoami` and request access rather than retrying the same operation.
|
|
58
|
+
See [references/issue-cli.md](references/issue-cli.md) for commands, options, examples and exit codes.
|
|
59
|
+
|
|
47
60
|
## Use the bundled CLI
|
|
48
61
|
|
|
49
62
|
Resolve the script relative to this `SKILL.md`. Common repository installs are:
|
|
@@ -68,11 +81,14 @@ Use direct JSON edits to add, remove, rename, or reorder phases and tasks, then
|
|
|
68
81
|
|
|
69
82
|
## Guardrails
|
|
70
83
|
|
|
84
|
+
- Verify the work before changing issue status. Decide roadmap task completion and issue closure separately.
|
|
85
|
+
|
|
86
|
+
- `issues` items must be issue keys like `NOLTO-12`, unique; put them on tasks only.
|
|
87
|
+
|
|
71
88
|
- `schemaVersion` is 2. Files at version 1 still validate (with a warning) and
|
|
72
89
|
are migrated to 2 automatically by any mutation command. Never edit
|
|
73
90
|
`schemaVersion` by hand.
|
|
74
|
-
-
|
|
75
|
-
syncing to Nolto is handled separately by `nolto watch` / `nolto sync`.
|
|
91
|
+
- The roadmap script writes local files. `nolto issue` writes to Nolto when issue work is authorized; `nolto sync` / `nolto watch` publishes local roadmap changes.
|
|
76
92
|
- Use only `todo`, `in-progress`, `done`, and `blocked`. Convert legacy `in_progress` when touching that entry.
|
|
77
93
|
- Keep all phase and task IDs unique across the file.
|
|
78
94
|
- Preserve task IDs across title changes so `dependsOn` remains stable.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Issue CLI reference
|
|
2
|
+
|
|
3
|
+
All commands accept global `--project <id>`, `--json`, `--token <value>` and `--base-url <url>`.
|
|
4
|
+
Project priority: flag → NOLTO_PROJECT → nearest ancestor nolto.json → config defaultProjectId. Git is not required. An invalid nolto.json remains an error.
|
|
5
|
+
References accept a key (NOLTO-12) or number (12). Only the number is sent: a different key prefix does not protect against acting on the same number in the selected project.
|
|
6
|
+
|
|
7
|
+
| Command | Options |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `issue list` | `--status <names...>`, `--assignee me/none/UUID`, `--closed exclude/include/only`, `--q`, `--sort updated/due/priority/number/created/assignee/status/type/subject`, `--order asc/desc`, `--page`, `--type`, `--priority high/normal/low`, `--category`, `--parent <ref-or-none>` |
|
|
10
|
+
| `issue view <ref>` | Global options |
|
|
11
|
+
| `issue create` | Required `--subject`; `--body` or `--body-file` (`-` for stdin); `--type`, `--status`, `--priority`, `--assignee`, `--due YYYY-MM-DD`, `--category <names...>`, `--parent <ref>`, `--phase <task-id>`, `--roadmap <slug>` |
|
|
12
|
+
| `issue update <ref>` | Same field options as create, subject optional; `--no-due`, `--no-parent`, `-m/--comment`; no phase/roadmap options |
|
|
13
|
+
| `issue comment <ref>` | `-m/--comment <text>` or `--body-file <path-or-dash>` |
|
|
14
|
+
| `issue close <ref>` | `--status <closed-name-or-UUID>`, `-m/--comment <text>` |
|
|
15
|
+
|
|
16
|
+
Status/type/category accept case-insensitive exact names or UUIDs from the project's settings. Unknown or ambiguous names list candidates. Create with `--type` and no body uses that type's body template. Update never inserts a template automatically. Close chooses the first closed status by sortOrder unless overridden; it fails if no matching closed status exists. `--assignee me` on writes resolves /api/me/profile; none clears the assignee.
|
|
17
|
+
|
|
18
|
+
List output is one line per issue plus `n / total (page p)`. View includes body and comments with API-token provenance. Writes print the issue key and URL. `--json` preserves API responses: list `{ issues, total, page, pageSize }`, view the full bundle, create `{ issue }`, update/close `{ issue, comment }`, comment `{ comment }`. Successful create with phase additionally returns `roadmap: { file, taskId }`. Human template creation adds `body: from template`. `whoami` adds scopes (null displayed as full) and project binding; JSON uses tokenScopes/tokenProject when introspection succeeds. Introspection failure is non-fatal and retains the old output.
|
|
19
|
+
|
|
20
|
+
`--phase` refers to a **task ID**, not a phase ID. It adds the issue key to task.issues in the selected local roadmap, avoids duplicates, upgrades legacy schema v1 to v2 on change and refreshes updatedAt with a local timezone offset. Run `nolto sync` afterward. If multiple roadmaps exist, use --roadmap (without .json). A local failure occurs after issue creation: the error includes the created key; repair the link instead of repeating create.
|
|
21
|
+
|
|
22
|
+
| Exit | Meaning |
|
|
23
|
+
|---|---|
|
|
24
|
+
| 0 | Success |
|
|
25
|
+
| 2 | Invalid input, recognized API 404, HTTP 422 (details shown), or local roadmap failure after creation |
|
|
26
|
+
| 3 | HTTP 401/403; token_scope/token_project includes a token settings hint |
|
|
27
|
+
| 4 | HTTP 402/429 (quota/rate limit). API token writes: 60/minute. On 429, wait Retry-After seconds before retrying. |
|
|
28
|
+
| 5 | Network/generic HTTP errors, including a 404 without an API error string |
|
|
29
|
+
|
|
30
|
+
Examples:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
nolto issue list --q "login" --closed include
|
|
34
|
+
nolto issue create --subject "Fix login" --type Bug --phase r4.t2 --roadmap release
|
|
35
|
+
nolto sync
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
nolto issue update NOLTO-12 --assignee me --status "In Progress" -m "Reproduced and implementing"
|
|
40
|
+
nolto issue comment NOLTO-12 --body-file notes.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
nolto issue close NOLTO-12 -m "Verified: regression tests pass"
|
|
45
|
+
nolto issue view NOLTO-12 --json
|
|
46
|
+
```
|
|
@@ -40,7 +40,8 @@ Use this reference when creating or structurally editing `.nolto/roadmaps/<slug>
|
|
|
40
40
|
"id": "task-005",
|
|
41
41
|
"title": "ログアウトAPI",
|
|
42
42
|
"status": "todo",
|
|
43
|
-
"dependsOn": ["task-004"]
|
|
43
|
+
"dependsOn": ["task-004"],
|
|
44
|
+
"issues": ["NOLTO-33"]
|
|
44
45
|
}
|
|
45
46
|
]
|
|
46
47
|
}
|
|
@@ -68,6 +69,8 @@ Use this reference when creating or structurally editing `.nolto/roadmaps/<slug>
|
|
|
68
69
|
- `note`: Current implementation detail or blocker. Omit when it adds no value.
|
|
69
70
|
- `dependsOn`: IDs of prerequisite tasks in the same roadmap. Each item must be a string matching `^[a-z0-9][a-z0-9._-]*$`; duplicates are rejected.
|
|
70
71
|
|
|
72
|
+
- `issues`: Optional task-only array of unique uppercase issue keys from the same project (e.g. `NOLTO-12`). Never put it on phases. Web resolves and displays these; sync warns and skips unknown keys.
|
|
73
|
+
|
|
71
74
|
## Phase status derivation
|
|
72
75
|
|
|
73
76
|
After a task mutation, derive phase status in this order:
|
|
@@ -4,11 +4,13 @@ import path from "node:path";
|
|
|
4
4
|
|
|
5
5
|
const STATUSES = new Set(["todo", "in-progress", "done", "blocked"]);
|
|
6
6
|
const ID_PATTERN = /^[a-z0-9][a-z0-9._-]*$/;
|
|
7
|
+
// Keep in sync with packages/roadmap-schema
|
|
8
|
+
const ISSUE_KEY_PATTERN = /^[A-Z][A-Z0-9]{1,9}-[1-9][0-9]{0,8}$/;
|
|
7
9
|
const ALLOWED_KEYS = {
|
|
8
10
|
roadmap: new Set(["schemaVersion", "project", "updatedAt", "currentTaskId", "summary", "phases"]),
|
|
9
11
|
project: new Set(["id", "name", "repository"]),
|
|
10
12
|
phase: new Set(["id", "title", "status", "plan", "tasks"]),
|
|
11
|
-
task: new Set(["id", "title", "status", "startedAt", "completedAt", "note", "dependsOn", "plan"])
|
|
13
|
+
task: new Set(["id", "title", "status", "startedAt", "completedAt", "note", "dependsOn", "plan", "issues"])
|
|
12
14
|
};
|
|
13
15
|
const PLAN_PATH_ERROR = "plan --path must be a repository-relative path using '/' separators (no absolute paths, '\\', '.' or '..' segments).";
|
|
14
16
|
|
|
@@ -144,6 +146,17 @@ function validate(roadmap) {
|
|
|
144
146
|
if (task.plan !== undefined && (typeof task.plan !== "string" || task.plan.length === 0)) {
|
|
145
147
|
errors.push(`${at}.plan must be a non-empty string.`);
|
|
146
148
|
}
|
|
149
|
+
if (task.issues !== undefined && !Array.isArray(task.issues)) {
|
|
150
|
+
errors.push(`${at}.issues must be an array.`);
|
|
151
|
+
} else if (Array.isArray(task.issues)) {
|
|
152
|
+
const seenIssues = new Set();
|
|
153
|
+
for (const [i, key] of task.issues.entries()) {
|
|
154
|
+
if (typeof key !== "string") { errors.push(`${at}.issues[${i}] must be a string.`); continue; }
|
|
155
|
+
if (!ISSUE_KEY_PATTERN.test(key)) { errors.push(`${at}.issues[${i}] is not an issue key (e.g. NOLTO-12).`); continue; }
|
|
156
|
+
if (seenIssues.has(key)) errors.push(`${at}.issues contains duplicate key "${key}".`);
|
|
157
|
+
seenIssues.add(key);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
147
160
|
if (task.dependsOn !== undefined && !Array.isArray(task.dependsOn)) errors.push(`${at}.dependsOn must be an array.`);
|
|
148
161
|
}
|
|
149
162
|
if (Array.isArray(phase.tasks) && STATUSES.has(phase.status)) {
|