pi-update
Skill3 starsChanged 2 months agoApache-2.0View on GitHub
Update the pinned @earendil-works/pi-coding-agent package to the latest version in this repo and triage the upstream changelog. Use when the user says "update pi", "bump pi", "update @earendil-works/pi-coding-agent", "upgrade pi-coding-agent", "keep pi up to date", or mentions the Pi coding agent version, its changelog, or new Pi features/extensions to adopt. Always checks the upstream Pi coding-agent CHANGELOG (https://github.com/earendil-works/pi/blob/main/packages/coding-agent/CHANGELOG.md) for breaking changes and for new useful features Argos could implement.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-composition-patterns/AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- argos-data-importSkill
- argos-releaseSkill
- argos-sddSkill
- awwwards-animationsSkill
- baseline-uiSkill
- bun-file-ioSkill
- design-taste-frontendSkill
- fork-syncSkill
- react-doctorSkill
- shadcnSkill
- tanstack-formSkill
- tanstack-pacerSkill
- tanstack-querySkill
- tanstack-rangerSkill
- tanstack-routerSkill
- tanstack-storeSkill
- tanstack-tableSkill
- tanstack-virtualSkill
- turborepoSkill
- vercel-composition-patternsSkill
- vercel-react-best-practicesSkill
- vgpuSkill
- viteSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 77
Update the version in the workspace catalog (root package.json, workspaces.catalog) to the exact target version (keep it pinned, no ^).
- Very specific: line 78
Run bun install to update bun.lock.
- Very specific: line 95
Follow the repo's Specification-Driven Development workflow (see .agents/skills/argos-sdd) for any code adaptation needed.
- Distinctive: line 104
If the Pi worker no longer starts or emits, or typecheck fails on the new API, stop and report the specific breaking entry from the …
- Distinctive: line 122
Always surface the changelog triage — never bump without reading it.
- Distinctive: line 124
Keep the package pinned at the exact version.
- Distinctive: line 125
If the user only asked to "check/update" without implementing features, deliver the triage summary and the bump, then list follow-up …
- Very specific: line 127
Follow conventional commit style (fix(deps) / chore(deps) for a plain bump.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Update Pi Coding Agent
Argos embeds @earendil-works/pi-coding-agent as its agent runtime. The version is managed in one place: the workspace catalog in the root package.json (workspaces.catalog). Packages reference it via "catalog:", so bumping the catalog entry is the only edit needed.
Where Pi Is Referenced In This Repo
- Root
package.json—workspaces.catalogholds the single pinned version (keep it pinned, no^). This is the only place the version changes. apps/daemon/package.jsonandpackages/pi-orchestrator-extension/package.json— both declare"@earendil-works/pi-coding-agent": "catalog:"; do not edit versions here.apps/daemon/src/host/piWorker.ts— the Pi worker: creates the session, registers providers/models, bridges extensions, MCP tools, UI context, and mapsAgentSessionEvents to the daemon protocol.packages/pi-orchestrator-extension/src/index.ts— theargos-orchestratorinline extension that exposes Argos orchestration tools to Pi.bun.lock— lockfile records the resolved version and its transitive deps (@earendil-works/pi-agent-core,pi-ai,pi-tui,pi-telemetry; 0.85+ adds@earendil-works/chord, andpi-client/pi-protocolno longer ship as separate deps).
Argos' Pi API Surface (verification reference)
Triage and API-diffing are only fast because Argos uses a small, stable slice of Pi. Consult this map before analyzing a changelog entry or re-checking .d.ts files.
Used by piWorker.ts
createAgentSession({ cwd, agentDir, modelRuntime, model, thinkingLevel, excludeTools, customTools, resourceLoader, sessionManager, settingsManager })→{ session, extensionsResult?, modelFallbackMessage? }.DefaultResourceLoader({ cwd, agentDir, settingsManager, systemPromptOverride, extensionFactories });reload({ resolveProjectTrust });getExtensions()(.errors),getSkills()/getPrompts()(.diagnostics).ModelRuntime.create({ authPath, modelsPath, allowModelNetwork }),.registerProvider(id, { name, baseUrl, api, headers, models }),.setRuntimeApiKey(id, apiKey),.getModel(id, modelId).SessionManager.create(cwd, sessionDir)/.open(sessionFile, sessionDir, cwd);SettingsManager.create(cwd, agentDir).AgentSessionmethods:prompt,steer,followUp,compact,abort,dispose,bindExtensions({ uiContext, mode: "rpc" }),subscribe,getSessionStats()(tokens.{input,output,cacheRead,cacheWrite}+cost),sessionFile.AgentSessionEventmembers bridged to the protocol:message_update(reads onlyassistantMessageEventdeltas:text_delta/thinking_delta/thinking_start/thinking_end),tool_execution_start(toolCallId,toolName,args),tool_execution_update,tool_execution_end,queue_update,compaction_start/compaction_end,auto_retry_start/auto_retry_end,message_end(message.role,message.timestamp),agent_settled.ExtensionUIContext:createUiContext()builds a full stub and casts it (as ExtensionUIContext), so new/renamed interface members do not fail typecheck; TUI-only methods route tounsupported(). Re-check the method list each update — a new member that Argos should bridge would silently be missing.
Used by pi-orchestrator-extension
InlineExtension({ name, factory }),defineTool,pi.registerTool(...),pi.on(...).- Tool
executereturns{ content, details, isError }. NoteisErroris not a field ofAgentToolResult(verified at 0.83 and 0.84) but typechecks; real tool errors should be thrown.
Never touched by Argos (skip unless an entry leaks into the surfaces above)
- pi-ai internals:
ModelsStreamTransforms→ModelsRequestTransformsrenames,ModelRegistry.*(getApiKeyAndHeaders,refresh),ModelsStore, provider refresh context (context.stored/context.publish), OAuthrefreshToken,samplingParams, deferred provider handles, vendor telemetry. - pi-agent-core harness/session: v4
Session/SessionStorage/SessionRepo,AgentHarness,JsonlSessionRepo,FileSystem.renameFile,RemoteSession/PiClient/CBOR protocol. - CLI/TUI: fullscreen mode, keybindings, terminal/theme/Mermaid/LaTeX rendering,
pi auth check, slash commands, prompt history. - Providers Argos does not surface (e.g. Baseten, Qwen token plan, Radius),
AI_AGENT=pienv,AGENTS.override.md.
Caveats. The map is a filter, not a guarantee: (1) always verify entries that touch a name appearing in piWorker.ts/pi-orchestrator-extension or a bridged AgentSessionEvent payload; (2) the map drifts as Argos adopts features — items move from "never touched" to "used", so refresh it when the skill mentions a new surface.
Workflow
1. Determine Current And Latest Versions
- Current: read the version in the workspace catalog (
workspaces.catalogin the rootpackage.json). It is the single source of truth;apps/daemonandpackages/pi-orchestrator-extensionboth use"catalog:". - Latest:
bun pm view @earendil-works/pi-coding-agent versionand checkdist-tags(bun pm view @earendil-works/pi-coding-agent dist-tags --json). Use thelatesttag (notlegacy-node20) unless the user asks otherwise.
2. Read The Changelog Before Touching Anything
Fetch the upstream changelog:
https://github.com/earendil-works/pi/blob/main/packages/coding-agent/CHANGELOG.md(recommended: https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/CHANGELOG.md for the raw text). Read every version section between the current pinned version (exclusive) and the target version (inclusive). If a section is truncated by the fetcher, re-fetch the raw file or query that specific version's section.
For each version, classify each entry as one of:
- BREAKING / migration: renamed exports, changed signatures, removed APIs, new required fields, event shape changes, dropped Node/Bun support, changed defaults. These are the priority — they can break
piWorker.ts,pi-orchestrator-extension, or the piWorker protocol mapping. - New features / APIs: new extension hooks, new
AgentSessionEventtypes, newExtensionUIContextmethods, new model/provider capabilities, new session APIs. Flag any that Argos could implement (e.g. new session events, new UI methods to bridge, new tool options, provider features). - Fixes / chores: usually no action; note only if they change observable behavior Argos depends on.
Filter before deep-diving. For every BREAKING entry, ask "does this touch a surface in the Argos API map above, or a type that leaks into one (e.g. the payload of a bridged AgentSessionEvent)?" Entries confined to the never-touched list get one line in the triage ("no Argos impact") and are skipped from .d.ts analysis. Worked example: 0.84.0's message_update "delta-only" change looks breaking but is Argos-compatible — Argos only ever reads assistantMessageEvent deltas and never used the removed cumulative message/partial fields.
3. Produce A Triage Summary (Do This Before Editing)
Write a concise per-version summary for the user: version(s), date(s), the breaking entries and which repo file they affect (or "no Argos impact"), and the candidate "new useful features to implement" with a one-line proposal each. Let the user pick which new features to adopt — do not silently implement them in the same change.
4. Bump And Install
- Update the version in the workspace catalog (root
package.json,workspaces.catalog) to the exact target version (keep it pinned, no^). No otherpackage.jsonneeds editing — both consumers use"catalog:". - Run
bun installto updatebun.lock. Verify the resolved version and its transitive Pi deps moved together (checkbun.lockfor thepi-coding-agententry and itspi-agent-core/pi-ai/pi-tuisiblings; 0.84+ addspi-telemetry; 0.85+ adds@earendil-works/chordand dropspi-client/pi-protocolas separate deps).
5. Adapt Code To Breaking Changes
Diff the upstream API against how this repo uses it (map above). Installed .d.ts locations (after bun install):
- Main package:
apps/daemon/node_modules/@earendil-works/pi-coding-agent/dist/<file>.d.ts— not the repo-rootnode_modules.index.d.ts— full export list (userg '"..." from'per surface).core/sdk.d.ts—CreateAgentSessionOptions/createAgentSession.core/agent-session.d.ts—AgentSessionEventunion,SessionStats,ExtensionBindings.core/model-runtime.d.ts—ModelRuntime.core/extensions/types.d.ts—ToolDefinition,defineTool,InlineExtension,ExtensionAPI,ExtensionUIContext,ToolCallEvent.core/session-manager.d.ts,core/settings-manager.d.ts,core/resource-loader.d.ts.
- Transitives (
pi-agent-core,pi-ai,pi-tui; 0.84.x also hadpi-client/pi-protocol, gone in 0.85+ where@earendil-works/chordappears): resolve undernode_modules/.bun/@earendil-works+<pkg>@<version>.../node_modules/...— find viaGet-ChildItem -Recurse -Directory -Filter "pi-agent-core".pi-agent-core/dist/types.d.tsholds theAgentEventunion members (incl.message_update,tool_execution_*),AgentToolResult,AgentMessage.
Checklist per surface: createAgentSession options, AgentSessionEvent union members, ExtensionUIContext method set, defineTool signature + result shape, ModelRuntime methods, SessionManager/SettingsManager statics, DefaultResourceLoader options + methods.
Follow the repo's Specification-Driven Development workflow (see .agents/skills/argos-sdd) for any code adaptation needed.
6. Validate
- Type check:
bun run typecheck(root script covers only@argos/desktop), plusbun run typecheckinsideapps/daemon(itstsconfig.jsonincludessrc/**;@argos/pi-orchestrator-extensionis typechecked transitively through the daemon graph — it has no own typecheck script). - Lint / format (root):
bun run lint,bun run format. - Tests:
bun run test(root runs@argos/desktop+@argos/daemonfilters) orcd apps/daemon && bun run test. Roottest:maintargets the desktop suite;@argos/daemonhas notest:mainscript. - Known flake:
apps/daemon/test/piWorker.test.tscan exceed vitest's default 5s test timeout when the full daemon suite runs in parallel (the worker's own ready-promise allows 10s; the test carries a 20s timeout). To tell a flake from real breakage, run it in isolation (bunx vitest run test/piWorker.test.ts, ~1s) or the whole suite with--testTimeout 30000. A real breakage also surfaces asWorker errorevents or stderr diagnostics, not just a timeout.
If the Pi worker no longer starts or emits, or typecheck fails on the new API, stop and report the specific breaking entry from the changelog that caused it rather than patching around it silently.
Seeking Improvements (Be Proactive)
A bump is a free audit window. After a successful update, scan the changelog for anything Argos could adopt or fix, and report every item as a concrete proposal (do not silently implement features):
- New
AgentSessionEventmembers → propose mapping inpiWorker.ts+piWorkerProtocol.ts(e.g. new deltas, retry/summarization phases). - New
ExtensionUIContextmethods → propose bridging through the existinguiRequest/uiResponseprotocol; TUI-only ones stay stubbed viaunsupported(). - New extension APIs/hooks → e.g.
tool_callterminate(0.84.1: lets blocked/denied tool batches skip the follow-up model call — pairs naturally with Argos permission mode),registerMarkdownTransformer,AgentOptions.shouldStopAfterTurn, newregisterTooloptions,scopedModels. - New model/provider capabilities → e.g.
samplingParams, new built-in providers, newapivalues; propose exposing via the daemon provider config (apps/daemon/src/host/pi-provider-execution.ts) or model settings UI. - New session/stat surfaces → e.g. new
SessionStatsfields or session APIs; propose surfacing in the usage dashboard / chat UI. - Security updates bundled in Pi's transitive deps (e.g.
undici,brace-expansion) → call out in the report. - Repo friction hit during the update (flaky tests, misleading commands, docs drift, catalog-state surprises) → propose as follow-up fixes; apply the trivial infra ones in the same change.
For each, give a one-line proposal + the files it touches. Recommend the highest-value adoption; let the user decide.
Response Rules
- Always surface the changelog triage — never bump without reading it. The whole point is to catch breakage early and spot features worth implementing.
- Report the exact
X.Y.Z -> X.Y.Zdelta and the versions in between. - Keep the package pinned at the exact version; do not switch to a range.
- If the user only asked to "check/update" without implementing features, deliver the triage summary and the bump, then list follow-up feature ideas for a later change.
- End every update with the triage and a "follow-up feature ideas" list (one line each, with files touched). Recommend the top pick.
- Follow conventional commit style (
fix(deps)/chore(deps)for a plain bump;featwhen adopting a new Pi feature).
Examples
- "Update pi to latest" → run the full workflow: bump, changelog triage, install, typecheck/lint/test.
- "Is there a new version of @earendil-works/pi-coding-agent?" → compare versions and summarize the changelog delta only; do not edit yet.
- "Pi added a new session event, can we surface it?" → check the changelog section for the new
AgentSessionEventtype and map it inpiWorker.ts. - "Any new Pi features worth having?" → run the changelog delta and produce the "Seeking Improvements" list only; no bump.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

