pi-usereq 0.37.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.
- package/CHANGELOG.md +23 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +358 -311
- package/pi-usereq/docs/REQUIREMENTS.md +17 -5
- package/pi-usereq/docs/WORKFLOW.md +14 -5
- package/src/core/config.ts +42 -3
- package/src/core/prompts.ts +47 -4
- package/src/index.ts +132 -4
- package/src/resources/guidelines/Google_TypeScript_Style_Guide.md +2954 -0
- package/src/resources/guidelines/RFC2119.md +127 -0
- 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
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
Network Working Group - Request for Comments: 2119 - BCP: 14
|
|
2
|
+
|
|
3
|
+
S. Bradner - Harvard University - March 1997
|
|
4
|
+
|
|
5
|
+
Category: Best Current Practice Key words for use in RFCs to Indicate Requirement Levels Status of this Memo
|
|
6
|
+
|
|
7
|
+
This document specifies an Internet Best Current Practices for the
|
|
8
|
+
Internet Community, and requests discussion and suggestions for
|
|
9
|
+
improvements. Distribution of this memo is unlimited.
|
|
10
|
+
|
|
11
|
+
Abstract
|
|
12
|
+
|
|
13
|
+
In many standards track documents several words are used to signify
|
|
14
|
+
the requirements in the specification. These words are often
|
|
15
|
+
capitalized. This document defines these words as they should be
|
|
16
|
+
interpreted in IETF documents. Authors who follow these guidelines
|
|
17
|
+
should incorporate this phrase near the beginning of their document:
|
|
18
|
+
|
|
19
|
+
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
|
|
20
|
+
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
|
|
21
|
+
"OPTIONAL" in this document are to be interpreted as described in` [`RFC 2119`](rfc2119) `.
|
|
22
|
+
|
|
23
|
+
Note that the force of these words is modified by the requirement
|
|
24
|
+
level of the document in which they are used.` [`1`](#section-1) `.
|
|
25
|
+
|
|
26
|
+
MUST This word, or the terms "REQUIRED" or "SHALL", mean that the
|
|
27
|
+
definition is an absolute requirement of the specification.` [`2`](#section-2) `.
|
|
28
|
+
|
|
29
|
+
MUST NOT This phrase, or the phrase "SHALL NOT", mean that the
|
|
30
|
+
definition is an absolute prohibition of the specification.` [`3`](#section-3) `.
|
|
31
|
+
|
|
32
|
+
SHOULD This word, or the adjective "RECOMMENDED", mean that there
|
|
33
|
+
may exist valid reasons in particular circumstances to ignore a
|
|
34
|
+
particular item, but the full implications must be understood and
|
|
35
|
+
carefully weighed before choosing a different course.` [`4`](#section-4) `.
|
|
36
|
+
|
|
37
|
+
SHOULD NOT This phrase, or the phrase "NOT RECOMMENDED" mean that
|
|
38
|
+
there may exist valid reasons in particular circumstances when the
|
|
39
|
+
particular behavior is acceptable or even useful, but the full
|
|
40
|
+
implications should be understood and the case carefully weighed
|
|
41
|
+
before implementing any behavior described with this label.
|
|
42
|
+
|
|
43
|
+
MAY This word, or the adjective "OPTIONAL", mean that an item is
|
|
44
|
+
truly optional. One vendor may choose to include the item because a
|
|
45
|
+
particular marketplace requires it or because the vendor feels that
|
|
46
|
+
it enhances the product while another vendor may omit the same item.
|
|
47
|
+
An implementation which does not include a particular option MUST be
|
|
48
|
+
prepared to interoperate with another implementation which does
|
|
49
|
+
include the option, though perhaps with reduced functionality. In the
|
|
50
|
+
same vein an implementation which does include a particular option
|
|
51
|
+
MUST be prepared to interoperate with another implementation which
|
|
52
|
+
does not include the option (except, of course, for the feature the
|
|
53
|
+
option provides.)` [`6`](#section-6) `.
|
|
54
|
+
|
|
55
|
+
Guidance in the use of these Imperatives Imperatives of the type defined in this memo must be used with care
|
|
56
|
+
and sparingly. In particular, they MUST only be used where it is
|
|
57
|
+
actually required for interoperation or to limit behavior which has
|
|
58
|
+
potential for causing harm (e.g., limiting retransmisssions) For
|
|
59
|
+
example, they must not be used to try to impose a particular method
|
|
60
|
+
on implementors where the method is not required for
|
|
61
|
+
interoperability.` [`7`](#section-7) `.
|
|
62
|
+
|
|
63
|
+
Security Considerations These terms are frequently used to specify behavior with security
|
|
64
|
+
implications. The effects on security of not implementing a MUST or
|
|
65
|
+
SHOULD, or doing something the specification says MUST NOT or SHOULD
|
|
66
|
+
NOT be done may be very subtle.
|
|
67
|
+
|
|
68
|
+
Document authors should take the time
|
|
69
|
+
to elaborate the security implications of not following
|
|
70
|
+
recommendations or requirements as most implementors will not have
|
|
71
|
+
had the benefit of the experience and discussion that produced the
|
|
72
|
+
specification.` [`8`](#section-8) `.
|
|
73
|
+
|
|
74
|
+
Acknowledgments The definitions of these terms are an amalgam of definitions taken
|
|
75
|
+
from a number of RFCs. In addition, suggestions have been
|
|
76
|
+
incorporated from a number of people including Robert Ullmann, Thomas
|
|
77
|
+
Narten, Neal McBurnett, and Robert Elz.
|
|
78
|
+
|
|
79
|
+
Author's Address Scott Bradner
|
|
80
|
+
Harvard University
|
|
81
|
+
1350 Mass. Ave.
|
|
82
|
+
Cambridge, MA 02138
|
|
83
|
+
|
|
84
|
+
phone - +1 617 495 3864
|
|
85
|
+
email - sob@harvard.edu
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
Bradner Best Current Practice [Page 3]`
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Produce an analysis report"
|
|
3
|
-
argument-hint: "Description of the analysis/investigation to perform"
|
|
4
|
-
usage: >
|
|
5
|
-
Select this prompt if you need a read-only, evidence-backed investigation/triage of the current state (SRS in %%DOC_PATH%%/REQUIREMENTS.md, runtime model in %%DOC_PATH%%/WORKFLOW.md, references in %%DOC_PATH%%/REFERENCES.md, and code under %%SRC_PATHS%%) to answer a question or decide which follow-up workflow to run. Use when you must NOT change any files and the deliverable is an analysis report with concrete evidence pointers. Do NOT select if you must, (a) produce an OK/FAIL verdict for every requirement ID (use /req-check), (b) modify requirements (use /req-new or /req-change), (c) implement code/tests (use /req-fix, /req-refactor, /req-cover, /req-implement), or (d) regenerate only WORKFLOW/REFERENCES docs (use /req-workflow or /req-references).
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Produce an analysis report
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -23,19 +16,32 @@ In scope: read-only analysis of the above documents plus source under %%SRC_PATH
|
|
|
23
16
|
- **Act as an Expert Debugger** when you identify a failure symptom with concrete evidence (failure evidence, stack trace, reproducible output). Only explain the root cause, not propose or implement fixes.
|
|
24
17
|
|
|
25
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.
|
|
28
|
+
|
|
29
|
+
|
|
26
30
|
## 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.
|
|
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.
|
|
28
32
|
- **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).
|
|
29
33
|
- You MUST read `%%DOC_PATH%%/REQUIREMENTS.md`, but you MUST NOT modify it in this workflow.
|
|
30
34
|
- Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
|
|
31
35
|
- **CRITICAL**: Do not modify any git tracked files (i.e., returned by `git ls-files`). You may run commands that create untracked artifacts ONLY if: (a) they are confined to standard disposable locations (e.g., `tmp/`, `temp/`, `.cache/`, `.pytest_cache/`, `node_modules/.cache`, `/tmp`), (b) they do not change any tracked file contents, and (c) you do NOT rely on those artifacts as permanent outputs. If unsure, run tools in a temporary directory (e.g., `tmp/`, `temp/`, `/tmp`) or use tool flags that disable caches.
|
|
32
|
-
|
|
36
|
+
**CRITICAL**: Git Read-Only Restriction
|
|
37
|
+
- Only read-only access to the git repository is allowed. You may inspect files, history, diffs, status, and other repository metadata, but you MUST NOT execute any command or action that modifies the repository state, the index, refs, history, branches, tags, remotes, or the .git directory. Any repository write or state-changing action is forbidden.
|
|
38
|
+
- Allowed git commands in this workflow (read-only only): `git status`, `git diff`, `git ls-files`, `grep`, `git rev-parse`, `git branch --show-current`. Do NOT run any other git commands.
|
|
33
39
|
|
|
34
40
|
## Behavior
|
|
35
41
|
- Only analyze the code and present the results; make no changes.
|
|
36
42
|
- Do NOT create or modify tests in this workflow.
|
|
37
43
|
- Report facts: for each finding include file paths and, when useful, line numbers or short code excerpts.
|
|
38
|
-
- Allowed git commands in this workflow (read-only only): `git status`, `git diff`, `git ls-files`, `grep`, `git rev-parse`, `git branch --show-current`. Do NOT run any other git commands.
|
|
44
|
+
- Allowed git commands in this workflow (read-only only): `git status`, `git diff`, `git ls-files`, `git grep`, `git rev-parse`, `git branch --show-current`. Do NOT run any other git commands.
|
|
39
45
|
- If `.venv/bin/python` exists in the project root, use it for Python executions (eg, `PYTHONPATH=src .venv/bin/python -m <program name>`).
|
|
40
46
|
- Non-Python tooling should use the project's standard commands.
|
|
41
47
|
- Use filesystem/shell tools to read files as needed (read-only only; e.g., `cat`, `sed -n`, `head`, `tail`, `rg`, `less`). Do NOT use in-place editing flags (e.g., `-i`, `perl -pi`) in this workflow.
|
|
@@ -127,3 +133,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
127
133
|
|
|
128
134
|
<h2 id="users-request">User's Request</h2>
|
|
129
135
|
%%ARGS%%
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## Context Files
|
|
139
|
+
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.
|
|
140
|
+
|
|
141
|
+
%%CONTEXT_FILES%%
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Update the requirements and implement the corresponding changes"
|
|
3
|
-
argument-hint: "Description of the requirements changes to implement"
|
|
4
|
-
usage: >
|
|
5
|
-
Select this prompt if and only if the request requires changing existing requirements/behavior, you must edit/replace/remove existing requirement IDs in %%DOC_PATH%%/REQUIREMENTS.md (not just append), then implement the corresponding code/tests under %%SRC_PATHS%% and %%TEST_PATH%% with verification and traceability, and update %%DOC_PATH%%/WORKFLOW.md and %%DOC_PATH%%/REFERENCES.md. Do NOT select if the SRS must remain unchanged (use /req-fix, /req-refactor, /req-cover, or /req-implement). Do NOT select if the change is strictly additive/backwards-compatible and can be expressed only by appending new requirement IDs (use /req-new). Do NOT select for read-only auditing/triage (use /req-check or /req-analyze) or docs-only maintenance (use /req-workflow or /req-references).
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Update the requirements and implement the corresponding changes
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -20,10 +13,22 @@ In scope: patch-style edits to `%%DOC_PATH%%/REQUIREMENTS.md`, an implementation
|
|
|
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.
|
|
@@ -187,3 +192,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
187
192
|
|
|
188
193
|
<h2 id="users-request">User's Request</h2>
|
|
189
194
|
%%ARGS%%
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
## Context Files
|
|
198
|
+
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.
|
|
199
|
+
|
|
200
|
+
%%CONTEXT_FILES%%
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Run the requirements check"
|
|
3
|
-
argument-hint: "Optional, context to focus the audit (can be empty)"
|
|
4
|
-
usage: >
|
|
5
|
-
Select this prompt if you need a complete, repository-read-only compliance audit that outputs an OK/FAIL verdict for EVERY requirement ID in %%DOC_PATH%%/REQUIREMENTS.md, backed by concrete code evidence and static-analysis evidence. Use after requirements/code changes to measure coverage and to produce a gap list + implementation-only technical report when FAILs exist. Do NOT select if you will modify any files (requirements/code/docs) or implement fixes; downstream implementation should be done via /req-cover (small set of uncovered IDs), /req-implement (large/greenfield gaps), /req-fix, /req-refactor, /req-new, or /req-change depending on intent.
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Run the requirements check
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -22,14 +15,26 @@ In scope: read `%%DOC_PATH%%/REQUIREMENTS.md` (and related docs), run static-ana
|
|
|
22
15
|
- **Act as a QA Auditor** when reporting facts, requiring concrete evidence (file paths, line numbers) for every finding.
|
|
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 MUST read `%%DOC_PATH%%/REQUIREMENTS.md`, but you MUST NOT modify it in this workflow.
|
|
29
33
|
- Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
|
|
30
34
|
- **CRITICAL**: Do not modify any git tracked files (i.e., returned by `git ls-files`). You may run commands that create untracked artifacts ONLY if: (a) they are confined to standard disposable locations (e.g., `tmp/`, `temp/`, `.cache/`, `.pytest_cache/`, `node_modules/.cache`, `/tmp`), (b) they do not change any tracked file contents, and (c) you do NOT rely on those artifacts as permanent outputs. If unsure, run tools in a temporary directory (e.g., `tmp/`, `temp/`, `/tmp`) or use tool flags that disable caches.
|
|
31
|
-
|
|
32
|
-
-
|
|
35
|
+
**CRITICAL**: Git Read-Only Restriction
|
|
36
|
+
- Only read-only access to the git repository is allowed. You may inspect files, history, diffs, status, and other repository metadata, but you MUST NOT execute any command or action that modifies the repository state, the index, refs, history, branches, tags, remotes, or the .git directory. Any repository write or state-changing action is forbidden.
|
|
37
|
+
- Allowed git commands in this workflow (read-only only): `git status`, `git diff`, `git ls-files`, `grep`, `git rev-parse`, `git branch --show-current`. Do NOT run any other git commands.
|
|
33
38
|
|
|
34
39
|
## Behavior
|
|
35
40
|
- Only analyze the code and static-analysis execution results and present the results; make no changes.
|
|
@@ -135,3 +140,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
135
140
|
|
|
136
141
|
<h2 id="users-request">User's Request</h2>
|
|
137
142
|
%%ARGS%%
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
## Context Files
|
|
146
|
+
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.
|
|
147
|
+
|
|
148
|
+
%%CONTEXT_FILES%%
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Implement minimal changes to cover uncovered existing requirements"
|
|
3
|
-
argument-hint: "Optional, context to focus coverage work (can be empty)"
|
|
4
|
-
usage: >
|
|
5
|
-
Select this prompt when specific uncovered requirement IDs already exist (typically identified by /req-check) and the goal is to implement the minimal deltas needed to satisfy those IDs WITHOUT changing %%DOC_PATH%%/REQUIREMENTS.md. Use for targeted gap-closure in an otherwise existing codebase (small/known missing surface), including adding/adjusting tests under %%TEST_PATH%%, verifying, updating %%DOC_PATH%%/WORKFLOW.md and %%DOC_PATH%%/REFERENCES.md, and committing. Do NOT select if you must change or add requirements (use /req-change or /req-new), if the request is primarily a defect fix relative to already-covered requirements (use /req-fix), or if the implementation is largely absent and needs end-to-end build-out from the SRS (use /req-implement).
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Implement minimal changes to cover uncovered existing requirements
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -21,10 +14,22 @@ In scope: identify uncovered requirement IDs, implement minimal code changes und
|
|
|
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.
|
|
@@ -179,3 +184,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
179
184
|
|
|
180
185
|
<h2 id="users-request">User's Request</h2>
|
|
181
186
|
%%ARGS%%
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
## Context Files
|
|
190
|
+
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.
|
|
191
|
+
|
|
192
|
+
%%CONTEXT_FILES%%
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Write a Software Requirements Specification using the project's source code"
|
|
3
|
-
argument-hint: "No arguments utilized by the prompt logic (English only)"
|
|
4
|
-
usage: >
|
|
5
|
-
Select this prompt when an implementation already exists under %%SRC_PATHS%% but %%DOC_PATH%%/REQUIREMENTS.md is missing or incomplete, and you need to bootstrap/update the SRS to reflect the code’s true current behavior (with evidence) BEFORE any SRS-driven change work. Output is only an updated SRS; source code, tests, %%DOC_PATH%%/WORKFLOW.md, and %%DOC_PATH%%/REFERENCES.md must remain unchanged. Do NOT select if you must draft the SRS from a user description without relying on code (use /req-write), if you must reorganize/renumber an existing SRS with an explicit old→new ID mapping (use /req-recreate), or if you intend to implement/fix/refactor anything (use /req-change, /req-new, /req-fix, /req-refactor, /req-cover, /req-implement).
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Write a Software Requirements Specification using the project's source code
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -21,8 +14,19 @@ In scope: static analysis of source under %%SRC_PATHS%% (and targeted tests only
|
|
|
21
14
|
- **Act as a Business Analyst** when verifying the "True State": ensure the draft accurately reflects implemented logic, including limitations or bugs.
|
|
22
15
|
|
|
23
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
|
+
|
|
27
|
+
|
|
24
28
|
## 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.
|
|
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.
|
|
26
30
|
- **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).
|
|
27
31
|
- You can read, write, or edit `%%DOC_PATH%%/REQUIREMENTS.md`.
|
|
28
32
|
- Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
|
|
@@ -103,3 +107,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
103
107
|
3. %%COMMIT%%
|
|
104
108
|
4. Present results
|
|
105
109
|
- 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.
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
## Context Files
|
|
113
|
+
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.
|
|
114
|
+
|
|
115
|
+
%%CONTEXT_FILES%%
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Fix a defect without changing the requirements"
|
|
3
|
-
argument-hint: "Description of the defect/bug to fix"
|
|
4
|
-
usage: >
|
|
5
|
-
Select this prompt when behavior is wrong relative to already-existing requirement IDs in %%DOC_PATH%%/REQUIREMENTS.md (a defect), and the intent is to restore compliance without changing the SRS. Use a test-first evidence-oriented flow when relevant unit-test suites exist, analyze defect -> create one failing reproducer unit test -> implement the smallest safe fix -> verify reproducer success with requirement evidence, static analysis, and conditional execution of existing unit tests via language-specific test-suite priority policy. Then update %%DOC_PATH%%/WORKFLOW.md and %%DOC_PATH%%/REFERENCES.md, and commit. Do NOT select if the requested outcome changes requirements/behavior (use /req-change or /req-new), if the goal is structural/performance improvement with no behavioral change (use /req-refactor), or if the primary task is satisfying a set of uncovered requirement IDs (use /req-cover or /req-implement).
|
|
6
|
-
---
|
|
7
|
-
|
|
8
1
|
# Fix a defect without changing the requirements
|
|
9
2
|
|
|
10
3
|
## Purpose
|
|
@@ -20,10 +13,22 @@ In scope: reproduce/triage the defect with concrete evidence and prefer an evide
|
|
|
20
13
|
- **Act as a Senior Software Developer** when implementing a defect fix: apply the smallest safe change that restores required behavior while preserving public interfaces.
|
|
21
14
|
- **Act as a Business Analyst** when reading `%%DOC_PATH%%/REQUIREMENTS.md` to ensure that fixes or refactors never violate or change existing documented behaviors.
|
|
22
15
|
- **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.
|
|
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.
|
|
@@ -130,7 +135,7 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
130
135
|
- **CRITICAL**: All tests MUST implement these instructions: `%%TEMPLATE_PATH%%/HDT_Test_Authoring_Guide.md`.
|
|
131
136
|
- Read %%GUIDELINES_FILES%% files and apply those **guidelines**; ensure the proposed code changes conform to those **guidelines**, and adjust the **Implementation Delta** if needed. Do not apply unrelated **guidelines**.
|
|
132
137
|
- A change is allowed ONLY if it corrects behavior that is: (a) explicitly required by `%%DOC_PATH%%/REQUIREMENTS.md` (cite requirement ID/section) OR (b) a defect with concrete evidence (crash, security flaw, data corruption, failure evidence, or incorrect output that contradicts a specific documented behavior). If the request implies new requirements or changing documented behavior, recommend `/req-new` or `/req-change`; before terminating, OUTPUT a Markdown table with exactly three columns in this order: `Requirement ID`, `Conflicting Excerpt`, `Conflict Reason + Interrupted Implementation Intent`; each row MUST map one conflicting requirement to the implementation-contrast rationale and intended interrupted modification; then OUTPUT exactly "ERROR: Defect fix failed due to incompatible requirements!", and then terminate the execution.
|
|
133
|
-
- Preferred execution order for Step
|
|
138
|
+
- Preferred execution order for Step 1 when relevant suites exist: analyze and identify defect -> create one failing reproducer unit test -> design and implement source fix -> verify reproducer and full selected suites.
|
|
134
139
|
- IMPLEMENT the **Implementation Delta** in the source code (creating new files/directories if necessary). You may make minimal mechanical adjustments needed to fit the actual codebase (file paths, symbol names), but you MUST NOT add new features or scope beyond the **Implementation Delta**.
|
|
135
140
|
2. Generate **Verification Delta** by verifying static-analysis results and implementing needed bug fixes
|
|
136
141
|
- Read `%%DOC_PATH%%/REQUIREMENTS.md` and cross-reference with the source code from %%SRC_PATHS%%, %%TEST_PATH%% to check ALL requirements, but use progressive disclosure: provide full evidence only for `FAIL` items and a compact pointer-only index for `OK` items. For each requirement, prefer the `search` and `files-search` tools to locate named symbols, declarations, constructs, and already-known files used as evidence. Use `rg` / `grep` only for supplementary free-text/body-content searches, fallback cases that construct extraction cannot express, or confirmation inside already targeted files. Read only the identified files to verify compliance and do not assume compliance without locating the specific code implementation.
|
|
@@ -140,9 +145,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
140
145
|
- Perform a static analysis check by executing the `static-check` tool.
|
|
141
146
|
- Review the produced output and fix every reported issue in source code.
|
|
142
147
|
- Re-run the `static-check` tool until it produces no issues. If output is exactly `Error: no source files found in configured directories.`, treat it as successful no-source completion and continue without retries.
|
|
143
|
-
- If relevant unit tests already exist in the repository, run them during verification using language-specific test-suite priority policy: project-defined test command first, language-default unit-test command second; if a reproducer unit test was created in Step
|
|
148
|
+
- If relevant unit tests already exist in the repository, run them during verification using language-specific test-suite priority policy: project-defined test command first, language-default unit-test command second; if a reproducer unit test was created in Step 1, require explicit evidence that it now passes; if no relevant tests exist, record test execution as N/A and continue.
|
|
144
149
|
- Verify that the implemented changes satisfy requirements evidence, static-analysis output, and unit-test outputs when tests are executed.
|
|
145
|
-
- For Step
|
|
150
|
+
- For Step 1, include before/after evidence that links the observed defect to the applied source fix.
|
|
146
151
|
- Provide explicit concrete verification evidence that the defect is resolved, using requirement evidence and static-analysis output.
|
|
147
152
|
- If static analysis reports issues or executed unit tests fail, analyze whether they are caused by source defects or requirement-implementation mismatch. Assume requirement evidence is authoritative; when static analysis reports issues, fix source code unless requirements explicitly justify alternative handling.
|
|
148
153
|
- Fix the source code to resolve valid verification findings autonomously without asking for user intervention. Execute a strict fix loop: 1) analyze static-check output and unit-test failures (when tests ran), 2) determine root cause from evidence, 3) fix code, 4) re-run the `static-check` tool and re-run the selected unit-test suites when applicable. Repeat up to 2 times. If static analysis still reports issues after the second attempt, report the failure, OUTPUT exactly "ERROR: Defect fix failed due to inability to complete static analysis!", and then terminate the execution.
|
|
@@ -181,3 +186,9 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
181
186
|
|
|
182
187
|
<h2 id="users-request">User's Request</h2>
|
|
183
188
|
%%ARGS%%
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
## Context Files
|
|
192
|
+
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.
|
|
193
|
+
|
|
194
|
+
%%CONTEXT_FILES%%
|
|
@@ -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%%
|