@dreadedzombie/pi-init 1.1.0 → 1.3.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/package.json +1 -1
- package/src/index.ts +19 -6
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -60,12 +60,13 @@ const TEMPLATE_RESEARCH = `# Research Agent
|
|
|
60
60
|
|
|
61
61
|
**Started:** <!-- Pi: insert today's date (YYYY-MM-DD) -->
|
|
62
62
|
|
|
63
|
-
## Output Rule — Files
|
|
64
|
-
**
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
63
|
+
## Output Rule — Files Before Chat
|
|
64
|
+
**Never summarize findings in chat.** Every finding goes into a file.
|
|
65
|
+
- Create \`research/<topic>.md\` as you complete each topic — not at the end
|
|
66
|
+
- Update the Research Findings section in this file after writing each doc
|
|
67
|
+
- Chat response comes last, only to say what files were written and what to do next
|
|
68
|
+
- **If you are about to type a finding into chat — stop. Write it to a file instead.**
|
|
69
|
+
- The goal is a handoff document set for the next agent, not a conversation
|
|
69
70
|
|
|
70
71
|
## Search Protocol
|
|
71
72
|
- Run at least **4 distinct queries** approaching the topic from different angles before drawing conclusions
|
|
@@ -264,6 +265,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
264
265
|
: TEMPLATE_CODE;
|
|
265
266
|
|
|
266
267
|
fs.writeFileSync(dest, content, "utf8");
|
|
268
|
+
|
|
269
|
+
// ── Research: scaffold research/ dir and plan.md so Pi fills in existing files ──
|
|
270
|
+
if (type === "research") {
|
|
271
|
+
const researchDir = path.join(cwd, "research");
|
|
272
|
+
if (!fs.existsSync(researchDir)) fs.mkdirSync(researchDir);
|
|
273
|
+
const planPath = path.join(researchDir, "plan.md");
|
|
274
|
+
if (!fs.existsSync(planPath)) {
|
|
275
|
+
fs.writeFileSync(planPath, `# Research Plan\n\n## Topic\n<!-- What are we researching? -->\n\n## Sub-topics to investigate\n<!-- Pi: list each angle you will cover, one per line. Write a <topic>.md file for each. -->\n\n## Key questions to answer\n<!-- Pi: what specific questions must be answered by the end of this session? -->\n\n## Known starting points\n<!-- Pi: any URLs, files, or repos already identified as relevant -->\n`, "utf8");
|
|
276
|
+
}
|
|
277
|
+
ctx.ui.notify(`[pi-init] research/plan.md created — Pi will fill this in before searching`, "info");
|
|
278
|
+
}
|
|
279
|
+
|
|
267
280
|
ctx.ui.notify(`[pi-init] AGENTS.md (${type}) written to ${cwd}`, "info");
|
|
268
281
|
ctx.ui.notify(getFollowUp(type), "info");
|
|
269
282
|
},
|