@henryqw/pi-prompt-creator 3.1.5 → 3.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CONTEXT.md +16 -18
  2. package/README.md +32 -32
  3. package/package.json +1 -1
package/CONTEXT.md CHANGED
@@ -1,25 +1,23 @@
1
- # pi-prompt-creator — Context
1
+ # Pi Prompt Creator
2
2
 
3
- ## Domain
3
+ Pi Prompt Creator finds reusable prompt ideas in the current conversation. Main and the user review each idea before the user approves a new global prompt.
4
4
 
5
- Turn repetition and correction in the current Pi conversation into one editable prompt template candidate. The user decides whether the candidate becomes a global Pi prompt.
5
+ ## Language
6
6
 
7
- ## Glossary
7
+ **Current Conversation**:
8
+ The model-visible conversation on the active branch, including its retained summary and effective user and completed assistant text. Inactive branches, removed context, tool traffic, and thinking are not prompt-analysis evidence.
8
9
 
9
- - **Current Conversation**: The active conversation branch, including summaries that replace compacted history. Inactive branches are outside the scope.
10
- - **Signal**: Evidence in the Current Conversation that a reusable prompt may help. Signals are explicit recurrence language, repetition of the same underlying request, or repeated correction of the agent's behavior.
11
- - **Prompt Candidate**: One unsaved, editable prompt template proposed from the strongest Signal. A session has at most one pending Prompt Candidate; the user may explicitly request another after the pending candidate is shown or dismissed.
12
- - **Prompt Review**: Conversational refinement of a Prompt Candidate by the user and Main.
13
- - **Final Prompt Draft**: Complete prompt-template Markdown authored by Main after Prompt Review. A Prompt Candidate is not a Final Prompt Draft.
14
- - **Approved Prompt**: A Final Prompt Draft the user explicitly accepts for creation as a global Pi prompt. Approval never authorizes replacing an existing prompt.
10
+ **Signal**:
11
+ Evidence that a reusable prompt could help: explicit recurrence language, requests with the same intent, or repeated corrections of Main's behavior.
15
12
 
16
- ## Boundary
13
+ **Prompt Candidate**:
14
+ One unsaved prompt template proposed from a Signal. A pending candidate is untrusted review material, not an approved prompt.
17
15
 
18
- | Concern | Home |
19
- | --- | --- |
20
- | Cross-session evidence and historical search | `@henryqw/pi-session-recall` |
21
- | Scripts, Skills, and other automation | Their owning package or repository |
22
- | User config load rules and launch reporting | `@henryqw/pi-config-store` ([ADR 004](../../docs/adr/004-extension-config-safety.md)) |
23
- | This extension | Current-conversation Signal detection, Prompt Candidate generation, and Prompt Review |
16
+ **Prompt Review**:
17
+ Conversational refinement of a displayed Prompt Candidate by the user and Main.
24
18
 
25
- The extension stays silent when it finds no Prompt Candidate. Background analysis remains visible while it is running. Manually requested candidates display when ready; automatic candidates wait for explicit user display, so background work never steals editor focus.
19
+ **Final Prompt Draft**:
20
+ The complete prompt-template Markdown in Main's latest valid retained review reply after the candidate was displayed. A Prompt Candidate is not a Final Prompt Draft.
21
+
22
+ **Approved Prompt**:
23
+ A Final Prompt Draft that the user explicitly accepts for creation as a new global Pi prompt. Approval does not permit replacement of an existing prompt.
package/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # `@henryqw/pi-prompt-creator`
2
2
 
3
- Turn repeated requests or corrections in the current conversation into a reviewed global Pi prompt. A tool-free child drafts one Prompt Candidate. Main and the user control Prompt Review and the save.
3
+ Turn repeated requests or corrections in the Current Conversation into a reviewed global Pi prompt. A child with no tools drafts one Prompt Candidate. Main and the user control Prompt Review and the save.
4
4
 
5
- Automatic analysis only prepares a candidate. The extension never saves it without your approval.
5
+ Automatic analysis only prepares a Prompt Candidate. The extension never saves it without your approval.
6
6
 
7
7
  ## Install
8
8
 
9
- This package requires Pi 1.1.0 or later in the 1.x series. Older Pi releases are no longer supported.
9
+ This package requires Pi 1.1.0 or later in the 1.x series. It no longer supports older Pi releases.
10
10
 
11
11
  ```bash
12
12
  pi install npm:@henryqw/pi-task-models
13
13
  pi install npm:@henryqw/pi-prompt-creator
14
14
  ```
15
15
 
16
- Run `/task-models` before analysis. Assign a model to `fast`, or override `pi-prompt-creator/draft`. Open `/task-models` again and verify the saved route or task assignment.
16
+ Run `/task-models` before analysis. Assign a model to `fast`, or override `pi-prompt-creator/draft`. Open `/task-models` again. Verify the saved route or task assignment.
17
17
 
18
18
  ## Works with
19
19
 
@@ -25,11 +25,11 @@ Run `/task-models` before analysis. Assign a model to `fast`, or override `pi-pr
25
25
 
26
26
  Run `/promptor` in the interactive TUI after a repeated request or correction appears:
27
27
 
28
- 1. Run `/promptor`. The completed candidate appears automatically.
29
- 2. Ask Main to refine it and return only the complete Final Prompt Draft.
30
- 3. Run `/promptor save` to save under the suggested name, or `/promptor save <name>` to rename it.
28
+ 1. Run `/promptor`. The completed Prompt Candidate appears automatically.
29
+ 2. Ask Main to refine it. Ask Main to return only the complete Final Prompt Draft.
30
+ 3. Run `/promptor save` to save under the suggested name. Alternatively, run `/promptor save <name>` to rename it.
31
31
 
32
- The prompt is created at `~/.pi/agent/prompts/<name>.md`. Then Pi reloads its resources. No selection menu or name prompt is required.
32
+ The extension creates the prompt at `~/.pi/agent/prompts/<name>.md`. Then Pi reloads its resources. You do not need a selection menu or name prompt.
33
33
 
34
34
  | Surface | Type | Purpose |
35
35
  | --- | --- | --- |
@@ -49,39 +49,39 @@ Automatic mode waits for the configured number of non-empty user inputs. The def
49
49
 
50
50
  It starts at the next idle `agent_settled` event that is not aborted. It starts at most one time per extension runtime.
51
51
 
52
- An aborted run does not start automatic analysis. It keeps the input count and the automatic opportunity, so a later eligible normal settlement can start analysis. `aborted: false` does not prove that the provider completed successfully.
52
+ An aborted run does not start automatic analysis. It keeps the input count and permits later automatic analysis. A later normal settlement can start analysis if it meets the conditions. `aborted: false` does not prove that the provider completed successfully.
53
53
 
54
- Explicit `/promptor analyze` remains available after cancellation. A manual analysis consumes the automatic opportunity.
54
+ Explicit `/promptor analyze` remains available after cancellation. A manual analysis prevents later automatic analysis in that extension runtime.
55
55
 
56
- Branch changes reset the input counter. Automatic analysis and candidate widgets require the interactive TUI.
56
+ Branch changes reset the input counter. Automatic analysis and Prompt Candidate widgets require the interactive TUI.
57
57
 
58
- Only one analysis can run at a time. A pending candidate blocks another analysis.
58
+ Only one analysis can run at a time. A pending Prompt Candidate blocks another analysis.
59
59
 
60
- Manual and automatic analysis send Pi's current model-visible session context to the child model configured through `/task-models`. Session context edits that omit or replace messages are honored. Original text removed from model context is not sent to the child. Request-local `context` and `context_with_system` transformations are not included.
60
+ Manual and automatic analysis send Pi's current model-visible session context to the child model that you configure through `/task-models`. Analysis applies session context edits that omit or replace messages. It does not send original text that these edits removed from model context to the child. It does not include request-local `context` and `context_with_system` transformations.
61
61
 
62
- Its payload includes the active compaction or branch summary, user text, successfully completed assistant text, and effective prompt names and descriptions.
62
+ The payload includes the active compaction or branch summary, user text, successfully completed assistant text, and effective prompt names and descriptions.
63
63
 
64
- Project context files and prompt templates are disabled for the child. Tool traffic, thinking, images, custom messages, and inactive branches are excluded.
64
+ The extension disables project context files and prompt templates for the child. It excludes tool traffic, thinking, images, custom messages, and inactive branches.
65
65
 
66
- Analysis asks a tool-free child for one JSON response. It has no user extensions, Skills, or saved session. The extension does not retry failed analysis.
66
+ Analysis asks a child with no tools for one JSON response. The child has no user extensions, Skills, or saved session. The extension does not try failed analysis again.
67
67
 
68
68
  New user input does not stop a running child. Branch navigation discards its old result without stopping the child.
69
69
 
70
70
  ### Review and save
71
71
 
72
- A manually requested analysis displays its completed candidate immediately. Automatic analysis shows a running widget. Then it keeps a completed candidate behind the `Prompt ready — /promptor` widget until you run `/promptor` or `/promptor dismiss`. Thus, background work never interrupts the conversation.
72
+ A manually requested analysis displays its completed Prompt Candidate immediately. Automatic analysis shows a running widget. It then keeps a completed Prompt Candidate behind the `Prompt ready — /promptor` widget until you run `/promptor` or `/promptor dismiss`. Background work never interrupts the conversation.
73
73
 
74
- Displayed candidates are visible messages marked as untrusted.
74
+ The extension displays Prompt Candidates as visible messages that it marks as untrusted.
75
75
 
76
- Refine the candidate with Main. Ask Main to return only the complete Final Prompt Draft. Then save it with `/promptor save [name]`.
76
+ Refine the Prompt Candidate with Main. Ask Main to return only the complete Final Prompt Draft. Then save it with `/promptor save [name]`.
77
77
 
78
- You can save only after you show a candidate and Main then completes a valid Markdown review reply. The save uses that latest retained Main reply as the entire file. Replies before the active compaction or branch summary cannot be saved.
78
+ You can save only after you show a Prompt Candidate and Main then completes a valid Markdown review reply. The save uses that latest retained Main reply as the entire file. You cannot save replies before the active compaction or branch summary.
79
79
 
80
- An interrupted, failed, empty, or tool-use reply cannot be saved. The extension never falls back to an older reply.
80
+ You cannot save an interrupted, failed, empty, or tool-use reply. The extension never uses an older reply instead.
81
81
 
82
- A successful save ends that review. Show another candidate and complete another Main review reply before you save again.
82
+ A successful save ends that Prompt Review. Show another Prompt Candidate. Complete another Main review reply before you save again.
83
83
 
84
- `/promptor save` uses the suggested candidate name. Pass `/promptor save <name>` to choose another. Names must be lowercase kebab-case, start with a letter, and contain at most 64 ASCII characters. Existing command names and prompt files are rejected.
84
+ `/promptor save` uses the suggested Prompt Candidate name. Pass `/promptor save <name>` to choose another. Names must be lowercase kebab-case, start with a letter, and contain at most 64 ASCII characters. The extension rejects existing command names and prompt files.
85
85
 
86
86
  A successful save reloads Pi resources. If reload fails, the prompt remains saved and `/reload` can load it.
87
87
 
@@ -104,15 +104,15 @@ Edit either field. Then run `/reload` to apply the change. Omitted fields use th
104
104
 
105
105
  A missing file quietly uses both defaults. Startup never creates or rewrites the file.
106
106
 
107
- At session start, Pi shows a warning with the file path and each problem for an unknown key or an invalid value. Pi ignores the unknown key. A misspelled key near a missing field, such as `automatc`, counts as an invalid value of that field. An invalid `inputThreshold` uses the default `3`.
107
+ At session start, Pi shows a warning for an unknown key or an invalid value. The warning includes the file path and each problem. Pi ignores the unknown key. A misspelled key near a missing field, such as `automatc`, counts as an invalid value of that field. An invalid `inputThreshold` uses the default `3`.
108
108
 
109
- Automatic analysis stays off for the session when `automatic` is invalid or misspelled, or when the file has malformed JSON, invalid UTF-8, more than 64 KiB, a read error, or a non-object root. Startup leaves the file unchanged.
109
+ Automatic analysis stays off for the session when `automatic` is invalid or misspelled. It also stays off when the file has malformed JSON, invalid UTF-8, more than 64 KiB, a read error, or a non-object root. Startup leaves the file unchanged.
110
110
 
111
- Only `/promptor automatic on` or `/promptor automatic off` writes the config. A toggle reads the file again and keeps its current `inputThreshold`, also when another session changed it. A toggle also replaces a file with problems: it first shows the problems, then keeps the usable values and removes unknown keys. If another session changes that file before the write, the toggle stops and writes nothing.
111
+ Only `/promptor automatic on` or `/promptor automatic off` writes the config. A toggle reads the file again and keeps its current `inputThreshold`, also when another session changed it. A toggle also replaces a file with problems. It first shows the problems, then keeps the usable values and removes unknown keys. If another session changes that file before the write, the toggle stops and writes nothing.
112
112
 
113
113
  ## State and storage
114
114
 
115
- A pending candidate stays in memory only. Automatic mode persists, but counters and candidates do not.
115
+ A pending Prompt Candidate stays in memory only. The extension saves automatic mode, but not counters or Prompt Candidates.
116
116
 
117
117
  Saved prompts are at `~/.pi/agent/prompts/<name>.md`. A save never replaces an existing file.
118
118
 
@@ -122,15 +122,15 @@ The child payload stays within 30,000 characters, including its JSON envelope an
122
122
 
123
123
  It gives priority to the active summary, then to the newest complete messages. It omits excess prompt metadata before conversation context.
124
124
 
125
- Old messages can be omitted. Individual messages are never cut.
125
+ Analysis can omit old messages. It never cuts individual messages.
126
126
 
127
- Generated candidate names use lowercase kebab-case and stay within 64 ASCII characters.
127
+ Generated Prompt Candidate names use lowercase kebab-case and stay within 64 ASCII characters.
128
128
 
129
- Candidate and Final Prompt Draft Markdown must be non-empty and at most 16 KiB.
129
+ Prompt Candidate and Final Prompt Draft Markdown must be non-empty and at most 16 KiB.
130
130
 
131
- Candidate and saved Markdown reject NUL and other terminal controls. Ordinary tabs and line feeds are allowed.
131
+ The extension rejects NUL and other terminal controls in Prompt Candidate and saved Markdown. It permits ordinary tabs and line feeds.
132
132
 
133
- If analysis finds no candidate, the running widget clears without a notice. Invalid output or child failure shows `Prompt analysis failed — /promptor`. Failed analysis is not retried automatically. Run `/promptor` or `/promptor analyze` to start again.
133
+ If analysis finds no Prompt Candidate, the running widget clears without a notice. Invalid output or child failure shows `Prompt analysis failed — /promptor`. The extension does not automatically try failed analysis again. Run `/promptor` or `/promptor analyze` to start again.
134
134
 
135
135
  The failure widget clears after the next non-empty user input. Analysis has a two-minute idle timeout and five-minute hard timeout.
136
136
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-prompt-creator",
3
- "version": "3.1.5",
3
+ "version": "3.1.7",
4
4
  "description": "Turn current Pi conversation signals into user-approved prompt templates.",
5
5
  "keywords": [
6
6
  "pi-package",