p-backlog 0.4.0 → 0.5.1

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +50 -30
  3. package/README.ru.md +50 -30
  4. package/dist/cli.js +670 -265
  5. package/dist/web/assets/{CodeTab-C87LaJFD.js → CodeTab-D3I5lIJJ.js} +1 -1
  6. package/dist/web/assets/CostTab-8f2AC5ER.js +1 -0
  7. package/dist/web/assets/EffectTab-1jObLK9a.js +1 -0
  8. package/dist/web/assets/Figure-BHBCd7Dt.js +1 -0
  9. package/dist/web/assets/OverviewTab-DjNyxzJq.js +1 -0
  10. package/dist/web/assets/QualityTab-W2NdYBhI.js +1 -0
  11. package/dist/web/assets/StatsPage-rJH3k8Ye.js +1 -0
  12. package/dist/web/assets/StatsTabState-BoimPoKm.js +1 -0
  13. package/dist/web/assets/{StatsTable-BXG0IS8p.js → StatsTable-B0tbx68M.js} +1 -1
  14. package/dist/web/assets/{UnavailableRepos-KiTvsm1X.js → UnavailableRepos-SpC6Dzwu.js} +1 -1
  15. package/dist/web/assets/cx-DDl6tKXq.js +58 -0
  16. package/dist/web/assets/{index-AJ1Qzly1.js → index-C8xqRmo-.js} +2 -2
  17. package/dist/web/assets/start-YlC0KTe5.js +38 -0
  18. package/dist/web/assets/use-grain-series-Bx70IZvb.js +55 -0
  19. package/dist/web/assets/value-dot-B7BsbWBD.js +1 -0
  20. package/dist/web/index.html +1 -1
  21. package/package.json +2 -1
  22. package/skill/backlog/SKILL.md +2 -2
  23. package/skill/backlog-en/SKILL.md +2 -2
  24. package/dist/web/assets/ChartTooltip-DWaDSRan.js +0 -55
  25. package/dist/web/assets/CostTab-D4ByOnHX.js +0 -1
  26. package/dist/web/assets/EffectTab-Dq06ghtZ.js +0 -1
  27. package/dist/web/assets/Figure-BC1eGh3_.js +0 -1
  28. package/dist/web/assets/OverviewTab-BBmohHJR.js +0 -1
  29. package/dist/web/assets/QualityTab-Rb7zRcGH.js +0 -1
  30. package/dist/web/assets/StatsPage-Dtyc1gAc.js +0 -1
  31. package/dist/web/assets/StatsTabState-Br-8FgKd.js +0 -1
  32. package/dist/web/assets/cx-CNNf0q6V.js +0 -58
  33. package/dist/web/assets/rolldown-runtime-hePW80VL.js +0 -1
  34. package/dist/web/assets/start-BGXTwsB0.js +0 -38
  35. package/dist/web/assets/value-dot-W-8PsGpd.js +0 -1
  36. /package/dist/web/assets/{ChartTooltip-tQC8-pw2.css → use-grain-series-tQC8-pw2.css} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1
4
+
5
+ - Every statistics chart (debt, created, check precision, effect, usage) has its own "week / day" toggle: 12 weeks or
6
+ 30 days; the choice is remembered per chart. Cost history is now kept for 12 weeks, so weekly usage fills in as data
7
+ accumulates (Claude Code deletes transcripts after 30 days by default).
8
+ - Codex and Cursor share one skill link in `~/.agents/skills` (Cursor reads it too); `setup` removes the older
9
+ `~/.cursor/skills` / `~/.codex/skills` links it made, and `setup --remove-manual --agent cursor` keeps the shared
10
+ link while Codex still uses it. Before, Cursor listed the skill up to three times.
11
+ - On Windows, writing a task file waits up to about 5 seconds (was about 1.3) for another process such as an
12
+ antivirus or indexer to release it.
13
+
14
+ ## 0.5.0
15
+
16
+ Claude Code plugin and other agents:
17
+
18
+ - The repository is a Claude Code plugin marketplace: `/plugin marketplace add expatriate/p-backlog`, then
19
+ `/plugin install p-backlog@p-backlog` (English skill) or `p-backlog-ru@p-backlog` (Russian). The plugin brings the
20
+ skill and the Stop hook; the CLI still comes from npm, and the plugin needs p-backlog CLI 0.5.0 or newer (older CLIs
21
+ reject `hook stop --agent`).
22
+ - `backlog setup` connects Codex CLI and Cursor too: it finds them by `$CODEX_HOME`/`~/.codex` and `~/.cursor`, links
23
+ the skill and adds the Stop hook to their `hooks.json`; `--agent claude|codex|cursor` limits it to one agent. Codex
24
+ runs the new hook only after you approve it once in `/hooks`; `setup` reminds you.
25
+ - `backlog hook stop --agent codex|cursor` reads their Stop events; Cursor gets the re-check request as a follow-up
26
+ message.
27
+ - With the plugin enabled, `setup` leaves Claude Code alone; `backlog setup --remove-manual` removes the skill links
28
+ and Stop hooks installed earlier; it cannot be combined with `--service`. Two Stop hooks in one turn (plugin and
29
+ manual) answer once.
30
+ - `backlog config language` switches the skill for every agent where `setup` installed it and, with the plugin, tells
31
+ which plugin to install.
32
+ - Cost statistics note that Codex and Cursor usage is not counted.
33
+
3
34
  ## 0.4.0
4
35
 
5
36
  Bulk triage in the web UI:
package/README.md CHANGED
@@ -46,24 +46,35 @@ It consists of the `backlog` CLI, the `backlog` skill and a Stop hook for Claude
46
46
 
47
47
  ## Getting started
48
48
 
49
- 1. **Install** (needs Node.js 22.13 or newer):
49
+ 1. **Install the CLI** (needs Node.js 22.13 or newer):
50
50
 
51
51
  ```bash
52
52
  npm i -g p-backlog
53
- backlog setup --service
54
53
  ```
55
54
 
56
- `npm i -g p-backlog` installs the CLI globally; `backlog setup --service` installs the skill and the
57
- Stop hook for Claude Code and starts the web app as an autostart service.
55
+ 2. **Connect your agent.**
58
56
 
59
- 2. **Language** — defaults to Russian if a backlog already exists, otherwise to the system locale.
57
+ - **Claude Code — the plugin (recommended).** In Claude Code run:
58
+
59
+ ```
60
+ /plugin marketplace add expatriate/p-backlog
61
+ /plugin install p-backlog@p-backlog
62
+ ```
63
+
64
+ `p-backlog-ru@p-backlog` installs the Russian skill instead. The plugin brings the skill and the Stop hook
65
+ and updates with `/plugin marketplace update p-backlog`; the CLI itself still comes from npm, and the plugin
66
+ needs p-backlog CLI 0.5.0 or newer.
67
+ - **Without the plugin, and for Codex and Cursor:** `backlog setup` links the skill and adds the Stop hook
68
+ for every agent it finds — see [Other agents](#other-agents).
69
+
70
+ 3. **Language** — defaults to Russian if a backlog already exists, otherwise to the system locale.
60
71
  Change it any time:
61
72
 
62
73
  ```bash
63
74
  backlog config language en # or ru
64
75
  ```
65
76
 
66
- 3. **First project and task** — open Claude Code in your repository and ask it to log something to the
77
+ 4. **First project and task** — open Claude Code in your repository and ask it to log something to the
67
78
  backlog, or create a task yourself:
68
79
 
69
80
  ```bash
@@ -72,17 +83,40 @@ It consists of the `backlog` CLI, the `backlog` skill and a Stop hook for Claude
72
83
 
73
84
  `backlog new` creates the project for the current repository itself if it doesn't exist yet.
74
85
 
75
- 4. **Web app** — already running at `http://localhost:4317`; check with:
86
+ 5. **Web app** — `backlog service install` runs it at `http://localhost:4317` and starts it on login; check with:
76
87
 
77
88
  ```bash
78
89
  backlog service status
79
90
  ```
80
91
 
81
- 5. **The Stop hook and alerts** — after each of the agent's turns in a repository, the Stop hook checks
92
+ 6. **The Stop hook and alerts** — after each of the agent's turns in a repository, the Stop hook checks
82
93
  whether the code behind that project's open tasks changed, and if so asks the agent to re-check them.
83
94
  It also surfaces alerts — signals about the backlog's health (growing debt, stuck tasks, stale
84
95
  low-priority tasks, and so on); `backlog stats` shows the same summary.
85
96
 
97
+ ## Other agents
98
+
99
+ `backlog setup` finds the agents installed on this machine and connects each of them; `--agent claude|codex|cursor`
100
+ limits it to one:
101
+
102
+ | Agent | Found by | Skill | Stop hook |
103
+ |---|---|---|---|
104
+ | Claude Code | always | `~/.claude/skills/backlog` | `~/.claude/settings.json` |
105
+ | Codex CLI | `$CODEX_HOME` or `~/.codex` | `~/.agents/skills/backlog` | `<codex home>/hooks.json` |
106
+ | Cursor | `~/.cursor` | `~/.agents/skills/backlog` | `~/.cursor/hooks.json` |
107
+
108
+ The skill is a link to the package's skill in the configured language; `backlog config language` switches it for
109
+ every agent where `setup` installed it. Other hooks in those files stay as they are, and running `setup` again adds nothing twice. Codex asks
110
+ you to review and approve the new hook once: open `/hooks` in Codex. In Cursor the re-check request arrives as a
111
+ follow-up message. Token and cost statistics cover Claude Code only.
112
+
113
+ Codex and Cursor share one skill link in `~/.agents/skills`, the common skills folder both read; `setup` removes
114
+ the older links it made in `~/.codex/skills` and `~/.cursor/skills`. Cursor also reads `~/.claude/skills`, so with
115
+ Claude Code connected manually it may list the skill twice.
116
+
117
+ If the Claude Code plugin is enabled, `setup` leaves Claude Code alone; `backlog setup --remove-manual` removes the
118
+ skill links and Stop hooks that `setup` installed earlier (for all agents, or for `--agent`).
119
+
86
120
  ## Where tasks live
87
121
 
88
122
  The backlog directory is `~/backlog`, or the path from the `BACKLOG_DIR` variable. Inside it, one
@@ -115,9 +149,10 @@ If there's no project yet, `backlog new` creates it.
115
149
  | `backlog prune [--project id \| --all-projects] [--apply]` | Low-priority tasks older than 30 days; `--apply` cancels them |
116
150
  | `backlog stats [--project id \| --all-projects] [--json]` | Statistics summary and alerts |
117
151
  | `backlog project list \| status <id> active\|inactive \| delete <id> --confirm <id>` | Project activity and deleting a project with its tasks |
118
- | `backlog hook stop` | The Stop hook for Claude Code: asks the agent to re-check tasks whose code changed |
152
+ | `backlog hook stop [--agent claude\|codex\|cursor]` | The Stop hook of Claude Code, Codex, or Cursor: asks the agent to re-check tasks whose code changed |
119
153
  | `backlog config language [ru\|en]` | With no value, prints the current backlog language; with a value, changes it |
120
- | `backlog setup [--service]` | Install the skill and the Stop hook; with `--service`, also the autostart service |
154
+ | `backlog setup [--agent claude\|codex\|cursor] [--service]` | Skill and Stop hook for the agents found — Claude Code, Codex, Cursor (see [Other agents](#other-agents)); `--service` also the autostart service |
155
+ | `backlog setup --remove-manual [--agent claude\|codex\|cursor]` | Removes the skill links and Stop hooks that `setup` installed |
121
156
  | `backlog serve [--port N]` | Runs the web server in the current process, on `PORT` or 4317 by default |
122
157
  | `backlog service install \| uninstall \| status` | Autostarts the web server at login: launchd on macOS, systemd --user on Linux, a Startup-folder script on Windows; `status` shows whether it is installed and responding |
123
158
 
@@ -229,30 +264,14 @@ service stores the path to the Node binary it was installed with.
229
264
  ## Uninstalling
230
265
 
231
266
  ```bash
267
+ backlog setup --remove-manual
232
268
  backlog service uninstall
233
269
  npm uninstall -g p-backlog
234
270
  ```
235
271
 
236
- Run `backlog service uninstall` before removing the package — otherwise launchd's `KeepAlive` (or systemd's
237
- `Restart=on-failure`) keeps relaunching a `cli.js` that no longer exists. Then remove the skill link and
238
- the Stop hook by hand:
239
-
240
- ```bash
241
- rm ~/.claude/skills/backlog # or $CLAUDE_SKILLS_DIR / $CLAUDE_CONFIG_DIR/skills, if set
242
- ```
243
-
244
- and delete the `Stop` hook entry from `~/.claude/settings.json` (or `$CLAUDE_SETTINGS_PATH`). On macOS/Linux
245
- it is
246
-
247
- ```json
248
- { "type": "command", "command": "command -v backlog >/dev/null && backlog hook stop || true" }
249
- ```
250
-
251
- and on Windows
252
-
253
- ```json
254
- { "type": "command", "shell": "powershell", "command": "if (Get-Command backlog.cmd -ErrorAction SilentlyContinue) { backlog.cmd hook stop }" }
255
- ```
272
+ `backlog setup --remove-manual` removes the skill links and Stop hooks from every agent (a plugin is removed with
273
+ `/plugin uninstall`). Run `backlog service uninstall` before removing the package — otherwise launchd's `KeepAlive`
274
+ (or systemd's `Restart=on-failure`) keeps relaunching a `cli.js` that no longer exists.
256
275
 
257
276
  On Windows, the Startup-folder script does not restart a crashed server the way launchd `KeepAlive` or
258
277
  systemd `Restart=on-failure` do — after a crash, run `backlog service install` again or start it with
@@ -265,6 +284,7 @@ npm install
265
284
  npm run build
266
285
  npm link # global backlog command
267
286
  npm run install-skill # ~/.claude/skills/backlog → skill/backlog and the Stop hook in ~/.claude/settings.json
287
+ npm run plugins # after changing the skill or the version: regenerate plugins/
268
288
  ```
269
289
 
270
290
  ```bash
package/README.ru.md CHANGED
@@ -45,24 +45,35 @@
45
45
 
46
46
  ## Как начать
47
47
 
48
- 1. **Установка** (нужен Node.js 22.13 или новее):
48
+ 1. **Установка CLI** (нужен Node.js 22.13 или новее):
49
49
 
50
50
  ```bash
51
51
  npm i -g p-backlog
52
- backlog setup --service
53
52
  ```
54
53
 
55
- `npm i -g p-backlog` ставит CLI глобально; `backlog setup --service` ставит скилл и хук Stop для Claude
56
- Code и запускает веб как службу автозапуска.
54
+ 2. **Подключите агента.**
57
55
 
58
- 2. **Язык** — по умолчанию русский, если беклог уже есть, иначе язык берётся из локали системы. Сменить
56
+ - **Claude Code — плагин (рекомендуется).** В Claude Code выполните:
57
+
58
+ ```
59
+ /plugin marketplace add expatriate/p-backlog
60
+ /plugin install p-backlog-ru@p-backlog
61
+ ```
62
+
63
+ `p-backlog@p-backlog` ставит английский скилл. Плагин приносит скилл и хук Stop и обновляется командой
64
+ `/plugin marketplace update p-backlog`; сам CLI по-прежнему ставится из npm, и для плагина нужен CLI p-backlog
65
+ 0.5.0 или новее.
66
+ - **Без плагина, а также для Codex и Cursor:** `backlog setup` ставит ссылку на скилл и хук Stop каждому
67
+ найденному агенту — см. [Другие агенты](#другие-агенты).
68
+
69
+ 3. **Язык** — по умолчанию русский, если беклог уже есть, иначе язык берётся из локали системы. Сменить
59
70
  можно в любой момент:
60
71
 
61
72
  ```bash
62
73
  backlog config language en # или ru
63
74
  ```
64
75
 
65
- 3. **Первый проект и первая задача** — откройте Claude Code в своём репозитории и попросите «запиши в
76
+ 4. **Первый проект и первая задача** — откройте Claude Code в своём репозитории и попросите «запиши в
66
77
  беклог …», либо создайте задачу сами:
67
78
 
68
79
  ```bash
@@ -71,17 +82,40 @@
71
82
 
72
83
  Проект для текущего репозитория `backlog new` создаст сам, если его ещё нет.
73
84
 
74
- 4. **Веб-приложение** — уже работает на `http://localhost:4317`; проверить можно так:
85
+ 5. **Веб-приложение** — `backlog service install` запускает его на `http://localhost:4317` и при входе в систему;
86
+ проверить можно так:
75
87
 
76
88
  ```bash
77
89
  backlog service status
78
90
  ```
79
91
 
80
- 5. **Хук Stop и тревоги** — после каждого ответа агента в репозитории хук Stop проверяет, не изменился ли
92
+ 6. **Хук Stop и тревоги** — после каждого ответа агента в репозитории хук Stop проверяет, не изменился ли
81
93
  код у открытых задач этого проекта, и просит агента перепроверить их, если да. Он же показывает
82
94
  тревоги — сигналы о состоянии беклога (растущий долг, зависшие задачи, старые задачи с низким
83
95
  приоритетом и т. п.); их сводку показывает и `backlog stats`.
84
96
 
97
+ ## Другие агенты
98
+
99
+ `backlog setup` находит установленных агентов и подключает каждого; `--agent claude|codex|cursor` сужает до одного:
100
+
101
+ | Агент | Как находится | Скилл | Хук Stop |
102
+ |---|---|---|---|
103
+ | Claude Code | всегда | `~/.claude/skills/backlog` | `~/.claude/settings.json` |
104
+ | Codex CLI | `$CODEX_HOME` или `~/.codex` | `~/.agents/skills/backlog` | `<каталог codex>/hooks.json` |
105
+ | Cursor | `~/.cursor` | `~/.agents/skills/backlog` | `~/.cursor/hooks.json` |
106
+
107
+ Скилл — ссылка на скилл пакета на выбранном языке; `backlog config language` переставляет её у всех
108
+ агентов, которым её поставил `setup`. Чужие хуки в этих файлах остаются на месте, повторный `setup` ничего
109
+ не дублирует. Codex один раз просит одобрить новый хук: откройте `/hooks` в Codex. В Cursor просьба перепроверить
110
+ задачи приходит следующим сообщением. Статистика токенов и расходов считает только Claude Code.
111
+
112
+ У Codex и Cursor одна ссылка на скилл в `~/.agents/skills` — общем каталоге скиллов, который читают оба; прежние
113
+ ссылки в `~/.codex/skills` и `~/.cursor/skills` `setup` снимает. Cursor читает ещё и `~/.claude/skills`, поэтому при
114
+ ручной установке для Claude Code он может показать скилл дважды.
115
+
116
+ Если включён плагин для Claude Code, `setup` Claude Code не трогает; `backlog setup --remove-manual` снимает ссылки на
117
+ скилл и хуки Stop, которые `setup` ставил раньше (у всех агентов или у `--agent`).
118
+
85
119
  ## Где лежат задачи
86
120
 
87
121
  Каталог беклога — `~/backlog` или путь из переменной `BACKLOG_DIR`. Внутри — по каталогу на проект:
@@ -113,9 +147,10 @@
113
147
  | `backlog prune [--project id \| --all-projects] [--apply]` | Задачи с низким приоритетом старше 30 дней; `--apply` отменяет их |
114
148
  | `backlog stats [--project id \| --all-projects] [--json]` | Сводка статистики и тревоги |
115
149
  | `backlog project list \| status <id> active\|inactive \| delete <id> --confirm <id>` | Активность проектов и удаление проекта вместе с задачами |
116
- | `backlog hook stop` | Хук Stop для Claude Code: просит агента перепроверить задачи, чей код изменился |
150
+ | `backlog hook stop [--agent claude\|codex\|cursor]` | Хук Stop для Claude Code, Codex или Cursor: просит агента перепроверить задачи, чей код изменился |
117
151
  | `backlog config language [ru\|en]` | Без значения — печатает текущий язык беклога; со значением — меняет его |
118
- | `backlog setup [--service]` | Поставить скилл и Stop-хук; с `--service` — ещё и службу автозапуска |
152
+ | `backlog setup [--agent claude\|codex\|cursor] [--service]` | Скилл и Stop-хук найденным агентам — Claude Code, Codex, Cursor (см. [Другие агенты](#другие-агенты)); с `--service` — ещё и служба автозапуска |
153
+ | `backlog setup --remove-manual [--agent claude\|codex\|cursor]` | Снимает ссылки на скилл и хуки Stop, которые поставил `setup` |
119
154
  | `backlog serve [--port N]` | Запускает веб-сервер в текущем процессе, порт — из `PORT`, иначе 4317 |
120
155
  | `backlog service install \| uninstall \| status` | Автозапуск веб-сервера при входе: launchd на macOS, systemd --user на Linux, скрипт в папке «Автозагрузка» на Windows; `status` — установлена ли служба и отвечает ли сервер |
121
156
 
@@ -223,30 +258,14 @@ backlog service install
223
258
  ## Удаление
224
259
 
225
260
  ```bash
261
+ backlog setup --remove-manual
226
262
  backlog service uninstall
227
263
  npm uninstall -g p-backlog
228
264
  ```
229
265
 
230
- Перед удалением пакета выполните `backlog service uninstall` — иначе `KeepAlive` у launchd (или
231
- `Restart=on-failure` у systemd) продолжит перезапускать несуществующий `cli.js`. Затем вручную уберите
232
- ссылку на скилл и хук Stop:
233
-
234
- ```bash
235
- rm ~/.claude/skills/backlog # или $CLAUDE_SKILLS_DIR / $CLAUDE_CONFIG_DIR/skills, если заданы
236
- ```
237
-
238
- и удалите запись хука `Stop` из `~/.claude/settings.json` (или `$CLAUDE_SETTINGS_PATH`). На macOS/Linux
239
- это
240
-
241
- ```json
242
- { "type": "command", "command": "command -v backlog >/dev/null && backlog hook stop || true" }
243
- ```
244
-
245
- а на Windows
246
-
247
- ```json
248
- { "type": "command", "shell": "powershell", "command": "if (Get-Command backlog.cmd -ErrorAction SilentlyContinue) { backlog.cmd hook stop }" }
249
- ```
266
+ `backlog setup --remove-manual` снимает ссылки на скилл и хуки Stop у всех агентов (плагин удаляется через
267
+ `/plugin uninstall`). Перед удалением пакета выполните `backlog service uninstall` — иначе `KeepAlive` у launchd
268
+ (или `Restart=on-failure` у systemd) продолжит перезапускать несуществующий `cli.js`.
250
269
 
251
270
  На Windows скрипт в папке «Автозагрузка» не перезапускает сервер после падения — в отличие от `KeepAlive`
252
271
  у launchd или `Restart=on-failure` у systemd; после сбоя запустите `backlog service install` заново или
@@ -259,6 +278,7 @@ npm install
259
278
  npm run build
260
279
  npm link # глобальная команда backlog
261
280
  npm run install-skill # ~/.claude/skills/backlog → skill/backlog и хук Stop в ~/.claude/settings.json
281
+ npm run plugins # после правки скилла или версии: пересобрать plugins/
262
282
  ```
263
283
 
264
284
  ```bash