← Catalog

pi-sync-instructions

Pi extension that compiles a folder of agent instructions (INDEX.md + linked files) into Pi's AGENTS.md on startup.

Extension

Install

Install with PiG

pig install npm:pi-sync-instructions

Install with Pi

pi install npm:pi-sync-instructions
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./extensions/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 1.0.0 (README.md). PiG does not review it.

pi-sync-instructions

A Pi extension that compiles a folder of agent instructions into Pi's AGENTS.md on every session start.

The folder must contain an INDEX.md that links to instruction files as ./name.md. Each linked file that exists is appended to <agent dir>/AGENTS.md (default ~/.pi/agent/AGENTS.md).

Install

pi install npm:pi-sync-instructions

Configure the instructions folder

Default: ~/.agents/instructions. Precedence, highest first:

  1. CLI flag: pi --instructions-dir ~/my/instructions
  2. Env var: PI_SYNC_INSTRUCTIONS_DIR=~/my/instructions
  3. Config file ~/.pi/agent/sync-instructions.json (honours PI_CODING_AGENT_DIR):
    {
      "instructionsDir": "~/my/instructions",
      "outputFile": "~/.pi/agent/AGENTS.md",
      "logFile": "~/.pi/instructions-sync.log"
    }
    
  4. ~/.agents/instructions

~ is expanded; relative paths resolve from the current directory. outputFile and logFile are optional.

Usage

  • Sync runs automatically on session_start. Errors show as notifications.
  • Run /sync-instructions to re-sync without restarting.
  • Sync history is appended to the log file.

Development

npm test
pi -e ./   # try locally

License

MIT