@lukisxyz/pi-add-deliberate1.0.1
pi extension: deliberate advise/plan modes — configured read-only second opinions and research-first implementation plans, saved to a configured path.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@lukisxyz/pi-add-deliberate
Configured advise and plan modes for the pi coding agent. Both delegate to a read-only subagent through the installed @lukisxyz/pi-core-subagent extension — this package never spawns child sessions itself.
/advise [extra context]— evidence-based second opinion: best practices, common patterns, efficient approaches, deeper analysis./plan [extra context]— research-first implementation plan; never implementation. The final standalone Markdown is saved to the configured path./plan-vieworCtrl+Alt+P— open the saved plan in a scrollable overlay (or print its path outside the TUI)./deliberate-config [advise|plan|status|clear [advise|plan]]— with no arguments, opens a menu: Configure advise / Configure plan / Status / Clear mode.clearasks which mode and removes only that mode (clear advise/clear planskips the question);statusprints the current config.
Install
Requires pi and @lukisxyz/pi-core-subagent:
npm install -g @earendil-works/pi-coding-agent
pi install npm:@lukisxyz/pi-core-subagent
pi install npm:@lukisxyz/pi-add-deliberate
Config
Stored at ${getAgentDir()}/deliberate.json (usually ~/.pi/agent/deliberate.json) and strictly validated on read: unknown keys, wrong types, or invalid values make the whole config unconfigured.
{
"advise": {
"model": { "provider": "anthropic", "id": "claude-sonnet-4-5" },
"thinking": "high",
"tools": ["read", "grep", "find", "ls", "bash"]
},
"plan": {
"model": { "provider": "openai", "id": "gpt-5" },
"thinking": "medium",
"tools": ["read", "grep", "find", "ls"],
"path": "PLAN.md"
}
}
model,thinking, andtoolsare optional;pathis plan-only.- Tools are filtered to the mode's read-only allowlist: advise
read, grep, find, ls, bash; planread, grep, find, ls.editandwriteare never allowed. Defaults are the full allowlists. pathmay be relative to the current cwd,~/..., or absolute; defaultPLAN.md.- The model picker lists session-scoped models (
--models/enabledModels) when configured, otherwise every currently available (authenticated) model. Thinking options come from the model's supported levels. - Writes are atomic (temp file + rename), so a crash never leaves a half-written config.
How a run works
/adviseor/planinjects/skill:deliberate-advise ...//skill:deliberate-plan ...as a user message (queued as a follow-up when the agent is busy). The matching skill command must exist, checked viapi.getCommands().- The skill always calls
deliberate_modewithaction: "prepare"first:unconfigured— skipped; the skill points to/deliberate-config <mode>and stops. No session-model fallback.dependency-missing— thesubagenttool is missing or inactive.model-unavailable— the configured model is not loaded, or a 16-token preflight call fails (auth/quota/provider). Sole exception:opencode-gosession-header probe errors keepprepareready(see Limitations).ready— returns the exact provider/model ref, the configured supported thinking level, the filtered tools, and (plan) the resolved path.
- Only then does the main agent make exactly one
subagentcall withmodel,thinking,tools,write: false, the mode's inline prompt, andautoAwait: true. - On a model failure the skill asks (
ask_user_questionwhen available):Skip mode,Custom subagent,Reconfigure mode, orMain agent handles. - After any successful plan — deliberate subagent, custom subagent, or main agent — the main agent calls
deliberate_save_planwith the final Markdown. The model never chooses the path.
Tools
| Tool | Purpose |
|---|---|
deliberate_mode |
prepare (validate config/subagent/model/connectivity) or configure (picker UI, save config; non-UI returns configure-requires-ui) |
deliberate_save_plan |
Save final Markdown to the configured path, atomically, and record it in the session; rejects empty content |
Saved plan state
The latest deliberate-plan custom entry on the current session branch is restored on session_start and session_tree, rebuilding the widget (path, /plan-view, Ctrl+Alt+P) and footer status. /plan-view re-reads the file from disk; a missing file warns, and a saved path that differs from the current config is flagged as stale. The overlay uses a manual sliced viewport with ↑/↓, PgUp/PgDn, Home/End, Esc/q, and SGR mouse-wheel scrolling when the terminal forwards it.
Limitations
- The advise/plan subagents are read-only; they cannot run write tools or save plans themselves.
- The preflight consumes a minimal request (
maxTokens: 16) against the configured model each timeprepareruns. For provideropencode-goonly, a preflight error matchingMissingSessionIDorx-opencode-sessionis inconclusive — statelessmodelRegistry.completeprobes cannot carry the session header — sopreparestaysreadyand the child session validates the model. Every other preflight failure staysmodel-unavailable. - Mouse-wheel scrolling only works when the terminal emits SGR wheel events to the regular (non-alt-screen) TUI; keyboard scrolling always works.
deliberate_mode configureand/deliberate-configrequire interactive UI.
License
MIT.