@gavin-hu/my-pi-agent 0.17.0 → 0.19.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 (274) hide show
  1. package/README.md +61 -45
  2. package/README.zh-CN.md +54 -42
  3. package/docs/extensions/README.md +34 -0
  4. package/docs/extensions/board.md +344 -0
  5. package/{extensions/bytefly/README.md → docs/extensions/bytefly.md} +465 -416
  6. package/{extensions/check/README.md → docs/extensions/check.md} +83 -68
  7. package/{extensions/context/README.md → docs/extensions/context.md} +40 -23
  8. package/docs/extensions/file-browse.md +554 -0
  9. package/{extensions/file-open/README.md → docs/extensions/file-open.md} +31 -23
  10. package/{extensions/file-read/README.md → docs/extensions/file-read.md} +47 -55
  11. package/{extensions/goal/README.md → docs/extensions/goal.md} +115 -131
  12. package/{extensions/job/README.md → docs/extensions/job.md} +66 -53
  13. package/{extensions/memory/README.md → docs/extensions/memory.md} +74 -63
  14. package/docs/extensions/plan.md +976 -0
  15. package/{extensions/question/README.md → docs/extensions/question.md} +54 -28
  16. package/{extensions/rewind/README.md → docs/extensions/rewind.md} +115 -122
  17. package/docs/extensions/session-bus.md +285 -0
  18. package/{extensions/subagent/README.md → docs/extensions/subagent.md} +166 -119
  19. package/docs/extensions/team.md +226 -0
  20. package/{extensions/todo/README.md → docs/extensions/todo.md} +85 -88
  21. package/{extensions/watch/README.md → docs/extensions/watch.md} +60 -38
  22. package/{extensions/web-access/README.md → docs/extensions/web-access.md} +93 -50
  23. package/{extensions/wechat/README.md → docs/extensions/wechat.md} +275 -192
  24. package/{extensions/worktree/README.md → docs/extensions/worktree.md} +115 -72
  25. package/extensions/board/commands.ts +87 -0
  26. package/extensions/board/config.ts +36 -0
  27. package/extensions/board/format.ts +72 -0
  28. package/extensions/board/index.ts +40 -0
  29. package/extensions/board/input.ts +54 -0
  30. package/extensions/board/join.ts +42 -0
  31. package/extensions/board/page.ts +312 -0
  32. package/extensions/board/result.ts +99 -0
  33. package/extensions/board/rows.ts +48 -0
  34. package/extensions/board/schema.ts +75 -0
  35. package/extensions/board/seat.ts +29 -0
  36. package/extensions/board/snapshot.ts +41 -0
  37. package/extensions/board/tools.ts +279 -0
  38. package/extensions/board/transport/router.ts +172 -0
  39. package/extensions/board/transport/server.ts +149 -0
  40. package/extensions/board/types.ts +54 -0
  41. package/extensions/board/view/actions.ts +306 -0
  42. package/extensions/board/view/client.ts +41 -0
  43. package/extensions/board/view/keys.ts +121 -0
  44. package/extensions/board/view/live.ts +397 -0
  45. package/extensions/board/view/page.ts +158 -0
  46. package/extensions/board/view/render.ts +496 -0
  47. package/extensions/board/view/styles.ts +211 -0
  48. package/extensions/board/view/team.ts +305 -0
  49. package/extensions/board/writes.ts +99 -0
  50. package/extensions/bytefly/notify/types.ts +1 -1
  51. package/extensions/bytefly/panel/commands.ts +40 -7
  52. package/extensions/bytefly/panel/settings-runtime.ts +0 -6
  53. package/extensions/bytefly/panel/settings.ts +11 -21
  54. package/extensions/bytefly/panel/tui/settings-view.ts +1 -1
  55. package/extensions/bytefly/picker/discovery.ts +0 -2
  56. package/extensions/bytefly/picker/types.ts +0 -2
  57. package/extensions/bytefly/update/check.ts +39 -0
  58. package/extensions/bytefly/update/format.ts +15 -0
  59. package/extensions/bytefly/update/register.ts +73 -34
  60. package/extensions/bytefly/update/state.ts +6 -3
  61. package/extensions/context/tui.ts +1 -1
  62. package/extensions/file-browse/{config.ts → config/config.ts} +13 -4
  63. package/extensions/file-browse/{files.ts → files/files.ts} +1 -14
  64. package/extensions/file-browse/{paths.ts → files/paths.ts} +1 -1
  65. package/extensions/file-browse/{git.ts → git/git.ts} +10 -3
  66. package/extensions/file-browse/index.ts +4 -4
  67. package/extensions/file-browse/{live.ts → live/live.ts} +54 -82
  68. package/extensions/file-browse/live/rev.ts +42 -0
  69. package/extensions/file-browse/{router.ts → transport/router.ts} +44 -17
  70. package/extensions/file-browse/transport/server.ts +110 -0
  71. package/extensions/file-browse/view/chrome.ts +83 -0
  72. package/extensions/file-browse/{client.ts → view/client.ts} +63 -1
  73. package/extensions/file-browse/view/diff-html.ts +94 -0
  74. package/extensions/file-browse/{html.ts → view/html.ts} +32 -158
  75. package/extensions/file-browse/{icons.ts → view/icons.ts} +1 -1
  76. package/extensions/file-browse/{live-client.ts → view/live-client.ts} +47 -1
  77. package/extensions/file-browse/{markdown.ts → view/markdown.ts} +7 -7
  78. package/extensions/file-browse/{raw-html.ts → view/raw-html.ts} +1 -1
  79. package/extensions/file-browse/{styles.ts → view/styles.ts} +31 -5
  80. package/extensions/file-browse/{tree.ts → view/tree.ts} +1 -1
  81. package/extensions/file-browse/{urls.ts → view/urls.ts} +1 -1
  82. package/extensions/file-read/schema.ts +2 -1
  83. package/extensions/goal/plan-route.ts +8 -2
  84. package/extensions/job/index.ts +15 -7
  85. package/extensions/memory/store.ts +12 -5
  86. package/extensions/plan/blocks.ts +23 -2
  87. package/extensions/plan/commands.ts +77 -21
  88. package/extensions/plan/feedback.ts +409 -63
  89. package/extensions/plan/index.ts +7 -5
  90. package/extensions/plan/plan-index.ts +44 -10
  91. package/extensions/plan/plan-text.ts +51 -24
  92. package/extensions/plan/plans.ts +162 -57
  93. package/extensions/plan/policy.ts +20 -12
  94. package/extensions/plan/review-prompt.ts +93 -0
  95. package/extensions/plan/review.ts +51 -95
  96. package/extensions/plan/runtime.ts +22 -10
  97. package/extensions/plan/sections.ts +112 -0
  98. package/extensions/plan/steps.ts +63 -95
  99. package/extensions/plan/tools/enter.ts +8 -3
  100. package/extensions/plan/tools/exit.ts +13 -19
  101. package/extensions/plan/tools/write.ts +8 -3
  102. package/extensions/plan/tools.ts +1 -1
  103. package/extensions/plan/tui.ts +29 -15
  104. package/extensions/plan/types.ts +29 -3
  105. package/extensions/plan/web-chrome.ts +2 -1
  106. package/extensions/plan/web-client.ts +122 -178
  107. package/extensions/plan/web-collab.ts +207 -0
  108. package/extensions/plan/web-comments.ts +269 -0
  109. package/extensions/plan/web-page.ts +96 -17
  110. package/extensions/plan/web-router.ts +109 -47
  111. package/extensions/plan/web-share-session.ts +191 -0
  112. package/extensions/plan/web-share.ts +169 -0
  113. package/extensions/plan/web-streams.ts +124 -0
  114. package/extensions/plan/web-tokens.ts +63 -0
  115. package/extensions/plan/web.ts +245 -151
  116. package/extensions/question/dialogs.ts +91 -1
  117. package/extensions/question/tools.ts +2 -1
  118. package/extensions/rewind/{commands.ts → commands/commands.ts} +5 -5
  119. package/extensions/rewind/{review.ts → commands/review.ts} +13 -13
  120. package/extensions/rewind/{rewind.ts → commands/rewind.ts} +6 -6
  121. package/extensions/rewind/{config.ts → config/config.ts} +1 -1
  122. package/extensions/rewind/index.ts +3 -3
  123. package/extensions/rewind/{policy.ts → state/policy.ts} +4 -4
  124. package/extensions/rewind/{runtime.ts → state/runtime.ts} +11 -11
  125. package/extensions/rewind/{snapshot-run.ts → state/snapshot-run.ts} +1 -1
  126. package/extensions/rewind/{timeline.ts → state/timeline.ts} +2 -2
  127. package/extensions/rewind/{format.ts → text/format.ts} +3 -3
  128. package/extensions/rewind/{git.ts → transport/git.ts} +2 -2
  129. package/extensions/rewind/{restore.ts → transport/restore.ts} +2 -2
  130. package/extensions/rewind/{snapshot.ts → transport/snapshot.ts} +1 -1
  131. package/extensions/rewind/{store.ts → transport/store.ts} +1 -1
  132. package/extensions/rewind/{checklist.ts → view/checklist.ts} +6 -6
  133. package/extensions/rewind/{hunk-picker.ts → view/hunk-picker.ts} +8 -8
  134. package/extensions/rewind/{path-picker.ts → view/path-picker.ts} +7 -7
  135. package/extensions/rewind/{review-tui.ts → view/review-tui.ts} +11 -11
  136. package/extensions/rewind/{rewind-tui.ts → view/rewind-tui.ts} +17 -11
  137. package/extensions/rewind/{status.ts → view/status.ts} +4 -4
  138. package/extensions/session-bus/commands.ts +113 -0
  139. package/extensions/session-bus/format.ts +101 -0
  140. package/extensions/session-bus/index.ts +75 -0
  141. package/extensions/session-bus/join-request.ts +40 -0
  142. package/extensions/session-bus/mail-watch.ts +134 -0
  143. package/extensions/session-bus/notice.ts +86 -0
  144. package/extensions/session-bus/overlap.ts +36 -0
  145. package/extensions/session-bus/protocol.ts +104 -0
  146. package/extensions/session-bus/resolve.ts +67 -0
  147. package/extensions/session-bus/result.ts +208 -0
  148. package/extensions/session-bus/rows.ts +171 -0
  149. package/extensions/session-bus/runtime.ts +466 -0
  150. package/extensions/session-bus/store.ts +365 -0
  151. package/extensions/session-bus/tools.ts +192 -0
  152. package/extensions/session-bus/tui.ts +394 -0
  153. package/extensions/session-bus/types.ts +98 -0
  154. package/extensions/subagent/agents.ts +9 -8
  155. package/extensions/subagent/invocation.ts +4 -2
  156. package/extensions/team/commands.ts +112 -0
  157. package/extensions/team/dispatch.ts +133 -0
  158. package/extensions/team/format.ts +105 -0
  159. package/extensions/team/index.ts +33 -0
  160. package/extensions/team/schema.ts +29 -0
  161. package/extensions/team/tools.ts +246 -0
  162. package/extensions/team/types.ts +48 -0
  163. package/extensions/watch/index.ts +15 -9
  164. package/extensions/web-access/fetch/page.ts +4 -1
  165. package/extensions/web-access/fetch/structured.ts +447 -0
  166. package/extensions/web-access/fetch/tool.ts +2 -1
  167. package/extensions/web-access/search/tool.ts +2 -1
  168. package/extensions/wechat/bridge.ts +76 -92
  169. package/extensions/wechat/{commands.ts → commands/commands.ts} +26 -18
  170. package/extensions/wechat/{doctor.ts → commands/doctor.ts} +5 -5
  171. package/extensions/wechat/{history.ts → commands/history.ts} +1 -1
  172. package/extensions/wechat/{login.ts → commands/login.ts} +3 -3
  173. package/extensions/wechat/{slash.ts → commands/slash.ts} +38 -2
  174. package/extensions/wechat/dialog/channels.ts +136 -0
  175. package/extensions/wechat/{interaction.ts → dialog/interaction.ts} +66 -51
  176. package/extensions/wechat/{prompt.ts → dialog/prompt.ts} +40 -25
  177. package/extensions/wechat/{remote-ui.ts → dialog/remote-ui.ts} +1 -1
  178. package/extensions/wechat/index.ts +10 -10
  179. package/extensions/wechat/{admission.ts → peer/admission.ts} +2 -2
  180. package/extensions/wechat/{peer-session.ts → peer/peer-session.ts} +2 -2
  181. package/extensions/wechat/{peer-worker.ts → peer/peer-worker.ts} +119 -56
  182. package/extensions/wechat/{presence.ts → peer/presence.ts} +11 -11
  183. package/extensions/wechat/{reply-pipeline.ts → peer/reply-pipeline.ts} +13 -5
  184. package/extensions/wechat/{credentials.ts → state/credentials.ts} +2 -2
  185. package/extensions/wechat/{state.ts → state/state.ts} +14 -2
  186. package/extensions/wechat/{format.ts → text/format.ts} +3 -3
  187. package/extensions/wechat/{notices.ts → text/notices.ts} +15 -7
  188. package/extensions/wechat/tools.ts +29 -12
  189. package/extensions/wechat/{client.ts → transport/client.ts} +26 -2
  190. package/extensions/wechat/{deliver.ts → transport/deliver.ts} +104 -40
  191. package/extensions/wechat/{inbound.ts → transport/inbound.ts} +5 -5
  192. package/extensions/wechat/{media.ts → transport/media.ts} +11 -5
  193. package/extensions/wechat/transport/outbound.ts +142 -0
  194. package/extensions/wechat/{poll.ts → transport/poll.ts} +3 -3
  195. package/extensions/wechat/types.ts +10 -1
  196. package/extensions/wechat/{login-screen.ts → view/login-screen.ts} +4 -4
  197. package/extensions/wechat/{status-screen.ts → view/status-screen.ts} +31 -26
  198. package/extensions/worktree/git.ts +5 -0
  199. package/extensions/worktree/guard.ts +3 -5
  200. package/extensions/worktree/registry.ts +11 -5
  201. package/extensions/worktree/status.ts +1 -3
  202. package/lib/README.md +12 -6
  203. package/lib/board/card.ts +290 -0
  204. package/lib/board/links.ts +117 -0
  205. package/lib/board/page-pointer.ts +256 -0
  206. package/lib/board/round-text.ts +72 -0
  207. package/lib/board/round.ts +89 -0
  208. package/lib/board/rules.ts +304 -0
  209. package/lib/board/session.ts +105 -0
  210. package/lib/board/store.ts +310 -0
  211. package/lib/board/view.ts +150 -0
  212. package/lib/errors.ts +12 -4
  213. package/lib/format.ts +13 -0
  214. package/lib/http/guard.ts +112 -0
  215. package/lib/http/index.ts +16 -5
  216. package/lib/http/router.ts +40 -13
  217. package/lib/http/serve.ts +234 -0
  218. package/lib/http/server.ts +29 -13
  219. package/lib/http/sink.ts +110 -0
  220. package/lib/http/token.ts +38 -0
  221. package/lib/interaction.ts +10 -0
  222. package/lib/notice.ts +29 -2
  223. package/lib/plan-entry.ts +7 -2
  224. package/lib/policy.ts +12 -2
  225. package/lib/qr.ts +64 -0
  226. package/lib/repo-key.ts +74 -0
  227. package/lib/report.ts +52 -33
  228. package/lib/requirements.ts +7 -9
  229. package/lib/session-label.ts +64 -0
  230. package/lib/session-roster.ts +130 -0
  231. package/lib/session-tool.ts +184 -0
  232. package/lib/tool-names.ts +25 -2
  233. package/lib/tui/README.md +16 -2
  234. package/lib/tui/dock-screen.ts +85 -17
  235. package/lib/tui/glyphs.ts +2 -0
  236. package/lib/tui/line-pane.ts +15 -4
  237. package/lib/tui/tool.ts +23 -4
  238. package/lib/web/README.md +5 -2
  239. package/lib/web/components.ts +6 -1
  240. package/lib/web/runtime.ts +7 -1
  241. package/lib/web/tokens.ts +25 -2
  242. package/package.json +27 -14
  243. package/skills/init/SKILL.md +80 -45
  244. package/skills/init/references/agents-md-quality.md +26 -2
  245. package/skills/init/references/interview-questions.md +36 -14
  246. package/skills/next/SKILL.md +77 -51
  247. package/skills/project-docs/SKILL.md +133 -0
  248. package/skills/project-docs/references/audit.md +131 -0
  249. package/skills/project-docs/references/changelog.md +105 -0
  250. package/skills/project-docs/references/discovery.md +127 -0
  251. package/skills/project-docs/references/readme.md +80 -0
  252. package/skills/project-docs/references/release.md +84 -0
  253. package/skills/project-docs/references/roadmap.md +93 -0
  254. package/skills/project-docs/scripts/state.ts +316 -0
  255. package/skills/refactor/SKILL.md +100 -125
  256. package/skills/refactor/references/handoff.md +35 -0
  257. package/skills/refactor/references/signals.md +54 -0
  258. package/skills/refactor/scripts/inventory.ts +587 -0
  259. package/extensions/file-browse/README.md +0 -467
  260. package/extensions/file-browse/server.ts +0 -134
  261. package/extensions/plan/README.md +0 -709
  262. package/extensions/plan/config.ts +0 -27
  263. package/extensions/wechat/outbound.ts +0 -100
  264. package/extensions/wechat/qrcode.ts +0 -46
  265. package/skills/changelog/SKILL.md +0 -148
  266. /package/extensions/file-browse/{diff.ts → text/diff.ts} +0 -0
  267. /package/extensions/file-browse/{fuzzy.ts → text/fuzzy.ts} +0 -0
  268. /package/extensions/file-browse/{palette.ts → view/palette.ts} +0 -0
  269. /package/extensions/rewind/{patch.ts → text/patch.ts} +0 -0
  270. /package/extensions/rewind/{paths.ts → text/paths.ts} +0 -0
  271. /package/extensions/rewind/{queue.ts → transport/queue.ts} +0 -0
  272. /package/extensions/rewind/{temp-index.ts → transport/temp-index.ts} +0 -0
  273. /package/extensions/wechat/{lock.ts → state/lock.ts} +0 -0
  274. /package/extensions/wechat/{channel.ts → text/channel.ts} +0 -0
@@ -1,27 +0,0 @@
1
- /**
2
- * Config-file support for plan mode.
3
- *
4
- * The `plan` section of the shared `bytefly.json` (global then project, project
5
- * wins). Only the approval offer is configurable; plan mode itself never depends
6
- * on it.
7
- */
8
-
9
- import { loadConfigSection } from "../../lib/config.ts";
10
-
11
- export interface PlanConfig {
12
- /** Ask before recording an approved plan's objective as the session goal. */
13
- goalPrompt: boolean;
14
- }
15
-
16
- export const DEFAULT_CONFIG: PlanConfig = { goalPrompt: true };
17
-
18
- /** Normalize one merged config object over the running base. */
19
- export function normalizeConfig(raw: Record<string, unknown> | undefined, base: PlanConfig): PlanConfig {
20
- if (!raw) return base;
21
- return { goalPrompt: typeof raw.goalPrompt === "boolean" ? raw.goalPrompt : base.goalPrompt };
22
- }
23
-
24
- /** Effective plan config from the shared `plan` section (defaults, global, project). */
25
- export function loadConfig(cwd: string): PlanConfig {
26
- return loadConfigSection(cwd, "plan", DEFAULT_CONFIG, normalizeConfig);
27
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * Outbound file sending: encrypt a local file and deliver it as one Weixin file
3
- * message.
4
- *
5
- * The flow mirrors the reference client: read the plaintext, compute its size and
6
- * MD5, generate a 16-byte AES key and a file key, request the CDN upload target,
7
- * upload the AES-128-ECB ciphertext, then send a `type: 4` file item whose media
8
- * reference carries the returned download parameter.
9
- *
10
- * Everything is injected, so it is tested with a fake client and a temp file.
11
- */
12
-
13
- import { createHash, randomBytes } from "node:crypto";
14
- import { readFileSync } from "node:fs";
15
- import { basename } from "node:path";
16
- import { rejectionOf, type WechatClient } from "./client.ts";
17
- import { aesEcbPaddedSize, encryptEcb, sanitizeFileName, uploadUrlOf } from "./media.ts";
18
- import type { BotCredentials, CDNMedia } from "./types.ts";
19
-
20
- /** `UploadMediaType.FILE` from the protocol. */
21
- export const UPLOAD_MEDIA_TYPE_FILE = 3;
22
-
23
- export interface SendLocalFileArgs {
24
- client: WechatClient;
25
- account: BotCredentials;
26
- cdnBaseUrl: string;
27
- /** Files larger than this are refused. */
28
- maxBytes: number;
29
- to: string;
30
- contextToken?: string;
31
- filePath: string;
32
- /** Display name; defaults to the file's base name, sanitized. */
33
- fileName?: string;
34
- signal?: AbortSignal;
35
- /** Random bytes for the AES key and file key; defaults to `crypto.randomBytes`. */
36
- random?: (size: number) => Buffer;
37
- }
38
-
39
- /**
40
- * Upload and send a local file. Returns true when the message was accepted.
41
- * Any failure (unreadable file, size cap, upload rejection) returns false rather
42
- * than throwing, so the caller can fall back.
43
- */
44
- export async function sendLocalFile(args: SendLocalFileArgs): Promise<boolean> {
45
- try {
46
- const plain = readFileSync(args.filePath);
47
- if (plain.length === 0 || plain.length > args.maxBytes) return false;
48
-
49
- const random = args.random ?? randomBytes;
50
- const aesKey = random(16);
51
- const filekey = random(16).toString("hex");
52
- const rawsize = plain.length;
53
- const rawfilemd5 = createHash("md5").update(plain).digest("hex");
54
- const filesize = aesEcbPaddedSize(rawsize);
55
-
56
- const upload = await args.client.getUploadUrl(
57
- args.account,
58
- {
59
- filekey,
60
- mediaType: UPLOAD_MEDIA_TYPE_FILE,
61
- toUserId: args.to,
62
- rawsize,
63
- rawfilemd5,
64
- filesize,
65
- aeskey: aesKey.toString("hex"),
66
- },
67
- args.signal,
68
- );
69
-
70
- const downloadParam = await args.client.uploadCdn(
71
- uploadUrlOf(upload, args.cdnBaseUrl, filekey),
72
- encryptEcb(plain, aesKey),
73
- args.signal,
74
- );
75
-
76
- // The reference encodes the hex key string as base64 (not the raw 16 bytes);
77
- // the download decoder accepts either.
78
- const media: CDNMedia = {
79
- encrypt_query_param: downloadParam,
80
- aes_key: Buffer.from(aesKey.toString("hex")).toString("base64"),
81
- encrypt_type: 1,
82
- };
83
-
84
- const response = await args.client.sendFileMessage(
85
- args.account,
86
- {
87
- to: args.to,
88
- fileName: sanitizeFileName(args.fileName ?? basename(args.filePath)),
89
- len: String(rawsize),
90
- media,
91
- contextToken: args.contextToken,
92
- },
93
- args.signal,
94
- );
95
-
96
- return rejectionOf(response) === undefined;
97
- } catch {
98
- return false;
99
- }
100
- }
@@ -1,46 +0,0 @@
1
- /**
2
- * Rendering a QR string as terminal lines.
3
- *
4
- * Uses the `qrcode` package only for the module matrix, then draws Unicode
5
- * half-blocks so two matrix rows share one terminal line. The package loads on
6
- * the first QR, not when the extension registers: a session that never logs in
7
- * pays nothing for it. No ANSI is emitted; the login screen decides colours, and
8
- * the width is the matrix width plus a quiet zone.
9
- */
10
-
11
- interface QrMatrix {
12
- size: number;
13
- get(row: number, col: number): boolean;
14
- }
15
-
16
- /** Build the module matrix for `text`, loading `qrcode` on first use. */
17
- export async function qrMatrix(text: string): Promise<QrMatrix> {
18
- const { default: QRCode } = await import("qrcode");
19
- const qr = QRCode.create(text, { errorCorrectionLevel: "M" });
20
- return qr.modules as unknown as QrMatrix;
21
- }
22
-
23
- /**
24
- * The QR as terminal lines. Each string is exactly `matrix.size + 2 * quiet`
25
- * columns wide (half-block characters are single width), so a caller can test
26
- * `qrLines(text)[0].length` against the terminal width.
27
- */
28
- export async function qrLines(text: string, options: { quiet?: number } = {}): Promise<string[]> {
29
- const quiet = Math.max(0, options.quiet ?? 2);
30
- const matrix = await qrMatrix(text);
31
- const size = matrix.size;
32
- const isDark = (row: number, col: number): boolean =>
33
- row >= 0 && col >= 0 && row < size && col < size && matrix.get(row, col);
34
-
35
- const lines: string[] = [];
36
- for (let y = -quiet; y < size + quiet; y += 2) {
37
- let line = "";
38
- for (let x = -quiet; x < size + quiet; x += 1) {
39
- const top = isDark(y, x);
40
- const bottom = isDark(y + 1, x);
41
- line += top && bottom ? "█" : top ? "▀" : bottom ? "▄" : " ";
42
- }
43
- lines.push(line);
44
- }
45
- return lines;
46
- }
@@ -1,148 +0,0 @@
1
- ---
2
- name: changelog
3
- description: "Maintain a Keep a Changelog file: record one user-visible bullet in the same commit, audit commits since the last tag for missing or weak entries, and curate a release section from the project's own rules. Use when writing, auditing, or releasing a changelog, not for ordinary code edits."
4
- ---
5
-
6
- # Maintain the changelog
7
-
8
- This is a procedure, not a second policy. Read the project's instructions first;
9
- where they disagree with this skill, the project wins. There are three modes:
10
- **record** (the default), **audit**, and **release**. `/skill:changelog` records;
11
- `... audit` and `... release` name the others.
12
-
13
- ## 1. Read the project profile
14
-
15
- In this package the profile is written down; read it rather than rediscover it:
16
-
17
- - [`../../CHANGELOG.md`](../../CHANGELOG.md) — the preamble, the scope prefixes,
18
- and the bullet shape in use;
19
- - [`../../AGENTS.md`](../../AGENTS.md) — the entry lands in the same commit as the
20
- change, and a behavior change also updates the two entry READMEs and `docs/`;
21
- - [`../../docs/development.md#release`](../../docs/development.md#release) — the
22
- normative release procedure: version bump, link refs, tag and push order;
23
- - [`../../test/release.test.ts`](../../test/release.test.ts) — the guard on
24
- subsection names, order, emptiness, and the version pin.
25
-
26
- Everywhere else, find the same six things: the changelog and its preamble, the
27
- category spelling and order, the scope prefix and one-bullet-per-unit rule,
28
- whether the entry ships with the change, the release document with its bump and
29
- push order, and the check command with any release-consistency test.
30
-
31
- State the profile in one short paragraph. Do not invent a rule the project never
32
- stated; ask instead.
33
-
34
- ## 2. Classify the change
35
-
36
- It qualifies when a user can observe it: behavior, a CLI/tool/command surface, a
37
- config default, packaging, security, or a documented promise that is now true or
38
- false.
39
-
40
- It does not qualify when only the implementation changed: an internal refactor, a
41
- rename, a test, formatting, a comment, or a dependency bump with no behavior
42
- change.
43
-
44
- One bullet per user-visible outcome. A feature and its bug fix before release can
45
- be one bullet if users see one outcome; two observable changes are two bullets.
46
- Ask when the outcome is unclear. Never invent an entry to make an audit look
47
- complete.
48
-
49
- ## 3. Record
50
-
51
- - Write the entry in the same commit as the change. If the change is already
52
- pushed without one, add a follow-up commit rather than rewriting history.
53
- - Put it under `[Unreleased]` in `Added`, `Changed`, `Deprecated`, `Removed`,
54
- `Fixed`, or `Security`.
55
- - Lead with what the user can now do or what changed; use the project's scope
56
- prefix; name a migration or required action explicitly.
57
- - Exclude file names, internal helpers, test counts, commit hashes, and vague
58
- words such as "various" or "improvements".
59
- - Match the file's voice and tense. Do not add marketing.
60
- - A behavior change also updates its row in the catalog tables of
61
- [`../../README.md`](../../README.md) and
62
- [`../../README.zh-CN.md`](../../README.zh-CN.md) plus the `docs/` guide it
63
- belongs to; the changelog is this skill's subject, not its only file. A skill's
64
- change updates its `SKILL.md` and its README row together.
65
- - Re-read immediately before editing, append within the category, and preserve
66
- other bullets and concurrent edits. Never create a second category heading.
67
-
68
- Shape: one blank-line-separated bullet per outcome, wrapped near 80 columns, the
69
- scope in backticks followed by a colon. The scope is the extension or module name,
70
- spelled as this package spells it — `bytefly`, `plan`, `wechat`, `todo` — or
71
- `lib`, `docs`, `test`, `ci`, `skills`. A bullet with no scope, or with a name the
72
- package does not use, is a defect. A bullet may run several sentences — say what
73
- the user sees, what it replaced, and any required action. Brevity is not the
74
- goal; vagueness is the defect.
75
-
76
- Good:
77
-
78
- ```text
79
- - `config`: the report now says what its percentages are shares of. A
80
- `Composition · 11k estimate` header sits above the rows, and a disabled
81
- compaction no longer prints a headroom figure for a threshold that will never
82
- fire.
83
- - `cli`: `oldKey` is no longer read; run `bun run config:migrate`.
84
- ```
85
-
86
- Bad:
87
-
88
- ```text
89
- - `config`: refactored invoice rendering and added tests.
90
- - `misc`: improvements.
91
- ```
92
-
93
- ## 4. Audit (read-only)
94
-
95
- 1. Find the last tag: `git describe --tags --abbrev=0`, or the project's
96
- equivalent.
97
- 2. List the commits since it: `git log --oneline --no-merges <tag>..HEAD`. Read
98
- each diff with `git show`; a subject line is not enough.
99
- 3. For each commit, answer: is it user-visible? Which existing bullet covers it?
100
- Is the scope right? Is the outcome accurate?
101
- 4. Report a table:
102
-
103
- | Commit | User-visible | Evidence | Existing entry | Action |
104
- |---|---|---|---|---|
105
-
106
- `Action` is add, update, leave, or ask. "No entry found" is a valid result.
107
-
108
- Also report duplicate `###` headings, empty categories, entries already shipped
109
- under a released heading, and a missing or empty `[Unreleased]` when the commits
110
- since the tag contain user-visible changes.
111
-
112
- Do not edit during the audit unless the user asks. If they do, return to
113
- **Record** and make only the entries the evidence supports.
114
-
115
- ## 5. Release (only when asked)
116
-
117
- The project's release document is normative — in this package
118
- [`../../docs/development.md#release`](../../docs/development.md#release), guarded
119
- by [`../../test/release.test.ts`](../../test/release.test.ts). This is a
120
- checklist, not a replacement:
121
-
122
- - Confirm the version and the SemVer reason with the user.
123
- - Move every `[Unreleased]` entry under `## [X.Y.Z] - YYYY-MM-DD`; leave an empty
124
- `[Unreleased]` heading.
125
- - Bump every manifest and update the compare and release link refs, in the same
126
- commit as the movable part; the version in the manifest and the newest dated
127
- heading must agree or the release test fails.
128
- - Run the project's release checks, then `bun test test/release.test.ts` for the
129
- version and subsection rules.
130
- - Tag, push, and publish only with explicit approval, in the project's order. The
131
- order matters: push the tag with `main`, never after it.
132
- - Keep the release commit mechanical: no behavior, code, or unrelated docs.
133
- - Use that section as the release body (`bun run release:notes X.Y.Z` prints it);
134
- do not add extra prose.
135
-
136
- ## 6. Quality gate
137
-
138
- - One bullet per user-visible change; every bullet starts with a scope and a user
139
- outcome, and may take several sentences to state it.
140
- - No internal-only or duplicate entries, and no empty category headings.
141
- - No entry for a change that shipped before its heading.
142
- - Links and versions agree; the project check passes.
143
-
144
- ## 7. Report and stop
145
-
146
- Say what was recorded, what the audit found, or what the release moved. List what
147
- was deliberately left out and why. When nothing qualifies, say so. Stop before
148
- editing if the project rules are missing or contradictory; ask instead.
File without changes
File without changes
File without changes