@bacnh85/pi-init

Guided AGENTS.md generation for Pi — /init scans the repo (package.json, CI, dir structure) and generates/updates AGENTS.md with build/test/lint commands, architecture, and conventions. Inspired by OpenCode's /init.

Packages

Package details

extension

Install @bacnh85/pi-init from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@bacnh85/pi-init
Package
@bacnh85/pi-init
Version
0.1.0
Published
Aug 8, 2026
Downloads
108/mo · 15/wk
Author
bacnh85
License
MIT
Types
extension
Size
12 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/index.js"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-init

Guided AGENTS.md generation for Pi.

/init scans your repo (package.json, build configs, CI, directory structure), detects what's there, and generates or updates AGENTS.md with concise project-specific guidance: build/test/lint commands, tech stack, repository structure, and conventions. Inspired by OpenCode's /init. Zero dependencies, plain JS.

Install

pi install npm:@bacnh85/pi-init

Commands

Command Description
/init Scan the repo and generate/update AGENTS.md (preserves existing content)
/init force Regenerate AGENTS.md from scratch
/init check Report detected commands and what's missing, without writing

What it does

  1. Repo introspection — reads package.json (scripts, deps, workspaces), detects package managers (npm/pnpm/yarn/bun), build systems (make/cargo/go/python/maven/gradle/cmake/elixir), CI configs (GitHub Actions, GitLab, CircleCI, etc.), and top-level directories.
  2. Prompt construction — builds a focused instruction covering the sections a context file needs, with real commands extracted from your scripts (never invented).
  3. Delegation — sends the prompt to the current model via pi.sendUserMessage(). The model uses Pi's existing read/write tools to produce AGENTS.md.

The model does the writing; this package only owns the scan and the prompt.

Why

Pi loads AGENTS.md at startup as project context. Starting a new project with a blank context file is friction — /init bootstraps it from what's actually in the repo.

License

MIT