@yefengr/pi-task-efficiency

Task efficiency review for Pi with scope confirmation, deterministic metrics, and actionable suggestions

Packages

Package details

extensionskill

Install @yefengr/pi-task-efficiency from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@yefengr/pi-task-efficiency
Package
@yefengr/pi-task-efficiency
Version
0.1.2
Published
Oct 23, 2026
Downloads
612/mo · 612/wk
Author
yefengr
License
MIT
Types
extension, skill
Size
209.6 KB
Dependencies
0 dependencies · 4 peers
Pi manifest JSON
{
  "skills": [
    "./skills"
  ],
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

@yefengr/pi-task-efficiency

A Pi task efficiency review extension maintained by yefengr. It reviews completed tasks in a separate session, reports verifiable time, token, cost, tool, and subagent metrics, and turns improvement suggestions into concrete files or rules.

Installation

Requires Node >= 22.19 and Pi 1.x.

pi install npm:@yefengr/pi-task-efficiency

After installation, run /reload or restart Pi. The package also ships the package-bundled skill analyze-task-efficiency, which Pi discovers automatically after installation.

Usage

/task-efficiency

This command creates a separate review session and does not replace the current working session. The review flow always has four steps:

  1. task_efficiency_read_scope_page reads the latest compact task scope page.
  2. task_efficiency_propose_scope submits the full candidate scope and waits for the user to confirm or correct it.
  3. If the boundary is still ambiguous, task_efficiency_expand_scope reads bounded detailed fragments.
  4. After the user confirms, call task_efficiency_analyze and write the review using only the returned deterministic report.

The model does not compute metrics on its own, and model text is never treated as confirmation. No report can be produced before the scope is confirmed.

Metric definitions

  • Times are deterministic ranges for the parent session, the subagents, and the combined total; model estimates are not used.
  • usage reports parent, children, and combined separately; reasoning is a subset of output and is not counted twice.
  • Cost only aggregates the usage.cost already persisted in Pi session JSONL files; no price table is maintained.
  • The overhead of the review session itself is isolated from the source task cost and is never mixed into the source task metrics.
  • coverage.complete only means the core fields required by the report are complete; it does not cover optional fields.

Read-only boundaries

The extension only reads session records that Pi has already persisted. It does not modify the project, configuration, memory, samples, or observations. Improvement suggestions produced by the review are suggestions only and are never written to files directly.

Development

npm ci
npm run typecheck
npm test

TUI smoke:

npm run test:tui-smoke

License

MIT, see LICENSE.