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 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
- [![version 0.6.1](https://img.shields.io/badge/version-0.6.1-blue)](CHANGELOG.md)
3
+ [![version 0.6.2](https://img.shields.io/badge/version-0.6.2-blue)](CHANGELOG.md)
4
4
  [![MIT license](https://img.shields.io/badge/license-MIT-green)](LICENSE.md)
5
5
  [![pi extension](https://img.shields.io/badge/pi-extension-purple)](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent)
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-quests",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "A quest-log for your pi. Keep your agent on track, one quest at a time.",
5
5
  "type": "module",
6
6
  "keywords": [
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 quest tool to track your work. Use action: 'skill' for usage documentation.";
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 (tracker.hasUsedQuestTool) return undefined;
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
  };
@@ -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
- ## When to use quests
9
-
10
- Use the quest tool at the start of any non-trivial task. If the request involves multiple steps, files, tool calls, or minion delegation, track it with quests.
11
-
12
- ## Capabilities
13
-
14
- | Action | Purpose |
15
- |--------|---------|
16
- | `add` | Create top-level quests |
17
- | `split` / `add_step` | Break a quest into steps under a parent |
18
- | `reparent` | Promote, demote, or move a quest/step via optional `parentId` |
19
- | `toggle` | Mark a quest or step done/undone |
20
- | `update` | Change a quest description |
21
- | `delete` | Remove a quest or step |
22
- | `clear` | Remove completed quests (or all with `all: true`) |
23
- | `reorder` | Change the priority order of top-level quests |
24
- | `revert` | Undo the most recent mutating action |
25
- | `list` | View all quests and steps |
26
-
27
- ## Common patterns
28
-
29
- ### Multi-step task workflow
30
- 1. Add many top-level quests for the overall goal
31
- 2. Split them into steps for each distinct deliverable
32
- 3. Execute steps sequentially, toggling each done as you finish
33
- 4. Toggle the parent quest done only after all steps are complete
34
-
35
- ### Delegation workflow
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
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
- ## Rules
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
- ## Gotchas
48
+ ## Rules
55
49
 
56
- - Use toggle for done states. NEVER use `update` to append "DONE", "- DONE", or any completion marker to a quest description.
57
- - IDs are hex, not positional. The list shows `#1 [01] ...`. Use `01` in tool calls, not `1`.
58
- - Steps cannot be reordered independently. Use `reorder` on top-level quests only.
59
- - Clear completed quests before adding unrelated work. This keeps the log focused and reduces context noise.
60
- - Parent blocked?: If you cannot toggle a parent done, check that all its steps are toggled done first.
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.
@@ -1,5 +1,5 @@
1
1
  import type { AgentToolResult, ExtensionAPI } from "@mariozechner/pi-coding-agent";
2
- import type { Static } from "@sinclair/typebox";
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
- : undefined;
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
  }