pi-usereq 0.38.0 → 0.39.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.
@@ -1,10 +1,3 @@
1
- ---
2
- description: "Deterministically renumber requirement IDs in the Software Requirements Specification without changing requirement text or order"
3
- argument-hint: "No arguments utilized by the prompt logic (English only)"
4
- usage: >
5
- Select this prompt when %%DOC_PATH%%/REQUIREMENTS.md already exists and you must enforce a clean, progressive, deterministic requirement ID sequence in document order, WITHOUT changing any requirement text, headings, or ordering. Only IDs and internal requirement-ID cross-references may change; all requirement content after the ID MUST remain byte-identical. Output is only the updated SRS; source code, tests, %%DOC_PATH%%/WORKFLOW.md, and %%DOC_PATH%%/REFERENCES.md must not change.
6
- ---
7
-
8
1
  # Deterministically renumber requirement IDs in the Software Requirements Specification
9
2
 
10
3
  ## Purpose
@@ -19,10 +12,22 @@ In scope: renumbering requirement identifiers in `%%DOC_PATH%%/REQUIREMENTS.md`
19
12
  - **Act as a Senior Technical Requirements Engineer** when analyzing source code to infer behavior: ensure every software requirement generated is atomic, unambiguous, and empirically testable.
20
13
  - **Act as a Technical Writer** when structuring the SRS document `%%DOC_PATH%%/REQUIREMENTS.md`: use RFC 2119 keywords exclusively (MUST, MUST NOT, SHOULD, SHOULD NOT, MAY) and never use "shall"; maintain a clean, hierarchical Markdown structure with a maximum depth of 3 levels.
21
14
  - **Act as a Business Analyst** when verifying the "True State": ensure the draft accurately reflects implemented logic, including limitations or bugs.
15
+ - **Act as an Expert GitOps Engineer** when executing git workflows.
16
+
17
+
18
+ ## Iteration and Context Economy
19
+ - **CRITICAL**: Plan every Step to complete in the minimum number of iterations; batch independent reads, searches, and edits into a single response and dispatch parallel tool calls whenever no dependency forces sequencing.
20
+ - **CRITICAL**: MUST NOT re-read, re-search, or re-fetch any file already provided as injected `%%CONTEXT_FILES%%` context or already read in the current session; reuse prior tool-output evidence instead.
21
+ - **CRITICAL**: MUST NOT restate requirement text, prior tool output, or unchanged file contents into the context; cite them by file path, symbol, and line range, quoting only the minimal changed snippet.
22
+ - **CRITICAL**: MUST add only information required by the active Step, a requirement ID, or explicit user-request text; omit narration, filler, restatements, and speculative commentary.
23
+ - **CRITICAL**: MUST choose the most token-efficient evidence path in order: `%%DOC_PATH%%/REQUIREMENTS.md`, `%%DOC_PATH%%/WORKFLOW.md`, `%%DOC_PATH%%/REFERENCES.md`, then `search`/`files-search`, then `rg`/`grep` fallback, reading only targeted constructs and line ranges.
24
+ - **CRITICAL**: MUST gather all evidence a Step needs before producing its output and MUST NOT split a single logical operation across multiple iterations when one suffices.
25
+ - **CRITICAL**: MUST pause and wait for a tool response only when a Step explicitly depends on it; otherwise proceed autonomously to the next Step without requesting confirmation.
26
+ - **CRITICAL**: These rules MUST govern how the agent organizes and sequences the work described in the `## Steps` section.
22
27
 
23
28
 
24
29
  ## Absolute Rules, Non-Negotiable
25
- - **CRITICAL**: When instructions generate shell commands, they MUST generate only linear shell commands compatible with restrictive filtering systems, MUST verify and apply correct quoting, escaping, or option termination for literal arguments that could be parsed as options or flags, MUST use explicit option termination for `rg` and `grep` patterns beginning with `-` or `--`, MUST NOT rely on quoting or backslash escaping alone for those patterns, and MUST NOT use command substitution (`$()` or backticks), complex variable expansion, nested substitution, shell-derived helper composition, nested shell logic, or nested pipelines.
30
+ - **CRITICAL**: When instructions generate shell commands, they MUST generate only linear shell commands compatible with restrictive filtering systems, MUST verify and apply correct quoting, escaping, or option termination for literal arguments that could be parsed as options or flags, MUST use explicit option termination for `rg` and `git grep` patterns beginning with `-` or `--`, MUST NOT rely on quoting or backslash escaping alone for those patterns, and MUST NOT use command substitution (`$()` or backticks), complex variable expansion, nested substitution, shell-derived helper composition, nested shell logic, or nested pipelines.
26
31
  - **CRITICAL**: NEVER write, modify, edit, or delete files outside of the active repository directory, except under `/tmp`.
27
32
  - You can read, write, or edit `%%DOC_PATH%%/REQUIREMENTS.md`.
28
33
  - Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
@@ -86,3 +91,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
86
91
  3. %%COMMIT%%
87
92
  4. Present results
88
93
  - PRINT, in the response, the results for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. Use the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
94
+
95
+
96
+ ## Context Files
97
+ The content under this section is pre-loaded reference material for this workflow, already present in full in your context. Treat it as authoritative ground truth and reason over it directly; do NOT re-read, search, locate, or fetch it with `read`, `search`, `files-search`, `grep`, `ls`, or any discovery tool. If this section contains no file content, treat it as empty and proceed without context-file assumptions.
98
+
99
+ %%CONTEXT_FILES%%
@@ -1,10 +1,3 @@
1
- ---
2
- description: "Write a WORKFLOW.md using the project's source code"
3
- argument-hint: "No arguments utilized by the prompt logic"
4
- usage: >
5
- Select this prompt ONLY for docs-maintenance of %%DOC_PATH%%/WORKFLOW.md, when it is missing/outdated and you need to regenerate the runtime/workflow model (processes/threads, internal call-traces, communication edges) from evidence in %%SRC_PATHS%% and commit that doc change. Do NOT select if you will change requirements, source code, or tests; choose /req-change, /req-new, /req-fix, /req-refactor, /req-cover, /req-implement, /req-create, or /req-recreate as appropriate. Do NOT select for read-only analysis/audits (use /req-analyze or /req-check).
6
- ---
7
-
8
1
  # Write a WORKFLOW.md using the project's source code
9
2
 
10
3
  ## Purpose
@@ -20,10 +13,22 @@ In scope: static analysis of source under %%SRC_PATHS%% to generate/overwrite on
20
13
  - **Act as a Business Analyst** when cross-referencing code findings with `%%DOC_PATH%%/REQUIREMENTS.md` to ensure functional alignment.
21
14
  - **Act as a Technical Writer** when producing the final analysis report or workflow descriptions, ensuring clarity, technical precision, and structured formatting.
22
15
  - **Act as a QA Auditor** when reporting facts, requiring concrete evidence as declaration file paths only (excluding line numbers and line ranges) for every finding.
16
+ - **Act as an Expert GitOps Engineer** when executing git workflows.
17
+
18
+
19
+ ## Iteration and Context Economy
20
+ - **CRITICAL**: Plan every Step to complete in the minimum number of iterations; batch independent reads, searches, and edits into a single response and dispatch parallel tool calls whenever no dependency forces sequencing.
21
+ - **CRITICAL**: MUST NOT re-read, re-search, or re-fetch any file already provided as injected `%%CONTEXT_FILES%%` context or already read in the current session; reuse prior tool-output evidence instead.
22
+ - **CRITICAL**: MUST NOT restate requirement text, prior tool output, or unchanged file contents into the context; cite them by file path, symbol, and line range, quoting only the minimal changed snippet.
23
+ - **CRITICAL**: MUST add only information required by the active Step, a requirement ID, or explicit user-request text; omit narration, filler, restatements, and speculative commentary.
24
+ - **CRITICAL**: MUST choose the most token-efficient evidence path in order: `%%DOC_PATH%%/REQUIREMENTS.md`, `%%DOC_PATH%%/WORKFLOW.md`, `%%DOC_PATH%%/REFERENCES.md`, then `search`/`files-search`, then `rg`/`grep` fallback, reading only targeted constructs and line ranges.
25
+ - **CRITICAL**: MUST gather all evidence a Step needs before producing its output and MUST NOT split a single logical operation across multiple iterations when one suffices.
26
+ - **CRITICAL**: MUST pause and wait for a tool response only when a Step explicitly depends on it; otherwise proceed autonomously to the next Step without requesting confirmation.
27
+ - **CRITICAL**: These rules MUST govern how the agent organizes and sequences the work described in the `## Steps` section.
23
28
 
24
29
 
25
30
  ## Absolute Rules, Non-Negotiable
26
- - **CRITICAL**: When instructions generate shell commands, they MUST generate only linear shell commands compatible with restrictive filtering systems, MUST verify and apply correct quoting, escaping, or option termination for literal arguments that could be parsed as options or flags, MUST use explicit option termination for `rg` and `grep` patterns beginning with `-` or `--`, MUST NOT rely on quoting or backslash escaping alone for those patterns, and MUST NOT use command substitution (`$()` or backticks), complex variable expansion, nested substitution, shell-derived helper composition, nested shell logic, or nested pipelines.
31
+ - **CRITICAL**: When instructions generate shell commands, they MUST generate only linear shell commands compatible with restrictive filtering systems, MUST verify and apply correct quoting, escaping, or option termination for literal arguments that could be parsed as options or flags, MUST use explicit option termination for `rg` and `git grep` patterns beginning with `-` or `--`, MUST NOT rely on quoting or backslash escaping alone for those patterns, and MUST NOT use command substitution (`$()` or backticks), complex variable expansion, nested substitution, shell-derived helper composition, nested shell logic, or nested pipelines.
27
32
  - **CRITICAL**: NEVER write, modify, edit, or delete files outside of the active repository directory, except under `/tmp`.
28
33
  - You can read, write, or edit `%%DOC_PATH%%/WORKFLOW.md`.
29
34
  - Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
@@ -164,3 +169,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
164
169
  3. %%COMMIT%%
165
170
  4. Present results
166
171
  - PRINT, in the response, the results for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. Use the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
172
+
173
+
174
+ ## Context Files
175
+ The content under this section is pre-loaded reference material for this workflow, already present in full in your context. Treat it as authoritative ground truth and reason over it directly; do NOT re-read, search, locate, or fetch it with `read`, `search`, `files-search`, `grep`, `ls`, or any discovery tool. If this section contains no file content, treat it as empty and proceed without context-file assumptions.
176
+
177
+ %%CONTEXT_FILES%%
@@ -1,10 +1,3 @@
1
- ---
2
- description: "Produce a Software Requirements Specification draft based on the User Request description"
3
- argument-hint: "Description of the application to be drafted from scratch (English only)"
4
- usage: >
5
- Select this prompt to draft/author %%DOC_PATH%%/REQUIREMENTS.md ONLY from the user’s textual request (greenfield/kickoff, no authoritative implementation to analyze). Use when you must capture intent, fill gaps via explicit Assumptions, and produce an SRS suitable for SRS-driven development, without touching code/tests/%%DOC_PATH%%/WORKFLOW.md/%%DOC_PATH%%/REFERENCES.md. Do NOT select if an implementation already exists and you need requirements grounded in repo evidence (use /req-create or /req-recreate), if you need to change existing requirements and implement (use /req-change or /req-new), or for audit/triage or implementation work (use /req-analyze, /req-check, /req-fix, /req-refactor, /req-cover, /req-implement).
6
- ---
7
-
8
1
  # Produce a Software Requirements Specification draft based on the User Request description
9
2
 
10
3
  ## Purpose
@@ -22,8 +15,19 @@ In scope: author/update only `%%DOC_PATH%%/REQUIREMENTS.md` from [User Request](
22
15
  - **Act as a Senior System Architect** when describing components or relationships: ensure the technical descriptions reflect a modular, scalable, and robust architecture consistent with industry best practices.
23
16
 
24
17
 
18
+ ## Iteration and Context Economy
19
+ - **CRITICAL**: Plan every Step to complete in the minimum number of iterations; batch independent reads, searches, and edits into a single response and dispatch parallel tool calls whenever no dependency forces sequencing.
20
+ - **CRITICAL**: MUST NOT re-read, re-search, or re-fetch any file already provided as injected `%%CONTEXT_FILES%%` context or already read in the current session; reuse prior tool-output evidence instead.
21
+ - **CRITICAL**: MUST NOT restate requirement text, prior tool output, or unchanged file contents into the context; cite them by file path, symbol, and line range, quoting only the minimal changed snippet.
22
+ - **CRITICAL**: MUST add only information required by the active Step, a requirement ID, or explicit user-request text; omit narration, filler, restatements, and speculative commentary.
23
+ - **CRITICAL**: MUST choose the most token-efficient evidence path in order: `%%DOC_PATH%%/REQUIREMENTS.md`, `%%DOC_PATH%%/WORKFLOW.md`, `%%DOC_PATH%%/REFERENCES.md`, then `search`/`files-search`, then `rg`/`grep` fallback, reading only targeted constructs and line ranges.
24
+ - **CRITICAL**: MUST gather all evidence a Step needs before producing its output and MUST NOT split a single logical operation across multiple iterations when one suffices.
25
+ - **CRITICAL**: MUST pause and wait for a tool response only when a Step explicitly depends on it; otherwise proceed autonomously to the next Step without requesting confirmation.
26
+ - **CRITICAL**: These rules MUST govern how the agent organizes and sequences the work described in the `## Steps` section.
27
+
28
+
25
29
  ## Absolute Rules, Non-Negotiable
26
- - **CRITICAL**: When instructions generate shell commands, they MUST generate only linear shell commands compatible with restrictive filtering systems, MUST verify and apply correct quoting, escaping, or option termination for literal arguments that could be parsed as options or flags, MUST use explicit option termination for `rg` and `grep` patterns beginning with `-` or `--`, MUST NOT rely on quoting or backslash escaping alone for those patterns, and MUST NOT use command substitution (`$()` or backticks), complex variable expansion, nested substitution, shell-derived helper composition, nested shell logic, or nested pipelines.
30
+ - **CRITICAL**: When instructions generate shell commands, they MUST generate only linear shell commands compatible with restrictive filtering systems, MUST verify and apply correct quoting, escaping, or option termination for literal arguments that could be parsed as options or flags, MUST use explicit option termination for `rg` and `git grep` patterns beginning with `-` or `--`, MUST NOT rely on quoting or backslash escaping alone for those patterns, and MUST NOT use command substitution (`$()` or backticks), complex variable expansion, nested substitution, shell-derived helper composition, nested shell logic, or nested pipelines.
27
31
  - **CRITICAL**: NEVER write, modify, edit, or delete files outside of the project’s home directory, except under `/tmp`, where creating temporary files and writing outputs is allowed (the only permitted location outside the project).
28
32
  - You can read, write, or edit `%%DOC_PATH%%/REQUIREMENTS.md`.
29
33
  - Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
@@ -98,3 +102,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
98
102
 
99
103
  <h2 id="users-request">User's Request</h2>
100
104
  %%ARGS%%
105
+
106
+
107
+ ## Context Files
108
+ The content under this section is pre-loaded reference material for this workflow, already present in full in your context. Treat it as authoritative ground truth and reason over it directly; do NOT re-read, search, locate, or fetch it with `read`, `search`, `files-search`, `grep`, `ls`, or any discovery tool. If this section contains no file content, treat it as empty and proceed without context-file assumptions.
109
+
110
+ %%CONTEXT_FILES%%
@@ -1,24 +1,4 @@
1
- ---
2
- title: "{{project name}} Requirements"
3
- description: Software requirements specification
4
- version: "{{version}}"
5
- date: "{{date_modified}}"
6
- author: "{{author}}"
7
- scope:
8
- paths:
9
- - "**/*.py"
10
- - "**/*.ipynb"
11
- - "**/*.c"
12
- - "**/*.h"
13
- - "**/*.cpp"
14
- excludes:
15
- - ".*/**"
16
- visibility: "draft"
17
- tags: ["markdown", "requirements", "example"]
18
- ---
19
-
20
1
  # {{project name}} Requirements
21
- <!-- Metadata is in the YAML front matter; do not duplicate it in the body. -->
22
2
 
23
3
  <!-- Optional: omit a Table of Contents to reduce token footprint for LLM agents. If a TOC is included, it MUST be auto-generated and kept minimal. -->
24
4
 
@@ -35,8 +15,8 @@ This document MUST follow these authoring rules (LLM-first, normative SRS):
35
15
  - Each requirement MUST be atomic, single-sentence, and testable; target <= 35 words per requirement; split any compound behavior into separate IDs.
36
16
  - Write for other LLM Agents and automated parsers (high semantic density; no filler).
37
17
  - On every change to this document:
38
- - Update `date` and `version` in the YAML front matter only (avoid duplicating metadata in the body).
39
- - Do NOT maintain an in-document revision history; use git history / CHANGELOG.md for change tracking.
18
+ - Keep the first line as a level-1 title beginning with `# `.
19
+ - Do NOT add YAML front matter or in-document revision history; use git history / CHANGELOG.md for change tracking.
40
20
 
41
21
  ### 1.2 Project Scope
42
22
  <!-- The project (name/version), primary purpose, key capabilities, and boundaries. Keep brief and focus on the "what" and "why", not the "how". Avoid detailed requirements here. -->
@@ -1826,6 +1826,7 @@ test("configuration menus expose local/global config ordering and omit overview
1826
1826
  "Document directory",
1827
1827
  "Source-code directories",
1828
1828
  "Unit tests directory",
1829
+ "Context Files",
1829
1830
  "Auto git commit",
1830
1831
  "Git worktree",
1831
1832
  "Worktree prefix",
@@ -1841,9 +1842,12 @@ test("configuration menus expose local/global config ordering and omit overview
1841
1842
  renderedMenu,
1842
1843
  new RegExp(`<dim>${buildExpectedShowLocalConfigPath(cwd).replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}</dim>`),
1843
1844
  );
1844
- assert.match(
1845
- renderedMenu,
1846
- new RegExp(`<dim>${buildExpectedShowGlobalConfigPath().replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}</dim>`),
1845
+ // `Show global configuration` renders off the first paginated page (14 top-level rows, 12-row budget per REQ-153);
1846
+ // its presence and order are verified by the deepEqual items list above, and its `dim` styling shares the same
1847
+ // `valueTone: "dim"` code path in `buildPiUsereqMenuChoices` confirmed for `Show local configuration` above.
1848
+ assert.ok(
1849
+ (ctx.__state.selectCalls[0]?.items ?? []).includes("Show global configuration"),
1850
+ "Show global configuration must remain in the top-level menu item list",
1847
1851
  );
1848
1852
  assert.ok(renderedMenu.includes("notification:off • sound:none • pushover:off"));
1849
1853
  assert.ok(renderedMenu.includes("disable"));
@@ -33,6 +33,9 @@ test("prompt rendering replaces dynamic placeholders, expands commit instruction
33
33
  const config = getDefaultConfig(projectBase);
34
34
  config["src-dir"] = ["src", "scripts", ".github/workflows"];
35
35
  config["tests-dir"] = "tests";
36
+ config["context-files-requirements"] = false;
37
+ config["context-files-references"] = false;
38
+ config["context-files-workflow"] = false;
36
39
  const runtimePathFacts = buildRuntimePathFacts(
37
40
  buildRuntimePathContext(projectBase, projectBase, config),
38
41
  );
@@ -50,6 +53,9 @@ test("prompt rendering injects the bundled read-only git instruction when auto g
50
53
  const projectBase = process.cwd();
51
54
  const config = getDefaultConfig(projectBase);
52
55
  config.AUTO_GIT_COMMIT = "disable";
56
+ config["context-files-requirements"] = false;
57
+ config["context-files-references"] = false;
58
+ config["context-files-workflow"] = false;
53
59
  const rendered = renderPrompt("write", "Build a CLI parser", projectBase, config);
54
60
  assert.match(rendered, /Git Read-Only Restriction/);
55
61
  assert.doesNotMatch(rendered, /git commit -m/);