@astrofoundry/pi-astro 0.2.9 → 0.2.10

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.
@@ -0,0 +1,17 @@
1
+ import * as fs from "node:fs";
2
+ import * as os from "node:os";
3
+ import * as path from "node:path";
4
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
5
+
6
+ const CLAUDE_GLOBAL_PATH = path.join(os.homedir(), ".claude", "CLAUDE.md");
7
+
8
+ export default function claudeGlobalsExtension(pi: ExtensionAPI): void {
9
+ pi.on("before_agent_start", async (event) => {
10
+ if (!fs.existsSync(CLAUDE_GLOBAL_PATH)) return;
11
+ const content = fs.readFileSync(CLAUDE_GLOBAL_PATH, "utf-8").trim();
12
+ if (!content) return;
13
+ return {
14
+ systemPrompt: `${event.systemPrompt}\n\n<claude-global-rules source="~/.claude/CLAUDE.md">\n${content}\n</claude-global-rules>`,
15
+ };
16
+ });
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrofoundry/pi-astro",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Personal pi customizations (extensions, skills, prompts, themes) for the pi coding agent.",
5
5
  "keywords": [
6
6
  "pi-package"