pi-usereq 0.62.0 → 0.64.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/README.md +1 -1
- package/package.json +1 -1
- package/scripts/pi-prompts-update.sh +240 -0
- package/src/core/prompts.ts +18 -6
- package/src/resources/prompts/analyze.md +12 -3
- package/src/resources/prompts/readme.md +6 -3
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# @file scripts/pi-prompts-update.sh
|
|
3
|
+
# @brief Updates bundled PI-useReq prompt resources from the latest PI-Prompts release.
|
|
4
|
+
# @details Clones the PI-Prompts repository (master branch), resolves the newest
|
|
5
|
+
# release ref, and performs a full one-way synchronization of the upstream
|
|
6
|
+
# `src/instructions`, `src/prompts`, and `src/templates` directories into the
|
|
7
|
+
# local `src/resources/instructions`, `src/resources/prompts`, and
|
|
8
|
+
# `src/resources/templates` targets. Full synchronization overwrites every
|
|
9
|
+
# present file and removes every file that no longer exists upstream by
|
|
10
|
+
# replacing each target directory with a freshly staged copy. Upstream file
|
|
11
|
+
# access and modification timestamps are preserved through `cp -p`.
|
|
12
|
+
# Runtime is dominated by one git clone plus one ref checkout and per-file
|
|
13
|
+
# copies. Side effects include temporary-directory creation, git
|
|
14
|
+
# subprocesses, one optional GitHub Releases API request, and replacement of
|
|
15
|
+
# the three target resource directories. No other repository content is
|
|
16
|
+
# modified.
|
|
17
|
+
# @satisfies DES-022, REQ-379, REQ-380, REQ-381, REQ-382, REQ-383, REQ-384
|
|
18
|
+
|
|
19
|
+
set -euo pipefail
|
|
20
|
+
|
|
21
|
+
PROMPTS_REPO_URL_PRIMARY="https://github.com/Ogekuri/PI-Prompts.git"
|
|
22
|
+
PROMPTS_REPO_URL_FALLBACK="https://github.com/Ogekuri/PI-Prompts"
|
|
23
|
+
PROMPTS_RELEASE_API_URL="https://api.github.com/repos/Ogekuri/PI-Prompts/releases/latest"
|
|
24
|
+
PROMPTS_BRANCH="master"
|
|
25
|
+
|
|
26
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
27
|
+
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
28
|
+
TARGET_ROOT="${REPO_ROOT}/src/resources"
|
|
29
|
+
|
|
30
|
+
## @brief Stores the ordered `upstream-relative:target-relative` synchronization pairs.
|
|
31
|
+
## @details Each entry maps one upstream repository directory to one bundled
|
|
32
|
+
## `src/resources` target directory synchronized in declaration order. The
|
|
33
|
+
## constant is immutable at runtime and costs O(1) per element access.
|
|
34
|
+
SYNC_SPECS=(
|
|
35
|
+
"src/instructions:src/resources/instructions"
|
|
36
|
+
"src/prompts:src/resources/prompts"
|
|
37
|
+
"src/templates:src/resources/templates"
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
WORK_DIR=""
|
|
41
|
+
STAGING_DIR=""
|
|
42
|
+
|
|
43
|
+
## @brief Writes one progress message to stdout.
|
|
44
|
+
## @details Emits the supplied message fragments joined by single spaces followed
|
|
45
|
+
## by one newline. Runtime is O(n) in message length. Side effect: writes to
|
|
46
|
+
## `stdout`.
|
|
47
|
+
## @param[in] ... {string} Progress message fragments.
|
|
48
|
+
## @return {void} No return value.
|
|
49
|
+
log() {
|
|
50
|
+
printf '%s\n' "$*"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
## @brief Aborts the updater with one deterministic diagnostic.
|
|
54
|
+
## @details Writes the supplied diagnostic prefixed with `ERROR: ` to `stderr`
|
|
55
|
+
## and terminates the process with exit code `1`. Runtime is O(n) in message
|
|
56
|
+
## length. Side effects include `stderr` output and process exit; the `EXIT`
|
|
57
|
+
## trap still removes updater temporary directories.
|
|
58
|
+
## @param[in] message {string} Failure diagnostic.
|
|
59
|
+
## @return {never} Never returns.
|
|
60
|
+
fail() {
|
|
61
|
+
printf 'ERROR: %s\n' "$*" >&2
|
|
62
|
+
exit 1
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
## @brief Removes updater temporary directories.
|
|
66
|
+
## @details Deletes the cloned upstream working tree and any pending staging
|
|
67
|
+
## directory registered in `WORK_DIR` plus `STAGING_DIR`. Invoked through the
|
|
68
|
+
## `EXIT` trap on every exit path. Runtime is O(1) plus filesystem removal
|
|
69
|
+
## cost. Side effects include directory removal.
|
|
70
|
+
## @return {void} No return value.
|
|
71
|
+
cleanup() {
|
|
72
|
+
if [ -n "${STAGING_DIR}" ]; then
|
|
73
|
+
rm -rf "${STAGING_DIR}"
|
|
74
|
+
fi
|
|
75
|
+
if [ -n "${WORK_DIR}" ]; then
|
|
76
|
+
rm -rf "${WORK_DIR}"
|
|
77
|
+
fi
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
## @brief Verifies that one required external tool is available.
|
|
81
|
+
## @details Probes the executable search path for the requested tool name and
|
|
82
|
+
## aborts through `fail(...)` when the probe fails. Runtime is O(1) plus one
|
|
83
|
+
## `PATH` lookup. No external state is mutated.
|
|
84
|
+
## @param[in] tool {string} Executable name to probe.
|
|
85
|
+
## @return {void} No return value.
|
|
86
|
+
require_tool() {
|
|
87
|
+
command -v "$1" >/dev/null 2>&1 || fail "Required tool not found: $1"
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
## @brief Clones the upstream PI-Prompts master branch into one target directory.
|
|
91
|
+
## @details Attempts a quiet, no-checkout clone of `${PROMPTS_BRANCH}` from
|
|
92
|
+
## `${PROMPTS_REPO_URL_PRIMARY}`, removes the partial destination on failure,
|
|
93
|
+
## and retries once with `${PROMPTS_REPO_URL_FALLBACK}`. Prints the resolved
|
|
94
|
+
## upstream URL on `stdout` so callers can capture provenance. Runtime is
|
|
95
|
+
## dominated by git subprocess execution. Side effects include
|
|
96
|
+
## destination-directory creation and removal.
|
|
97
|
+
## @param[in] destination {string} Target directory path for the clone.
|
|
98
|
+
## @return {string} Resolved upstream repository URL on stdout.
|
|
99
|
+
## @throws Exits through `fail(...)` when both upstream URLs are unreachable.
|
|
100
|
+
clone_upstream() {
|
|
101
|
+
local destination="$1"
|
|
102
|
+
rm -rf "${destination}"
|
|
103
|
+
if git clone --quiet --no-checkout --branch "${PROMPTS_BRANCH}" "${PROMPTS_REPO_URL_PRIMARY}" "${destination}" 2>/dev/null; then
|
|
104
|
+
printf '%s\n' "${PROMPTS_REPO_URL_PRIMARY}"
|
|
105
|
+
return 0
|
|
106
|
+
fi
|
|
107
|
+
log "Primary clone failed, retrying with the fallback repository URL ..."
|
|
108
|
+
rm -rf "${destination}"
|
|
109
|
+
if git clone --quiet --no-checkout --branch "${PROMPTS_BRANCH}" "${PROMPTS_REPO_URL_FALLBACK}" "${destination}" 2>/dev/null; then
|
|
110
|
+
printf '%s\n' "${PROMPTS_REPO_URL_FALLBACK}"
|
|
111
|
+
return 0
|
|
112
|
+
fi
|
|
113
|
+
fail "Unable to clone PI-Prompts from ${PROMPTS_REPO_URL_PRIMARY} or ${PROMPTS_REPO_URL_FALLBACK}."
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
## @brief Resolves the upstream synchronization ref for the cloned repository.
|
|
117
|
+
## @details Prefers the newest tag reported by the GitHub Releases API when
|
|
118
|
+
## `curl` is available and that tag exists in the local clone; otherwise
|
|
119
|
+
## selects the newest version-sorted tag reachable from `${PROMPTS_BRANCH}`;
|
|
120
|
+
## otherwise falls back to the `${PROMPTS_BRANCH}` head. Prints the resolved
|
|
121
|
+
## ref name on `stdout`. Runtime is dominated by one optional HTTPS request
|
|
122
|
+
## plus git ref enumeration. No external state is mutated.
|
|
123
|
+
## @param[in] repository {string} Cloned upstream repository path.
|
|
124
|
+
## @return {string} Resolved `refs/tags/<tag>` or `refs/heads/master` ref on stdout.
|
|
125
|
+
resolve_release_ref() {
|
|
126
|
+
local repository="$1"
|
|
127
|
+
local release_tag=""
|
|
128
|
+
|
|
129
|
+
if command -v curl >/dev/null 2>&1; then
|
|
130
|
+
release_tag="$(curl -fsSL --max-time 20 "${PROMPTS_RELEASE_API_URL}" 2>/dev/null \
|
|
131
|
+
| sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' \
|
|
132
|
+
| head -n 1 || true)"
|
|
133
|
+
fi
|
|
134
|
+
|
|
135
|
+
if [ -n "${release_tag}" ] \
|
|
136
|
+
&& git -C "${repository}" rev-parse --verify --quiet "refs/tags/${release_tag}" >/dev/null 2>&1; then
|
|
137
|
+
printf 'refs/tags/%s\n' "${release_tag}"
|
|
138
|
+
return 0
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
release_tag="$(git -C "${repository}" tag --sort=-v:refname --merged "${PROMPTS_BRANCH}" 2>/dev/null | head -n 1 || true)"
|
|
142
|
+
if [ -n "${release_tag}" ]; then
|
|
143
|
+
printf 'refs/tags/%s\n' "${release_tag}"
|
|
144
|
+
return 0
|
|
145
|
+
fi
|
|
146
|
+
|
|
147
|
+
log "No PI-Prompts release resolvable, falling back to the ${PROMPTS_BRANCH} head."
|
|
148
|
+
printf 'refs/heads/%s\n' "${PROMPTS_BRANCH}"
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
## @brief Fully synchronizes one upstream directory into one target directory.
|
|
152
|
+
## @details Stages every upstream file below `source_dir` into a fresh sibling
|
|
153
|
+
## staging directory using timestamp-preserving copies, then replaces
|
|
154
|
+
## `target_dir` with the staged tree through a backup-and-swap sequence so
|
|
155
|
+
## files removed upstream disappear and existing files are overwritten.
|
|
156
|
+
## Runtime is dominated by per-file copy cost. Side effects include staging
|
|
157
|
+
## plus backup directory creation and removal, target-directory replacement,
|
|
158
|
+
## and one progress line on `stdout`.
|
|
159
|
+
## @param[in] source_dir {string} Absolute upstream source directory path.
|
|
160
|
+
## @param[in] target_dir {string} Absolute bundled target directory path.
|
|
161
|
+
## @return {void} No return value.
|
|
162
|
+
## @throws Exits through `fail(...)` when `source_dir` is not a directory.
|
|
163
|
+
sync_directory() {
|
|
164
|
+
local source_dir="$1"
|
|
165
|
+
local target_dir="$2"
|
|
166
|
+
|
|
167
|
+
[ -d "${source_dir}" ] || fail "Upstream directory not found: ${source_dir}"
|
|
168
|
+
|
|
169
|
+
STAGING_DIR="${target_dir}.staging.$$"
|
|
170
|
+
rm -rf "${STAGING_DIR}"
|
|
171
|
+
mkdir -p "${STAGING_DIR}"
|
|
172
|
+
|
|
173
|
+
local relative_path destination parent_dir copied=0
|
|
174
|
+
while IFS= read -r -d '' relative_path; do
|
|
175
|
+
relative_path="${relative_path#./}"
|
|
176
|
+
[ -n "${relative_path}" ] || continue
|
|
177
|
+
destination="${STAGING_DIR}/${relative_path}"
|
|
178
|
+
parent_dir="$(dirname "${destination}")"
|
|
179
|
+
mkdir -p "${parent_dir}"
|
|
180
|
+
cp -p "${source_dir}/${relative_path}" "${destination}"
|
|
181
|
+
copied=$((copied + 1))
|
|
182
|
+
done < <(cd "${source_dir}" && find . -type f -print0)
|
|
183
|
+
|
|
184
|
+
local backup_dir="${target_dir}.backup.$$"
|
|
185
|
+
rm -rf "${backup_dir}"
|
|
186
|
+
if [ -d "${target_dir}" ]; then
|
|
187
|
+
mv "${target_dir}" "${backup_dir}"
|
|
188
|
+
fi
|
|
189
|
+
mv "${STAGING_DIR}" "${target_dir}"
|
|
190
|
+
STAGING_DIR=""
|
|
191
|
+
rm -rf "${backup_dir}"
|
|
192
|
+
|
|
193
|
+
log "Synchronized ${copied} file(s) into ${target_dir#"${REPO_ROOT}"/}"
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
## @brief Executes one full bundled-resource update run.
|
|
197
|
+
## @details Validates required tools, allocates the temporary upstream working
|
|
198
|
+
## tree, clones the PI-Prompts master branch, resolves and checks out the
|
|
199
|
+
## newest release ref, then synchronizes every ordered pair declared in
|
|
200
|
+
## `SYNC_SPECS`. Runtime is dominated by the upstream clone plus the three
|
|
201
|
+
## directory synchronizations. Side effects include temporary-directory
|
|
202
|
+
## creation and removal, git subprocesses, one optional GitHub Releases API
|
|
203
|
+
## request, and replacement of the three bundled target directories.
|
|
204
|
+
## @return {void} No return value.
|
|
205
|
+
## @throws Exits through `fail(...)` when any required tool, clone, checkout, or
|
|
206
|
+
## synchronization step fails.
|
|
207
|
+
main() {
|
|
208
|
+
require_tool git
|
|
209
|
+
require_tool find
|
|
210
|
+
require_tool mkdir
|
|
211
|
+
require_tool cp
|
|
212
|
+
|
|
213
|
+
mkdir -p "${TARGET_ROOT}"
|
|
214
|
+
|
|
215
|
+
WORK_DIR="$(mktemp -d "${TMPDIR:-/tmp}/pi-prompts-update.XXXXXX")" \
|
|
216
|
+
|| fail "Unable to create the temporary working directory."
|
|
217
|
+
local repository="${WORK_DIR}/PI-Prompts"
|
|
218
|
+
|
|
219
|
+
local upstream_url
|
|
220
|
+
upstream_url="$(clone_upstream "${repository}")"
|
|
221
|
+
log "Upstream repository: ${upstream_url}"
|
|
222
|
+
|
|
223
|
+
local release_ref
|
|
224
|
+
release_ref="$(resolve_release_ref "${repository}")"
|
|
225
|
+
git -C "${repository}" checkout --quiet --detach "${release_ref}" \
|
|
226
|
+
|| fail "Unable to check out ${release_ref}."
|
|
227
|
+
log "Synchronizing from ref: ${release_ref}"
|
|
228
|
+
|
|
229
|
+
local spec source_rel target_rel
|
|
230
|
+
for spec in "${SYNC_SPECS[@]}"; do
|
|
231
|
+
source_rel="${spec%%:*}"
|
|
232
|
+
target_rel="${spec#*:}"
|
|
233
|
+
sync_directory "${repository}/${source_rel}" "${REPO_ROOT}/${target_rel}"
|
|
234
|
+
done
|
|
235
|
+
|
|
236
|
+
log "Bundled prompt resources updated."
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
trap cleanup EXIT
|
|
240
|
+
main "$@"
|
package/src/core/prompts.ts
CHANGED
|
@@ -81,16 +81,28 @@ const PI_DEV_CODING_AGENT_DOCS_PROMPT_PATH = `${PI_DEV_DOCS_PROMPT_PATH}/coding-
|
|
|
81
81
|
* @details Prompt guidance cites this directory when requiring read-only validation against the pi client implementation. Lookup complexity is O(1).
|
|
82
82
|
*/
|
|
83
83
|
const PI_DEV_SOURCE_PROMPT_PATH = "pi.dev-src/pi-mono";
|
|
84
|
+
/**
|
|
85
|
+
* @brief Stores the repository-relative root directory of the pi CLI client sources.
|
|
86
|
+
* @details Prompt guidance cites this directory when declaring the permanently read-only pi CLI client reference and source-of-truth mandates for new implementations, source-code modifications, and bug fixes. Lookup complexity is O(1).
|
|
87
|
+
*/
|
|
88
|
+
const PI_DEV_SOURCE_ROOT_PROMPT_PATH = "pi.dev-src";
|
|
84
89
|
/**
|
|
85
90
|
* @brief Defines the injected pi.dev governance guidance block.
|
|
86
|
-
* @details The block requires read-only handling for documentation and pi client sources, coding-agent-document review, coding-agent-document compliance, optional manifest-referenced document handling, and pi client source validation for ambiguous or bug-fix interface work. Construction happens once at module load. Access complexity is O(1).
|
|
87
|
-
* @satisfies REQ-033, REQ-034, REQ-108, REQ-273, REQ-274, REQ-275
|
|
91
|
+
* @details The block requires read-only handling for documentation and pi client sources, mandatory read-only pi CLI client reference usage plus source-of-truth handling for new implementations, source-code modifications, and bug fixes, coding-agent-document review, coding-agent-document compliance, optional manifest-referenced document handling, and pi client source validation for ambiguous or bug-fix interface work. Construction happens once at module load. Access complexity is O(1).
|
|
92
|
+
* @satisfies CTN-017, CTN-023, CTN-024, REQ-033, REQ-034, REQ-108, REQ-273, REQ-274, REQ-275, REQ-378
|
|
88
93
|
*/
|
|
89
94
|
const PI_DEV_CONFORMANCE_BLOCK = [
|
|
90
95
|
"- Treat every path under `docs/` as read-only; do NOT modify "
|
|
91
96
|
+ "any documentation file, including those under `docs/pi.dev/`.",
|
|
92
97
|
"- Treat every path under `pi.dev-src/` as read-only; do NOT modify "
|
|
93
98
|
+ `\`${PI_DEV_SOURCE_PROMPT_PATH}\` or any other pi client source.`,
|
|
99
|
+
`- Every file under \`${PI_DEV_SOURCE_ROOT_PROMPT_PATH}/\` is a pi CLI client `
|
|
100
|
+
+ "source: it MAY and MUST be used as read-only reference material "
|
|
101
|
+
+ "during analysis, implementation, verification, and bug fixing.",
|
|
102
|
+
`- Treat \`${PI_DEV_SOURCE_ROOT_PROMPT_PATH}/\` as the source-of-truth (SoT) `
|
|
103
|
+
+ "for new implementations, source-code modifications, and bug fixes; "
|
|
104
|
+
+ "derive pi-client-facing behavior from it without modifying it "
|
|
105
|
+
+ "in any way.",
|
|
94
106
|
"- If the task creates or modifies software that interfaces with the "
|
|
95
107
|
+ `pi.dev CLI, review \`${PI_DEV_CODING_AGENT_DOCS_PROMPT_PATH}/\` `
|
|
96
108
|
+ "before analysis, implementation, verification, or bug fixing.",
|
|
@@ -110,11 +122,11 @@ const PI_DEV_CONFORMANCE_BLOCK = [
|
|
|
110
122
|
|
|
111
123
|
/**
|
|
112
124
|
* @brief Builds the conditional pi.dev governance block for one rendered prompt.
|
|
113
|
-
* @details Emits the coding-agent-document-driven governance rules only when the selected bundled prompt can analyze or mutate source code and the project root contains the `docs/pi.dev/coding-agent-docs/` directory; the manifest file is optional and its absence does not suppress the block. Time complexity O(1). No filesystem writes.
|
|
125
|
+
* @details Emits the coding-agent-document-driven governance rules only when the selected bundled prompt can analyze or mutate source code and the project root contains the `docs/pi.dev/coding-agent-docs/` directory; the manifest file is optional and its absence does not suppress the block. The emitted rules declare `pi.dev-src/` the permanently read-only pi CLI client reference and source-of-truth for new implementations, source-code modifications, and bug fixes. Time complexity O(1). No filesystem writes.
|
|
114
126
|
* @param[in] promptName {string} Bundled prompt identifier.
|
|
115
127
|
* @param[in] projectBase {string} Absolute project root used for coding-agent-docs directory existence checks.
|
|
116
128
|
* @return {string} Markdown bullet block or the empty string when injection is not applicable.
|
|
117
|
-
* @satisfies REQ-032, REQ-033, REQ-034, REQ-108, REQ-273, REQ-274, REQ-275
|
|
129
|
+
* @satisfies CTN-023, CTN-024, REQ-032, REQ-033, REQ-034, REQ-108, REQ-273, REQ-274, REQ-275, REQ-378
|
|
118
130
|
*/
|
|
119
131
|
function buildPiDevConformanceBlock(promptName: string, projectBase: string): string {
|
|
120
132
|
if (!PI_DEV_AWARE_PROMPT_NAMES.has(promptName)) {
|
|
@@ -134,7 +146,7 @@ function buildPiDevConformanceBlock(promptName: string, projectBase: string): st
|
|
|
134
146
|
* @param[in] promptName {string} Bundled prompt identifier.
|
|
135
147
|
* @param[in] projectBase {string} Absolute project root used for coding-agent-docs directory existence checks.
|
|
136
148
|
* @return {string} Prompt markdown with zero or one injected conformance block.
|
|
137
|
-
* @satisfies REQ-032, REQ-033, REQ-034, REQ-108, REQ-273, REQ-274, REQ-275
|
|
149
|
+
* @satisfies REQ-032, REQ-033, REQ-034, REQ-108, REQ-273, REQ-274, REQ-275, REQ-378
|
|
138
150
|
*/
|
|
139
151
|
function injectPiDevConformanceBlock(text: string, promptName: string, projectBase: string): string {
|
|
140
152
|
const block = buildPiDevConformanceBlock(promptName, projectBase);
|
|
@@ -326,7 +338,7 @@ function renderBundledCommitInstruction(
|
|
|
326
338
|
* @param[in] config {UseReqConfig} Effective project configuration used for path substitutions.
|
|
327
339
|
* @param[in] executionPlan {PromptCommandExecutionPlan | undefined} Optional prompt-command execution plan used for injected runtime guidance.
|
|
328
340
|
* @return {string} Fully rendered prompt markdown ready for `pi.sendUserMessage(...)`.
|
|
329
|
-
* @satisfies REQ-002, REQ-003, REQ-032, REQ-033, REQ-034, REQ-108, REQ-200, REQ-201, REQ-202, REQ-206, REQ-207, REQ-208, REQ-209, REQ-211, REQ-213, REQ-214, REQ-273, REQ-274, REQ-275, REQ-329, REQ-330, REQ-331, REQ-332
|
|
341
|
+
* @satisfies REQ-002, REQ-003, REQ-032, REQ-033, REQ-034, REQ-108, REQ-200, REQ-201, REQ-202, REQ-206, REQ-207, REQ-208, REQ-209, REQ-211, REQ-213, REQ-214, REQ-273, REQ-274, REQ-275, REQ-378, REQ-329, REQ-330, REQ-331, REQ-332
|
|
330
342
|
*/
|
|
331
343
|
export function renderPrompt(
|
|
332
344
|
promptName: string,
|
|
@@ -102,7 +102,7 @@ Use for: string/pattern searches inside code bodies, cross-file references, conf
|
|
|
102
102
|
## Execution Protocol (Global vs Local)
|
|
103
103
|
You must manage the execution flow using two distinct methods:
|
|
104
104
|
- **Global Roadmap** (*check-list*):
|
|
105
|
-
- You MUST maintain a *check-list* internally with `
|
|
105
|
+
- You MUST maintain a *check-list* internally with `3` Steps (one item per Step).
|
|
106
106
|
- **Do NOT** use the *task-list tool* for this high-level roadmap.
|
|
107
107
|
- **Local Sub-tasks** (Tool Usage):
|
|
108
108
|
- If a *task-list tool* is available, use it **exclusively** to manage granular sub-tasks *within* a specific step (e.g., in Step X: "1. Edit file A", "2. Edit file B"; or in Step Y: "1. Fix test K", "2. Fix test L").
|
|
@@ -123,13 +123,22 @@ During the execution flow you MUST follow these directives:
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
## Steps
|
|
126
|
-
Create internally a *check-list* for the **Global Roadmap** including all the numbered steps below: `1..
|
|
126
|
+
Create internally a *check-list* for the **Global Roadmap** including all the numbered steps below: `1..3`, and start following the roadmap at the same time, executing the instructions of Step 1. If a tool call is required in Step 1, invoke it immediately; otherwise proceed to Step 1 without additional commentary. Do not add extra intent-adjustment checks unless explicitly listed in the Steps section.
|
|
127
127
|
1. Analyze the [User Request](#users-request)
|
|
128
128
|
- Using [User Request](#users-request) as a unified semantic framework, extract all directly and tangentially related information from `%%DOC_PATH%%/REQUIREMENTS.md`, `%%DOC_PATH%%/WORKFLOW.md` and `%%DOC_PATH%%/REFERENCES.md`, prioritizing high recall to capture every borderline connection across both sources, to identify the most likely related files and functions based on explicit evidence, and treat any uncertain links as candidates without claiming completeness, then analyze the involved source code from %%SRC_PATHS%% to answer the [User Request](#users-request), ensuring compliance with %%GUIDELINES_FILES%% documents if present.
|
|
129
129
|
- Do NOT create or modify tests in this workflow. If you cite tests as evidence, treat them as read-only artifacts.
|
|
130
130
|
- Read %%GUIDELINES_FILES%% files and ensure any suggested follow-up changes would conform to those **guidelines**. Do not check unrelated **guidelines**.
|
|
131
|
-
2.
|
|
131
|
+
2. Generate the follow-up prompt text from the analysis outcome
|
|
132
|
+
- Using the Step 1 analysis outcome, classify the result against `%%DOC_PATH%%/REQUIREMENTS.md` into exactly one branch:
|
|
133
|
+
- IF the analysis identified an implementation behavior that conflicts with requirements (the source code must change while `%%DOC_PATH%%/REQUIREMENTS.md` stays unchanged), GENERATE the exact prompt text to pass to the LLM Agent with the `/req-fix` command, including the defect summary, the affected requirement IDs, and concrete evidence (file paths with line numbers).
|
|
134
|
+
- ELSE IF the analysis identified changes needed to BOTH the source code and `%%DOC_PATH%%/REQUIREMENTS.md`, GENERATE the exact prompt text to pass to the LLM Agent with the `/req-change` command, including the requested change description, the affected requirement IDs, and concrete evidence (file paths with line numbers).
|
|
135
|
+
- ELSE IF the analysis identified source-code modifications with the intent of improving or adjusting the sources (internals, structure, maintainability, or performance) while `%%DOC_PATH%%/REQUIREMENTS.md` stays unchanged and NO implementation behavior conflicting with requirements was identified, GENERATE the exact prompt text to pass to the LLM Agent with the `/req-refactor` command, including the improvement objective, the affected source paths/symbols, the requirement IDs constraining the behavior to preserve, and concrete evidence (file paths with line numbers).
|
|
136
|
+
- ELSE (no source-code or requirements modifications are required), do NOT generate any follow-up prompt text.
|
|
137
|
+
- Each generated follow-up prompt text (`/req-fix`, `/req-change`, or `/req-refactor`) MUST be printed ONLY when the analysis identified its corresponding trigger in the classification above, and MUST NOT be printed in any other case; when generated, carry it into Step 3 for printing under the `## **Next Workflow**` report section.
|
|
138
|
+
- Do NOT execute the generated follow-up prompt and do NOT apply any fix or repository modification in this workflow; this workflow remains read-only.
|
|
139
|
+
3. Present results
|
|
132
140
|
- PRINT, in the response, the final analysis report 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.
|
|
141
|
+
- Include the Step 2 generated follow-up prompt text under `## **Next Workflow**` ONLY when Step 2 generated it; omit the follow-up prompt text entirely in all other cases.
|
|
133
142
|
|
|
134
143
|
<h2 id="users-request">User's Request</h2>
|
|
135
144
|
%%ARGS%%
|
|
@@ -39,7 +39,7 @@ In scope: static analysis of user-visible behavior from %%SRC_PATHS%% and relate
|
|
|
39
39
|
- Write root `README.md` in English.
|
|
40
40
|
- Do not perform unrelated edits.
|
|
41
41
|
- Analyze user-visible implementation changes, including new features, CLI parameters/options, GUI interactions, distributed APIs, and configuration-file schema updates when present.
|
|
42
|
-
- Validate
|
|
42
|
+
- Validate the current root `README.md` exhaustively against implementation evidence: enumerate every section, validate each sentence, and record a per-sentence conformance outcome before editing; then update only missing, outdated, or incorrect user-facing content.
|
|
43
43
|
- Parse [User Request](#users-request) (`%%ARGS%%`) as explicit additional-edit directives, using the same anchor-based reference model used by `write.md`, and execute those directives in the same scoped README update pass.
|
|
44
44
|
- Keep non-analysis documentary sections unchanged, including document headers, versioning metadata, context/scope descriptions, personal motivations, related projects, and high-level conceptual or graphical descriptions that do not alter interface usage.
|
|
45
45
|
- Preserve existing README structure and formatting patterns (section order, heading hierarchy, bullet/list style, table style) whenever possible.
|
|
@@ -136,9 +136,12 @@ Create internally a *check-list* for the **Global Roadmap** including all the nu
|
|
|
136
136
|
- Use repository evidence only; for each finding, collect file paths and line ranges.
|
|
137
137
|
- Derive a compact "README coverage list" of user-visible behavior that MUST appear in root `README.md`.
|
|
138
138
|
2. Validate and update root `README.md`
|
|
139
|
-
- Read the current root `README.md` and
|
|
140
|
-
-
|
|
139
|
+
- Read the current root `README.md` and enumerate ALL its sections and headings in document order to fix the complete validation surface.
|
|
140
|
+
- Validate `README.md` sentence by sentence, section by section, in document order: for every sentence, verify its content against repository implementation evidence and record exactly one outcome: `CONFORMING`, `OUTDATED`, or `UNSUPPORTED`.
|
|
141
|
+
- Classify non-analysis documentary sections (headers, versioning, motivations, related projects, high-level graphics) as `NOT-ANALYZED-BY-DESIGN` instead of sentence-level validation; never skip any other part or section.
|
|
142
|
+
- Identify and list the exact `README.md` sections impacted by the detected user-visible implementation changes, the recorded validation outcomes, and explicit additional edits from [User Request](#users-request) before editing.
|
|
141
143
|
- Update only the identified sections so `README.md` reflects the current externally visible behavior and usage flows.
|
|
144
|
+
- Completeness gate: do NOT proceed to Step 3 until every enumerated section and every sentence has a recorded outcome and every `OUTDATED` or `UNSUPPORTED` sentence in analysis sections is corrected or removed.
|
|
142
145
|
- 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).
|
|
143
146
|
- Keep content focused on user interaction, setup, commands, interfaces, and observable outputs.
|
|
144
147
|
- Do NOT add internal implementation details, internal architecture, private symbol names, or algorithm internals.
|