pi-flow-enforcer

Enforces a strict workflow in pi.dev sessions:

Package details

extension

Install pi-flow-enforcer from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-flow-enforcer
Package
pi-flow-enforcer
Version
0.1.0
Published
Feb 9, 2026
Downloads
29/mo · 17/wk
Author
misile
License
unknown
Types
extension
Size
165 KB
Dependencies
0 dependencies · 4 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

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

README

pi-flow-enforcer

Enforces a strict workflow in pi.dev sessions:

plan -> blocking ambiguity questions -> /approve -> execute -> checkpoint proof -> commit

How it works

  • Auto-starts each session (when registered in .pi/settings.json)
  • Runs auto-context manager first (max 6 files or 24k chars)
  • Forces plan output in required Markdown schema
  • Asks blocking questions only when ambiguity is detected (max 5 per event)
  • Blocks execution changes until exact /approve
  • Stops execution immediately on failed assumptions/unexpected tool output
  • Enforces checkpoint proof before completion
  • Auto-generates Conventional Commit message and auto-commits per checkpoint
  • Stops and asks to split when big-commit threshold is exceeded

Register (project-local)

Install packages:

pi install pi-flow-enforcer
pi install pi-agent-pack

Then use project settings:

{
  "packages": [
    "pi-flow-enforcer",
    "pi-agent-pack"
  ]
}

File: .pi/settings.json

Approve execution

Execution is locked until you run:

/approve

Token matching is exact by default.

Configuration

Create .pi-flow-enforcer.json in repo root:

{
  "approvalToken": "/approve",
  "bigCommitThresholds": {
    "locChanged": 350,
    "filesChanged": 12
  },
  "contextManager": {
    "maxFiles": 6,
    "maxChars": 24000,
    "priorities": [
      "README*",
      "docs/README*",
      "docs/overview*",
      "docs/architecture*",
      "package.json",
      "pyproject.toml",
      "Cargo.toml",
      "go.mod",
      "CONTRIBUTING*",
      "Makefile",
      "justfile",
      "main.*",
      "index.*",
      "app.*"
    ]
  },
  "commitStyle": "conventional"
}