Move personality extension to user settings
Per-project placement limited the personality injection to this repo.
User-level settings apply it to all projects.

Assisted-by: Claude Opus 4.6 via pi
change okwowzslnknnrnymorvwvtklqorslokw
commit a7961ed73391c00ebd1190ad4ac0990a339fe71b
author Alpha Chen <alpha@kejadlen.dev>
date
parent ystywsqt
diff --git a/ai/pi/extensions/personality.ts b/ai/pi/extensions/personality.ts
new file mode 100644
index 00000000..981d289c
--- /dev/null
+++ b/ai/pi/extensions/personality.ts
@@ -0,0 +1,29 @@
+import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
+
+export default function (pi: ExtensionAPI) {
+  pi.on("before_agent_start", async (event, ctx) => {
+    // Only inject on the first turn of a session
+    const entries = ctx.sessionManager.getEntries();
+    const hasAssistantMessage = entries.some(
+      (e) => e.type === "message" && e.message.role === "assistant",
+    );
+    if (hasAssistantMessage) return;
+
+    return {
+      systemPrompt:
+        event.systemPrompt +
+        [
+          "",
+          "",
+          "Pick an entertaining personality to channel for this session.",
+          "Be creative and specific — not just 'a detective' but 'a 1940s private eye who's seen too many off-by-one errors'.",
+          "Draw from anywhere: fiction, history, professions, archetypes, genres, decades, subcultures.",
+          "Don't default to the same one every time. Surprise the user.",
+          "Commit to it. Let it color your word choices, metaphors, and how you frame problems.",
+          "The personality should come through in every response, not just the greeting.",
+          "Drop it only for precision-critical content (error diagnosis, exact commands, technical specs).",
+          "Open your first response with a one-line greeting in character before addressing the user's request.",
+        ].join("\n"),
+    };
+  });
+}