p-backlog 0.4.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0
4
+
5
+ Claude Code plugin and other agents:
6
+
7
+ - The repository is a Claude Code plugin marketplace: `/plugin marketplace add expatriate/p-backlog`, then
8
+ `/plugin install p-backlog@p-backlog` (English skill) or `p-backlog-ru@p-backlog` (Russian). The plugin brings the
9
+ 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
10
+ reject `hook stop --agent`).
11
+ - `backlog setup` connects Codex CLI and Cursor too: it finds them by `$CODEX_HOME`/`~/.codex` and `~/.cursor`, links
12
+ the skill and adds the Stop hook to their `hooks.json`; `--agent claude|codex|cursor` limits it to one agent. Codex
13
+ runs the new hook only after you approve it once in `/hooks`; `setup` reminds you.
14
+ - `backlog hook stop --agent codex|cursor` reads their Stop events; Cursor gets the re-check request as a follow-up
15
+ message.
16
+ - With the plugin enabled, `setup` leaves Claude Code alone; `backlog setup --remove-manual` removes the skill links
17
+ and Stop hooks installed earlier; it cannot be combined with `--service`. Two Stop hooks in one turn (plugin and
18
+ manual) answer once.
19
+ - `backlog config language` switches the skill for every agent where `setup` installed it and, with the plugin, tells
20
+ which plugin to install.
21
+ - Cost statistics note that Codex and Cursor usage is not counted.
22
+
3
23
  ## 0.4.0
4
24
 
5
25
  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,36 @@ 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` | `~/.cursor/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
+ If the Claude Code plugin is enabled, `setup` leaves Claude Code alone; `backlog setup --remove-manual` removes the
114
+ skill links and Stop hooks that `setup` installed earlier (for all agents, or for `--agent`).
115
+
86
116
  ## Where tasks live
87
117
 
88
118
  The backlog directory is `~/backlog`, or the path from the `BACKLOG_DIR` variable. Inside it, one
@@ -115,9 +145,10 @@ If there's no project yet, `backlog new` creates it.
115
145
  | `backlog prune [--project id \| --all-projects] [--apply]` | Low-priority tasks older than 30 days; `--apply` cancels them |
116
146
  | `backlog stats [--project id \| --all-projects] [--json]` | Statistics summary and alerts |
117
147
  | `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 |
148
+ | `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
149
  | `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 |
150
+ | `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 |
151
+ | `backlog setup --remove-manual [--agent claude\|codex\|cursor]` | Removes the skill links and Stop hooks that `setup` installed |
121
152
  | `backlog serve [--port N]` | Runs the web server in the current process, on `PORT` or 4317 by default |
122
153
  | `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
154
 
@@ -229,30 +260,14 @@ service stores the path to the Node binary it was installed with.
229
260
  ## Uninstalling
230
261
 
231
262
  ```bash
263
+ backlog setup --remove-manual
232
264
  backlog service uninstall
233
265
  npm uninstall -g p-backlog
234
266
  ```
235
267
 
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
- ```
268
+ `backlog setup --remove-manual` removes the skill links and Stop hooks from every agent (a plugin is removed with
269
+ `/plugin uninstall`). Run `backlog service uninstall` before removing the package — otherwise launchd's `KeepAlive`
270
+ (or systemd's `Restart=on-failure`) keeps relaunching a `cli.js` that no longer exists.
256
271
 
257
272
  On Windows, the Startup-folder script does not restart a crashed server the way launchd `KeepAlive` or
258
273
  systemd `Restart=on-failure` do — after a crash, run `backlog service install` again or start it with
@@ -265,6 +280,7 @@ npm install
265
280
  npm run build
266
281
  npm link # global backlog command
267
282
  npm run install-skill # ~/.claude/skills/backlog → skill/backlog and the Stop hook in ~/.claude/settings.json
283
+ npm run plugins # after changing the skill or the version: regenerate plugins/
268
284
  ```
269
285
 
270
286
  ```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,36 @@
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` | `~/.cursor/skills/backlog` | `~/.cursor/hooks.json` |
106
+
107
+ Скилл — ссылка на скилл пакета на выбранном языке; `backlog config language` переставляет её у всех
108
+ агентов, которым её поставил `setup`. Чужие хуки в этих файлах остаются на месте, повторный `setup` ничего
109
+ не дублирует. Codex один раз просит одобрить новый хук: откройте `/hooks` в Codex. В Cursor просьба перепроверить
110
+ задачи приходит следующим сообщением. Статистика токенов и расходов считает только Claude Code.
111
+
112
+ Если включён плагин для Claude Code, `setup` Claude Code не трогает; `backlog setup --remove-manual` снимает ссылки на
113
+ скилл и хуки Stop, которые `setup` ставил раньше (у всех агентов или у `--agent`).
114
+
85
115
  ## Где лежат задачи
86
116
 
87
117
  Каталог беклога — `~/backlog` или путь из переменной `BACKLOG_DIR`. Внутри — по каталогу на проект:
@@ -113,9 +143,10 @@
113
143
  | `backlog prune [--project id \| --all-projects] [--apply]` | Задачи с низким приоритетом старше 30 дней; `--apply` отменяет их |
114
144
  | `backlog stats [--project id \| --all-projects] [--json]` | Сводка статистики и тревоги |
115
145
  | `backlog project list \| status <id> active\|inactive \| delete <id> --confirm <id>` | Активность проектов и удаление проекта вместе с задачами |
116
- | `backlog hook stop` | Хук Stop для Claude Code: просит агента перепроверить задачи, чей код изменился |
146
+ | `backlog hook stop [--agent claude\|codex\|cursor]` | Хук Stop для Claude Code, Codex или Cursor: просит агента перепроверить задачи, чей код изменился |
117
147
  | `backlog config language [ru\|en]` | Без значения — печатает текущий язык беклога; со значением — меняет его |
118
- | `backlog setup [--service]` | Поставить скилл и Stop-хук; с `--service` — ещё и службу автозапуска |
148
+ | `backlog setup [--agent claude\|codex\|cursor] [--service]` | Скилл и Stop-хук найденным агентам — Claude Code, Codex, Cursor (см. [Другие агенты](#другие-агенты)); с `--service` — ещё и служба автозапуска |
149
+ | `backlog setup --remove-manual [--agent claude\|codex\|cursor]` | Снимает ссылки на скилл и хуки Stop, которые поставил `setup` |
119
150
  | `backlog serve [--port N]` | Запускает веб-сервер в текущем процессе, порт — из `PORT`, иначе 4317 |
120
151
  | `backlog service install \| uninstall \| status` | Автозапуск веб-сервера при входе: launchd на macOS, systemd --user на Linux, скрипт в папке «Автозагрузка» на Windows; `status` — установлена ли служба и отвечает ли сервер |
121
152
 
@@ -223,30 +254,14 @@ backlog service install
223
254
  ## Удаление
224
255
 
225
256
  ```bash
257
+ backlog setup --remove-manual
226
258
  backlog service uninstall
227
259
  npm uninstall -g p-backlog
228
260
  ```
229
261
 
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
- ```
262
+ `backlog setup --remove-manual` снимает ссылки на скилл и хуки Stop у всех агентов (плагин удаляется через
263
+ `/plugin uninstall`). Перед удалением пакета выполните `backlog service uninstall` — иначе `KeepAlive` у launchd
264
+ (или `Restart=on-failure` у systemd) продолжит перезапускать несуществующий `cli.js`.
250
265
 
251
266
  На Windows скрипт в папке «Автозагрузка» не перезапускает сервер после падения — в отличие от `KeepAlive`
252
267
  у launchd или `Restart=on-failure` у systemd; после сбоя запустите `backlog service install` заново или
@@ -259,6 +274,7 @@ npm install
259
274
  npm run build
260
275
  npm link # глобальная команда backlog
261
276
  npm run install-skill # ~/.claude/skills/backlog → skill/backlog и хук Stop в ~/.claude/settings.json
277
+ npm run plugins # после правки скилла или версии: пересобрать plugins/
262
278
  ```
263
279
 
264
280
  ```bash