pi-usereq 0.36.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +552 -546
  2. package/README.md +260 -421
  3. package/package.json +46 -46
package/README.md CHANGED
@@ -1,421 +1,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
- [![Flowchart](https://raw.githubusercontent.com/Ogekuri/PI-useReq/refs/heads/master/images/flowchart-bw.svg)](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.
1
+ # PI-useReq/pi-usereq (0.37.0)
2
+
3
+ <p align="center">
4
+ <img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
5
+ <img src="https://img.shields.io/badge/license-GPL--3.0-491?style=flat-square" alt="License: GPL-3.0">
6
+ <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">
7
+ <img src="https://img.shields.io/badge/docs-live-b31b1b" alt="Docs">
8
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
9
+ </p>
10
+
11
+ <p align="center">
12
+ <strong>TODO: complete with one line project descrition.</strong><br>
13
+ TODO: complete with complete molti-line project descrition.<br>
14
+ This allows them to be run both as a Python package (installed as <b>req</b>, <b>usereq</b>, or <b>use-req</b>) and directly using <b>uvx</b>.
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="#prompts-and-agents">Prompts and Agents</a> |
21
+ <a href="#default-workflow">Default Workflow</a> |
22
+ <a href="#supported-clis-agents-and-extensions">Supported CLIs, Agents, and Extensions</a> |
23
+ <a href="#known-issues">Known Issues</a> |
24
+ <a href="#legacy-mode">Legacy Mode</a>
25
+ </p>
26
+ <p align="center">
27
+ <br>
28
+ 🚧 <strong>DRAFT</strong>: 👾 Alpha Development 👾 - Work in Progress 🏗️ 🚧<br>
29
+ ⚠️ <strong>IMPORTANT NOTICE</strong>: Created itself with <a href="https://github.com/Ogekuri/PI-useReq"><strong>PI-useReq/pi-usereq</strong></a> 🤖✨ ⚠️<br>
30
+ <br>
31
+ <p>
32
+
33
+
34
+
35
+ ## Requirements
36
+
37
+ - TODO: complete the bulle list with requiremets
38
+
39
+
40
+ ## Feature Highlights
41
+ - TODO: complete the bulle list with feature highlights
42
+
43
+
44
+ ## Extension Custom Commands
45
+
46
+ TODO: complete table with the extension custom commands
47
+
48
+ | Prompt | Description |
49
+ | --- | --- |
50
+ | `write` | Produce a *SRS* draft based on the User Request description |
51
+ | `create` | Write a *Software Requirements Specification* using the project's source code |
52
+ | `recreate` | Reorganize and update the *Software Requirements Specification* based on source code analysis (preserve requirement IDs) |
53
+ | `renumber` | Deterministically renumber requirement IDs in the *Software Requirements Specification* without changing requirement text or order |
54
+ | `analyze` | Produce an analysis report |
55
+ | `change` | Update the requirements and implement the corresponding changes |
56
+ | `check` | Run the requirements check |
57
+ | `cover` | Implement minimal changes to cover uncovered existing requirements |
58
+ | `fix` | Fix a defect without changing the requirements |
59
+ | `implement` | Implement source code from requirements (from scratch) |
60
+ | `new` | Implement a new requirement and the corresponding source code changes |
61
+ | `refactor` | Perform a refactor without changing the requirements |
62
+ | `readme` | Write `README.md` from user-visible implementation evidence |
63
+ | `req-references` | Write a `REFERENCES.md` using the project's source code |
64
+ | `workflow` | Write a `WORKFLOW.md` using the project's source code |
65
+ | `flowchart` | Write a `FLOWCHART.md` using the project's source code |
66
+
67
+
68
+ ## Default Workflow
69
+
70
+ Click to zoom flowchart image.
71
+
72
+ [![Flowchart](https://raw.githubusercontent.com/Ogekuri/PI-useReq/refs/heads/master/images/flowchart-bw.svg)](https://raw.githubusercontent.com/Ogekuri/PI-useReq/refs/heads/master/images/flowchart-bw.svg)
73
+
74
+
75
+ ## Project's Documentation
76
+
77
+
78
+ ### Project's Tree
79
+
80
+ TODO: update/rewrite the project tree
81
+
82
+ ```text
83
+ .
84
+ ├── .req/
85
+ │ └── useReq/req files
86
+ ├── docs/
87
+ │ ├── FLOWCHART.md
88
+ │ ├── REQUIREMENTS.md
89
+ │ ├── REFERENCES.md
90
+ │ └── WORKFLOW.md
91
+ ├── guidelines/
92
+ │ └── User's guidelines
93
+ ├── src/
94
+ │ └── Source code
95
+ └── tests/
96
+ └── Unit tests suite
97
+ ```
98
+
99
+ ## Install/Uninstall
100
+
101
+ ### Install
102
+
103
+ TODO: complete installation istructions
104
+
105
+ Install:
106
+ ```bash
107
+ pi install npm:pi-usereq
108
+ ```
109
+
110
+ Or via git:
111
+ ```bash
112
+ pi install git:github.com/Ogekuri/PI-useReq
113
+ ```
114
+
115
+ Reload Pi.
116
+
117
+
118
+ ### Uninstall
119
+
120
+ TODO: complete uninstall istructions
121
+
122
+ ```bash
123
+
124
+ ```
125
+
126
+ ## Quick Start
127
+
128
+ TODO: complete/reeview with a quick start guide with a complete quick start guide
129
+
130
+ 1. Install extension, tun pi-dev CLI
131
+ 2. Use `/req-write` or `/req-create` to create requirements
132
+ 3. Use `/req-implement` to implement source-code from requirements, or `/req-cover` to cover new requirements (documentation).
133
+ 4. Use `/req-workflow`, `/req-flowchart`, and/or `/req-references` to update project's documentation.
134
+ 5. Start to use `/req-change`, `/req-new`, and `/req-fix`.
135
+
136
+ ## Extension Usage
137
+
138
+ TODO: document all extension features in details
139
+
140
+ ### Extension Custom Commands
141
+
142
+ TODO: complete with the extension custom commands full documentation
143
+
144
+ ### Extension Custom Tools
145
+
146
+ TODO: complete with the extension custom tools full documentasions
147
+
148
+ - Count tokens and chars for the given files
149
+ `files-tokens FILE [FILE ...]`
150
+
151
+ - Generate LLM summary markdown for the given files
152
+ `files-summarize FILE [FILE ...]`
153
+
154
+ - Generate compressed output for the given files
155
+ `files-compress FILE [FILE ...]`
156
+
157
+ - Find and extract specific constructs from the given files
158
+ `files-find TAG PATTERN FILE [FILE ...]`
159
+
160
+ - Run static analysis on the given files using tools configured in `.req/config.json`
161
+ `files-static-check FILE [FILE ...]`
162
+
163
+ - Count tokens and chars for canonical docs files in configured `docs-dir` (`REQUIREMENTS.md`, `WORKFLOW.md`, `REFERENCES.md`).
164
+ `tokens`
165
+
166
+ - Generate LLM summary markdown for source files selected by `git ls-files cached others exclude-standard` under configured `src-dir` directories.
167
+ `summarize`
168
+
169
+ - Generate compressed output for source files selected by `git ls-files cached others exclude-standard` under configured `src-dir` directories.
170
+ `compress`
171
+
172
+ - Find and extract specific constructs from source files selected by `git ls-files cached others exclude-standard` under configured `src-dir` directories.
173
+ `find TAG PATTERN`
174
+
175
+ - Run static analysis on source files selected by `git ls-files cached others exclude-standard` under configured `src-dir` directories (plus configured `tests-dir`, excluding `fixtures/`).
176
+ `static-check`
177
+
178
+ - Check repository integrity for the configured git path: clean working tree and valid HEAD.
179
+ `git-check`
180
+
181
+ - Check canonical docs presence in configured `docs-dir`: `REQUIREMENTS.md`, `WORKFLOW.md`, `REFERENCES.md`.
182
+ `docs-check`
183
+
184
+ - Create an isolated git worktree and branch with the provided name; also copies `.req/`, active provider directories, and `.venv` (when present) into the new worktree context.
185
+ `git-wt-create WT_NAME`
186
+
187
+ - Remove the git worktree and branch identified by name.
188
+ `git-wt-delete WT_NAME`
189
+
190
+ - Print the configured `git-path` value from `.req/config.json`; if `.req/config.json` is missing, the command fails with `Error: .req/config.json not found in the project root`.
191
+ `git-path`
192
+
193
+ - Print the configured `base-path` value from `.req/config.json`; if `.req/config.json` is missing, the command fails with `Error: .req/config.json not found in the project root`.
194
+ `get-base-path`
195
+
196
+
197
+ - Add `enable-line-numbers` to include `<n>:` prefixes in `files-compress`, `compress`, `files-find`, and `find` output.
198
+
199
+ - Test static check configuration and execution (standalone).
200
+ `test-static-check {dummy,pylance,ruff,command} [FILES...]`
201
+
202
+ #### Supported <TAG> in `find` commands
203
+
204
+ - **Python**: CLASS, FUNCTION, DECORATOR, IMPORT, VARIABLE
205
+ - **C**: STRUCT, UNION, ENUM, TYPEDEF, MACRO, FUNCTION, IMPORT, VARIABLE
206
+ - **C++**: CLASS, STRUCT, ENUM, NAMESPACE, FUNCTION, MACRO, IMPORT, TYPE_ALIAS
207
+ - **C#**: CLASS, INTERFACE, STRUCT, ENUM, NAMESPACE, FUNCTION, PROPERTY, IMPORT, DECORATOR, CONSTANT
208
+ - **Rust**: FUNCTION, STRUCT, ENUM, TRAIT, IMPL, MODULE, MACRO, CONSTANT, TYPE_ALIAS, IMPORT, DECORATOR
209
+ - **JavaScript**: CLASS, FUNCTION, COMPONENT, CONSTANT, IMPORT, MODULE
210
+ - **TypeScript**: INTERFACE, TYPE_ALIAS, ENUM, CLASS, FUNCTION, NAMESPACE, MODULE, IMPORT, DECORATOR
211
+ - **Java**: CLASS, INTERFACE, ENUM, FUNCTION, IMPORT, MODULE, DECORATOR, CONSTANT
212
+ - **Go**: FUNCTION, METHOD, STRUCT, INTERFACE, TYPE_ALIAS, CONSTANT, IMPORT, MODULE
213
+ - **Ruby**: CLASS, MODULE, FUNCTION, CONSTANT, IMPORT, DECORATOR
214
+ - **PHP**: CLASS, INTERFACE, TRAIT, FUNCTION, NAMESPACE, IMPORT, CONSTANT
215
+ - **Swift**: CLASS, STRUCT, ENUM, PROTOCOL, EXTENSION, FUNCTION, IMPORT, CONSTANT, VARIABLE
216
+ - **Kotlin**: CLASS, INTERFACE, ENUM, FUNCTION, CONSTANT, VARIABLE, MODULE, IMPORT, DECORATOR
217
+ - **Scala**: CLASS, TRAIT, MODULE, FUNCTION, CONSTANT, VARIABLE, TYPE_ALIAS, IMPORT
218
+ - **Lua**: FUNCTION, VARIABLE
219
+ - **Shell**: FUNCTION, VARIABLE, IMPORT
220
+ - **Perl**: FUNCTION, MODULE, IMPORT, CONSTANT
221
+ - **Haskell**: MODULE, TYPE_ALIAS, STRUCT, CLASS, FUNCTION, IMPORT
222
+ - **Zig**: FUNCTION, STRUCT, ENUM, UNION, CONSTANT, VARIABLE, IMPORT
223
+ - **Elixir**: MODULE, FUNCTION, PROTOCOL, IMPL, STRUCT, IMPORT
224
+
225
+ ### Extension Side Features
226
+
227
+ TODO: complete with extension side defatures
228
+
229
+ #### Sound
230
+
231
+ TODO: complete with sound extension feature description
232
+
233
+ ## Note on Git usage
234
+
235
+ TODO: review and rewrite git section according extension features.
236
+
237
+ This section describes the Git behavior when executing the commands provided by the scripts.
238
+
239
+ - Required state before execution:
240
+ - Execute commands from a working branch (not in detached HEAD).
241
+ - Preferably, the working tree should be clean: avoid unintended changes in the repository before starting the scripts.
242
+ - Save all files and verify that you are in the correct project directory.
243
+ - **IMPORTANT:** in clude on repository the directory configured in the extension.
244
+
245
+ - What the scripts do to the repository:
246
+ - The scripts may modify, create, or remove files in the working tree (files on disk).
247
+ - They do not modify Git history (HEAD), branches, or tags automatically.
248
+ - The index (staging area) and history remain unchanged until the user manually performs staging/commit operations.
249
+
250
+ - How to commit (recommended practice):
251
+ - Review changes generated by the scripts before including them in a commit.
252
+ - Manually add files to commit using `git add <file...>`.
253
+ - Execute the commit with a structured message, for example:
254
+ `git commit -m "change(<COMPONENT>): <SHORT-DESCRIPTION> [<DATE>]"`.
255
+ - Staging and commit operations are under the user's control; the scripts do not perform automatic commits or update Git references.
256
+
257
+ - Practical warnings:
258
+ - Do not use destructive commands (e.g., `git reset --hard`, `git clean -fd`) to "clean" the repository without verifying the impact.
259
+ - If you prefer to isolate changes, execute commands in a branch or a copy of the repository.
260
+