npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-agent-goal

v2026.7.16

Published

Pi extension that gives coding agents persistent /goal workflows with branch-aware state, source imports, progress tools, and explicit start handoffs.

Readme

Pi Agent Goal

Pi Agent Goal adds persistent /goal workflows to Pi. Use it to set a long-running objective, import context from docs, track progress, keep state aligned with branch history, and start agent work only when you ask for it.

Repository: KristjanPikhof/Pi-Agent-Goal

Compatibility

Release 2026.6.14 requires Node.js >=22.19.0.

The package supports @earendil-works/pi-coding-agent >=0.80.5 <0.81.0 and @earendil-works/pi-tui >=0.79.3 <0.81.0. Development and release validation use both packages at ^0.80.7. The coding-agent floor is required because continuation scheduling uses agent_settled.

Published package contents must include extensions, src, README.md, docs, and LICENSE. Keep docs links relative so they work from both GitHub and npm tarballs.

Quick start

pi install npm:pi-agent-goal
pi

Then run:

/goal

With no saved goal, /goal shows help. To create one interactively:

/goal Ship the onboarding cleanup

Pi asks the chat agent to draft a concise objective and acceptance criteria. In the TUI, review the draft, then choose Start, Edit, or Cancel. Nothing is saved until you choose Start.

If a goal already exists, start one explicit agent handoff with:

/goal start

Non-interactive starts

Plain non-interactive /goal <objective> --start does not save or start work by itself. It only queues the agent-mediated draft/review path, which still needs propose_goal_draft and review before persistence.

Use an already-approved path when a non-interactive run should begin immediately:

pi -e npm:pi-agent-goal -p "/goal import docs/prd.md --yes --start"
pi -e npm:pi-agent-goal -p "/goal resume --start"

Install options

| Need | Command | | --------------------- | --------------------------------------------- | | Global install | pi install npm:pi-agent-goal | | Project-local install | pi install -l npm:pi-agent-goal | | One-off run | pi -e npm:pi-agent-goal | | Local checkout run | pi --no-extensions -e ./extensions/index.ts |

See docs/setup.md for settings.json examples and local development links.

Commands

| Command | What it does | | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | /goal | Show help or the current goal summary. | | /goal <objective> [--start] | Ask the chat agent to draft a reviewable goal with propose_goal_draft. Interactive Start saves and queues one handoff. Edit opens the draft editor. Cancel saves nothing. Recognized flags such as --replace and --start are stripped from the objective. | | /goal start | Queue one explicit handoff for the current active goal. This is not automatic continuation. | | /goal status | Show objective, status, criteria, constraints, source docs, progress, blockers, and next commands. | | /goal import <path> [--yes] [--start] | Import a markdown/text PRD file or docs folder. Creates a goal when none exists. Merges docs, constraints, and criteria into an existing active goal without rewriting the objective. Non-interactive mode needs --yes; add --start to begin immediately. | | /goal edit | Edit the objective and acceptance criteria in the interactive UI. Non-interactive mode should use /goal <objective> --replace. | | /goal pause | Pause the goal and stop hidden context, continuation, completion, and progress updates. | | /goal resume [--start] | Reactivate a paused goal. Add --start for an immediate non-interactive handoff. | | /goal complete [--yes] | Mark an active goal complete. | | /goal clear [--yes] | Clear the current goal and hide goal UI. |

How plain goal review works

Plain /goal text is a drafting request, not direct persistence. The command asks the chat agent to call propose_goal_draft once with:

  • a concise objective,
  • concrete acceptance criteria,
  • optional source paths.

Only the reviewed objective, criteria, and source paths are saved. If the model replies in prose instead of calling the tool, no goal is saved. If review UI is unavailable, the tool returns review_ui_unavailable and saves nothing.

Model tools

The extension exposes narrow tools on purpose:

  • get_goal, read current goal state and source paths.
  • create_goal, create an already-approved goal only when explicit_request is true and no goal exists.
  • propose_goal_draft, open the Start/Edit/Cancel review flow for agent-drafted /goal proposals.
  • complete_goal, mark an active goal complete with optional evidence.
  • update_goal_progress, update progress only.

Expected denials, such as no active goal or missing authorization, return soft refusals with details.status: "refused". Invalid input and unexpected failures remain hard tool errors.

State and autonomy

Canonical state is stored as Pi session custom entries of type goal-state. The extension reconstructs state from ctx.sessionManager.getBranch(), so forks, /tree, reload, and resume follow the selected branch instead of a global latest value.

Active goals inject a short hidden goal-context before agent turns. Compaction preserves objective, criteria, source doc briefs, and progress in summary details. Full imported docs are not repeatedly pasted into model context.

/goal start and --start queue one explicit handoff. They do not enable background work.

Automatic continuation is separate and opt-in:

pi -e npm:pi-agent-goal --goal-continuation
pi -e npm:pi-agent-goal --goal-continuation --goal-continuation-max-turns 3

Continuation finalizes and considers the next turn on agent_settled, after Pi has finished retries, auto-compaction retries, and queued continuations. It only queues when the goal is active, Pi is idle, no pending user messages exist, and the stale-goal and max-turn guards pass.

Known Codex parity gaps

These gaps are intentional for this Pi-native release:

  • no Codex SQLite thread_goals table or app-server RPC compatibility,
  • no exact Codex token budget or wall-clock accounting,
  • no exact Codex goal menu or bottom-pane UI,
  • no general model update_goal tool,
  • no automated proof of live TUI lifecycle behavior.

Live TUI smoke for /compact, /reload, /resume, /tree, /fork, and the visible active-goal widget remains manual and release-blocking. Record evidence before release, or mark the release blocked. Automated tests cover the underlying hooks and reconstruction behavior, not the live terminal.

Troubleshooting

| Symptom | Fix | | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | Import path is outside the workspace | Run from the workspace root or move the file inside it. Realpaths are checked, including symlink escapes. | | Import requires --yes | Non-interactive mode cannot confirm. Review the source, rerun with --yes, and add --start only if work should begin immediately. | | Directory import has too many docs | Narrow the path or raise maxFiles in code/tests. Import fails rather than silently truncating. | | Replacement fails non-interactively | Use /goal <objective> --replace to authorize the replacement draft. It still saves only after review unless you use an approved persistence path. | | /goal edit fails | The editor is interactive-only. Use /goal <objective> --replace instead. | | Draft queued but no review appears | The chat agent must call propose_goal_draft. A prose answer saves nothing. | | review_ui_unavailable | Run the review path in the Pi TUI, or use an explicitly approved create_goal request. | | Continuation does not start | Launch with --goal-continuation, keep the goal active, wait for idle, and make sure no user messages are pending. | | Goal looks stale after branch navigation | Run /goal status; state is reconstructed from the selected branch. |

Local verification

Canonical release checks are listed in docs/acceptance-criteria.md.

npm run typecheck
npm run lint
npm run format
npm test
npm run test:coverage
npm pack --dry-run
npm run smoke:pi
npm run smoke:package

More docs

License

MIT. See LICENSE.