pi-usereq 0.38.0 → 0.40.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/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +377 -318
- package/pi-usereq/docs/REQUIREMENTS.md +23 -5
- package/pi-usereq/docs/WORKFLOW.md +21 -10
- package/src/core/config.ts +42 -3
- package/src/core/prompts.ts +115 -4
- package/src/index.ts +177 -8
- package/src/resources/prompts/analyze.md +22 -10
- package/src/resources/prompts/change.md +19 -8
- package/src/resources/prompts/check.md +21 -10
- package/src/resources/prompts/cover.md +19 -8
- package/src/resources/prompts/create.md +18 -8
- package/src/resources/prompts/fix.md +22 -11
- package/src/resources/prompts/flowchart.md +21 -10
- package/src/resources/prompts/implement.md +19 -8
- package/src/resources/prompts/new.md +19 -8
- package/src/resources/prompts/readme.md +20 -9
- package/src/resources/prompts/recreate.md +19 -8
- package/src/resources/prompts/refactor.md +19 -8
- package/src/resources/prompts/renumber.md +19 -8
- package/src/resources/prompts/workflow.md +19 -8
- package/src/resources/prompts/write.md +18 -8
- package/src/resources/templates/Requirements_Template.md +2 -22
- package/tests/extension-registration.test.ts +7 -3
- package/tests/prompt-rendering.test.ts +6 -0
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Write a FLOWCHART.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%%/FLOWCHART.md, when it is missing/outdated and you need to regenerate the primary runtime flowchart from evidence in %%SRC_PATHS%% and commit that doc change. Do NOT select if you will change requirements, workflow, references, source code, or tests; choose /req-change, /req-new, /req-fix, /req-refactor, /req-cover, /req-implement, /req-create, /req-recreate, /req-workflow, or /req-references as appropriate. Do NOT select for read-only analysis/audits (use /req-analyze or /req-check).
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Write a FLOWCHART.md using the project's source code
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -19,9 +12,21 @@ In scope: static analysis of source under %%SRC_PATHS%% to generate/overwrite on
|
|
|
19
12
|
- **Act as a Business Analyst** when cross-referencing code findings with `%%DOC_PATH%%/REQUIREMENTS.md` to ensure functional alignment.
|
|
20
13
|
- **Act as a Technical Writer and Expert Mermaid.js Developer** when producing the final flowchart, ensuring structurally valid Mermaid syntax and zero-hallucination mapping.
|
|
21
14
|
- **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.
|
|
15
|
+
- **Act as an Expert GitOps Engineer** when executing git workflows.
|
|
16
|
+
|
|
17
|
+
## Iteration and Context Economy
|
|
18
|
+
- **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.
|
|
19
|
+
- **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.
|
|
20
|
+
- **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.
|
|
21
|
+
- **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.
|
|
22
|
+
- **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.
|
|
23
|
+
- **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.
|
|
24
|
+
- **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.
|
|
25
|
+
- **CRITICAL**: These rules MUST govern how the agent organizes and sequences the work described in the `## Steps` section.
|
|
26
|
+
|
|
22
27
|
|
|
23
28
|
## Absolute Rules, Non-Negotiable
|
|
24
|
-
- **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.
|
|
29
|
+
- **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.
|
|
25
30
|
- **CRITICAL**: NEVER write, modify, edit, or delete files outside of the active repository directory, except under `/tmp`.
|
|
26
31
|
- You can read, write, or edit `%%DOC_PATH%%/FLOWCHART.md`.
|
|
27
32
|
- Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
|
|
@@ -137,7 +142,7 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
137
142
|
- Isolate the core program functionality and disregard secondary or tangential flows.
|
|
138
143
|
- Group non-atomic functions into logical phases with sequential alphabetical labels.
|
|
139
144
|
- Inside each phase, extract atomic operations, label them with sequential integers, and document them using strictly parameterless function prototypes.
|
|
140
|
-
- Deduce actual control flow, branching, and joins from the code analyzed in Step
|
|
145
|
+
- Deduce actual control flow, branching, and joins from the code analyzed in Step 1.
|
|
141
146
|
- **Granularity consistency rule (CRITICAL):** maintain the same abstraction level across sibling branches that originate from the same decision node. If one branch exposes internal sub-operations of a composite internal function, then every sibling branch at that same decision depth MUST expose the equivalent internal sub-operations needed for semantic comparison; conversely, if one branch remains collapsed as a composite phase, sibling branches MUST NOT mix in a lower-level expansion unless that lower-level expansion is required in all sibling branches.
|
|
142
147
|
- **Comparability rule (CRITICAL):** the flowchart MUST make branch-to-branch equivalence explicit. Do not represent one branch as a wrapper function and another branch as the wrapper’s internal steps when both branches implement the same logical stage. Expand or collapse branches so that a downstream LLM Agent can compare them without inferring hidden steps.
|
|
143
148
|
- **Mandatory-entry vs optional-effect rule (CRITICAL):** explicitly distinguish between:
|
|
@@ -164,7 +169,7 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
164
169
|
- **Skipped-work rule (CRITICAL):** represent intentionally skipped work explicitly only when the source code emits or enforces a real skip condition. Do not create an apparent skip merely by collapsing one branch more aggressively than another. Real pass-through branches MUST be rendered as explicit bypasses.
|
|
165
170
|
- **Lexical signal check (CRITICAL):** before finalizing the flowchart, cross-check `%%DOC_PATH%%/REQUIREMENTS.md` and `%%DOC_PATH%%/WORKFLOW.md` for signal terms such as `optional`, `disabled`, `pass-through`, `enable-state validation`, `when omitted`, and `disable`; when those terms correspond to an analyzed stage or helper, ensure the flowchart reflects the same optionality semantics with visible decision and bypass structure.
|
|
166
171
|
- **Normative category example (CRITICAL):** "A helper always invoked by the caller but internally bypassed by an enable/disable selector MUST be rendered as a decision region, not as an unconditional application phase."
|
|
167
|
-
- Before writing the file, perform a strict internal audit cross-referencing the generated flowchart, the runtime model from Step
|
|
172
|
+
- Before writing the file, perform a strict internal audit cross-referencing the generated flowchart, the runtime model from Step 1, the original source code, and the lexical signals found in `%%DOC_PATH%%/REQUIREMENTS.md` and `%%DOC_PATH%%/WORKFLOW.md`.
|
|
168
173
|
- The internal audit MUST explicitly verify:
|
|
169
174
|
- every decision node has sibling branches rendered at comparable semantic granularity;
|
|
170
175
|
- every optional stage with mandatory stage entry has a visible decision node;
|
|
@@ -183,3 +188,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
183
188
|
3. %%COMMIT%%
|
|
184
189
|
4. Present results
|
|
185
190
|
- 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.
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
## Context Files
|
|
194
|
+
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.
|
|
195
|
+
|
|
196
|
+
%%CONTEXT_FILES%%
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Implement source code from requirements (from scratch)"
|
|
3
|
-
argument-hint: "No arguments utilized by the prompt logic"
|
|
4
|
-
usage: >
|
|
5
|
-
Select this prompt when %%DOC_PATH%%/REQUIREMENTS.md is already authoritative and stable, but the codebase under %%SRC_PATHS%% is missing large parts of the required functionality (greenfield or major gaps) and you must build an end-to-end implementation (including creating new modules/files and tests under %%TEST_PATH%%) WITHOUT changing requirements. Do NOT select if only a small/known set of requirement IDs is uncovered in an otherwise working codebase (use /req-cover), if you need to modify or add requirements (use /req-change or /req-new), or if the task is a narrow defect fix or refactor (use /req-fix or /req-refactor). Do NOT select for auditing/triage (use /req-check or /req-analyze).
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Implement source code from requirements from scratch
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -21,10 +14,22 @@ In scope: read `%%DOC_PATH%%/REQUIREMENTS.md`, implement/introduce source under
|
|
|
21
14
|
- **Act as a Senior System Architect** when generating the **Implementation Delta** and planning the coverage strategy: ensure the new implementation integrates perfectly with the existing architecture without regressions.
|
|
22
15
|
- **Act as a Senior Software Developer** when implementing the missing logic: focus on satisfying the Requirement IDs previously marked as uncovered.
|
|
23
16
|
- **Act as a QA Engineer** during verification and testing Steps: verify compliance with zero leniency, using mandatory code evidence and strict fix loops based on static-analysis findings to ensure stability.
|
|
17
|
+
- **Act as an Expert GitOps Engineer** when executing git workflows.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Iteration and Context Economy
|
|
21
|
+
- **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.
|
|
22
|
+
- **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.
|
|
23
|
+
- **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.
|
|
24
|
+
- **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.
|
|
25
|
+
- **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.
|
|
26
|
+
- **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.
|
|
27
|
+
- **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.
|
|
28
|
+
- **CRITICAL**: These rules MUST govern how the agent organizes and sequences the work described in the `## Steps` section.
|
|
24
29
|
|
|
25
30
|
|
|
26
31
|
## Absolute Rules, Non-Negotiable
|
|
27
|
-
- **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.
|
|
32
|
+
- **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.
|
|
28
33
|
- **CRITICAL**: NEVER write, modify, edit, or delete files outside of the active repository directory, except under `/tmp`.
|
|
29
34
|
- You MUST read `%%DOC_PATH%%/REQUIREMENTS.md`, but you MUST NOT modify it in this workflow.
|
|
30
35
|
- Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
|
|
@@ -125,3 +130,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
125
130
|
6. %%COMMIT%%
|
|
126
131
|
7. Present results
|
|
127
132
|
- 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.
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## Context Files
|
|
136
|
+
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.
|
|
137
|
+
|
|
138
|
+
%%CONTEXT_FILES%%
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Implement a new requirement and make the corresponding source code changes"
|
|
3
|
-
argument-hint: "Description of the new requirement/feature to implement"
|
|
4
|
-
usage: >
|
|
5
|
-
Select this prompt if and only if the work is a strictly additive, backwards-compatible feature, you will append new requirement IDs to %%DOC_PATH%%/REQUIREMENTS.md (no edits/removals of existing IDs), then implement and verify the corresponding code/tests under %%SRC_PATHS%% and %%TEST_PATH%% with traceability, and update %%DOC_PATH%%/WORKFLOW.md and %%DOC_PATH%%/REFERENCES.md. Do NOT select if any existing requirement must be modified/removed, or if breaking changes/migrations are needed (use /req-change). Do NOT select if requirements must remain unchanged (use /req-fix, /req-refactor, /req-cover, /req-implement) or for read-only analysis/audits (use /req-analyze or /req-check).
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Implement a new requirement and make the corresponding source code changes
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -20,10 +13,22 @@ In scope: patch-style updates to `%%DOC_PATH%%/REQUIREMENTS.md` that add the new
|
|
|
20
13
|
- **Act as a Senior System Architect** when generating the **Implementation Delta**: translate requirements into a robust, modular, and non-breaking technical implementation plan.
|
|
21
14
|
- **Act as a Senior Software Developer** during implementation: implement the planned changes with high-quality, idiomatic code that maps strictly to Requirement IDs.
|
|
22
15
|
- **Act as a QA Engineer** during verification and testing: verify compliance with zero leniency, using mandatory code evidence and strict fix loops based on static-analysis findings to ensure stability.
|
|
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%%/REQUIREMENTS.md`.
|
|
29
34
|
- Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
|
|
@@ -186,3 +191,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
186
191
|
|
|
187
192
|
<h2 id="users-request">User's Request</h2>
|
|
188
193
|
%%ARGS%%
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
## Context Files
|
|
197
|
+
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.
|
|
198
|
+
|
|
199
|
+
%%CONTEXT_FILES%%
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Write README.md from user-visible implementation evidence"
|
|
3
|
-
argument-hint: "Description of additional edits to perform on README.md file"
|
|
4
|
-
usage: >
|
|
5
|
-
Select this prompt ONLY for docs-maintenance of root README.md, when user-visible behavior changed and you must align README with current implementation evidence. Analyze externally visible surfaces only (features, CLI parameters, GUI behavior, distributed APIs, configuration schema), identify affected README sections before editing, and update only those sections while preserving unrelated content/format. Do NOT include internal implementation logic. Do NOT select if requirements, workflow, references, source code, or tests must change.
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Write README.md from user-visible implementation evidence
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -20,10 +13,22 @@ In scope: static analysis of user-visible behavior from %%SRC_PATHS%% and relate
|
|
|
20
13
|
- **Act as a Business Analyst** when mapping implementation behavior to user outcomes and usage expectations.
|
|
21
14
|
- **Act as a Senior Technical Writer** when producing the final README text as concise, user-centric guidance for first-time readers.
|
|
22
15
|
- **Act as a QA Auditor** when reporting facts, requiring concrete evidence (file paths, line numbers) for every user-visible claim.
|
|
16
|
+
- **Act as an Expert GitOps Engineer** for isolated worktree and merge flow.
|
|
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 `README.md`.
|
|
29
34
|
- Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
|
|
@@ -131,7 +136,7 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
131
136
|
- Use repository evidence only; for each finding, collect file paths and line ranges.
|
|
132
137
|
- Derive a compact "README coverage list" of user-visible behavior that MUST appear in root `README.md`.
|
|
133
138
|
2. Validate and update root `README.md`
|
|
134
|
-
- Read the current root `README.md` and compare it with the README coverage list from Step
|
|
139
|
+
- Read the current root `README.md` and compare it with the README coverage list from Step 1.
|
|
135
140
|
- Identify and list the exact `README.md` sections impacted by the detected user-visible implementation changes and explicit additional edits from [User Request](#users-request) before editing.
|
|
136
141
|
- Update only the identified sections so `README.md` reflects the current externally visible behavior and usage flows.
|
|
137
142
|
- Keep all non-analysis documentary sections unchanged (e.g., headers, versioning, context/scope narratives, motivations, related projects, high-level graphics/descriptions not tied to interface behavior).
|
|
@@ -144,3 +149,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
144
149
|
|
|
145
150
|
<h2 id="users-request">User's Request</h2>
|
|
146
151
|
%%ARGS%%
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## Context Files
|
|
155
|
+
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.
|
|
156
|
+
|
|
157
|
+
%%CONTEXT_FILES%%
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Reorganize and update the Software Requirements Specification based on source code analysis (preserve requirement IDs)"
|
|
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 but must be rebuilt into a clean structure based on evidence from code under %%SRC_PATHS%%, while preserving all existing requirement IDs (no renumbering). Requirements may be reorganized, moved, grouped, and clarified, and new requirements may be added only with NEW non-colliding IDs appended beyond the existing ID space. Output is only the rewritten SRS (English); source code, tests, %%DOC_PATH%%/WORKFLOW.md, and %%DOC_PATH%%/REFERENCES.md must not change. Do NOT select for incremental requirement edits or behavior changes (use /req-change or /req-new), for drafting SRS from user request only (use /req-write), or for implementation/fixing/refactoring work (use /req-fix, /req-refactor, /req-cover, /req-implement).
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Reorganize and update the Software Requirements Specification draft based on source code analysis
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -19,10 +12,22 @@ In scope: static analysis of source under %%SRC_PATHS%% (and targeted tests only
|
|
|
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.
|
|
@@ -180,3 +185,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
180
185
|
3. %%COMMIT%%
|
|
181
186
|
4. Present results
|
|
182
187
|
- 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.
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## Context Files
|
|
191
|
+
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.
|
|
192
|
+
|
|
193
|
+
%%CONTEXT_FILES%%
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Perform a refactor without changing the requirements"
|
|
3
|
-
argument-hint: "Description of the refactor goal"
|
|
4
|
-
usage: >
|
|
5
|
-
Select this prompt when the primary intent is internal code improvement under %%SRC_PATHS%% (maintainability/structure/performance) and externally observable behavior must remain unchanged and compliant with %%DOC_PATH%%/REQUIREMENTS.md (SRS stays unchanged). Use when you will restructure internals, keep public interfaces/data formats stable, verify via the `static-check` tool and conditional execution of existing unit tests using language-specific test-suite priority policy, update %%DOC_PATH%%/WORKFLOW.md and %%DOC_PATH%%/REFERENCES.md, and commit. Do NOT select if the user’s goal is to fix incorrect behavior relative to requirements (use /req-fix), to add/modify requirements/behavior (use /req-new or /req-change), or to close uncovered requirement IDs (use /req-cover or /req-implement). Do NOT select for read-only audits/triage (use /req-check or /req-analyze).
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Perform a refactor without changing the requirements
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -20,10 +13,22 @@ In scope: internal refactors under %%SRC_PATHS%% (including private API reshapin
|
|
|
20
13
|
- **Act as a Business Analyst** when reading `%%DOC_PATH%%/REQUIREMENTS.md` to ensure that fixes or refactors never violate or change existing documented behaviors.
|
|
21
14
|
- **Act as a QA Automation Engineer** when validating the fix/refactor: ensure that static-analysis results are clean (or no-source positive) and no regressions in documented behavior are introduced.
|
|
22
15
|
- **Act as an Expert Debugger** only if tests fail or a defect emerges during refactor.
|
|
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 MUST read `%%DOC_PATH%%/REQUIREMENTS.md`, but you MUST NOT modify it in this workflow.
|
|
29
34
|
- Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
|
|
@@ -173,3 +178,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
173
178
|
|
|
174
179
|
<h2 id="users-request">User's Request</h2>
|
|
175
180
|
%%ARGS%%
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
## Context Files
|
|
184
|
+
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.
|
|
185
|
+
|
|
186
|
+
%%CONTEXT_FILES%%
|
|
@@ -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
|
-
-
|
|
39
|
-
- Do NOT
|
|
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
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
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/);
|