pi-task: Deterministic Spec-Orchestration for Local Models

Stop local LLM drift and hallucinations. Discover pi-task, the deterministic pipeline for reliable, crash-safe, and verifiable agentic workflows.

robot, code, gears, document

Ask a local LLM to plan a complex coding change, and you often watch it drift. It skips crucial context, hallucinates non-existent APIs, and eventually forgets the very goal you set at the beginning of the conversation.

This ‘model drift’ is a primary bottleneck for developers trying to move from simple prompting to complex agentic workflows. When an LLM attempts to juggle too many instructions and large files at once, the context becomes a noisy, unmanageable mess.

The Solution: Deterministic Orchestration

pi-task solves this by replacing the chaotic ‘prompt and pray’ method with a fixed, verifiable pipeline. Instead of relying on a single, massive prompt, it drives your request through a series of small, discrete, and predictable steps.

By using the pi-task repository on GitHub, you can ensure that your local model follows a structured path from a raw idea to a polished implementation spec.

The Execution Pipeline

Unlike standard agentic loops that leave the sequence of steps up to the model’s whim, pi-task is deterministic by construction. The orchestrator follows a strict sequence, ensuring each phase has a specific job and a dedicated output section.

PhaseOutput SectionPurpose
RefineRefined PromptSharpens your raw ask into an unambiguous statement.
ResearchResearchFans out to sub-agents to index files, APIs, and docs.
GrillGrill Q&AGenerates clarifying questions to resolve ambiguities.
ComposeCompose SpecAssembles research and Q&A into a single implementation spec.
CritiqueCritique SpecTriages the draft and rewrites it if it fails quality checks.

Seamless Command Integration

robot, code, gears, document

Managing these complex pipelines is made easy through a variety of slash commands that allow for rapid, iterative development.

  • /task <prompt>: Starts a new task through the full pipeline.
  • /task-auto <feature>: Plans a feature and runs a sequence of tasks automatically.
  • /task-resume [id]: Resumes a previous task exactly where it left off.
  • /task-config: Toggles settings like remote server access or auto-commit.

Built for the Reality of Local LLMs

robot, code, gears, document

Local models are often smaller and more prone to stalls or repetitions than massive frontier models. pi-task includes a built-in loop detector and failure classifier. This allows the system to catch malformed outputs and retry with sharper emphasis rather than simply failing.

Furthermore, the system is designed around the philosophy of agent-native development. Instead of just bolting a prompt onto a model, pi-task uses parallel research phases where child agents perform ‘spelunking’ in your codebase and documentation. The parent session only ever sees the distilled, clean answers, keeping your main context window pristine.

Because every phase is written to a local Markdown file in the .pi-tasks/ directory, the entire process is crash-safe. You can restart your machine, cancel a task, or manually edit the spec in a text editor, then use /task-resume to continue.

You can get started by installing the package via npm:

pi install npm:@mjasnikovs/pi-task

Ready to automate your local development with precision? Explore the pi-task GitHub repository and bring deterministic structure to your AI agents today.