Install
Install with PiG
pig install npm:@rifle-donkey/pi-dev-kitInstall with Pi
pi install npm:@rifle-donkey/pi-dev-kitPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"skills": [
"./skills"
],
"extensions": [
"./extensions/roles.ts",
"./extensions/handoff.ts",
"./extensions/usage.ts"
]
}README
Written by the package's publisher, shown as published in version 6.2.0 (README.md). PiG does not review it.
Pi Dev Kit
A reusable, risk-scaled development workflow for Pi as the main coding agent, executed by pi-herdr-agents. The main Pi session coordinates work; named leaf roles perform bounded tasks. Project rules and explicit authorizations remain in control.
This README is authoritative for installation, use, model configuration, precedence, limitations, and removal. Update it when those operations change. Role responsibilities live in their role files, workflow decisions in the coordinator skill, model choices in the model file, and project permissions in the project's agent context.
Contents
- Requirements
- Installation
- Upgrade
- Use
- Session usage
- Roles
- Model profiles
- Customize models
- Host task categories
- Project adaptation
- Safety and limits
- Removal
- License
Requirements
Required: pi-herdr-agents, with Pi started inside Herdr. The suite is a role and workflow pack for that host and has no execution layer of its own. One small extension registers the role files with the host through the host's role-pack protocol, another adds the dev_handoff tool and /dev-handoff command that move a task into a new session, and a third records each dev-flow session's time and tokens (Session usage); the host provides the subagent launch, cancel, and resume tools, runs each child as a separate Pi process in a Herdr pane, and manages worktrees. The role frontmatter fields (spawning, auto-exit, persistent, session-mode, system-prompt) and the launch rules in dev-flow are written for this host. Pi itself has no built-in subagents, and another subagent extension cannot use these roles unchanged.
Without the host, or with Pi started outside Herdr, the roles are not loaded and no child can be launched. dev-flow then falls back to a reduced mode: the coordinator does the work itself, results are reported as not independently reviewed, QA acceptance stays blocked, and reinforced work stops after design. This is a safety fallback, not a supported way to run the suite.
Also required:
- Pi with package and skills support, and the host's pi-herdr-agents operating skill discoverable in Pi.
- The
pi-project-docspackage, which provides the project-docs skill and its document checker. python3(3.9 or newer) forscripts/validate.py, which dev-flow runs once per session before its first delegation.- Authenticated Pi providers for each model profile you use, as listed in the model file (Model profiles). With the packaged default these are
github-copilotfor work projects, andanthropicandopenai-codex(/login openai-codex) for private projects. Exact IDs are configuration, not proof of working quota or availability. - pi-web-access for public research under the user's web-routing rules; native agent-browser tools when browser verification is needed.
Installation
Install the host and the document package if they are not installed yet, then the suite:
pi install npm:pi-herdr-agents pi install npm:pi-project-docs pi install npm:@rifle-donkey/pi-dev-kitIn the global agent context, keep a short Development suite coordination entry directing the main agent to load the dev-flow skill for actual development tasks, excluding ordinary questions and bounded child assignments. The entry must point to the skill by name, not duplicate its workflow. Use project-docs for that document change.
Run
/reloador restart Pi./subagent listshows the five roles with the sourcepackage:@rifle-donkey/pi-dev-kit. A global (~/.pi/agent/agents/<role>.md) or project (.pi/agents/<role>.md) definition with the same name hides the package role; remove it unless you want that override. Discovery alone does not test a model or a child process.Check the model file. Pi installs packages under
~/.pi/agent/npm/node_modules/(or$PI_CODING_AGENT_DIR/npm/node_modules/):python3 ~/.pi/agent/npm/node_modules/@rifle-donkey/pi-dev-kit/scripts/validate.py --models-only --printIt prints the selected model file and the table dev-flow will use, warns about role definitions that hide the package roles, and exits 1 on any problem.
Upgrade
The installed version is the version in the installed package's package.json; each release has a Git tag vX.Y.Z and a CHANGELOG.md entry. A major version change means you must act before or after upgrading.
- Read the newer releases in CHANGELOG.md, especially each Before upgrading line, and do those actions.
- Update the package:
pi update npm:@rifle-donkey/pi-dev-kit. - Run
/reloador restart Pi. - Re-run the model check from Installation step 4. If you keep your own model file, compare it with the new packaged default (Customize models step 4).
Use
Ask Pi for a development outcome in normal language. The global entry activates coordination for development tasks; simple explanations do not start a development pipeline. You can explicitly load it:
/skill:dev-flow Analyze and implement the requested feature using this project's rules
The coordinator reads the project and interviews you in rounds. Each numbered question has a recommendation; answer "yes" to accept it. The coordinator looks up facts itself and skips the interview for prose or formatting-only work with no open question.
Approve the requirements report before design. It shows the problem, concrete input/output examples, proposed level with reasons, and the run and repair budget. A light report stays in chat and needs your approval before edits, even for prose or typos. Standard and reinforced reports go in the project plan. These are the default paths and budgets:
| Level | Used for | Default path and budget |
|---|---|---|
| Prototype | Proposed first for a new requirement with a question that reading cannot settle; at most three questions | The coordinator alone, outside the repository; lab reads and writes only under the project's lab grant, with verified cleanup; findings go into the plan, the code is never accepted or delivered as is |
| Light (default) | Prose and formatting; a small, reversible behavior change inside one module | The coordinator implements; behavioral code gets one review from a different model family and one repair per blocking finding |
| Standard | Other behavior changes | Test first: QA maps each report example to acceptance tests, then the developer implements, the coordinator tests offline, and a reviewer from another family reviews; three child runs, plus one for an environment layer, and two repair cycles per blocking finding |
| Reinforced | A change that touches a listed reinforced trigger, such as authorization, destructive or external writes, or migrations | The standard path with risk and failure analysis and, without dual design, one design review plus at most one delta review; eight child runs, counting resumes, and three repair cycles per blocking finding |
If a cross-family reviewer is unavailable, you can approve an ordinary same-family review. The final report discloses that it was context-isolated, not cross-family independent. See delegation.
You can ask for a prototype or a stricter level. To choose a lower level, accept the risks the coordinator lists. Authentication and authorization (T1), credentials and cryptography (T2), destructive operations (T5), and external writes (T6) cannot go below reinforced. Your approved budget replaces the defaults. The coordinator asks before exceeding it.
If the active profile configures architect-alternate, you can approve dual design during the interview. It uses two independent designs and two comparison resumes. The coordinator recommends a merged design and asks you to resolve differences that evidence cannot settle. Dual design replaces separate design review, not independent code review.
A requested feature does not approve a design. After design approval at standard or reinforced, the coordinator saves decisions in the plan and calls dev_handoff to resume the task in a new session. You can also type /dev-handoff <plan> <next action> yourself. Work proceeds within the approved scope and budget, subject to project approvals and environment grants. A finding blocks only when it meets the workflow's blocking criteria, including a realistic scenario and its harm. See planning, the workflow, delegation, and the worked example.
Each final report ends with a cost line: level, child runs with their models, repair cycles, and tokens when the host reports them. The coordinator also appends that line, with the date and the project directory name, to ~/.pi/agent/dev-kit/cost-log.md (under $PI_CODING_AGENT_DIR when set). Read the log to see which roles and levels change results for their cost; delete the file whenever you like. Before the final report, the coordinator also shows a measured snapshot of the session's time and tokens (Session usage).
Direct role commands remain available, but are not a complete pipeline:
/subagent reviewer Review the specified accepted contract and diff; do not edit files
Roles carry no model, so this short form passes none and the host chooses: its models.agents.<role>, then its models.default, then the parent session's model. Use the short form only when both hold:
- the model check from Installation step 4 passes; it fails when the host config sets
models.defaultor names a suite role inmodels.agents; - Pi has been started or reloaded (
/reload) since the host config last changed, because the host uses the configuration it loaded then, not the file on disk.
The child then runs on the parent session's model, so the parent must use a model of the project's profile. To choose another model, launch the role through the host's subagent tool with an exact model and thinking from the validated table, and state the project's model profile in the task.
Supply the actual scope, references, allowed files, checks, and authorization when directly invoking a role. A review command does not run independent acceptance or grant environment access.
Session usage
dev-flow calls the dev_usage_activate tool at its entry step, in a turn of its own, and dev_usage_summary before its final report. Activation starts one usage report for the current coordinator session. Only work after activation counts. A session that never activates writes nothing, and its children are not recorded.
- Report lifetime. One report per activated session run.
/reloadkeeps the report and its figures. Resuming or forking a session,/dev-handoff,/new, and a restart after a crash start a new run: it needs a new activation (dev-flow does this at entry) and starts a new report at zero. - Children. When an activated coordinator calls the
subagenttool, the extension appends a final linedev-usage-token: <token>to the task. It also tags asubagent_resumecall that has a non-emptymessage. The child reads the token from its first prompt and joins the coordinator's report. Each child process gets its own row, including a resumed child and a replacement process that the host starts with another model and the same tagged task. A child keeps updating its row after the coordinator closes. The token is a local tracking label, not authentication, and the child's model can see it. - Untracked children. Children started with the
/subagentcommand; asubagent_resumecall without a message; a replacement process whose task lacks the token line; children started by a child.
Commands:
| Command | Shows |
|---|---|
/dev-usage | The current report, or not tracked |
/dev-usage history | Every report, newest first: report ID, start time (UTC), total active time, total tokens |
/dev-usage show <report-id> | One report from the history; an unknown ID gives an error |
A report has a coordinator row, one row per child process, and a total row:
| Column | Meaning |
|---|---|
| model | Every provider and model seen on the row's counted replies; a model switch keeps the row |
| status | running; ended after the session closed; unclean when the process is gone without closing. A row of a process that no longer exists can still show running when another process reuses its process ID |
| active time | Sum of agent runs minus waits for your answer in a dialog. Idle time between runs, including waiting for a child or for you, is not counted. The total adds the rows, so parallel children add up |
| input, output, cache_read, cache_write | Token counts as the provider reported them on each completed reply, never estimates |
| cache hit % | cache_read / (input + cache_read + cache_write); — when that sum is 0 |
| unreported or zero calls | Replies whose usage was missing, invalid or all zero; they add nothing to the token columns |
Excluded usage: compaction summaries, branch summaries from /tree, prompt-cache warming, and usage reported inside tool results. A reply that failed or was cancelled still counts the usage it reported. After a crash, a row keeps the time and tokens up to its last save. These figures are not a bill.
Limitations:
dev_usage_activatemust run in its own turn. Asubagentcall in the same reply is checked before activation and stays untracked.- A token line copied into a later task binds that child to the older report.
- If another extension sends a user message before the task prompt, the child stays untracked.
- Child rows are labeled with the host's undocumented
PI_SUBAGENT_AGENTvariable when it is set, and with the run ID (PI_SUBAGENT_ID). - Launch tokens need the
subagenttool;/subagentcommand launches are untracked. - A child stays untracked when it cannot read the coordinator's launch record, for example when its
PI_CODING_AGENT_DIRselects a different history store. Two values that lead to the same store, such as a linked agent directory and its target, work. - The directories above the history store (the agent directory,
dev-kitandusage) are trusted as configured and may be links. Onlyv1and the entries below it are checked. - A model name is saved with at most 120 characters and shown in the table with at most 60; a row lists at most 20 distinct models.
History is stored on your machine only, under ~/.pi/agent/dev-kit/usage/v1/ (under $PI_CODING_AGENT_DIR when set): one directory per report and a launches/ directory of token records, with owner-only permissions. Files hold counts, times, model names, child labels, run and process IDs; no prompts, replies, paths or tool arguments. Links and unsafe names are refused. If saving fails, the report and /dev-usage history show history not saved for that report, and development continues. Nothing is deleted automatically; delete the directory to remove all history.
Roles
| Definition | Purpose |
|---|---|
| developer | Required at standard and reinforced: implementation, unit and integration tests, and document updates |
| reviewer | Independent code and test review; design review only at reinforced without dual design. Code review separates Spec (missing, wrong, and unrequested behavior) from Standards (documented project rules only) |
| qa | Required at standard and reinforced: acceptance tests from the approved report and design before implementation, and environment layers |
| researcher | Optional: bounded evidence gathering that would otherwise fill the coordinator's context |
| architect | Optional: independent design and comparison in dual design, or reinforced design work too large for the coordinator's context |
The coordinator itself owns requirements, planning, the documentation impact check, and release preparation.
Role files contain responsibilities and tool and skill prerequisites; they name no model. The coordinator passes an exact model and thinking from the validated model table on every launch and reports unavailability instead of silently falling back. Every final report ends with a cost line listing which roles and models ran; use these lines to judge whether a role is worth its cost.
The host resolves project roles ahead of global roles, then package roles. A project or global role with the same name therefore replaces one installed here. Inspect the effective source before use; preserve the suite policy explicitly when writing an override. A hidden project role can also mask a visible role.
Model profiles
Every project declares a model profile in its agent context file with one line, Model profile: work or Model profile: private. Each profile allows only the providers listed for it in the model file; by default work allows github-copilot, and private allows anthropic and openai-codex. The two lists never overlap. The separation is strict: there is no fallback between profiles, so when the profile's models are unavailable or out of credits, the work stops and is reported. The coordinator's own model must also belong to the project's profile; start or switch Pi to a matching model before development. A project without the line is asked about before any work.
Your own data-boundary rules in your user-level agent context prevail over the model file. The validator cannot tell whether two provider lists were swapped; if the file conflicts with your rules, dev-flow stops and asks.
Customize models
Model choices live in one JSON file. The package ships a working default, config/models.json; your own file replaces it completely and survives package updates. dev-flow runs validate.py --models-only --print --profile <profile> once per session, before its first delegation, and again after compaction or when you say the model file or host config changed; it uses only the rows the latest run printed. If you edit the model file or run /subagents-init during a session, tell the coordinator. --profile and --slot (repeatable) shorten the output to one profile and the named rows; the whole file and the host config are still checked.
The validator selects exactly one file, and never falls back to a later one once a path is selected:
PI_DEV_KIT_MODELS, when set in the environment Pi runs in. Set but empty is an error.$PI_CODING_AGENT_DIR/dev-kit/models.json(default~/.pi/agent/dev-kit/models.json), when anything exists at that path, including a broken link.- The packaged
config/models.json.
To use your own file:
Copy the packaged default:
mkdir -p ~/.pi/agent/dev-kit cp ~/.pi/agent/npm/node_modules/@rifle-donkey/pi-dev-kit/config/models.json ~/.pi/agent/dev-kit/models.jsonEdit it as described in Model file reference.
Run the model check from Installation step 4. Its first line must name your file with
(user).After each package update, compare your file with the new packaged default and adopt what you want; updates never change your file:
diff ~/.pi/agent/dev-kit/models.json ~/.pi/agent/npm/node_modules/@rifle-donkey/pi-dev-kit/config/models.json
A file that exists but is malformed or breaks a rule stops dev-flow until you fix it; it never falls back to the packaged default. To return to the default, delete your file.
Model file reference
{
"schemaVersion": 1,
"hostTasksProfile": "work",
"profiles": {
"work": {
"providers": ["<provider>"],
"roles": {
"researcher": { "model": "<provider>/<model-id>", "thinking": "medium" },
"developer": {
"model": "<provider>/<model-id>",
"thinking": "medium",
"upgrade": { "when": "Difficult or high-risk implementation", "model": "<provider>/<model-id>", "thinking": "high" }
}
}
},
"private": { "providers": ["<provider>"], "roles": {} }
}
}
The example is shortened; a valid file lists all required slots in both profiles.
| Key | Rule |
|---|---|
schemaVersion | Must be 1. |
hostTasksProfile | work or private: the only profile whose providers may appear in the host's models.tasks lists (Host task categories). |
profiles | Exactly work and private. |
profiles.<p>.providers | Non-empty list of Pi provider names; the two profiles share none. |
profiles.<p>.roles | One slot per role (architect, developer, reviewer, qa, researcher), required reviewer-alternate, and optional architect-alternate. |
slot model | One exact <provider>/<model-id> whose provider is in the profile's list: no comma, space, wildcard, or task: alias. |
slot thinking | One of off, minimal, low, medium, high, xhigh, max. |
slot upgrade | Optional: when (the trigger, as text), model, thinking. |
reviewer-alternate runs as reviewer when the artifact's author shares the reviewer slot's family. architect-alternate runs as architect for the second designer. Family is the model-name prefix: claude, gpt, or gemini.
If your effective file has no architect-alternate for the active profile, dual design is unavailable. To enable it, add the slot with a model of a different family than architect, then rerun the model check. The packaged file has both alternate architect entries. Each uses its profile's reviewer model at medium thinking, with a high-thinking upgrade for reinforced design. --slot architect-alternate prints the row if present.
The validator also enforces:
- Strict JSON: duplicate keys, unknown keys, wrong types,
NaN, invalid UTF-8, and unreadable files fail. - In each profile,
reviewerandreviewer-alternatemust use different recognized families. The same rule applies toarchitectandarchitect-alternatewhen the alternate is present. Upgrades in each pair must keep the slot's default family. - The two profiles' provider lists do not overlap.
- Nothing else links the profiles: a slot may use another family, thinking, or upgrade in each. Reviewer selection uses the actual author's family in every run, so review stays cross-family in either profile.
Host task categories
pi-herdr-agents has its own six task:<category> model lists in herdr-agents/config.json, filled by /subagents-init. dev-flow never uses them; they serve ad-hoc launches outside the workflow, and only in projects whose profile is the model file's hostTasksProfile, because the lists may hold only that profile's providers. In projects with the other profile, launch with an exact model of that profile instead. The host does not link roles to categories. The table below records the intended correspondence, and the host check warns when a role's default in the hostTasksProfile profile differs from its category's first candidate, except for the differences marked intentional.
| Role | Host category | Intentional difference |
|---|---|---|
| architect | architecture | no |
| developer | coding | no |
| reviewer | review | no |
| qa | qa | no |
| researcher | recon | yes: researcher also covers complex investigation; recon favors cheap, fast scouting |
Keep the host lists family-separated: coding uses only Claude models and review only GPT models, so a fallback in either list never makes an ad-hoc review same-family. Leave models.default unset and keep suite role names out of models.agents (Use). Re-check after every /subagents-init:
python3 ~/.pi/agent/npm/node_modules/@rifle-donkey/pi-dev-kit/scripts/validate.py --host-config
The flags --models-only, --host-config and --catalog each select the installed-package checks (model file and host config only); they can be combined.
The host check fails on malformed host config, on a candidate outside the hostTasksProfile providers, on a broken coding/review family separation, and on models.default or a suite role in models.agents; a missing config, missing categories, and role-default drift only warn. Add --catalog to compare every model in the effective model file and the host lists with the local pi --list-models listing.
Project adaptation
Use the adaptation template to identify missing decisions. Add concise project-specific rules to the existing agent context, not another parallel guide. Existing contracts, plans, commands, and documentation homes stay authoritative.
Sandbox E2E permission is a project-level decision, not a global default. The project must name the runner, environment, allowed namespace and mutations, required layers, and cleanup boundaries. Production is never inherited from a sandbox grant. Revoke or tighten a durable grant in the same project authority; already running operations require explicit coordinated cancellation, not merely editing the text.
Safety and limits
- Prompts and tool lists are behavioral controls, not an operating-system sandbox. Bash can write files and access networks even in a nominally read-only role. External isolation requires separate infrastructure and approval.
- Shared test sandboxes, databases, and VMs are not isolated by Git worktrees. The coordinator serializes stateful tests against shared resources.
- The parallelism budget, the per-level run limits and the repair-cycle limits are workflow instructions, not new host-enforced configuration. Do not infer a process limit or permission boundary from them.
- Independent review reduces shared blind spots; different model families and passing tests do not prove absence of defects.
- Generated configuration, host discovery, real child execution, model availability, and project acceptance are different validation levels. Do not present one as another.
- The model check reads the host config on disk; the host uses the configuration it loaded at start-up or the last
/reload. - Keep the package installed while agents use it. Removing it does not cancel an active child.
Maintenance and static validation commands are in AGENTS.md.
Removal
- Finish or cancel active suite tasks using the host tools; do not close their panes as a substitute for confirmed cancellation.
- Remove the package:
pi remove npm:@rifle-donkey/pi-dev-kit. - Remove the Development suite coordination entry from the global agent context through project-docs.
- Review the project-specific Development suite adaptation section. Remove suite-specific references or revoke its durable E2E grant only deliberately; preserve pre-existing project rules and other sections. The grant remains effective if its text is left in place.
- Run
/reloador restart Pi. Delete your own model file (~/.pi/agent/dev-kit/models.json) and the usage history (~/.pi/agent/dev-kit/usage/) only if you do not plan to reinstall; removing or downgrading the package leaves them in place. Do not remove pi-herdr-agents, pi-project-docs, credentials, or retained worktrees merely to uninstall this suite.
License
MIT; see LICENSE. The planning workflow adapts mattpocock-skills grilling, to-spec, and DESIGN-IT-TWICE (MIT).