@gavin-hu/my-pi-agent 0.15.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -13
- package/README.zh-CN.md +19 -11
- package/extensions/bytefly/README.md +255 -200
- package/extensions/bytefly/footer/collect/entries.ts +1 -6
- package/extensions/bytefly/footer/collect/snapshot.ts +23 -9
- package/extensions/bytefly/footer/price/price.ts +12 -8
- package/extensions/bytefly/footer/register.ts +13 -1
- package/extensions/bytefly/footer/types.ts +11 -0
- package/extensions/bytefly/footer/unpriced.ts +36 -0
- package/extensions/bytefly/header/component.ts +15 -29
- package/extensions/bytefly/header/identity.ts +71 -0
- package/extensions/bytefly/header/register.ts +9 -3
- package/extensions/bytefly/index.ts +13 -5
- package/extensions/bytefly/message/format.ts +20 -13
- package/extensions/bytefly/message/register.ts +8 -7
- package/extensions/bytefly/notice/component.ts +6 -4
- package/extensions/bytefly/notice/config.ts +16 -2
- package/extensions/bytefly/panel/commands.ts +46 -25
- package/extensions/bytefly/panel/format.ts +52 -22
- package/extensions/bytefly/panel/join.ts +36 -15
- package/extensions/bytefly/panel/settings.ts +72 -392
- package/extensions/bytefly/panel/skills.ts +51 -0
- package/extensions/bytefly/panel/tui/entries.ts +16 -14
- package/extensions/bytefly/panel/tui/extensions-view.ts +7 -58
- package/extensions/bytefly/panel/tui/frame.ts +11 -3
- package/extensions/bytefly/panel/tui/list-view.ts +72 -0
- package/extensions/bytefly/panel/tui/nav.ts +71 -3
- package/extensions/bytefly/panel/tui/settings-section.ts +250 -0
- package/extensions/bytefly/panel/tui/settings-view.ts +8 -12
- package/extensions/bytefly/panel/tui/skills-view.ts +50 -0
- package/extensions/bytefly/panel/tui.ts +223 -333
- package/extensions/bytefly/panel/types.ts +26 -8
- package/extensions/bytefly/picker/discovery.ts +32 -27
- package/extensions/bytefly/picker/resources.ts +22 -10
- package/extensions/bytefly/picker/runtime.ts +62 -34
- package/extensions/bytefly/picker/toggle.ts +16 -10
- package/extensions/bytefly/picker/types.ts +31 -13
- package/extensions/bytefly/update/format.ts +66 -8
- package/extensions/bytefly/update/patch.ts +66 -0
- package/extensions/bytefly/update/register.ts +4 -11
- package/extensions/bytefly/update/release.ts +65 -0
- package/extensions/bytefly/update/state.ts +14 -0
- package/extensions/bytefly/update/suppress.ts +47 -29
- package/extensions/bytefly/update/types.ts +15 -5
- package/extensions/bytefly/working/register.ts +2 -8
- package/extensions/check/tools.ts +2 -11
- package/extensions/check/tui.ts +2 -0
- package/extensions/context/README.md +172 -0
- package/extensions/context/collect.ts +53 -0
- package/extensions/context/commands.ts +100 -0
- package/extensions/context/format.ts +84 -0
- package/extensions/context/index.ts +16 -0
- package/extensions/context/report.ts +332 -0
- package/extensions/context/tui.ts +284 -0
- package/extensions/context/types.ts +124 -0
- package/extensions/file-browse/README.md +67 -19
- package/extensions/file-browse/client.ts +16 -463
- package/extensions/file-browse/config.ts +8 -0
- package/extensions/file-browse/html.ts +9 -7
- package/extensions/file-browse/index.ts +17 -2
- package/extensions/file-browse/live-client.ts +13 -13
- package/extensions/file-browse/live.ts +44 -10
- package/extensions/file-browse/markdown.ts +3 -10
- package/extensions/file-browse/palette.ts +224 -0
- package/extensions/file-browse/raw-html.ts +3 -10
- package/extensions/file-browse/router.ts +2 -2
- package/extensions/file-browse/server.ts +13 -2
- package/extensions/file-browse/styles.ts +8 -3
- package/extensions/file-browse/tree.ts +381 -0
- package/extensions/file-open/README.md +1 -2
- package/extensions/{document → file-read}/README.md +76 -57
- package/extensions/{document → file-read}/config.ts +12 -9
- package/extensions/{document → file-read}/extract/doc.ts +2 -2
- package/extensions/{document → file-read}/extract/docx.ts +3 -3
- package/extensions/{document → file-read}/extract/file.ts +9 -9
- package/extensions/{document → file-read}/extract/odt.ts +10 -8
- package/extensions/{document → file-read}/extract/pdf.ts +3 -3
- package/extensions/{document → file-read}/extract/rtf.ts +3 -3
- package/extensions/{document → file-read}/extract/xlsx.ts +4 -4
- package/extensions/{document → file-read}/formats.ts +11 -11
- package/extensions/file-read/index.ts +17 -0
- package/extensions/{document → file-read}/paging.ts +15 -13
- package/extensions/{document → file-read}/render.ts +17 -13
- package/extensions/{document → file-read}/schema.ts +7 -7
- package/extensions/{document → file-read}/tool.ts +36 -28
- package/extensions/goal/tools.ts +16 -25
- package/extensions/job/commands.ts +32 -46
- package/extensions/job/index.ts +20 -45
- package/extensions/job/runtime.ts +6 -8
- package/extensions/job/tools.ts +58 -103
- package/extensions/memory/commands.ts +30 -44
- package/extensions/memory/tools.ts +10 -20
- package/extensions/memory/tui.ts +5 -1
- package/extensions/plan/README.md +88 -33
- package/extensions/plan/commands.ts +19 -4
- package/extensions/plan/config.ts +27 -0
- package/extensions/plan/plan-index.ts +3 -1
- package/extensions/plan/plans.ts +31 -13
- package/extensions/plan/review.ts +34 -14
- package/extensions/plan/runtime.ts +3 -1
- package/extensions/plan/steps.ts +43 -14
- package/extensions/plan/tools/cancel.ts +79 -0
- package/extensions/plan/tools/enter.ts +16 -17
- package/extensions/plan/tools/exit.ts +60 -50
- package/extensions/plan/tools/steps.ts +13 -26
- package/extensions/plan/tools/write.ts +30 -38
- package/extensions/plan/tools.ts +5 -2
- package/extensions/plan/tui.ts +9 -7
- package/extensions/plan/types.ts +8 -0
- package/extensions/plan/web-chrome.ts +101 -0
- package/extensions/plan/web-client.ts +98 -311
- package/extensions/plan/web-markdown.ts +222 -0
- package/extensions/plan/web-page.ts +28 -2
- package/extensions/plan/web-router.ts +2 -2
- package/extensions/plan/web.ts +21 -12
- package/extensions/question/tools.ts +5 -4
- package/extensions/rewind/checklist.ts +4 -0
- package/extensions/rewind/review-tui.ts +3 -1
- package/extensions/rewind/rewind-tui.ts +4 -0
- package/extensions/subagent/README.md +25 -12
- package/extensions/subagent/background.ts +1 -7
- package/extensions/subagent/format.ts +72 -25
- package/extensions/subagent/index.ts +21 -47
- package/extensions/subagent/orchestrate.ts +18 -41
- package/extensions/subagent/render.ts +29 -42
- package/extensions/subagent/stream.ts +24 -18
- package/extensions/subagent/types.ts +7 -0
- package/extensions/todo/tools.ts +15 -20
- package/extensions/todo/tui.ts +5 -1
- package/extensions/watch/README.md +5 -5
- package/extensions/watch/commands.ts +33 -47
- package/extensions/watch/index.ts +10 -35
- package/extensions/watch/runtime.ts +5 -7
- package/extensions/watch/tools.ts +38 -77
- package/extensions/web-access/README.md +3 -3
- package/extensions/web-access/search/search.ts +9 -18
- package/extensions/wechat/README.md +40 -18
- package/extensions/wechat/bridge.ts +38 -40
- package/extensions/wechat/client.ts +1 -4
- package/extensions/wechat/commands.ts +1 -1
- package/extensions/wechat/interaction.ts +25 -4
- package/extensions/wechat/login-screen.ts +2 -3
- package/extensions/wechat/notices.ts +7 -5
- package/extensions/wechat/prompt.ts +19 -4
- package/extensions/wechat/qrcode.ts +9 -9
- package/extensions/wechat/slash.ts +14 -0
- package/extensions/wechat/status-screen.ts +2 -2
- package/extensions/wechat/timer.ts +9 -30
- package/extensions/wechat/tools.ts +7 -18
- package/extensions/worktree/README.md +48 -12
- package/extensions/worktree/commands.ts +109 -65
- package/extensions/worktree/enter.ts +1 -1
- package/extensions/worktree/exit.ts +11 -1
- package/extensions/worktree/lifecycle.ts +9 -1
- package/extensions/worktree/screen.ts +263 -0
- package/extensions/worktree/status.ts +84 -38
- package/lib/README.md +15 -11
- package/lib/config.ts +12 -0
- package/lib/escape.ts +15 -2
- package/lib/format.ts +6 -2
- package/lib/interaction.ts +18 -1
- package/lib/pdf.ts +2 -2
- package/lib/report.ts +75 -2
- package/lib/requirements.ts +2 -2
- package/lib/screen-session.ts +85 -0
- package/lib/timer.ts +61 -0
- package/lib/tool-result.ts +54 -4
- package/lib/tui/README.md +19 -11
- package/lib/tui/chrome.ts +27 -6
- package/lib/tui/columns.ts +33 -8
- package/lib/tui/dock-screen.ts +6 -2
- package/lib/tui/gauge.ts +9 -5
- package/lib/tui/rows.ts +15 -6
- package/lib/tui/rules.ts +4 -8
- package/lib/tui/tool.ts +55 -2
- package/lib/usage.ts +26 -0
- package/lib/web/README.md +131 -0
- package/lib/web/base.ts +19 -2
- package/lib/web/components.ts +10 -6
- package/lib/web/layout.ts +2 -0
- package/lib/web/markup.ts +2 -1
- package/lib/web/runtime.ts +103 -25
- package/lib/web/tokens.ts +23 -7
- package/package.json +10 -4
- package/skills/changelog/SKILL.md +148 -0
- package/skills/next/SKILL.md +184 -0
- package/extensions/document/index.ts +0 -17
- /package/extensions/{document → file-read}/deadline.ts +0 -0
- /package/extensions/{document → file-read}/extract/vendor.d.ts +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
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.
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: next
|
|
3
|
+
description: "Decide what to do next from a project's real state, or from the current conversation: loose work in the tree, commits since the last tag, unreleased changelog entries, roadmap or plan items still open, and the project's check command. Returns a short ranked list with the evidence for each item and the command that starts it; read-only, it never edits, commits, or begins the work. Use when asked what to do next, where to pick up, what is left, or what to work on now."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Decide what to do next
|
|
7
|
+
|
|
8
|
+
This is a triage, not a work session. The deliverable is a short ranked list with
|
|
9
|
+
evidence; do not edit, commit, tag, or start the top item. The skill is
|
|
10
|
+
model-invoked when a request matches the description; `/skill:next` is the
|
|
11
|
+
explicit fallback. Read the project's own instructions first; where they disagree
|
|
12
|
+
with this skill, the project wins.
|
|
13
|
+
|
|
14
|
+
Two sibling skills own a narrower question: an audit of *where to refactor* is
|
|
15
|
+
`refactor`, and *what the last tag owes the changelog* is `changelog`. When the
|
|
16
|
+
request is already scoped to one of those, name the skill that answers it and
|
|
17
|
+
hand over, instead of returning a generic list.
|
|
18
|
+
|
|
19
|
+
A next-steps block that the host draws itself is not this skill's output: that is
|
|
20
|
+
the reply's suggested follow-up, a turn-level hint. This skill inspects state, so
|
|
21
|
+
its list survives the conversation that produced it.
|
|
22
|
+
|
|
23
|
+
## 1. Read the request
|
|
24
|
+
|
|
25
|
+
The host appends the text after the command to these instructions as the request.
|
|
26
|
+
It is `<prompt>` in `/skill:next <prompt>`, it comes before any reading, and it
|
|
27
|
+
carries up to three parts:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
/skill:next [session] [what you want] [@path ...]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- **`session`, first word** — session mode (section 3). The rest of the prompt
|
|
34
|
+
keeps its own meaning: `/skill:next session what is left?` is session mode with
|
|
35
|
+
a filter, not a filter of `session`.
|
|
36
|
+
- **What you want** — a question, a goal, or a topic: "what is left before
|
|
37
|
+
0.17?", "plan file outline". It chooses what the shortlist is about and keeps
|
|
38
|
+
only the sources that can answer it; say which ones you kept. A named release,
|
|
39
|
+
file, or feature is the filter.
|
|
40
|
+
- **One or more paths** — `@src`, `src`, `packages/api`, or one inside the
|
|
41
|
+
sentence. Resolve each from the working directory, and take the evidence from
|
|
42
|
+
there: that path's diffs, plan steps, roadmap items, and changelog scope. A path
|
|
43
|
+
that does not exist is reported and asked about, never guessed.
|
|
44
|
+
- **Both** — the usual case. `/skill:next plan file outline @extensions/plan/`
|
|
45
|
+
asks what to do next about the plan file outline, with `@extensions/plan/` as
|
|
46
|
+
the evidence, so a roadmap item, a plan step, or a changelog entry outside that
|
|
47
|
+
path is not a candidate.
|
|
48
|
+
- **An imperative** — "fix the failing test" names one piece of work, and the
|
|
49
|
+
prompt is not approval for it. Answer with that item alone — evidence, starting
|
|
50
|
+
command, effort — and ask before starting, instead of producing a list.
|
|
51
|
+
- **No prompt** — triage of the current project.
|
|
52
|
+
- **Anything unreadable** — triage anyway, and say in one clause how you read the
|
|
53
|
+
prompt, so a misreading is visible in the report rather than silently narrowing
|
|
54
|
+
the list.
|
|
55
|
+
|
|
56
|
+
## 2. Read the project profile
|
|
57
|
+
|
|
58
|
+
With the request read, find:
|
|
59
|
+
|
|
60
|
+
- the instruction files, and whether they require isolation (a worktree, a
|
|
61
|
+
branch) or a specific check;
|
|
62
|
+
- the check command — the one that proves the tree is green; the triage quotes it
|
|
63
|
+
and never runs it (section 4);
|
|
64
|
+
- where work is tracked: a roadmap, an issue tracker, `TODO` docs, a plans
|
|
65
|
+
directory, a changelog;
|
|
66
|
+
- the release path: what a tag, a version bump, or an unreleased entry owes;
|
|
67
|
+
- the VCS, its branch model, and the last tag if there is one.
|
|
68
|
+
|
|
69
|
+
State the profile in one or two lines. Do not invent a source the project does
|
|
70
|
+
not have; a project with no roadmap is triaged from git and the check alone.
|
|
71
|
+
|
|
72
|
+
## 3. Choose the mode
|
|
73
|
+
|
|
74
|
+
- **Triage** — what the tree says. Use git, the changelog, the roadmap or issues,
|
|
75
|
+
and the plans directory. This is the default.
|
|
76
|
+
- **Session** — what this conversation left open. Read the conversation's own
|
|
77
|
+
record: the todo list, the goal, the approved plan and its ticked steps, what
|
|
78
|
+
subagents and jobs returned, and the diff this session produced. Then list the
|
|
79
|
+
loose ends it left: uncommitted files, an unapproved plan, a claim that was
|
|
80
|
+
never run, a documented behavior that changed without a doc or changelog edit.
|
|
81
|
+
- When both apply, run triage and read the session for context; the tree wins,
|
|
82
|
+
because it is where the work actually is.
|
|
83
|
+
|
|
84
|
+
Mode and scope are independent: session mode still honours a path, and triage
|
|
85
|
+
with a path reads the whole tree's evidence before narrowing. State the mode, the
|
|
86
|
+
scope, and the prompt as read, at the top of the report.
|
|
87
|
+
|
|
88
|
+
## 4. Gather evidence
|
|
89
|
+
|
|
90
|
+
Read only; nothing in this stage writes. Follow the project's own tool
|
|
91
|
+
discipline, and say what you could not read.
|
|
92
|
+
|
|
93
|
+
| Source | What it proves |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `git status --short`, `git diff --stat` | Work in flight, and whose it is |
|
|
96
|
+
| `git log --oneline <last-tag>..HEAD` | What has landed unreleased |
|
|
97
|
+
| `git worktree list`, `git branch --no-merged` | An isolated tree left behind, a branch never merged |
|
|
98
|
+
| The changelog's `[Unreleased]` | Whether a landed change is recorded, and whether the window is empty |
|
|
99
|
+
| The roadmap, issue tracker, or `TODO` docs | The project's stated priorities, and which are already done |
|
|
100
|
+
| The plans directory (`.pi/plans` or the project's equivalent) | An approved plan whose steps remain |
|
|
101
|
+
| The todo list, the goal, job and subagent results | What the session promised and did not finish |
|
|
102
|
+
| The check command | Whether the tree is green — cite the last known result, and make running it the item's starting command rather than running it here |
|
|
103
|
+
|
|
104
|
+
A roadmap, a changelog, and a plan all lag the tree. Verify a candidate against
|
|
105
|
+
the code before recommending it, and drop one that is already done.
|
|
106
|
+
|
|
107
|
+
## 5. Verify and filter
|
|
108
|
+
|
|
109
|
+
A candidate is not a suggestion until it has one concrete artifact: a path with
|
|
110
|
+
line numbers, a command's output, a diff hunk, or a failing test name. If you
|
|
111
|
+
cannot point at it, drop it.
|
|
112
|
+
|
|
113
|
+
- Reject anything already done, already documented as a deliberate non-goal, or
|
|
114
|
+
blocked on a decision the user has not made — say which, and ask if it matters.
|
|
115
|
+
- Keep a bug separate from a preference, and a refactor separate from a fix.
|
|
116
|
+
- Prefer the candidate with a fast verification command.
|
|
117
|
+
- Never invent work to fill the list. An empty list is a valid answer.
|
|
118
|
+
|
|
119
|
+
## 6. Rank by cost of loss
|
|
120
|
+
|
|
121
|
+
Order by what it would cost to lose, cheapest loss first:
|
|
122
|
+
|
|
123
|
+
- **Loose work** — a dirty tree, an unapproved plan, a check that has not been
|
|
124
|
+
run, an unmerged branch, a worktree left behind, a stopped job.
|
|
125
|
+
- **A broken promise** — a README, roadmap, or doc claim the code no longer
|
|
126
|
+
meets, a released behavior with no test.
|
|
127
|
+
- **An unfinished promise** — a stated roadmap item, the remaining steps of an
|
|
128
|
+
approved plan, a documented limitation with no item, an unreleased change with
|
|
129
|
+
no changelog entry.
|
|
130
|
+
- **New reach** — a capability nobody has asked for comes last, and only when the
|
|
131
|
+
three above are empty.
|
|
132
|
+
|
|
133
|
+
Label each item with the ceremony it needs. The label is not a second ordering:
|
|
134
|
+
cost of loss decides the order, and the label says how much work the item takes.
|
|
135
|
+
|
|
136
|
+
- **Do next** — cheap, safe, and unblocks the rest.
|
|
137
|
+
- **Worth planning** — high value, but it spans files, changes a public surface,
|
|
138
|
+
or needs a decision first.
|
|
139
|
+
- **Later** — real, but not now.
|
|
140
|
+
|
|
141
|
+
Cap the list at three to five items, and let a tier be empty. A roadmap restated
|
|
142
|
+
as ten suggestions is not a triage. Do not invent a numeric score; the reason
|
|
143
|
+
must be readable.
|
|
144
|
+
|
|
145
|
+
## 7. Report
|
|
146
|
+
|
|
147
|
+
- **State** — one paragraph: the mode, the scope and how the prompt was read,
|
|
148
|
+
the branch or worktree, what is dirty, what is unreleased, and whether the
|
|
149
|
+
check passes. Name anything you could not read.
|
|
150
|
+
- **The shortlist** — each item with its label, the action, the evidence at
|
|
151
|
+
`path:line` or the command output that proves it, the command that starts it,
|
|
152
|
+
and effort (S/M/L). Link the file the item lives in.
|
|
153
|
+
- **Rejected or stale** — one line each, with the reason the roadmap, changelog,
|
|
154
|
+
or plan entry no longer applies.
|
|
155
|
+
- **Next step** — ask which item to start. Do not start it, and do not open with
|
|
156
|
+
an edit.
|
|
157
|
+
|
|
158
|
+
If the host expects a closing next-steps block, keep it to the top two or three
|
|
159
|
+
choices as one line each; the evidence stays in the list above, never repeated
|
|
160
|
+
there.
|
|
161
|
+
|
|
162
|
+
## 8. Handoff
|
|
163
|
+
|
|
164
|
+
When the user picks an item, the audit is over:
|
|
165
|
+
|
|
166
|
+
- Restate the chosen item as a task with its acceptance test.
|
|
167
|
+
- Enter plan mode when the host provides it and the item spans files, changes a
|
|
168
|
+
public surface, or has an unknown step list. Track a small one in a todo list.
|
|
169
|
+
- Run the project's check first for a baseline, and finish with the full check.
|
|
170
|
+
- Do not commit unless the user asks.
|
|
171
|
+
|
|
172
|
+
## 9. Stop conditions
|
|
173
|
+
|
|
174
|
+
- Nothing worth doing: say so, with what was checked, instead of inventing work.
|
|
175
|
+
- The tree is mid-rebase, mid-merge, mid-bisect, or has a conflict: reconciling it
|
|
176
|
+
is the only next item; nothing else is safe to suggest.
|
|
177
|
+
- The project has no work tracking: say the list is derived from git and the check
|
|
178
|
+
only, and suggest recording the plan or roadmap the project is missing.
|
|
179
|
+
- A candidate needs a destructive command (a branch delete, a worktree prune, a
|
|
180
|
+
history rewrite) to start: name it as a decision for the user, not as a step.
|
|
181
|
+
|
|
182
|
+
The triage is done when the mode is stated, every item has evidence and a
|
|
183
|
+
starting command, the list is capped, rejected candidates are explained, and no
|
|
184
|
+
file was modified.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `document` extension entrypoint.
|
|
3
|
-
*
|
|
4
|
-
* Registers `read_doc`, which extracts text from a local PDF, DOCX, DOC, ODT,
|
|
5
|
-
* RTF, or XLSX under the effective working root using in-process parsers. The
|
|
6
|
-
* factory only registers; a parser library loads lazily on the first read of its
|
|
7
|
-
* format, so the extension costs nothing at startup.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
11
|
-
import { isExtensionEnabled } from "../../lib/env.ts";
|
|
12
|
-
import { registerDocTool } from "./tool.ts";
|
|
13
|
-
|
|
14
|
-
export default function document(pi: ExtensionAPI): void {
|
|
15
|
-
if (!isExtensionEnabled("document")) return;
|
|
16
|
-
registerDocTool(pi);
|
|
17
|
-
}
|
|
File without changes
|
|
File without changes
|