@cnzgray/dsh-mattpocock-workflow 0.5.1 → 0.7.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 +150 -162
- package/README.zh-CN.md +182 -0
- package/lib/client.js +956 -157
- package/lib/index.js +192 -76
- package/package.json +1 -1
- package/skills/README.md +17 -15
- package/skills/README.zh-CN.md +23 -0
- package/skills/engineering/setup-matt-pocock-skills/issue-tracker-gitea.zh.md +0 -73
package/README.md
CHANGED
|
@@ -1,171 +1,159 @@
|
|
|
1
|
+
English | [简体中文](README.zh-CN.md)
|
|
2
|
+
|
|
1
3
|
# dsh-mattpocock-workflow
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
仓库自带的 `prepare` 会从源码构建出宿主入口与客户端 bundle。
|
|
59
|
-
3. **从 Release 下载预构建 tarball**:在 GitHub Releases 里取
|
|
60
|
-
`cnzgray-dsh-mattpocock-workflow-<版本>.tgz`,再执行
|
|
61
|
-
`dsh plugin --profile <profile> add /绝对路径/<文件>.tgz`。tarball 里已含构建产物,安装不触发构建脚本,
|
|
62
|
-
适合网络受限、或想固定版本离线留存的场景。
|
|
63
|
-
|
|
64
|
-
Desktop 的 profile 由应用自己管理,在「插件」页安装即可;安装确认框会写明来源(npm 版本、Git 提交还是
|
|
65
|
-
tarball 资产),以及这次安装会不会执行构建脚本。上面的命令用于 web / tui 等自建 profile。
|
|
66
|
-
|
|
67
|
-
### 装不上怎么办
|
|
68
|
-
|
|
69
|
-
从 Git 安装会执行仓库的 `prepare`,pnpm 10 起默认拦下依赖的构建脚本。DSH 的安装界面会给出
|
|
70
|
-
**「允许这些脚本并重试」**,点它即可;用 CLI 时把 pnpm 报错里建议的键**原样**加进 profile 的
|
|
71
|
-
`pnpm-workspace.yaml`(`allowBuilds` 下一行 `<键>: true`)。键就是这次安装的 spec,不同 pnpm 版本
|
|
72
|
-
可能带、也可能不带末尾的提交号,以 pnpm 打印的为准:
|
|
5
|
+
A MattWorkflow task panel plugin that runs the [mattpocock/skills](https://github.com/mattpocock/skills) workflow inside DSH.
|
|
6
|
+
|
|
7
|
+
It adds a "MattWorkflow" tab to the right sidebar with four views:
|
|
8
|
+
|
|
9
|
+
- **List**: reads the current workspace's tickets and the "ready / blocked / closed" counts, supports filtering by status and by "assigned to me / created by me" (the two are independent, can be enabled together to take the union, and combine with the status filter), sorting by status/updated time/created time/number/title, and fills the prompts behind "new feature", "+ bug", "to-spec feature" and each ticket's skill badge into the current session or a new session according to the user's choice.
|
|
10
|
+
"+ New feature" injects the plugin's bundled `/mattwf-feature` and a "one-line requirement" slot, and "+ bug" injects `/mattwf-bug` and three slots: symptom / reproduction steps / expected behavior; the two intake commands only write the report as one raw ticket — bugs get `bug` + `needs-triage`, features get only `needs-triage`, and classification is left to `/triage`; they do not reproduce, read code or split tickets, and after creating the ticket they give the ticket link and one line of next-step advice and stop.
|
|
11
|
+
The intake commands are registered in memory with the plugin and are not written to the user's skills directory.
|
|
12
|
+
The plugin also registers `/mattwf-close`: after changes are merged, when the user explicitly invokes it with the ticket reference, the agent reads the ticket's requirements, the subsequent changes and comments, and judges whether the ticket can be closed; if it can, it first writes the rationale as a comment and then closes the ticket (GitHub / GitLab / Gitea use their respective CLI, local Markdown changes `Status:` to `resolved`); if it cannot close or cannot judge, it only reports what is missing and does not touch the ticket or its status labels.
|
|
13
|
+
"+ to-spec feature" injects `/to-spec` and a "requirement description:" slot without going through intake first: when the requirement is already clear, the skill directly creates a feature ticket with a spec and `ready-for-agent`, which is then split and implemented as needed; ticket creation and labeling both live in the skill body, and the panel does not perform them on the skill's behalf.
|
|
14
|
+
Clicking a ticket row opens the details; the skill badges on list rows and in the detail header share the same judgment, and only a click fills in the corresponding skill's prompt; tickets that cannot be worked show a reason badge and offer no injection entry.
|
|
15
|
+
Rows with a body excerpt show a one-line plain-text excerpt under the title (at most 240 code points); rows without one take no space.
|
|
16
|
+
The detail header has a manual refresh button: it re-reads this ticket and syncs the list snapshot; on failure it keeps the old content and explains the reason below the header instead of turning the details into an error page.
|
|
17
|
+
Ticket prompts contain only the skill gesture and the ticket reference (such as `/implement #40`); fetching, implementing, verifying and reviewing are all written in the skill body, and the panel does not restate them.
|
|
18
|
+
The three buttons at the top and the ticket skill badges are all split actions: the primary key fills the current session, and the small arrow on the right opens a new session directly with the same prompt (reusing the current workspace; the draft policy is append and nothing is sent automatically). Session actions in the environment check still only fill the current session.
|
|
19
|
+
When the host does not provide new-session capability, only the small arrow is disabled, and the reason is given in the hover text and in the capability diagnostics.
|
|
20
|
+
By default only unclosed tickets are shown, sorted "ready → blocked → other open → closed"; filters, person toggles, sort key, layout and direction are remembered per workspace and restored when the panel is reopened or that workspace is switched back to.
|
|
21
|
+
Preferences live only in browser local storage and are not cleaned up when a workspace is deleted; at most 50 workspace entries are kept; when storage is unavailable the panel silently falls back to the default view.
|
|
22
|
+
On the right side of the toolbar there is an "inline display" icon (sliders); the popover it opens has four toggles: author, created time, updated time and assignee; author and created time are on by default (matching the inline information before the toggles existed), updated time and assignee are off by default, and all four toggles are remembered per workspace.
|
|
23
|
+
Created time no longer depends on the author: rows without an author (local Markdown) also show "Created X", and the time is still shown when the author toggle is off; a bare relative created time is kept only when author and created time share a line.
|
|
24
|
+
With "updated time" on, the time area appends "Updated Y"; when it sits next to the created time, both segments carry their prefixes.
|
|
25
|
+
With "assignee" on, assignee names with avatars are shown after the labels (at most two, the rest folded into `+N` with the full list on hover); a missing avatar URL falls back to a colored initial; rows without assignees render no placeholder; the local Markdown backend does not offer the assignee toggle.
|
|
26
|
+
The list supports two layouts, **flat** and **parent-child**, flat by default: the parent-child layout builds a tree from tickets that are loaded and pass the current filters, indents child tickets level by level, and lets a parent row collapse its whole subtree and show the number of visible child tickets; when a parent ticket is filtered out, not yet loaded, in another repository or is a GitLab epic, the child ticket rises to the top level and shows a parent-reference badge, without fabricating a parent row.
|
|
27
|
+
GitHub uses native sub-issues, GitLab uses work item hierarchy (after the list returns, it is filled in with one GraphQL call per batch of up to 100 tickets; on failure only the parent-child layout is disabled and the list works as usual), and local Markdown uses a `Parent:` line; Gitea has no native sub-issues and uses `Part of #<number>` on the first line of the child ticket body.
|
|
28
|
+
Layout only changes the organization: judgment, counts, filtering, sorting, skill badges, prompt injection and details are all unchanged; layout is remembered per workspace, and switching it sends no request.
|
|
29
|
+
|
|
30
|
+
- **Overview**: gives on one screen the project identity (repository, backend, instance host, snapshot time, sample size), a pressure overview (three tier cards for size / blockage / staleness), key numbers (open backlog, ready capacity, awaiting triage, stale tickets, opened and closed in the last 30 days, net inflow), status and classification composition bars, and at most 5 tickets that most deserve attention first. Each of the three dimensions is tiered on its own, and the overall tier is the heaviest dimension; every conclusion carries the specific fact that triggered it. Clicking a ticket in the attention list switches to the list and locates it. Metrics the backend cannot provide show "unavailable" and state what is missing, rather than approximating with 0 or the updated time; when the sample is truncated, closure-type metrics are marked "may be underestimated" and the net inflow derived from closure counts is marked "may be overestimated";
|
|
31
|
+
|
|
32
|
+
- **Flow help**: opened by the tips icon at the top of the panel, with tabs by scenario, using vertically laid out SVG flowcharts to explain the intake and triage state machine, the feature chain, the direct-to-spec path when the requirement is already clear, the bug chain, the trade-off between `/grill-with-docs` and `/wayfinder`, and the review, PR and close-ticket steps after implementation (`/mattwf-close`). The diagrams are not clickable, the legend distinguishes the plugin's bundled `mattwf-` commands from matt skills, and nodes where the agent stops and waits for the user to send the next command are marked; entering from the list or the environment check returns to the original view and filters;
|
|
33
|
+
|
|
34
|
+
- **Environment check**: on opening, automatically checks item by item the home directory, backend selection, whether the backend CLI is installed and logged in, whether the repository is reachable, whether the workspace is initialized, the local ticket directory (only for the local Markdown backend, or when the backend is undetermined), and whether the skills used by the panel are installed. Each failed item gives a remedy matching its cause: workspace, skill and local-ticket items get session actions (fill the prompt only, do not send), CLI, login and remote items get copyable commands and documentation links, and timeouts and probe failures get "re-check". When a prerequisite fails, later items are marked "skipped" and an entry to jump to the root-cause item is offered. The collapsed "capability diagnostics" at the bottom lists whether the DSH host services and UI extension points used by the panel (including new-session capability) are available, and missing items state their impact and how to fix them. The plugin's bundled `mattwf-` commands do not count as "skills the user needs to install". When two or more skills are missing, a "skill bundle install" card appears above the check list, installing all missing skills at once with a single prompt; skills are installed to the user's home directory by default (`~/.agents/skills`, and `~/.dsh/skills` works too) and apply to all workspaces.
|
|
35
|
+
|
|
36
|
+
The panel itself only reads tickets and the environment: it does not modify tickets, install, log in, change the user's workspace files, or send prompts automatically; ticket creation and closure are performed by the agent using the tracker's own mechanisms as directed by the plugin commands, and the remedy area only provides commands and prompts without executing them.
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
All three methods have the same effect, so pick one; all require DSH `>= 0.2.0-rc.2`.
|
|
41
|
+
|
|
42
|
+
1. **Install from npm by package name**: `dsh plugin --profile <profile> add @cnzgray/dsh-mattpocock-workflow`.
|
|
43
|
+
This is the only channel that supports checking for updates and upgrading in place from the "Plugins" page; the package is published by CI with trusted publishing (OIDC) and carries provenance.
|
|
44
|
+
2. **Install from Git with one command**: `dsh plugin --profile <profile> add github:cnzgray/dsh-mattpocock-workflow`.
|
|
45
|
+
The repository's own `prepare` builds the host entry and the client bundle from source.
|
|
46
|
+
3. **Download a prebuilt tarball from a Release**: take
|
|
47
|
+
`cnzgray-dsh-mattpocock-workflow-<version>.tgz` from GitHub Releases, then run
|
|
48
|
+
`dsh plugin --profile <profile> add /absolute/path/<file>.tgz`. The tarball already contains the build artifacts, and installation does not trigger build scripts,
|
|
49
|
+
which suits restricted networks or keeping a pinned version offline.
|
|
50
|
+
|
|
51
|
+
Desktop profiles are managed by the app itself; install from the "Plugins" page. The installation confirmation states the source (npm version, Git commit or
|
|
52
|
+
tarball asset) and whether this installation will run build scripts. The commands above are for self-managed profiles such as web / tui.
|
|
53
|
+
|
|
54
|
+
### If installation fails
|
|
55
|
+
|
|
56
|
+
Installing from Git runs the repository's `prepare`, and pnpm 10 and later block dependency build scripts by default. DSH's installation UI offers
|
|
57
|
+
**"Allow these scripts and retry"**; click it. With the CLI, add the key suggested by the pnpm error **verbatim** to the profile's
|
|
58
|
+
`pnpm-workspace.yaml` (the line `<key>: true` under `allowBuilds`). The key is the spec of this installation; different pnpm versions
|
|
59
|
+
may or may not include the trailing commit hash, so use what pnpm prints:
|
|
73
60
|
|
|
74
61
|
```yaml
|
|
75
62
|
allowBuilds:
|
|
76
|
-
'@cnzgray/dsh-mattpocock-workflow@github:cnzgray/dsh-mattpocock-workflow
|
|
63
|
+
'@cnzgray/dsh-mattpocock-workflow@github:cnzgray/dsh-mattpocock-workflow#<commit>': true
|
|
77
64
|
```
|
|
78
65
|
|
|
79
|
-
Release tarball
|
|
80
|
-
|
|
81
|
-
###
|
|
82
|
-
|
|
83
|
-
`dsh plugin --profile <profile> remove @cnzgray/dsh-mattpocock-workflow
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
##
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
- `
|
|
118
|
-
- `
|
|
119
|
-
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
66
|
+
Installing from a Release tarball does not need this step; installing from npm likewise does not trigger build scripts.
|
|
67
|
+
|
|
68
|
+
### Uninstall
|
|
69
|
+
|
|
70
|
+
`dsh plugin --profile <profile> remove @cnzgray/dsh-mattpocock-workflow`; on Desktop, remove it from the "Plugins" page.
|
|
71
|
+
Uninstalling also removes the bundle layer from the profile, but does not delete the plugin's own snapshot cache
|
|
72
|
+
(`$DSH_HOME/cache/dsh-mattpocock-workflow/`, see below); delete it manually when needed.
|
|
73
|
+
|
|
74
|
+
## Interface language
|
|
75
|
+
|
|
76
|
+
Panel copy follows DSH's interface language (Settings → General → Language); Chinese and English are currently provided, and other languages display English
|
|
77
|
+
along DSH's fallback chain. After switching languages the panel updates immediately, with no need to refresh the page or reopen the panel. The plugin has no separate
|
|
78
|
+
language switch; DSH's language setting is the only source.
|
|
79
|
+
|
|
80
|
+
- When the host provides the locale service, the plugin registers its own namespace dictionary (`@cnzgray/dsh-mattpocock-workflow`) on the browser side,
|
|
81
|
+
and the panel takes its words through the same translation entry; a locale service that becomes ready after the panel can also connect;
|
|
82
|
+
- When the host has no locale service (older DSH), the panel uses its built-in Chinese dictionary and behaves as before the integration;
|
|
83
|
+
the "capability diagnostics" at the bottom of the environment check records the "interface language service" as missing;
|
|
84
|
+
- All of the panel's own UI copy lives in `src/client/messages.ts`: Chinese is the source of the key set, and English must cover the same set of keys (a missing translation fails at compile time);
|
|
85
|
+
- Prompts injected into the session also follow the interface language, but skill gestures and skill names (such as `/implement`), repository names, ticket references,
|
|
86
|
+
status/classification label literals, commands, paths and links stay as they are;
|
|
87
|
+
- The plugin's title and description under "Settings → Plugins" come from the `locale/<language>.json` shipped with the package (English is the baseline);
|
|
88
|
+
`package.json`'s `description` is only a fallback. To add a language, add a dictionary file in the same directory as `en`
|
|
89
|
+
and add the corresponding dictionary in `src/client/messages.ts`; when only Chinese and English are shipped, other languages automatically display English.
|
|
90
|
+
|
|
91
|
+
The panel saves the most recent successfully fetched ticket data (the local snapshot store) in its own cache directory, so the first screen has data and tickets stay viewable when the remote is unavailable:
|
|
92
|
+
|
|
93
|
+
- Location: `$DSH_HOME/cache/dsh-mattpocock-workflow/`, or `~/.dsh/cache/dsh-mattpocock-workflow/` when `DSH_HOME` is not set; when the directory is not writable it falls back to the system temporary directory.
|
|
94
|
+
- One file per workspace, storing the raw tickets returned by the backend, each ticket's assignees, the current logged-in user and the fetch time, but not judgment results; judgments are recomputed by the current rules.
|
|
95
|
+
Since cache format 7, older entries without structured assignees, excerpts or comment counts are invalidated entirely and fully re-fetched, so data with missing fields is not treated as complete.
|
|
96
|
+
- Opening the panel first reads the store (without a remote request), then starts a refresh that brings the store up to date: with a usable store and a backend that supports increments only changed tickets are fetched, otherwise everything is re-fetched. Incremental results are reconciled against the backend's authoritative total; a mismatch (tickets were deleted remotely) makes that run fall back to a full fetch.
|
|
97
|
+
- While the panel is open, if the agent creates tickets, changes labels or status, or closes tickets with the tracker CLI, the panel does one incremental refresh itself after that turn ends;
|
|
98
|
+
if what comes back matches what is displayed the UI is left untouched, and only changed data is updated; in either case, filters, sorting, the ticket being viewed and the prompt draft in the input box are unaffected.
|
|
99
|
+
- The UI marks whether data is "live" or from the "local cache"; when a refresh fails it keeps the old data and explains the failure, without clearing the screen.
|
|
100
|
+
- The cache lives only in the plugin's own directory; it writes neither the workspace nor the repository. After uninstalling the plugin the directory remains on disk; use "Clear local snapshot store" in the environment check, or delete the directory directly.
|
|
101
|
+
|
|
102
|
+
The ticket backend is chosen automatically from the `origin` remote:
|
|
103
|
+
|
|
104
|
+
- `github.com` → GitHub, read through `gh`;
|
|
105
|
+
- `gitlab.com`, or a self-hosted instance where `glab` is logged in → GitLab, read through `glab`, supporting nested groups;
|
|
106
|
+
- a self-hosted Gitea instance where `tea` is logged in → Gitea, read through `tea`;
|
|
107
|
+
- anything else (no git, no remote, host mismatch) → local Markdown, reading
|
|
108
|
+
`.scratch/<feature>/issues/*.md`.
|
|
109
|
+
|
|
110
|
+
The top of the panel marks the current backend (GitHub / GitLab / Gitea / local); the Gitea backend also shows the instance host, making multiple
|
|
111
|
+
self-hosted instances easy to tell apart. All four backends share the same judgment, counts, filtering/sorting and prompt injection. GitHub fetches
|
|
112
|
+
the current logged-in user, each ticket's structured assignees, body excerpt and comment count in the same GraphQL query; GitLab / Gitea query `/user` once in parallel outside the list, and the list response carries descriptions and comment counts. A failed identity query does not affect the list;
|
|
113
|
+
the person filter row simply does not appear. Local Markdown has no authors or assignees, so the person filter row is not shown.
|
|
114
|
+
|
|
115
|
+
The source of parent-child relations differs by backend, and is used only to organize the list:
|
|
116
|
+
|
|
117
|
+
- GitHub: the list GraphQL also fetches the parent ticket number and its repository; same-repository parents are stored as `#<number>`, cross-repository ones as the full `owner/repo#<number>`, with no additional request;
|
|
118
|
+
- GitLab: the list still goes through the issue API (returning issues and tasks by default), and after it returns, parents are filled in with one
|
|
119
|
+
`workItems` GraphQL call per batch of up to 100 iids; a parent that is an Issue / Task is stored as `#iid`, and an Epic as `&iid` as an out-of-list reference.
|
|
120
|
+
A failed hierarchy query only marks this snapshot as having no parent-child capability, and the list works as usual; when the incremental parent-child capability differs from the store's, it falls back to a full re-fetch;
|
|
121
|
+
- Gitea: no native sub-issues, so parent-child capability is a convention: the **first non-empty line** of the child ticket body says `Part of #<number>`
|
|
122
|
+
(that is how tickets published by `to-tickets` attach to their source spec), parsed from the existing list response with no additional request. If this line is not the first non-empty line, carries a blockquote / heading prefix
|
|
123
|
+
or extra text, uses a cross-repository form, or is self-referential, it is treated as having no parent; task lists in a parent's body are not parsed; blocking dependencies are not treated as parents;
|
|
124
|
+
- Local Markdown: write `Parent: NN` in the same front matter as `Status:` / `Blocked by:`, and only another ticket existing under the same feature is recognized;
|
|
125
|
+
a `Parent:` in comments, a missing one, self-references and cross-feature references are all treated as having no parent.
|
|
126
|
+
|
|
127
|
+
GitLab native blocking relations: the first screen waits only for the list, blocker counts first fall back to the description, and native blocker counts are filled in after the list is displayed.
|
|
128
|
+
When the list response carries `blocking_issues_count`, support is determined directly; otherwise the instance host is probed once, and when supported, one batch
|
|
129
|
+
GraphQL query fetches the blocker counts. When unsupported (the Community edition returns
|
|
130
|
+
`200` plus an empty array for the links API) or the probe fails, only the `Blocked by:` description fallback is used, with no per-ticket requests. Probe results are cached per instance host,
|
|
131
|
+
so a refresh does not probe again.
|
|
132
|
+
|
|
133
|
+
## Requirements
|
|
134
|
+
|
|
135
|
+
- DSH `>= 0.2.0-rc.2`;
|
|
136
|
+
- GitHub: GitHub CLI installed and logged in (`gh auth login`);
|
|
137
|
+
- GitLab: GitLab CLI installed and logged in (`glab auth login`); a self-hosted instance requires logging in to that instance.
|
|
138
|
+
The minimum supported version is `glab` 1.126 (the version this plugin was verified against); earlier versions are untested, and when login state detection fails it falls back to local Markdown;
|
|
139
|
+
- Gitea: `tea` 0.16 or later installed and logged in to the instance (`tea login add`); a self-hosted instance requires logging in to that instance;
|
|
140
|
+
- The current workspace is a git repository with a remote; or put tickets directly in `.scratch/<feature>/issues/NN-<slug>.md`
|
|
141
|
+
(see [local ticket conventions](docs/local-issues.md)).
|
|
142
|
+
- When a workspace has multiple remotes, `origin` wins; when the same host appears in both `glab` and `tea` login lists, it is treated as
|
|
143
|
+
GitLab.
|
|
144
|
+
|
|
145
|
+
When `gh` / `glab` / `tea` is missing or not logged in, the list shows the corresponding action hint and offers a "view environment check" entry; a failure to read `.scratch` only shows a file-permission hint.
|
|
146
|
+
When a self-hosted GitLab or Gitea is not logged in to the corresponding CLI, the panel falls back to local Markdown and marks "local" at the top; the environment check names whether installation or login is missing,
|
|
147
|
+
and gives actionable suggestions such as `gh auth login` / `glab auth login` / `tea login add`.
|
|
148
|
+
After the Gitea backend has been selected, if `tea` disappears, the token expires or permissions are insufficient, the list shows an install or re-login hint
|
|
149
|
+
(`tea-missing` / `tea-unauthenticated`), and the three Gitea items in the environment check reach the same conclusion.
|
|
150
|
+
|
|
151
|
+
## Development
|
|
152
|
+
|
|
153
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). During development, `pnpm dev` watches both the host and client builds, and with DSH HMR
|
|
154
|
+
a save refreshes immediately. Each layer's conventions are written in `src/<layer>/README.md`, and the dependency direction is checked by
|
|
155
|
+
`.dependency-cruiser.json`; for domain terms see [GLOSSARY.md](GLOSSARY.md).
|
|
156
|
+
|
|
157
|
+
## License
|
|
170
158
|
|
|
171
159
|
MIT
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
[English](README.md) | 简体中文
|
|
2
|
+
|
|
3
|
+
# dsh-mattpocock-workflow
|
|
4
|
+
|
|
5
|
+
在 DSH 里运行 [mattpocock/skills](https://github.com/mattpocock/skills) 工作流的 MattWorkflow 任务面板插件。
|
|
6
|
+
|
|
7
|
+
右侧栏新增一个“MattWorkflow”页签,含四个视图:
|
|
8
|
+
|
|
9
|
+
- **列表**:读取当前工作区的工单与“可接 / 阻塞 / 已关闭”统计,支持按状态过滤与按「分配给我 / 我创建的」过滤
|
|
10
|
+
(两者各自独立,可同时开启取并集,并与状态筛选交叉生效)、按状态/更新时间/创建时间/编号/标题排序,
|
|
11
|
+
并把“新建需求”“+ bug”“to-spec 需求”和每张票技能徽标对应的提示词按用户选择填进当前会话或新会话。
|
|
12
|
+
“+ 新建需求”注入插件自带的 `/mattwf-feature` 和一个“一句话需求”槽位,“+ bug”注入 `/mattwf-bug` 和
|
|
13
|
+
现象 / 复现步骤 / 预期行为三个槽位;两个入池命令只把报告写成一张原始工单——缺陷打 `bug` + `needs-triage`,
|
|
14
|
+
需求只打 `needs-triage`,分类留给 `/triage`;不复现、不翻代码、不拆票,建完后给出票的链接和一行下一步建议就停下。
|
|
15
|
+
入池命令随插件在内存里注册,不写入用户的技能目录。
|
|
16
|
+
插件还注册 `/mattwf-close`:改动合并后,用户带上票的引用显式调用时,agent 读这张票的要求、之后的改动与评论,
|
|
17
|
+
判断能否关闭;能关就先把判断依据写成评论再关票(GitHub / GitLab / Gitea 走各自 CLI,本地 Markdown 把
|
|
18
|
+
`Status:` 改成 `resolved`),不能关或判断不了就只报告差什么,不动票、不改状态标签。
|
|
19
|
+
“+ to-spec 需求”注入 `/to-spec` 和一个“需求描述:”槽位,不先入池:需求已经清楚时由技能直接建一张带规格、
|
|
20
|
+
带 `ready-for-agent` 的需求票,之后按需拆票、实现;建票与打标签都在技能正文里,面板不代为执行。
|
|
21
|
+
点击工单行打开详情;列表行与详情头部的技能徽标共用同一套判定,点击才填入对应技能的提示词;不可开工的票显示原因徽标,不提供注入入口。
|
|
22
|
+
有正文摘要的行在标题下显示一行纯文本摘要(最多 240 个码点),没有摘要时不占位。
|
|
23
|
+
详情头部有手动刷新按钮:重读这张票并同步列表快照,失败时保留旧内容、在头部下方说明原因,不把详情切成错误页。
|
|
24
|
+
工单提示词只有技能手势和工单引用(如 `/implement #40`),取票、实现、验证与复审都写在技能正文里,面板不复述。
|
|
25
|
+
顶部三个按钮与工单技能徽标都是分裂动作:主键填进当前会话,右侧小箭头用同一段提示词直接开一个新会话
|
|
26
|
+
(沿用当前工作区,草稿策略是追加,不自动发送)。环境检查的会话动作仍然只填当前会话。
|
|
27
|
+
宿主不提供新建会话能力时只禁用小箭头,并在悬停说明与能力诊断里给出原因。
|
|
28
|
+
默认只看未关闭工单,并按“可接 → 阻塞 → 其他开放 → 已关闭”排序;筛选、人员开关、排序键、布局与方向按工作区记住,
|
|
29
|
+
重新打开面板或切回该工作区时恢复。偏好只存在浏览器本地存储里,不随工作区删除而清理,最多保留 50 个工作区条目;
|
|
30
|
+
存储不可用时静默退回默认视图;
|
|
31
|
+
工具栏右侧有一个「行内显示」图标(滑杆),点开浮层后是四个开关:创建人、创建时间、更新时间与分配人;
|
|
32
|
+
创建人与创建时间默认打开(与加入开关前的行内信息一致),更新时间与分配人默认关闭,四个开关都按工作区记住。
|
|
33
|
+
创建时间不再依附创建人:没有创建人的行(本地 Markdown)也显示「创建 X」,关掉创建人时时间照常显示;
|
|
34
|
+
只在创建人与创建时间同排时保留裸露的相对创建时间。
|
|
35
|
+
打开「更新时间」后,时间区追加「更新 Y」,与创建时间并排时两段都带前缀;
|
|
36
|
+
打开「分配人」后,标签之后显示带头像的分配人名(最多两个,其余折成 `+N`,悬停可看完整名单),
|
|
37
|
+
没有头像地址时回退首字母色块;没有分配人的行不渲染占位;本地 Markdown 后端不提供分配人开关;
|
|
38
|
+
列表支持**平铺**与**父子**两种布局,默认平铺:父子布局用已加载且通过当前筛选的票建树,子票逐层缩进,
|
|
39
|
+
父行可收起整棵子树并显示可见子票数;父票被筛掉、还没加载、在别的仓库或是 GitLab epic 时,子票升到顶层并显示父级引用徽标,
|
|
40
|
+
不伪造父行。GitHub 用原生子工单,GitLab 用工作项层级(列表返回后按每批最多 100 张票用一次 GraphQL 补齐,失败时只禁用父子布局、列表照常),
|
|
41
|
+
本地 Markdown 用 `Parent:` 行;Gitea 没有原生子工单,用子票正文首行的 `Part of #编号`。布局只改变组织方式:
|
|
42
|
+
判定、统计、筛选、排序、技能徽标、提示词注入与详情都不变;布局按工作区记住,切换不发请求;
|
|
43
|
+
|
|
44
|
+
- **概览**:一屏给出项目身份(仓库、后端、实例主机、快照时间、样本量)、压力总览(规模 / 阻塞 / 时效三张档位卡)、
|
|
45
|
+
关键数字(开放积压、可接容量、待 triage、陈旧票、近 30 天新开与关闭、净流入)、状态与分类构成条,以及最多 5 张
|
|
46
|
+
最该先看的票。三个维度各自判档,总档位取最重的一维;每条结论都带触发它的具体事实。点击关注清单里的票会切到列表并定位。
|
|
47
|
+
后端给不出的指标显示“不可用”并说明缺什么,不用 0 或更新时间近似;样本被截断时,关闭类指标标注“可能低估”,
|
|
48
|
+
由关闭数派生的净流入标注“可能高估”;
|
|
49
|
+
- **流程帮助**:面板顶部的 tips 图标打开,按场景分页签,用竖向排版的 SVG 流程图讲清入池与 triage 状态机、需求链、
|
|
50
|
+
需求已明确时的直达规格路径、缺陷链、`/grill-with-docs` 与 `/wayfinder` 的取舍,以及实现之后的评审、PR 与关票(`/mattwf-close`)。图不可点击,图例区分插件自带的 `mattwf-` 命令与 matt 技能,
|
|
51
|
+
并标出 agent 停下等用户发下一条命令的节点;从列表或环境检查进入,返回时回到原来的视图与筛选;
|
|
52
|
+
- **环境检查**:打开时自动逐项检查主目录、后端选择、后端 CLI 是否安装并登录、仓库是否可达、工作区是否初始化、
|
|
53
|
+
本地工单目录(仅本地 Markdown 后端,或后端未判定时)、面板用到的技能是否安装。每个失败项给出与原因对应的解决:工作区、技能与本地工单类给会话动作(只填提示词、不发送),
|
|
54
|
+
CLI、登录与远端类给可复制的命令和文档链接,超时与探测失败给“重新检查”。前置项没通过时后续项标为“跳过”,
|
|
55
|
+
并提供跳到根因项的入口。底部折叠的“能力诊断”列出插件用到的 DSH 宿主服务和界面扩展点(含新建会话能力)是否可用,缺失项写明影响与补法。
|
|
56
|
+
插件自带的 `mattwf-` 命令不计入“需要用户安装的技能”。缺两项以上技能时,检查项列表上方另有“技能总装”卡片,
|
|
57
|
+
一条提示词一次装齐全部缺失技能;技能默认装到用户主目录(`~/.agents/skills`,`~/.dsh/skills` 同样有效),所有工作区通用。
|
|
58
|
+
|
|
59
|
+
面板本身只读工单与环境,不修改工单、不安装、不登录、不改用户的工作区文件,也不会自动发送提示词;建票与关票由 agent 按插件命令用跟踪器自己的方式完成,解决区只提供命令与提示词,不代为执行。
|
|
60
|
+
|
|
61
|
+
## 安装
|
|
62
|
+
|
|
63
|
+
三种方式效果相同,选一种即可;都要求 DSH `>= 0.2.0-rc.2`。
|
|
64
|
+
|
|
65
|
+
1. **按包名从 npm 安装**:`dsh plugin --profile <profile> add @cnzgray/dsh-mattpocock-workflow`。
|
|
66
|
+
这是唯一支持「插件」页检查更新与就地升级的通道;包由 CI 用可信发布(OIDC)发布,带 provenance。
|
|
67
|
+
2. **一条命令从 Git 安装**:`dsh plugin --profile <profile> add github:cnzgray/dsh-mattpocock-workflow`。
|
|
68
|
+
仓库自带的 `prepare` 会从源码构建出宿主入口与客户端 bundle。
|
|
69
|
+
3. **从 Release 下载预构建 tarball**:在 GitHub Releases 里取
|
|
70
|
+
`cnzgray-dsh-mattpocock-workflow-<版本>.tgz`,再执行
|
|
71
|
+
`dsh plugin --profile <profile> add /绝对路径/<文件>.tgz`。tarball 里已含构建产物,安装不触发构建脚本,
|
|
72
|
+
适合网络受限、或想固定版本离线留存的场景。
|
|
73
|
+
|
|
74
|
+
Desktop 的 profile 由应用自己管理,在「插件」页安装即可;安装确认框会写明来源(npm 版本、Git 提交还是
|
|
75
|
+
tarball 资产),以及这次安装会不会执行构建脚本。上面的命令用于 web / tui 等自建 profile。
|
|
76
|
+
|
|
77
|
+
### 装不上怎么办
|
|
78
|
+
|
|
79
|
+
从 Git 安装会执行仓库的 `prepare`,pnpm 10 起默认拦下依赖的构建脚本。DSH 的安装界面会给出
|
|
80
|
+
**「允许这些脚本并重试」**,点它即可;用 CLI 时把 pnpm 报错里建议的键**原样**加进 profile 的
|
|
81
|
+
`pnpm-workspace.yaml`(`allowBuilds` 下一行 `<键>: true`)。键就是这次安装的 spec,不同 pnpm 版本
|
|
82
|
+
可能带、也可能不带末尾的提交号,以 pnpm 打印的为准:
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
allowBuilds:
|
|
86
|
+
'@cnzgray/dsh-mattpocock-workflow@github:cnzgray/dsh-mattpocock-workflow#<提交>': true
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Release tarball 安装不需要这一步;从 npm 安装同样不触发构建脚本。
|
|
90
|
+
|
|
91
|
+
### 卸载
|
|
92
|
+
|
|
93
|
+
`dsh plugin --profile <profile> remove @cnzgray/dsh-mattpocock-workflow`;Desktop 在「插件」页移除。
|
|
94
|
+
卸载会一并移除 profile 里的组合包层,但不会删除插件自己的快照缓存
|
|
95
|
+
(`$DSH_HOME/cache/dsh-mattpocock-workflow/`,见下文),需要时手动删除。
|
|
96
|
+
|
|
97
|
+
## 界面语言
|
|
98
|
+
|
|
99
|
+
面板文案跟随 DSH 的界面语言(设置 → 通用 → 语言),当前提供中文与英文两套;其余语言沿 DSH 的回退链显示英文。
|
|
100
|
+
切换语言后面板立即改写,不需要刷新页面或重开面板。插件不另设语言开关,DSH 的语言设置是唯一来源。
|
|
101
|
+
|
|
102
|
+
- 宿主提供 locale 服务时,插件在浏览器端注册自己的命名空间词典(`@cnzgray/dsh-mattpocock-workflow`),
|
|
103
|
+
面板通过同一个翻译入口取词;locale 服务晚于面板就绪也能接上;
|
|
104
|
+
- 宿主没有 locale 服务(老版本 DSH)时,面板使用内置中文词典,行为与接入前一致;
|
|
105
|
+
环境检查底部的「能力诊断」会把「界面语言服务」记为缺失;
|
|
106
|
+
- 面板自己的全部界面文案集中在 `src/client/messages.ts`:中文是键集来源,英文必须覆盖同一组键(漏译在编译期失败);
|
|
107
|
+
- 注入到会话里的提示词同样跟随界面语言,但技能手势与技能名(`/implement` 等)、仓库名、工单引用、
|
|
108
|
+
状态/分类标签字面值、命令、路径与链接保持原样;
|
|
109
|
+
- 插件在「设置 → 插件」里的标题与说明来自随包发布的 `locale/<语言>.json`(英文为基准),
|
|
110
|
+
`package.json` 的 `description` 只作兜底。补一门语言时新增一份与 `en` 同目录的词典文件,
|
|
111
|
+
并在 `src/client/messages.ts` 增加对应词典;只交中英两套时,其余语言自动显示英文。
|
|
112
|
+
|
|
113
|
+
面板会在自己的缓存目录里保存最近一次成功拉取的工单数据(本地快照库),用于首屏先出数据与远端不可用时仍能查看:
|
|
114
|
+
|
|
115
|
+
- 位置:`$DSH_HOME/cache/dsh-mattpocock-workflow/`,未设置 `DSH_HOME` 时是 `~/.dsh/cache/dsh-mattpocock-workflow/`;目录不可写时退回系统临时目录。
|
|
116
|
+
- 每个工作区一个文件,存后端返回的原始工单、每张票的分配人、当前登录用户与拉取时刻,不存判定结果;判定按当前规则重算。
|
|
117
|
+
缓存格式升到 7 后,没有结构化分配人、摘要或评论数的旧条目会整体作废并全量重拉,避免把缺字段的旧数据当成完整数据。
|
|
118
|
+
- 打开面板先读库(不发远端请求),随即发起一次刷新把库推向最新:有可用库且后端支持增量时只取变更过的票,否则全量重拉。增量结果要与后端的权威总数对账,对不上(远端删过票)就当次改走全量。
|
|
119
|
+
- 面板开着时,agent 用跟踪器命令行建票、改标签、改状态或关票,这一轮结束后面板会自己做一次增量刷新;
|
|
120
|
+
拉回来与当前显示的一致就不改动界面,数据变了才更新;无论哪种,筛选、排序、正在看的票与输入框里的提示词草稿都不受影响。
|
|
121
|
+
- 界面会标出数据来自「实时」还是「本地缓存」,刷新失败时保留旧数据并说明失败原因,不会清屏。
|
|
122
|
+
- 缓存只在插件自己的目录里,不写工作区,也不写仓库。卸载插件后这个目录仍会留在磁盘上,可以在环境检查里「清除本地快照库」,或直接删掉该目录。
|
|
123
|
+
|
|
124
|
+
工单后端按 `origin` 远端自动选择:
|
|
125
|
+
|
|
126
|
+
- `github.com` → GitHub,通过 `gh` 读取;
|
|
127
|
+
- `gitlab.com` 或 `glab` 已登录的自建实例 → GitLab,通过 `glab` 读取,支持嵌套 group;
|
|
128
|
+
- `tea` 已登录的自建 Gitea 实例 → Gitea,通过 `tea` 读取;
|
|
129
|
+
- 其余情况(没有 git、没有远端、主机不匹配)→ 本地 Markdown,读取
|
|
130
|
+
`.scratch/<feature>/issues/*.md`。
|
|
131
|
+
|
|
132
|
+
面板顶部会标出当前后端(GitHub / GitLab / Gitea / 本地);Gitea 后端还显示实例主机,便于区分多个
|
|
133
|
+
自建实例。四种后端共用同一套判定、统计、过滤排序与提示词注入。GitHub 在同一次 GraphQL 查询里取回
|
|
134
|
+
当前登录用户、每张票的结构化分配人、正文摘要与评论数;GitLab / Gitea 在列表之外并行查询一次 `/user`,
|
|
135
|
+
列表响应里带描述与评论数。身份查询失败不影响列表,
|
|
136
|
+
只是人员筛选行不出现。本地 Markdown 没有创建人与分配人,因此不显示人员筛选行。
|
|
137
|
+
|
|
138
|
+
父子关系来源随后端不同,并且只用于组织列表:
|
|
139
|
+
|
|
140
|
+
- GitHub:列表 GraphQL 一并取父票编号与所在仓库;同仓库存 `#编号`,跨仓库存完整 `仓库#编号`,不新增请求;
|
|
141
|
+
- GitLab:列表仍走 issue 接口(默认同时返回 issue 与 task),返回后按每批最多 100 个 iid 用一次
|
|
142
|
+
`workItems` GraphQL 补齐父级;父级是 Issue / Task 时存 `#iid`,是 Epic 时存 `&iid` 作为列表外引用。
|
|
143
|
+
层级查询失败只把本次快照标为无父子能力,列表照常;增量与库的父子能力不一致时退回全量重拉;
|
|
144
|
+
- Gitea:没有原生子工单,父子能力为约定:子票正文**第一个非空行**写 `Part of #编号`(`to-tickets` 发布的
|
|
145
|
+
ticket 就是这样挂到来源 spec 下),在已有列表响应里解析,不新增请求。这一行不在首个非空行、带引用块 / 标题前缀
|
|
146
|
+
或多余文字、跨仓库写法、自引用都按无父级处理;父票正文里的任务列表不解析;阻塞依赖不当父级;
|
|
147
|
+
- 本地 Markdown:在 `Status:` / `Blocked by:` 同一段前言里写 `Parent: NN`,只认同一 feature 下存在的另一张票;
|
|
148
|
+
评论里的 `Parent:`、缺失、自引用与跨 feature 引用都按无父级处理。
|
|
149
|
+
|
|
150
|
+
GitLab 的原生阻塞关系:首屏只等列表,阻塞数先按描述回退,原生阻塞数在列表显示之后补齐。
|
|
151
|
+
列表响应带 `blocking_issues_count` 时直接判定支持;否则按实例主机只探测一次,支持时用一次批量
|
|
152
|
+
GraphQL 查询取回阻塞数。不支持(Community 版对 links 接口返回
|
|
153
|
+
`200` + 空数组)或探测失败时只用描述 `Blocked by:` 回退,不再逐票请求。探测结果按实例主机缓存,
|
|
154
|
+
刷新不会重复探测。
|
|
155
|
+
|
|
156
|
+
## 环境要求
|
|
157
|
+
|
|
158
|
+
- DSH `>= 0.2.0-rc.2`;
|
|
159
|
+
- GitHub:已安装并登录 GitHub CLI(`gh auth login`);
|
|
160
|
+
- GitLab:已安装 GitLab CLI 并登录(`glab auth login`);自建实例需要登录该实例。
|
|
161
|
+
最低支持 `glab` 1.126(本插件验证的版本);更早版本未验证,登录状态识别失败时会回退本地 Markdown;
|
|
162
|
+
- Gitea:已安装 `tea` 0.16 或更高版本并登录实例(`tea login add`);自建实例需要登录该实例;
|
|
163
|
+
- 当前工作区是 git 仓库且有远端;或直接把工单放在 `.scratch/<feature>/issues/NN-<slug>.md`
|
|
164
|
+
(见 [本地工单约定](docs/local-issues.md))。
|
|
165
|
+
- 同一个工作区有多个远端时,以 `origin` 为准;同一个主机同时出现在 `glab` 与 `tea` 的登录列表里时按
|
|
166
|
+
GitLab 处理。
|
|
167
|
+
|
|
168
|
+
缺 `gh` / `glab` / `tea` 或未登录时,列表会显示对应的操作提示,并提供“查看环境检查”入口;读取 `.scratch` 失败时只给出文件权限提示。
|
|
169
|
+
自建 GitLab 或 Gitea 未在对应 CLI 登录时,面板回退本地 Markdown,并在顶部标明“本地”;环境检查会点名缺的是安装还是登录,
|
|
170
|
+
给出 `gh auth login` / `glab auth login` / `tea login add` 这类可执行建议。
|
|
171
|
+
Gitea 后端选定之后,如果 `tea` 不见了、令牌失效或权限不够,列表会显示安装或重新登录的提示
|
|
172
|
+
(`tea-missing` / `tea-unauthenticated`),环境检查里的 Gitea 三项也会给出同样的结论。
|
|
173
|
+
|
|
174
|
+
## 开发
|
|
175
|
+
|
|
176
|
+
见 [CONTRIBUTING.md](CONTRIBUTING.md)。开发时用 `pnpm dev` 同时 watch 宿主与客户端构建,配合 DSH HMR
|
|
177
|
+
做到保存即刷新。各层的约定写在 `src/<层>/README.md`,依赖方向由
|
|
178
|
+
`.dependency-cruiser.json` 检查;业务术语见 [GLOSSARY.md](GLOSSARY.md)。
|
|
179
|
+
|
|
180
|
+
## 许可证
|
|
181
|
+
|
|
182
|
+
MIT
|