pi-usereq 0.34.0 → 0.36.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/.g.conf +0 -4
- package/CHANGELOG.md +546 -532
- package/README.md +421 -260
- package/package.json +46 -46
- package/pi-usereq/docs/REFERENCES.md +368 -348
- package/pi-usereq/docs/REQUIREMENTS.md +4 -4
- package/pi-usereq/docs/WORKFLOW.md +29 -15
- package/src/core/extension-status.ts +19 -3
- package/src/core/path-context.ts +59 -0
- package/src/index.ts +4 -3
- package/tests/extension-registration.test.ts +53 -2
package/README.md
CHANGED
|
@@ -1,260 +1,421 @@
|
|
|
1
|
-
# PI-useReq/pi-usereq (0.
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<img src="https://img.shields.io/badge/
|
|
5
|
-
<img src="https://img.shields.io/badge/
|
|
6
|
-
<img src="https://img.shields.io/badge/
|
|
7
|
-
<img src="https://img.shields.io/badge/
|
|
8
|
-
<img src="https://img.shields.io/
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<strong>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
<p align="center">
|
|
18
|
-
<a href="#quick-start">Quick Start</a> |
|
|
19
|
-
<a href="#feature-highlights">Feature Highlights</a> |
|
|
20
|
-
<a href="#
|
|
21
|
-
<a href="#default-workflow">Default Workflow</a> |
|
|
22
|
-
<a href="#
|
|
23
|
-
<a href="#
|
|
24
|
-
<a href="#
|
|
25
|
-
</
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<br>
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
## Requirements
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
.
|
|
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
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
1
|
+
# PI-useReq/pi-usereq (0.36.0)
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://img.shields.io/badge/node-24.15%2B-5FA04E?style=flat-square&logo=node.js&logoColor=white" alt="Node.js 24.15+">
|
|
5
|
+
<img src="https://img.shields.io/badge/runtime-pi%20extension-6A7EC2?style=flat-square" alt="pi extension">
|
|
6
|
+
<img src="https://img.shields.io/badge/language-TypeScript-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript">
|
|
7
|
+
<img src="https://img.shields.io/badge/license-GPL--3.0-491?style=flat-square" alt="License: GPL-3.0">
|
|
8
|
+
<img src="https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-6A7EC2?style=flat-square&logo=terminal&logoColor=white" alt="Platforms">
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<strong>pi-usereq is a pi extension for requirements-driven repository work.</strong><br>
|
|
13
|
+
It adds bundled <code>/req-*</code> workflows, repository analysis tools, a configuration menu, status telemetry, notifications, worktree-aware prompt orchestration, and standalone debug utilities for maintaining <code>REQUIREMENTS.md</code>, <code>WORKFLOW.md</code>, <code>REFERENCES.md</code>, <code>README.md</code>, and source-code changes from one consistent extension surface.<br>
|
|
14
|
+
The repository also ships a standalone CLI and offline debug harness for local inspection, replay, and automation-friendly analysis.
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<a href="#quick-start">Quick Start</a> |
|
|
19
|
+
<a href="#feature-highlights">Feature Highlights</a> |
|
|
20
|
+
<a href="#extension-custom-commands">Extension Custom Commands</a> |
|
|
21
|
+
<a href="#default-workflow">Default Workflow</a> |
|
|
22
|
+
<a href="#projects-documentation">Project's Documentation</a> |
|
|
23
|
+
<a href="#installuninstall">Install/Uninstall</a> |
|
|
24
|
+
<a href="#extension-usage">Extension Usage</a> |
|
|
25
|
+
<a href="#extension-side-features">Extension Side Features</a> |
|
|
26
|
+
<a href="#note-on-git-usage">Note on Git usage</a>
|
|
27
|
+
</p>
|
|
28
|
+
<p align="center">
|
|
29
|
+
<br>
|
|
30
|
+
🚧 <strong>DRAFT</strong>: 👾 Alpha Development 👾 - Work in Progress 🏗️ 🚧<br>
|
|
31
|
+
⚠️ <strong>IMPORTANT NOTICE</strong>: Created itself with <a href="https://github.com/Ogekuri/useReq"><strong>useReq/req</strong></a> 🤖✨ ⚠️<br>
|
|
32
|
+
<br>
|
|
33
|
+
<p>
|
|
34
|
+
|
|
35
|
+
## Requirements
|
|
36
|
+
|
|
37
|
+
- A working <strong>pi</strong> installation able to load extensions from this repository (`package.json` exposes `./src/index.ts` as the extension entry).
|
|
38
|
+
- A <strong>Git repository</strong> for prompt-backed `/req-*` workflows and for `/req-references` / `/req-reset` behavior.
|
|
39
|
+
- <strong>Node.js 24.15+</strong> for local repository-driven commands and debug scripts (`release-npm.yml` and local scripts target Node 24.15.0).
|
|
40
|
+
- For project-scope defaults, pi-usereq expects:
|
|
41
|
+
- docs in `pi-usereq/docs`
|
|
42
|
+
- source in `src`
|
|
43
|
+
- tests in `tests`
|
|
44
|
+
- Optional external static-check executables if you enable or keep the documented defaults:
|
|
45
|
+
- `pyright`, `ruff`
|
|
46
|
+
- `cppcheck`, `clang-format`
|
|
47
|
+
- `node` (`--check`)
|
|
48
|
+
- `npx eslint`
|
|
49
|
+
- Optional desktop notification tooling if you enable it:
|
|
50
|
+
- `notify-send` for command notifications
|
|
51
|
+
- `paplay` for sound notifications
|
|
52
|
+
- Pushover credentials if you enable Pushover delivery
|
|
53
|
+
|
|
54
|
+
## Feature Highlights
|
|
55
|
+
|
|
56
|
+
- Registers bundled slash commands for requirements authoring, implementation, analysis, refactoring, workflow-doc generation, and README maintenance.
|
|
57
|
+
- Exposes agent tools for file tokens, summaries, compression, construct search, references generation, and static checks.
|
|
58
|
+
- Provides a top-level `/pi-usereq` configuration UI for docs/source/test paths, git automation, active tools, notifications, static checks, and debug settings.
|
|
59
|
+
- Tracks extension state in the pi status footer with extension version, workflow state, branch, context usage, elapsed time, and active sound level.
|
|
60
|
+
- Supports prompt-command worktree orchestration with configurable automatic git commit and generated worktree naming.
|
|
61
|
+
- Includes direct non-agentic commands:
|
|
62
|
+
- `/req-references` regenerates and commits `REFERENCES.md`
|
|
63
|
+
- `/req-reset` restores base-path state and removes generated worktrees/branches
|
|
64
|
+
- Includes repository-local debug utilities:
|
|
65
|
+
- `scripts/pi-usereq-debug.sh`
|
|
66
|
+
- `scripts/debug-extension.ts`
|
|
67
|
+
- optional `/debug-*` wrapper commands when enabled in Debug settings
|
|
68
|
+
|
|
69
|
+
## Extension Custom Commands
|
|
70
|
+
|
|
71
|
+
| Command | Kind | Description |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| `/req-write` | Prompt-backed | Produce a Software Requirements Specification draft from a user request. |
|
|
74
|
+
| `/req-create` | Prompt-backed | Write a Software Requirements Specification using the project's source code. |
|
|
75
|
+
| `/req-recreate` | Prompt-backed | Reorganize and update the Software Requirements Specification from source-code evidence while preserving requirement IDs. |
|
|
76
|
+
| `/req-renumber` | Prompt-backed | Deterministically renumber requirement IDs without changing requirement text or order. |
|
|
77
|
+
| `/req-analyze` | Prompt-backed | Produce an evidence-backed analysis report. |
|
|
78
|
+
| `/req-check` | Prompt-backed | Run a requirements coverage/compliance check. |
|
|
79
|
+
| `/req-change` | Prompt-backed | Update the requirements and implement the corresponding changes. |
|
|
80
|
+
| `/req-new` | Prompt-backed | Implement a new requirement and make the corresponding source-code changes. |
|
|
81
|
+
| `/req-fix` | Prompt-backed | Fix a defect without changing the requirements. |
|
|
82
|
+
| `/req-cover` | Prompt-backed | Implement minimal changes to cover uncovered existing requirements. |
|
|
83
|
+
| `/req-implement` | Prompt-backed | Implement source code from requirements (from scratch). |
|
|
84
|
+
| `/req-refactor` | Prompt-backed | Perform a refactor without changing the requirements. |
|
|
85
|
+
| `/req-workflow` | Prompt-backed | Write `WORKFLOW.md` from source-code evidence. |
|
|
86
|
+
| `/req-flowchart` | Prompt-backed | Write `FLOWCHART.md` from source-code evidence. |
|
|
87
|
+
| `/req-readme` | Prompt-backed | Write `README.md` from user-visible implementation evidence. |
|
|
88
|
+
| `/req-references` | Direct command | Regenerate `REFERENCES.md`, stage only that file, commit it, and verify repository cleanliness. |
|
|
89
|
+
| `/req-reset` | Direct command | Reset req workflow state, restore base-path, and remove generated worktrees/branches. |
|
|
90
|
+
| `/pi-usereq` | Direct command | Open the interactive pi-usereq configuration menu. |
|
|
91
|
+
|
|
92
|
+
## Default Workflow
|
|
93
|
+
|
|
94
|
+
Click to zoom flowchart image.
|
|
95
|
+
|
|
96
|
+
[](https://raw.githubusercontent.com/Ogekuri/PI-useReq/refs/heads/master/images/flowchart-bw.svg)
|
|
97
|
+
|
|
98
|
+
## Project's Documentation
|
|
99
|
+
|
|
100
|
+
### Project's Tree
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
.
|
|
104
|
+
├── .github/
|
|
105
|
+
│ └── workflows/
|
|
106
|
+
│ └── release-npm.yml
|
|
107
|
+
├── images/
|
|
108
|
+
│ ├── flowchart-bw.png
|
|
109
|
+
│ ├── flowchart-bw.svg
|
|
110
|
+
│ ├── flowchart.md
|
|
111
|
+
│ ├── flowchart.png
|
|
112
|
+
│ └── flowchart.svg
|
|
113
|
+
├── pi-usereq/
|
|
114
|
+
│ └── docs/
|
|
115
|
+
│ ├── REFERENCES.md
|
|
116
|
+
│ ├── REQUIREMENTS.md
|
|
117
|
+
│ └── WORKFLOW.md
|
|
118
|
+
├── scripts/
|
|
119
|
+
│ ├── debug-extension.ts
|
|
120
|
+
│ ├── pi-usereq-debug.sh
|
|
121
|
+
│ └── tool-args-to-params.ts
|
|
122
|
+
├── src/
|
|
123
|
+
│ ├── cli.ts
|
|
124
|
+
│ ├── core/
|
|
125
|
+
│ └── index.ts
|
|
126
|
+
├── tests/
|
|
127
|
+
├── CHANGELOG.md
|
|
128
|
+
├── LICENSE
|
|
129
|
+
├── README.md
|
|
130
|
+
├── package-lock.json
|
|
131
|
+
├── package.json
|
|
132
|
+
└── TODO.md
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Install/Uninstall
|
|
136
|
+
|
|
137
|
+
### Install
|
|
138
|
+
|
|
139
|
+
For pi usage, install the extension from the repository source and reload pi:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
pi install git:github.com/Ogekuri/PI-useReq
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Then reload pi so the extension commands, tools, and shortcut registration become available.
|
|
146
|
+
|
|
147
|
+
For local repository development and standalone scripts:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npm ci
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Uninstall
|
|
154
|
+
|
|
155
|
+
This repository does not ship a separate uninstall script.
|
|
156
|
+
|
|
157
|
+
- Remove the extension from your pi installation using your normal pi extension-management flow.
|
|
158
|
+
- Reload pi after removal.
|
|
159
|
+
- If you no longer want repository-local configuration, remove `.pi-usereq.json` from the project root.
|
|
160
|
+
|
|
161
|
+
## Quick Start
|
|
162
|
+
|
|
163
|
+
1. Install the extension and open a Git-backed project.
|
|
164
|
+
2. Run `/pi-usereq` and confirm the key project settings:
|
|
165
|
+
- `Document directory`
|
|
166
|
+
- `Source-code directories`
|
|
167
|
+
- `Unit tests directory`
|
|
168
|
+
- `Auto git commit` / `Git worktree`
|
|
169
|
+
3. Bootstrap or refresh documentation:
|
|
170
|
+
- `/req-write` for a request-driven SRS draft
|
|
171
|
+
- `/req-create` for code-driven SRS generation
|
|
172
|
+
- `/req-workflow` and `/req-references` for runtime and symbol documentation
|
|
173
|
+
4. Execute implementation workflows as needed:
|
|
174
|
+
- `/req-change`, `/req-new`, `/req-fix`, `/req-cover`, `/req-implement`, `/req-refactor`
|
|
175
|
+
5. Use maintenance utilities when needed:
|
|
176
|
+
- `/req-readme` to align `README.md`
|
|
177
|
+
- `/req-flowchart` to refresh the flowchart artifact
|
|
178
|
+
- `/req-reset` to recover from worktree/session leftovers
|
|
179
|
+
|
|
180
|
+
## Extension Usage
|
|
181
|
+
|
|
182
|
+
### Extension Custom Commands
|
|
183
|
+
|
|
184
|
+
#### Prompt-backed workflow families
|
|
185
|
+
|
|
186
|
+
- <strong>Requirements authoring</strong>: `/req-write`, `/req-create`, `/req-recreate`, `/req-renumber`
|
|
187
|
+
- <strong>Read-only analysis</strong>: `/req-analyze`, `/req-check`
|
|
188
|
+
- <strong>Implementation/change</strong>: `/req-change`, `/req-new`, `/req-fix`, `/req-cover`, `/req-implement`, `/req-refactor`
|
|
189
|
+
- <strong>Documentation maintenance</strong>: `/req-workflow`, `/req-flowchart`, `/req-readme`
|
|
190
|
+
|
|
191
|
+
Prompt-backed commands use prompt-specific required-document checks. For example:
|
|
192
|
+
|
|
193
|
+
- `/req-create`, `/req-workflow`, `/req-write` do not require pre-existing canonical docs.
|
|
194
|
+
- `/req-implement` requires `REQUIREMENTS.md`.
|
|
195
|
+
- Most other bundled workflows require `REQUIREMENTS.md`, `WORKFLOW.md`, and `REFERENCES.md`.
|
|
196
|
+
|
|
197
|
+
#### Direct maintenance commands
|
|
198
|
+
|
|
199
|
+
- <strong>`/req-references`</strong>
|
|
200
|
+
- validates repository state
|
|
201
|
+
- regenerates `REFERENCES.md` from configured source directories
|
|
202
|
+
- stages only `REFERENCES.md`
|
|
203
|
+
- creates the fixed commit `docs(references): Update REFERENCES.md document. [useReq]`
|
|
204
|
+
- <strong>`/req-reset`</strong>
|
|
205
|
+
- restores req workflow state
|
|
206
|
+
- restores the original base-path when recoverable prompt state exists
|
|
207
|
+
- removes generated worktrees and matching branches built from the configured worktree prefix
|
|
208
|
+
- <strong>`/pi-usereq`</strong>
|
|
209
|
+
- opens the interactive settings UI
|
|
210
|
+
- persists project-local and global configuration on exit
|
|
211
|
+
|
|
212
|
+
#### Optional debug wrapper commands
|
|
213
|
+
|
|
214
|
+
When <strong>Debug → Enable debug commands for tools</strong> is enabled, pi-usereq also registers:
|
|
215
|
+
|
|
216
|
+
- `/debug-compress`
|
|
217
|
+
- `/debug-references`
|
|
218
|
+
- `/debug-static-check`
|
|
219
|
+
- `/debug-summarize`
|
|
220
|
+
- `/debug-tokens`
|
|
221
|
+
|
|
222
|
+
These commands run the corresponding tool path and write the monolithic result into the editor instead of the model context.
|
|
223
|
+
|
|
224
|
+
### Extension Custom Tools
|
|
225
|
+
|
|
226
|
+
| Tool | Scope | User-visible behavior |
|
|
227
|
+
| --- | --- | --- |
|
|
228
|
+
| `files-tokens` | Explicit files | Count tokens, bytes, characters, lines, headings, and related file metrics. |
|
|
229
|
+
| `files-summarize` | Explicit source files | Produce monolithic summary markdown for the selected files. |
|
|
230
|
+
| `files-compress` | Explicit source files | Produce monolithic compressed markdown for the selected files. |
|
|
231
|
+
| `files-search` | Explicit source files | Extract named constructs by tag + regex from the selected files. |
|
|
232
|
+
| `summarize` | Configured source directories | Summarize project source under configured `src-dir` values. |
|
|
233
|
+
| `references` | Configured source directories + docs dir | Overwrite `<docs-dir>/REFERENCES.md` and return only `success` or `error: ...`. |
|
|
234
|
+
| `compress` | Configured source directories | Compress project source under configured `src-dir` values. |
|
|
235
|
+
| `search` | Configured source directories | Extract named constructs by tag + regex across configured source directories. |
|
|
236
|
+
| `tokens` | Canonical docs | Count token metrics for `REQUIREMENTS.md`, `WORKFLOW.md`, and `REFERENCES.md` under configured `docs-dir`. |
|
|
237
|
+
| `files-static-check` | Explicit files | Run configured static-check entries against selected files. |
|
|
238
|
+
| `static-check` | Configured source + test directories | Run configured static checks across source and tests (excluding fixtures from project-scope selection). |
|
|
239
|
+
|
|
240
|
+
Notes:
|
|
241
|
+
|
|
242
|
+
- `files-compress`, `compress`, `files-search`, and `search` support optional line numbers.
|
|
243
|
+
- `search`/`files-search` apply the regex to construct <strong>names</strong>, not bodies.
|
|
244
|
+
- `references` is also part of the default enabled-tool set.
|
|
245
|
+
- Default enabled tools include all extension-owned tools above plus embedded `read`, `bash`, `edit`, and `write`. Embedded `find`, `grep`, and `ls` are configurable but default-disabled.
|
|
246
|
+
|
|
247
|
+
### Standalone CLI
|
|
248
|
+
|
|
249
|
+
The repository also ships a standalone CLI entry in `src/cli.ts`.
|
|
250
|
+
|
|
251
|
+
Run it from the repository root with:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
npm run cli -- --here --summarize
|
|
255
|
+
npm run cli -- --here --compress --enable-line-numbers
|
|
256
|
+
npm run cli -- --files-summarize src/index.ts src/cli.ts
|
|
257
|
+
npm run cli -- --files-compress src/index.ts src/cli.ts
|
|
258
|
+
npm run cli -- --files-find FUNCTION '^main$' src/cli.ts
|
|
259
|
+
npm run cli -- --files-static-check src/index.ts
|
|
260
|
+
npm run cli -- --static-check
|
|
261
|
+
npm run cli -- --enable-static-check "Python=Command,ruff,check" --here --static-check
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Supported top-level CLI switches include:
|
|
265
|
+
|
|
266
|
+
- `--base <path>`
|
|
267
|
+
- `--here`
|
|
268
|
+
- `--verbose`
|
|
269
|
+
- `--enable-line-numbers`
|
|
270
|
+
- `--enable-static-check LANG=Command,CMD[,PARAM...]` (repeatable)
|
|
271
|
+
- `--files-tokens FILE...`
|
|
272
|
+
- `--files-summarize FILE...`
|
|
273
|
+
- `--files-compress FILE...`
|
|
274
|
+
- `--files-find TAG PATTERN FILE...`
|
|
275
|
+
- `--summarize`
|
|
276
|
+
- `--compress`
|
|
277
|
+
- `--find TAG PATTERN`
|
|
278
|
+
- `--tokens`
|
|
279
|
+
- `--files-static-check FILE...`
|
|
280
|
+
- `--static-check`
|
|
281
|
+
- `--test-static-check dummy ...`
|
|
282
|
+
- `--test-static-check command <cmd> ...`
|
|
283
|
+
|
|
284
|
+
CLI naming note: the standalone CLI uses <code>--files-find</code> / <code>--find</code>, while the extension tool surface uses <code>files-search</code> / <code>search</code>.
|
|
285
|
+
|
|
286
|
+
### Offline debug utilities
|
|
287
|
+
|
|
288
|
+
#### `scripts/pi-usereq-debug.sh`
|
|
289
|
+
|
|
290
|
+
The bash wrapper provides convenience subcommands for offline extension replay:
|
|
291
|
+
|
|
292
|
+
- `inspect`
|
|
293
|
+
- `session`
|
|
294
|
+
- `command <name>`
|
|
295
|
+
- `prompt <name>`
|
|
296
|
+
- `tool <name>`
|
|
297
|
+
- `sdk`
|
|
298
|
+
- `raw ...`
|
|
299
|
+
|
|
300
|
+
Examples:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
./scripts/pi-usereq-debug.sh inspect --format pretty
|
|
304
|
+
./scripts/pi-usereq-debug.sh session --format json
|
|
305
|
+
./scripts/pi-usereq-debug.sh prompt analyze --args "Inspect prompt rendering"
|
|
306
|
+
./scripts/pi-usereq-debug.sh tool files-search --args 'FUNCTION ^run src/index.ts --enable-line-numbers'
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
#### `scripts/debug-extension.ts`
|
|
310
|
+
|
|
311
|
+
The lower-level TypeScript harness supports:
|
|
312
|
+
|
|
313
|
+
- `inspect`
|
|
314
|
+
- `session-start`
|
|
315
|
+
- `command`
|
|
316
|
+
- `tool`
|
|
317
|
+
- `sdk-smoke`
|
|
318
|
+
|
|
319
|
+
It accepts `--cwd`, `--extension`, `--format`, `--name`, `--args`, `--params`, `--event-payload`, `--select`, and `--input`.
|
|
320
|
+
|
|
321
|
+
## Extension Side Features
|
|
322
|
+
|
|
323
|
+
### Configuration UI
|
|
324
|
+
|
|
325
|
+
`/pi-usereq` exposes these top-level controls:
|
|
326
|
+
|
|
327
|
+
- `Document directory`
|
|
328
|
+
- `Source-code directories`
|
|
329
|
+
- `Unit tests directory`
|
|
330
|
+
- `Auto git commit`
|
|
331
|
+
- `Git worktree`
|
|
332
|
+
- `Worktree prefix`
|
|
333
|
+
- `Language static code checkers`
|
|
334
|
+
- `Enable tools`
|
|
335
|
+
- `Notifications`
|
|
336
|
+
- `Debug`
|
|
337
|
+
- `Show local configuration`
|
|
338
|
+
- `Show global configuration`
|
|
339
|
+
- `Reset defaults`
|
|
340
|
+
|
|
341
|
+
Configuration persistence is split across:
|
|
342
|
+
|
|
343
|
+
- local project file: `.pi-usereq.json`
|
|
344
|
+
- global file: `~/.config/pi-usereq/config.json`
|
|
345
|
+
|
|
346
|
+
### Status footer
|
|
347
|
+
|
|
348
|
+
The extension status line renders:
|
|
349
|
+
|
|
350
|
+
- extension name and version
|
|
351
|
+
- workflow state
|
|
352
|
+
- current Git branch
|
|
353
|
+
- context-usage gauge
|
|
354
|
+
- elapsed timing fields
|
|
355
|
+
- active runtime sound level
|
|
356
|
+
|
|
357
|
+
### Sound
|
|
358
|
+
|
|
359
|
+
Notification sound behavior is user-visible in two separate ways:
|
|
360
|
+
|
|
361
|
+
- <strong>Persisted boot sound level</strong>: configurable in `Notifications` as `none`, `low`, `mid`, or `high`
|
|
362
|
+
- <strong>Active runtime sound level</strong>: cycled at runtime with the configured shortcut
|
|
363
|
+
|
|
364
|
+
Default sound-toggle shortcut:
|
|
365
|
+
|
|
366
|
+
```text
|
|
367
|
+
alt+s
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Cycle order:
|
|
371
|
+
|
|
372
|
+
```text
|
|
373
|
+
none -> low -> mid -> high -> none
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Changing the shortcut updates configuration immediately, but the extension asks you to run `/reload` before the new binding is applied.
|
|
377
|
+
|
|
378
|
+
### Notifications
|
|
379
|
+
|
|
380
|
+
The Notifications menu manages three transport families:
|
|
381
|
+
|
|
382
|
+
- command notification (`notify-send` by default)
|
|
383
|
+
- sound notification (`paplay` commands by default)
|
|
384
|
+
- Pushover delivery
|
|
385
|
+
|
|
386
|
+
Each transport has completed/interrupted/failed event toggles.
|
|
387
|
+
|
|
388
|
+
Pushover behavior:
|
|
389
|
+
|
|
390
|
+
- stays disabled until both credential fields are populated
|
|
391
|
+
- exposes priority `Normal` or `High`
|
|
392
|
+
- exposes configurable title/text templates
|
|
393
|
+
- supports escaped control-sequence editing for the text field
|
|
394
|
+
|
|
395
|
+
Default templates:
|
|
396
|
+
|
|
397
|
+
```text
|
|
398
|
+
Pushover title: %%PROMT%% @ %%BASE%% [%%TIME%%]
|
|
399
|
+
Pushover text : %%RESULT%%\n%%ARGS%%
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
## Note on Git usage
|
|
403
|
+
|
|
404
|
+
pi-usereq owns visible Git behavior for prompt-backed workflows and for the dedicated direct commands.
|
|
405
|
+
|
|
406
|
+
- Prompt-backed `/req-*` workflows validate that the current project is inside a Git repository.
|
|
407
|
+
- Prompt-backed workflows can use generated worktrees when:
|
|
408
|
+
- `Auto git commit` is `enable`
|
|
409
|
+
- `Git worktree` is `enable`
|
|
410
|
+
- If `Auto git commit` is disabled, effective worktree usage is forced to `disable`.
|
|
411
|
+
- Generated worktree names use the configurable `Worktree prefix` (`PI-useReq-` by default).
|
|
412
|
+
- `/req-references` does <strong>not</strong> create a worktree; it writes `REFERENCES.md`, stages only that file, commits it, and verifies the repository is clean afterward.
|
|
413
|
+
- `/req-reset` removes generated worktrees and matching branches and restores the original base-path when prompt recovery data is available.
|
|
414
|
+
- The extension status footer exposes workflow-state transitions while these Git-backed flows run.
|
|
415
|
+
|
|
416
|
+
Practical guidance:
|
|
417
|
+
|
|
418
|
+
- Start from the intended repository and branch.
|
|
419
|
+
- Keep the working tree clean before launching mutation workflows.
|
|
420
|
+
- Review generated changes before relying on the resulting commit history.
|
|
421
|
+
- Use `/req-reset` if a worktree-backed run leaves recoverable state behind.
|