pi-quests 0.6.1 → 0.6.2
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 +5 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/index.ts +6 -2
- package/src/prompts/skill.md +42 -45
- package/src/tools/handler.ts +24 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.6.2] - 2026-04-17
|
|
6
|
+
|
|
7
|
+
- fix: system prompt was too weak
|
|
8
|
+
- chore: add more roadmap items
|
|
9
|
+
|
|
5
10
|
## [0.6.1] - 2026-04-17
|
|
6
11
|
|
|
7
12
|
- fix: make quest prompt injection static and cache-friendly with `nudges.enable` and `display.showStatus` toggles
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# pi-quests
|
|
2
2
|
|
|
3
|
-
[](CHANGELOG.md)
|
|
4
4
|
[](LICENSE.md)
|
|
5
5
|
[](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent)
|
|
6
6
|
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { registerQuestTool } from "./tools/handler.js";
|
|
|
22
22
|
* - Provide rollback support to restore a previous snapshot.
|
|
23
23
|
*/
|
|
24
24
|
const NO_QUESTS_REMINDER =
|
|
25
|
-
"No active quests. Use the
|
|
25
|
+
"No active quests. Use the learn_quests tool to understand how to use quests and use quests to track this task. DO THIS NOW and acknowledge it.";
|
|
26
26
|
|
|
27
27
|
const FAKE_DONE_REMINDER =
|
|
28
28
|
"QUEST REMINDER: A quest has a completion marker appended to its description but is not toggled done. Use the list action to find it, then toggle it done. NEVER append completion markers via update.";
|
|
@@ -121,7 +121,11 @@ export default function (pi: ExtensionAPI): void {
|
|
|
121
121
|
});
|
|
122
122
|
|
|
123
123
|
pi.on("before_agent_start", async (event) => {
|
|
124
|
-
if (
|
|
124
|
+
if (questLog.getAll().length === 0)
|
|
125
|
+
return {
|
|
126
|
+
systemPrompt: `${event.systemPrompt}\n\nUse quests to track this task. DO THIS now and acknowledge it.`,
|
|
127
|
+
};
|
|
128
|
+
|
|
125
129
|
return {
|
|
126
130
|
systemPrompt: `# Quest Management\n${QUEST_PROMPT_GATE}${event.systemPrompt}\n\n## Quest Management\n${NO_QUESTS_REMINDER}`,
|
|
127
131
|
};
|
package/src/prompts/skill.md
CHANGED
|
@@ -5,56 +5,53 @@ description: Quest management best practices for the pi-quests extension. Use wh
|
|
|
5
5
|
|
|
6
6
|
# Quest Management
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
|
|
16
|
-
| `
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
4.
|
|
34
|
-
|
|
35
|
-
### Delegation
|
|
36
|
-
1.
|
|
37
|
-
2.
|
|
38
|
-
3.
|
|
8
|
+
This skill provides guidelines and best practices for using the quest management system in the pi-quests extension. It covers the core actions available for managing quests, recommended workflows for common use cases, and important rules to follow for effective task tracking and progress management.
|
|
9
|
+
|
|
10
|
+
## Action Reference
|
|
11
|
+
|
|
12
|
+
| Action | Required Params | Behavior |
|
|
13
|
+
|--------|----------------|----------|
|
|
14
|
+
| `add` | `descriptions[]` | Create top-level quests. Batch multiple descriptions in one call. |
|
|
15
|
+
| `split` | `id`, `descriptions[]` | Break a quest into steps under it. Alias: `add_step`. |
|
|
16
|
+
| `list` | — | View all quests and steps. |
|
|
17
|
+
| `toggle` | `id` | Flip done status. Blocked if parent has incomplete steps. |
|
|
18
|
+
| `update` | `id`, `description` | Change description. |
|
|
19
|
+
| `delete` | `id` | Remove a quest. Blocked if parent has incomplete steps. Cascade-deletes done steps of a done parent. |
|
|
20
|
+
| `clear` | — | Remove completed quests. `all: true` removes everything. |
|
|
21
|
+
| `reorder` | `id`, `targetId` | Move a top-level quest before `targetId`. Steps cannot be reordered. |
|
|
22
|
+
| `reparent` | `id`, `parentId?` | Demote to step under `parentId`, or promote to top-level if `parentId` omitted. |
|
|
23
|
+
| `revert` | — | Undo the most recent mutating action. One level only. |
|
|
24
|
+
| `rules` / `skill` | — | Return this document. |
|
|
25
|
+
|
|
26
|
+
## Workflows
|
|
27
|
+
|
|
28
|
+
### Multi-step task
|
|
29
|
+
1. `add` top-level quests for the overall goal
|
|
30
|
+
2. `split` them into steps for each deliverable
|
|
31
|
+
3. Execute steps sequentially, `toggle` each done as you finish
|
|
32
|
+
4. `add` other top-level quests for other related work of this goal
|
|
33
|
+
4. `toggle` the parent done only after all steps are complete
|
|
34
|
+
|
|
35
|
+
### Delegation
|
|
36
|
+
1. `add` a quest for the delegated task
|
|
37
|
+
2. `spawn` the minion and assign the work
|
|
38
|
+
3. `toggle` the quest done when the minion returns successfully
|
|
39
39
|
|
|
40
40
|
### Reparenting
|
|
41
41
|
- Promote a step: `reparent <step-id>` (omit `parentId`)
|
|
42
42
|
- Demote a quest: `reparent <quest-id> <parent-id>`
|
|
43
43
|
- Move a step: `reparent <step-id> <new-parent-id>`
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- Steps cannot have nested steps. Only top-level quests can be parents.
|
|
48
|
-
- A parent with incomplete steps cannot be toggled done or deleted.
|
|
49
|
-
- Deleting a done parent cascade-deletes its done steps.
|
|
50
|
-
- Revert only undoes the most recent mutating action.
|
|
51
|
-
- Quest IDs are random hex strings shown in square brackets (e.g., `[01]`, `[a3f1]`).
|
|
52
|
-
- Always use the hex ID for actions, never the positional number.
|
|
45
|
+
### Cleanup
|
|
46
|
+
- `clear` completed quests before adding unrelated work. Keeps the log focused.
|
|
53
47
|
|
|
54
|
-
##
|
|
48
|
+
## Rules
|
|
55
49
|
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
50
|
+
- ALWAYS use quests for any work that involves multiple turns.
|
|
51
|
+
- NEVER try to nest steps. Only top-level quests can be parents.
|
|
52
|
+
- NEVER mark a parent as done if they have incomplete steps.
|
|
53
|
+
- NEVER delete a quest with incomplete steps.
|
|
54
|
+
- Use revert if you make a mistake to undo an action.
|
|
55
|
+
- ALWAYS use the hex ID, never the positional number when referring to quests in actions.
|
|
56
|
+
- ALWAYS Use `toggle` for done states. NEVER use `update` to append "DONE" or any completion marker to a description.
|
|
57
|
+
- If a parent toggle is blocked, check that all its steps are done first.
|
package/src/tools/handler.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentToolResult, ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
2
|
-
import type
|
|
2
|
+
import { type Static, Type } from "@sinclair/typebox";
|
|
3
3
|
import type { ResolvedConfig } from "../config.js";
|
|
4
4
|
import { logger } from "../logger.js";
|
|
5
5
|
import { QUEST_PROMPT_GATE, QUEST_PROMPT_REMINDER } from "../prompts.js";
|
|
@@ -106,7 +106,7 @@ function runTool(
|
|
|
106
106
|
? questLog.getAll()
|
|
107
107
|
: result.quest
|
|
108
108
|
? [result.quest]
|
|
109
|
-
:
|
|
109
|
+
: [];
|
|
110
110
|
|
|
111
111
|
return makeToolResult(result.message, questLog, displayQuests);
|
|
112
112
|
}
|
|
@@ -132,10 +132,10 @@ export function registerQuestTool(
|
|
|
132
132
|
label: "Quest",
|
|
133
133
|
description:
|
|
134
134
|
"Manage the session quest log and retrieve the complete quest system documentation. " +
|
|
135
|
-
"Use this VERY frequently to track tasks, plans, and progress. " +
|
|
136
135
|
"When you need to understand quests, steps, rules, or best practices, use action: 'skill' or action: 'rules'.",
|
|
137
136
|
promptSnippet:
|
|
138
|
-
"Manage quests and steps, or retrieve quest rules and best practices via skill/rules"
|
|
137
|
+
"Manage quests and steps, or retrieve quest rules and best practices via skill/rules. " +
|
|
138
|
+
"Use this VERY frequently to track tasks, plans, and progress. ",
|
|
139
139
|
promptGuidelines: [QUEST_PROMPT_GATE, ...QUEST_PROMPT_REMINDER],
|
|
140
140
|
parameters: createQuestParams(config.ids.length),
|
|
141
141
|
execute: (toolCallId, params, _signal, _onUpdate, _ctx) =>
|
|
@@ -143,4 +143,24 @@ export function registerQuestTool(
|
|
|
143
143
|
renderCall: renderQuestCall,
|
|
144
144
|
renderResult: renderQuestResult(config),
|
|
145
145
|
});
|
|
146
|
+
|
|
147
|
+
pi.registerTool({
|
|
148
|
+
name: "learn_quests",
|
|
149
|
+
label: "Learn Quests",
|
|
150
|
+
description: "Learn about the quest system and how to use it effectively.",
|
|
151
|
+
promptSnippet: "Use this tool to learn about the quest system and how to use it effectively.",
|
|
152
|
+
promptGuidelines: [
|
|
153
|
+
"Use this tool when on a session to understand how and when to use quests.",
|
|
154
|
+
"ALWAYS run this tool when on a new session before starting any work.",
|
|
155
|
+
],
|
|
156
|
+
parameters: Type.Object(
|
|
157
|
+
{},
|
|
158
|
+
{ description: "No parameters required for learning about quests" },
|
|
159
|
+
),
|
|
160
|
+
execute: async (_toolCallId, _params, _signal, _onUpdate, _ctx) =>
|
|
161
|
+
questToolExecute(questLog, "learn_quests", { action: QUEST_ACTIONS.skill }),
|
|
162
|
+
renderCall: (_args, theme, context) =>
|
|
163
|
+
renderQuestCall({ action: QUEST_ACTIONS.skill }, theme, context),
|
|
164
|
+
renderResult: renderQuestResult(config),
|
|
165
|
+
});
|
|
146
166
|
}
|