@matyah00/openpi

extensionmaintained

Comprehensive, high-performance, and safety-hardened Pi-native multi-agent orchestration package, featuring advanced workflows, damage-control rules, and developer tooling.

by · v0.2.0 · published 2mo ago

$ pi install npm:@matyah00/openpi
downloads/mo
143
stars
0
last push
2mo ago
open issues
0

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

221 downloads · last 12 weeks (weekly)

README

OpenPi

A Pi-native command, skill, agent, workflow, and theme pack for serious coding sessions.

npm version license Pi native Pi install

Core Idea Install Quick Start What You Get Profiles Commands Agents Tools Architecture


The Core Idea

OpenPi turns Pi into a richer engineering environment without copying another assistant's file layout.

It uses Pi-owned package surfaces:

  • prompts/*.md for slash-command prompt templates
  • skills/*/SKILL.md for Pi skills
  • agents/*.md for specialist role prompts
  • extensions/*.ts for native Pi commands, tools, profile switching, themes, and workflow orchestration
  • themes/*.json for terminal UI themes
Plain Pi session                         OpenPi session

Manual project scan                      /prime and /explore orient the session
Ad hoc planning                          /spec, /clarify, /blueprint, /debate
One long assistant context               spawn_agents delegates to role agents
Manual grep/tree work                    project_tree and code_search_batch
Manual safety checks                     secret_scan, env_scan, ghost_test_scan
Lost session reasoning                   /snapshot, goal_state, write_snapshot
One profile for every task               /openpi use <profile>

OpenPi is not a project template. It is a reusable Pi package you install once and activate per project or globally.


Install

npm i @matyah00/openpi

For Pi:

pi install npm:@matyah00/openpi

Restart Pi after install, then activate a profile:

/openpi use full
/reload

The npm names openpi and open-pi are blocked by npm's package-name similarity policy, so the public npm package is:

@matyah00/openpi

Quick Start

/openpi list                 show every profile
/openpi use commands         enable prompt commands and core tools
/openpi use workflow         enable /add, /fix, /review and spawn_agents
/openpi use guard            enable security, dependency, and ship gates
/openpi use commands+guard   combine multiple profiles (e.g. focus+safety)
/openpi use full --dry-run   preview profile settings changes without writing
/openpi use full             enable the broad OpenPi surface
/openpi clear                remove OpenPi-managed extensions

Use --global to install the selected profile into your global Pi settings:

/openpi use full --global

Profiles update .pi/settings.json. Run /reload or restart Pi after switching.


What You Get

OpenPi
  13 profiles          choose or compose a focused runtime surface
  23 prompt commands   /prime, /blueprint, /deep, /ship, /refactor, ...
  42 agent prompts     planner, reviewer, tester, api-designer, Pi experts
  9 skills             ultrathink, test-first, refactor-guide, bowser, ...
  11 themes            tokyo-night, rose-pine, gruvbox, nord, dracula, ...
  Native tools         search, audit, state, snapshot, dispatch, chains
  Audit Telemetry      structured JSONL audit logging to .pi/logs/

OpenPi is designed around one practical rule: load only the surface you need.

NeedProfileWhat it adds
Slash commandscommandsPrompt commands, search tools, state tools, theme switching
Explore a repoexploreTree/search/discovery workflows
Implement workworkflow/add, /fix, /review, spawn_agents
Pre-ship safetyguardSecurity, dependency, environment, and test-integrity tools
Focused UIfocusMinimal Pi UI plus theme defaults
Session purposepurposeKeeps task purpose visible while working
MetricsmetricsModel, context, branch, token, cost, and tool counters
PersonassystemSwitch active system persona from bundled agents
TeamsteamDispatcher-only role team with dispatch_agent
ChainschainSequential workflow runner with run_chain
EverythingfullCommands, workflow, safety, metrics, personas, teams, chains

Commands

OpenPi prompt commands are markdown templates with frontmatter metadata. They are loaded from the package and can be extended by project-local .pi/prompts/*.md.

Planning and reasoning

CommandPurpose
/primeLoad project orientation before work
/specTurn a vague feature into a structured spec
/clarifyAsk focused clarification questions before coding
/blueprintBuild an implementation blueprint before risky work
/debateRun adversarial decision analysis for tradeoffs
/deepUse deeper evidence-led reasoning for hard bugs or architecture
/plan-teamCreate a team-oriented implementation plan

Discovery and state

CommandPurpose
/exploreMap relevant files and code paths
/goalManage durable task goals in .pi/memory/goals.md
/snapshotSave a continuation checkpoint before compaction
/compressCompress current task context into a handoff brief
/commandsList loaded OpenPi and project prompt commands
/command:statusShow command loader status and collisions

Quality and release

CommandPurpose
/code-reviewReview code or changes for bugs and missing tests
/testSelect or design focused validation
/validateRun targeted validation for current work
/depsAudit dependency manifests, lockfiles, pins, and update risk
/ghost-testDetect vacuous tests and reward-hacking test patterns
/sentinelRead-only security and environment safety scan
/shipPre-ship gate for tests, security, dependency risk, and git readiness
/parallelPlan safe parallel work with ownership checks

Agent Workflows

The workflow profile adds high-level commands that prompt Pi to use role agents and verification steps.

/add <feature>       discover files -> plan -> edit -> test -> review
/fix <bug>           reproduce/inspect -> plan -> patch -> validate -> review
/review [scope]      read-only review over diff or requested scope
/openpi-agents       list available role agents

OpenPi role agents include:

AgentRole
file-pickerFinds relevant files and line ranges before edits
plannerProduces scoped implementation plans
editorPerforms isolated edits when the plan is clear
testerSelects and runs targeted validation
reviewerReviews diffs for bugs, regressions, and missing tests
security-auditorChecks secrets, risky automation, and security-sensitive changes
problem-architectTurns ambiguous work into a concrete team spec
spec-reviewerChallenges unclear requirements before implementation
ship-guardReviews release readiness
red-teamChallenges plans and assumptions
api-designerReviews REST/GraphQL APIs for design and naming consistency
perf-auditorEvaluates bundle sizes, N+1 queries, and resource leaks
migration-expertPlans database and architecture migration sequences
docs-writerGenerates/maintains READMEs, manuals, and architecture documents

The spawn_agents tool can run agents sequentially or in parallel as isolated Pi subprocesses. It returns structured outputs: files, line ranges, commands, exact validation output, findings, and assumptions.


Team and Chain Modes

OpenPi has two orchestration modes for larger work.

Team dispatcher

/openpi use team
/agents-list
/agents-team guard

The team profile registers dispatch_agent and uses teams from agents/teams.yaml, including:

TeamAgents
researchscout, directory-lister, glob-matcher, code-searcher, librarian, documenter, red-team
validationtester, basher, reviewer
guardsecurity-auditor, rule-verifier, ship-guard, spec-reviewer
frontendscout, frontend, reviewer
backendscout, backend, reviewer
pi-piPi package, extension, skill, prompt, config, theme, TUI, CLI, and keybinding experts
perfscout, perf-auditor, planner, reviewer
docsscout, docs-writer, reviewer
apiscout, api-designer, reviewer
migrationscout, migration-expert, planner, reviewer

Chain runner

/openpi use chain
/chain-list

The chain profile registers run_chain for sequential workflows from agents/agent-chain.yaml:

ChainFlow
plan-build-reviewplanner -> builder -> reviewer
research-planscout -> red-team -> planner
deep-exploredirectory-lister -> code-searcher -> thinker
evidence-validatecode-searcher -> tester -> reviewer
spec-to-planproblem-architect -> spec-reviewer -> planner
ship-gatesecurity-auditor -> ship-guard -> reviewer
pi-package-designPi experts -> planner
refactor-flowscout -> problem-architect -> planner -> reviewer
docs-flowscout -> docs-writer -> reviewer
perf-auditscout -> perf-auditor -> planner
full-lifecycleproblem-architect -> planner -> plan-reviewer -> builder -> tester -> reviewer

Tooling

OpenPi registers native Pi tools through profiles.

ToolPurpose
project_treeReturn a scoped project tree with ignore handling (supports file sizes)
code_search_batchRun multiple code searches in one call (supports case-sensitivity & regex toggle)
env_scanDetect stack, package managers, scripts, and environment clues (24+ frameworks)
secret_scanSearch for 22 types of cloud keys, tokens, credentials, and high-entropy hex strings
ghost_test_scanFind weak, empty, mocked-everything, self-comparing, or reward-hacked tests
sast_scanStatic Application Security Testing for eval, SQL concat, SSRF, CORS wildcards, and XSS
dependency_inventorySummarize dependency manifests and lockfiles
session_stateRead current session state
goal_stateRead goal memory state
write_snapshotWrite a continuation snapshot
parallel_safety_checkCheck file ownership overlap before parallel work
spawn_agentsRun role agents as isolated Pi subprocesses (supports retries & timeouts)
dispatch_agentDispatch to the active specialist team
run_chainRun a named sequential agent chain (supports step timeouts, continueOnError, & $STEP_N)

Skills

OpenPi ships focused Pi skills:

SkillUse it for
ultrathinkHard debugging, architecture tradeoffs, root-cause analysis
test-firstProduction code, bug fixes, refactors, validation planning
security-guardCredentials, env files, external code, automation, deploy risk
spec-drivenVague requirements, unclear features, acceptance criteria
session-continuityLong context, resuming, stopping, compaction handoffs
env-scannerUnknown repos, setup issues, stack detection
bowserPlaywright-powered browser automation and UI testing
refactor-guideGuides safe codebase refactoring with code smell detection and verification
perf-auditorStructured resource profiling and runtime execution optimization

Themes and UI Profiles

OpenPi includes 11 bundled themes:

catppuccin-mocha  cyberpunk  dracula  everforest  gruvbox
midnight-ocean    nord       ocean-breeze  rose-pine
synthwave         tokyo-night

Use the theme profile or the full profile, then:

/theme
/theme tokyo-night

UI-oriented profiles:

ProfilePurpose
focusMinimal, distraction-free Pi UI
metricsStatus bar and usage metrics
tool-widgetLive per-tool usage counts
purposeSession purpose gate and visible task focus
safetyDamage-control rules and actionable blocked-tool feedback

Architecture

OpenPi is a package, not a project scaffold.

@matyah00/openpi
  package.json              Pi package manifest
  prompts/                  prompt commands
  skills/                   Pi skills
  agents/                   role agents, teams, chains
  extensions/               native Pi extensions and tools
  themes/                   terminal UI themes
  damage-control-rules.yaml safety feedback rules

The activation flow is explicit:

1. Install package with Pi
2. Run /openpi use <profile>
3. OpenPi writes selected extension paths into .pi/settings.json
4. Run /reload or restart Pi
5. Use only the commands/tools for that profile

This keeps OpenPi portable across projects. You can add project-specific prompts and agents in .pi/prompts and .pi/agents; OpenPi will load them alongside the bundled resources where the active profile supports it.


Why It Is Different

Without OpenPiWith OpenPi
One generic assistant flowProfiles for planning, workflow, guard, team, chain, UI
Manual project discovery/explore, project_tree, code_search_batch
Vague implementation prompts/spec, /clarify, /blueprint, problem-architect
Manual review discipline/review, reviewer, ship-guard, ghost_test_scan
One large contextspawn_agents, dispatch_agent, run_chain
Repeated session loss/snapshot, write_snapshot, goal_state
Ad hoc security checkssecret_scan, /sentinel, security-guard
Same UI for every taskfocus, metrics, purpose, tool-widget, safety profiles

Verified

Before publish, the package is checked with:

npm pack --dry-run
npx tsc --noEmit
npm install @matyah00/openpi@latest --dry-run

Current npm package:

npm i @matyah00/openpi
pi install npm:@matyah00/openpi

License

MIT - haytamAroui