@gavin-hu/my-pi-agent 0.13.1 → 0.15.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.
Files changed (237) hide show
  1. package/README.md +66 -41
  2. package/README.zh-CN.md +53 -36
  3. package/extensions/bytefly/README.md +321 -186
  4. package/extensions/bytefly/block/component.ts +7 -15
  5. package/extensions/bytefly/block/register.ts +6 -1
  6. package/extensions/bytefly/doctor/config.ts +4 -1
  7. package/extensions/bytefly/doctor/register.ts +24 -5
  8. package/extensions/bytefly/doctor/tools.ts +4 -0
  9. package/extensions/bytefly/footer/collect/snapshot.ts +6 -1
  10. package/extensions/bytefly/footer/config.ts +10 -6
  11. package/extensions/bytefly/footer/price/config.ts +3 -2
  12. package/extensions/bytefly/footer/price/price.ts +5 -3
  13. package/extensions/bytefly/footer/price/rates.ts +63 -26
  14. package/extensions/bytefly/footer/render/status.ts +3 -3
  15. package/extensions/bytefly/header/component.ts +33 -10
  16. package/extensions/bytefly/header/config.ts +22 -0
  17. package/extensions/bytefly/header/register.ts +2 -1
  18. package/extensions/bytefly/index.ts +6 -6
  19. package/extensions/bytefly/notice/component.ts +8 -3
  20. package/extensions/bytefly/notify/config.ts +7 -12
  21. package/extensions/bytefly/notify/dispatch.ts +13 -5
  22. package/extensions/bytefly/panel/commands.ts +22 -2
  23. package/extensions/bytefly/panel/format.ts +17 -21
  24. package/extensions/bytefly/panel/settings-runtime.ts +86 -22
  25. package/extensions/bytefly/panel/settings.ts +279 -46
  26. package/extensions/bytefly/panel/themes.ts +32 -0
  27. package/extensions/bytefly/panel/tui/editing.ts +77 -0
  28. package/extensions/bytefly/panel/tui/entries.ts +24 -0
  29. package/extensions/bytefly/panel/tui/extensions-view.ts +13 -8
  30. package/extensions/bytefly/panel/tui/frame.ts +121 -4
  31. package/extensions/bytefly/panel/tui/settings-view.ts +98 -13
  32. package/extensions/bytefly/panel/tui.ts +176 -166
  33. package/extensions/bytefly/picker/discovery.ts +1 -0
  34. package/extensions/bytefly/picker/types.ts +2 -0
  35. package/extensions/bytefly/separator/component.ts +17 -6
  36. package/extensions/bytefly/separator/config.ts +15 -0
  37. package/extensions/bytefly/separator/format.ts +60 -6
  38. package/extensions/bytefly/separator/register.ts +68 -9
  39. package/extensions/bytefly/separator/types.ts +8 -0
  40. package/extensions/bytefly/update/cache.ts +58 -19
  41. package/extensions/bytefly/update/check.ts +35 -0
  42. package/extensions/bytefly/update/format.ts +76 -35
  43. package/extensions/bytefly/update/register.ts +144 -55
  44. package/extensions/bytefly/update/state.ts +4 -2
  45. package/extensions/bytefly/update/suppress.ts +66 -0
  46. package/extensions/bytefly/update/types.ts +15 -0
  47. package/extensions/bytefly/working/config.ts +4 -5
  48. package/extensions/bytefly/working/format.ts +24 -7
  49. package/extensions/bytefly/working/register.ts +34 -3
  50. package/extensions/check/README.md +253 -0
  51. package/extensions/check/commands.ts +128 -0
  52. package/extensions/check/config.ts +39 -0
  53. package/extensions/check/detect.ts +269 -0
  54. package/extensions/check/failures.ts +230 -0
  55. package/extensions/check/format.ts +135 -0
  56. package/extensions/check/index.ts +26 -0
  57. package/extensions/check/render.ts +185 -0
  58. package/extensions/check/runner.ts +176 -0
  59. package/extensions/check/runtime.ts +244 -0
  60. package/extensions/check/source.ts +80 -0
  61. package/extensions/check/tools.ts +173 -0
  62. package/extensions/check/tui.ts +195 -0
  63. package/extensions/check/types.ts +99 -0
  64. package/extensions/document/README.md +1 -1
  65. package/extensions/document/extract/pdf.ts +8 -16
  66. package/extensions/document/formats.ts +2 -2
  67. package/extensions/file-browse/README.md +66 -32
  68. package/extensions/file-browse/client.ts +95 -32
  69. package/extensions/file-browse/config.ts +9 -9
  70. package/extensions/file-browse/git.ts +37 -47
  71. package/extensions/file-browse/html.ts +39 -58
  72. package/extensions/file-browse/markdown.ts +110 -92
  73. package/extensions/file-browse/raw-html.ts +478 -0
  74. package/extensions/file-browse/router.ts +32 -70
  75. package/extensions/file-browse/server.ts +18 -56
  76. package/extensions/file-browse/urls.ts +80 -0
  77. package/extensions/goal/README.md +103 -47
  78. package/extensions/goal/clarify-parse.ts +4 -9
  79. package/extensions/goal/clarify.ts +27 -4
  80. package/extensions/goal/commands.ts +24 -11
  81. package/extensions/goal/format.ts +41 -10
  82. package/extensions/goal/index.ts +39 -16
  83. package/extensions/goal/plan-route.ts +51 -0
  84. package/extensions/goal/schema.ts +6 -23
  85. package/extensions/goal/state.ts +39 -57
  86. package/extensions/goal/tools.ts +26 -20
  87. package/extensions/goal/types.ts +11 -1
  88. package/extensions/job/README.md +20 -6
  89. package/extensions/job/format.ts +18 -68
  90. package/extensions/job/index.ts +26 -41
  91. package/extensions/job/log-writer.ts +208 -0
  92. package/extensions/job/logs.ts +3 -2
  93. package/extensions/job/process.ts +6 -99
  94. package/extensions/job/runtime.ts +42 -181
  95. package/extensions/job/schema.ts +1 -4
  96. package/extensions/job/tools.ts +1 -15
  97. package/extensions/job/tui.ts +117 -307
  98. package/extensions/job/ui.ts +7 -33
  99. package/extensions/memory/README.md +3 -1
  100. package/extensions/memory/errors.ts +5 -6
  101. package/extensions/memory/tui.ts +14 -24
  102. package/extensions/plan/README.md +106 -18
  103. package/extensions/plan/commands.ts +9 -5
  104. package/extensions/plan/format.ts +87 -0
  105. package/extensions/plan/index.ts +31 -15
  106. package/extensions/plan/plans.ts +2 -3
  107. package/extensions/plan/policy.ts +0 -6
  108. package/extensions/plan/runtime.ts +4 -2
  109. package/extensions/plan/steps.ts +37 -8
  110. package/extensions/plan/todos.ts +44 -3
  111. package/extensions/plan/tools/enter.ts +94 -0
  112. package/extensions/plan/tools/exit.ts +296 -0
  113. package/extensions/plan/tools/nested.ts +21 -0
  114. package/extensions/plan/tools/steps.ts +136 -0
  115. package/extensions/plan/tools/todo-seed.ts +76 -0
  116. package/extensions/plan/tools/write.ts +127 -0
  117. package/extensions/plan/tools.ts +18 -703
  118. package/extensions/plan/web-client.ts +6 -22
  119. package/extensions/plan/web-page.ts +19 -30
  120. package/extensions/plan/web-router.ts +34 -71
  121. package/extensions/plan/web.ts +13 -40
  122. package/extensions/question/answers.ts +3 -8
  123. package/extensions/question/tui.ts +6 -6
  124. package/extensions/rewind/README.md +95 -22
  125. package/extensions/rewind/checklist.ts +185 -0
  126. package/extensions/rewind/commands.ts +8 -0
  127. package/extensions/rewind/config.ts +3 -11
  128. package/extensions/rewind/format.ts +220 -2
  129. package/extensions/rewind/git.ts +74 -7
  130. package/extensions/rewind/hunk-picker.ts +114 -0
  131. package/extensions/rewind/patch.ts +88 -0
  132. package/extensions/rewind/path-picker.ts +67 -100
  133. package/extensions/rewind/paths.ts +93 -19
  134. package/extensions/rewind/restore.ts +53 -10
  135. package/extensions/rewind/review-tui.ts +320 -0
  136. package/extensions/rewind/review.ts +397 -0
  137. package/extensions/rewind/rewind-tui.ts +4 -3
  138. package/extensions/rewind/runtime.ts +94 -17
  139. package/extensions/subagent/README.md +118 -8
  140. package/extensions/subagent/background-tui.ts +208 -0
  141. package/extensions/subagent/background.ts +470 -0
  142. package/extensions/subagent/commands.ts +80 -0
  143. package/extensions/subagent/config.ts +62 -0
  144. package/extensions/subagent/format.ts +24 -1
  145. package/extensions/subagent/index.ts +116 -1
  146. package/extensions/subagent/orchestrate.ts +16 -3
  147. package/extensions/subagent/render.ts +25 -0
  148. package/extensions/subagent/run.ts +113 -49
  149. package/extensions/subagent/schema.ts +12 -0
  150. package/extensions/subagent/transcripts.ts +202 -0
  151. package/extensions/subagent/types.ts +23 -0
  152. package/extensions/subagent/ui.ts +50 -0
  153. package/extensions/todo/README.md +18 -13
  154. package/extensions/todo/format.ts +3 -2
  155. package/extensions/todo/runtime.ts +3 -2
  156. package/extensions/todo/schema.ts +8 -84
  157. package/extensions/todo/state.ts +5 -46
  158. package/extensions/todo/tools.ts +2 -1
  159. package/extensions/todo/types.ts +6 -15
  160. package/extensions/watch/README.md +16 -6
  161. package/extensions/watch/child.ts +150 -0
  162. package/extensions/watch/format.ts +8 -48
  163. package/extensions/watch/index.ts +42 -58
  164. package/extensions/watch/runtime.ts +49 -128
  165. package/extensions/watch/schema.ts +1 -4
  166. package/extensions/watch/tools.ts +1 -11
  167. package/extensions/watch/tui.ts +103 -273
  168. package/extensions/watch/ui.ts +5 -32
  169. package/extensions/web-access/README.md +1 -1
  170. package/extensions/web-access/fetch/page.ts +1 -1
  171. package/extensions/web-access/fetch/tool.ts +6 -2
  172. package/extensions/web-access/search/search.ts +2 -5
  173. package/extensions/wechat/README.md +3 -1
  174. package/extensions/wechat/client.ts +23 -0
  175. package/extensions/wechat/commands.ts +57 -42
  176. package/extensions/wechat/deliver.ts +5 -9
  177. package/extensions/wechat/errors.ts +3 -6
  178. package/extensions/wechat/inbound.ts +2 -5
  179. package/extensions/wechat/index.ts +2 -8
  180. package/extensions/wechat/outbound.ts +2 -4
  181. package/extensions/wechat/peer-worker.ts +3 -8
  182. package/extensions/wechat/poll.ts +10 -9
  183. package/extensions/wechat/presence.ts +35 -62
  184. package/extensions/wechat/reply-pipeline.ts +3 -1
  185. package/extensions/wechat/status-screen.ts +1 -1
  186. package/extensions/wechat/timer.ts +57 -0
  187. package/extensions/worktree/config.ts +8 -20
  188. package/extensions/worktree/enter.ts +7 -12
  189. package/extensions/worktree/git.ts +38 -69
  190. package/extensions/worktree/index.ts +5 -4
  191. package/extensions/worktree/registry.ts +7 -7
  192. package/extensions/worktree/root-tools.ts +2 -2
  193. package/extensions/worktree/status.ts +3 -2
  194. package/lib/README.md +22 -8
  195. package/lib/config.ts +83 -12
  196. package/lib/errors.ts +12 -0
  197. package/lib/format.ts +56 -0
  198. package/lib/git/read.ts +8 -0
  199. package/lib/goal-state.ts +23 -8
  200. package/lib/http/headers.ts +54 -0
  201. package/lib/http/index.ts +13 -0
  202. package/lib/http/response.ts +46 -0
  203. package/lib/http/router.ts +52 -0
  204. package/lib/http/server.ts +91 -0
  205. package/lib/lines.ts +77 -0
  206. package/lib/pdf.ts +82 -0
  207. package/lib/plan-entry.ts +71 -0
  208. package/lib/plan-state.ts +34 -0
  209. package/lib/report.ts +99 -0
  210. package/lib/requirements.ts +25 -19
  211. package/lib/spawn.ts +170 -0
  212. package/lib/todo-state.ts +110 -23
  213. package/lib/tool-names.ts +7 -0
  214. package/lib/tool-result.ts +33 -0
  215. package/lib/tui/README.md +68 -3
  216. package/lib/tui/chrome.ts +28 -4
  217. package/lib/tui/columns.ts +6 -1
  218. package/lib/tui/confirm.ts +65 -0
  219. package/lib/tui/dock-screen.ts +410 -0
  220. package/lib/tui/glyphs.ts +2 -1
  221. package/lib/tui/indent.ts +1 -1
  222. package/lib/tui/index.ts +2 -0
  223. package/lib/tui/rows.ts +21 -0
  224. package/lib/tui/status-controller.ts +35 -1
  225. package/lib/tui/tool.ts +59 -1
  226. package/lib/web/components.ts +20 -1
  227. package/lib/web/markup.ts +32 -0
  228. package/lib/web/runtime.ts +50 -0
  229. package/package.json +23 -5
  230. package/skills/init/SKILL.md +165 -0
  231. package/skills/init/references/agents-md-quality.md +103 -0
  232. package/skills/init/references/interview-questions.md +81 -0
  233. package/skills/refactor/SKILL.md +141 -0
  234. package/themes/bytefly-dark.json +2 -3
  235. package/themes/bytefly-light.json +2 -3
  236. package/extensions/watch/process.ts +0 -63
  237. package/extensions/web-access/fetch/pdf.ts +0 -45
package/README.md CHANGED
@@ -8,9 +8,13 @@
8
8
  [![built for Pi](https://img.shields.io/badge/built%20for-Pi-5A4FCF)](https://pi.dev)
9
9
 
10
10
  `my-pi-agent` is a single [Pi](https://pi.dev) package that adds a curated set
11
- of extensions and themes to the agent you already use — install the pack, turn
11
+ of extensions, skills, and themes to the agent you already use — install the pack, turn
12
12
  off what you do not want, and keep using Pi unchanged.
13
13
 
14
+ This page is the catalog and the setup instructions. For how to use a feature —
15
+ the keys, the commands, and what you should see — start with the
16
+ [user guide](./docs/user-guide/).
17
+
14
18
  ![A terminal window running the Pi TUI with the bytefly header, hint row, context and loaded extensions, a turn separator, and the status bar](assets/chrome.png)
15
19
 
16
20
  ## Contents
@@ -31,31 +35,34 @@ want the agent to *think first and work safely*:
31
35
  - **Plan, then execute.** A read-only planning mode turns a task into a reviewed
32
36
  plan file that the agent then follows step by step.
33
37
  - **Delegate and parallelize.** Run specialist subagents in their own Pi
34
- processes to explore, review, test, or implement while you keep the thread.
35
- - **Never wreck the checkout.** Work happens in an isolated `git worktree`, and
36
- every prompt is snapshotted so a bad turn is one `/rewind` away.
38
+ processes, push a long build into a background job, and let a watcher tail a
39
+ log until it matters — all while you keep the thread.
40
+ - **Never wreck the checkout.** Isolation is one command: the task moves onto its
41
+ own branch in a `git worktree`, and every prompt is snapshotted so a bad turn
42
+ is one `/rewind` away.
37
43
  - **Remember across sessions.** Durable notes live in plain markdown that you
38
44
  can read, edit, and version.
39
45
  - **Reach the web and your files.** Search, fetch, browse, open, and read
40
- documents — all from inside the session.
46
+ documents from inside the session, and answer a WeChat chat through a bridge to
47
+ the live session.
41
48
 
42
- Everything is optional and independently toggleable. Nothing is patched or
43
- forked: Pi discovers the resources through the `pi` manifest in
44
- [`package.json`](./package.json), so the package upgrades with Pi like any
45
- other.
49
+ Everything is optional and independently toggleable. Nothing is forked, and no
50
+ installed Pi file is modified: Pi discovers the resources through the `pi`
51
+ manifest in [`package.json`](./package.json), so the package upgrades with Pi
52
+ like any other.
46
53
 
47
54
  ## Quick start
48
55
 
49
56
  Requires a working [Pi](https://pi.dev) installation.
50
57
 
51
58
  ```bash
52
- pi install npm:@gavin-hu/my-pi-agent # install from npm
53
- pi install git:github.com/gavin-hu/my-pi-agent # install from git
54
- pi install git:github.com/gavin-hu/my-pi-agent@v0.13.1 # pin a release
55
- pi install ./ -l # project-local (.pi/settings.json)
56
- pi -e . # try it for one run
59
+ pi install npm:@gavin-hu/my-pi-agent
57
60
  ```
58
61
 
62
+ [User guide](./docs/user-guide/) has the other sources — git, a
63
+ pinned release, a project-local install, and a trial that writes nothing — plus
64
+ the fit decision, the first workflows, and how to remove the pack.
65
+
59
66
  `git` on `PATH` is needed by [`worktree`](./extensions/worktree/) and
60
67
  [`rewind`](./extensions/rewind/); everything else degrades or disables cleanly,
61
68
  and `/bytefly doctor` names what is missing, including optional runtime pieces.
@@ -66,33 +73,38 @@ Then, from inside Pi:
66
73
  - `/bytefly [extension] [refresh]` opens the control center on Extensions, lists
67
74
  every loaded extension with its runtime health, enables or disables one, and
68
75
  clears a project override with `x`.
69
- - `/bytefly settings` opens the control center's Settings section: bytefly
70
- startup TUI, desktop notifications and their delivery method, the proactive
71
- health check, the currency and cost precision, the transcript
72
- rail glyph, output padding, and the hardware cursor, with `Space`/`Enter` to
73
- change a value and `Tab` for Global/Project scope.
76
+ - `/bytefly settings` opens the control center's Settings section: ten groups
77
+ covering startup, notifications, diagnostics, pricing, transcript, terminal,
78
+ worktree, snapshots, jobs, and memory, plus a **Theme** row, with
79
+ `Space`/`Enter` to change a value and `Tab` for Global/Project scope.
74
80
  - `/bytefly doctor [extension] [refresh]` prints the doctor report —
75
81
  `run_doctor`'s text — and checks that each enabled extension has what it needs
76
82
  at runtime.
77
- - `/settings` → **Theme** selects a theme.
83
+ - `/bytefly update` re-runs the package update check now and reports the
84
+ updateable packages, this package's version and release URL, or a skip.
78
85
  - `/plan <task>` starts a task in read-only planning mode.
86
+ - `/skill:init` creates or updates `AGENTS.md` through a short built-in interview and a plan you review first.
79
87
 
80
- One thing the pack does on its own: once per interactive session, `bytefly` asks
81
- npm for the newest published version and marks the header when yours is older.
82
- Nothing about the session is sent, and `PI_OFFLINE` skips the request;
88
+ One thing the pack does on its own: once per interactive session, `bytefly`
89
+ asks Pi's package manager which configured packages are behind, suppresses Pi's
90
+ own startup update block, and posts one themed notice naming
91
+ `pi update --extensions`; this package's new version also marks the header.
92
+ Nothing about the session is sent, and `PI_OFFLINE` skips the check;
83
93
  [`docs/security.md`](./docs/security.md) covers the trust boundaries.
84
94
 
85
95
  ## What you get
86
96
 
87
- Sixteen extensions, grouped by what you are trying to do, plus two themes. Each
88
- extension's own `README.md` has the full tool and command surface.
97
+ Seventeen extensions and two packaged skills, grouped by what you are trying to
98
+ do, plus two themes. Each extension's own `README.md` has the full tool and
99
+ command surface.
89
100
 
90
101
  ### Plan and delegate
91
102
 
92
103
  | Extension | Tools and commands | What it does |
93
104
  |---|---|---|
94
- | [`plan`](./extensions/plan/) | `enter_plan_mode`, `write_plan`, `exit_plan_mode`, `set_plan_steps`, `/plan`, `--plan` | Read-only planning: the model investigates, saves a plan under `.pi/plans`, and you approve it before anything is written. Review in the TUI, or open it in a browser to leave inline comments. |
95
- | [`subagent`](./extensions/subagent/) | `subagent` | Delegate a task to a specialist agent (`explorer`, `planner`, `reviewer`, `worker`, `researcher`, `tester`, `debugger`, `documenter`) in its own Pi process — single, parallel, or chained. |
105
+ | [`plan`](./extensions/plan/) | `enter_plan_mode`, `write_plan`, `exit_plan_mode`, `set_plan_steps`, `/plan`, `--plan` | Read-only planning: the model investigates, saves a plan under `.pi/plans`, and you approve it before anything is written. Review in the TUI, or open it in a browser to leave inline comments. The `init` skill uses the same review to create or update a project's `AGENTS.md`. |
106
+ | [`check`](./extensions/check/) | `run_check`, `/check` | Detect the project's test, lint, or typecheck command (or take `check.command`), run it in a supervised process, and turn failures into a navigable `file:line` list. |
107
+ | [`subagent`](./extensions/subagent/) | `subagent`, `/agents` | Delegate a task to a specialist agent (`explorer`, `planner`, `reviewer`, `worker`, `researcher`, `tester`, `debugger`, `documenter`) in its own Pi process — single, parallel, chained, or in the background, with a footer chip while it runs and a finish notice. |
96
108
  | [`todo`](./extensions/todo/) | `todo`, `/todos` | A persistent task list (`pending` / `in_progress` / `completed`) with a one-line widget. |
97
109
  | [`goal`](./extensions/goal/) | `goal`, `/goal` | A persistent session objective, kept in a widget and restated before each turn. |
98
110
  | [`question`](./extensions/question/) | `ask_user_question` | Ask you one or more structured questions (labelled options plus free-form "Other") and wait. |
@@ -103,8 +115,8 @@ extension's own `README.md` has the full tool and command surface.
103
115
 
104
116
  | Extension | Tools and commands | What it does |
105
117
  |---|---|---|
106
- | [`worktree`](./extensions/worktree/) | `enter_worktree`, `exit_worktree`, `prune_worktrees`, `list_worktrees`, `/worktree*`, `--worktree` | Work inside an isolated `git worktree` on its own branch; the built-in read/write/edit/bash tools follow, and cleanup refuses to throw work away. |
107
- | [`rewind`](./extensions/rewind/) | `/rewind`, `↺ N` status chip | Snapshot the repo on every prompt under `refs/pi/rewind` and restore code, conversation, or both. |
118
+ | [`worktree`](./extensions/worktree/) | `enter_worktree`, `exit_worktree`, `prune_worktrees`, `list_worktrees`, `/worktree status|enter|exit|prune`, `--worktree` | Work inside an isolated `git worktree` on its own branch; the built-in read/write/edit/bash tools follow, and cleanup refuses to throw work away. |
119
+ | [`rewind`](./extensions/rewind/) | `/rewind`, `/review`, `↺ N` status chip | Snapshot the repo on every prompt under `refs/pi/rewind`, restore code, conversation, or both, and review the latest turn's changes before reverting a file. |
108
120
  | [`memory`](./extensions/memory/) | `memory`, `/memory` | Durable cross-session notes as human-editable markdown, injected into each run and managed through the `/memory` picker. |
109
121
 
110
122
  ### Reach the world
@@ -121,14 +133,26 @@ extension's own `README.md` has the full tool and command surface.
121
133
 
122
134
  | Extension | Tools and commands | What it does |
123
135
  |---|---|---|
124
- | [`bytefly`](./extensions/bytefly/) | `/bytefly` (with the `doctor` and `settings` subcommands), `run_doctor` | The visible layer: a themed header with a width-adaptive footer, a live elapsed counter on Pi's working row, and a transcript where every tool block leads with its call line and rails its result under it. `/bytefly` switches extensions and holds the curated settings; opt-in `notify` raises OS notifications when a run, a job, or a question needs you. `bytefly.json` is the config document every extension reads. |
136
+ | [`bytefly`](./extensions/bytefly/) | `/bytefly` (with the `doctor`, `settings`, and `update` subcommands), `run_doctor` | The visible layer: a themed header with a width-adaptive footer, a live run line on Pi's working row (tool, tool count, and elapsed time), and a transcript where every tool block leads with its call line and rails its result under it. `/bytefly` switches extensions and holds the curated settings; opt-in `notify` raises OS notifications when a run, a job, or a question needs you. `bytefly.json` is the config document every extension reads. |
137
+
138
+ ### Skills
139
+
140
+ Packaged workflows loaded on demand: each skill's name and description are
141
+ advertised to the model, and its instructions load only when the task matches
142
+ (`/skill:<name>` forces one).
143
+
144
+ | Skill | What it does |
145
+ |---|---|
146
+ | [`init`](./skills/init/SKILL.md) | Creates or updates a project's `AGENTS.md` through a built-in interactive interview and plan review, from repository evidence. |
147
+ | [`refactor`](./skills/refactor/SKILL.md) | Audits a project or path for refactoring opportunities: duplication, oversized modules, coupling, drift, and high-churn code with weak tests. Returns a ranked shortlist with evidence and verification commands; discovery is read-only. |
125
148
 
126
149
  ### Themes
127
150
 
128
151
  [`bytefly-dark`](./themes/bytefly-dark.json) is a GitHub-inspired dark palette
129
152
  and [`bytefly-light`](./themes/bytefly-light.json) its light companion, with
130
153
  optional automatic light/dark switching. Installing the pack does not change
131
- your theme: pick one through `/settings` → **Theme**, or set
154
+ your theme: pick one through `/settings` → **Theme** (or `/bytefly settings` →
155
+ **Theme**), or set
132
156
  `"theme": "bytefly-light/bytefly-dark"` for switching. The screenshots in this
133
157
  README use `bytefly-dark`.
134
158
 
@@ -153,20 +177,23 @@ each tool's own renderer (or bytefly's generic fallback): the user nameplate and
153
177
  a notice, Pi's built-ins, and every tool this package registers. The rail glyph
154
178
  is the `chrome.rail` setting.
155
179
 
156
- ![A full-page reference of every tool block: the user nameplate, a notice, the turn rule, Pi's read, write, edit, bash, grep, find, and ls renderers, and every package tool — todo, goal, memory, job, watch, subagent, web_search, web_fetch, read_doc, open_path, run_doctor, send_wechat, ask_user_question, the plan tools, and the worktree tools](assets/tool-renderings.png)
180
+ ![A full-page reference of every tool block: the user nameplate, a notice, the turn rule, Pi's read, write, edit, bash, grep, find, and ls renderers, and every package tool — todo, goal, memory, job, watch, subagent, web_search, web_fetch, read_doc, open_path, run_doctor, run_check, send_wechat, ask_user_question, the plan tools, and the worktree tools](assets/tool-renderings.png)
157
181
 
158
182
  `bun run screenshot:tools` regenerates it; `bun run screenshot:tool-pngs` writes
159
183
  one image per tool under [`assets/tools/`](./assets/tools).
160
184
 
185
+ Ready to use one? The [user guide](./docs/user-guide/) has a walkthrough for
186
+ each: the first run, the keys that matter, and what to expect on screen.
187
+
161
188
  ## Configuration
162
189
 
163
190
  Most extensions need no configuration. Every setting lives in one shared
164
191
  document, `bytefly.json`, read from `<agent-dir>/bytefly.json` and merged with
165
192
  `<cwd>/.pi/bytefly.json` (project wins), under a top-level section named for the
166
- extension. Each extension's `README.md` covers the behaviour around its keys,
167
- [`docs/configuration.md`](./docs/configuration.md) indexes the sections, and
168
- [`docs/references/bytefly-config.md`](./docs/references/bytefly-config.md) lists
169
- every key with its type, default, and bounds.
193
+ extension. Each extension's `README.md` covers the behaviour around its keys, and
194
+ [`docs/configuration.md`](./docs/configuration.md) has the resolution rules, the
195
+ settings screen walkthrough, and every section's keys with their type, default,
196
+ and bounds.
170
197
 
171
198
  Every extension is on by default. To load the pack without some of them, set
172
199
  `PI_DISABLED_EXTENSIONS` to a comma- or whitespace-separated list of extension
@@ -184,11 +211,9 @@ stops the factories from registering; to drop the whole package, use Pi's
184
211
 
185
212
  | Guide | What it covers |
186
213
  |---|---|
187
- | [Getting started](./docs/getting-started.md) | Requirements, install options, verifying the load, themes. |
188
- | [Extensions](./docs/extensions.md) | The full catalog of every extension and theme. |
189
- | [Configuration](./docs/configuration.md) | Config-file resolution, the per-extension index, environment variables. |
190
- | [Configuration reference](./docs/references/bytefly-config.md) | Every `bytefly.json` section and key, with its type, default, and bounds. |
191
- | [Architecture](./docs/architecture.md) | How the package, its extensions, and `lib/` fit together. |
214
+ | [User guide](./docs/user-guide/) | A chaptered manual: install, every feature, settings, troubleshooting, and a command reference. |
215
+ | [Configuration](./docs/configuration.md) | Resolution, the settings screen, and every `bytefly.json` key with its default and bounds. |
216
+ | [Architecture](./docs/architecture.md) | The load path, runtime model, state, process shapes, and where new code belongs. |
192
217
  | [Development](./docs/development.md) | Local setup, checks, tests, cross-platform notes, and the release process. |
193
218
  | [Security](./docs/security.md) | Trust boundaries for the loopback and remote surfaces. |
194
219
  | [Roadmap](./ROADMAP.md) | Where the pack is going, grouped by the README's promises, with the evidence behind each item. |
package/README.zh-CN.md CHANGED
@@ -8,7 +8,10 @@
8
8
  [![built for Pi](https://img.shields.io/badge/built%20for-Pi-5A4FCF)](https://pi.dev)
9
9
 
10
10
  `my-pi-agent` 是一个 [Pi](https://pi.dev) 包,在你已经使用的智能体之上新增一组精选
11
- 扩展和主题 —— 安装整个包,关掉你不需要的部分,其余照常使用 Pi。
11
+ 扩展、技能和主题 —— 安装整个包,关掉你不需要的部分,其余照常使用 Pi。
12
+
13
+ 本页是目录与安装说明。要了解某个功能怎么用 —— 按键、命令以及应有的效果 ——
14
+ 请先看[用户指南](./docs/user-guide/)。
12
15
 
13
16
  ![一个运行 Pi TUI 的终端窗口,包含 bytefly 头部、提示行、上下文与已加载扩展、回合分隔线以及状态栏](assets/chrome.png)
14
17
 
@@ -29,29 +32,29 @@ Pi 提供一个精简而锐利的内核。这个包是在其之上的一层,
29
32
 
30
33
  - **先规划,再执行。** 只读的规划模式把一次任务变成一份可审阅的计划文件,智能体
31
34
  随后按步骤执行。
32
- - **委派与并行。** 在各自的 Pi 进程中运行专职子智能体来探索、审阅、测试或实现,
33
- 你继续把握主线。
34
- - **绝不搞乱检出区。** 工作发生在隔离的 `git worktree` 中,每次提示都会生成快照,
35
- 因此一次糟糕的回合只需一个 `/rewind` 就能回退。
35
+ - **委派与并行。** 在各自的 Pi 进程中运行专职子智能体,把耗时构建交给后台任务,
36
+ 让 watcher 盯住日志直到出现关键行 —— 你继续把握主线。
37
+ - **绝不搞乱检出区。** 隔离只需一条命令:任务切到自己分支的 `git worktree` 中,
38
+ 每次提示还会生成快照,因此一次糟糕的回合只需一个 `/rewind` 就能回退。
36
39
  - **跨会话记忆。** 持久笔记以纯 Markdown 保存,可读、可改、可纳入版本控制。
37
- - **连通网络与文件。** 搜索、抓取、浏览、打开和读取文档 —— 全部在会话内完成。
40
+ - **连通网络与文件。** 在会话内搜索、抓取、浏览、打开和读取文档,还可通过桥接
41
+ 在微信里直接回答当前会话。
38
42
 
39
- 一切都是可选的,且可独立开关。没有任何东西被补丁或分叉:Pi 通过
40
- [`package.json`](./package.json) 里的 `pi` manifest 发现这些资源,因此该包能像
41
- 其他包一样随 Pi 一起升级。
43
+ 一切都是可选的,且可独立开关。没有任何东西被分叉,也没有修改已安装的 Pi 文件:
44
+ Pi 通过 [`package.json`](./package.json) 里的 `pi` manifest 发现这些资源,因此
45
+ 该包能像其他包一样随 Pi 一起升级。
42
46
 
43
47
  ## 快速开始
44
48
 
45
49
  需要一个可用的 [Pi](https://pi.dev) 安装。
46
50
 
47
51
  ```bash
48
- pi install npm:@gavin-hu/my-pi-agent # 从 npm 安装
49
- pi install git:github.com/gavin-hu/my-pi-agent # 从 git 安装
50
- pi install git:github.com/gavin-hu/my-pi-agent@v0.13.1 # 固定到某个版本
51
- pi install ./ -l # 仅项目本地(.pi/settings.json)
52
- pi -e . # 试运行一次
52
+ pi install npm:@gavin-hu/my-pi-agent
53
53
  ```
54
54
 
55
+ [用户指南](./docs/user-guide/) 介绍其余安装方式——git、固定版本、
56
+ 仅项目本地安装,以及不写入任何内容的试用——还有适用性判断、首个工作流和移除方式。
57
+
55
58
  `git` 需在 `PATH` 上,供 [`worktree`](./extensions/worktree/) 与
56
59
  [`rewind`](./extensions/rewind/) 使用;其余部分会优雅降级或禁用,
57
60
  `/bytefly doctor` 会指出缺少什么,包括可选的运行时组件。
@@ -61,29 +64,33 @@ Windows、macOS 和 Linux 均可运行,完整检查套件在每个平台上都
61
64
 
62
65
  - `/bytefly [extension] [refresh]` 打开控制中心的 Extensions 区,列出每个已加载扩展
63
66
  及其运行时健康状况,启用或禁用一个扩展,并用 `x` 清除项目级覆盖。
64
- - `/bytefly settings` 打开控制中心的 Settings 区:bytefly 启动 TUI、桌面通知及其
65
- 投递方式、主动健康检查、货币与费用精度、转录轨道字形、输出内边距和硬件光标;
66
- 用 `Space`/`Enter` 修改,用 `Tab` 切换 Global/Project 作用域。
67
+ - `/bytefly settings` 打开控制中心的 Settings 区:十个分组覆盖启动、通知、
68
+ 诊断、计价、转录、终端、worktree、快照、任务与监听器、记忆,并提供 **Theme**
69
+ 行;用 `Space`/`Enter` 修改,用 `Tab` 切换 Global/Project 作用域。
67
70
  - `/bytefly doctor [extension] [refresh]` 打印 doctor 报告(`run_doctor` 的文本),
68
71
  检查每个已启用扩展在运行时是否具备所需条件。
69
- - `/settings` → **Theme** 选择主题。
72
+ - `/bytefly update` 立即重跑包更新检查,报告可更新的包、本包版本与 release URL,
73
+ 或跳过原因。
70
74
  - `/plan <任务>` 以只读规划模式开始一个任务。
75
+ - `/skill:init` 通过内置的简短访谈和先审阅的计划创建或更新 `AGENTS.md`。
71
76
 
72
- 还有一件包会自行做的事:每次交互式会话启动时,`bytefly` 向 npm 询问最新发布
73
- 版本,当你的版本较旧时在头部标出。不会发送任何会话内容,`PI_OFFLINE` 可跳过
74
- 该请求;信任边界见 [`docs/security.md`](./docs/security.md)。
77
+ 还有一件包会自行做的事:每次交互式会话启动时,`bytefly` 询问 Pi 的包管理器
78
+ 哪些已配置的包有更新,抑制 Pi 自己的启动更新块,并用一个主题化 notice 列出它们
79
+ 和 `pi update --extensions`;本包的新版本还会标在头部。不会发送任何会话内容,
80
+ `PI_OFFLINE` 可跳过检查;信任边界见 [`docs/security.md`](./docs/security.md)。
75
81
 
76
82
  ## 包含内容
77
83
 
78
- 十六个扩展,按你想达成的目标分组,外加两个主题。每个扩展自己的 `README.md`
84
+ 十七个扩展和两个随包技能,按你想达成的目标分组,外加两个主题。每个扩展自己的 `README.md`
79
85
  提供完整的工具与命令说明。
80
86
 
81
87
  ### 规划与委派
82
88
 
83
89
  | 扩展 | 工具与命令 | 说明 |
84
90
  |---|---|---|
85
- | [`plan`](./extensions/plan/) | `enter_plan_mode`, `write_plan`, `exit_plan_mode`, `set_plan_steps`, `/plan`, `--plan` | 只读规划:模型先调研,把计划保存到 `.pi/plans` 下,你在写入任何内容前先批准。可在 TUI 中审阅,或在浏览器中打开以留下行内评论。 |
86
- | [`subagent`](./extensions/subagent/) | `subagent` | 把任务委派给专职智能体(`explorer`、`planner`、`reviewer`、`worker`、`researcher`、`tester`、`debugger`、`documenter`),运行在它自己的 Pi 进程中 —— 单个、并行或链式。 |
91
+ | [`plan`](./extensions/plan/) | `enter_plan_mode`, `write_plan`, `exit_plan_mode`, `set_plan_steps`, `/plan`, `--plan` | 只读规划:模型先调研,把计划保存到 `.pi/plans` 下,你在写入任何内容前先批准。可在 TUI 中审阅,或在浏览器中打开以留下行内评论。`init` 技能复用同一审阅流程来创建或更新项目的 `AGENTS.md`。 |
92
+ | [`check`](./extensions/check/) | `run_check`, `/check` | 检测项目的测试、lint 或类型检查命令(或使用 `check.command`),在受监管的进程中运行,并把失败整理成可导航的 `file:line` 列表。 |
93
+ | [`subagent`](./extensions/subagent/) | `subagent`, `/agents` | 把任务委派给专职智能体(`explorer`、`planner`、`reviewer`、`worker`、`researcher`、`tester`、`debugger`、`documenter`),运行在它自己的 Pi 进程中 —— 单个、并行、链式或在后台运行;后台运行时在页脚显示数量,完成后发出提示。 |
87
94
  | [`todo`](./extensions/todo/) | `todo`, `/todos` | 持久任务列表(`pending` / `in_progress` / `completed`),配一行式 widget。 |
88
95
  | [`goal`](./extensions/goal/) | `goal`, `/goal` | 持久会话目标,保存在 widget 中,并在每个回合前重述。 |
89
96
  | [`question`](./extensions/question/) | `ask_user_question` | 向你提出一个或多个结构化问题(带标签的选项外加自由填写的“其他”)并等待回答。 |
@@ -94,8 +101,8 @@ Windows、macOS 和 Linux 均可运行,完整检查套件在每个平台上都
94
101
 
95
102
  | 扩展 | 工具与命令 | 说明 |
96
103
  |---|---|---|
97
- | [`worktree`](./extensions/worktree/) | `enter_worktree`, `exit_worktree`, `prune_worktrees`, `list_worktrees`, `/worktree*`, `--worktree` | 在隔离的 `git worktree` 里、在独立分支上工作;内置的 read/write/edit/bash 工具会跟随,清理时也不会丢弃工作。 |
98
- | [`rewind`](./extensions/rewind/) | `/rewind`, `↺ N` 状态标记 | 每次提示时在 `refs/pi/rewind` 下对仓库生成快照,可恢复代码、对话或两者。 |
104
+ | [`worktree`](./extensions/worktree/) | `enter_worktree`, `exit_worktree`, `prune_worktrees`, `list_worktrees`, `/worktree status|enter|exit|prune`, `--worktree` | 在隔离的 `git worktree` 里、在独立分支上工作;内置的 read/write/edit/bash 工具会跟随,清理时也不会丢弃工作。 |
105
+ | [`rewind`](./extensions/rewind/) | `/rewind`, `/review`, `↺ N` 状态标记 | 每次提示时在 `refs/pi/rewind` 下对仓库生成快照,可恢复代码、对话或两者,并在还原文件前审阅本轮改动。 |
99
106
  | [`memory`](./extensions/memory/) | `memory`, `/memory` | 跨会话的持久笔记,以可人工编辑的 Markdown 保存,注入每次运行,并通过 `/memory` 选择器管理。 |
100
107
 
101
108
  ### 连通外部世界
@@ -112,13 +119,23 @@ Windows、macOS 和 Linux 均可运行,完整检查套件在每个平台上都
112
119
 
113
120
  | 扩展 | 工具与命令 | 说明 |
114
121
  |---|---|---|
115
- | [`bytefly`](./extensions/bytefly/) | `/bytefly`(`doctor`、`settings` 子命令)、`run_doctor` | 可见的那一层:主题化头部配宽度自适应页脚,Pi 工作行上实时计时,转录中每个工具块以调用行为标题、结果正文挂在其下方。`/bytefly` 可开关扩展并集中存放精选设置;可选的 `notify` 会在一次运行、后台任务或待回答的问题需要你时发出系统通知。`bytefly.json` 是每个扩展都会读取的配置文档。 |
122
+ | [`bytefly`](./extensions/bytefly/) | `/bytefly`(`doctor`、`settings`、`update` 子命令)、`run_doctor` | 可见的那一层:主题化头部配宽度自适应页脚,Pi 工作行上实时显示工具、调用次数与计时,转录中每个工具块以调用行为标题、结果正文挂在其下方。`/bytefly` 可开关扩展并集中存放精选设置;可选的 `notify` 会在一次运行、后台任务或待回答的问题需要你时发出系统通知。`bytefly.json` 是每个扩展都会读取的配置文档。 |
123
+
124
+ ### 技能
125
+
126
+ 按需加载的随包工作流:每个技能的名称和描述会提供给模型,只有任务匹配时才加载完整说明(`/skill:<name>` 可强制加载)。
127
+
128
+ | 技能 | 说明 |
129
+ |---|---|
130
+ | [`init`](./skills/init/SKILL.md) | 基于仓库证据,通过内置的交互式访谈和计划审阅创建或更新项目的 `AGENTS.md`。 |
131
+ | [`refactor`](./skills/refactor/SKILL.md) | 审计项目或路径中的重构机会:重复代码、过大的模块、耦合、结构漂移,以及测试薄弱且改动频繁的代码。返回带证据和验证命令的排序清单;发现阶段只读。 |
116
132
 
117
133
  ### 主题
118
134
 
119
135
  [`bytefly-dark`](./themes/bytefly-dark.json) 是 GitHub 风格的深色调色板,
120
136
  [`bytefly-light`](./themes/bytefly-light.json) 是其浅色搭档,并支持可选的自动
121
- 浅色/深色切换。安装本包不会改变你的主题:通过 `/settings` → **Theme** 选择,
137
+ 浅色/深色切换。安装本包不会改变你的主题:通过 `/settings` → **Theme**(或
138
+ `/bytefly settings` → **Theme**)选择,
122
139
  或设置 `"theme": "bytefly-light/bytefly-dark"` 以自动切换。本 README 的截图
123
140
  使用 `bytefly-dark`。
124
141
 
@@ -147,14 +164,16 @@ Windows、macOS 和 Linux 均可运行,完整检查套件在每个平台上都
147
164
  `bun run screenshot:tools` 重新生成它;`bun run screenshot:tool-pngs` 在
148
165
  [`assets/tools/`](./assets/tools) 下为每个工具输出一张图。
149
166
 
167
+ 准备上手了?[用户指南](./docs/user-guide/) 为每个扩展都准备了分步讲解:
168
+ 第一次运行、关键按键,以及屏幕上会出现什么。
169
+
150
170
  ## 配置
151
171
 
152
172
  大多数扩展无需配置。所有设置都在一个共享文档 `bytefly.json` 中,从
153
173
  `<agent-dir>/bytefly.json` 读取,并与 `<cwd>/.pi/bytefly.json` 合并(项目优先),
154
174
  位于一个以扩展名命名的顶层 section 下。每个扩展的 `README.md` 说明其键位的行为,
155
- [`docs/configuration.md`](./docs/configuration.md) 为其建立索引,
156
- [`docs/references/bytefly-config.md`](./docs/references/bytefly-config.md) 逐个列出每个键的
157
- 类型、默认值和取值范围。
175
+ [`docs/configuration.md`](./docs/configuration.md) 则给出解析规则、设置界面操作方式,
176
+ 以及每个 section 的键、类型、默认值和取值范围。
158
177
 
159
178
  每个扩展默认都开启。若要在加载整包时排除其中一些,把 `PI_DISABLED_EXTENSIONS`
160
179
  设为一个以逗号或空白分隔的扩展名列表(即 [`extensions/`](./extensions/) 下的目录
@@ -171,11 +190,9 @@ Pi 的 `--no-extensions`,或从你的设置中删除该包。
171
190
 
172
191
  | 指南 | 内容 |
173
192
  |---|---|
174
- | [快速开始](./docs/getting-started.md) | 环境要求、安装选项、验证加载、主题。 |
175
- | [扩展](./docs/extensions.md) | 所有扩展与主题的完整目录。 |
176
- | [配置](./docs/configuration.md) | 配置文件解析、按扩展索引、环境变量。 |
177
- | [配置参考](./docs/references/bytefly-config.md) | 列出 `bytefly.json` 的每个 section 与键,包括类型、默认值和取值范围。 |
178
- | [架构](./docs/architecture.md) | 包、各扩展与 `lib/` 如何协同。 |
193
+ | [用户指南](./docs/user-guide/) | 分章手册:安装、每项功能、设置、故障排查与命令参考。 |
194
+ | [配置](./docs/configuration.md) | 解析规则、设置界面,以及 `bytefly.json` 每个键的默认值与取值范围。 |
195
+ | [架构](./docs/architecture.md) | 加载路径、运行时模型、状态、进程形态,以及新代码应放在哪里。 |
179
196
  | [开发](./docs/development.md) | 本地设置、检查、测试、跨平台注意事项与发布流程。 |
180
197
  | [安全](./docs/security.md) | 回环与远程界面的信任边界。 |
181
198
  | [路线图](./ROADMAP.md) | 包的下一步方向,按 README 的承诺分组,并列出每条事项的依据。 |