π pi-project-profile

Project-aware π (pi) coding agent with a verification gate. Detects any repository's stack, commands, conventions and instruction files (AGENTS.md, CLAUDE.md, .cursorrules, …), injects them as a stable <project_profile> system-prompt section, then runs the project's own typecheck, lint, tests and build after every agent turn — with a bounded self-repair loop and a review of the agent's diff. It never writes into the repository.

pi install npm:@lenard9191/pi-project-profile
Terminal screenshot: the injected project profile on the left, and the verification of an agent turn — typecheck and lint results and a repair round — on the right

What it does

Installs, migrations, deploys and anything network-bound are never run. Cache and settings live under ~/.pi/agent/project-profile/. Requires π ≥ 0.87 and Node ≥ 22.18; no runtime dependencies; MIT.

What the agent sees

<project_profile>
- Project: zod — ~/projects/zod · remote github.com/colinhacks/zod · ~741 tracked files
- Stack: monorepo: pnpm workspaces (8 packages) · pnpm · Vite · Vitest
- Commands: install `pnpm install` · typecheck `pnpm exec tsc --noEmit -p tsconfig.json` · lint `pnpm run lint` · test `pnpm run test` · test one `pnpm exec vitest run <file> -t "<name>"`
- Conventions: ESM · Prettier · Biome · Husky git hooks · License: MIT
- Tests: `*.test.ts` in tests/ (202)
- Instruction files: AGENTS.md (loaded) · .cursorrules (22 KB — read it when relevant)
- Verification: after each turn that changed files, the harness runs `pnpm exec tsc --noEmit -p tsconfig.json`, `pnpm run lint:check` automatically; asks once before running tests
</project_profile>

Verification tiers

TierExamplesPolicy
syntaxnode --check, python -c ast.parse, ruby -c, bash -n, JSON parseautomatic, changed files only
fasttsc --noEmit, cargo check, go build/go vet, mypy/pyright, mix compile, dart analyzeautomatic
linteslint, biome, prettier --check, ruff, cargo fmt --check/clippy, gofmt, rubocop, swiftlintautomatic
testnpm test, cargo test, pytest, go test, rspec, mix test, phpunit, swift test, ./gradlew testconfirmed once per repo
buildpnpm build, ./gradlew compile*, swift build, zig build, cmake --buildconfirmed once per repo

Pre-existing failures (a repository that was already red) are hidden from the agent and reported to you once. Tests are narrowed to the changed files when that is safe (vitest related, jest --findRelatedTests, go test ./<pkg>/..., cargo test -p, pytest <files>); monorepo packages are checked in their own directory. Format and lint failures come with the exact auto-fix command.

Coverage

Node/TypeScript (npm, pnpm, yarn, bun; workspaces, Turborepo, Nx), Deno, Rust, Go, Python (uv, poetry, pdm, pipenv, hatch), Ruby, JVM (Gradle, Maven, Kotlin, Android), .NET, Swift, PHP, Elixir, Dart/Flutter, C/C++ (CMake, Meson), Zig, Haskell, Scala, OCaml, Gleam, Erlang, Terraform, shell, Lua, Perl, plus Makefile/justfile/Taskfile targets, Bazel, CI files (GitHub Actions, GitLab, CircleCI, Azure, Travis, Jenkins, Buildkite, Bitbucket), docker-compose services and umbrella repositories. Tested on macOS, Linux and Windows.

Commands and tool

/profileshow the profile, checks, availability and cache path
/profile doctorrequired vs installed runtimes, tool and dependency availability, fix commands (never run)
/profile set <key> <cmd>override typecheck, lint, test, build, … (- disables)
/profile tests allow|deny|asktest-tier permission (same for build)
/verify [fast|lint|test|build|all] [file…]run checks now, showing every failure
run_checksthe same, as a tool the model can call mid-task

The package also ships an Agent Skill (/skill:project-profile) that the model loads on demand to interpret verification messages and explain configuration. Full reference: README.

FAQ

Does it work with Claude Code, Cursor, Codex or GitHub Copilot?

It is an extension for the π coding agent only. It does read the instruction files those tools use (CLAUDE.md, .cursorrules, .cursor/rules, copilot-instructions.md, .github/instructions, Windsurf and Cline rules, GEMINI.md, codex.md), so a repository already set up for them is understood by π with no extra configuration.

Does it change anything in my repository?

No. Detection is read-only; the cache and per-repo settings live under ~/.pi/agent/project-profile/ and logs under $TMPDIR/pi-project-profile/. The automatic checks are the project's own read-only commands; auto-fix commands are suggested, never run.

Will it run my tests or builds automatically?

Only after you allow it once per repository. Typecheck and lint run automatically because they are read-only. Installs, migrations, deploys and anything that needs the network are never run.

What happens when a check fails?

The failing diagnostics go back to the agent, which must fix the cause — not disable the check — and end its turn; the checks re-run. After three rounds, or when a round changes nothing or repeats the same failure, the loop stops and the agent summarizes what is still failing instead of claiming success.

Does it break prompt caching?

No. The <project_profile> section contains no timestamps, branch names or iteration-order-dependent content, so it is byte-identical for every turn of a session.

The detected command is wrong. How do I fix it?

/profile set <key> <command> overrides one key for the repository (use - to disable it); /profile doctor explains missing tools; /profile refresh re-detects; /profile note persists guidance for the agent.